Skip to content

fix(www): reverse proxy /tanstack/* to v1 preview during alpha - #1812

Open
yamcodes wants to merge 4 commits into
devfrom
proxy_tanstack_addon_to_v1
Open

fix(www): reverse proxy /tanstack/* to v1 preview during alpha#1812
yamcodes wants to merge 4 commits into
devfrom
proxy_tanstack_addon_to_v1

Conversation

@yamcodes

@yamcodes yamcodes commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

This PR adds a reverse proxy rewrite in apps/www/next.config.ts routing /tanstack/:path* requests to https://arkenv-v1.vercel.app/tanstack/:path*.

Why

The official TanStack CLI add-on for ArkEnv is deployed on the v1 branch at https://arkenv-v1.vercel.app/tanstack/info.json. Because production docs (https://arkenv.js.org) are deployed from main (which flows from dev), this rewrite allows https://arkenv.js.org/tanstack/info.json to resolve immediately during the alpha prerelease phase without URL rot or waiting for the full v1 merge.

Once merged to dev, this change can be synced directly to main via sync-main.yml (Category 1 doc/infra sync).

Blocks / Relates to: #1811 (feat: add official TanStack CLI add-on for ArkEnv)

@changeset-bot

changeset-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e37d48d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added the www Improvements or additions to arkenv.js.org label Sep 5, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — two rough edges worth a look.

Reviewed changes

  • Added a production rewrite in apps/www/next.config.ts proxying /tanstack/:path* to https://arkenv-v1.vercel.app/tanstack/:path*, so the TanStack CLI add-on manifest from #1811 resolves on arkenv.js.org during the v1 alpha.

ℹ️ Sequencing — the proxy only starts resolving once #1811 lands on v1

https://arkenv-v1.vercel.app/tanstack/info.json returns 404 today (verified), so this rewrite only serves content after #1811 merges into v1 and the branch redeploys — and it only reaches production after this PR is synced to main. The "resolves immediately" goal therefore has a timing gap. Both PRs already note the interlock, so this is just a reminder to confirm the deploy ordering lands in sequence: nothing here fails loudly if the v1 deploy slips.

Technical details
# Sequencing dependency

## Affected sites
- `apps/www/next.config.ts:85-88` — the `/tanstack/*` rewrite
- #1811 (base `v1`) — supplies `apps/www/public/tanstack/info.json` on the v1 branch

## Required outcome
- Confirm that `arkenv-v1.vercel.app/tanstack/info.json` returns 200 (not 404) before this rewrite is considered functional, i.e. after #1811 merges to `v1` and the branch alias redeploys.
- Consider a one-time manual check post-deploy (e.g. `curl https://arkenv.js.org/tanstack/info.json`) since there is no automated assertion covering the end-to-end path.

ℹ️ Removal/tracking — nothing marks this rewrite as temporary

Once the full v1 merge lands, this proxy should be deleted — but nothing in the repo flags that. If it survives, arkenv.js.org/tanstack/* stays pinned to the transient arkenv-v1.vercel.app alias and the rewrite would shadow any native /tanstack page routes that later land on main (only static files under public/ would win over it). Suggest adding an explicit removal TODO keyed to the v1 merge, or gating the rewrite behind an env flag so it can be switched off in one change.

Technical details
# Temporary-marking / teardown

## Affected sites
- `apps/www/next.config.ts:82-88`

## Required outcome
- Make the temporary scope of this rewrite discoverable (comment naming the v1-merge as the removal milestone, and/or an env-flag gate).
- Ensure the rewrite is removed when the TanStack add-on content ships natively on `main`, preventing indefinite coupling of production `arkenv.js.org` to a deployment alias that may later be decommissioned.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread apps/www/next.config.ts
@yamcodes

yamcodes commented Sep 5, 2026

Copy link
Copy Markdown
Owner Author

Review Comments Addressed

  1. Native Static Bundles (apps/www/public/tanstack/):

    • Committed the compiled add-on assets directly to apps/www/public/tanstack/ (info.json, add-on.json, package.json.ejs, and assets/*).
    • Next.js serves these statically and natively before rewrites, completely eliminating preview deployment dependencies, timing gaps, and any risk of preview protection SSO redirects.
  2. Teardown & Tracking:

    • Updated the rewrite in apps/www/next.config.ts with an explicit TODO(v1-ga) comment explaining that static files take precedence and tagging the rewrite for removal once v1 merges into dev/main.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No blocking issues — prior feedback is addressed. One minor suggestion inline.

Reviewed changes

  • Committed the compiled TanStack add-on bundle (info.json / add-on.json / assets/ templates) directly into apps/www/public/tanstack/, verified byte-identical to #1811's current build output, so arkenv.js.org/tanstack/* now serves natively with zero dependency on the arkenv-v1.vercel.app alias.
  • Documented the reverse proxy as a temporary fallback with an explicit TODO(v1-ga) removal note, resolving the teardown-tracking gap.
  • Removed the static-file-precedence question: the Next.js 16 docs confirm that an un-bucketed rewrites() array is applied after the filesystem check, so the committed public/tanstack files do win over the proxy as the comment claims.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread apps/www/next.config.ts

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Pullfrog addressed all of its review feedback on this PR.

Addressed the single suggestion from review #5120259606: added a comment in apps/www/next.config.ts noting that the public/tanstack static bundles are generated by packages/tanstack-addon/scripts/build.ts (from #1811), making the re-sync obligation discoverable. Committed as e37d48d5 and pushed to proxy_tanstack_addon_to_v1; the review thread is resolved.

Task list (1/4 completed)
  • Checkout PR branch and fetch review comments
  • Address each review comment (verify findings)
  • Test changes and quality-check diff
  • Commit, push, reply to threads, and report progress

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

www Improvements or additions to arkenv.js.org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant