Skip to content

Group each repl route's files in app/routes/<name>/ - #2248

Merged
NullVoxPopuli merged 3 commits into
mainfrom
nvp/repl-route-layout
Oct 12, 2026
Merged

NullVoxPopuli merged 3 commits into
mainfrom
nvp/repl-route-layout

Conversation

@NullVoxPopuli-ai-agent

@NullVoxPopuli-ai-agent NullVoxPopuli-ai-agent commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

Ports the route folder layout from url-shortener (branch stripe) into apps/repl.

Layout

Each route lives in app/routes/<name>/:

  • +route.ts, +template.gts, and +controller.ts (only for routes with query params)
  • components, helpers, modifiers, and styles that only that route uses sit beside them, for example app/routes/edit/header.gts, app/routes/edit/save.gts, and app/routes/edit/layout/constrain-vertically.ts

app/custom-layout.ts maps those paths to the resolver keys (./routes/x, ./templates/x, ./controllers/x).

The docs routes are plain templates with nothing to co-locate, so they stay in app/templates/docs/ and the router keeps listing their lazy bundles by hand.

Other moves:

  • the application controller is app/routes/application/+controller.ts
  • import-map.ts was not a route, so it moved beside the application route that uses it
  • #edit/* now points at app/routes/edit/*
  • the is-editing, not, and stringify helpers and the positioned-n-lines-from-top modifier had no importers and are deleted

What stays in app/components/ and app/modifiers/ is shared by more than one route, or is a public name for demos (limber/components/menu).

Prerendered CSS

vite-ember-ssr keys its CSS manifest by an app/templates/<route>.gts path. With the docs templates left there, the prerendered docs pages link the same stylesheets as a clean build of main. A layout independent fix is proposed upstream in evoactivity/vite-ember-ssr#24 (issue #23).

Checks

  • pnpm lint:types passes
  • pnpm test:chrome passes (54 tests, 7 skipped)

🤖 Generated with Claude Code

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor
Project Preview URL1 Manage
Limber https://nvp-repl-route-layout.limber-glimdown.pages.dev on Cloudflare
Tutorial https://nvp-repl-route-layout.limber-glimmer-tutorial.pages.dev on Cloudflare

Logs

Footnotes

  1. if these branch preview links are not working, please check the logs for the commit-based preview link. There is a character limit of 28 for the branch subdomain, as well as some other heuristics, described here for the sake of implementation ease in deploy-preview.yml, that algo has been omitted. The URLs are logged in the wrangler output, but it's hard to get outputs from a matrix job. ↩

NullVoxPopuli and others added 3 commits October 12, 2026 18:00
Port the layout from url-shortener (branch stripe). Each route folder holds
+route.ts, +template.gts, and +controller.ts, plus the components and styles
that only that route uses. app/custom-layout.ts translates those paths to the
classic resolver keys, and builds the lazy docs bundles from a glob instead of
a hand-written list.

The application controller (query params) moves to +controller.ts in the
application route folder. import-map.ts was not a route, so it moves beside
the application route that uses it. The page-title service becomes a
re-export so services can be globbed like the other modules.

vite-ember-ssr keys its CSS manifest by an app/templates/<route>.gts path and
falls back to the chunk name, which is `_template` for every route here. That
dropped the docs stylesheet link from the prerendered docs pages.
config/route-css-manifest.js rewrites the manifest per route before the
prerender step reads it. The prerendered output now matches main.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The docs routes are plain templates with no route class, controller, or
route-only components, so the folder layout buys them nothing. They go
back to app/templates/docs/, and the router lists their lazy bundles by
hand again. That also puts their templates where vite-ember-ssr expects
them, so the prerendered docs pages get their stylesheet link without the
manifest rewrite plugin. The plugin is gone. The general fix, so any
layout works, is proposed upstream in evoactivity/vite-ember-ssr#24.

The save banner, the current-url helper, and the constrain-vertically
modifier are only used by the edit route, so they move next to their
users. The is-editing, not, and stringify helpers and the
positioned-n-lines-from-top modifier had no importers, so they are
deleted.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rt file

app-ssr.ts already registers it that way. A file whose only job is to be
found by the services glob is not worth having.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@NullVoxPopuli
NullVoxPopuli merged commit 6d34b75 into main Oct 12, 2026
12 checks passed
@NullVoxPopuli
NullVoxPopuli deleted the nvp/repl-route-layout branch October 12, 2026 22:14
@github-actions github-actions Bot mentioned this pull request Oct 12, 2026
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.

2 participants