mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
## [0.30.0] - 2024-09-23 -c96b712syntax: [**BREAKING**] Remove `SymbolFlags::ArrowFunction` (#5857) (overlookmotel) ### Features -ae89145ast: Revert `#[non_exhaustive]` change (#5885) (Boshen) -e8bf30aast: Add `Comment::real_span` (#5764) (Boshen) -d901772codegen: Implement minify number from terser (#5929) (Boshen) -9f6696acodegen: Add new lines to `TSTypeParameterDeclaration` (#5853) (Boshen) -bcdbba3codegen: Print jsdoc comments that are attached to statements and class elements (#5845) (Boshen) -26386dacodegen: Have `with_source_text` reserve memory for code buffer (#5823) (DonIsaac) -4a62703isolated-declarations: Handle `export` in the `namespace` correctly (#5950) (Dunqing) -84a5816isolated_declarations: Add `stripInternal` (#5878) (Boshen) -dfbde2cisolated_declarations: Print jsdoc comments (#5858) (Boshen) -3bf7b24linter: Make `typescript/no-duplicate-enum-values` a `correctness` rule (#5810) (DonIsaac) -9076deeminifier: Implement part of `StatementFusion` (#5936) (Boshen) -a111bb6oxc_wasm: Add `verbse` option to `debug_dot` (#5879) (IWANABETHATGUY) -8e7556fparser: Calculate leading and trailing position for comments (#5785) (Boshen) -65c337aprettier: Improve ts compatibility (#5900) (Alexander S.) -6d9ccddprettier: Support TSMappedType (#5834) (Alexander S.) -b5ac5a6prettier: Support TSModuleDeclaration (#5813) (Alexander S.) -74d8714semantic: Add help message for invalid `let x?: number` (#5969) (DonIsaac) -3230ae5semantic: Add `SemanticBuilder::with_excess_capacity` (#5762) (overlookmotel) -a5f2e9aspan: Impl `From<Atom<'a>>` for `Atom` (#5809) (DonIsaac) -a07f03atransformer: Sync `Program::source_type` after transform (#5887) (Boshen) -635e918traverse: `generate_uid_name` method (#5839) (overlookmotel) ### Bug Fixes -66e919east: Correct TS types for JSX (#5884) (overlookmotel) -0d10521ast: Serialize `JSXMemberExpressionObject` to estree (#5883) (overlookmotel) -a822c9dast: Serialize `JSXElementName` to estree (#5882) (Boshen) -f4aefb5codegen: Print `let[0]` as `(let)[0]` (#5947) (Boshen) -cee9d0bcodegen: Fix spacing of `for await (x of y)` (#5890) (Boshen) -5901d2acodegen: Various spacing issues (#5820) (Boshen) -fd1c46cisolated-declarations: Infer failed if there are two setter/getter methods that need to be inferred (#5967) (Dunqing) -6df82eeisolated-declarations: False positive for class private method that has arguments without type annotations (#5964) (Dunqing) -6a9e71disolated-declarations: Wrap TSFunctionType in parentheses if it is inside the `TSUnionType` (#5963) (Dunqing) -ea32d5bisolated-declarations: Should print constructor assignments first (#5934) (Dunqing) -0f96b59isolated-declarations: Missing print comments in class's private method (#5931) (Dunqing) -8780c54isolated-declarations: Do not union a undefined when the param type is any or unknown (#5930) (Dunqing) -f07ff14isolated-declarations: Should not transform signature that has type annotation (#5927) (Dunqing) -b6a9178isolated-declarations: Don't collect references when `ExportNamedDeclaration` has source (#5926) (Dunqing) -756a571isolated-declarations: Missing empty export when has an export declare (#5925) (Dunqing) -e148c80isolated_declarations: Try fix fixtures (Boshen) -9b3f763isolated_declarations: Try fix new line issue (Boshen) -ee748b0isolated_declarations: Fix fixture spacing (Boshen) -362c427mangler,codegen: Do not mangle top level symbols (#5965) (Boshen) -127c881napi/transform: Fix jsdoc links (#5886) (Boshen) -6c04fa1napi/transform: Make isolated_declaration options optional (#5880) (Boshen) -42dcadfparser: Hashbang comment should not keep the end newline char (#5844) (Boshen) -f1551d6semantic: `?` on variable declaration type annotations is a syntax error (#5956) (DonIsaac) -a23879csemantic: Analyze `ReferenceFlags` incorrectly when there are nested `AssignmentTarget` (#5847) (Dunqing) -87323c6transformer: Arrow function transform: prevent stack getting out of sync (#5941) (overlookmotel) -4e9e838transformer: Fix arrow function transform (#5933) (overlookmotel) -4d5c4f6transformer: Fix reference flags in logical assignment operator transform (#5903) (overlookmotel) -d335a67transformer: Fix references in logical assignment operator transform (#5896) (overlookmotel) -9758c1atransformer: JSX source: add `var _jsxFileName` statement (#5894) (overlookmotel) -49ee1dctransformer: Arrow function transform handle `this` in arrow function in class static block (#5848) (overlookmotel) -172fa03transformer: Fix stacks in arrow function transform (#5828) (overlookmotel) -d74c7fatransformer: Remove `AstBuilder::copy` from arrow functions transform (#5825) (overlookmotel) -3cc38dftransformer/react: React refresh panics when encounter `use` hook (#5768) (Dunqing) ### Performance -cd34f07isolated-declarations: Combine type/value bindings and type/value references into one (#5968) (Dunqing) -c477424mangler: Use `sort_unstable_by_key` instead of `sort_by` (#5948) (Boshen) -c3e0fb6semantic: Simplify resetting ReferenceFlags in `AssignmentExpression` (#5846) (Dunqing) -ff7d9c1transformer: Arrow function transform: calculate whether `this` is in arrow function lazily (#5850) (Dunqing) -fd70c4btransformer: Arrow function transform more efficient scope search (#5842) (overlookmotel) -56703a3transformer: Make branch more predictable in arrow function transform (#5833) (overlookmotel) -36e698btransformer: Call `transform_jsx` in `exit_expression` rather than `enter_expression` (#5751) (Dunqing) -aac8316transformer/react: Improve `is_componentish_name`'s implementation (#5769) (Dunqing) ### Documentation -acc2d16ast: Document most TypeScript AST nodes (#5983) (DonIsaac) -47c2faaast: Document TryStatement and related nodes (#5970) (DonIsaac) -83ca7f5diagnostics: Fully document `oxc_diagnostics` (#5865) (DonIsaac) -bacfbb8oxc: Add submodule documentation (#5984) (DonIsaac) -3120c6cparser: Add module and struct level documentation (#5831) (DonIsaac) -1ccf290semantic: Document `AstNode` and `AstNodes` (#5872) (DonIsaac) -e04841csyntax: Add ModuleRecord documentation (#5818) (DonIsaac) -7085829transformer: Arrow function transform: comment about incomplete implementation (#5945) (overlookmotel) -66b4688transformer: React: convert docs to standard format (#5891) (overlookmotel) -7f05eedtransformer: Add comment about missing features in arrow function transform (#5855) (overlookmotel) -8770647transformer: Correct docs for arrow function transform (#5854) (overlookmotel) ### Refactor -f4fac0fast: Remove `.iter()` where not needed (#5904) (camchenry) -17cd903ast: Move functions to top level in `ast` macro (#5793) (overlookmotel) -cf97f6dast: Import `syn` types in `ast` macro (#5792) (overlookmotel) -dc10eafast: Split `ast` macro into multiple files (#5791) (overlookmotel) -6dd6f7cast: Change `Comment` struct (#5783) (Boshen) -bb95306codegen: Change annotation comment tests to snapshot (#5800) (Boshen) -e613a3dcodegen: Prepare to add leading comments by adding a template method pattern (#5784) (Boshen) -7caae5bcodegen: Add `GetSpan` requirement to `Gen` trait (#5772) (Boshen) -c84bd28isolated-declarations: Simplify to infer the getter and setter methods (#5966) (Dunqing) -67b4220isolated-declarations: Simplify handling VariableDeclaration transform (#5916) (Dunqing) -2fd5c2aisolated-declarations: Pre-filter statements that do not need to be transformed (#5909) (Dunqing) -943bd76minifier: Move tests to their src files (#5912) (Boshen) -cbaeea6minifier: Clean up some tests (#5910) (Boshen) -144611eminifier: Align ast pass names with closure compiler (#5908) (Boshen) -31e9db4parser: Shorten `UniquePromise` code (#5805) (overlookmotel) -2322b8bparser: Remove dead code warning when running tests (#5804) (overlookmotel) -4abfa76parser: Add `--ast` and `--comments` to example (Boshen) -a4b55bfparser: Use AstBuilder (#5743) (Boshen) -d910304semantic: Rename lifetime on `impl IntoIterator for &AstNodes` (#5881) (overlookmotel) -f360e2csemantic: Remove redundunt is_leading check for JSDoc (#5877) (leaysgur) -9115dd9semantic: Use `Comment::attached_to` for jsdoc attachment (#5876) (Boshen) -db4f16asemantic: Call `with_trivias` before `build_with_jsdoc` (#5875) (Boshen) -3d13c6dsemantic: Impl `IntoIterator` for `&AstNodes` (#5873) (DonIsaac) -47d9ad8semantic: Remove unused vars warning in release mode (#5803) (overlookmotel) -155d7fctransformer: Arrow function transform: ignore type fields when finding enclosing arrow function (#5944) (overlookmotel) -2cf5607transformer: Split up logical assignment operator transform into functions (#5902) (overlookmotel) -41fbe15transformer: Internal functions not `pub` in logical assignment operator transform (#5898) (overlookmotel) -b11d91ctransformer: Remove nested match in logical assignment operator transform (#5897) (overlookmotel) -52c9903transformer: JSX: use `AstBuilder::vec_from_iter` (#5862) (overlookmotel) -74364adtransformer: JSX: merge `transform_jsx_attribute_item` into `transform_jsx` (#5861) (overlookmotel) -d2eaa7dtransformer: Reorder match arms in JSX transform (#5860) (overlookmotel) -58a8327transformer: Simplify match in JSX transform (#5859) (overlookmotel) -b9c4564transformer: Transformer example output semantic + transformer errors (#5852) (overlookmotel) -03e02a0transformer: Comment about potential improvement to arrow function transform (#5841) (overlookmotel) -40cdad5transformer: Remove repeat code in arrow function transform (#5837) (overlookmotel) -3dd188ctransformer: Deref `SymbolId` immediately (#5836) (overlookmotel) -03a9e1atransformer: Reorder methods in arrow function transform (#5830) (overlookmotel) -4d97184transformer: Rename vars in arrow function transform (#5827) (overlookmotel) -01c5b7ctransformer: Shorten code in arrow functions transform (#5826) (overlookmotel) -85ac3f7transformer: Arrow functions transform do not wrap function expressions in parentheses (#5824) (overlookmotel) -1c1353btransformer: Use AstBuilder instead of using struct constructor (#5778) (Boshen) ### Testing -84b7d1aindex: Add unit tests to `oxc_index` (#5979) (DonIsaac) -d6cbbe7isolated-declarations: Arrow function unions in return signature (#5973) (DonIsaac) --------- Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
231 lines
7.9 KiB
TOML
231 lines
7.9 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.30.0", path = "crates/oxc" }
|
|
oxc_allocator = { version = "0.30.0", path = "crates/oxc_allocator" }
|
|
oxc_ast = { version = "0.30.0", path = "crates/oxc_ast" }
|
|
oxc_ast_macros = { version = "0.30.0", path = "crates/oxc_ast_macros" }
|
|
oxc_cfg = { version = "0.30.0", path = "crates/oxc_cfg" }
|
|
oxc_codegen = { version = "0.30.0", path = "crates/oxc_codegen" }
|
|
oxc_diagnostics = { version = "0.30.0", path = "crates/oxc_diagnostics" }
|
|
oxc_index = { version = "0.30.0", path = "crates/oxc_index" }
|
|
oxc_isolated_declarations = { version = "0.30.0", path = "crates/oxc_isolated_declarations" }
|
|
oxc_mangler = { version = "0.30.0", path = "crates/oxc_mangler" }
|
|
oxc_minifier = { version = "0.30.0", path = "crates/oxc_minifier" }
|
|
oxc_module_lexer = { version = "0.30.0", path = "crates/oxc_module_lexer" }
|
|
oxc_parser = { version = "0.30.0", path = "crates/oxc_parser" }
|
|
oxc_regular_expression = { version = "0.30.0", path = "crates/oxc_regular_expression" }
|
|
oxc_semantic = { version = "0.30.0", path = "crates/oxc_semantic" }
|
|
oxc_sourcemap = { version = "0.30.0", path = "crates/oxc_sourcemap" }
|
|
oxc_span = { version = "0.30.0", path = "crates/oxc_span" }
|
|
oxc_syntax = { version = "0.30.0", path = "crates/oxc_syntax" }
|
|
oxc_transform_napi = { version = "0.30.0", path = "napi/transform" }
|
|
oxc_transformer = { version = "0.30.0", path = "crates/oxc_transformer" }
|
|
oxc_traverse = { version = "0.30.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" }
|
|
|
|
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 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
|