Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce <RSCImage /> component #95

Merged
merged 2 commits into from
Apr 2, 2024
Merged

Introduce <RSCImage /> component #95

merged 2 commits into from
Apr 2, 2024

Conversation

stefanoverna
Copy link
Member

@stefanoverna stefanoverna commented Apr 1, 2024

Now that both loading=lazy and aspect-ratio are broadly supported (> 93% of browsers) we can avoid complex JS to achieve lazy-loaded images with placeholders!

The new <RSCImage /> is a React Server Component that generates a single <picture /> element and utilizes the browser's native loading="lazy".


All the examples have been consolidated into a single SPA React application to ensure a straightforward maintenance process: https://deploy-preview-95--react-datocms-example.netlify.app/

@stefanoverna stefanoverna changed the title Native image Simplify <Image /> component Apr 1, 2024
@stefanoverna stefanoverna force-pushed the native-image branch 4 times, most recently from 44c2652 to 1f0736a Compare April 1, 2024 11:53
@datocms datocms deleted a comment from netlify bot Apr 1, 2024
@stefanoverna stefanoverna force-pushed the native-image branch 4 times, most recently from d8f0112 to c5b0752 Compare April 2, 2024 11:46
@stefanoverna stefanoverna changed the title Simplify <Image /> component Introduce <NativeImage /> component Apr 2, 2024
@stefanoverna stefanoverna force-pushed the native-image branch 4 times, most recently from 67f9f54 to b20f441 Compare April 2, 2024 12:46
@stefanoverna stefanoverna changed the title Introduce <NativeImage /> component Introduce <RSCImage /> component Apr 2, 2024
@stefanoverna stefanoverna merged commit ee96715 into master Apr 2, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant