mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
## [0.26.0] - 2024-09-03 -1aa49afast: [**BREAKING**] Remove `JSXMemberExpressionObject::Identifier` variant (#5358) (Dunqing) -01cc2cesemantic: [**BREAKING**] Add `ScopeTree:get_child_ids` API behind a runtime flag (#5403) (Boshen) -b1d0075napi/transform: [**BREAKING**] Align output API `sourceText` -> `code` with babel (#5398) (Boshen) -32f7300ast: [**BREAKING**] Add `JSXElementName::IdentifierReference` and `JSXMemberExpressionObject::IdentifierReference` (#5223) (Dunqing) -23e8456traverse: [**BREAKING**] `TraverseCtx::ancestor` with level 0 = equivalent to `parent` (#5294) (overlookmotel) -582ce9etraverse: [**BREAKING**] `TraverseCtx::ancestor` return `Ancestor::None` if out of bounds (#5286) (overlookmotel) -234a24cast: [**BREAKING**] Merge `UsingDeclaration` into `VariableDeclaration` (#5270) (Kevin Deng 三咲智子) -c100826semantic: [**BREAKING**] Always create a scope for `for` statements (#5110) (overlookmotel) -d304d6fsemantic: [**BREAKING**] Always create a scope for `CatchClause` (#5109) (overlookmotel) ### Features -180b1a1ast: Add `Function::name()` (#5361) (DonIsaac) -5505749ast: Add `accessibility` field to `AccessorProperty` (#5290) (Dunqing) -49cd5dbast,parser: Add `definite` flag to `AccessorProperty` node (#5182) (DonIsaac) -c2fa725ast,parser: Parse `TSTypeAnnotations` on `AccessorProperty` (#5179) (DonIsaac) -292d162codegen: Print missing fields for `AccessorProperty` (#5291) (Dunqing) -72740b3isolated_declaration: Support sourcemap option (#5170) (dalaoshu) -f81e8a1linter: Add `oxc/no-async-endpoint-handlers` (#5364) (DonIsaac) -9c22ce9linter: Add hyperlinks to diagnostic messages (#5318) (DonIsaac) -d22bd20module_lexer: Distinguish for types-only imports and exports (#5184) (Kevin Deng 三咲智子) -7dfd51aparser: Report class properties that are both definite and optional (#5181) (DonIsaac) -a563968parser: Report errors on optional accessor properties (#5180) (DonIsaac) -46b641bregular_expression: Validate max quantifier value (#5218) (leaysgur) -be4642fsemantic: Transform checker check child scope IDs (#5410) (overlookmotel) -6e969f9semantic: Add `ScopeTree::delete_root_unresolved_reference` (#5305) (overlookmotel) -1b20cebspan: Add `CompactStr::to_compact_string` method (#5385) (Boshen) -5a137f0span/source-type: Add SourceType factory methods (#5242) (DonIsaac) -f5e05dbspan/source-type: Impl `Display` and `Error` for `UnknownExtension` (#5240) (DonIsaac) -d04857btransformer: Support `Targets::from_query` method (#5336) (Dunqing) -3d4a64ctransformer: Make `Targets` public (#5335) (Dunqing) -0eb7602transformer: Support `TransformOptions::from_preset_env` API (#5323) (Dunqing) -08dc0adtransformer: Add `object-spread` plugin (#3133) (magic-akari) -01c0c3etransformer: Add remaining options to transformer options (#5169) (Boshen) -056c667transformer/arrow-functions: The output that uses `this` inside blocks doesn't match Babel (#5188) (Dunqing) -0abfc50transformer/typescript: Support `rewrite_import_extensions` option (#5399) (Dunqing) ### Bug Fixes -8ebc23fast: Serialize `TSParenthesizedType` with camelCase (#5199) (Kevin Deng 三咲智子) -5c4c001codegen: Print `export @decorator declare abstract class Foo` correctly (#5303) (Boshen) -7b1546bcodegen: Do not print comments when `--minify` (Boshen) -ff7fa98diagnostics: Improve "file is too long to fit on the screen" (#5120) (Boshen) -8a17807parser: Treat JSX element tags starting with `_` or `$` as `IdentifierReference`s (#5343) (overlookmotel) -d4c06efparser: Revert "check for `@flow` with recoverable errors as well" (#5297) (overlookmotel) -e1d8b92parser: Check for `@flow` with recoverable errors as well (Boshen) -e6fd52eparser: Change unterminated regex error to be non-recoverable (#5285) (Boshen) -1686920parser: Span for invalid regex flags (#5225) (leaysgur) -cffce11regular_expression: Prevent panic on too large number (#5282) (leaysgur) -293413fsemantic: Implicit return `UpdateExpression` in `ArrowFunctionExpression` does not as read reference (#5161) (Dunqing) -a6bb3b1span/source-type: Consider `.cjs` and `.cts` files as `ModuleKind::Script` (#5239) (DonIsaac) -35f03dbtransformer: `ArrowfunctionExpression`'s expression is true but has more than one body statement (#5366) (Dunqing) -8d6b05ctransformer: Class property with typescript value should not be removed (#5298) (Boshen) -47e69a8transformer-optional-catch-binding: The `unused` binding is not in the correct scope (#5066) (Dunqing) -94ff94ctransformer/arrow-functions: Reaches `unreachable` when `<this.foo>` is inside an arrow function (#5356) (Dunqing) -f8bb022transformer/arrow-functions: Remove `SymbolFlags::ArrowFunction` (#5190) (Dunqing) -d9ba5adtransformer/arrow-functions: Correct scope for `_this` (#5189) (Dunqing) -3acb3f6transformer/react: Mismatch output caused by incorrect transformation ordering (#5255) (Dunqing) -5754c89transformer/typescript: Remove accessibility from `AccessorProperty` (#5292) (Dunqing) -d594818traverse: `insert_scope_below` update child scopes records (#5409) (overlookmotel) -25d6e20traverse: Add missing visitors to `ChildScopeCollector` (#5118) (overlookmotel) ### Performance -292f217ast: Optimize `JSXIdentifier::is_reference` (#5344) (overlookmotel) -12a7607codegen: Inline `Codegen::print_list` (#5221) (overlookmotel) -fb847bdcodegen: Slightly faster `print_list` (#5192) (Boshen) -a1523c6transformer: Remove an allocation from arrow functions transform (#5412) (overlookmotel) ### Documentation -8334bd4transformer: Add documentation for `Targets::get_targets` (#5337) (Dunqing) -d51a954transformer: Add documentation for arrow-functions plugin (#5186) (Dunqing) ### Refactor -c2d8c9east: Reduce allocations in `AstBuilder::move_assignment_target` (#5367) (overlookmotel) -946c867ast: Box `TSThisParameter` (#5325) (overlookmotel) -960e1d5ast: Rename `IdentifierReference::new_with_reference_id` (#5157) (overlookmotel) -f63b568ast: Remove `#[non_exhaustive]` attr from `AstBuilder` (#5130) (overlookmotel) -d4c3778codegen: Rename vars (#5222) (overlookmotel) -543cad6codegen: Remove some pub APIs (Boshen) -cd63336diagnostic: Change how diagnostic codes are rendered (#5317) (DonIsaac) -d236554parser: Move `JSXIdentifier` conversion code into parser (#5345) (overlookmotel) -bc59dd2parser: Improve example for `byte_search!` macro usage (#5234) (overlookmotel) -a3ddfddparser: Improve lexer pointer maths (#5233) (overlookmotel) -3ae94b8semantic: Change `build_module_record` to accept &Path instead of PathBuf (Boshen) -05d25e2semantic: Combine add scope methods (#5262) (overlookmotel) -fdedc0fsemantic: Transform checker: rename `SemanticData` to `Scoping` (#5261) (overlookmotel) -1086109semantic: Transform checker do not output spans in errors (#5260) (overlookmotel) -af5713esemantic: Transform checker continue checks if missing IDs (#5259) (overlookmotel) -943454fsemantic: Update transform checker for no conditional scopes (#5252) (overlookmotel) -892a7fasemantic: Replace `ref` syntax (#5253) (overlookmotel) -cbb4725semantic: Add comment to transform checker (#5250) (overlookmotel) -a17cf33semantic: Remove `ScopeTree::child_ids` (#5232) (Boshen) -d5a4940semantic: Rewrite handling of label statement errors (#5138) (Boshen) -94f60e7span/source-type: Make `SourceType` factories `const` (#5241) (DonIsaac) -0de844dtransformer: Remove unnecessary code from JSX transform (#5339) (overlookmotel) -5136f01transformer: Remove unnecessary type annotation (#5131) (overlookmotel) -260c9d2transformer/es2015: Move all entry points to implementation of Traverse trait (#5187) (Dunqing) -1645115transformer/object-reset-spread: Make plugin initialization unconditional (#5319) (Dunqing) -d2666fetransformer/object-rest-spread: Move plugin-relates files to `object_rest_spread` mod (#5320) (Dunqing) -7e2a7aftransformer/react: Remove `CalculateSignatureKey` implementation from refresh (#5289) (Dunqing) -b43a394traverse: Correct code comments (#5293) (overlookmotel) -d71f0edtraverse: Inline all passthrough methods (#5279) (overlookmotel) -188ce07traverse: Improve safety via type system (#5277) (overlookmotel) -0f4a8b3traverse: Add debug asserts for safety invariants (#5272) (overlookmotel) -341e42atraverse: Make `Ancestor` an owned type (#5269) (overlookmotel) -eba5033traverse: Codegen `ChildScopeCollector` (#5119) (overlookmotel) -f771d7ctraverse: Remove unnecessary imports (#5116) (overlookmotel) -c6590aetraverse: Move generated files into separate folder (#5115) (overlookmotel) -fc2e9adtraverse: Remove support for `#[scope(if(...))]` attr (#5114) (overlookmotel) -1ba11a3traverse: Refactor `ChildScopeCollector` (#5112) (overlookmotel) -40e2f6etraverse: Remove unnecessary branch in `ChildScopeCollector` (#5111) (overlookmotel) -b39c0d6wasm: Add `source_type` for parser, replace class options with plain object (#5217) (Kevin Deng 三咲智子) ### Testing -7009177parser: Fix incorrect flow error test (Boshen) -be7b8c6semantic: Add `JSXIdentifierReference`-related tests (#5224) (Dunqing) Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
224 lines
9.1 KiB
TOML
224 lines
9.1 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"]
|
|
description = "A collection of JavaScript tools written in Rust."
|
|
edition = "2021"
|
|
homepage = "https://oxc.rs"
|
|
keywords = ["JavaScript", "TypeScript", "linter", "minifier", "parser"]
|
|
license = "MIT"
|
|
repository = "https://github.com/oxc-project/oxc"
|
|
rust-version = "1.74"
|
|
|
|
# <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
|
|
# 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.26.0", path = "crates/oxc" }
|
|
oxc_allocator = { version = "0.26.0", path = "crates/oxc_allocator" }
|
|
oxc_ast = { version = "0.26.0", path = "crates/oxc_ast" }
|
|
oxc_codegen = { version = "0.26.0", path = "crates/oxc_codegen" }
|
|
oxc_diagnostics = { version = "0.26.0", path = "crates/oxc_diagnostics" }
|
|
oxc_index = { version = "0.26.0", path = "crates/oxc_index" }
|
|
oxc_minifier = { version = "0.26.0", path = "crates/oxc_minifier" }
|
|
oxc_mangler = { version = "0.26.0", path = "crates/oxc_mangler" }
|
|
oxc_parser = { version = "0.26.0", path = "crates/oxc_parser" }
|
|
oxc_semantic = { version = "0.26.0", path = "crates/oxc_semantic" }
|
|
oxc_span = { version = "0.26.0", path = "crates/oxc_span" }
|
|
oxc_syntax = { version = "0.26.0", path = "crates/oxc_syntax" }
|
|
oxc_transformer = { version = "0.26.0", path = "crates/oxc_transformer" }
|
|
oxc_sourcemap = { version = "0.26.0", path = "crates/oxc_sourcemap" }
|
|
oxc_ast_macros = { version = "0.26.0", path = "crates/oxc_ast_macros" }
|
|
oxc_traverse = { version = "0.26.0", path = "crates/oxc_traverse" }
|
|
oxc_module_lexer = { version = "0.26.0", path = "crates/oxc_module_lexer" }
|
|
oxc_cfg = { version = "0.26.0", path = "crates/oxc_cfg" }
|
|
oxc_isolated_declarations = { version = "0.26.0", path = "crates/oxc_isolated_declarations" }
|
|
oxc_regular_expression = { version = "0.26.0", path = "crates/oxc_regular_expression" }
|
|
oxc_transform_napi = { version = "0.26.0", path = "napi/transform" }
|
|
|
|
# publish = false
|
|
oxc_macros = { path = "crates/oxc_macros" }
|
|
oxc_linter = { path = "crates/oxc_linter" }
|
|
oxc_prettier = { path = "crates/oxc_prettier" }
|
|
oxc_tasks_common = { path = "tasks/common" }
|
|
|
|
napi = "3.0.0-alpha.8"
|
|
napi-derive = "3.0.0-alpha.7"
|
|
napi-build = "2.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"
|
|
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"
|
|
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_resolver = "1.10.2"
|
|
oxc-browserslist = "1.0.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_json = "1.0.124"
|
|
serde-wasm-bindgen = "0.6.5"
|
|
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 for `cargo coverage`
|
|
[profile.coverage]
|
|
inherits = "release"
|
|
lto = "thin" # Faster compile time with thin LTO
|
|
debug-assertions = true # Make sure `debug_assert!`s pass
|
|
overflow-checks = true # Catch arithmetic overflow errors
|