Boshen
c828b7030f
chore(deps): update rust crates ( #6368 )
2024-10-08 14:36:52 +00:00
oxc-bot
6921d50371
release(crates): v0.31.0 ( #6360 )
...
## [0.31.0] - 2024-10-08
- 01b878e parser: [**BREAKING**] Use `BindingIdentifier` for `namespace`
declaration names (#6003 ) (DonIsaac)
- 95ca01c cfg: [**BREAKING**] Make BasicBlock::unreachable private
(#6321 ) (DonIsaac)
- 020bb80 codegen: [**BREAKING**] Change to `CodegenReturn::code` and
`CodegenReturn::map` (#6310 ) (Boshen)
- 409dffc traverse: [**BREAKING**] `generate_uid` return a
`BoundIdentifier` (#6294 ) (overlookmotel)
- 5a73a66 regular_expression: [**BREAKING**] Simplify public APIs
(#6262 ) (leaysgur)
- 32d972e parser: [**BREAKING**] Treat unambiguous files containing TS
export assignments as modules (#6253 ) (overlookmotel)
- 4f6bc79 transformer: [**BREAKING**] Remove `source_type` param from
`Transformer::new` (#6251 ) (overlookmotel)
- afc3ccb napi/transform: [**BREAKING**] Rename
`TransformOptions::react` to `jsx`. (#6211 ) (Boshen)
- 82ab689 transformer,minifier: [**BREAKING**] Move define and inject
plugin from minifier to transformer (#6199 ) (Boshen)
### Features
- fa4d505 cfg: Derive more base traits for CFG blocks (#6320 ) (DonIsaac)
- 14275b1 cfg: Color-code edges in CFG dot diagrams (#6314 ) (DonIsaac)
- 7566c2d data_structures: Add `as_slice` + `as_mut_slice` methods to
stacks (#6216 ) (overlookmotel)
- c3c3447 data_structures: Add `oxc_data_structures` crate; add stack
(#6206 ) (Boshen)
- e304e8c minifier: Minify exponential arithmetic operation. (#6281 )
(7086cmd)
- f9ae70c minifier: Minify basic arithmetic calculations. (#6280 )
(7086cmd)
- 4008afe minifier: Fold array and object constructors (#6257 )
(camchenry)
- 115ccc9 minifier: Bitwise not in exceeded value. (#6235 ) (7086cmd)
- ee6c850 minifier: Scaffold peephole replace known methods. (#6245 )
(7086cmd)
- c32af57 minifier: Fold demical bitwise not for bigint. (#6233 )
(7086cmd)
- 23b6464 minifier: Fold true / false comparison. (#6225 ) (7086cmd)
- 585ccda minifier: Support subtraction assignment. (#6214 ) (7086cmd)
- cca0034 minifier: Handle positive `NaN` and `Infinity`. (#6207 )
(7086cmd)
- dac8f09 minifier: Minify unary plus negation. (#6203 ) (7086cmd)
- 3b79e1b minifier: Evaluate bigint in fold constant (#6178 ) (Boshen)
- abd3a9f napi/transform: Perform dce after define plugin (#6312 )
(Boshen)
- a0ccc26 napi/transform: Add `lang` option to change source type
(#6309 ) (Boshen)
- f98e12c napi/transform: Add inject plugin (#6250 ) (Boshen)
- 291891e napi/transform: Add `define` option (#6212 ) (Boshen)
- 51a78d5 napi/transform: Rename all mention of React to Jsx; remove
mention of `Binding` (#6198 ) (Boshen)
- 2f888ed oxc: Add napi transform options (#6268 ) (Boshen)
- 8729755 oxc,napi/transform: Napi/transform use oxc compiler pipeline
(#6298 ) (Boshen)
- f6e42b6 sourcemap: Add support for sourcemap debug IDs (#6221 ) (Tim
Fish)
- 9e62396 syntax_operations: Add crate `oxc_syntax_operations` (#6202 )
(Boshen)
- cf20f3a transformer: Exponentiation transform: support private fields
(#6345 ) (overlookmotel)
### Bug Fixes
- 84b2d07 codegen: Converts line comment to block comment if it is a
`PURE` comment (#6356 ) (Dunqing)
- e9eeae0 isolated-declarations: False positive for function with a type
asserted parameters (#6181 ) (Dunqing)
- d953a6b minifier: Correct the reference link (#6283 ) (dalaoshu)
- 37cbabb minifier: Should not handle the strict operation for bool
comparison. (#6261 ) (7086cmd)
- e29c067 minifier: Handle exceeded shifts. (#6237 ) (7086cmd)
- 294da86 napi/transform: Fix index.d.ts (Boshen)
- 9736aa0 oxc_transformer: Define `import.meta` and `import.meta.*`
(#6277 ) (IWANABETHATGUY)
- 6159560 parser: String `ImportSpecifier`s for type imports (#6352 )
(DonIsaac)
- 1380d8b parser: Should regard comments where after `=` as leading
comments of next token (#6355 ) (Dunqing)
- 2bcd12a transformer: Exponentiation transform: fix reference flags
(#6330 ) (overlookmotel)
- 28cbfa7 transformer: Exponentiation transform: fix temp var names
(#6329 ) (overlookmotel)
- 3a4bcc7 transformer: Exponentiation transform: fix temp var names
(#6318 ) (overlookmotel)
- ccb7bdc transformer: Exponentiation transform: do not replace object
when private property (#6313 ) (overlookmotel)
- 56d50cf transformer: Exponentiation transform: do not assume `Math` is
not a local var (#6302 ) (overlookmotel)
- bd81c51 transformer: Exponentiation transform: fix duplicate symbols
(#6300 ) (overlookmotel)
- 06797b6 transformer: Logical assignment operator transform: fix
reference IDs (#6289 ) (overlookmotel)
- 4b42047 transformer: Fix memory leak in `ReplaceGlobalDefines` (#6224 )
(overlookmotel)
- a28926f transformer: Fix inserting `require` with `front` option
(#6188 ) (overlookmotel)
- b92fe84 transformer: `NonEmptyStack::push` write value before updating
cursor (#6169 ) (overlookmotel)
### Performance
- 5db9b30 allocator: Use lower bound of size hint when creating Vecs
from an iterator (#6194 ) (DonIsaac)
- 788e444 transformer: Parse options from comments only once (#6152 )
(overlookmotel)
- da2b2a4 transformer: Look up `SymbolId` for `require` only once
(#6192 ) (overlookmotel)
- 40bd919 transformer: Faster parsing JSX pragmas from comments (#6151 )
(overlookmotel)
### Documentation
- eb1d0b8 transformer: Exponentiation transform: update doc comments
(#6315 ) (overlookmotel)
- c7636d7 traverse: Remove erroneous doc comment (#6328 ) (overlookmotel)
### Refactor
- f7d1136 allocator: Remove unnecessary `Vec` impl (#6213 )
(overlookmotel)
- 40932f7 cfg: Use IndexVec for storing basic blocks (#6323 ) (DonIsaac)
- a1e0d30 cfg: Add type alias for Graph (#6322 ) (DonIsaac)
- 7672793 cfg: Move block data types to separate file (#6319 ) (DonIsaac)
- cc57541 data_structures: `NonEmptyStack::len` hint that `len` is never
0 (#6220 ) (overlookmotel)
- 147a5d5 data_structures: Remove `is_empty` methods for non-empty
stacks (#6219 ) (overlookmotel)
- 61805fd data_structures: Add debug assertion to `SparseStack` (#6218 )
(overlookmotel)
- dbfa0bc data_structures: Add `len` method to `StackCommon` trait
(#6215 ) (overlookmotel)
- ac5a23f minifier: Use ctx.ast.vec instead of Vec::new. (#6331 )
(7086cmd)
- 1cee207 minifier: Some boilerplate work for PeepholeFoldConstants
(#6054 ) (Boshen)
- 5b5daec napi: Use vitest (#6307 ) (Boshen)
- 58a8615 napi/transform: Remove context (#6306 ) (Boshen)
- 099ff3a napi/transform: Remove "Binding" from types; fix type error
(#6260 ) (Boshen)
- 54c1c53 napi/transform: Remove a call on `TransformOptions::clone`
(#6210 ) (Boshen)
- aa0dbb6 oxc: Add `napi` feature, change napi parser to use `oxc` crate
(#6265 ) (Boshen)
- 3b53dd4 parser: Provide better error messages for `const` modifiers on
class elements (#6353 ) (DonIsaac)
- acab777 regular_expression: Misc fixes (#6234 ) (leaysgur)
- bdd9e92 semantic: Rename vars from `ast_node_id` to `node_id` (#6304 )
(overlookmotel)
- d110700 semantic: Dereference IDs as quickly as possible (#6303 )
(overlookmotel)
- 03bc041 syntax: Remove some unsafe code creating IDs (#6324 )
(overlookmotel)
- bd5fb5a transformer: Exponentiation transform: rename methods (#6344 )
(overlookmotel)
- 4aa4e6b transformer: Exponentiation transform: do not wrap in
`SequenceExpression` if not needed (#6343 ) (overlookmotel)
- a15235a transformer: Exponentiation transform: no cloning (#6338 )
(overlookmotel)
- 7d93b25 transformer: Exponentiation transform: split into 2 paths
(#6316 ) (overlookmotel)
- 15cc8af transformer: Exponentiation transform: break up into functions
(#6301 ) (overlookmotel)
- 7f5a94b transformer: Use `Option::get_or_insert_with` (#6299 )
(overlookmotel)
- 0cea6e9 transformer: Exponentiation transform: reduce identifier
cloning (#6297 ) (overlookmotel)
- ac7a3ed transformer: Logical assignment transform: reduce identifier
cloning (#6296 ) (overlookmotel)
- 527f7c8 transformer: Nullish coalescing transform: no cloning
identifier references (#6295 ) (overlookmotel)
- 7b62966 transformer: Move `BoundIdentifier` into `oxc_traverse` crate
(#6293 ) (overlookmotel)
- c7fbf68 transformer: Logical assignment operator transform: no cloning
identifier references (#6290 ) (overlookmotel)
- f0a74ca transformer: Prefer `create_bound_reference_id` to
`create_reference_id` (#6282 ) (overlookmotel)
- ba3e85b transformer: Fix spelling (#6279 ) (overlookmotel)
- bc757c8 transformer: Move functionality of common transforms into
stores (#6243 ) (overlookmotel)
- 1c31932 transformer: Rename var in `VarDeclarations` common transform
(#6242 ) (overlookmotel)
- 0400ff9 transformer: `VarDeclarations` common transform: check if at
top level with `ctx.parent()` (#6231 ) (overlookmotel)
- 235cdba transformer: Use AstBuilder instance from TraverseCtx (#6209 )
(overlookmotel)
- a7ed29e transformer: Insert `import` statement or `require` depending
on source type (#6191 ) (overlookmotel)
- 4c63f0e transformer: Rename methods (#6190 ) (overlookmotel)
- 900cb46 transformer: Convert `ModuleImports` into common transform
(#6186 ) (overlookmotel)
- 00e2802 transformer: Introduce `TopLevelStatements` common transform
(#6185 ) (overlookmotel)
- 70d4c56 transformer: Rename `VarDeclarationsStore` methods (#6184 )
(overlookmotel)
- 81be545 transformer: Export `var_declarations` module from `common`
module (#6183 ) (overlookmotel)
- 02fedf5 transformer: Shorten import (#6180 ) (overlookmotel)
- f2ac584 transformer: Use TraverseCtx's ast in ModuleImports (#6175 )
(Dunqing)
- 21b08ba transformer: Shared `VarDeclarations` (#6170 ) (overlookmotel)
- 0dd9a2e traverse: Add helper methods to `BoundIdentifier` (#6341 )
(overlookmotel)
- c0e2fef traverse: Function to get var name from node (#6317 )
(overlookmotel)
- adc5381 traverse: `TraverseAncestry` use `NonEmptyStack` (#6217 )
(overlookmotel)
### Testing
- 964d71e minifier: Add arithmetic tests for fold constants. (#6269 )
(7086cmd)
- fcb4651 minifier: Enable null comparison with bigint. (#6252 )
(7086cmd)
- d4f2ee9 transformer: Tidy up transform checker (#6287 ) (overlookmotel)
- 0f5afd7 transformer: 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>
2024-10-08 20:55:24 +08:00
oxc-bot
62d45bf14e
release(oxlint): v0.9.10 ( #6340 )
...
## [0.9.10] - 2024-10-07
### Features
- f272137 editors/vscode: Clear diagnostics on file deletion (#6326 )
(dalaoshu)
- 1a5f293 editors/vscode: Update VSCode extention to use project's
language server (#6132 ) (dalaoshu)
- 376cc09 linter: Implement `no-throw-literal` (#6144 ) (dalaoshu)
- 5957214 linter: Allow fixing in files with source offsets (#6197 )
(camchenry)
- a089e19 linter: Eslint/no-else-return (#4305 ) (yoho)
- 183739f linter: Implement prefer-await-to-callbacks (#6153 ) (dalaoshu)
- ae539af linter: Implement no-return-assign (#6108 ) (Radu Baston)
### Bug Fixes
- 9e9808b linter: Fix regression when parsing ts in vue files (#6336 )
(Boshen)
- 93c6db6 linter: Improve docs and diagnostics message for
no-else-return (#6327 ) (DonIsaac)
- e0a3378 linter: Correct false positive in
`unicorn/prefer-string-replace-all` (#6263 ) (H11)
- ea28ee9 linter: Improve the fixer of `prefer-namespace-keyword`
(#6230 ) (dalaoshu)
- f6a3450 linter: Get correct source offsets for astro files (#6196 )
(camchenry)
- be0030c linter: Allow whitespace control characters in
`no-control-regex` (#6140 ) (camchenry)
- e7e8ead linter: False positive in `no-return-assign` (#6128 )
(DonIsaac)
### Performance
- ac0a82a linter: Reuse allocator when there are multiple source texts
(#6337 ) (Boshen)
- 50a0029 linter: Do not concat vec in `no-useless-length-check` (#6276 )
(camchenry)
### Documentation
- 7ca70dd linter: Add docs for `ContextHost` and `LintContext` (#6272 )
(camchenry)
- a949ecb linter: Improve docs for `eslint/getter-return` (#6229 )
(DonIsaac)
- 14ba263 linter: Improve docs for `eslint-plugin-import` rules (#6131 )
(dalaoshu)
### Refactor
- 642725c linter: Rename vars from `ast_node_id` to `node_id` (#6305 )
(overlookmotel)
- 8413175 linter: Move shared function from utils to rule (#6127 )
(dalaoshu)
- ba9c372 linter: Make jest/vitest rule mapping more clear (#6273 )
(camchenry)
- 82b8f21 linter: Add schemars and serde traits to AllowWarnDeny and
RuleCategories (#6119 ) (DonIsaac)
- ea908f7 linter: Consolidate file loading logic (#6130 ) (DonIsaac)
- db751f0 linter: Use regexp AST visitor in `no-control-regex` (#6129 )
(camchenry)
- 3aa7e42 linter: Use RegExp AST visitor for `no-hex-escape` (#6117 )
(camchenry)
- 9d5b44a linter: Use regex visitor in `no-regex-spaces` (#6063 )
(camchenry)
- 0d44cf7 linter: Use regex visitor in `no-useless-escape` (#6062 )
(camchenry)
- eeb8873 linter: Use regex visitor in `no-empty-character-class`
(#6058 ) (camchenry)
### Testing
- d883562 linter: Invalid `eslint/no-unused-vars` options (#6228 )
(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>
2024-10-08 12:14:54 +08:00
DonIsaac
40932f79b1
refactor(cfg): use IndexVec for storing basic blocks ( #6323 )
...
Use an `IndexVec` when storing basic blocks. This makes the link between nodes in `.graph` and elements of `.basic_blocks` more clear. I had to rename `BasicBlockId` to `BlockNodeId` to avoid a name collision. I wasn't sure what else to name the `Idx` type for the basic blocks vec.
2024-10-07 19:28:40 -04:00
Boshen
9e62396803
feat(syntax_operations): add crate oxc_syntax_operations ( #6202 )
...
I intend to add constant folding and eval logic to this crate. There are downstream tools that require these functionalities alone.
It's also reasonable to move these traits out of the `ast` crate.
2024-10-07 05:39:59 +00:00
Boshen
8729755baa
feat(oxc,napi/transform): napi/transform use oxc compiler pipeline ( #6298 )
...
part of #6156
2024-10-05 16:35:09 +00:00
overlookmotel
e19deaa102
ci(transformer): move post-transform checker to tasks crate ( #6288 )
...
Move post-transform checker into a `tasks` crate. It doesn't feel like it belongs in `oxc_semantic`. It also feels like too heavy a lump of code to put in `tasks/common`.
2024-10-05 14:48:37 +00:00
Boshen
2f888ed871
feat(oxc): add napi transform options ( #6268 )
2024-10-03 13:36:38 +00:00
Boshen
aa0dbb6375
refactor(oxc): add napi feature, change napi parser to use oxc crate ( #6265 )
2024-10-03 04:28:38 +00:00
Boshen
f98e12c13a
feat(napi/transform): add inject plugin ( #6250 )
2024-10-02 15:15:51 +00:00
overlookmotel
adc538141c
refactor(traverse): TraverseAncestry use NonEmptyStack ( #6217 )
...
#6206 moved stack types into a shared crate. So now we can use it for the stack in `TraverseAncestry`.
2024-10-01 12:26:37 +00:00
Boshen
c3c3447ac3
feat(data_structures): add oxc_data_structures crate; add stack ( #6206 )
2024-10-01 10:02:45 +00:00
Boshen
82ab68984e
feat(transformer,minifier)!: move define and inject plugin from minifier to transformer ( #6199 )
2024-10-01 03:59:24 +00:00
oxc-bot
6c01fd7480
release(crates): v0.30.5 ( #6163 )
...
## [0.30.5] - 2024-09-29
### Features
- 15552ac napi/transform: Display semantic error (#6160 ) (Boshen)
- f50fdcd napi/transform: Make react refresh option take a boolean
(#6146 ) (Boshen)
### Bug Fixes
- f27d59f napi/transform: Remove confusing `jsx` option (#6159 ) (Boshen)
- bfd1988 transformer/react: Should not collect use-hooks if it's a
nested member expression (#6143 ) (Dunqing)
### Refactor
- ab187d1 codegen: Restrict visibility of internal methods (#6145 )
(DonIsaac)
- 375bebe transformer: Improve parsing React pragmas (#6138 )
(overlookmotel)
- 0836f6b transformer: Move parsing pragmas into TS transform (#6137 )
(overlookmotel)
- 30424fa transformer: TS transforms only store options they need
(#6135 ) (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>
2024-09-29 15:20:19 +08:00
DonIsaac
ea908f742d
refactor(linter): consolidate file loading logic ( #6130 )
...
# Human Description
Low on time, so this one is short.
- consolidate source file and partial loader logic into `loader` module. I have more plans for this.
- ~LSP no longer uses `VALID_EXTENSIONS`, so now `.d.ts` files (and the like) will be linted as well~ LSP does not respect `.gitignore` files, so this change was reverted.
# AI Description
## Refactor Loader and Partial Loader
This PR refactors the loader and partial loader functionality in the oxc_linter crate:
* Introduce a new `Loader` struct with methods for checking if a file can be loaded and loading file contents
* Move `partial_loader` module to `loader/partial_loader`
* Rename `JavaScriptSource` to `source.rs` and move it to the `loader` module
* Update `JavaScriptSource` to use `u32` for `start` offset instead of `usize`
* Refactor `IsolatedLintHandler` to use the new `Loader`
* Update imports and module references throughout the codebase
This change improves the organization of the loader-related code and provides a more unified interface for loading different file types.
2024-09-29 02:48:01 +00:00
oxc-bot
73098a43ff
release(crates): v0.30.4 ( #6134 )
...
## [0.30.4] - 2024-09-28
### Bug Fixes
- 8582ae3 codegen: Missing parentheses if there is a pure comment before
a NewExpression as a ComputedMemberExpression's callee (#6105 ) (Dunqing)
- fd6798f parser: Remove unintended `pub Kind` (#6109 ) (Boshen)
- 6f98aad sourcemap: Align sourcemap type with Rollup (#6133 ) (Boshen)
- 64d4756 transformer: Fix debug assertion in `Stack` (#6106 )
(overlookmotel)
### Performance
- 05852a0 codegen: Do not check whether there are annotation comments or
not if we don't preserve annotation comments (#6107 ) (Dunqing)
### Documentation
- 26a273a oxc-transform: Update README (Boshen)
- e2c5baf transformer: Fix formatting of README (#6111 ) (overlookmotel)
### Refactor
- 2090fce semantic: Fix lint warning in nightly (#6110 ) (overlookmotel)
- 7bc3988 transformer: Remove dead code (#6124 ) (overlookmotel)
- 07fe45b transformer: Exponentiation operator: convert to match (#6123 )
(overlookmotel)
- 4387845 transformer: Share `TypeScriptOptions` with ref not `Rc`
(#6121 ) (overlookmotel)
- 09e41c2 transformer: Share `TransformCtx` with ref not `Rc` (#6118 )
(overlookmotel)
- 58fd6eb transformer: Pre-allocate more stack space (#6095 )
(overlookmotel)
- 9ac80bd transformer: Add wrapper around `NonNull` (#6115 )
(overlookmotel)
- c50500e transformer: Move common stack functionality into
`StackCommon` trait (#6114 ) (overlookmotel)
- 9839059 transformer: Simplify `StackCapacity` trait (#6113 )
(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>
2024-09-28 13:08:44 +08:00
Boshen
c519182359
feat(napi): add napi minifier ( #6053 )
2024-09-28 00:46:52 +08:00
oxc-bot
3ef248afbd
release(oxlint): v0.9.9 ( #6101 )
...
## [0.9.9] - 2024-09-27
### Bug Fixes
- bd8f786 linter: Rule and generic filters do not re-configure existing
rules (#6087 ) (DonIsaac)
- c5cdb4c linter: Disable all rules in a plugin when that plugin gets
turned off (#6086 ) (DonIsaac)
- 6c855af linter: Only write fix results if source code has changed
(#6096 ) (DonIsaac)
- 8759528 linter: Category filters not re-configuring already-enabled
rules (#6085 ) (DonIsaac)
- c2616f7 linter: Fix panic in fixer for `oxc/only-used-in-recursion`
(#6070 ) (camc314)
- 3da3845 linter: Malformed snippets in `eslint/for-direction` docs
(#6060 ) (DonIsaac)
- c047d42 linter: `no-useless-escape`: do not crash on backslash
character (#6048 ) (camchenry)
- 6f76ebe linter: Ignore invalid or partial disable directives (#6045 )
(camchenry)
- 09a24cd linter: Fix false positives for generics in
`no-unexpected-multiline` (#6039 ) (camchenry)
- d05fd20 linter: Newline in type parameters causing false positive in
`no-unexpected-multiline` (#6031 ) (DonIsaac)
- 01b9c4b npm/oxlint: Make bin/oxc_language_server an executable (#6066 )
(Boshen)
### Performance
- f8464a3 linter: `no-magic-numbers` remove redudant checks in
`is_array_index` (#6033 ) (Alexander S.)
- c16ae60 linter: `jest/prefer-hooks-in-order`: rewrite rule to allocate
less and iterate fewer times (#6030 ) (camchenry)
### Documentation
- a4fdf1b linter: Improve docs for promise rules (#6051 ) (dalaoshu)
- 21cdb78 linter: Fix incorrect "bad" example in
`only-used-in-recursion` (#6029 ) (Boshen)
### Refactor
- 1f92d61 linter: `jest/prefer-hooks-in-order`: improve diagnostic
messages (#6036 ) (camchenry)
### Testing
- 55949eb linter: Add `OxlintRules::override_rules` tests (#6081 )
(DonIsaac)
- 1a6923a linter: Add filter parsing test cases (#6080 ) (DonIsaac)
- 58d333a linter: Add more test cases for disable directives (#6047 )
(camchenry)
---------
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-27 14:41:55 +08:00
oxc-bot
d56264ee9a
release(crates): v0.30.3 ( #6104 )
...
## [0.30.3] - 2024-09-27
### Bug Fixes
- a8338dd isolated-declarations: Accidentally collected references of
original ast (#6102 ) (Dunqing)
- 933a743 semantic: Add interfaces and functions to
`SymbolFlags::ClassExcludes` (#6057 ) (DonIsaac)
### Documentation
- 6167f29 oxc-transform: Modify the example code in the `Readme` file
(#6103 ) (loong.woo)
---------
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-27 14:23:48 +08:00
oxc-bot
60d02a61f9
release(crates): v0.30.2 ( #6100 )
...
## [0.30.2] - 2024-09-27
### Features
- 60c52ba ast: Allow passing span to `void_0` method (#6065 ) (Dunqing)
- cca433f codegen: Print `vite` / `webpack` special comments (#6021 )
(Dunqing)
- 8d026e1 regular_expression: Implement `GetSpan` for RegExp AST nodes
(#6056 ) (camchenry)
- 7764793 regular_expression: Implement visitor pattern trait for regex
AST (#6055 ) (camchenry)
- f866781 semantic: Check for type annotations on left side of `for..in`
and `for..of` iterators (#6043 ) (DonIsaac)
- 8b2e9aa semantic: Check for JSDoc types in TS type annotations (#6042 )
(DonIsaac)
- 28da771 transformer: Do not transform `**` with bigint literals
(#6023 ) (Boshen)
### Bug Fixes
- a88504c diagnostics: Check for terminal when displaying links (#6018 )
(Boshen)
- 418ae25 isolated-declarations: Report uninferrable types in arrays
(#6084 ) (michaelm)
- e0a8959 minifier: Compute `void number` as `undefined` (#6028 )
(Boshen)
- 0658576 paresr: Do not report missing initializer error in ambient
context (#6020 ) (Boshen)
- b1af73d semantic: Do not create a `global` symbol for `declare global
{}` (#6040 ) (DonIsaac)
- c8682e9 semantic,codegen,transformer: Handle definite `!` operator in
variable declarator (#6019 ) (Boshen)
### Performance
- 6b7d3ed isolated-declarations: Should clone transformed AST rather
than original AST (#6078 ) (Dunqing)
- 85aff19 transformer: Introduce `Stack` (#6093 ) (overlookmotel)
- ad4ef31 transformer: Introduce `NonEmptyStack` (#6092 ) (overlookmotel)
### Documentation
- 3099709 allocator: Document `oxc_allocator` crate (#6037 ) (DonIsaac)
- d60ceb4 oxc: Add README.md and crate-level docs (#6035 ) (DonIsaac)
- efabfc8 semantic: Improve doc comments on `Reference` methods (#6076 )
(overlookmotel)
### Refactor
- 1fc80d1 ast: Move all ts ast related impl methods to `ast_impl`
(#6015 ) (Dunqing)
- fe696f0 codegen: Simplify printing annotation comments (#6027 )
(Dunqing)
- e60ce50 transformer: Add `SparseStack::with_capacity` method (#6094 )
(overlookmotel)
- 1399d2c transformer: Move `SparseStack` definition into folder (#6091 )
(overlookmotel)
- 6bd29dd transformer: Add more debug assertions (#6090 ) (overlookmotel)
- c90b9bf transformer: Rename `SparseStack` methods (#6089 )
(overlookmotel)
- 2b380c8 transformer: Remove unsued `self.ctx` (#6022 ) (Boshen)
### Testing
- 93575cd semantic: Add comprehensive regression test suite (#5976 )
(DonIsaac)
- a4cec75 transformer: Enable tests (#6032 ) (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>
2024-09-27 13:28:12 +08:00
overlookmotel
ad4ef31f9f
perf(transformer): introduce NonEmptyStack ( #6092 )
...
`NonEmptyStack` is a stack structure, optimized for fast push/pop and reading/writing the last entry on the stack. By always having 1 at least one entry, `last` and `last_mut` can be made branchless and extremely cheap (only 1 CPU op).
Use `NonEmptyStack` as one of the backing stores in `SparseStack`.
2024-09-27 04:28:53 +00:00
oxc-bot
539751cd13
release(oxlint): v0.9.8 ( #6025 )
...
## [0.9.8] - 2024-09-24
### Bug Fixes
- e3c8a12 linter: Fix panic in sort-keys (#6017 ) (Boshen)
- 4771492 linter: Fix `import/no_cycle` with `ignoreTypes` (#5995 )
(Boshen)
### Performance
- 5ae3f36 linter: `no-fallthrough`: Use string matching instead of Regex
for default comment pattern (#6008 ) (camchenry)
- 2b17003 linter, prettier, diagnostics: Use `FxHashMap` instead of
`std::collections::HashMap` (#5993 ) (camchenry)
---------
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-24 19:43:11 +08:00
Cam McHenry
65d8f9e8fe
perf(linter, ast-tools, coverage): Use FxHashSet instead of std::collections::HashSet ( #6001 )
2024-09-24 19:29:08 +08:00
oxc-bot
7f0e27afd9
release(crates): v0.30.1 ( #6016 )
...
## [0.30.1] - 2024-09-24
### Features
- 5c323a2 minifier: Loop compressor passes (#6013 ) (Boshen)
### Bug Fixes
- 9ca202a codegen: Preserve newlines between comments (#6014 ) (Boshen)
- 4a99372 codegen: Print jsdoc comments for `TSEnumMember`s (#6007 )
(camc314)
- 97a2c41 isolated-declarations: False positive for class private getter
with non-inferrable return type (#5987 ) (michaelm)
### Performance
- 2b17003 linter, prettier, diagnostics: Use `FxHashMap` instead of
`std::collections::HashMap` (#5993 ) (camchenry)
- 7b90d79 transformer: `SparseStack` always keep minimum 1 entry (#5962 )
(overlookmotel)
- 28fe80a transformer: Logical assignment operator transform use
`SparseStack` (#5960 ) (overlookmotel)
- 9f7d4b7 transformer: Exponentiation operator transform use
`SparseStack` (#5959 ) (overlookmotel)
- 5dc0154 transformer: Nullish coalescing operator transform use
`SparseStack` (#5942 ) (overlookmotel)
- 618e89e transformer: Arrow function transform: reduce stack memory
usage (#5940 ) (overlookmotel)
### Documentation
- 5a0d17c ast: Document more AST nodes (#6000 ) (DonIsaac)
- 18371dd oxc: Include feature-guarded modules in docs.rs (#6012 )
(DonIsaac)
- 1abfe8f semantic: Document `SymbolTable` (#5998 ) (DonIsaac)
- f5eee72 semantic: Correct docs for `Reference` (#5992 ) (overlookmotel)
- 860f108 transformer: Add to arrow functions transform docs (#5989 )
(overlookmotel)
### Refactor
- 0a2f687 minifier: Move dce conditional expression to `RemoveDeadCode`
(#5971 ) (Boshen)
- f02bf51 transformer: Arrow function transform: remove unnecessary
assertion (#6002 ) (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>
2024-09-24 14:03:03 +08:00
camchenry
02d5637dbc
perf(ast-tools): use FxHashMap over std::collections::HashMap ( #5997 )
2024-09-23 18:28:54 +00:00
camchenry
2b17003e0b
perf(linter, prettier, diagnostics): use FxHashMap instead of std::collections::HashMap ( #5993 )
...
Using `FxHashMap` is faster than `HashMap` in many cases, especially for hashing-heavy workloads. This change improves the performance of the linter, prettier, and diagnostics crates by using `FxHashMap` instead of `std::collections::HashMap`.
2024-09-23 16:29:05 +00:00
oxc-bot
859227e457
release(oxlint): v0.9.7 ( #5988 )
...
## [0.9.7] - 2024-09-23
### Features
- d24985e linter: Add `oxc-security/api-keys` (#5906 ) (DonIsaac)
- f9b44c5 linter: Add unicode sets support to `no-useless-escape` rule
(#5974 ) (camchenry)
- 0f19848 linter: Implement `no-unexpected-multiline` rule (#5911 )
(camchenry)
- 16fe383 linter: Implement `no-extend-native` rule (#5867 ) (Cam
McHenry)
### Bug Fixes
- eed9ac7 linter: Include actual span size in `no-regex-spaces`
diagnostic (#5957 ) (camchenry)
- 40c89c2 linter: Move `promise/avoid-new` to style category (#5961 )
(DonIsaac)
### Performance
- 608d637 linter: Use `aho-corasick` instead of `regex` for string
matching in `jsx-a11y/img-redundant-alt` (#5892 ) (camchenry)
- 3148d4b linter: Check file path after checking node kind for
`nextjs/no-head-element` (#5868 ) (Cam McHenry)
### Refactor
- 0a5a4a9 linter: Use parsed patterns for `unicorn/no-hex-escape`
(#5985 ) (camchenry)
- 2cf2edd linter: Use parsed patterns in `no-empty-character-class` rule
(#5980 ) (camchenry)
- a9a8e2a linter: Use regex parser in `eslint/no-regex-spaces` (#5952 )
(camchenry)
- 05f592b linter: Use parsed patterns in
`unicorn/prefer-string-starts-ends-with` (#5949 ) (camchenry)
- 3273b64 linter: Use parsed patterns for
`unicorn/prefer-string-replace-all` rule (#5943 ) (camchenry)
- ba7b01f linter: Add `LinterBuilder` (#5714 ) (DonIsaac)
- db4f16a semantic: Call `with_trivias` before `build_with_jsdoc`
(#5875 ) (Boshen)
- 3d13c6d semantic: Impl `IntoIterator` for `&AstNodes` (#5873 )
(DonIsaac)
### Testing
- b681c9a linter: Import test cases for `no-empty-character-class`
(#5981 ) (camchenry)
- 767602b linter: Add regression test for #5227 (#5975 ) (camchenry)
---------
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-23 15:10:33 +08:00
oxc-bot
b9178cc5ae
release(crates): v0.30.0 ( #5986 )
...
## [0.30.0] - 2024-09-23
- c96b712 syntax: [**BREAKING**] Remove `SymbolFlags::ArrowFunction`
(#5857 ) (overlookmotel)
### Features
- ae89145 ast: Revert `#[non_exhaustive]` change (#5885 ) (Boshen)
- e8bf30a ast: Add `Comment::real_span` (#5764 ) (Boshen)
- d901772 codegen: Implement minify number from terser (#5929 ) (Boshen)
- 9f6696a codegen: Add new lines to `TSTypeParameterDeclaration` (#5853 )
(Boshen)
- bcdbba3 codegen: Print jsdoc comments that are attached to statements
and class elements (#5845 ) (Boshen)
- 26386da codegen: Have `with_source_text` reserve memory for code
buffer (#5823 ) (DonIsaac)
- 4a62703 isolated-declarations: Handle `export` in the `namespace`
correctly (#5950 ) (Dunqing)
- 84a5816 isolated_declarations: Add `stripInternal` (#5878 ) (Boshen)
- dfbde2c isolated_declarations: Print jsdoc comments (#5858 ) (Boshen)
- 3bf7b24 linter: Make `typescript/no-duplicate-enum-values` a
`correctness` rule (#5810 ) (DonIsaac)
- 9076dee minifier: Implement part of `StatementFusion` (#5936 ) (Boshen)
- a111bb6 oxc_wasm: Add `verbse` option to `debug_dot` (#5879 )
(IWANABETHATGUY)
- 8e7556f parser: Calculate leading and trailing position for comments
(#5785 ) (Boshen)
- 65c337a prettier: Improve ts compatibility (#5900 ) (Alexander S.)
- 6d9ccdd prettier: Support TSMappedType (#5834 ) (Alexander S.)
- b5ac5a6 prettier: Support TSModuleDeclaration (#5813 ) (Alexander S.)
- 74d8714 semantic: Add help message for invalid `let x?: number`
(#5969 ) (DonIsaac)
- 3230ae5 semantic: Add `SemanticBuilder::with_excess_capacity` (#5762 )
(overlookmotel)
- a5f2e9a span: Impl `From<Atom<'a>>` for `Atom` (#5809 ) (DonIsaac)
- a07f03a transformer: Sync `Program::source_type` after transform
(#5887 ) (Boshen)
- 635e918 traverse: `generate_uid_name` method (#5839 ) (overlookmotel)
### Bug Fixes
- 66e919e ast: Correct TS types for JSX (#5884 ) (overlookmotel)
- 0d10521 ast: Serialize `JSXMemberExpressionObject` to estree (#5883 )
(overlookmotel)
- a822c9d ast: Serialize `JSXElementName` to estree (#5882 ) (Boshen)
- f4aefb5 codegen: Print `let[0]` as `(let)[0]` (#5947 ) (Boshen)
- cee9d0b codegen: Fix spacing of `for await (x of y)` (#5890 ) (Boshen)
- 5901d2a codegen: Various spacing issues (#5820 ) (Boshen)
- fd1c46c isolated-declarations: Infer failed if there are two
setter/getter methods that need to be inferred (#5967 ) (Dunqing)
- 6df82ee isolated-declarations: False positive for class private method
that has arguments without type annotations (#5964 ) (Dunqing)
- 6a9e71d isolated-declarations: Wrap TSFunctionType in parentheses if
it is inside the `TSUnionType` (#5963 ) (Dunqing)
- ea32d5b isolated-declarations: Should print constructor assignments
first (#5934 ) (Dunqing)
- 0f96b59 isolated-declarations: Missing print comments in class's
private method (#5931 ) (Dunqing)
- 8780c54 isolated-declarations: Do not union a undefined when the param
type is any or unknown (#5930 ) (Dunqing)
- f07ff14 isolated-declarations: Should not transform signature that has
type annotation (#5927 ) (Dunqing)
- b6a9178 isolated-declarations: Don't collect references when
`ExportNamedDeclaration` has source (#5926 ) (Dunqing)
- 756a571 isolated-declarations: Missing empty export when has an export
declare (#5925 ) (Dunqing)
- e148c80 isolated_declarations: Try fix fixtures (Boshen)
- 9b3f763 isolated_declarations: Try fix new line issue (Boshen)
- ee748b0 isolated_declarations: Fix fixture spacing (Boshen)
- 362c427 mangler,codegen: Do not mangle top level symbols (#5965 )
(Boshen)
- 127c881 napi/transform: Fix jsdoc links (#5886 ) (Boshen)
- 6c04fa1 napi/transform: Make isolated_declaration options optional
(#5880 ) (Boshen)
- 42dcadf parser: Hashbang comment should not keep the end newline char
(#5844 ) (Boshen)
- f1551d6 semantic: `?` on variable declaration type annotations is a
syntax error (#5956 ) (DonIsaac)
- a23879c semantic: Analyze `ReferenceFlags` incorrectly when there are
nested `AssignmentTarget` (#5847 ) (Dunqing)
- 87323c6 transformer: Arrow function transform: prevent stack getting
out of sync (#5941 ) (overlookmotel)
- 4e9e838 transformer: Fix arrow function transform (#5933 )
(overlookmotel)
- 4d5c4f6 transformer: Fix reference flags in logical assignment
operator transform (#5903 ) (overlookmotel)
- d335a67 transformer: Fix references in logical assignment operator
transform (#5896 ) (overlookmotel)
- 9758c1a transformer: JSX source: add `var _jsxFileName` statement
(#5894 ) (overlookmotel)
- 49ee1dc transformer: Arrow function transform handle `this` in arrow
function in class static block (#5848 ) (overlookmotel)
- 172fa03 transformer: Fix stacks in arrow function transform (#5828 )
(overlookmotel)
- d74c7fa transformer: Remove `AstBuilder::copy` from arrow functions
transform (#5825 ) (overlookmotel)
- 3cc38df transformer/react: React refresh panics when encounter `use`
hook (#5768 ) (Dunqing)
### Performance
- cd34f07 isolated-declarations: Combine type/value bindings and
type/value references into one (#5968 ) (Dunqing)
- c477424 mangler: Use `sort_unstable_by_key` instead of `sort_by`
(#5948 ) (Boshen)
- c3e0fb6 semantic: Simplify resetting ReferenceFlags in
`AssignmentExpression` (#5846 ) (Dunqing)
- ff7d9c1 transformer: Arrow function transform: calculate whether
`this` is in arrow function lazily (#5850 ) (Dunqing)
- fd70c4b transformer: Arrow function transform more efficient scope
search (#5842 ) (overlookmotel)
- 56703a3 transformer: Make branch more predictable in arrow function
transform (#5833 ) (overlookmotel)
- 36e698b transformer: Call `transform_jsx` in `exit_expression` rather
than `enter_expression` (#5751 ) (Dunqing)
- aac8316 transformer/react: Improve `is_componentish_name`'s
implementation (#5769 ) (Dunqing)
### Documentation
- acc2d16 ast: Document most TypeScript AST nodes (#5983 ) (DonIsaac)
- 47c2faa ast: Document TryStatement and related nodes (#5970 )
(DonIsaac)
- 83ca7f5 diagnostics: Fully document `oxc_diagnostics` (#5865 )
(DonIsaac)
- bacfbb8 oxc: Add submodule documentation (#5984 ) (DonIsaac)
- 3120c6c parser: Add module and struct level documentation (#5831 )
(DonIsaac)
- 1ccf290 semantic: Document `AstNode` and `AstNodes` (#5872 ) (DonIsaac)
- e04841c syntax: Add ModuleRecord documentation (#5818 ) (DonIsaac)
- 7085829 transformer: Arrow function transform: comment about
incomplete implementation (#5945 ) (overlookmotel)
- 66b4688 transformer: React: convert docs to standard format (#5891 )
(overlookmotel)
- 7f05eed transformer: Add comment about missing features in arrow
function transform (#5855 ) (overlookmotel)
- 8770647 transformer: Correct docs for arrow function transform (#5854 )
(overlookmotel)
### Refactor
- f4fac0f ast: Remove `.iter()` where not needed (#5904 ) (camchenry)
- 17cd903 ast: Move functions to top level in `ast` macro (#5793 )
(overlookmotel)
- cf97f6d ast: Import `syn` types in `ast` macro (#5792 ) (overlookmotel)
- dc10eaf ast: Split `ast` macro into multiple files (#5791 )
(overlookmotel)
- 6dd6f7c ast: Change `Comment` struct (#5783 ) (Boshen)
- bb95306 codegen: Change annotation comment tests to snapshot (#5800 )
(Boshen)
- e613a3d codegen: Prepare to add leading comments by adding a template
method pattern (#5784 ) (Boshen)
- 7caae5b codegen: Add `GetSpan` requirement to `Gen` trait (#5772 )
(Boshen)
- c84bd28 isolated-declarations: Simplify to infer the getter and setter
methods (#5966 ) (Dunqing)
- 67b4220 isolated-declarations: Simplify handling VariableDeclaration
transform (#5916 ) (Dunqing)
- 2fd5c2a isolated-declarations: Pre-filter statements that do not need
to be transformed (#5909 ) (Dunqing)
- 943bd76 minifier: Move tests to their src files (#5912 ) (Boshen)
- cbaeea6 minifier: Clean up some tests (#5910 ) (Boshen)
- 144611e minifier: Align ast pass names with closure compiler (#5908 )
(Boshen)
- 31e9db4 parser: Shorten `UniquePromise` code (#5805 ) (overlookmotel)
- 2322b8b parser: Remove dead code warning when running tests (#5804 )
(overlookmotel)
- 4abfa76 parser: Add `--ast` and `--comments` to example (Boshen)
- a4b55bf parser: Use AstBuilder (#5743 ) (Boshen)
- d910304 semantic: Rename lifetime on `impl IntoIterator for &AstNodes`
(#5881 ) (overlookmotel)
- f360e2c semantic: Remove redundunt is_leading check for JSDoc (#5877 )
(leaysgur)
- 9115dd9 semantic: Use `Comment::attached_to` for jsdoc attachment
(#5876 ) (Boshen)
- db4f16a semantic: Call `with_trivias` before `build_with_jsdoc`
(#5875 ) (Boshen)
- 3d13c6d semantic: Impl `IntoIterator` for `&AstNodes` (#5873 )
(DonIsaac)
- 47d9ad8 semantic: Remove unused vars warning in release mode (#5803 )
(overlookmotel)
- 155d7fc transformer: Arrow function transform: ignore type fields when
finding enclosing arrow function (#5944 ) (overlookmotel)
- 2cf5607 transformer: Split up logical assignment operator transform
into functions (#5902 ) (overlookmotel)
- 41fbe15 transformer: Internal functions not `pub` in logical
assignment operator transform (#5898 ) (overlookmotel)
- b11d91c transformer: Remove nested match in logical assignment
operator transform (#5897 ) (overlookmotel)
- 52c9903 transformer: JSX: use `AstBuilder::vec_from_iter` (#5862 )
(overlookmotel)
- 74364ad transformer: JSX: merge `transform_jsx_attribute_item` into
`transform_jsx` (#5861 ) (overlookmotel)
- d2eaa7d transformer: Reorder match arms in JSX transform (#5860 )
(overlookmotel)
- 58a8327 transformer: Simplify match in JSX transform (#5859 )
(overlookmotel)
- b9c4564 transformer: Transformer example output semantic + transformer
errors (#5852 ) (overlookmotel)
- 03e02a0 transformer: Comment about potential improvement to arrow
function transform (#5841 ) (overlookmotel)
- 40cdad5 transformer: Remove repeat code in arrow function transform
(#5837 ) (overlookmotel)
- 3dd188c transformer: Deref `SymbolId` immediately (#5836 )
(overlookmotel)
- 03a9e1a transformer: Reorder methods in arrow function transform
(#5830 ) (overlookmotel)
- 4d97184 transformer: Rename vars in arrow function transform (#5827 )
(overlookmotel)
- 01c5b7c transformer: Shorten code in arrow functions transform (#5826 )
(overlookmotel)
- 85ac3f7 transformer: Arrow functions transform do not wrap function
expressions in parentheses (#5824 ) (overlookmotel)
- 1c1353b transformer: Use AstBuilder instead of using struct
constructor (#5778 ) (Boshen)
### Testing
- 84b7d1a index: Add unit tests to `oxc_index` (#5979 ) (DonIsaac)
- d6cbbe7 isolated-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>
2024-09-23 11:20:12 +08:00
Dunqing
cd34f07e09
perf(isolated-declarations): Combine type/value bindings and type/value references into one ( #5968 )
2024-09-23 02:39:28 +00:00
overlookmotel
eadffb900e
test(conformance): move conformance snapshots into separate directory ( #5924 )
2024-09-20 12:30:39 +00:00
camchenry
608d637e4d
perf(linter): use aho-corasick instead of regex for string matching in jsx-a11y/img-redundant-alt ( #5892 )
...
hypothesis: profiling shows that Regex creation takes a decent amount of time. the `regex` crate uses `aho-corasick` internally for string matching, which is all we need in some cases. in theory, we could save time by using the lib directly and not needing the full regex syntax.
2024-09-19 22:40:01 +00:00
oxc-bot
65a17346cd
release(oxlint): v0.9.6 ( #5843 )
...
## [0.9.6] - 2024-09-18
### Features
- 3bf7b24 linter: Make `typescript/no-duplicate-enum-values` a
`correctness` rule (#5810 ) (DonIsaac)
- 7799c06 linter/react: Implement `no-danger-with-children` rule (#5420 )
(Cam McHenry)
### Bug Fixes
- f942485 linter: Remove all* remaining "Disallow <foo>" messages
(#5812 ) (DonIsaac)
- b5ad518 linter: Improve diagnostic messages for various lint rules
(#5808 ) (DonIsaac)
- 858f7af linter: Plugin prefix name for eslint-plugin-node (#5807 )
(DonIsaac)
- 737ba1d linter: Fix some cases on ```AssignmentExpression``` for
```unicorn/consistent-function-scoping``` (#5675 ) (Arian94)
- 148c7a8 linter: Replace bitwise AND (&) with logical AND (&&) in
explici… (#5780 ) (kaykdm)
- b4ed564 linter/no-unused-vars: Writes to members triggering false
positive (#5744 ) (Dunqing)
- e9c084a linter/no-unused-vars: False positive when a variable used as
a computed member property (#5722 ) (Dunqing)
### Performance
- 3725d5d linter: Make all rules share a diagnostics vec (#5806 )
(DonIsaac)
- e978567 linter: Shrink size of `DisableDirectives` (#5798 ) (DonIsaac)
- 1bfa515 linter: Remove redundant clone of diagnostics in context
(#5797 ) (DonIsaac)
- e413cad linter: Move shared context info to `ContextHost` (#5795 )
(DonIsaac)
### Refactor
- 6dd6f7c ast: Change `Comment` struct (#5783 ) (Boshen)
- 7caae5b codegen: Add `GetSpan` requirement to `Gen` trait (#5772 )
(Boshen)
- 026ee6a linter: Decouple module resolution from import plugin (#5829 )
(dalaoshu)
- 50834bc linter: Move `override_rule` to `OxlintRules` (#5708 )
(DonIsaac)
- a438743 linter: Move `OxlintConfig` to `Oxlintrc` (#5707 ) (DonIsaac)
- f61e8b5 linter: Impl serde and schemars traits for `LintPlugins`
(#5706 ) (DonIsaac)
- 20a7861 linter: Shorten `Option` syntax (#5735 ) (overlookmotel)
- d8b612c oxc_linter: Prefer pass Enum instead of str `no_plus_plus`
(#5730 ) (IWANABETHATGUY)
- cc0408b semantic: S/AstNodeId/NodeId (#5740 ) (Boshen)
---------
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-18 12:02:09 +08:00
Boshen
4abfa7682a
refactor(parser): add --ast and --comments to example
2024-09-14 09:02:23 +08:00
oxc-bot
bd48dfbf8b
release(crates): v0.29.0 ( #5763 )
...
## [0.29.0] - 2024-09-13
- 71116a1 index: [**BREAKING**] Remove ability to index `IndexVec` with
`usize` (#5733 ) (overlookmotel)
- c3dd2a0 ast: [**BREAKING**] Revert: reduce byte size of
`TaggedTemplateExpression::quasi` by `Boxing` it (#5679 ) (#5715 )
(overlookmotel)
### Features
- 953fe17 ast: Provide `NONE` type for AST builder calls (#5737 )
(overlookmotel)
- a362f51 index: Add `IndexVec::shrink_to` (#5713 ) (overlookmotel)
- e968e9f minifier: Constant fold nullish coalescing operator (#5761 )
(Boshen)
- 6bc13f6 minifier: Add `MinimizeConditions` pass (#5747 ) (Boshen)
- 805fbac oxc_cfg: Better control flow graph dot dot repr (#5731 )
(IWANABETHATGUY)
- f3baa49 semantic: Add `SemanticBuilder::with_stats` (#5757 )
(overlookmotel)
- 7fa0cb3 semantic: Expose `Stats` (#5755 ) (overlookmotel)
### Bug Fixes
- 8ff013a minifier: Handle dce CallExpression::callee (#5752 ) (Boshen)
- 608b7d3 napi/transformer: Refresh plugin doesn't work even after
passing the refresh option (#5702 ) (Dunqing)
- 042afa9 syntax: Correctly check for valid `RedeclarationId`s (#5759 )
(overlookmotel)
- 77d9170 transformer/react: IsStaticChildren should be false when there
is only one child (#5745 ) (Dunqing)
### Performance
- 333e2e0 index: Remove `Idx` bounds-checks from `first` + `last`
methods (#5726 ) (overlookmotel)
- d18c896 rust: Use `cow_utils` instead (#5664 ) (dalaoshu)
### Refactor
- 2890c98 minifier: Add tests for `remove_syntax` (#5749 ) (Boshen)
- 9a9d8f6 minifier: Replace `self.ast` with `ctx.ast` (#5748 ) (Boshen)
- 746f7b3 minifier: Align code with closure compiler (#5717 ) (Boshen)
- 21e2df5 minifier: Replace `VisitMut` with `Traverse` for inject and
define plugins (#5705 ) (Boshen)
- 4bdc202 rust: Remove some #[allow(unused)] (#5716 ) (Boshen)
- a35fb14 semantic: `Stats::assert_accurate` take `self` (#5758 )
(overlookmotel)
- 4b896f1 semantic: Make `Stats` `Copy` (#5756 ) (overlookmotel)
- b4b460f semantic: `Stats` store counts as `u32` (#5754 )
(overlookmotel)
- 667170c semantic: Rename `Counts` to `Stats` (#5753 ) (overlookmotel)
- cc0408b semantic: S/AstNodeId/NodeId (#5740 ) (Boshen)
- 7dfcdfc semantic: Remove `more-asserts` dependency (#5739 )
(overlookmotel)
- 6436524 semantic: Fix dead code warning in release mode (#5728 )
(overlookmotel)
- e02621d semantic: Re-order use statements (#5712 ) (overlookmotel)
- ac6203c semantic: Move `Counts` code into counter module (#5710 )
(overlookmotel)
- 339fcfc semantic: Rename `Counts` in transform checker (#5709 )
(overlookmotel)
- d8ec781 semantic: Remove `record_ast_node` call for `Program` (#5701 )
(overlookmotel)
### Styling
- 1857ff0 semantic: Rename vars for node IDs (#5699 ) (overlookmotel)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2024-09-13 21:43:23 +08:00
overlookmotel
7dfcdfced6
refactor(semantic): remove more-asserts dependency ( #5739 )
...
Remove `more-asserts` dependency which was added in #5710 .
As suggested by @Boshen in https://github.com/oxc-project/oxc/pull/5710#pullrequestreview-2299016692 .
2024-09-13 02:53:00 +00:00
oxc-bot
1dad9fa301
release(oxlint): v0.9.5 ( #5724 )
...
## [0.9.5] - 2024-09-12
### Features
- 4b04f65 linter: Implement `no-plusplus` rule (#5570 ) (Cam McHenry)
---------
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-12 16:59:25 +08:00
oxc-bot
d06bab6260
release(oxlint): v0.9.4 ( #5718 )
...
## [0.9.4] - 2024-09-12
### Features
- 9ca2593 linter: Eslint/sort-keys (#4845 ) (Na'aman Hirschfeld)
- 023c160 linter: Impl `Serialize` for `OxlintConfig` (#5594 ) (DonIsaac)
- 24d6a47 linter: Implement `eslint/no-invalid-regexp` (#5443 ) (Boshen)
### Bug Fixes
- af6d240 linter: Panic in consistent-function-scoping (#5613 )
(DonIsaac)
- 54e2e76 linter: `react/no_set_state` + `react/no_string_refs` rules
find correct parent (#5615 ) (overlookmotel)
- 3b87ac4 linter: Fix no_unused_vars panic when encountering unicode
(#5582 ) (Boshen)
### Performance
- bfe9186 linter: Use `cow_replace` instead of `replace` (#5643 )
(dalaoshu)
- e3ae5db linter: Use cow_to_ascii_lowercase/uppercase (#5637 ) (heygsc)
- a0370bf linter: Use cow_utils in no_script_url (#5633 ) (heygsc)
- 37e922c linter: `eslint/no_shadow_restricted_names` use
`run_on_symbol` (#5618 ) (overlookmotel)
- 0b7fccf linter: `react/no_set_state` + `react/no_string_refs` rules
reduce iteration over ancestors (#5616 ) (overlookmotel)
- 2c3f3fe linter: Make `jsx_key` slightly faster (#5585 ) (Boshen)
- cd81d12 linter: Add `should_run` to check path only once to
nextjs/no_typos (#5584 ) (Boshen)
- d18c896 rust: Use `cow_utils` instead (#5664 ) (dalaoshu)
### Documentation
- 64f9575 linter: Add plugin usage to example with configuration
(Boshen)
- 8c9179d linter: Fix typos (#5591 ) (Brian Donovan)
### Refactor
- 9e9435f linter: Add `LintFilter` (#5685 ) (DonIsaac)
- 4f70fe5 linter: Start internal/external split of LintPluginOptions
(#5660 ) (DonIsaac)
- 5ae9b48 linter: Start internal/external split of `OxlintOptions`
(#5659 ) (DonIsaac)
- c8bc6f0 linter: Use `std::ptr::eq` (#5649 ) (overlookmotel)
- a37c064 linter: Use `ContentHash` for `no_duplicate_case`; remove
`calculate_hash` (#5648 ) (Boshen)
- 0b3c1d7 linter: Start internal/external split of `OxlintConfig`
(#5595 ) (DonIsaac)
- 89bdf55 linter: Inline `Rule` trait default methods (#5619 )
(overlookmotel)
- afea8d5 linter: Rename `Rule` trait method params (#5617 )
(overlookmotel)
- 4e748b5 linter: Replace ast "compare by hash" to "compare by content"
(#5602 ) (dalaoshu)
- bac03e3 linter: Make fields of `LintServiceOptions` private (#5593 )
(DonIsaac)
- 2661d8b linter: Jest prefer_strict_equal (#5588 ) (IWANABETHATGUY)
- 20d0068 oxlint: Move cli-related exports to `cli` module (#5139 )
(DonIsaac)
- 067f9b5 semantic: Introduce `IsGlobalReference` trait (#5672 )
(Boshen)- 26d9235 Enable clippy::ref_as_ptr (#5577 ) (夕舞八弦)
### Testing
- 8e79f8d linter: Add class method test cases for `oxc/no-async-await`
(#5550 ) (DonIsaac)
- 3835189 linter: Add test case for no_unused_vars in 3b87ac4 (Boshen)
- 5f27551 linter: Add a passing case to no_undef (#5580 ) (Boshen)
---------
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-12 13:56:38 +08:00
overlookmotel
ac6203c891
refactor(semantic): move Counts code into counter module ( #5710 )
...
Pure refactor. Move code for counting nodes etc, and verifying counts, into `counter` module.
2024-09-11 20:41:48 +00:00
dalaoshu
d18c896a2c
perf(rust): use cow_utils instead ( #5664 )
...
Related to #5586 and #5662
---------
Co-authored-by: Boshen <boshenc@gmail.com>
2024-09-11 18:39:30 +08:00
oxc-bot
a727ee8aca
release(oxc): crates v0.28.0 ( #5696 )
...
## [0.28.0] - 2024-09-11
- afc4548 ast: [**BREAKING**] Educe byte size of
`TaggedTemplateExpression::quasi` by `Boxing` it (#5679 ) (Boshen)
- 7415e85 ast: [**BREAKING**] Reduce byte size of
`TSImportType::attributes` by `Box`ing it (#5678 ) (Boshen)
- ee4fb42 ast: [**BREAKING**] Reduce size of `WithClause` by `Box`ing it
(#5677 ) (Boshen)
- 1fa3e56 semantic: [**BREAKING**] Rename `SymbolTable::iter` to
`symbol_ids` (#5621 ) (overlookmotel)
- 96a1552 semantic: [**BREAKING**] Remove `SymbolTable::iter_rev`
(#5620 ) (overlookmotel)
- 4a8aec1 span: [**BREAKING**] Change `SourceType::js` to
`SourceType::cjs` and `SourceType::mjs` (#5606 ) (Boshen)
- 603817b oxc: [**BREAKING**] Add `SourceType::Unambiguous`; parse `.js`
as unambiguous (#5557 ) (Boshen)
- b060525 semantic: [**BREAKING**] Remove `source_type` argument from
`SemanticBuilder::new` (#5553 ) (Boshen)
### Features
- 2da5ad1 ast: Add `JSXElementName::get_identifier` method (#5556 )
(overlookmotel)
- 2016bae coverage: Add regular expression idempotency test (#5676 )
(Boshen)
- 68c3cf5 minifier: Fold `void 1` -> `void 0` (#5670 ) (Boshen)
- c6bbf94 minifier: Constant fold unary expression (#5669 ) (Boshen)
- 86256ea minifier: Constant fold `typeof` (#5666 ) (Boshen)
- e698418 napi/transform: Align output `SourceMap` with Rollup's
`ExistingRawSourceMap` (#5657 ) (Boshen)
- aba9194 napi/transform: Export react refresh options (#5533 )
(underfin)
- 642295c semantic: Add `SymbolTable::delete_resolved_reference` method
(#5558 ) (overlookmotel)
- b3cbd56 span: `format_compact_str!` macro (#5610 ) (overlookmotel)
- 95a6d99 transformer: Enable the react refresh plugin in enable_all
(#5630 ) (Dunqing)
- 7b543df transformer/react: Handle `refresh_sig` and `refresh_reg`
options correctly (#5638 ) (Dunqing)
- 17226dd traverse: Add methods for deleting references (#5559 )
(overlookmotel)
### Bug Fixes
- d62defb codegen: Do not print trailing commas for `ArrayExpression`
(#5551 ) (Boshen)
- 1bc08e2 coverage: Parse babel unambiguously (#5579 ) (Boshen)
- 28b934c coverage: Apply `always_strict` to test262 and typescript per
the specifcation (#5555 ) (Boshen)
- b9bf544 isolated-declarations: False positive for setter method in
`interface` (#5681 ) (Dunqing)
- 6e8409a isolated-declarations: Bindings referenced in
`TSModuleDeclaration` are removed incorrectly (#5680 ) (Dunqing)
- b8f8dd6 minifier/replace_global_defines: Do not replace shadowed
identifiers (#5691 ) (Boshen)
- 304ce25 regular_expression: Keep LegacyOctalEscape raw digits for
`to_string` (#5692 ) (leaysgur)
- 0511d55 regular_expression: Report more MayContainStrings error in
(nested)class (#5661 ) (leaysgur)
- 41582ea regular_expression: Improve RegExp `to_string()` results
(#5635 ) (leaysgur)
- 28aad28 regular_expression: Handle `-` in `/[\-]/u` as escaped
character (#5631 ) (leaysgur)
- f9e3a41 semantic: Bind `SymbolId` to function name in `if (foo)
function id() {}` (#5673 ) (Boshen)
- f49e6eb span: Treat `.js` as `module` file (reverts the previous
breaking change) (#5612 ) (Boshen)
- 919d17f transform_conformance: Only print semantic mismatch errors
when output is correct (#5589 ) (Boshen)
- 505d064 transformer: JSX transform delete references for
`JSXClosingElement`s (#5560 ) (overlookmotel)
- 9b7ecc7 transformer: RegExp transform only set span on final
expression (#5508 ) (overlookmotel)
- d1ece19 transformer: RegExp transform handle `Term::Quantifier`
(#5501 ) (overlookmotel)
- a1afd48 transformer/react: Incorrect scope_id for var hoisted in fast
refresh plugin (#5695 ) (Dunqing)
- f2f5e5a transformer/react: Missing scope_id for function in fast
refresh plugin (#5693 ) (Dunqing)
- a891c31 transformer/react: Refresh plugin has incorrect reference
flags (#5656 ) (Dunqing)
- 3e8b96f transformer/react: The refresh plugin cannot handle member
expressions with React hooks (#5655 ) (Dunqing)
- 0739b5f transformer/react: Don't transform declaration of function
overloads (#5642 ) (Dunqing)
- 3bf6aaf transformer/react: Support `emit_full_signatures` option in
refresh plugin (#5629 ) (Dunqing)
- 36d864a transformer/react: Don't transform if the variable does not
have a value reference (#5528 ) (Dunqing)
### Performance
- e8013d2 traverse: Faster string operations generating UIDs (#5626 )
(overlookmotel)
- 4996874 traverse: `generate_uid` cache available binding names (#5611 )
(overlookmotel)
### Documentation
- fefbbc1 sourcemap: Add trailing newline to README (#5539 )
(overlookmotel)
- 9282647 transformer: Comment on RegExp transform for potential
improvement (#5514 ) (overlookmotel)
- 1c051ae traverse: Correct code comment 2 (#5607 ) (overlookmotel)
- 2e24a15 traverse: Correct code comment (#5604 ) (overlookmotel)
### Refactor
- 14ee086 ast: Inline `AstKind::as_*` methods (#5547 ) (overlookmotel)
- 2de6ea0 index, traverse: Remove unnecessary type annotations (#5650 )
(overlookmotel)
- 0ac420d linter: Use meaningful names for diagnostic parameters (#5564 )
(Don Isaac)
- 2da42ef regular_expression: Improve AST docs with refactoring
may_contain_strings (#5665 ) (leaysgur)
- dec1395 regular_expression: Align diagnostics (#5543 ) (leaysgur)
- 731ffaa semantic: Compare nodes by pointer equality (#5686 )
(overlookmotel)
- 067f9b5 semantic: Introduce `IsGlobalReference` trait (#5672 ) (Boshen)
- d22a9b7 semantic: `SymbolTable::is_empty` use `is_empty` (#5622 )
(overlookmotel)
- 3d190a5 span: Move `CompactStr` into separate file (#5609 )
(overlookmotel)
- 5532628 span: Put types and impl in the same mod file (Boshen)
- ce71982 transformer: Shorten code in JSX transform (#5554 )
(overlookmotel)
- 758a10c transformer: RegExp transform reuse var (#5527 )
(overlookmotel)
- fad0a05 transformer: RegExp transform unbox early (#5504 )
(overlookmotel)
- 19cdcc5 traverse: Revert changes to `walk.rs` (#5652 ) (overlookmotel)-
26d9235 Enable clippy::ref_as_ptr (#5577 ) (夕舞八弦)
### Styling
- e52d006 traverse: Fix formatting of traverse codegen (#5651 )
(overlookmotel)
- 97e99bd traverse: Remove excess line break (#5603 ) (overlookmotel)-
694f032 Add trailing line breaks to `package.json` files (#5542 )
(overlookmotel)
### Testing
- 2e367c9 traverse: Enable tests for `oxc_traverse` crate (#5625 )
(overlookmotel)- dc92489 Add trailing line breaks to conformance
fixtures (#5541 ) (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>
2024-09-11 17:57:55 +08:00
Dunqing
3bf6aaf06a
fix(transformer/react): support emit_full_signatures option in refresh plugin ( #5629 )
2024-09-11 07:57:14 +00:00
Boshen
2016bae98c
feat(coverage): add regular expression idempotency test ( #5676 )
...
closes #5634
2024-09-11 02:07:42 +00:00
heygsc
febb29f7f5
perf(formatter): use cow and put cow_ascii on clippy ( #5646 )
...
close : #5639
part of: #5586
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Boshen <boshenc@gmail.com>
2024-09-10 09:38:17 +08:00
overlookmotel
e8013d259e
perf(traverse): faster string operations generating UIDs ( #5626 )
...
`get_unique_name` perform string manipulation faster, avoiding bounds checks, and use `itoa` crate for faster conversion of integers to strings for postfixes above 100.
No apparent difference on benchmarks, but I imagine that's only because it's outweighed by cost of hashing strings. If measured alone, I believe it would be a perf improvement.
2024-09-10 01:12:22 +00:00
overlookmotel
4996874dda
perf(traverse): generate_uid cache available binding names ( #5611 )
...
Close #5488 .
`generate_uid` previously iterated through every symbol and unresolved reference in the AST to find a unique var name. If the first var name it tried was already in use, it'd iterate again.
Instead build a hash map recording existing var names in use for every name which could clash with a UID (any var name starting with `_`). Once built, use that hash map to generate UIDs without iterating through all symbols again.
I had hoped to make `generate_uid` cheaper still by just recording the highest digits postfix for each var name, and then incrementing that postfix for each UID. i.e. if AST contains vars `_foo1` and `_foo6`, create UIDs starting at one number higher - `_foo7`, `_foo8` etc. This method would be more efficient, but unfortunately it does not match Babel, and so causes some of Babel's tests to fail.
2024-09-10 01:12:19 +00:00
heygsc
a0370bf506
perf(linter): use cow_utils in no_script_url ( #5633 )
...
part of #5586
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-09 15:06:50 +08:00
oxc-bot
16009c09fd
release: oxlint v0.9.3 ( #5569 )
...
## [0.9.3] - 2024-09-07
### Features
- be3a432 linter: Implement typescript/no-magic-numbers (#4745 )
(Alexander S.)
- 09aa86d linter/eslint: Implement `sort-vars` rule (#5430 ) (Jelle van
der Waa)
- 2ec2f7d linter/eslint: Implement no-alert (#5535 ) (Edwin Lim)
- a786acf linter/import: Add no-dynamic-require rule (#5389 ) (Jelle van
der Waa)
- 4473779 linter/node: Implement no-exports-assign (#5370 ) (dalaoshu)
- b846432 linter/oxc: Add fixer for `erasing-op` (#5377 ) (camc314)
- aff2c71 linter/react: Implement `self-closing-comp` (#5415 ) (Jelle van
der Waa)
### Bug Fixes
- 0df1d9d ast, codegen, linter: Panics in fixers. (#5431 ) (rzvxa)
- cdd1a91 linter: Typescript/no-magic-numbers: remove double minus for
reporting negative bigint numbers (#5565 ) (Alexander S.)
- ff88c1f linter: Don't mark binding rest elements as unused in TS
function overloads (#5470 ) (Cam McHenry)
- 088733b linter: Handle loops in `getter-return` rule (#5517 ) (Cam
McHenry)
- 82c0a16 linter: `tree_shaking/no_side_effects_in_initialization`
handle JSX correctly (#5450 ) (overlookmotel)
- 6285a02 linter: `eslint/radix` rule correctly check for unbound
symbols (#5446 ) (overlookmotel)
- c8ab353 linter/tree-shaking: Align JSXMemberExpression's report
(#5548 ) (mysteryven)
- 5187f38 linter/tree-shaking: Detect the correct export symbol
resolution (#5467 ) (mysteryven)
### Performance
- 8170954 linter/react: Add should_run conditions for react rules
(#5402 ) (Jelle van der Waa)
### Documentation
- a540215 linter: Update docs `Examples` for linter rules (#5513 )
(dalaoshu)
- 7414190 linter: Update docs `Example` for linter rules (#5479 )
(heygsc)
### Refactor
- 0ac420d linter: Use meaningful names for diagnostic parameters (#5564 )
(Don Isaac)
- 81a394d linter: Deduplicate code in `oxc/no-async-await` (#5549 )
(DonIsaac)
- 979c16c linter: Reduce nested if statements in
eslint/no_this_before_super (#5485 ) (IWANABETHATGUY)
- 1d3e973 linter: Simplify `eslint/radix` rule (#5445 ) (overlookmotel)
- fdb8857 linter: Use "parsed pattern" in `no_div_regex` rule. (#5417 )
(rzvxa)
- 2ccbd93 linter: `react/jsx_no_undef` rule `get_member_ident` do not
return Option (#5411 ) (overlookmotel)
### Styling
- 2a43fa4 linter: Introduce the writing style from PR #5491 and reduce
the if nesting (#5512 ) (dalaoshu)- d8b29e7 Add trailing line breaks to
JSON files (#5544 ) (overlookmotel)- 694f032 Add trailing line breaks to
`package.json` files (#5542 ) (overlookmotel)
### Testing
- 340b535 linter/no-unused-vars: Arrow functions in tagged templates
(#5510 ) (Don Isaac)
- af69393 linter/no-useless-spread: Ensure spreads on identifiers pass
(#5561 ) (DonIsaac)- dc92489 Add trailing line breaks to conformance
fixtures (#5541 ) (overlookmotel)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2024-09-07 12:28:46 +08:00
oxc-bot
64eb2cccb7
release: crates v0.27.0 ( #5538 )
...
## [0.27.0] - 2024-09-06
- bd820f9 semantic: [**BREAKING**] Remove
`SymbolTable::get_symbol_id_from_name` and
`SymbolTable::get_scope_id_from_name` (#5480 ) (overlookmotel)
- cba93f5 ast: [**BREAKING**] Add `ThisExpression` variants to
`JSXElementName` and `JSXMemberExpressionObject` (#5466 ) (overlookmotel)
- 87c5df2 ast: [**BREAKING**] Rename `Expression::without_parentheses`
(#5448 ) (overlookmotel)
### Features
- e8bdd12 allocator: Add `AsMut` impl for `Box` (#5515 ) (overlookmotel)
- 90facd3 ast: Add `ContentHash` trait; remove noop `Hash`
implementation from `Span` (#5451 ) (rzvxa)
- 23285f4 ast: Add `ContentEq` trait. (#5427 ) (rzvxa)
- 59abf27 ast, parser: Add `oxc_regular_expression` types to the parser
and AST. (#5256 ) (rzvxa)
- 68a1c01 ast_tools: Add dedicated `Derive` trait. (#5278 ) (rzvxa)
- c782916 codegen: Print `type_parameters` in `TaggedTemplateExpression`
(#5438 ) (Dunqing)
- 4cb63fe index: Impl rayon related to trait for IndexVec (#5421 )
(IWANABETHATGUY)
- ba4b68c minifier: Remove parenthesized expression for dce (#5439 )
(Boshen)
- ed8ab6d oxc: Conditional expose `oxc_cfg` in `oxc` crate (#5524 )
(IWANABETHATGUY)
- 91b39c4 oxc_diagnostic: Impl DerefMut for OxcDiagnostic (#5474 )
(IWANABETHATGUY)
- 10279f5 parser: Add syntax error for hyphen in `JSXMemberExpression`
`<Foo.bar-baz />` (#5440 ) (Boshen)
- 0f50b1e semantic: Check for initializers in ambient
`VariableDeclaration`s (#5463 ) (DonIsaac)
- 62f7fff semantic: Check for non-declared, non-abstract object
accessors without bodies (#5461 ) (DonIsaac)
- 5407143 semantic: Check for non-declared, non-abstract class accessors
without bodies (#5460 ) (DonIsaac)
- 052e94c semantic: Check for parameter properties in constructor
overloads (#5459 ) (DonIsaac)
- 32d4bbb transformer: Add `TransformOptions::enable_all` method (#5495 )
(Boshen)
- c59d8b3 transformer: Support all /regex/ to `new RegExp` transforms
(#5387 ) (Dunqing)
- cedf7a4 xtask: Impl `as_ast_kind` method for each variant (#5491 )
(IWANABETHATGUY)
### Bug Fixes
- 0df1d9d ast, codegen, linter: Panics in fixers. (#5431 ) (rzvxa)
- fce549e diagnostics: Ignore `Interrupted` and `BrokenPipe` errors
while printing (#5526 ) (Boshen)
- ea7a52f napi/transform: Fix test (Boshen)
- 9b984b3 regex: Panic on displaying surrogated `UnicodeEscape`
characters. (#5469 ) (rzvxa)
- 88b7ddb regular_expression: Handle unterminated character class
(#5523 ) (leaysgur)
- 7a797ac semantic: Incorrect reference when `MemberExpression` used in
`TSPropertySignature` (#5525 ) (Dunqing)
- d8b9909 semantic: `IdentifierReference` within `TSPropertySignature`
cannot reference type-only import binding (#5441 ) (Dunqing)
- 8f9627d transformer: RegExp transform do not transform invalid regexps
(#5494 ) (overlookmotel)
- 2060efc transformer: RegExp transform don't transform all RegExps
(#5486 ) (overlookmotel)
- cfe5497 transformer: Do not create double reference in JSX transform
(#5414 ) (overlookmotel)
- 0617249 transformer/nullish-coalescing-operator: Incorrect reference
flags (#5408 ) (Dunqing)
- 0eb32a6 traverse: Invalid variable name generated by
`generate_uid_based_on_node` (#5407 ) (Dunqing)- b96bea4 Add back
lifetime (#5507 ) (IWANABETHATGUY)
### Performance
- bfabd8f syntax: Further optimize `is_identifier_name` (#5426 )
(overlookmotel)
- aeda84f syntax: Optimize `is_identifier_name` (#5425 ) (overlookmotel)
- ed8937e transformer: Memoize rope instance (#5518 ) (Dunqing)
- bfab091 transformer: Store needed options only on `RegExp` (#5484 )
(overlookmotel)
- b4765af transformer: Pre-calculate if unsupported patterns in RegExp
transform (#5483 ) (overlookmotel)
- 182ab91 transformer: Pre-calculate unsupported flags in RegExp
transform (#5482 ) (overlookmotel)
### Documentation
- 64db1b4 ast: Clarify docs for `RegExpPattern` (#5497 ) (overlookmotel)
- 3f204a9 span: Update docs about `ContentEq` `Vec` comparison speed
(#5478 ) (overlookmotel)- 00511fd Use `oxc_index` instead of `index_vec`
in doc comments (#5423 ) (IWANABETHATGUY)
### Refactor
- 9f6e0ed ast: Simplify `ContentEq` trait definition. (#5468 ) (rzvxa)
- a43e951 ast: Use loop instead of recursion (#5447 ) (overlookmotel)
- 2224cc4 ast: Renumber `JSXMemberExpressionObject` discriminants
(#5464 ) (overlookmotel)
- a952c47 ast: Use loop not recursion (#5449 ) (overlookmotel)
- d9d7e7c ast: Remove `IdentifierName` from `TSThisParameter` (#5327 )
(overlookmotel)
- ccc8a27 ast, ast_tools: Use full method path for generated derives
trait calls. (#5462 ) (rzvxa)
- fdb8857 linter: Use "parsed pattern" in `no_div_regex` rule. (#5417 )
(rzvxa)
- e7bd49d regular_expression: Correct typo (#5429 ) (overlookmotel)
- e4ed41d semantic: Change the reference flag to `ReferenceFlags::Type`
if it is used within a `TSTypeQuery` (#5444 ) (Dunqing)
- 94a6ac6 span: Use `Hasher` from `std` (#5476 ) (overlookmotel)
- b47aca0 syntax: Use `generate_derive` for `CloneIn` in types outside
of `oxc_ast` crate. (#5280 ) (rzvxa)
- a96866d transformer: Re-order imports (#5499 ) (overlookmotel)
- 6abde0a transformer: Clarify match in RegExp transform (#5498 )
(overlookmotel)
- 09c522a transformer: RegExp transform report pattern parsing errors
(#5496 ) (overlookmotel)
- dd19823 transformer: RegExp transform do not take ownership of
`Pattern` then reallocate it (#5492 ) (overlookmotel)
- 2514cc9 transformer/react: Move all entry points to implementation of
Traverse trait (#5473 ) (Dunqing)
- c984219 transformer/typescript: Move all entry points to
implementation of Traverse trait (#5422 ) (Dunqing)
### Styling
- 2a43fa4 linter: Introduce the writing style from PR #5491 and reduce
the if nesting (#5512 ) (dalaoshu)
### Testing
- 340b535 linter/no-unused-vars: Arrow functions in tagged templates
(#5510 ) (Don Isaac)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2024-09-06 19:06:29 +08:00
IWANABETHATGUY
ed8ab6d7c8
feat(oxc): conditional expose oxc_cfg in oxc crate ( #5524 )
...
This is useful when the downside user wants to use `oxc_cfg`, and easy
to reuse `petgraph` in `oxc_cfg`
2024-09-06 14:07:43 +08:00
Boshen
32d4bbb519
feat(transformer): add TransformOptions::enable_all method ( #5495 )
...
Make it **really** explicit about which transformer options are being
turned on. I also need this in monitor-oxc.
2024-09-06 12:04:06 +08:00