Skip to content

refactor(routes): give the route table a module without components - #8456

Closed
talissoncosta wants to merge 1 commit into
feat/usage-over-limit-8187from
refactor/route-map-without-components
Closed

refactor(routes): give the route table a module without components#8456
talissoncosta wants to merge 1 commit into
feat/usage-over-limit-8187from
refactor/route-map-without-components

Conversation

@talissoncosta

Copy link
Copy Markdown
Contributor

Changes

Stacked on #8432, which is where isAllowedWhileBlocked comes from. Rebase onto main once that merges.

web/routes imports App, so any component reading a path from it forms a cycle. That already cost us: reading the map at module level in App got an empty object and the app failed to boot, worked around by reading it lazily inside the function.

The table moves to web/routePaths, which imports nothing but react-router. web/routes re-exports it, so nothing outside changes, and the three components that only wanted a path take it from there. The lazy read goes with the cycle.

isAllowedWhileBlocked moves too, which makes it testable without pulling in the app. That test is what Themis asked for on #8432: the usage route stays open to a blocked organisation and its neighbours still block.

jest gains the web/ alias webpack already resolves. Without it jest cannot follow those imports at all.

How did you test this code?

npm run test:unit, 632 tests including the 8 new ones.

Worth loading the app once, since a cycle here is the kind of thing only a browser catches.

web/routes imports App, so every component reading a path from it forms
a cycle. That already cost us once: reading the map at module level in
App got an empty object and the app failed to boot, worked around by
reading it lazily inside the function.

The table moves to web/routePaths, which imports nothing but
react-router. web/routes re-exports it, so nothing outside changes, and
the three components that wanted a path now take it from there. The
lazy read goes with the cycle.

isAllowedWhileBlocked moves too, and is now testable without pulling in
the app. jest gains the web/ alias webpack already resolves, without
which it cannot follow those imports.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
flagsmith-frontend-preview Ready Ready Preview Sep 3, 2026 6:14pm UTC
flagsmith-frontend-staging Ready Ready Preview Sep 3, 2026 6:14pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Sep 3, 2026 6:14pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

front-end Issue related to the React Front End Dashboard refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant