oxc/crates/oxc_codegen/CHANGELOG.md
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

13 KiB

Changelog

All notable changes to this package will be documented in this file.

The format is based on Keep a Changelog, and this project does not adhere to Semantic Versioning until v1.0.0.

[0.22.0] - 2024-07-23

Bug Fixes

  • 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)

[0.21.0] - 2024-07-18

Features

  • 83c2c62 codegen: Add option for choosing quotes; remove slow choose_quot method (#4219) (Boshen)
  • e3e663b mangler: Initialize crate and integrate into minifier (#4197) (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)
  • 66b455a oxc_codegen: Avoid print same pure comments multiple time (#4230) (IWANABETHATGUY)- 1c117eb Avoid print extra semicolon after accessor property (#4199) (IWANABETHATGUY)

Refactor

  • d1c4be0 codegen: Clean up annotation_comment (Boshen)
  • 06197b8 codegen: Separate tests (Boshen)
  • aa22073 codegen: Improve print API (#4196) (Boshen)

[0.20.0] - 2024-07-11

  • 5731e39 ast: [BREAKING] Store span details inside comment struct (#4132) (Luca Bruno)

Refactor

[0.18.0] - 2024-07-09

Features

  • 365d9ba oxc_codegen: Generate annotation comments before CallExpression and NewExpression (#4119) (IWANABETHATGUY)

[0.17.2] - 2024-07-08

Bug Fixes

  • 5472b7c codegen: 256 indentations level is not enough for codegen (Boshen)

[0.17.1] - 2024-07-06

Bug Fixes

  • 564a75a codegen: Missing TypeParameters in TSConstructSignature (#4063) (michaelm)

[0.17.0] - 2024-07-05

Features

  • 7768d23 isolated-declarations: Support optional class methods (#4035) (Egor Blinov)

Bug Fixes

  • aaac2d8 codegen: Preserve parentheses from AST instead calculating from operator precedence (#4055) (Boshen)
  • 5e5b1b1 codegen: Correct accessibility emit for class formal-parameters/methods/properties (#4042) (Egor Blinov)
  • 7844734 codegen: Missing const keyword in TSTypeParamter (#4022) (Dunqing)
  • 6254a41 codegen: Missing TypeParamters in TSCallSignature (#4021) (Dunqing)

[0.16.3] - 2024-07-02

Bug Fixes

  • 23038ad codegen: Print TSFunctionType inside TSTypeAssertion (#3999) (Boshen)

[0.16.2] - 2024-06-30

Features

  • dc6d45e ast,codegen: Add TSParenthesizedType and print type parentheses correctly (#3979) (Boshen)

Bug Fixes

  • dac617d codegen: Print some missing typescript attributes (#3980) (Boshen)

[0.16.1] - 2024-06-29

Bug Fixes

  • 51e54f9 codegen: Should print TSModuleDeclarationKind instead of just module (#3957) (Dunqing)

[0.16.0] - 2024-06-26

  • 6796891 ast: [BREAKING] Rename all instances of BigintLiteral to BigIntLiteral. (#3898) (rzvxa)

  • ae09a97 ast: [BREAKING] Remove Modifiers from ts nodes (#3846) (Boshen)

  • 1af5ed3 ast: [BREAKING] Replace Modifiers with declare and const on EnumDeclaration (#3845) (Boshen)

  • 0673677 ast: [BREAKING] Replace Modifiers with declare on Function (#3844) (Boshen)

  • ee6ec4e ast: [BREAKING] Replace Modifiers with declare and abstract on Class (#3841) (Boshen)

  • 9b38119 ast: [BREAKING] Replace Modifiers with declare on VariableDeclaration (#3839) (Boshen)

  • cfcef24 ast: [BREAKING] Add directives field to TSModuleBlock (#3830) (Boshen)

  • 4456034 ast: [BREAKING] Add IdentifierReference to ExportSpecifier (#3820) (Boshen)

Features

  • 5847e16 ast,parser: Add intrinsic keyword (#3767) (Boshen)
  • 01da2f7 codegen: Print TSThisParameter for TSCallSignatureDeclaration and TSMethodSignature (#3792) (Dunqing)
  • 2821e0e codegen: Print readonly keyword for TSIndexSignature (#3791) (Dunqing)
  • 97575d8 codegen: Print TSClassImplements and TSThisParameter (#3786) (Dunqing)

Bug Fixes

  • 2766594 codegen: Print type parameters for MethodDefinition (#3922) (Dunqing)

Performance

  • 4f7ff7e Do not pass &Atom to functions (#3818) (overlookmotel)

Refactor

  • 4cf3c76 parser: Improve parsing of TypeScript types (#3903) (Boshen)

[0.15.0] - 2024-06-18

  • 5c38a0f codegen: [BREAKING] New code gen API (#3740) (Boshen)

  • 534242a codegen: [BREAKING] Remove CodegenOptions::enable_typescript (#3674) (Boshen)

  • 0578ece ast: [BREAKING] Remove ExportDefaultDeclarationKind::TSEnumDeclaration (#3666) (Dunqing)

Features

  • 5a99d30 codegen: Improve codegen formatting (#3735) (Boshen)
  • bf9b38a codegen: Improve codegen formatting (#3731) (Boshen)
  • 4a004e2 codegen: Print TSImport remaining fields (#3695) (Dunqing)
  • a56cb1b codegen: Print accessibility for MethodDefinition (#3690) (Dunqing)
  • 38a75e5 coverage: Improve codegen (#3729) (Boshen)
  • 4f2db46 transformer-dts: --isolatedDeclarations dts transform (#3664) (Dunqing)

Bug Fixes

  • da1e2d0 codegen: Improve typescript codegen (#3708) (Boshen)

Refactor

  • fa7a6ba codegen: Add gen method to ast nodes (#3687) (Boshen)
  • 09b92b6 codegen: Move gen_ts into gen to make searching things easier (#3680) (Boshen)
  • 815260e isolated-declarations: Decouple codegen (#3715) (Boshen)
  • 4f16664 transformer_dts: Create a Program for codegen (#3679) (Boshen)

[0.14.0] - 2024-06-12

Refactor

  • f98f777 linter: Add rule fixer (#3589) (Don Isaac)

[0.13.4] - 2024-06-07

Features

  • 5c8e16c coverage: Second transformer build does not print typescript (#3561) (Dunqing)

Bug Fixes

  • affb2c8 codegen: Print indentation before directive (#3512) (Dunqing)

[0.13.3] - 2024-06-04

Bug Fixes

  • 98c9029 codegen: Should be double quote for jsx attribute value (#3516) (Dunqing)
  • d8063b6 codegen: Wrong escape string (#3514) (Dunqing)

Refactor

  • ddac2a0 codegen: Reduce allocation for print_unquoted_str (#3525) (Dunqing)

[0.13.2] - 2024-06-03

Features

  • 0cdb45a oxc_codegen: Preserve annotate comment (#3465) (IWANABETHATGUY)

[0.13.1] - 2024-05-22

Features

  • e2dd8ac syntax: Export is_reserved_keyword and is_global_object method (#3384) (Boshen)

Bug Fixes

  • a12ed0f codegen: Using declaration in for statement (#3285) (Don Isaac)

Refactor

  • 9ced605 parser: Start porting arrow function parsing from tsc (#3340) (Boshen)
  • e879685 sourcemap: Using binary search to search original position (#3360) (underfin)

[0.13.0] - 2024-05-14

Features

  • eefb66f ast: Add type to AccessorProperty to support TSAbractAccessorProperty (#3256) (Dunqing)

Bug Fixes

  • 0ba7778 parser: Correctly parse cls.fn = x (#3208) (Dunqing)

Refactor

  • 7e1fe36 ast: Squash nested enums (#3115) (overlookmotel)
  • 0185eb2 ast: Remove duplicate TSNamedTupleMember representation (#3101) (overlookmotel)
  • a8af5de syntax: Move number related functions to number module (#3130) (Boshen)

[0.12.5] - 2024-04-22

Features

  • 92d709b ast: Add CatchParameter node (#3049) (Boshen)

[0.12.4] - 2024-04-19

Features

  • fd5002b codegen: Correctly print type-only imports/exports (#2993) (Dunqing)

[0.12.1] - 2024-04-03

Bug Fixes

  • 28fae2e sourcemap: Using serde_json::to_string to quote sourcemap string (#2889) (underfin)

Refactor

  • 114f68e codegen: Make codegen sourcemap builder clearer (#2894) (underfin)

[0.11.0] - 2024-03-30

Features

  • 243131d transformer: Numeric separator plugin. (#2795) (Ali Rezvani)- b199cb8 Add oxc sourcemap crate (#2825) (underfin)- a2cfc86 SourcemapVisualizer (#2773) (underfin)

Bug Fixes

  • 6177c2f codegen: Sourcemap token name should be original name (#2843) (underfin)
  • b76b02d parser: Add support for empty module declaration (#2834) (Ali Rezvani)

Performance

  • 2be5f9d codegen: Avoid unnecessary copy (#2727) (underfin)
  • d7004da sourcemap: Remove unnecessary binary search (#2728) (underfin)

Refactor

  • d9b77d8 sourcemap: Change sourcemap name to take a reference (#2779) (underfin)

[0.10.0] - 2024-03-14

  • c3477de ast: [BREAKING] Rename BigintLiteral to BigIntLiteral (#2659) (Arnaud Barré)

Bug Fixes

  • 9609c34 codegen: CallExpression sourcemap (#2717) (underfin)
  • b453a07 parser: Parse named rest element in type tuple (#2655) (Arnaud Barré)

[0.9.0] - 2024-03-05

  • f66059e ast: [BREAKING] Align TSImportType with ESTree (#2578) (Arnaud Barré)

Features

  • 20c7bf7 ast: Add AssignmentTargetRest (#2601) (Boshen)
  • 3efbbb2 ast: Add "abstract" type to MethodDefinition and PropertyDefinition (#2536) (Boshen)
  • 8bb1084 codegen: Add sourcemap (#2565) (Boshen)

Bug Fixes

  • ea30fd5 codegen: Fix adding mapping to sourcemaps (#2590) (overlookmotel)
  • fe29fa4 codegen: Correct sourcemaps when Windows line breaks + unicode (#2584) (overlookmotel)
  • 517026b codegen: Correct sourcemaps when unicode chars (#2583) (overlookmotel)

Performance

  • b7f5c63 codegen: Speed up generating sourcemap mappings (#2597) (overlookmotel)
  • 42fa8eb codegen: Speed up building sourcemap line tables (#2591) (overlookmotel)

Refactor

  • ef932a3 codegen: Clean up API around building sourcemaps (#2602) (Boshen)

[0.8.0] - 2024-02-26

Features

  • 6b3b260 Codegen: Improve codegen (#2460) (Andrew McClenaghan)
  • e6d536c codegen: Configurable typescript codegen (#2443) (Andrew McClenaghan)

Bug Fixes

  • 4327916 codegen: Remove redundant semicolon in PropertyDefinition (#2511) (Dunqing)
  • b5deb9a codegen: When async is on the left-hand side of a for-of, wrap it in parentheses (#2407) (Dunqing)
  • 384d5ac codegen: Lower the level of precedence in TaggedTemplateExpression (#2391) (Wenzhe Wang)

Refactor

  • 540f917 ast: Remove TSEnumBody (#2509) (Boshen)
  • 9087f71 ast: S/TSThisKeyword/TSThisType to align with estree (Boshen)
  • d08abc6 ast: S/NumberLiteral/NumericLiteral to align with estree (Boshen)
  • e6b391a ast: S/ArrowExpression/ArrowFunctionExpression to align estree (Boshen)- a2c173d Remove panic! from examples (#2454) (Boshen)

[0.7.0] - 2024-02-09

Features

  • 55011e2 codegen: Avoid printing comma in ArrayAssignmentTarget if the elements is empty (#2331) (Dunqing)

Bug Fixes

  • 2eb489e codegen: Format new expession + import expression with the correct parentheses (#2346) (Dunqing)
  • 721f6cb codegen: Format new expression + call expression with the correct parentheses (#2330) (Boshen)

Refactor

  • 1822cfe ast: Fix BigInt memory leak by removing it (#2293) (Boshen)

[0.6.0] - 2024-02-03

Features

  • 8ac0202 codegen: Keep shorthand in ObjectPattern and ObjectProperty (#2265) (Dunqing)
  • fa555ce codegen: Change back to read raw (#2222) (Wenzhe Wang)
  • 9333264 codegen: Print TemplateLiteral with print_str (#2207) (Wenzhe Wang)
  • 1ee6d8c codegen: Move string test to codegen (#2150) (Wenzhe Wang)

Bug Fixes

  • 0c225a4 codegen: Print space before with clause in import (#2278) (Wenzhe Wang)
  • d34650a codegen: Print necessary spaces for ExportAllDeclaration (#2190) (Yunfei He)
  • 989ab88 codegen: Print Directive original string (#2157) (underfin)
  • 29dc5e6 codegen: Add parenthesis in binary expression by precedence (#2067) (Wenzhe Wang)

Refactor

  • 766ca63 ast: Rename RestElement to BindingRestElement (#2116) (Dunqing)

[0.5.0] - 2024-01-12

Refactor

  • a6717db formatter,linter,codegen: Remove oxc_formatter (#1968) (Boshen)

[0.4.0] - 2023-12-08

Features

  • 9ff0ffc ast: Implement new proposal-import-attributes (#1476) (magic-akari)

Refactor

  • 1a576f6 rust: Move to workspace lint table (#1444) (Boshen)

[0.3.0] - 2023-11-06

Features

  • cef78ac codegen: Indent inner class (#1085) (Wenzhe Wang)
  • 854b55a codegen: Json strings proposal (#1039) (Boshen)
  • 6c18b3e codegen: Beauty class print (#995) (Wenzhe Wang)
  • e0ca09b codegen: Implement the basics of non-minifying codegen (#987) (Boshen)
  • 809f050 codegen: Move minifying printer to codegen crate (#985) (Boshen)
  • f28d96c codegen: Initialize the codegen crate and struct (#983) (Boshen)
  • 2e2b758 playground: Add transform and minify (#993) (Boshen)
  • e8a4e81 transformer: Implement some of jsx decode entities (#1086) (Boshen)
  • af1a76b transformer: Implement some of needs_explicit_esm for typescript (#1047) (Boshen)
  • dfee853 transformer: Add utils to make logical_assignment_operators pass (#1017) (Boshen)
  • 678db1d transformer: ES2020 Nullish Coalescing Operator (#1004) (Boshen)- 094dfa5 Support filter exec snap (#1084) (Wenzhe Wang)- 0e91044 Adjust the order of print semicolon (#1003) (Wenzhe Wang)

Bug Fixes

  • 6295f9c ast: Jsx attribute value and text child should be jsx string (#1089) (Boshen)
  • f32bf27 codegen: Fix some typescript codegen problems (#989) (Boshen)
  • a455c81 linter: Revert changes to JSX attribute strings (#1101) (Boshen)

Refactor

  • 801d78a minifier: Make the minifier api only accept an ast (#990) (Boshen)
  • 110059f rust: Change RefCell.clone().into_inner() to RefCell.get() (Boshen)