mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 12:51:57 +00:00
## [0.42.0] - 2024-12-18 -84b75a0semantic: [**BREAKING**] Remove `ScopeFlags::Modifiers` (#7935) (overlookmotel) -c071494semantic: [**BREAKING**] Remove `SymbolTable::rename` method (#7868) (overlookmotel) ### Features -8b7c5aeast: Add `AstBuilder::atom_from_cow` (#7974) (overlookmotel) -46e2e27data_structures: Implement `Default` for `NonEmptyStack` (#7946) (overlookmotel) -db9e93bmangler: Mangle top level variables (#7907) (翠 / green) -075bd16minifier: Fold bitwise operation (#7908) (翠 / green) -c16a851napi/transform: Add `jsx: 'preserve'` option (#7965) (Boshen) -81eedb1parser: 'readonly' type modifier is only permitted on array and tuple literal types. (#7880) (Boshen) -b9322c6semantic: Re-export all flags and ID types (#7886) (overlookmotel) -c30a982span: Add `impl From<ArenaString> for Atom` (#7973) (overlookmotel) -02b653ctransformer/class-properties: Do not create temp var for template literal computed key (#7919) (overlookmotel) -feac02etransformer/class-properties: Only rename symbols if necessary (#7896) (overlookmotel) -6bc530dtransformer/class-properties: Transform super call expression that is inside static prop initializer (#7831) (Dunqing) -53e2bc0traverse: Add `TraverseScoping::rename_symbol` method (#7871) (overlookmotel) ### Bug Fixes -3659e6dcfg: Include export default code in CFG instructions (#7862) (Jan Olaf Martin) -850dd43codegen: Missing `,` when generating type parameters with jsx (#7929) (Dunqing) -4799471minfier: Bigint bitwise operation only works with bigint (#7937) (Boshen) -de8a86eminifier: Incorrect minification in `try_fold_left_child_op` (#7949) (翠 / green) -9a30910oxc_transformer: Inject_global_variables should considering string imported name (#7768) (IWANABETHATGUY) -111dc52parser: Include export token in spans of TSNamespaceExportDeclaration (#7963) (branchseer) -14c51ffsemantic: Remove inherting `ScopeFlags::Modifier` from parent scope (#7932) (Dunqing) -596aeadsemantic: Reset references flags when resolved (#7923) (Dunqing) -4924073semantic: `ScopeTree::rename_binding` preserve order of bindings (#7870) (overlookmotel) -bb38065transformer/class-properties: Do not transform `super.prop` in nested method within static prop initializer (#7978) (overlookmotel) -e76fbb0transformer/class-properties: Fix symbol clashes in instance prop initializers (#7872) (overlookmotel) -c0576fatransformer/class-properties: Use UID for `args` in created class constructor (#7866) (overlookmotel) -d660d8dtransformer/optional-chaining: Do not create unused reference when `noDocumentAll` assumption (#7847) (overlookmotel) -4920c6atransformer/optional-chaining: Avoid creating a useless reference when `noDocumentAll` is true (#7832) (Dunqing) ### Performance -a5f04a7ast: Faster `Comment::is_jsdoc` (#7905) (overlookmotel) -4b24335codegen: Improve printing of statement comments (#7857) (Boshen) -71a40a2codegen: Guard comment printing comments when there are no comments (#7856) (Boshen) -b31f123transformer/class-properties: Do not re-generate same method key (#7915) (overlookmotel) -8ca8fcetransformer/class-properties: Reduce work updating scopes when transforming static prop initializers (#7904) (overlookmotel) -80d0b3etransformer/class-properties: Fast path for instance prop initializer scope re-parenting (#7901) (overlookmotel) -38aafa2transformer/class-properties: Reduce size of `transform_call_expression_for_super_member_expr` (#7859) (overlookmotel) ### Documentation -e49de81ast: Document `Expression::is_*` methods (#7853) (overlookmotel) -10a86b9transformer: Fix comments (#7925) (overlookmotel) -f4cb5d3transformer: Clarify comment (#7918) (overlookmotel) -41a1456transformer/class-properties: Correct doc comments (#7966) (overlookmotel) -18441aftransformer/class-properties: Remove oudated todo for assignment expression (#7955) (Dunqing) -1317c00transformer/class-properties: Clarify doc comments (#7914) (overlookmotel) -9989b58transformer/class-properties: Re-order file list in doc comment (#7911) (overlookmotel) -7390048transformer/class-properties: Reformat doc comment (#7909) (overlookmotel) ### Refactor -beb982aast: Use exhaustive match for `Argument` to `ArrayExpressionElement` conversion (#7848) (overlookmotel) -3858221global: Sort imports (#7883) (overlookmotel) -1314c97minifier: Expose dce as an API instead of an option (#7957) (Boshen) -6551dfesemantic: Pass `&str` instead of `Cow` (#7972) (overlookmotel) -b8d2bd2semantic: Move determining references flags for export specifier to `visit_export_named_declaration` (#7924) (Dunqing) -98d7946semantic: Import flags and ID types from `oxc_syntax` (#7887) (overlookmotel) -1cf8f8fsemantic: `SymbolTable::set_name` return old name (#7869) (overlookmotel) -5d42df8semantic: Use `Expression::is_super` (#7851) (overlookmotel) -8cf9766semantic, syntax, wasm: Remove `#![allow(non_snake_case)]` (#7863) (overlookmotel) -d59bbaetransformer: Remove unneeded lint `#[allow]` (#7971) (overlookmotel) -2c94236transformer: Improve encapsulation of transforms (#7888) (overlookmotel) -34091b2transformer: Use `Expression::is_super` (#7852) (overlookmotel) -d4d7bc0transformer/async-to-generator: Avoid allocating unnecessary `Atom`s (#7975) (overlookmotel) -2e5ffd3transformer/class-properties: Store `temp_var_is_created` on `ClassBindings` (#7981) (overlookmotel) -27cc6datransformer/class-properties: Store `is_declaration` only on `ClassDetails` (#7980) (overlookmotel) -ee282f8transformer/class-properties: Remove `move_expression`s (#7979) (overlookmotel) -94b376atransformer/class-properties: Simplify logic for when to create temp binding (#7977) (overlookmotel) -ff9d1b3transformer/class-properties: Comments about shorter output (#7976) (overlookmotel) -6fc40f0transformer/class-properties: Pass `BoundIdentifier`s by reference (#7968) (overlookmotel) -69eeeeatransformer/class-properties: Methods take `&self` where possible (#7967) (overlookmotel) -98340bbtransformer/class-properties: Use stack of `ClassDetails` (#7947) (overlookmotel) -088dd48transformer/class-properties: Shorten code (#7913) (overlookmotel) -544ffbftransformer/class-properties: Split up code into multiple files (#7912) (overlookmotel) -dcaf674transformer/class-properties: Rename file (#7910) (overlookmotel) -6243980transformer/class-properties: Instance prop inits visitor use `Visit` (#7867) (overlookmotel) -eb47d43transformer/class-properties: Re-use existing `Vec` (#7854) (overlookmotel) -1380b7btransformer/class-properties: Reduce visibility of method (#7858) (overlookmotel) -0f5e078transformer/class-properties: Rename `*_owner` to `owned_*` (#7855) (Dunqing) -4ea90d4transformer/react-refresh: Calculate signature key once (#7970) (Dunqing) -15b9bfftransformer/typescript: Reuse `Atom` (#7969) (overlookmotel) ### Styling -fb897f6data_structures: Add line break (#7882) (overlookmotel) -7fb9d47rust: `cargo +nightly fmt` (#7877) (Boshen) ### Testing -523d48ctransformer: Move named test to exports folder (#7922) (Dunqing) -e766051transformer: Skip test which uses filesystem under miri (#7874) (overlookmotel) -f39e65etransformer: Prevent lint error when running miri (#7873) (overlookmotel) Co-authored-by: Dunqing <29533304+Dunqing@users.noreply.github.com>
246 lines
8.4 KiB
TOML
246 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.78" # 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"
|
|
# Too annoying, we import by name anyway.
|
|
wildcard_imports = "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.42.0", path = "crates/oxc" }
|
|
oxc_allocator = { version = "0.42.0", path = "crates/oxc_allocator" }
|
|
oxc_ast = { version = "0.42.0", path = "crates/oxc_ast" }
|
|
oxc_ast_macros = { version = "0.42.0", path = "crates/oxc_ast_macros" }
|
|
oxc_cfg = { version = "0.42.0", path = "crates/oxc_cfg" }
|
|
oxc_codegen = { version = "0.42.0", path = "crates/oxc_codegen" }
|
|
oxc_data_structures = { version = "0.42.0", path = "crates/oxc_data_structures" }
|
|
oxc_diagnostics = { version = "0.42.0", path = "crates/oxc_diagnostics" }
|
|
oxc_ecmascript = { version = "0.42.0", path = "crates/oxc_ecmascript" }
|
|
oxc_estree = { version = "0.42.0", path = "crates/oxc_estree" }
|
|
oxc_isolated_declarations = { version = "0.42.0", path = "crates/oxc_isolated_declarations" }
|
|
oxc_mangler = { version = "0.42.0", path = "crates/oxc_mangler" }
|
|
oxc_minifier = { version = "0.42.0", path = "crates/oxc_minifier" }
|
|
oxc_napi = { version = "0.42.0", path = "crates/oxc_napi" }
|
|
oxc_parser = { version = "0.42.0", path = "crates/oxc_parser" }
|
|
oxc_regular_expression = { version = "0.42.0", path = "crates/oxc_regular_expression" }
|
|
oxc_semantic = { version = "0.42.0", path = "crates/oxc_semantic" }
|
|
oxc_span = { version = "0.42.0", path = "crates/oxc_span" }
|
|
oxc_syntax = { version = "0.42.0", path = "crates/oxc_syntax" }
|
|
oxc_transform_napi = { version = "0.42.0", path = "napi/transform" }
|
|
oxc_transformer = { version = "0.42.0", path = "crates/oxc_transformer" }
|
|
oxc_traverse = { version = "0.42.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" }
|
|
|
|
# Relaxed version so the user can decide which version to use.
|
|
napi = "3.0.0-alpha"
|
|
napi-build = "2.1.3"
|
|
napi-derive = "3.0.0-alpha"
|
|
|
|
# Relaxed version so the user can decide which version to use.
|
|
indexmap = "2.7"
|
|
proc-macro2 = "1"
|
|
quote = "1"
|
|
rustc-hash = "2"
|
|
serde = "1"
|
|
serde_json = "1"
|
|
syn = { version = "2", default-features = false }
|
|
unicode-id-start = "1"
|
|
|
|
#
|
|
dashmap = "6"
|
|
oxc-browserslist = "1.1.0"
|
|
oxc_index = "2"
|
|
oxc_resolver = "3"
|
|
oxc_sourcemap = "1"
|
|
|
|
#
|
|
allocator-api2 = "0.2.21"
|
|
assert-unchecked = "0.1.2"
|
|
base64 = "0.22.1"
|
|
bitflags = "2.6.0"
|
|
bpaf = "0.9.15"
|
|
bumpalo = "3.16.0"
|
|
compact_str = "0.8.0"
|
|
console = "0.15.8"
|
|
console_error_panic_hook = "0.1.7"
|
|
convert_case = "0.6.0"
|
|
cow-utils = "0.1.3"
|
|
criterion2 = { version = "2.0.0", default-features = false }
|
|
encoding_rs = "0.8.35"
|
|
encoding_rs_io = "0.1.7"
|
|
env_logger = { version = "0.11.5", default-features = false }
|
|
fast-glob = "0.4.0"
|
|
flate2 = "1.0.35"
|
|
futures = "0.3.31"
|
|
glob = "0.3.1"
|
|
globset = "0.4.15"
|
|
handlebars = "6.2.0"
|
|
humansize = "2.1.3"
|
|
ignore = "0.4.23"
|
|
insta = "1.41.1"
|
|
itertools = "0.13.0"
|
|
itoa = "1.0.14"
|
|
jemallocator = "0.5.4"
|
|
json-strip-comments = "1.0.4"
|
|
language-tags = "0.3.2"
|
|
lazy_static = "1.5.0"
|
|
log = "0.4.22"
|
|
markdown = "1.0.0-alpha.21"
|
|
memchr = "2.7.4"
|
|
miette = { package = "oxc-miette", version = "1.0.2", 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"
|
|
petgraph = "0.6.5"
|
|
phf = "0.11.2"
|
|
pico-args = "0.5.0"
|
|
prettyplease = "0.2.25"
|
|
project-root = "0.2.2"
|
|
rayon = "1.10.0"
|
|
regex = "1.11.1"
|
|
ropey = "1.6.1"
|
|
rust-lapper = "1.1.0"
|
|
ryu-js = "1.0.1"
|
|
saphyr = "0.0.3"
|
|
schemars = "0.8.21"
|
|
self_cell = "1.1.0"
|
|
seq-macro = "0.3.5"
|
|
serde-wasm-bindgen = "0.6.5"
|
|
sha1 = "0.10.6"
|
|
simdutf8 = { version = "0.1.5", features = ["aarch64_neon"] }
|
|
similar = "2.6.0"
|
|
string_wizard = "0.0.25"
|
|
tempfile = "3.14.0"
|
|
tokio = "1.42.0"
|
|
tower-lsp = "0.20.0"
|
|
tracing-subscriber = "0.3.19"
|
|
tsify = "0.4.5"
|
|
ureq = { version = "2.12.1", default-features = false }
|
|
url = "2.5.4"
|
|
walkdir = "2.5.0"
|
|
wasm-bindgen = "0.2.99"
|
|
|
|
[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
|