build: compile-time router optimization
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
Already have a PoC for this done – using Babel, but can be anything.
The idea is to remove the `Router` and `regexparam` code entirely from the output, even though the `Router` itself is < 900 bytes and `regexparam` is less than 400b.
This was a driving feature for #82 – which unfortunately couldn't be part of the initial #94 work. Tried to make `worktop.build` entirely with swc/core, but not feasible at this time.
Requires AST traversal and modifications. Hoping for https://github.com/evanw/esbuild/issues/1297#issuecomment-925571027 but may end up having to write my own TS parser or bringing in Babel 😖 Major overkill for data/tooling that's already there.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing Babel-based proof of concept and the constraints described for esbuild and swc/core. The work is complete when the compile-time process removes Router and regexparam from the generated output without relying on an impractical parser or unsupported build approach.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- babel, typescript
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100