mirror of
https://github.com/swc-project/swc.git
synced 2024-12-22 05:01:42 +03:00
3d204b44f0
swc_ecma_utils: - `collect_decls`: More parallel. swc_ecma_transforms_macros: - Add `Parallel`, which is helper for `#[parallel]`. - Add `ParExplode`, which is helper for `#[parallel(explode)]`. swc_ecma_transforms_macros: - Add `#[parllel]`. swc_ecma_transforms_compat: - `sticky_regex`: Parallel. - `typeof_symbol`: Parallel. - `for_of`: Remove exponential visit. - `regenerator`: Remove exponential visit. - `object_spread`: Parallel. - `instance_of`: Parallel. - `duplicate_keys`: Parallel. - `logical_assignments`: Parallel. - `template_literal`: Parallel. - `block_scoped_functions`: Migrate to `VisitMut`. - `for_of`: Migrate to `VisitMut`. - `destructuring`: Reduce `Visit`. - `arrow`: Migrate to `VisitMut`. - `function_name`: Parallel. - `reserved_words`: Parallel. - `for_of`: Parallel. swc_ecma_transforms_module: - `import_analyzer`: Migrate to `VisitMut`. swc_ecma_transforms_react: - `jsx_src`: Parallel. - `jsx_self`: Migrate to `VisitMut`. - `jsx_self`: Parallel. swc_ecma_transforms_proposal: - `export_default_from`: Migrate to `VisitMut`. swc_ecma_transforms_optimization: - `inline_globals`: Parallel. - `json_parse`: Migrate to `VisitMut`. - `json_parse`: Parallel. |
||
---|---|---|
.. | ||
examples | ||
scripts | ||
src | ||
tests | ||
.eslintrc | ||
.gitignore | ||
Cargo.toml | ||
package.json | ||
README.md | ||
yarn.lock |
Minifier
EcmaScript minifier for the swc project. This is basically a port of terser.
Note
Currently name mangler is very simple. To focus on creating a MVP, I (kdy1) will use simple logic for name mangler and implement the content-aware name mangler after publishing first non-beta version.
Testing
Real-library tests
You can use vscode to see diffs. Select a file from tests/projects/output
and select the corresponding file from tests/projects/refs
. Then you can right click to see an option to open diff.
Splitting a library test
Extracting only subset from a library test makes development much easier.
Split status:
- angular-1.2.5
- backbone-1.1.0
- jquery-1.9.1
- jquery.mobile-1.4.2
- mootools-1.4.5
- underscore-1.5.2
- yui-3.12.0
Tests from terser
Tests ported from terser has
- input.js
- config.json
- mangle.json (if name mangling is enabled)
- output.js (if exists and can be modified if our one is better or due to lack of frequency-aware base54)
- output.terser.js (if exists)
Copying tests
Replace the content of terser/test/compress.js
with it of scripts/compress.js
and run npm run test:compress