Skip to content

Replace the v1 route convention with an explicit route config - #250

Merged
engleek merged 1 commit into
mainfrom
chore/explicit-route-config
Oct 4, 2026
Merged

engleek merged 1 commit into
mainfrom
chore/explicit-route-config

Conversation

@engleek

@engleek engleek commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

What

app/routes.ts now lists every route explicitly with route() / index() from @react-router/dev/routes, instead of using remixRoutesOptionAdapter(createRoutesFromFolders). @remix-run/v1-route-convention and @react-router/remix-routes-option-adapter are removed from package.json.

The config follows the v1 folder convention:

  • dots in a file name are path segments (event.$id.edit.jsx → event/:id/edit, at the top level)
  • only a sibling folder creates nesting: event.$id/* and game.$id/* are children of event/:id and game/:id; *.changes/ holds index + :revisionId children
  • $.jsx is the * splat, and admin/ and auth/ are plain path prefixes

@react-router/fs-routes was not used because its flat-routes convention would nest event.$id.changes and event.$id.edit under event.$id, which would change the nesting.

Why

@remix-run/v1-route-convention pulled in @remix-run/dev@1.19.3. Removing it drops 576 packages from the lockfile (no packages added, no versions changed).

npm audit low moderate high critical total
before 5 18 38 2 63
after 3 11 25 0 39

Verification

  • npx react-router routes --json before and after, normalized for child order: identical (66 entries). Route ids came out identical too, so useRouteLoaderData / matches lookups are unaffected.
  • npx react-router build: passes
  • npx vitest run: 24 files, 75 tests pass
  • npx playwright test: 24 passed, 29 failed. main gives exactly the same result with the same 29 tests failing. The failures come from the local database being behind on Prisma migrations (e.g. column `game.tag_list` does not exist), not from this change.

🤖 Generated with Claude Code

@engleek
engleek force-pushed the chore/explicit-route-config branch from 7307a3d to 165bc39 Compare October 4, 2026 12:41
@engleek

engleek commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Rebuilt on main after #249 merged, as one commit (force-pushed).

  • Removed signup, forgot and reset/:token from the route config. Schema stage 1 (Schema cleanup, stage 1: remove unused parts, add org status and role #241, now on main) deleted those route files.
  • react-router routes --json lists the same 63 routes as main, with the same ids and nesting.
  • Lockfile: 1332 → 928 packages. No name@version that isn't already on main.
  • npm audit: 34 → 8 (critical 1 → 0; 3 high, 4 moderate, 1 low left).
  • Build ✅, vitest 137/137 ✅, Playwright 73/73 ✅ on a freshly migrated and seeded DB. The 29 earlier e2e failures came from a DB that was behind on migrations.

app/routes.ts lists every route with route() / index() from
@react-router/dev/routes instead of remixRoutesOptionAdapter(
createRoutesFromFolders), following the v1 folder convention: dots are
path segments, only a sibling folder nests (event.$id/, game.$id/,
*.changes/), $.jsx is the splat, admin/ and auth/ are path prefixes.
`react-router routes --json` gives the same 63 routes, ids and nesting
as before.

Removes @remix-run/v1-route-convention, which pulled in
@remix-run/dev@1.19.3 and with it the last critical audit finding
(tar), and @react-router/remix-routes-option-adapter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@engleek
engleek force-pushed the chore/explicit-route-config branch from 165bc39 to 5cb8007 Compare October 4, 2026 12:43
@engleek
engleek merged commit 53da6e4 into main Oct 4, 2026
2 checks passed
@engleek
engleek deleted the chore/explicit-route-config branch October 4, 2026 12:47
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