You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: support client-only SPA recovery builds - #161
Adds the narrow stripServerOnlyRouteExportsInSpa plugin option for client-only recovery artifacts built from route sources that are normally shared with SSR.
Dependency and review scope
This PR depends on #160 (f4db610). It targets main only so the repository's pkg-pr-new workflow publishes a combined preview package for TTArch integration. Do not merge this PR before #160. The SPA recovery feature is the top commit, 79fe88c; review that commit for this PR's independent implementation. After #160 lands, this branch can be rebased so the final diff contains only the SPA recovery change.
Supported behavior
When explicitly enabled for plain SPA mode (ssr: false with no prerender paths), the plugin:
validates that every source loader, action, or middleware has an explicit clientLoader, clientAction, or clientMiddleware
strips loader, action, middleware, and headers from browser and build-time server route modules
preserves explicit client exports and the root HydrateFallback
removes server loader/action flags and exports from generated browser/server manifest metadata
retains the existing non-root HydrateFallback validation
The default remains unchanged. The option does not apply to ssr: false prerender builds and is rejected in RSC mode. It does not synthesize serverLoader, convert server behavior to client behavior, emit an SSR snapshot, or allow a second router runtime.
source server exports throw if invoked and their markers are absent from all emitted JS
direct deep-route static fallback
offline client navigation
explicit clientLoader and clientAction
manifest hasLoader/hasAction false with client flags true
zero .data/.rsc responses and zero browser errors
pnpm build
pnpm test:package-interop
A full pnpm test run reached 848 passing tests but hit 13 unrelated route-imports.test.ts resource-identity failures and one pre-existing stale benchmark temp-fixture resolution error. The focused affected suites pass.
Temporarily closing and reopening to deliver a qualifying pull-request lifecycle event to pkg-pr-new; this PR was originally opened against a base excluded by the preview workflow. No code or merge state is changing.
System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.
Closing: the Remix 2 / React Router 6 support for TTArk will live as a TTArk-owned package in its monorepo instead of in this plugin. Keeping the branch for reference.
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
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.
Summary
Adds the narrow
stripServerOnlyRouteExportsInSpaplugin option for client-only recovery artifacts built from route sources that are normally shared with SSR.Dependency and review scope
This PR depends on #160 (
f4db610). It targetsmainonly so the repository'spkg-pr-newworkflow publishes a combined preview package for TTArch integration. Do not merge this PR before #160. The SPA recovery feature is the top commit,79fe88c; review that commit for this PR's independent implementation. After #160 lands, this branch can be rebased so the final diff contains only the SPA recovery change.Supported behavior
When explicitly enabled for plain SPA mode (
ssr: falsewith no prerender paths), the plugin:loader,action, ormiddlewarehas an explicitclientLoader,clientAction, orclientMiddlewareloader,action,middleware, andheadersfrom browser and build-time server route modulesHydrateFallbackHydrateFallbackvalidationThe default remains unchanged. The option does not apply to
ssr: falseprerender builds and is rejected in RSC mode. It does not synthesizeserverLoader, convert server behavior to client behavior, emit an SSR snapshot, or allow a second router runtime.Verification
pnpm typecheckclientLoaderandclientActionhasLoader/hasActionfalse with client flags true.data/.rscresponses and zero browser errorspnpm buildpnpm test:package-interopA full
pnpm testrun reached 848 passing tests but hit 13 unrelatedroute-imports.test.tsresource-identity failures and one pre-existing stale benchmark temp-fixture resolution error. The focused affected suites pass.