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

Optimize runtime production size #1211

Open
wre232114 opened this issue Apr 19, 2024 · 0 comments
Open

Optimize runtime production size #1211

wre232114 opened this issue Apr 19, 2024 · 0 comments

Comments

@wre232114
Copy link
Member

What problem does this feature solve?

Currently runtime size is really large(11KB after minify and tree shake), we need to optimize the size.

What does the proposed API look like?

Optimize strategies:

  1. remove minimal runtime for runtime, concat all runtime modules like rollup/esbuild
  2. rewrite runtime core with lower syntax version that do not need any syntax downgrade or polyfill(Except Promise), and the runtime code bundle should not contain any polyfill
  3. inject runtime functions in need, if the bundle do not need to load resources dynamically, then runtime resource loader should be removed from runtime.
  4. runtime module's name and internal helper name should be shorten, for example @swc/heplers/_/xxxxx can be shorten to _x, module id s2441d31 can be shorten to s as long as s is not occupied by other modules. if s is occupied, then s2 should be used.
@wre232114 wre232114 added this to the V1.2.0 milestone Apr 22, 2024
@callqh callqh assigned callqh and unassigned callqh Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants