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

Reduce duplication in client routes map #75

Open
aleclarson opened this issue Jul 6, 2022 · 0 comments
Open

Reduce duplication in client routes map #75

aleclarson opened this issue Jul 6, 2022 · 0 comments
Labels
backlog Unlikely to be worked on without outside contribution enhancement New feature or request

Comments

@aleclarson
Copy link
Contributor

https://github.com/novemberborn/common-path-prefix/blob/master/index.js

If multiple routes have the same route module, we can avoid duplication in client routes map.

// Before
export default {
  "default": "/assets/entry.8ae2ce2d.js",
  "/": "/assets/entry.8ae2ce2d.js",
  "/about": "/assets/entry.ba4aa235.js",
}

// After
import {buildRouteMap} from '/@id/saus/src/client/helpers.ts'
export default buildRouteMap({
  "/assets/entry.": {
    "8ae2ce2d.js": ["default", "/"],
    "ba4aa235.js": ["/about"],
  },
})

The exported object would look the same as before, but the paths would be deduplicated.

Q: Does gzip make this a non-problem?

@aleclarson aleclarson added enhancement New feature or request backlog Unlikely to be worked on without outside contribution labels Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Unlikely to be worked on without outside contribution enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant