-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Disable FOW for all ssr:false and tighten up spa mode logic #12894
base: dev
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: f99370d The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 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 |
@@ -1402,7 +1401,7 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = () => { | |||
let route = getRoute(ctx.reactRouterConfig, id); | |||
if (!route) return; | |||
|
|||
if (!options?.ssr && !ctx.reactRouterConfig.ssr) { | |||
if (!options?.ssr && isSpaModeEnabled(ctx.reactRouterConfig)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only reject server-only exports in true SPA mode
reactRouterConfig.prerender.length === 1 && | ||
reactRouterConfig.prerender[0] === "/")) | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the proper detection, the old buggy one was simply:
!ctx.reactRouterConfig.ssr && ctx.reactRouterConfig.prerender == null
@@ -1908,13 +1920,6 @@ async function handlePrerender( | |||
); | |||
} | |||
} | |||
|
|||
await prerenderManifest( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never need to prerender a manifest anymore
ssr: true
will handle the manifest via the server handlerssr: false
will not have fog of war enabled
export function isFogOfWarEnabled(isSpaMode: boolean) { | ||
return !isSpaMode; | ||
export function isFogOfWarEnabled(ssr: boolean) { | ||
return ssr === true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only enable fog of war for ssr:true
apps
Fixes a few
ssr
/prerender
bugs found during testing:ssr: false
apps so we don't make any assumptions about the static file server's ability to serve__manifest
and deal with search paramsprerender
- this has been fixed up so that SPA mode is now properly detected asssr:false
and prerendeing the root route (/
) and nothing elsessr: false
and a more advanced prerender config is for advanced use cases - this unlocks the ability to run loaders during the build as well as render down past the rot route for prerendered pages