mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
## [0.31.0] - 2024-10-08 -01b878eparser: [**BREAKING**] Use `BindingIdentifier` for `namespace` declaration names (#6003) (DonIsaac) -95ca01ccfg: [**BREAKING**] Make BasicBlock::unreachable private (#6321) (DonIsaac) -020bb80codegen: [**BREAKING**] Change to `CodegenReturn::code` and `CodegenReturn::map` (#6310) (Boshen) -409dffctraverse: [**BREAKING**] `generate_uid` return a `BoundIdentifier` (#6294) (overlookmotel) -5a73a66regular_expression: [**BREAKING**] Simplify public APIs (#6262) (leaysgur) -32d972eparser: [**BREAKING**] Treat unambiguous files containing TS export assignments as modules (#6253) (overlookmotel) -4f6bc79transformer: [**BREAKING**] Remove `source_type` param from `Transformer::new` (#6251) (overlookmotel) -afc3ccbnapi/transform: [**BREAKING**] Rename `TransformOptions::react` to `jsx`. (#6211) (Boshen) -82ab689transformer,minifier: [**BREAKING**] Move define and inject plugin from minifier to transformer (#6199) (Boshen) ### Features -fa4d505cfg: Derive more base traits for CFG blocks (#6320) (DonIsaac) -14275b1cfg: Color-code edges in CFG dot diagrams (#6314) (DonIsaac) -7566c2ddata_structures: Add `as_slice` + `as_mut_slice` methods to stacks (#6216) (overlookmotel) -c3c3447data_structures: Add `oxc_data_structures` crate; add stack (#6206) (Boshen) -e304e8cminifier: Minify exponential arithmetic operation. (#6281) (7086cmd) -f9ae70cminifier: Minify basic arithmetic calculations. (#6280) (7086cmd) -4008afeminifier: Fold array and object constructors (#6257) (camchenry) -115ccc9minifier: Bitwise not in exceeded value. (#6235) (7086cmd) -ee6c850minifier: Scaffold peephole replace known methods. (#6245) (7086cmd) -c32af57minifier: Fold demical bitwise not for bigint. (#6233) (7086cmd) -23b6464minifier: Fold true / false comparison. (#6225) (7086cmd) -585ccdaminifier: Support subtraction assignment. (#6214) (7086cmd) -cca0034minifier: Handle positive `NaN` and `Infinity`. (#6207) (7086cmd) -dac8f09minifier: Minify unary plus negation. (#6203) (7086cmd) -3b79e1bminifier: Evaluate bigint in fold constant (#6178) (Boshen) -abd3a9fnapi/transform: Perform dce after define plugin (#6312) (Boshen) -a0ccc26napi/transform: Add `lang` option to change source type (#6309) (Boshen) -f98e12cnapi/transform: Add inject plugin (#6250) (Boshen) -291891enapi/transform: Add `define` option (#6212) (Boshen) -51a78d5napi/transform: Rename all mention of React to Jsx; remove mention of `Binding` (#6198) (Boshen) -2f888edoxc: Add napi transform options (#6268) (Boshen) -8729755oxc,napi/transform: Napi/transform use oxc compiler pipeline (#6298) (Boshen) -f6e42b6sourcemap: Add support for sourcemap debug IDs (#6221) (Tim Fish) -9e62396syntax_operations: Add crate `oxc_syntax_operations` (#6202) (Boshen) -cf20f3atransformer: Exponentiation transform: support private fields (#6345) (overlookmotel) ### Bug Fixes -84b2d07codegen: Converts line comment to block comment if it is a `PURE` comment (#6356) (Dunqing) -e9eeae0isolated-declarations: False positive for function with a type asserted parameters (#6181) (Dunqing) -d953a6bminifier: Correct the reference link (#6283) (dalaoshu) -37cbabbminifier: Should not handle the strict operation for bool comparison. (#6261) (7086cmd) -e29c067minifier: Handle exceeded shifts. (#6237) (7086cmd) -294da86napi/transform: Fix index.d.ts (Boshen) -9736aa0oxc_transformer: Define `import.meta` and `import.meta.*` (#6277) (IWANABETHATGUY) -6159560parser: String `ImportSpecifier`s for type imports (#6352) (DonIsaac) -1380d8bparser: Should regard comments where after `=` as leading comments of next token (#6355) (Dunqing) -2bcd12atransformer: Exponentiation transform: fix reference flags (#6330) (overlookmotel) -28cbfa7transformer: Exponentiation transform: fix temp var names (#6329) (overlookmotel) -3a4bcc7transformer: Exponentiation transform: fix temp var names (#6318) (overlookmotel) -ccb7bdctransformer: Exponentiation transform: do not replace object when private property (#6313) (overlookmotel) -56d50cftransformer: Exponentiation transform: do not assume `Math` is not a local var (#6302) (overlookmotel) -bd81c51transformer: Exponentiation transform: fix duplicate symbols (#6300) (overlookmotel) -06797b6transformer: Logical assignment operator transform: fix reference IDs (#6289) (overlookmotel) -4b42047transformer: Fix memory leak in `ReplaceGlobalDefines` (#6224) (overlookmotel) -a28926ftransformer: Fix inserting `require` with `front` option (#6188) (overlookmotel) -b92fe84transformer: `NonEmptyStack::push` write value before updating cursor (#6169) (overlookmotel) ### Performance -5db9b30allocator: Use lower bound of size hint when creating Vecs from an iterator (#6194) (DonIsaac) -788e444transformer: Parse options from comments only once (#6152) (overlookmotel) -da2b2a4transformer: Look up `SymbolId` for `require` only once (#6192) (overlookmotel) -40bd919transformer: Faster parsing JSX pragmas from comments (#6151) (overlookmotel) ### Documentation -eb1d0b8transformer: Exponentiation transform: update doc comments (#6315) (overlookmotel) -c7636d7traverse: Remove erroneous doc comment (#6328) (overlookmotel) ### Refactor -f7d1136allocator: Remove unnecessary `Vec` impl (#6213) (overlookmotel) -40932f7cfg: Use IndexVec for storing basic blocks (#6323) (DonIsaac) -a1e0d30cfg: Add type alias for Graph (#6322) (DonIsaac) -7672793cfg: Move block data types to separate file (#6319) (DonIsaac) -cc57541data_structures: `NonEmptyStack::len` hint that `len` is never 0 (#6220) (overlookmotel) -147a5d5data_structures: Remove `is_empty` methods for non-empty stacks (#6219) (overlookmotel) -61805fddata_structures: Add debug assertion to `SparseStack` (#6218) (overlookmotel) -dbfa0bcdata_structures: Add `len` method to `StackCommon` trait (#6215) (overlookmotel) -ac5a23fminifier: Use ctx.ast.vec instead of Vec::new. (#6331) (7086cmd) -1cee207minifier: Some boilerplate work for PeepholeFoldConstants (#6054) (Boshen) -5b5daecnapi: Use vitest (#6307) (Boshen) -58a8615napi/transform: Remove context (#6306) (Boshen) -099ff3anapi/transform: Remove "Binding" from types; fix type error (#6260) (Boshen) -54c1c53napi/transform: Remove a call on `TransformOptions::clone` (#6210) (Boshen) -aa0dbb6oxc: Add `napi` feature, change napi parser to use `oxc` crate (#6265) (Boshen) -3b53dd4parser: Provide better error messages for `const` modifiers on class elements (#6353) (DonIsaac) -acab777regular_expression: Misc fixes (#6234) (leaysgur) -bdd9e92semantic: Rename vars from `ast_node_id` to `node_id` (#6304) (overlookmotel) -d110700semantic: Dereference IDs as quickly as possible (#6303) (overlookmotel) -03bc041syntax: Remove some unsafe code creating IDs (#6324) (overlookmotel) -bd5fb5atransformer: Exponentiation transform: rename methods (#6344) (overlookmotel) -4aa4e6btransformer: Exponentiation transform: do not wrap in `SequenceExpression` if not needed (#6343) (overlookmotel) -a15235atransformer: Exponentiation transform: no cloning (#6338) (overlookmotel) -7d93b25transformer: Exponentiation transform: split into 2 paths (#6316) (overlookmotel) -15cc8aftransformer: Exponentiation transform: break up into functions (#6301) (overlookmotel) -7f5a94btransformer: Use `Option::get_or_insert_with` (#6299) (overlookmotel) -0cea6e9transformer: Exponentiation transform: reduce identifier cloning (#6297) (overlookmotel) -ac7a3edtransformer: Logical assignment transform: reduce identifier cloning (#6296) (overlookmotel) -527f7c8transformer: Nullish coalescing transform: no cloning identifier references (#6295) (overlookmotel) -7b62966transformer: Move `BoundIdentifier` into `oxc_traverse` crate (#6293) (overlookmotel) -c7fbf68transformer: Logical assignment operator transform: no cloning identifier references (#6290) (overlookmotel) -f0a74catransformer: Prefer `create_bound_reference_id` to `create_reference_id` (#6282) (overlookmotel) -ba3e85btransformer: Fix spelling (#6279) (overlookmotel) -bc757c8transformer: Move functionality of common transforms into stores (#6243) (overlookmotel) -1c31932transformer: Rename var in `VarDeclarations` common transform (#6242) (overlookmotel) -0400ff9transformer: `VarDeclarations` common transform: check if at top level with `ctx.parent()` (#6231) (overlookmotel) -235cdbatransformer: Use AstBuilder instance from TraverseCtx (#6209) (overlookmotel) -a7ed29etransformer: Insert `import` statement or `require` depending on source type (#6191) (overlookmotel) -4c63f0etransformer: Rename methods (#6190) (overlookmotel) -900cb46transformer: Convert `ModuleImports` into common transform (#6186) (overlookmotel) -00e2802transformer: Introduce `TopLevelStatements` common transform (#6185) (overlookmotel) -70d4c56transformer: Rename `VarDeclarationsStore` methods (#6184) (overlookmotel) -81be545transformer: Export `var_declarations` module from `common` module (#6183) (overlookmotel) -02fedf5transformer: Shorten import (#6180) (overlookmotel) -f2ac584transformer: Use TraverseCtx's ast in ModuleImports (#6175) (Dunqing) -21b08batransformer: Shared `VarDeclarations` (#6170) (overlookmotel) -0dd9a2etraverse: Add helper methods to `BoundIdentifier` (#6341) (overlookmotel) -c0e2feftraverse: Function to get var name from node (#6317) (overlookmotel) -adc5381traverse: `TraverseAncestry` use `NonEmptyStack` (#6217) (overlookmotel) ### Testing -964d71eminifier: Add arithmetic tests for fold constants. (#6269) (7086cmd) -fcb4651minifier: Enable null comparison with bigint. (#6252) (7086cmd) -d4f2ee9transformer: Tidy up transform checker (#6287) (overlookmotel) -0f5afd7transformer: Transform checker output symbol name for mismatches (#6286) (overlookmotel) --------- Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
241 lines
8.4 KiB
TOML
241 lines
8.4 KiB
TOML
[workspace]
|
|
resolver = "2"
|
|
members = ["apps/*", "crates/*", "napi/*", "tasks/*", "wasm/*"]
|
|
exclude = ["tasks/lint_rules"]
|
|
|
|
[workspace.package]
|
|
authors = ["Boshen <boshenc@gmail.com>", "Oxc contributors"]
|
|
categories = ["compilers", "development-tools", "web-programming"]
|
|
edition = "2021"
|
|
homepage = "https://oxc.rs"
|
|
keywords = ["JavaScript", "TypeScript", "linter", "minifier", "parser"]
|
|
license = "MIT"
|
|
repository = "https://github.com/oxc-project/oxc"
|
|
rust-version = "1.76" # Support last 6 minor versions.
|
|
description = "A collection of JavaScript tools written in Rust."
|
|
|
|
# <https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html>
|
|
[workspace.lints.rust]
|
|
absolute_paths_not_starting_with_crate = "warn"
|
|
non_ascii_idents = "warn"
|
|
unit-bindings = "warn"
|
|
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage)', 'cfg(coverage_nightly)'] }
|
|
|
|
[workspace.lints.clippy]
|
|
all = { level = "warn", priority = -1 }
|
|
empty_docs = { level = "allow", priority = 1 } # From `Tsify`
|
|
# restriction
|
|
dbg_macro = "warn"
|
|
todo = "warn"
|
|
unimplemented = "warn"
|
|
print_stdout = "warn" # Must be opt-in
|
|
print_stderr = "warn" # Must be opt-in
|
|
allow_attributes = "warn"
|
|
# I like the explicitness of this rule as it removes confusion around `clone`.
|
|
# This increases readability, avoids `clone` mindlessly and heap allocating by accident.
|
|
clone_on_ref_ptr = "warn"
|
|
# These two are mutually exclusive, I like `mod.rs` files for better fuzzy searches on module entries.
|
|
self_named_module_files = "warn" # "-Wclippy::mod_module_files"
|
|
empty_drop = "warn"
|
|
empty_structs_with_brackets = "warn"
|
|
exit = "warn"
|
|
filetype_is_file = "warn"
|
|
get_unwrap = "warn"
|
|
impl_trait_in_params = "warn"
|
|
rc_buffer = "warn"
|
|
rc_mutex = "warn"
|
|
rest_pat_in_fully_bound_structs = "warn"
|
|
unnecessary_safety_comment = "warn"
|
|
undocumented_unsafe_blocks = "warn"
|
|
infinite_loop = "warn"
|
|
# I want to write the best Rust code so pedantic is enabled.
|
|
# We should only disable rules globally if they are either false positives, chaotic, or does not make sense.
|
|
pedantic = { level = "warn", priority = -1 }
|
|
# Allowed rules
|
|
# pedantic
|
|
# This rule is too pedantic, I don't want to force this because naming things are hard.
|
|
module_name_repetitions = "allow"
|
|
# All triggers are mostly ignored in our codebase, so this is ignored globally.
|
|
struct_excessive_bools = "allow"
|
|
too_many_lines = "allow"
|
|
# `#[must_use]` is creating too much noise for this codebase, it does not add much value
|
|
# except nagging the programmer to add a `#[must_use]` after clippy has been run.
|
|
# Having `#[must_use]` everywhere also hinders readability.
|
|
must_use_candidate = "allow"
|
|
# used_underscore_binding= "allow"
|
|
doc_markdown = "allow"
|
|
# nursery
|
|
# `const` functions do not make sense for our project because this is not a `const` library.
|
|
# This rule also confuses newcomers and forces them to add `const` blindlessly without any reason.
|
|
missing_const_for_fn = "allow"
|
|
# cargo
|
|
cargo = { level = "warn", priority = -1 }
|
|
multiple_crate_versions = "allow"
|
|
cargo_common_metadata = "allow" # FIXME
|
|
doc_lazy_continuation = "allow" # FIXME
|
|
|
|
[workspace.dependencies]
|
|
# publish = true
|
|
oxc = { version = "0.31.0", path = "crates/oxc" }
|
|
oxc_allocator = { version = "0.31.0", path = "crates/oxc_allocator" }
|
|
oxc_ast = { version = "0.31.0", path = "crates/oxc_ast" }
|
|
oxc_ast_macros = { version = "0.31.0", path = "crates/oxc_ast_macros" }
|
|
oxc_cfg = { version = "0.31.0", path = "crates/oxc_cfg" }
|
|
oxc_codegen = { version = "0.31.0", path = "crates/oxc_codegen" }
|
|
oxc_data_structures = { version = "0.31.0", path = "crates/oxc_data_structures" }
|
|
oxc_diagnostics = { version = "0.31.0", path = "crates/oxc_diagnostics" }
|
|
oxc_index = { version = "0.31.0", path = "crates/oxc_index" }
|
|
oxc_isolated_declarations = { version = "0.31.0", path = "crates/oxc_isolated_declarations" }
|
|
oxc_mangler = { version = "0.31.0", path = "crates/oxc_mangler" }
|
|
oxc_minifier = { version = "0.31.0", path = "crates/oxc_minifier" }
|
|
oxc_module_lexer = { version = "0.31.0", path = "crates/oxc_module_lexer" }
|
|
oxc_parser = { version = "0.31.0", path = "crates/oxc_parser" }
|
|
oxc_regular_expression = { version = "0.31.0", path = "crates/oxc_regular_expression" }
|
|
oxc_semantic = { version = "0.31.0", path = "crates/oxc_semantic" }
|
|
oxc_sourcemap = { version = "0.31.0", path = "crates/oxc_sourcemap" }
|
|
oxc_span = { version = "0.31.0", path = "crates/oxc_span" }
|
|
oxc_syntax = { version = "0.31.0", path = "crates/oxc_syntax" }
|
|
oxc_syntax_operations = { version = "0.31.0", path = "crates/oxc_syntax_operations" }
|
|
oxc_transform_napi = { version = "0.31.0", path = "napi/transform" }
|
|
oxc_transformer = { version = "0.31.0", path = "crates/oxc_transformer" }
|
|
oxc_traverse = { version = "0.31.0", path = "crates/oxc_traverse" }
|
|
|
|
# publish = false
|
|
oxc_linter = { path = "crates/oxc_linter" }
|
|
oxc_macros = { path = "crates/oxc_macros" }
|
|
oxc_prettier = { path = "crates/oxc_prettier" }
|
|
oxc_tasks_common = { path = "tasks/common" }
|
|
oxc_tasks_transform_checker = { path = "tasks/transform_checker" }
|
|
|
|
napi = "3.0.0-alpha"
|
|
napi-build = "2.1.3"
|
|
napi-derive = "3.0.0-alpha"
|
|
|
|
aho-corasick = "1.1.3"
|
|
allocator-api2 = "0.2.18"
|
|
assert-unchecked = "0.1.2"
|
|
base64 = "0.22.1"
|
|
base64-simd = "0.8"
|
|
bitflags = "2.6.0"
|
|
bpaf = "0.9.12"
|
|
bumpalo = "3.16.0"
|
|
cfg-if = "1.0.0"
|
|
compact_str = "0.8.0"
|
|
console = "0.15.8"
|
|
convert_case = "0.6.0"
|
|
cow-utils = "0.1.3"
|
|
criterion2 = { version = "1.1.0", default-features = false }
|
|
daachorse = { version = "1.0.0" }
|
|
dashmap = "6.0.1"
|
|
encoding_rs = "0.8.34"
|
|
encoding_rs_io = "0.1.7"
|
|
env_logger = { version = "0.11.5", default-features = false }
|
|
flate2 = "1.0.31"
|
|
futures = "0.3.30"
|
|
glob = "0.3.1"
|
|
globset = "0.4.14"
|
|
handlebars = "6.0.0"
|
|
humansize = "2.1.3"
|
|
ignore = "0.4.22"
|
|
indexmap = "2.3.0"
|
|
insta = "1.39.0"
|
|
itertools = "0.13.0"
|
|
itoa = "1.0.11"
|
|
jemallocator = "0.5.4"
|
|
json-strip-comments = "1.0.4"
|
|
language-tags = "0.3.2"
|
|
lazy_static = "1.5.0"
|
|
log = "0.4.22"
|
|
memchr = "2.7.4"
|
|
memoffset = "0.9.1"
|
|
miette = { version = "7.2.0", features = ["fancy-no-syscall"] }
|
|
mimalloc = "0.1.43"
|
|
mime_guess = "2.0.5"
|
|
nonmax = "0.5.5"
|
|
num-bigint = "0.4.6"
|
|
num-traits = "0.2.19"
|
|
once_cell = "1.19.0"
|
|
owo-colors = "4.0.0"
|
|
oxc-browserslist = "1.0.3"
|
|
oxc_resolver = "1.10.2"
|
|
petgraph = "0.6.5"
|
|
phf = "0.11.2"
|
|
pico-args = "0.5.0"
|
|
prettyplease = "0.2.20"
|
|
proc-macro2 = "1.0.86"
|
|
project-root = "0.2.2"
|
|
quote = "1.0.36"
|
|
rayon = "1.10.0"
|
|
regex = "1.10.6"
|
|
ropey = "1.6.1"
|
|
rust-lapper = "1.1.0"
|
|
rustc-hash = "2.*"
|
|
ryu-js = "1.0.1"
|
|
saphyr = "0.0.1"
|
|
schemars = "0.8.21"
|
|
seq-macro = "0.3.5"
|
|
serde = "1.0.206"
|
|
serde-wasm-bindgen = "0.6.5"
|
|
serde_json = "1.0.124"
|
|
simdutf8 = { version = "0.1.4", features = ["aarch64_neon"] }
|
|
similar = "2.6.0"
|
|
syn = { version = "2.0.74", default-features = false }
|
|
tempfile = "3.12.0"
|
|
textwrap = "0.16.1"
|
|
tokio = "1.39.2"
|
|
tower-lsp = "0.20.0"
|
|
tracing-subscriber = "0.3.18"
|
|
tsify = "0.4.5"
|
|
unicode-id-start = "1" # Relaxed version so the user can decide which unicode version to use.
|
|
unicode-width = "0.1.13"
|
|
ureq = { version = "2.10.1", default-features = false }
|
|
url = "2.5.2"
|
|
walkdir = "2.5.0"
|
|
wasm-bindgen = "0.2.92"
|
|
|
|
[workspace.metadata.cargo-shear]
|
|
ignored = ["napi", "oxc_transform_napi", "prettyplease"]
|
|
|
|
[profile.dev]
|
|
# Disabling debug info speeds up local and CI builds,
|
|
# and we don't rely on it for debugging that much.
|
|
debug = false
|
|
|
|
[profile.dev.package]
|
|
# Compile macros with some optimizations to make consuming crates build faster
|
|
oxc_macros.opt-level = 1
|
|
oxc_ast_macros.opt-level = 1
|
|
# Compile insta and its dependencies in release mode for faster snapshot tests
|
|
# See: https://insta.rs/docs/quickstart/#optional-faster-runs
|
|
insta.opt-level = 3
|
|
similar.opt-level = 3
|
|
|
|
[profile.release.package.oxc_wasm]
|
|
opt-level = 'z'
|
|
|
|
[profile.release]
|
|
# Configurations explicitly listed here for clarity.
|
|
# Using the best options for performance.
|
|
opt-level = 3
|
|
lto = "fat"
|
|
codegen-units = 1
|
|
strip = "symbols" # Set to `false` for debug information
|
|
debug = false # Set to `true` for debug information
|
|
panic = "abort" # Let it crash and force ourselves to write safe Rust
|
|
|
|
# Profile used for release mode, but with debugging information for profiling
|
|
# and debugging. Use `cargo build --profile=release-with-debug` to build with this profile.
|
|
[profile.release-with-debug]
|
|
inherits = "release"
|
|
strip = false # Keep debug information in binary
|
|
debug = true # Include maximum amount of debug information
|
|
|
|
# Profile for `cargo coverage`
|
|
[profile.coverage]
|
|
inherits = "release"
|
|
opt-level = 2 # Compile faster
|
|
codegen-units = 256 # Compile faster
|
|
lto = "thin" # Faster compile time with thin LTO
|
|
debug-assertions = true # Make sure `debug_assert!`s pass
|
|
overflow-checks = true # Catch arithmetic overflow errors
|
|
incremental = true
|