feat(website): TanStack Router as a live go-web example + in-card web bridge - #17
Open
Huxpro wants to merge 1 commit into
Open
feat(website): TanStack Router as a live go-web example + in-card web bridge#17Huxpro wants to merge 1 commit into
Huxpro wants to merge 1 commit into
Conversation
… bridge Surface the MPA demo on the website as a live <Go> example, and make cross-page navigation render in the browser preview. - lynx.web.config.ts: a website-only build that emits *.web.bundle (in-browser preview) and *.lynx.bundle (QR / on-device), points assetPrefix at the deployed examples path, and writes to dist-web/ so the native dist/ is safe. - src/web-nav/setup.ts (native no-op) + setup.web.ts (web): a go-web card renders one bundle and cannot swap to another native page, so the web variant registers the sparkling router.open/close web methods and points their host at THIS card, rendering the cross-page destination in-page (the bundle carries the whole route tree). Selected via the React-Native-style `.web.ts` extension. - website/scripts/prepare-examples.mjs: build the demo's workspace deps before its web bundle (their dist/ is gitignored) so the example builds on a fresh Vercel checkout; register the explicit spike/home entries. - rspress.config.ts + docs/guide/examples*: add the example to the Examples sidebar/overview and an example page with two <Go> embeds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H1EU55YA4e1zj2oVHh7Zme
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Stacked PR 4/5 (base:
tsr-03-mpa-codegen). Surfaces the MPA demo on the website as a live<Go>example, and makes cross-page navigation render in the browser preview.📚 Stack (review bottom → top)
tsr-01-sparkling-history— router-agnostic web-history shimtsr-02-reactlynx-spike— prove TanStack Router runs on ReactLynxtsr-03-mpa-codegen— file-based routing + native MPA + codegentsr-04-website-goweb— go-web example + in-card web bridge (this PR)tsr-05-docs-guide— design guide + support matrix + RN comparisonRelated issues
Standalone. Depends on PRs 1–3.
Changes
lynx.web.config.ts: a website-only build emitting*.web.bundle(in-browser preview) and*.lynx.bundle(QR / on-device); pointsassetPrefixat the deployed examples path; writes todist-web/so the nativedist/is safe.src/web-nav/setup.ts(native no-op) +setup.web.ts(web): a go-web card renders one bundle and can't swap to another native page, so the web variant registers the sparklingrouter.open/closeweb methods and points their host at THIS card — rendering the cross-page destination in-page (the bundle carries the whole route tree). Selected via the React-Native-style.web.tsextension.website/scripts/prepare-examples.mjs: build the demo's workspace deps before its web bundle (theirdist/is gitignored) so the example builds on a fresh Vercel checkout; register the explicitspike/homeentries.rspress.config.ts+docs/guide/examples*: add the example to the Examples sidebar/overview and an example page with two<Go>embeds.How to test
pnpm --filter tanstack-router-demo build:web # builds workspace deps, then spike/home .web.bundleThen locally:
pnpm -C packages/website devand open/guide/examples/tanstack-router— tap Detail tiktok#42 → to see the cross-page route render in-card.Checklist
build:web; verified live in the<Go>preview)🤖 Generated with Claude Code
https://claude.ai/code/session_01H1EU55YA4e1zj2oVHh7Zme
Generated by Claude Code