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

Replaced third-party lazy-loading implementation with native lazy-loading for improved performance #602

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

rodriguescarson
Copy link

@rodriguescarson rodriguescarson commented Jan 11, 2025

Replaced third-party lazy-loading implementation with native lazy-loading for improved performance.

Performance Benefits:

  • Reduced JavaScript Overhead: Native lazy-loading is handled by the browser, eliminating the need for additional libraries and reducing the initial JS load.
  • Optimized by the Browser: Modern browsers automatically optimize native lazy-loading, resulting in better performance and lower memory usage.
  • Improved Initial Load: By leveraging native lazy-loading, we reduce the number of unnecessary requests, improving page load times, especially on slower connections or devices.
  • No Extra Dependencies: This change removes the need for third-party libraries like react-lazy-images or react-lazy-load-image-component, making the codebase simpler and more maintainable.

This change leverages the built-in loading="lazy" attribute in React for images, which provides a significant performance boost by deferring image loading until they're close to the viewport, optimizing the user experience on initial load.

Copy link

vercel bot commented Jan 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
react-notion-x ✅ Ready (Inspect) Visit Preview Jan 11, 2025 7:51pm
react-notion-x-minimal-demo ✅ Ready (Inspect) Visit Preview Jan 11, 2025 7:51pm

@rodriguescarson
Copy link
Author

Hello Mainter, can you let me know the problem, why the build failed?

@rodriguescarson
Copy link
Author

Replaced third-party lazy-loading implementation with native lazy-loading for improved performance.

Performance Benefits:

  • Reduced JavaScript Overhead: Native lazy-loading is handled by the browser, eliminating the need for additional libraries and reducing the initial JS load.
  • Optimized by the Browser: Modern browsers automatically optimize native lazy-loading, resulting in better performance and lower memory usage.
  • Improved Initial Load: By leveraging native lazy-loading, we reduce the number of unnecessary requests, improving page load times, especially on slower connections or devices.
  • No Extra Dependencies: This change removes the need for third-party libraries like react-lazy-images or react-lazy-load-image-component, making the codebase simpler and more maintainable.

This change leverages the built-in loading="lazy" attribute in React for images, which provides a significant performance boost by deferring image loading until they're close to the viewport, optimizing the user experience on initial load.

@rodriguescarson rodriguescarson changed the title update prettier dependecy and lint issue Replaced third-party lazy-loading implementation with native lazy-loading for improved performance Jan 12, 2025
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.

2 participants