fix: disable lazy hydration when not using lazy-loading to avoid binary-size cost #4438
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#3988 (included in 0.8.5) introduced support for async hydration to support hydrating routes that included lazy-loaded WASM. However, this accidentally meant duplicating the hydration code for all
AnyViewtypes, which bloats the WASM binary size for all applications, including those not using lazy-loading.This can be resolved by:
hydrate_asyncfor applications that don't activate alazyfeaturehydratefor applications that do use itHowever, requiring a
lazyfeature is a breaking change. In the meantime, I'd encourage people to try out this PR as a smallish patch, to see if it resolves the binary-size increase.