Repository navigation
fix: review corrections before 1.6.0 - #26
Merged
Merged
Conversation
- ssr: web only, and only for the first hydration -- a module-level flag lets providers mounted later render the real window immediately, and native ignores ssr. StrictMode-safe. In production an invalid ssr flag is dropped while the rest of the config is kept. - Contexts are realm-wide singletons (Symbol.for on globalThis), so MockWindowProvider and ResponsiveProvider work when an app loads both the ESM and CommonJS builds. - removeOrientationListener regains its @deprecated JSDoc in the .d.ts; the legacy removeEventListener is called as a method again. - Docs: ssr scope and nesting, MockWindowProvider limits, CHANGELOG.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes from an independent review of the unreleased 1.6.0 batch (#22, #23, #24).
Summary
ssrflashedinitialWindowon later mounts and on native:hasHydratedflag, set in the firstssrprovider's effect, means providers mounted afterwards (screens, modals, client-side navigation) render the real window at once. Effects never run on the server.ssris ignored whenPlatform.OS !== 'web', so one Expo Router root layout can enable it safely.ResponsiveProvider's andMockWindowProvider's contexts are now realm-wide singletons (Symbol.foronglobalThis). Before, an app that loaded both the ESM and CJS builds (for example a CJS dependency plus an ESM story) got two contexts, and the override silently did nothing. This is written without??=for older Babel presets.@deprecatedrestored:removeOrientationListenerregains its tag in the published.d.ts. The legacyremoveEventListeneris called as a method again, which keepsthisbound.ssrwithoutinitialWindownow drops only thessrflag and keeps the rest of the config, instead of discarding everything.ssrscope (web, first hydration, hook output only, nested providers must repeat it) andMockWindowProviderlimits.Test plan
npm test: 140/140, 100% coverage. New tests cover a late-mounted provider, native being ignored, StrictMode, the prodssr-only fallback, and a shared context across isolated module copies.npm run lint,typecheck,build; the.d.tsshows@deprecatedagain