Skip to content

Split unstable_clientMiddleware export into its own chunk#12961

Closed
markdalgleish wants to merge 36 commits into
devfrom
markdalgleish/client-middleware-chunk
Closed

Split unstable_clientMiddleware export into its own chunk#12961
markdalgleish wants to merge 36 commits into
devfrom
markdalgleish/client-middleware-chunk

Conversation

@markdalgleish

Copy link
Copy Markdown
Member

Note, this PR is targeting the brophdawg11/feat-middleware branch.

Luckily this turned out to be fairly straightforward. The route manifest now has hasClientMiddleware and clientMiddlewareModule fields. It follows the same pattern as clientLoader/clientAction/HydrateFallback where the manifest allows you to dynamically load the unstable_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 the future.unstable_splitRouteModules flag, so it might be a good idea to encourage turning this flag on when using client middleware given the performance implications.

@changeset-bot

changeset-bot Bot commented Feb 6, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6a4b923

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Base automatically changed from brophdawg11/feat-middleware to dev March 4, 2025 15:24
@markdalgleish markdalgleish deleted the markdalgleish/client-middleware-chunk branch August 29, 2025 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants