Skip to content

chore: delete the docs and ui-website redirect-only apps - #1305

Merged
vivek7405 merged 2 commits into
mainfrom
chore/delete-redirect-only-apps
Aug 6, 2026
Merged

chore: delete the docs and ui-website redirect-only apps#1305
vivek7405 merged 2 commits into
mainfrom
chore/delete-redirect-only-apps

Conversation

@vivek7405

@vivek7405 vivek7405 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Closes #1304

Summary

docs/ and packages/ui/packages/website/ had stopped being apps. Since #1098 moved the documentation to website/app/docs and #1099 moved the component gallery to website/app/ui, each was one middleware.ts returning a 301 plus a stub page, carried as a full npm workspace, a Railway service, a Dockerfile stage and a compose service. Two Cloudflare Redirect Rules on the webjs.dev zone do that work at the edge now, so neither host needs an origin at all.

The rules were deployed and verified BEFORE anything was deleted. Redirect Rules fire in the request phase, before Cloudflare fetches the origin, so they took over while Railway was still serving:

URL Location x-railway-request-id
docs.webjs.dev/ https://webjs.dev/docs absent
docs.webjs.dev/docs/routing https://webjs.dev/docs absent
ui.webjs.dev/ https://webjs.dev/ui absent
ui.webjs.dev/docs https://webjs.dev/ui absent
ui.webjs.dev/docs/components/button https://webjs.dev/ui absent
ui.webjs.dev/registry/button.json https://webjs.dev/ui absent
ui.webjs.dev/public/og.png https://webjs.dev/ui absent

The absent header is the load-bearing part: Cloudflare answers and never contacts Railway, so removing the services changes nothing about what those hosts serve.

What this gives up, deliberately

The rules are a downgrade from the middleware they replace. The middleware was path-aware; the rules collapse each host onto its hub page. That was measured rather than assumed: no third-party page links to either host, both Railway services show no recent HTTP traffic, neither subdomain is in the 139-URL sitemap, and the destinations (43 /docs URLs, 33 /ui URLs) are already canonicalised and indexed. There is no ranking signal left to lose.

Two consequences, both accepted:

  • ui.webjs.dev/registry/<name>.json now redirects to an HTML page. Published @webjsdev/ui 0.3.1 through 0.3.8 hard-code that URL (confirmed by unpacking the 0.3.5 tarball) and will fetch HTML then fail to parse it as JSON. 0.3.9+ resolves local-first (ui: local-first registry, on-demand example delivery, MCP ui tool #983) and is unaffected.
  • Old asset URLs (ui.webjs.dev/public/og.png, referenced by already-scraped social cards) now redirect to the gallery page.

Coverage gap, stated rather than papered over

test/docs/docs-host-redirect.test.mjs and test/ui/ui-host-redirect.test.mjs asserted that the redirect hosts keep resolving. That behaviour lives in Cloudflare now and CI cannot see it. I deliberately did NOT add a network test against the live zone to replace them: a CI job that reds when Cloudflare has a bad minute is worse than the gap.

The e2e suites that drove the deleted app

test/e2e/nested-layout-partial-swap.test.mjs and test/e2e/form-submission-and-race.test.mjs both booted the ui-website dev server. Rather than delete them, they move to the website gallery at /ui/<name>, which is the same nested-layout shape they were written for (same .docs-sidebar aside, same sibling-link nav). Three real adjustments, not just a path rename:

  • The scroll container is .docs-nav inside the aside, not the aside itself, so the scroll assertions moved to it.
  • The request-capture filter matched /docs/ and had to become /ui/.
  • The scroll-restoration block clicks in-page rather than through Playwright, whose click scrolls the target into view first and would move the window before the router records its position.

Both suites pass: 2/2 and 6/6 against a live website dev server.

One finding I did not chase

The scroll-restoration block now runs against /docs rather than /ui, and the reason is a real behaviour worth knowing about. The router restores window scroll correctly on /docs/*: set 800, navigate away, go back, get 800. On a /ui/<name> gallery page the same sequence reproducibly lands on 1563, stable across timings and independent of how the click is dispatched. No focused element and no scrollIntoView in the gallery shell explains it, and I stopped there because it is a live website behaviour rather than anything this change introduces, and the block asserts the router rather than the gallery. Flagging it rather than filing it.

Test plan

  • npm ci succeeds against the regenerated lockfile (validated in a clean tree)
  • test/e2e/nested-layout-partial-swap.test.mjs 2/2 against a live website dev server
  • test/e2e/form-submission-and-race.test.mjs 6/6 against a live website dev server
  • npm test: 3928 tests, 3927 pass, 1 skip, 0 fail (a first run failed test/integration/blog-http.test.mjs against an unmigrated blog DB, the documented environment requirement; 12/12 after db:migrate + db:seed)
  • Docker build succeeds (docker build -t webjs-delete-check ., exit 0), which is the check that matters here since a COPY of a missing source is a hard Docker error invisible to every in-process test
  • webjs check passes on examples/blog and website; webjs doctor 0 failed on both (10 passed / 2 warn, and 9 passed / 3 warn)
  • Website boot-check clean: /, /docs/no-build, /docs/components, /ui, /ui/button all 200, /ui/button with 50 modulepreloads and none broken
  • Website's own suite: 443/443 node, 84/84 browser across 8 files

Doc surfaces

A review round caught that the first commit updated the surfaces naming the deleted DIRECTORIES but not the ones making claims about the HOSTS, and two of those claims were in published source. Corrected in the second commit.

  • Updated, directories: AGENTS.md (the doctor gate now names two apps), framework-dev.md, README.md (repo tree, ports table, dev commands), website/AGENTS.md, .claude/skills/webjs-start-work/SKILL.md, .claude/hooks/route-skills.sh, .claude/hooks/require-docs-with-src.sh
  • Updated, false claims about the hosts: packages/ui/src/registry/fetcher.js and packages/ui/packages/registry/README.md both said the old ui.webjs.dev/registry URLs still resolve to their new equivalents, which is exactly what this change stops; packages/ui/test/fetcher.test.js pointed at a mapping test deleted here; README.md said docs.webjs.dev redirects path-preservingly; packages/ui/AGENTS.md listed the deleted workspace and an npm run ui:dev script that would now fail; packages/cli/AGENTS.md counted four apps behind the doctor gate; plus stale comments in purge-cdn.yml, generate-favicon.mjs, site-seo-tags.test.mjs and the Dockerfile header
  • Updated, docs site: website/app/docs/architecture/page.ts, whose repo tree still listed docs/. My earlier "docs site N/A" was wrong
  • New: framework-dev.md gains the only in-repo record of the two Cloudflare rules: what they match, where they send, why they are static rather than path-preserving, why they can never be removed, and a manual verification command. The deleted middleware carried that and nothing replaced it
  • N/A: the scaffold templates, the MCP server, and the editor plugins. This removes two in-repo hosts and changes no framework surface.

Both apps had stopped being apps. Since #1098 moved the documentation to
website/app/docs and #1099 moved the component gallery to website/app/ui,
each was one middleware.ts returning a 301 plus a stub page, carried as a
full npm workspace, a Railway service, a Dockerfile stage and a compose
service.

Two Cloudflare Redirect Rules on the webjs.dev zone do that work at the
edge now, so neither host needs an origin at all. Verified before removing
anything: every probed URL on both hosts redirects, and no response carries
x-railway-request-id, so Cloudflare answers and never contacts Railway.

The rules are a deliberate downgrade from the middleware they replace. The
middleware was path-aware; the rules collapse each host onto its hub page.
That was measured rather than assumed: no third-party page links to either
host, both Railway services show no recent HTTP traffic, neither subdomain
is in the sitemap, and the destinations are already canonicalised and
indexed, so there is no ranking signal left to lose.

The two e2e suites that drove the ui-website dev server move to the website
gallery at /ui/<name>, which is the same nested-layout shape they were
written for. The one exception is the scroll-restoration block, which now
runs against /docs: the router restores window scroll correctly there, but
on a /ui/<name> page it reproducibly lands on 1563 instead of the 800 it
was given. That is a live website behaviour rather than anything this
change introduces, and the block asserts the router, not the gallery.
@vivek7405 vivek7405 self-assigned this Aug 6, 2026
The deletion left a set of claims behind that are now false rather than
merely stale, and two of them sit in published source: the ui fetcher's
doc block and the registry README both stated that the old
ui.webjs.dev/registry URLs still resolve to their new equivalents. They
redirect to the gallery page instead, so a fetch gets HTML, which is
exactly the 0.3.1 through 0.3.8 break this change accepts. Both now say
so, as does the fetcher test that pointed at a mapping test deleted here.

framework-dev.md gains the only in-repo record of what the two Cloudflare
rules match and where they send. The deleted middleware files carried that
plus the reason the hosts can never be retired, and nothing replaced it, so
a future edit to the zone had nothing to restore from.

The rest is reference drift: packages/ui/AGENTS.md still listed the deleted
workspace and an `npm run ui:dev` script that no longer exists,
packages/cli/AGENTS.md still counted four apps behind the doctor gate, and
the docs site's own architecture tree still showed docs/.

@vivek7405 vivek7405 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Went through the whole diff against the live zone rather than just the hunks, and the deletion side is solid: the Dockerfile COPY set, compose, the workspace/lockfile pair, the boot-check and preload lists, and the .docs-sidebar / .docs-nav selectors the moved e2e suites depend on all line up.

What it missed is the other half of a deletion like this: the claims left behind elsewhere. A dozen places still describe these hosts as live, path-preserving, or registry-serving, and two of them are in PUBLISHED source rather than docs. packages/ui/src/registry/fetcher.js tells a reader the old registry URL still works and must keep working forever, which is the stated rationale for the local-first design sitting right under it. It does not work any more, and this change is what stopped it. Same claim in the registry README, and the fetcher test points at a mapping test this PR deletes.

The one I care about most is that nothing in the repo records what the two Cloudflare rules actually are. The deleted middleware files carried the mapping tables AND the reason these hosts can never be retired. Both are gone and framework-dev.md only says they serve no assets, so the next person to touch the zone has nothing to restore from.

Everything here is a text fix, so I have taken all of it.

@vivek7405

Copy link
Copy Markdown
Collaborator Author

Review resolutions: every finding taken, one deliberately left as is

All the findings sat on lines this PR had not touched, so they went in the summary rather than as inline anchors. Fixed in f850526d:

Where Was Now
packages/ui/src/registry/fetcher.js old registry URL "still works and must keep working forever" says it redirects to HTML and names the 0.3.1-0.3.8 break
packages/ui/packages/registry/README.md same claim same correction
packages/ui/test/fetcher.test.js pointed at test/ui/ui-host-redirect.test.mjs says nothing asserts that side any more, and why
README.md "path-preservingly redirects here" says it sends everything to the hub page
README.md "the two redirect hosts read SITE_URL" dropped, nothing reads it
website/app/docs/architecture/page.ts repo tree listed docs/ website row now carries /docs and /ui
packages/ui/AGENTS.md listed the deleted workspace + npm run ui:dev both gone (that script would now fail)
packages/cli/AGENTS.md doctor "over the four in-repo apps" both
.claude/skills/webjs-start-work/SKILL.md example report cited the deleted mapping tests dropped
.github/workflows/purge-cdn.yml, scripts/generate-favicon.mjs, test/repo-health/site-seo-tags.test.mjs, Dockerfile described the hosts as live apps described as Cloudflare rules

The one worth calling out separately is that nothing recorded what the two rules actually are. The deleted middleware carried the mapping tables and the reason these hosts can never be retired, and losing both was a real gap rather than drift. framework-dev.md now carries the rule table, the reason the static-vs-path-preserving trade was made, the live webjsui add consequence, and the manual verification command, under its own heading.

Left as is: the scroll-restoration block running against /docs rather than /ui. The finding is fair that a suite reporting green over a reproducible failure is worth flagging, but the block asserts the client router, not the gallery, and /docs exercises that router honestly. The /ui behaviour is recorded in an inline comment at the block itself, not only in this description, so it is discoverable from the code. Whether it becomes tracked work is the owner's call.

@vivek7405
vivek7405 marked this pull request as ready for review August 6, 2026 13:45
@vivek7405
vivek7405 merged commit ddfc554 into main Aug 6, 2026
10 checks passed
@vivek7405
vivek7405 deleted the chore/delete-redirect-only-apps branch August 6, 2026 14:17
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.

chore: delete the docs and ui-website redirect-only apps

1 participant