Skip to content

Format requirement for routes.tsx is too strict #19181

Closed

Description

@Legioth

Description of the bug

The requirement that routes.tsx contains export const { router, routes } = new RouterConfigurationBuilder() is too strict in case I want to manually modify the routes value before it's exported. In that case, I would want to structure my code like this:

const { router, originalRoutes } = new RouterConfigurationBuilder();
    .withFallback(Flow)
    .build();

const routes = originalRoutes; // This is where the modification would be done
export { router, routes }

If I use this structure, then Flow will complain that routes.tsx doesn't export routes even though it's indeed doing that.

Expected behavior

There will be an obvious way of customizing the routes beyond what's easily doable through RouterConfigurationBuilder.

Minimal reproducible example

  1. Get any starter from anywhere
  2. Add a routes.tsx file with the content described above
  3. mvn

Versions

  • Vaadin / Flow version: Vaadin 24.4.0.alpha22

Activity

  1. self-assigned this
    on Apr 17, 2024
  2. removed their assignment
    on Apr 18, 2024
  3. moved this from ⚒️ In progress to 🟢Ready to Go in Vaadin Flow | Hilla | Kits ongoing workon Apr 18, 2024
  4. self-assigned this
    on Apr 18, 2024
  5. moved this from 🟢Ready to Go to ⚒️ In progress in Vaadin Flow | Hilla | Kits ongoing workon Apr 18, 2024
  6. added a commit that references this issue on Apr 19, 2024
    0283492
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions