No description
Find a file
2023-05-24 21:12:33 +08:00
.cargo chore(rust): allow clippy::new_without_default 2023-05-13 15:07:00 +08:00
.github ci: sleep 15s before running the benchmark (#382) 2023-05-24 21:12:33 +08:00
benchmark chore(benchmark): update rules and add M2 data 2023-03-23 22:21:43 +08:00
crates refactor(ast): move NumberBase to oxc_syntax; add NumberBase::Float 2023-05-24 18:33:19 +08:00
npm fix(ci): prefix platform pkg (#332) 2023-04-30 23:02:24 +08:00
tasks ci: sleep 15s before running the benchmark (#382) 2023-05-24 21:12:33 +08:00
website feat: napi (#302) 2023-04-22 14:41:45 +08:00
.git-blame-ignore-revs chore(git-blame-ignore-revs): ignore cargo fmt commit 2023-05-21 11:52:40 +08:00
.gitignore chore: add just watch command for overcoming cargo-watch being slow 2023-05-16 13:22:42 +08:00
.gitmodules chore(tasks): update submodules 2023-02-24 13:08:22 +08:00
.ignore chore: add just watch command for overcoming cargo-watch being slow 2023-05-16 13:22:42 +08:00
.taplo.toml chore: format toml files 2023-04-24 14:07:34 +08:00
.typos.toml chore: use taplo to reformat toml files 2023-04-22 15:58:59 +08:00
Cargo.lock Add Brotli size to minsize task output (#377) 2023-05-23 17:00:49 +08:00
Cargo.toml chore(minsize): use default version of flate2 (removes 2 extra dependencies) 2023-05-23 00:32:00 +08:00
CONTRIBUTING.md docs: Update CONTRIBUTING.md (#288) 2023-04-17 10:12:12 +08:00
deny.toml ci: add cargo deny 2023-04-22 22:35:19 +08:00
justfile chore(just): --deny warnings for cargo lint 2023-05-16 23:24:15 +08:00
LICENSE Initial commit 2023-02-09 13:46:52 +08:00
README.md chore(minifier): port tests from tdewolff/minify 2023-05-23 13:37:46 +08:00
rust-toolchain.toml chore: bump nightly to nightly-2023-04-20 (#304) 2023-04-20 23:35:38 +08:00
rustfmt.toml chore(rustfmt): add a few formatting rules 2023-05-21 11:52:26 +08:00
SECURITY.md Create SECURITY.md 2023-03-31 15:55:03 +08:00
THIRD-PARTY-LICENSE chore(minifier): port tests from tdewolff/minify 2023-05-23 13:37:46 +08:00

OXC Logo

Discord chat Build Status npm version Crates.io Docs.rs

Code Coverage Code Size MIT licensed

The Oxidation Compiler is creating a suite of tools for the JavaScript / TypeScript language:

Goals

The primary objectives for this project include:

  • Create a really fast native program by using the Rust programming language
  • Provide the basic building blocks for creating your own tools by having good API designs
  • Provide good documentation on learning Rust and compiler techniques

Performance issues are considered as bugs in this project.

Milestone

As of now, Oxc has a fully working parser and a prototype for the linter.

The current objectives are:

Contributing

This project is an invitation for you to come and learn Rust with us, We welcome and appreciate all contributions to this project.

To get started, check out CONTRIBUTING.md.

If you are unable to contribute code,, you can still participate by:

Linter

The linter is fast to the extent that it feels broken.

With a few rules implemented, testing in the VSCode repo:

vscode  main  npx oxidation-compiler@latest lint src
Checked 3479 files in 335ms using 12 cores.
Found 17 errors.

And also in a huge monorepo:

Checked 73660 files in 7415ms using 12 cores.
Found 470 errors.

On my Intel i7 6-core, the linter is around 84 times faster than ESLint. But we'll get slightly slower as we add more features.

See benchmark for details.

Try it out yourself!

The linter is currently usable and it can potentially catch a few mistakes for you:

npx oxidation-compiler@latest lint path

All feedbacks are welcome.

Parser Conformance

The cargo coverage command reports the following conformance summary

Test262 Summary:
AST Parsed     : 44000/44000 (100.00%)
Positive Passed: 44000/44000 (100.00%)
Negative Passed: 3915/3915 (100.00%)

Babel Summary:
AST Parsed     : 2065/2071 (99.71%)
Positive Passed: 2062/2071 (99.57%)
Negative Passed: 1332/1502 (88.68%)

TypeScript Summary:
TypeScript Summary:
AST Parsed     : 2337/2337 (100.00%)
Positive Passed: 2331/2337 (99.74%)
Negative Passed: 673/2535 (26.55%)

Test262 conformance is complete. TypeScript parsing is complete.

Only unstable stage 3 json-modules and stage 3 decorators tests are skipped.

Learning Resources

Rust cloc

scc . --include-ext=rs --no-complexity

───────────────────────────────────────────────────────────────────────────────
Language                     Files       Lines     Blanks    Comments      Code
───────────────────────────────────────────────────────────────────────────────
Rust                           172       46389       5039        2935     38415

Credits

This project was incubated with the assistance of these exceptional mentors and their projects:

License

MIT

Third Party Licenses

Licenses are listed in THIRD-PARTY-LICENSE

This project partially copies code from the following projects:

Project License
eslint/eslint MIT
typescript-eslint/typescript-eslint MIT
microsoft/TypeScript Apache 2.0
rome/tools MIT
mozilla-spidermonkey/jsparagus MIT Apache 2.0
acorn MIT
zkat/miette Apache 2.0
sindresorhus/globals MIT
terser BSD
evanw/esbuild MIT
google/closure-compiler Apache 2.0
google/closure-compiler Apache 2.0
tdewolff/minify MIT