Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code split on route definition files #40

Open
zth opened this issue Jun 20, 2022 · 3 comments
Open

Code split on route definition files #40

zth opened this issue Jun 20, 2022 · 3 comments
Labels
cli Issue that's about the CLI. enhancement New feature or request future Something not likely to be done right now, but rather in the future.

Comments

@zth
Copy link
Owner

zth commented Jun 20, 2022

Currently, each route renderer is code split, but the infra that loads each route is always emitted in one single file. This means that while we don't pay bundle costs for route renderers and how much code each route loads, we're still paying costs for every route we add, whether it's used or not.

I'd like to experiment with code splitting on route definition files. If this works out, it means we can replicate the "multiple entry points" pattern (like having a single app that has an admin section baked in for example) with very little bundle size cost. Which would be cool!

@zth zth added enhancement New feature or request cli Issue that's about the CLI. future Something not likely to be done right now, but rather in the future. labels Jun 20, 2022
@Kingdutch
Copy link
Collaborator

Could we apply the same concept to a property in the routes definition (e.g. splitSubtree)? That way if it's more useful for my app I can still keep everything in a single routes file while benefitting from the app (but can also choose to split sub-apps in different files since we already have include).

@zth
Copy link
Owner Author

zth commented Jun 21, 2022

Yes, for sure! That's probably the better solution.

@zth
Copy link
Owner Author

zth commented Jun 30, 2022

I looked into this a bit, but it'll require quite a few changes. Postponing this because we have bigger fish to fry currently, and most of the pains this would solve was at least partially solved by #49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Issue that's about the CLI. enhancement New feature or request future Something not likely to be done right now, but rather in the future.
Projects
None yet
Development

No branches or pull requests

2 participants