Skip to content

Add routes only based on current locale used #2646

@szwenni

Description

@szwenni

Describe the feature

Our project right now contains several rules and several languages. With this increased complexity the "entry" bundle for nuxt consists 90% of route definition for vue-router. The parsing of this whole entries costs a lot of main thread work which is not needed in this place of time. I think for initial loading the page only the route definitions of the current language and the ones for all languages of the current page are needed. The others can be lazy loaded based on laguage selection if I'm not wrong.

I know this requires some effort to implement but I think nuxt/vue provides a way of adding and removing routes at runtime. I'm also not quotes sure right now where the correct way to implement this would be and how this can be achieved at all.
I'm also not quite sure if e.g. splitting away the routes from the entry file can affect this in a positive way.

I'm willing to help if someone can give me a good start point where to start.

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: routingRelated to custom paths, router functionality, etc.v8

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions