-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Lazy Loaded Route Modules #10045
Lazy Loaded Route Modules #10045
Conversation
🦋 Changeset detectedLatest commit: 2560422 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
5ed0e9e
to
8d4870a
Compare
8d4870a
to
36975ff
Compare
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
Co-authored-by: Mark Dalgleish <[email protected]>
This is released in |
How do you put a Suspense fallback for a lazy loaded route component? |
That's not quite the "idiomatic" use case since the idea of |
Add support for a
route.lazy
method to lazily load the "meat" of a route while still providing the "matching" information up front. This injects thelazy()
call into the normalloading
/submitting
navigation flow internal to the router so we can provide first-class support for route-level code splitting. This ends up being cleaner/easier than doing it in user-land for a few reasons:AbortSignal
in case thelazy()
call gets interruptedroute
so subsequent navigations don't have a repeatedlazy()
callerrorElement
exists since we will have updated the route prior to updating any UI stateExample
Todo
Built-in Remix-style export mapping (default export -> element
,ErrorBoundary -> errorElement
)Reference Links
createModuleRoutes
utility function #9830