Skip to content

Lazy load components#73

Merged
mwarman merged 3 commits intomainfrom
69-lazy-load-components
Mar 10, 2025
Merged

Lazy load components#73
mwarman merged 3 commits intomainfrom
69-lazy-load-components

Conversation

@mwarman
Copy link
Member

@mwarman mwarman commented Mar 9, 2025

📢 Instructions

  • Begin with a DRAFT pull request.
  • Follow italicized instructions to add detail to assist the reviewers.
  • After completing all checklist items, change the pull request to READY.

🔧 Change Summary

Describe the changes included in this pull request. Link to the associated GitHub issue(s).

  • fixes Lazy load components #69
  • Updated the Router to lazy load routed components.
  • Added the LoaderSuspense which displays a loader while the lazily loaded import is resolving.
  • Add the withSuspense utility function to simplify wrapping components with the suspense loader within the router configuration.

📝 Checklist

Pull request authors must complete the following tasks before marking the PR as ready to review.

  • Complete a self-review of changes
  • Unit tests have been created or updated
  • The code is free of [new] lint errors and warnings
  • Update storybook stories as needed
  • Update project documentation as needed, README, JSDoc, etc.

🧪 Steps to Test

Describe the process to test the changes in this pull request.

  1. Complete regression test.
  2. Reload the app. In dev tools, set the network speed to "Fast 4G". Navigate through the site and notice the LoaderSuspense rendering while dynamic imports are loading. Note that the loader is displayed only the first time the import is loaded; subsequent uses of that component are rendered instantaneously.

🔗 Additional Information

Optionally, provide additional details, screenshots, or URLs that may assist the reviewer.

  • [...]

@mwarman mwarman self-assigned this Mar 9, 2025
@mwarman mwarman linked an issue Mar 9, 2025 that may be closed by this pull request
@mwarman mwarman marked this pull request as ready for review March 9, 2025 18:58
@mwarman mwarman merged commit dcfe065 into main Mar 10, 2025
5 checks passed
@mwarman mwarman deleted the 69-lazy-load-components branch March 10, 2025 10:37
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.

Lazy load components

1 participant