lukeed / lukeed/worktop

build: compile-time router optimization

Open
#95 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.