-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Split unstable_clientMiddleware
export into its own chunk
#12961
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
Conversation
|
Co-authored-by: Mark Dalgleish <mark.john.dalgleish@gmail.com> Co-authored-by: Steven Liao <114700648+steven-liao-rs@users.noreply.github.com>
Note, this PR is targeting the
brophdawg11/feat-middleware
branch.Luckily this turned out to be fairly straightforward. The route manifest now has
hasClientMiddleware
andclientMiddlewareModule
fields. It follows the same pattern asclientLoader
/clientAction
/HydrateFallback
where the manifest allows you to dynamically load theunstable_clientMiddleware
export if it's in its own chunk, otherwise you can fall back to loading it from the main route module. Note that this behaviour is also guarded behind thefuture.unstable_splitRouteModules
flag, so it might be a good idea to encourage turning this flag on when using client middleware given the performance implications.