overlookmotel
b8e67538f8
perf(codegen): u32 indexes in LineOffsetTable for source maps ( #4641 )
...
Oxc have a limit on size of source files of 4 GiB, so `u32` is sufficient to hold line and column offsets. Use `u32` for these values in `LineOffsetTable`, which reduces size of the type by 8 bytes.
2024-08-05 02:28:50 +00:00
Boshen
e78cba6464
refactor(minifier): ast passes infrastructure ( #4625 )
...
After studying google closure compiler, I'm leaning towards a multi-ast-pass infrastructure for the minifier.
This is one of the few places where we are going to trade maintainability over performance, given the goal of the minifier is compression size not performance.
All of the terminologies and separation of concerns are aligned with google closure compiler.
Infrastructure of `terser` and `esbuild` are not suitable for us to study nor pursuit. Their code are so tightly coupled - I failed to comprehend any of them every time I try to walk through a piece of optmization. Google closure compiler despite being written in Java, it's actually the most readable minifier out there.
To improve performance between ast passes, I envision a change detection system over a portion of the code.
The benchmark will demonstrate the performance regression of running 5 ast passes instead of 2.
To complete this PR, I need to figure out "fix-point" and order of these ast passes.
2024-08-04 11:58:39 +00:00
Boshen
a40a217de4
fix(parser): parse assert keyword in TSImportAttributes ( #4610 )
...
closes #4601
2024-08-04 01:41:31 +00:00
oxc-bot
e02bac357a
Release crates v0.23.0 ( #4595 )
...
## [0.23.0] - 2024-08-01
- 27fd062 sourcemap: [**BREAKING**] Avoid passing `Result`s (#4541 )
(overlookmotel)
### Features
- a558492 codegen: Implement `BinaryExpressionVisitor` (#4548 ) (Boshen)
- 7446e98 codegen: Align more esbuild implementations (#4510 ) (Boshen)
- 35654e6 codegen: Align operator precedence with esbuild (#4509 )
(Boshen)
- b952942 linter: Add eslint/no-unused-vars (⭐ attempt 3.2) (#4445 )
(DonIsaac)
- 85e8418 linter: Add react/jsx-curly-brace-presence (#3949 ) (Don Isaac)
- cf1854b semantic: Remove `ReferenceFlags::Value` from non-type-only
exports that referenced type binding (#4511 ) (Dunqing)
### Bug Fixes
- b58ed80 codegen: Enable more test cases (#4585 ) (Boshen)
- 6a94e3f codegen: Fixes for esbuild test cases (#4503 ) (Boshen)
- d5c4b19 parser: Fix enum member parsing (#4543 ) (DonIsaac)
### Performance
- 4c6d19d allocator: Use capacity hint (#4584 ) (Luca Bruno)
- 7585e16 linter: Remove allocations for string comparisons (#4570 )
(DonIsaac)
- 55a8763 parser: Faster decoding unicode escapes in identifiers (#4579 )
(overlookmotel)
- ae1d38f parser: Fast path for ASCII when checking char after numeric
literal (#4577 ) (overlookmotel)
- 56ae615 parser: Make not at EOF the hot path in `Source` methods
(#4576 ) (overlookmotel)
- 25679e6 parser: Optimize `Lexer::hex_digit` (#4572 ) (overlookmotel)
- bb33bcc parser: Speed up lexing non-decimal numbers (#4571 )
(overlookmotel)
- ab8509e parser: Use `-` not `saturating_sub` (#4561 ) (overlookmotel)
- c9c38a1 parser: Support peeking over bytes (#4304 ) (lucab)
- 0870ee1 parser: Get and check lookahead token (#4534 ) (lucab)
- d00014e sourcemap: Elide bounds checks in VLQ encoding (#4583 )
(overlookmotel)
- 1fd9dd0 sourcemap: Use simd to escape JSON string (#4487 )
(Brooooooklyn)
### Documentation
- 0914e47 ast: Add doc comments to literal nodes (#4551 ) (DonIsaac)
- c6a11be ast: Auto-generate doc comments for AstBuilder methods (#4471 )
(DonIsaac)
### Refactor
- e68ed62 parser: Convert lexer byte handler for `|` to a single match
(#4575 ) (overlookmotel)
- bba824b parser: Convert `Lexer::read_minus` to a single match (#4574 )
(overlookmotel)
- ef5418a parser: Convert `Lexer::read_left_angle` to a single match
(#4573 ) (overlookmotel)
- 9e5be78 parser: Add `Lexer::consume_2_chars` (#4569 ) (overlookmotel)
- 649913e parser: Extract `u8` not `&u8` when iterating over bytes
(#4568 ) (overlookmotel)
- 59f00c0 parser: Rename function (#4566 ) (overlookmotel)
- 8e3e910 parser: Rename vars (#4565 ) (overlookmotel)
- 0c0601f parser: Rename function (#4564 ) (overlookmotel)
- 0acc4a7 parser: Fetch 2 bytes in `?` byte handler (#4563 )
(overlookmotel)
- 565eccf parser: Shorten lexer code (#4562 ) (overlookmotel)
- 148bdb5 parser: Adjust function inlining (#4530 ) (overlookmotel)
- 16c7b98 semantic: Move CatchClause scope binding logic to
visit_block_statement (#4505 ) (Dunqing)
- d6974d4 semantic: `AstNodeParentIter` fetch nodes lazily (#4533 )
(overlookmotel)
- d914b14 semantic: Reusing the same reference (#4529 ) (Dunqing)
- 7b5e1f5 semantic: Use `is_empty()` instead of `len() == 0` (#4532 )
(overlookmotel)
- 9db4259 semantic: Inline trivial methods (#4531 ) (overlookmotel)
- 7c42ffc sourcemap: Align Base64 chars lookup table to cache line
(#4535 ) (overlookmotel)
- 96602bf transformer/typescript: Determine whether to remove
`ExportSpeicifer` by `ReferenceFlags` (#4513 ) (Dunqing)
- e6a8af6 traverse: Speed up tests (#4538 ) (overlookmotel)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2024-08-01 16:55:41 +08:00
Boshen
b58ed80a55
fix(codegen): enable more test cases ( #4585 )
2024-07-31 12:58:28 +00:00
Boshen
a558492bf9
feat(codegen): implement BinaryExpressionVisitor ( #4548 )
...
part of https://github.com/oxc-project/backlog/issues/58
`monitor-oxc` run: https://github.com/oxc-project/monitor-oxc/actions/runs/10179047831
binary expression stack length tally using `counts` in top 100 npm packages from monitor-oxc:
```
29772 counts
( 1) 17652 (59.3%, 59.3%): 0
( 2) 5772 (19.4%, 78.7%): 1
( 3) 3204 (10.8%, 89.4%): 2
( 4) 1276 ( 4.3%, 93.7%): 3
( 5) 616 ( 2.1%, 95.8%): 4
( 6) 308 ( 1.0%, 96.8%): 5
( 7) 202 ( 0.7%, 97.5%): 6
( 8) 168 ( 0.6%, 98.1%): 7
( 9) 114 ( 0.4%, 98.5%): 9
( 10) 90 ( 0.3%, 98.8%): 8
( 11) 84 ( 0.3%, 99.0%): 13
( 12) 58 ( 0.2%, 99.2%): 10
( 13) 48 ( 0.2%, 99.4%): 12
( 14) 32 ( 0.1%, 99.5%): 11
( 15) 20 ( 0.1%, 99.6%): 134
( 16) 16 ( 0.1%, 99.6%): 18
( 17) 16 ( 0.1%, 99.7%): 20
( 18) 12 ( 0.0%, 99.7%): 19
( 19) 12 ( 0.0%, 99.8%): 35
( 20) 12 ( 0.0%, 99.8%): 51
( 21) 10 ( 0.0%, 99.8%): 15
( 22) 6 ( 0.0%, 99.9%): 17
( 23) 6 ( 0.0%, 99.9%): 21
( 24) 6 ( 0.0%, 99.9%): 45
( 25) 4 ( 0.0%, 99.9%): 14
( 26) 4 ( 0.0%, 99.9%): 26
( 27) 4 ( 0.0%, 99.9%): 53
( 28) 2 ( 0.0%, 99.9%): 172
( 29) 2 ( 0.0%, 99.9%): 214
( 30) 2 ( 0.0%,100.0%): 22
( 31) 2 ( 0.0%,100.0%): 27
( 32) 2 ( 0.0%,100.0%): 28
( 33) 2 ( 0.0%,100.0%): 29
( 34) 2 ( 0.0%,100.0%): 31
( 35) 2 ( 0.0%,100.0%): 36
( 36) 2 ( 0.0%,100.0%): 46
( 37) 2 ( 0.0%,100.0%): 55
```
2024-07-31 12:44:19 +00:00
DonIsaac
7585e16beb
perf(linter): remove allocations for string comparisons ( #4570 )
...
Refactors a lot of case-insensitive comparisons from
```rust
a.to_lowercase() == b.to_lowercase()
```
with
```rust
a.eq_ignore_ascii_case(b)
```
These mostly happened when checking JSX props, so I'm expecting the most benefit from JSX-related rules.
2024-07-31 00:24:12 +00:00
DonIsaac
d5c4b190aa
fix(parser): fix enum member parsing ( #4543 )
...
Closes #4449
2024-07-30 10:43:09 +00:00
overlookmotel
27fd0628ef
refactor(sourcemap)!: avoid passing Results ( #4541 )
...
Refactor building sourcemap JSON to avoid passing `Result`s. `Serialize::serialize` is infallible here as writing to a `Vec<u8>` is infallible.
2024-07-30 04:23:49 +00:00
Boshen
7446e986c3
feat(codegen): align more esbuild implementations ( #4510 )
2024-07-28 13:35:37 +00:00
Boshen
35654e665c
feat(codegen): align operator precedence with esbuild ( #4509 )
...
closes #4339
2024-07-28 11:48:51 +00:00
Boshen
6a94e3f573
fix(codegen): fixes for esbuild test cases ( #4503 )
2024-07-28 08:57:15 +00:00
oxc-bot
80118cbf3b
Release crates v0.22.1 ( #4508 )
...
## [0.22.1] - 2024-07-27
### Features
- 2477330 ast: Add `AstKind::TSExportAssignment` (#4501 ) (Dunqing)
- aaee07e ast: Add `AstKind::AssignmentTargetPattern`,
`AstKind::ArrayAssignmentTarget` and `AstKind::ObjectAssignmentTarget`
(#4456 ) (Dunqing)
- fd363d1 ast: Add AstKind::get_container_scope_id (#4450 ) (DonIsaac)
- e2735ca span: Add `contains_inclusive` method (#4491 ) (DonIsaac)
### Bug Fixes
- 368112c ast: Remove `#[visit(ignore)]` from
`ExportDefaultDeclarationKind`'s `TSInterfaceDeclaration` (#4497 )
(Dunqing)
- 36bb680 semantic: `TSExportAssignment` cannot reference type binding
(#4502 ) (Dunqing)
- cb2fa49 semantic: `typeof` operator cannot reference type-only import
(#4500 ) (Dunqing)
- ef0e953 semantic: Generic passed to typeof not counted as a reference
(#4499 ) (Dunqing)
- 40cafb8 semantic: Params in `export default (function() {})` flagged
as `SymbolFlags::Export` (#4480 ) (Dunqing)
- 2e01a45 semantic: Non-exported namespace member symbols flagged as
exported (#4493 ) (Don Isaac)
- e4ca06a semantic: Incorrect symbol’s scope_id after var hoisting
(#4458 ) (Dunqing)
- 77bd5f1 semantic: Use correct span for namespace symbols (#4448 ) (Don
Isaac)
- 5db7bed sourcemap: Fix pre-calculation of required segments for
building JSON (#4490 ) (overlookmotel)
- 1667491 syntax: Correct `is_reserved_keyword_or_global_object`'s
incorrect function calling. (#4484 ) (Ethan Goh)
- 82ba2a0 syntax: Fix unsound use of `NonZeroU32` (#4466 )
(overlookmotel)
- c04b9aa transformer: Add to `SymbolTable::declarations` for all
symbols (#4460 ) (overlookmotel)
- ecdee88 transformer/typescript: Incorrect eliminate exports when the
referenced symbol is both value and type (#4507 ) (Dunqing)
### Performance
- 963a2d1 mangler: Reduce unnecessary allocation (#4498 ) (Dunqing)
- 868fc87 parser: Optimize conditional advance on ASCII values (#4298 )
(lucab)
- 24beaeb semantic: Give `AstNodeId` a niche (#4469 ) (overlookmotel)
- 348c1ad semantic: Remove `span` field from `Reference` (#4464 )
(overlookmotel)
- 6a9f4db semantic: Reduce storage size for symbol redeclarations
(#4463 ) (overlookmotel)
- 705e19f sourcemap: Reduce memory copies encoding JSON (#4489 )
(overlookmotel)
- 4d10c6c sourcemap: Pre allocate String buf while encoding (#4476 )
(Brooooooklyn)
### Documentation
- f5f0ba8 ast: Add doc comments to more AST nodes (#4413 ) (Don Isaac)
- 871b3d6 semantic: Add doc comments for SymbolTester and SemanticTester
(#4433 ) (DonIsaac)
### Refactor
- 9c5d2f9 ast/builder: Use `Box::new_in` over `.into_in` (#4428 )
(overlookmotel)
- ccb1835 semantic: Methods take `Span` as param, not `&Span` (#4470 )
(overlookmotel)
- f17254a semantic: Populate `declarations` field in
`SymbolTable::create_symbol` (#4461 ) (overlookmotel)
- a49f491 semantic: Re-order `SymbolTable` fields (#4459 )
(overlookmotel)
- 7cd53f3 semantic: Var hoisting (#4379 ) (Dunqing)
- 4f5a7cb semantic: Mark SemanticTester and SymbolTester as must_use
(#4430 ) (DonIsaac)
- c958a55 sourcemap: `push_list` method for building JSON (#4486 )
(overlookmotel)
- c99b3eb syntax: Give `ScopeId` a niche (#4468 ) (overlookmotel)
- 96fc94f syntax: Use `NonMaxU32` for IDs (#4467 ) (overlookmotel)
### Testing
- 4b274a8 semantic: Add more test cases for symbol references (#4429 )
(DonIsaac)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2024-07-28 09:58:29 +08:00
Boshen
e1ca4122d8
chore(codegen): port over esbuild codegen tests (all ignored right now) ( #4457 )
2024-07-25 10:00:34 +00:00
oxc-bot
aa56eb4d1d
Release crates v0.22.0 ( #4434 )
...
## [0.22.0] - 2024-07-23
- 85a7cea semantic: [**BREAKING**] Remove name from `reference` (#4329 )
(Dunqing)
- f68b659 ast: [**BREAKING**] Reorder fields of
`ArrowFunctionExpression` (#4364 ) (Dunqing)
### Features
- d345b84 ast: Add `#[ast]` attribute to non-visited AST types. (#4309 )
(rzvxa)
- 3c0c709 linter: Add typescript-eslint/no-extraneous-class (#4357 )
(Jaden Rodriguez)
- 68efcd4 linter/react-perf: Handle new objects and arrays in prop
assignment patterns (#4396 ) (DonIsaac)
- 0deb027 minfier: Dce `if (xxx) else if (false) { REMOVE }` (#4407 )
(Boshen)
- e33ec18 minifier: Compress `typeof foo == "undefined"` into `typeof
foo > "u"` (#4412 ) (Boshen)- 6068e6b Add error codes to OxcDiagnostic
(#4334 ) (DonIsaac)
### Bug Fixes
- aece1df ast: Visit `Program`s `hashbang` field first (#4368 )
(overlookmotel)
- 44a10c4 codegen: Object shorthand with parens `({x: (x)})` -> `({ x
})` (#4391 ) (Boshen)
- 3d88f20 codegen: Print shorthand for all `{ x }` variants (#4374 )
(Boshen)
- e624dff codegen,mangler: Do not print shorthand for `ObjectProperty`
(#4350 ) (Boshen)
- ac08de8 linter/react_perf: Allow new objects, array, fns, etc in top
scope (#4395 ) (DonIsaac)
- 267f7c4 minifier: Skip `Object.defineProperty(exports, ...)` for
`cjs-module-lexer` (#4409 ) (Boshen)
- bc8d4e5 semantic: Correct comment (#4410 ) (overlookmotel)
- 6ffce86 semantic: Align `visit_arrow_function_expression` field visit
order with ast (#4366 ) (Dunqing)
- 4cd5df0 sourcemap: Avoid negative line if token_chunks has same
prev_dst_line (#4348 ) (underfin)
- f8565ae transformer/typescript: Unexpectedly removed class binding
from ExportNamedDeclaration (#4351 ) (Dunqing)- ea33f94 Impl
PartialEq<str> for CompactStr (#4352 ) (DonIsaac)
### Performance
- 1b51511 semantic: Use `Atom` instead of `CompactStr` for
`UnresolvedReferencesStack` (#4401 ) (Dunqing)
- 40f9356 semantic: Calculate number of nodes, scopes, symbols,
references before visiting AST (#4367 ) (Dunqing)
- da13d93 semantic: Remove bounds checks on unresolved references stack
(#4390 ) (overlookmotel)
- e70c67b semantic: Remove a branch from `add_scope` (#4384 )
(overlookmotel)
- 402006f semantic: Simplify logic in `enter_scope` + `leave_scope`
(#4383 ) (overlookmotel)
- 7469e01 semantic: Remove branch from `Nodes::add_node` (#4361 )
(overlookmotel)
- 7eb2864 traverse: Speed up finding UID binding name (#4356 )
(overlookmotel)- a207923 Replace some CompactStr usages with Cows
(#4377 ) (DonIsaac)
### Refactor
- 504daed allocator: Rename fn params for `Box::new_in` (#4431 )
(overlookmotel)
- d213773 ast: Replace serde rename "lowercase" with "camelCase" (#4376 )
(overlookmotel)
- abfccbd ast: Reduce `#[cfg_attr]` boilerplate in AST type defs (#4375 )
(overlookmotel)
- 5f1c7ec ast: Rename the `visited_node` marker to `ast`. (#4289 )
(rzvxa)
- 58f6ec2 ast: Enter node before scope (#4347 ) (Dunqing)
- 59aea73 ast: Scope is created only if CatchClause has param (#4346 )
(Dunqing)
- 7a3e925 ast_codegen: Better visit marker parsing. (#4371 ) (rzvxa)
- 0e1ea90 isolated-declarations: Remove useless code from scope (#4420 )
(Dunqing)
- 7a75e0f linter: Use diagnostic codes in lint rules (#4349 ) (DonIsaac)
- a2eabe1 parser: Use error codes for ts diagnostics (#4335 ) (DonIsaac)
- 5d77b36 semantic: `visit_program` visit `hashbang` field (#4370 )
(overlookmotel)
- f7b9ada semantic: `Program` visitor leave scope before node (#4369 )
(overlookmotel)
- 729b288 semantic: Shorten code (#4358 ) (overlookmotel)
- 21d0eee semantic: Use error codes for ts diagnostics (#4336 )
(DonIsaac)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2024-07-24 08:23:27 +08:00
Dunqing
426016d1d6
Revert "Release crates v0.22.0" ( #4418 )
...
Still release failed. Reverts oxc-project/oxc#4417
2024-07-23 15:51:01 +08:00
github-actions[bot]
f76113cd8f
Release crates v0.22.0 ( #4417 )
...
## [0.22.0] - 2024-07-23
- 85a7cea semantic: [**BREAKING**] Remove name from `reference` (#4329 )
(Dunqing)
- f68b659 ast: [**BREAKING**] Reorder fields of
`ArrowFunctionExpression` (#4364 ) (Dunqing)
### Features
- d345b84 ast: Add `#[ast]` attribute to non-visited AST types. (#4309 )
(rzvxa)
- 3c0c709 linter: Add typescript-eslint/no-extraneous-class (#4357 )
(Jaden Rodriguez)
- 68efcd4 linter/react-perf: Handle new objects and arrays in prop
assignment patterns (#4396 ) (DonIsaac)
- 0deb027 minfier: Dce `if (xxx) else if (false) { REMOVE }` (#4407 )
(Boshen)
- e33ec18 minifier: Compress `typeof foo == "undefined"` into `typeof
foo > "u"` (#4412 ) (Boshen)- 6068e6b Add error codes to OxcDiagnostic
(#4334 ) (DonIsaac)
### Bug Fixes
- aece1df ast: Visit `Program`s `hashbang` field first (#4368 )
(overlookmotel)
- 44a10c4 codegen: Object shorthand with parens `({x: (x)})` -> `({ x
})` (#4391 ) (Boshen)
- 3d88f20 codegen: Print shorthand for all `{ x }` variants (#4374 )
(Boshen)
- e624dff codegen,mangler: Do not print shorthand for `ObjectProperty`
(#4350 ) (Boshen)
- ac08de8 linter/react_perf: Allow new objects, array, fns, etc in top
scope (#4395 ) (DonIsaac)
- 267f7c4 minifier: Skip `Object.defineProperty(exports, ...)` for
`cjs-module-lexer` (#4409 ) (Boshen)
- bc8d4e5 semantic: Correct comment (#4410 ) (overlookmotel)
- 6ffce86 semantic: Align `visit_arrow_function_expression` field visit
order with ast (#4366 ) (Dunqing)
- 4cd5df0 sourcemap: Avoid negative line if token_chunks has same
prev_dst_line (#4348 ) (underfin)
- f8565ae transformer/typescript: Unexpectedly removed class binding
from ExportNamedDeclaration (#4351 ) (Dunqing)- ea33f94 Impl
PartialEq<str> for CompactStr (#4352 ) (DonIsaac)
### Performance
- 1b51511 semantic: Use `Atom` instead of `CompactStr` for
`UnresolvedReferencesStack` (#4401 ) (Dunqing)
- 40f9356 semantic: Calculate number of nodes, scopes, symbols,
references before visiting AST (#4367 ) (Dunqing)
- da13d93 semantic: Remove bounds checks on unresolved references stack
(#4390 ) (overlookmotel)
- e70c67b semantic: Remove a branch from `add_scope` (#4384 )
(overlookmotel)
- 402006f semantic: Simplify logic in `enter_scope` + `leave_scope`
(#4383 ) (overlookmotel)
- 7469e01 semantic: Remove branch from `Nodes::add_node` (#4361 )
(overlookmotel)
- 7eb2864 traverse: Speed up finding UID binding name (#4356 )
(overlookmotel)- a207923 Replace some CompactStr usages with Cows
(#4377 ) (DonIsaac)
### Refactor
- d213773 ast: Replace serde rename "lowercase" with "camelCase" (#4376 )
(overlookmotel)
- abfccbd ast: Reduce `#[cfg_attr]` boilerplate in AST type defs (#4375 )
(overlookmotel)
- 5f1c7ec ast: Rename the `visited_node` marker to `ast`. (#4289 )
(rzvxa)
- 58f6ec2 ast: Enter node before scope (#4347 ) (Dunqing)
- 59aea73 ast: Scope is created only if CatchClause has param (#4346 )
(Dunqing)
- 7a3e925 ast_codegen: Better visit marker parsing. (#4371 ) (rzvxa)
- 7a75e0f linter: Use diagnostic codes in lint rules (#4349 ) (DonIsaac)
- a2eabe1 parser: Use error codes for ts diagnostics (#4335 ) (DonIsaac)
- 5d77b36 semantic: `visit_program` visit `hashbang` field (#4370 )
(overlookmotel)
- f7b9ada semantic: `Program` visitor leave scope before node (#4369 )
(overlookmotel)
- 729b288 semantic: Shorten code (#4358 ) (overlookmotel)
- 21d0eee semantic: Use error codes for ts diagnostics (#4336 )
(DonIsaac)
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-07-23 13:24:08 +08:00
Dunqing
c1cf0e6dd9
Revert "Release crates v0.22.0" ( #4415 )
...
Reverts oxc-project/oxc#4414
2024-07-23 09:59:38 +08:00
github-actions[bot]
00c7b7dad4
Release crates v0.22.0 ( #4414 )
...
## [0.22.0] - 2024-07-22
- 85a7cea semantic: [**BREAKING**] Remove name from `reference` (#4329 )
(Dunqing)
- f68b659 ast: [**BREAKING**] Reorder fields of
`ArrowFunctionExpression` (#4364 ) (Dunqing)
### Features
- d345b84 ast: Add `#[ast]` attribute to non-visited AST types. (#4309 )
(rzvxa)
- 3c0c709 linter: Add typescript-eslint/no-extraneous-class (#4357 )
(Jaden Rodriguez)
- 0deb027 minfier: Dce `if (xxx) else if (false) { REMOVE }` (#4407 )
(Boshen)
- e33ec18 minifier: Compress `typeof foo == "undefined"` into `typeof
foo > "u"` (#4412 ) (Boshen)- 6068e6b Add error codes to OxcDiagnostic
(#4334 ) (DonIsaac)
### Bug Fixes
- aece1df ast: Visit `Program`s `hashbang` field first (#4368 )
(overlookmotel)
- 44a10c4 codegen: Object shorthand with parens `({x: (x)})` -> `({ x
})` (#4391 ) (Boshen)
- 3d88f20 codegen: Print shorthand for all `{ x }` variants (#4374 )
(Boshen)
- e624dff codegen,mangler: Do not print shorthand for `ObjectProperty`
(#4350 ) (Boshen)
- 267f7c4 minifier: Skip `Object.defineProperty(exports, ...)` for
`cjs-module-lexer` (#4409 ) (Boshen)
- bc8d4e5 semantic: Correct comment (#4410 ) (overlookmotel)
- 6ffce86 semantic: Align `visit_arrow_function_expression` field visit
order with ast (#4366 ) (Dunqing)
- 4cd5df0 sourcemap: Avoid negative line if token_chunks has same
prev_dst_line (#4348 ) (underfin)
- f8565ae transformer/typescript: Unexpectedly removed class binding
from ExportNamedDeclaration (#4351 ) (Dunqing)- ea33f94 Impl
PartialEq<str> for CompactStr (#4352 ) (DonIsaac)
### Performance
- 1b51511 semantic: Use `Atom` instead of `CompactStr` for
`UnresolvedReferencesStack` (#4401 ) (Dunqing)
- 40f9356 semantic: Calculate number of nodes, scopes, symbols,
references before visiting AST (#4367 ) (Dunqing)
- da13d93 semantic: Remove bounds checks on unresolved references stack
(#4390 ) (overlookmotel)
- e70c67b semantic: Remove a branch from `add_scope` (#4384 )
(overlookmotel)
- 402006f semantic: Simplify logic in `enter_scope` + `leave_scope`
(#4383 ) (overlookmotel)
- 7469e01 semantic: Remove branch from `Nodes::add_node` (#4361 )
(overlookmotel)
- 7eb2864 traverse: Speed up finding UID binding name (#4356 )
(overlookmotel)- a207923 Replace some CompactStr usages with Cows
(#4377 ) (DonIsaac)
### Refactor
- d213773 ast: Replace serde rename "lowercase" with "camelCase" (#4376 )
(overlookmotel)
- abfccbd ast: Reduce `#[cfg_attr]` boilerplate in AST type defs (#4375 )
(overlookmotel)
- 5f1c7ec ast: Rename the `visited_node` marker to `ast`. (#4289 )
(rzvxa)
- 58f6ec2 ast: Enter node before scope (#4347 ) (Dunqing)
- 59aea73 ast: Scope is created only if CatchClause has param (#4346 )
(Dunqing)
- 7a3e925 ast_codegen: Better visit marker parsing. (#4371 ) (rzvxa)
- 7a75e0f linter: Use diagnostic codes in lint rules (#4349 ) (DonIsaac)
- a2eabe1 parser: Use error codes for ts diagnostics (#4335 ) (DonIsaac)
- 5d77b36 semantic: `visit_program` visit `hashbang` field (#4370 )
(overlookmotel)
- f7b9ada semantic: `Program` visitor leave scope before node (#4369 )
(overlookmotel)
- 729b288 semantic: Shorten code (#4358 ) (overlookmotel)
- 21d0eee semantic: Use error codes for ts diagnostics (#4336 )
(DonIsaac)
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-07-23 09:38:03 +08:00
Boshen
44a10c4b91
fix(codegen): object shorthand with parens ({x: (x)}) -> ({ x }) ( #4391 )
2024-07-21 14:04:17 +00:00
Boshen
3d88f20cbb
fix(codegen): print shorthand for all { x } variants ( #4374 )
...
closes #4340
2024-07-21 19:54:21 +08:00
Boshen
e624dff1d4
fix(codegen,mangler): do not print shorthand for ObjectProperty ( #4350 )
...
I'll fix the TODO's later.
2024-07-18 16:26:33 +00:00
github-actions[bot]
7d751898b3
Release crates v0.21.0 ( #4344 )
...
## [0.21.0] - 2024-07-18
- d7ab0b8 semantic: [**BREAKING**] Simplify node creation (#4226 )
(lucab)
### Features
- af4dc01 ast: Align ts ast scope with typescript (#4253 ) (Dunqing)
- 83c2c62 codegen: Add option for choosing quotes; remove slow
`choose_quot` method (#4219 ) (Boshen)
- 5d17675 mangler: Add debug mode (#4314 ) (Boshen)
- e3e663b mangler: Initialize crate and integrate into minifier (#4197 )
(Boshen)
- c818472 minifier: Dce conditional expression `&&` or `||` (#4190 )
(Boshen)
- 8a190eb oxc: Export `oxc_mangler` (Boshen)
- 20cdb1f semantic: Align class scope with typescript (#4195 ) (Dunqing)
- 92ee774 semantic: Add `ScopeFlags::CatchClause` for use in CatchClause
(#4205 ) (Dunqing)
- 205c259 sourcemap: Support SourceMapBuilder#token_chunks (#4220 )
(underfin)
- 7eb960d transformer: Decode xml character entity `&#xhhhh` and
`&#nnnn;` (#4235 ) (Boshen)
### Bug Fixes
- bf3d8d3 codegen: Print annotation comment inside parens for new and
call expressions (#4290 ) (Boshen)
- 084ab76 codegen: Use `ryu-js` for f64 to string (Boshen)
- e167ef7 codegen: Print parenthesis properly (#4245 ) (Boshen)
- c65198f codegen: Choose the right quote for jsx attribute string
(#4236 ) (Boshen)
- be82c28 codegen: Print `JSXAttributeValue::StringLiteral` directly
(#4231 ) (Boshen)
- 3df9e69 mangler: No shorthand `BindingProperty`; handle var hoisting
and export variables (#4319 ) (Boshen)
- f144082 minifier: RemoveDeadCode should visit nested expression
(#4268 ) (underfin)
- 66b455a oxc_codegen: Avoid print same pure comments multiple time
(#4230 ) (IWANABETHATGUY)
- 9a87e41 parser: Avoid crashing on invalid const modifier (#4267 )
(lucab)
- 641a78b parser: Fix tests for number parsing (#4254 ) (overlookmotel)
- 9badac0 semantic: Avoid var hosting insert the var variable to the
`CatchClause` scope (#4337 ) (Dunqing)
- 95e15b6 semantic: Incorrect resolve references for `ExportSpecifier`
(#4320 ) (Dunqing)
- c362bf7 semantic: Incorrect resolve references for
`TSInterfaceHeritage` (#4311 ) (Dunqing)
- 351ecf2 semantic: Incorrect resolve references for `TSTypeQuery`
(#4310 ) (Dunqing)
- 1108f2a semantic: Resolve references to the incorrect symbol (#4280 )
(Dunqing)
- 22d56bd semantic: Do not resolve references after `FormalParameters`
in TS type (#4241 ) (overlookmotel)- 1c117eb Avoid print extra semicolon
after accessor property (#4199 ) (IWANABETHATGUY)
### Performance
- a8dc4f3 parser: Speed up parsing numbers with `_` separators (#4259 )
(overlookmotel)
- b94540d parser: Speed up parsing octal literals (#4258 )
(overlookmotel)
- a7b328c parser: Faster parsing decimal numbers (#4257 ) (overlookmotel)
- f9d3f2e semantic: Inline ast record functions (#4272 ) (overlookmotel)
- 8fad7db semantic: Reduce `AstNodeId` to `u32` (#4264 ) (overlookmotel)
- 23743db semantic: Do not record ast nodes for cfg if cfg disabled
(#4263 ) (overlookmotel)
- da69076 semantic: Reduce overhead of cfg recording ast nodes (#4262 )
(overlookmotel)
- cb15303 semantic: Reduce memory copies (#4216 ) (overlookmotel)
- ef4c1f4 semantic: Reduce lookups (#4214 ) (overlookmotel)
- f23e54f semantic: Recycle unresolved references hash maps (#4213 )
(overlookmotel)
- 2602ce2 semantic: Reuse existing map of unresolved refs (#4206 )
(lucab)
### Refactor
- 2c7bb9f ast: Pass final `ScopeFlags` into `visit_function` (#4283 )
(overlookmotel)
- 3e099fe ast: Move `enter_scope` after `visit_binding_identifier`
(#4246 ) (Dunqing)
- aab7aaa ast/visit: Fire node events as the outermost one. (#4203 )
(rzvxa)
- d1c4be0 codegen: Clean up annotation_comment (Boshen)
- 06197b8 codegen: Separate tests (Boshen)
- aa22073 codegen: Improve print API (#4196 ) (Boshen)
- c5731a5 semantic: Remove defunct code setting ScopeFlags twice (#4286 )
(overlookmotel)
- 16698bc semantic: Move function/class-specific code into specific
visitors (#4278 ) (overlookmotel)
- ee16668 semantic: Rename function param (#4277 ) (overlookmotel)
- 25f0771 semantic: Alter syntax of `control_flow!` macro (#4275 )
(overlookmotel)
- 639fd48 semantic: Comment why extra CFG enabled check (#4274 )
(overlookmotel)
- c418bf5 semantic: Directly record `current_node_id` when adding a
scope (#4265 ) (Dunqing)
- ace4f1f semantic: Update the order of `visit_function` and `Visit`
fields in the builder to be consistent (#4248 ) (Dunqing)
- 8bfeabf semantic: Simplify adding `SymbolFlags::Export` (#4249 )
(Dunqing)
- dc2b3c4 semantic: Add strict mode in scope flags for class definitions
(#4156 ) (Dunqing)
- 81ed588 semantic: Convert scope fields to IndexVecs (#4208 ) (lucab)
- bbe5ded semantic: Set `current_scope_id` to `scope_id` in
`enter_scope` (#4193 ) (Dunqing)
- 7f1addd semantic: Correct scope in CatchClause (#4192 ) (Dunqing)
- fc0b17d syntax: Turn the `AstNodeId::dummy` into a constant field.
(#4308 ) (rzvxa)
- a197e01 transformer/typescript: Remove unnecessary code (#4321 )
(Dunqing)
- 1458d81 visit: Add `#[inline]` to empty functions (#4330 )
(overlookmotel)
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-07-18 14:39:07 +08:00
Dunqing
fc39ffa009
Revert "Release crates v0.21.0" ( #4342 )
...
Reverts oxc-project/oxc#4338
https://github.com/oxc-project/oxc/actions/runs/9986290706/job/27598542089
Release failed
2024-07-18 14:11:42 +08:00
github-actions[bot]
0abcf499b7
Release crates v0.21.0 ( #4338 )
...
## [0.21.0] - 2024-07-18
- d7ab0b8 semantic: [**BREAKING**] Simplify node creation (#4226 )
(lucab)
### Features
- af4dc01 ast: Align ts ast scope with typescript (#4253 ) (Dunqing)
- 83c2c62 codegen: Add option for choosing quotes; remove slow
`choose_quot` method (#4219 ) (Boshen)
- 5d17675 mangler: Add debug mode (#4314 ) (Boshen)
- e3e663b mangler: Initialize crate and integrate into minifier (#4197 )
(Boshen)
- c818472 minifier: Dce conditional expression `&&` or `||` (#4190 )
(Boshen)
- 8a190eb oxc: Export `oxc_mangler` (Boshen)
- 20cdb1f semantic: Align class scope with typescript (#4195 ) (Dunqing)
- 92ee774 semantic: Add `ScopeFlags::CatchClause` for use in CatchClause
(#4205 ) (Dunqing)
- 205c259 sourcemap: Support SourceMapBuilder#token_chunks (#4220 )
(underfin)
- 7eb960d transformer: Decode xml character entity `&#xhhhh` and
`&#nnnn;` (#4235 ) (Boshen)
### Bug Fixes
- bf3d8d3 codegen: Print annotation comment inside parens for new and
call expressions (#4290 ) (Boshen)
- 084ab76 codegen: Use `ryu-js` for f64 to string (Boshen)
- e167ef7 codegen: Print parenthesis properly (#4245 ) (Boshen)
- c65198f codegen: Choose the right quote for jsx attribute string
(#4236 ) (Boshen)
- be82c28 codegen: Print `JSXAttributeValue::StringLiteral` directly
(#4231 ) (Boshen)
- 3df9e69 mangler: No shorthand `BindingProperty`; handle var hoisting
and export variables (#4319 ) (Boshen)
- f144082 minifier: RemoveDeadCode should visit nested expression
(#4268 ) (underfin)
- 66b455a oxc_codegen: Avoid print same pure comments multiple time
(#4230 ) (IWANABETHATGUY)
- 9a87e41 parser: Avoid crashing on invalid const modifier (#4267 )
(lucab)
- 641a78b parser: Fix tests for number parsing (#4254 ) (overlookmotel)
- 9badac0 semantic: Avoid var hosting insert the var variable to the
`CatchClause` scope (#4337 ) (Dunqing)
- 95e15b6 semantic: Incorrect resolve references for `ExportSpecifier`
(#4320 ) (Dunqing)
- c362bf7 semantic: Incorrect resolve references for
`TSInterfaceHeritage` (#4311 ) (Dunqing)
- 351ecf2 semantic: Incorrect resolve references for `TSTypeQuery`
(#4310 ) (Dunqing)
- 1108f2a semantic: Resolve references to the incorrect symbol (#4280 )
(Dunqing)
- 22d56bd semantic: Do not resolve references after `FormalParameters`
in TS type (#4241 ) (overlookmotel)- 1c117eb Avoid print extra semicolon
after accessor property (#4199 ) (IWANABETHATGUY)
### Performance
- a8dc4f3 parser: Speed up parsing numbers with `_` separators (#4259 )
(overlookmotel)
- b94540d parser: Speed up parsing octal literals (#4258 )
(overlookmotel)
- a7b328c parser: Faster parsing decimal numbers (#4257 ) (overlookmotel)
- f9d3f2e semantic: Inline ast record functions (#4272 ) (overlookmotel)
- 8fad7db semantic: Reduce `AstNodeId` to `u32` (#4264 ) (overlookmotel)
- 23743db semantic: Do not record ast nodes for cfg if cfg disabled
(#4263 ) (overlookmotel)
- da69076 semantic: Reduce overhead of cfg recording ast nodes (#4262 )
(overlookmotel)
- cb15303 semantic: Reduce memory copies (#4216 ) (overlookmotel)
- ef4c1f4 semantic: Reduce lookups (#4214 ) (overlookmotel)
- f23e54f semantic: Recycle unresolved references hash maps (#4213 )
(overlookmotel)
- 2602ce2 semantic: Reuse existing map of unresolved refs (#4206 )
(lucab)
### Refactor
- 2c7bb9f ast: Pass final `ScopeFlags` into `visit_function` (#4283 )
(overlookmotel)
- 3e099fe ast: Move `enter_scope` after `visit_binding_identifier`
(#4246 ) (Dunqing)
- aab7aaa ast/visit: Fire node events as the outermost one. (#4203 )
(rzvxa)
- d1c4be0 codegen: Clean up annotation_comment (Boshen)
- 06197b8 codegen: Separate tests (Boshen)
- aa22073 codegen: Improve print API (#4196 ) (Boshen)
- c5731a5 semantic: Remove defunct code setting ScopeFlags twice (#4286 )
(overlookmotel)
- 16698bc semantic: Move function/class-specific code into specific
visitors (#4278 ) (overlookmotel)
- ee16668 semantic: Rename function param (#4277 ) (overlookmotel)
- 25f0771 semantic: Alter syntax of `control_flow!` macro (#4275 )
(overlookmotel)
- 639fd48 semantic: Comment why extra CFG enabled check (#4274 )
(overlookmotel)
- c418bf5 semantic: Directly record `current_node_id` when adding a
scope (#4265 ) (Dunqing)
- ace4f1f semantic: Update the order of `visit_function` and `Visit`
fields in the builder to be consistent (#4248 ) (Dunqing)
- 8bfeabf semantic: Simplify adding `SymbolFlags::Export` (#4249 )
(Dunqing)
- dc2b3c4 semantic: Add strict mode in scope flags for class definitions
(#4156 ) (Dunqing)
- 81ed588 semantic: Convert scope fields to IndexVecs (#4208 ) (lucab)
- bbe5ded semantic: Set `current_scope_id` to `scope_id` in
`enter_scope` (#4193 ) (Dunqing)
- 7f1addd semantic: Correct scope in CatchClause (#4192 ) (Dunqing)
- fc0b17d syntax: Turn the `AstNodeId::dummy` into a constant field.
(#4308 ) (rzvxa)
- a197e01 transformer/typescript: Remove unnecessary code (#4321 )
(Dunqing)
- 1458d81 visit: Add `#[inline]` to empty functions (#4330 )
(overlookmotel)
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-07-18 13:56:35 +08:00
Boshen
3df9e697cc
fix(mangler): no shorthand BindingProperty; handle var hoisting and export variables ( #4319 )
...
Trying to pass tests in https://github.com/oxc-project/monitor-oxc
2024-07-17 18:12:42 +08:00
Boshen
bf3d8d3e8f
fix(codegen): print annotation comment inside parens for new and call expressions ( #4290 )
2024-07-16 06:55:36 +00:00
Boshen
a71787572e
chore: remove unsafe_code = "warn" rust lint
...
Feels too verbose as we already have unsafe comment turned on
2024-07-15 10:39:08 +08:00
Boshen
9a094e861e
chore(codegen): add ts snapshot test
2024-07-14 20:46:22 +08:00
Boshen
d1c4be0020
refactor(codegen): clean up annotation_comment
2024-07-14 15:55:50 +08:00
Boshen
084ab7602d
fix(codegen): use ryu-js for f64 to string
2024-07-14 13:23:30 +08:00
Boshen
06197b8be4
refactor(codegen): separate tests
2024-07-14 12:56:02 +08:00
Boshen
e167ef79c6
fix(codegen): print parenthesis properly ( #4245 )
...
`TSParenthesizedType` handles parenthesis in ts types.
It should be considered a bug if parenthesis is not printed correctly after this PR.
2024-07-14 04:13:10 +00:00
Boshen
c65198fa15
fix(codegen): choose the right quote for jsx attribute string ( #4236 )
2024-07-12 17:30:24 +00:00
Boshen
be82c286d6
fix(codegen): print JSXAttributeValue::StringLiteral directly ( #4231 )
...
jsx attribute string is interpreted as is without escaping.
The transformer is responsible for converting it to plain js string.
2024-07-12 16:17:23 +00:00
IWANABETHATGUY
66b455a2b2
fix(oxc_codegen): avoid print same pure comments multiple time ( #4230 )
...
## Before
```bash
Original:
const builtInSymbols = new Set(
/*#__PURE__*/
Object.getOwnPropertyNames(Symbol)
.filter(key => key !== 'arguments' && key !== 'caller')
)
Printed:
const builtInSymbols = new Set(/*#__PURE__*/ /*#__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller"));
Minified:
const builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).filter((key)=>key!=="arguments"&&key!=="caller"))
```
## After
```bash
Original:
const builtInSymbols = new Set(
/*#__PURE__*/
Object.getOwnPropertyNames(Symbol)
.filter(key => key !== 'arguments' && key !== 'caller')
)
Printed:
const builtInSymbols = new Set(/*#__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller"));
Minified:
const builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).filter((key)=>key!=="arguments"&&key!=="caller"))
```
2024-07-12 23:07:43 +08:00
Boshen
83c2c62f7b
feat(codegen): add option for choosing quotes; remove slow choose_quot method ( #4219 )
2024-07-12 03:08:22 +00:00
IWANABETHATGUY
1c117eb20d
fix: avoid print extra semicolon after accessor property ( #4199 )
...
## Before
```js
export default class Foo { @x @y accessor #aDef = 1 }
```
**output**
```bash
Original:
export default class Foo { @x @y accessor #aDef = 1 }
Printed:
export default class Foo {
accessor #aDef=1;;
}
```
2024-07-11 20:16:02 +08:00
Boshen
e3e663bae4
feat(mangler): initialize crate and integrate into minifier ( #4197 )
2024-07-11 10:35:13 +00:00
Boshen
aa22073736
refactor(codegen): improve print API ( #4196 )
2024-07-11 08:41:04 +00:00
github-actions[bot]
2a169d1969
Release crates v0.20.0 ( #4189 )
...
## [0.20.0] - 2024-07-11
- 5731e39 ast: [**BREAKING**] Store span details inside comment struct
(#4132 ) (Luca Bruno)
### Features
- 67fe75e ast, ast_codegen: Pass the `scope_id` to the `enter_scope`
event. (#4168 ) (rzvxa)
- 54cd04a minifier: Implement dce with var hoisting (#4160 ) (Boshen)
- 44a894a minifier: Implement return statement dce (#4155 ) (Boshen)
- 725571a napi/transformer: Add `jsx` option to force parsing with jsx
(#4133 ) (Boshen)
### Bug Fixes
- 48947a2 ast: Put `decorators` before everything else. (#4143 ) (rzvxa)
- 7a059ab cfg: Double resolution of labeled statements. (#4177 ) (rzvxa)
- 4a656c3 lexer: Incorrect lexing of large hex/octal/binary literals
(#4072 ) (DonIsaac)
- 28eeee0 parser: Fix asi error diagnostic pointing at invalid text
causing crash (#4163 ) (Boshen)
### Performance
- ddfa343 diagnostic: Use `Cow<'static, str>` over `String` (#4175 )
(DonIsaac)
- 2203143 semantic: Store unresolved refs in a stack (#4162 ) (lucab)
- fca9706 semantic: Faster search for leading comments (#4140 ) (Boshen)
### Documentation
- bdcc298 ast: Update the note regarding the `ast_codegen` markers.
(#4149 ) (rzvxa)
### Refactor
- 03ad1e3 semantic: Tweak comment argument type (#4157 ) (lucab)
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-07-11 11:05:49 +08:00
Boshen
083fe38971
chore(codegen): add a for loop special case
2024-07-11 01:35:05 +08:00
Luca Bruno
5731e3957f
refactor(ast)!: store span details inside comment struct ( #4132 )
...
This tweaks `Comment` definition in order to internally store the start
and end position of its span.
Closes: https://github.com/oxc-project/oxc/issues/4069
2024-07-09 23:23:43 +08:00
github-actions[bot]
714bf1dd7f
Release crates v0.19.0 ( #4137 )
...
## [0.19.0] - 2024-07-09
- b936162 ast/ast_builder: [**BREAKING**] Shorter allocator utility
method names. (#4122 ) (rzvxa)
### Features
- 485c871 ast: Allow conversion from `Expression` into `Statement` with
`FromIn` trait. (#4124 ) (rzvxa)
### Refactor
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-07-09 20:32:06 +08:00
github-actions[bot]
e29cdbfe40
Release crates v0.18.0 ( #4136 )
...
## [0.18.0] - 2024-07-09
- d347aed ast: [**BREAKING**] Generate `ast_builder.rs`. (#3890 ) (rzvxa)
### Features
- c6c16a5 minifier: Dce all conditional expressions (#4135 ) (Boshen)
- 365d9ba oxc_codegen: Generate annotation comments before
`CallExpression` and `NewExpression` (#4119 ) (IWANABETHATGUY)
- 3a0f2aa parser: Check for illegal modifiers in modules and namespaces
(#4126 ) (DonIsaac)
- 2f53bdf semantic: Check for abstract ClassElements in non-abstract
classes (#4127 ) (DonIsaac)
- c4ee9f8 semantic: Check for abstract initializations and
implementations (#4125 ) (Don Isaac)
- 44c7fe3 span: Add various implementations of `FromIn` for `Atom`.
(#4090 ) (rzvxa)
### Bug Fixes
- cb1af04 isolated-declarations: Remove the `async` and `generator`
keywords from `MethodDefinition` (#4130 ) (Dunqing)
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-07-09 19:56:10 +08:00
IWANABETHATGUY
365d9ba252
feat(oxc_codegen): generate annotation comments before CallExpression and NewExpression ( #4119 )
...
1. test case copy from `vue/core`, here are all usages of `#__PURE__` in
`vue/core`
https://gist.github.com/IWANABETHATGUY/c7911ecd98467a2969b2a994a34d32bc#file-pure_annotation_in_vue_repo-sh
2. Also took a look in other codebase,
https://github.com/search?q=%23__PURE__&type=code , most of the usage of
`#__PURE__` attached as leading comment before `CallExpression` and
`NewExpression`
2024-07-09 00:22:28 +08:00
github-actions[bot]
c3f08ce8e0
Release crates v0.17.2 ( #4115 )
...
## [0.17.2] - 2024-07-08
### Features
- 115ac3b allocator: Introduce `FromIn` and `IntoIn` traits. (#4088 )
(rzvxa)
- 720983a napi/transform: Allow setting `sourceType` to `transform`
(#4113 ) (Boshen)
- e386b62 semantic: Check for invalid type import assignments (#4097 )
(DonIsaac)
### Bug Fixes
- 5472b7c codegen: 256 indentations level is not enough for codegen
(Boshen)
- 5c31236 isolated-declarations: Keep literal value for readonly
property (#4106 ) (Dunqing)
- e67c7d1 isolated-declarations: Do not infer type for private
parameters (#4105 ) (Dunqing)
- 3fcad5e isolated_declarations: Remove nested AssignmentPatterns from
inside parameters (#4077 ) (michaelm)
- f8d77e4 isolated_declarations: Infer type of template literal
expressions as string (#4068 ) (michaelm)
- 0f02608 semantic: Bind `TSImportEqualsDeclaration`s (#4100 ) (Don
Isaac)
- 4413e2d transformer: Missing initializer for readonly consructor
properties (#4103 ) (Don Isaac)
### Performance
- 7ed27b7 isolated-declarations: Use `FxHashSet` instead of `Vec` to
speed up the `contain` (#4074 ) (Dunqing)
- 9114c8e semantic: Keep a single map of unresolved references (#4107 )
(Luca Bruno)
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-07-08 19:16:33 +08:00
Boshen
5472b7c990
fix(codegen): 256 indentations level is not enough for codegen
2024-07-08 00:25:37 +08:00
github-actions[bot]
51d56d37ff
Release crates v0.17.1 ( #4075 )
...
## [0.17.1] - 2024-07-06
### Bug Fixes
- aa585d3 ast_codegen, ast: Visit `ExpressionArrayElement` as
`Expression`. (#4061 ) (rzvxa)
- 564a75a codegen: Missing TypeParameters in TSConstructSignature
(#4063 ) (michaelm)
- adee728 isolated_declarations: Don't report an error for parameters if
they are ObjectPattern or ArrayPattern with an explicit type (#4065 )
(michaelm)
- 1b8f208 isolated_declarations: Correct emit for private static methods
(#4064 ) (michaelm)
- 719fb96 minifier: Omit dce `undefined` which can be a shadowed
variable (#4073 ) (Boshen)
- 150f4d9 napi/transform: Display error with spanned messages (Boshen)
### Performance
- 7fe2a2f parser: Do not copy comments (#4067 ) (overlookmotel)
### Refactor
- 8fa98e0 ast: Inline trivial functions and shorten code (#4066 )
(overlookmotel)
- 65aee19 isolated-declarations: Reorganize scope tree (#4070 ) (Luca
Bruno)
Co-authored-by: Boshen <Boshen@users.noreply.github.com>
2024-07-07 01:29:52 +08:00
michaelm
564a75ab37
fix(codegen): missing TypeParameters in TSConstructSignature ( #4063 )
2024-07-06 13:59:49 +08:00