Skip to content

Migrate site to Next.js 16 (App Router on OpenNext/Cloudflare) - #12

Draft
seokju-na wants to merge 13 commits into
mainfrom
nextjs-migration
Draft

seokju-na wants to merge 13 commits into
mainfrom
nextjs-migration

Conversation

@seokju-na

@seokju-na seokju-na commented Jul 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Migrates the website from TanStack Start + Vite to Next.js 16 (App Router), deployed via @opennextjs/cloudflare (workerd). The old src/ app, Vite config, and TanStack/Vite dependencies are removed.

Note: this branch also carries the earlier docs content work (KO translations, frontend/native guides, references cleanup) that was already committed on it.

Migration

  • Routing / i18n — app/[lang]/… with fumadocs i18n middleware (hideLocale: 'default-locale' → English at unprefixed URLs, Korean under /ko). Pure locale helpers live in lib/i18n.ts (server+client safe); React context in lib/locale.tsx.
  • UI — landing, docs (notebook layout), and 404 ported from src/layouts/** to components/** (client components where interactive).
  • Changelog — rendered as an async Server Component (app/[lang]/docs/changelog), fetching GitHub releases server-side (replaces the old createServerFn).
  • Search API — moved to a Next Route Handler (app/api/search).
  • Middleware — fumadocs i18n + Cloudflare Access (guarded to *.workers.dev previews, wrapped so it can't break i18n routing).

Follow-up polish (in this branch)

  • Last-updated — git commit time shown on docs pages via PageLastUpdate.
  • Error screens + Sentry — localized error.tsx / global-error.tsx (components/ErrorScreen.tsx) that call Sentry.captureException; client Sentry init in instrumentation-client.ts (no-op unless NEXT_PUBLIC_SENTRY_DSN is set).
  • Favicon — from the wvb logo (app/icon.png 256×256, app/apple-icon.png 180×180).
  • garu removed — dropped the garu-ko Korean WASM tokenizer + inlined model. Korean search now uses a lightweight eojeol tokenizer (lowercase + split on whitespace/punctuation, keeps Hangul) — no WASM, no extra deps.
  • Cleanup — removed all remaining TanStack/Vite code, config, and deps.

Notable decisions

  • Docs catch-all is force-dynamic. With no OpenNext incremental cache configured, serving a prerendered page through the default-locale rewrite (/docs/* → /en/docs/*) hangs. SSR is fast (MDX is bundled). SSG can be restored later by configuring an incremental cache in open-next.config.ts.
  • No server-side Sentry wired (workerd needs @sentry/cloudflare); client capture only.

Verification

next build (Turbopack) + opennextjs-cloudflare build green, oxlint + tsc pass. Smoke-tested on the workerd preview (yarn preview): home / docs / changelog / search (EN + KO) / 404 / error screen / last-updated / favicon all confirmed.

Caveats

  • Search does not work under next dev (Turbopack) — use yarn preview to test it locally on workerd.
  • Next 16 warns to rename middleware.ts → proxy.ts (deprecation warning only; works as-is).

🤖 Generated with Claude Code

https://claude.ai/code/session_01AFm8T7PNfkxNcN9yFTCe8J


Summary by cubic

Migrated the site from TanStack Start + Vite to Next.js 16 App Router on Cloudflare (@opennextjs/cloudflare), with bilingual i18n routing, SSR docs/changelog, localized error handling with @sentry/nextjs, and a CI link validator to prevent broken /docs routes and anchors.

  • Migration

    • App Router with app/[lang] and fumadocs i18n: EN unprefixed, KO at /ko; locale helpers and context split for server/client.
    • Middleware: fumadocs i18n rewrite and Cloudflare Access for *.workers.dev previews.
    • Docs: SSR via force-dynamic with notebook layout, mobile TOC, and “Last updated” timestamp; redirects /docs and /docs/guide to the first Guide page.
    • Changelog: async Server Component fetching GitHub releases; standalone shell without the docs sidebar.
    • Search API: Next Route Handler, forced Node runtime; Korean uses a lightweight tokenizer (no WASM) instead of garu-ko.
    • Errors: per-locale error boundaries (error.tsx, global-error.tsx) with client @sentry/nextjs; localized 404.
    • UI: landing and header components ported; favicon and apple icon added.
    • CI: adds yarn check:links (via next-validate-link) job to block bad /docs URLs and #anchors.
    • Notes: search doesn’t run under next dev (use yarn preview); Next 16 warns to rename middleware.ts → proxy.ts.
  • Dependencies

    • Added next@16, @opennextjs/cloudflare, fumadocs-*, @sentry/nextjs, @tailwindcss/postcss.
    • Removed TanStack Start, Vite tooling, and garu-ko.
    • Added open-next.config.ts, updated wrangler.jsonc for .open-next output, and a link-check script (scripts/validate-links.ts).

Written for commit 561b726. Summary will update on new commits.

Review in cubic

seokju-na and others added 10 commits July 4, 2026 22:41
Fill the previously-stubbed practical guides under content/docs/guide,
in English and Korean:
- frontend: packing, development, upload, deploy, and bridges/{index,
  checking-sources, update-remote-bundles, testing}
- native: {electron,tauri,android,ios,deno}/{local-development,builtin},
  plus tauri/mobile and deno/building

Fix broken internal /docs links across the docs so none 404:
- concept short-forms -> /docs/guide/core-concepts/*
- getting-started/platform-support -> platform-and-framework-support
- /docs/guide/spec/* -> /docs/guide/remote/http-spec/*
- /docs/guide/providers/* -> /docs/guide/remote/providers/*
- /docs/guide/bundle-format -> /docs/guide/core-concepts/webview-bundle

Correct bundleProtocol('app') usage in the Deno setup pages.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSyTK87Kia293eVqtbeken
- Translate the remaining English section headings in the Korean docs to
  Korean, keeping code identifiers, @wvb/* package names, and proper nouns;
  fix in-page anchors that pointed at translated headings.
- Remove the "Next steps" / "다음 단계" navigation section from every guide
  and reference page (English and Korean), keeping the two locales in
  structural lockstep.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSyTK87Kia293eVqtbeken
…penNext/Cloudflare)

Replace the TanStack Start + Vite app with a Next.js 16 App Router site
deployed via @opennextjs/cloudflare (workerd).

- app/[lang] structure with fumadocs i18n (en unprefixed, ko under /ko)
- landing, docs, and 404 ported to components/ (client where interactive)
- changelog rendered as an async Server Component (GitHub releases)
- search API moved to a Next route handler (app/api/search)
- i18n + Cloudflare Access middleware
- last-updated (git commit time) shown on docs pages
- localized error screens (error.tsx / global-error.tsx) with Sentry capture
- favicon from the wvb logo (app/icon.png, app/apple-icon.png)
- drop the garu-ko Korean WASM tokenizer/model; ko search now uses a
  lightweight eojeol tokenizer (no WASM, no extra deps)
- remove all remaining TanStack/Vite code, config, and dependencies

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFm8T7PNfkxNcN9yFTCe8J
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
webview-bundle-website 561b726 Jul 06 2026, 03:31 PM

seokju-na and others added 3 commits July 7, 2026 00:12
The migration commit didn't run the formatter; oxfmt normalizes import
ordering and line wrapping so the `format` CI check passes. No behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFm8T7PNfkxNcN9yFTCe8J
Add `yarn check:links` (scripts/validate-links.ts) and a CI job so a broken or
orphan link — a `/docs/...` page or `#anchor` that doesn't exist, including
`<Card href>` targets — fails the build instead of shipping.

Handles the i18n setup (hideLocale: 'default-locale'): content links are
un-prefixed and validated against the un-prefixed URL space, with Korean pages
also contributing their `/ko/...` URLs and both locales' heading anchors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFm8T7PNfkxNcN9yFTCe8J
main advanced only via PR #11 (the same `newdoc` docs work this branch is built
on) plus a WORKS.md update — it made no code or content changes this branch
doesn't already contain. Resolved by keeping the migration (ours) for all code,
config, and docs content, dropping the old `src/` TanStack app, and taking
main's WORKS.md.

Verified: `next build` green, `yarn check:links`, lint, and format all pass;
`yarn install --immutable` in sync.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFm8T7PNfkxNcN9yFTCe8J
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant