Boshen
d1d187417b
feat(ast)!: change comment.span to real position that contain // and /* ( #7154 )
...
closes #7150
2024-11-06 05:10:33 +00:00
oxc-bot
12a6952782
release(crates): v0.35.0 ( #7110 )
...
## [0.35.0] - 2024-11-04
- f543a8d ast: [**BREAKING**] Remove `AstBuilder::*_from_*` methods
(#7073 ) (overlookmotel)
- b8daab3 transformer: [**BREAKING**] API to `TryFrom<&EnvOptions> for
TransformOptions` and `TryFrom<&BabelOptions> TransformOptions` (#7020 )
(Boshen)
- 9a6a2f9 semantic: [**BREAKING**] Remove
`SymbolTable::get_symbol_id_from_span` API (#6955 ) (Boshen)
### Features
- 854870e ast: Label AST fields with #[ts] (#6987 ) (ottomated)
- ce5b609 ast: Remove explicit untagged marker on enums (#6915 )
(ottomated)
- 9725e3c ast_tools: Add #[estree(always_flatten)] to Span (#6935 )
(ottomated)
- fbc297e ast_tools: Move tsify custom types to estree attribute macro
(#6934 ) (ottomated)
- 169fa22 ast_tools: Default enums to rename_all = "camelCase" (#6933 )
(ottomated)
- caa4b1f codegen: Improve printing of comments (#7108 ) (Boshen)
- 001058a codegen: Always print legal comments on its own line (#7089 )
(Boshen)
- 413973d codegen: Print linked and external legal comment (#7059 )
(Boshen)
- ee27b92 codegen: Print eof legal comments (#7058 ) (Boshen)
- 6516f9e codegen: Print inline legal comments (#7054 ) (Boshen)
- 1e2f012 linter: Add `oxc/no-map-spread` (#6751 ) (DonIsaac)
- 6d97af4 rust: Use `oxc-miette` (#6938 ) (Boshen)
- bfdbcf1 transformer: Add `EnvOptions::from_browerslist_query` API
(#7098 ) (Boshen)
- 21b8e49 transformer: Add `ESTarget` (#7091 ) (Boshen)
- fcaba4a transformer: Add `TransformerOptions::env` with `EnvOptions`
(#7037 ) (Boshen)
- 1d906c6 transformer: Class properties transform skeleton (#7038 )
(overlookmotel)
- 934cb5e transformer: Add `async_generator_functions` plugin (#6573 )
(Dunqing)
### Bug Fixes
- 0601271 ast: Fix `StaticMemberExpression.get_first_object` (#6969 )
(tomoya yanagibashi)
- da199c7 ecmascript: Allow getting PropName for object methods (#6967 )
(camchenry)
- f5a7134 linter/no-unused-vars: False positive for discarded reads
within sequences (#6907 ) (DonIsaac)
- 9ed9501 module_lexer: Add missing `export * from 'foo';` case (#7103 )
(Boshen)
- d15e408 napi/transform: Fix 'typescript.declaration' option not
working (#7012 ) (Boshen)
- dcdb9ea napi/transform: Fix test (Boshen)
- caaf00e parser: Fix incorrect parsed `TSIndexSignature` (#7016 )
(Boshen)
- b188b4a transformer: Fix typescript globals being recognized as
globals (#7100 ) (Boshen)
- a2244ff transformer/async-to-generator: Output is incorrect when arrow
function without params (#7052 ) (Dunqing)
- 7d12669 types: Move @oxc-project/types to dependencies (#6909 )
(ottomated)
### Performance
- 6ca01b9 ast: Reduce size of `Comment` (#6921 ) (overlookmotel)
- c58ec89 data_structures: Optimize `NonEmptyStack::pop` (#7021 )
(overlookmotel)
- fa9a4ec parser: Check `.` before `[` in `parse_member_expression_rest`
(#6979 ) (Boshen)
### Refactor
- b0211a1 ast: `StaticMemberExpression::get_first_object` use loop
instead of recursion (#7065 ) (overlookmotel)
- fc07458 ast: Move custom types `.d.ts` file (#6931 ) (overlookmotel)
- c41c013 ast: Rename lifetime (#6922 ) (overlookmotel)
- 335eb38 ast_tools: Faster formatting Rust code (#6972 ) (overlookmotel)
- 4cf0085 ast_tools: Reorder imports in generated code (#6926 )
(overlookmotel)
- dd79c1b codegen: Replace `daachorse` with string match for annotation
comment (#7064 ) (Boshen)
- 0bb1aa4 codegen: Move options to its own file (#7053 ) (Boshen)
- b021147 data_structures: Make all methods of `NonNull` shim
`#[inline(always)]` (#7024 ) (overlookmotel)
- fb1710a data_structures: Add `#[repr(transparent)]` to `NonNull` shim
(#7023 ) (overlookmotel)
- f1fc8db data_structures: Add `read` method to `NonNull` shim (#7022 )
(overlookmotel)
- cea0e6b isolated_declarations: Do not use `AstBuilder::*_from_*`
methods (#7071 ) (overlookmotel)
- 97caae1 minifier: Do not use `AstBuilder::*_from_*` methods (#7072 )
(overlookmotel)
- 2c7ac29 minifier: Remove `Tri`, use `Option<bool>` instead (#6912 )
(Boshen)
- 9926990 napi: Move custom types to bottom of file (#6930 )
(overlookmotel)
- 23157bd napi: Types file in root of types package (#6929 )
(overlookmotel)
- 953b051 parser: Remove `oxc_ecmascript` crate (#7109 ) (Boshen)
- fdd480d parser: Do not use `AstBuilder::*_from_*` methods (#7068 )
(overlookmotel)
- 9e85b10 parser: Add `ParserImpl::alloc` method (#7063 ) (overlookmotel)
- 17a938e parser: Use function `parse_type_member_semicolon` (#7018 )
(Boshen)
- aa1b29c parser: Remove `parse_ts_index_signature_member` function
(#7017 ) (Boshen)
- 7f1d1fe transform: Deserialize `BabelPreests::env` directly (#7051 )
(Boshen)
- 76947e2 transform: Refactor Babel Targets (#7026 ) (Boshen)
- d03e622 transformer: Do not use `AstBuilder::*_from_*` methods (#7070 )
(overlookmotel)
- 9d384ad transformer: Use `identifier_reference_with_reference_id`
builder method (#7056 ) (overlookmotel)
- 4688a06 transformer: Use `*_with_scope_id` builder methods where
possible (#7055 ) (overlookmotel)
- 7122e00 transformer: Use `ctx.alloc` over `ctx.ast.alloc` where
possible (#7066 ) (overlookmotel)
- a3b68b4 transformer: Flatten dir structure of options/babel/env
(#7049 ) (Boshen)
- 6d92f36 transformer: Deserialize `BabelOptions::compiler_assumptions`
(#7048 ) (Boshen)
- f83a760 transformer: Deserialize `BabelOptions::presets` (#7047 )
(Boshen)
- 52c20d6 transformer: Deserialize `BabelOptions::plugins` (#7045 )
(Boshen)
- e921df6 transformer: Rename `EnvOptions` to `BabelEnvOptions` (#7036 )
(Boshen)
- af5140f transformer: Isolate babel options logic (#7034 ) (Boshen)
- 12aa910 transformer: Clean up `env/targets/query.rs` (#7033 ) (Boshen)
- 3d174bb transformer: Clean up `BabelOptions` (#7029 ) (Boshen)
- 6284f84 transformer: Use `Browserslist::Version` (#7028 ) (Boshen)
- 5b11cdf transformer: Clean up TransformerOptions (#7005 ) (Boshen)
- f0c87d4 transformer: Mark all EnvOptions as not implemented (#7004 )
(Boshen)
- d9edef6 transformer: Combine ObjectRestSpread into a single file
(#7002 ) (Boshen)
- c945fe7 transformer: Import `oxc_allocator::Box` as `ArenaBox` (#6999 )
(overlookmotel)
- fc1af2e transformer: Import `oxc_allocator::Vec` as `ArenaVec` (#6998 )
(overlookmotel)
- 63e8bfe transformer: Rename `AString` to `ArenaString` (#6997 )
(overlookmotel)
- 562bb9a transformer/async-to-generator: Move transform methods to
`AsyncGeneratorExecutor` and make it public (#6992 ) (Dunqing)
- e23f7e6 transformer/common: `VarDeclarations` insert either `var` or
`let` statements (#7043 ) (overlookmotel)
- e5ecbb9 transformer/jsx: Return `&mut T` not `&mut ArenaBox<T>`
(#7001 ) (overlookmotel)
- 9e66c29 transformer/react-refresh: Small refactor (#6973 )
(overlookmotel)
- 1ca8cd2 transformer/react-refresh: Avoid panic for `init` of
`VariableDeclarator` isn't a `BindingIdentifier` (#6937 ) (Dunqing)
- 5f153ac transformer/react-refresh: Use `VarDeclarations` to insert
declarators (#6884 ) (Dunqing)
- df3b089 transformer/react-refresh: Use `StatementInjector` to insert
statements (#6881 ) (Dunqing)
- ae22671 transformer/typescript: Pass `&mut T` not `&mut ArenaBox<T>`
(#7000 ) (overlookmotel)
- 938ee87 traverse: Do not use `AstBuilder::*_from_*` methods (#7069 )
(overlookmotel)
### Styling
- 86ab091 transformer/common: Split up `StatementInjectorStore` methods
into blocks (#7042 ) (overlookmotel)
### Testing
- 64e2499 module_lexer: Use a single integration test for faster
compilation (#7097 ) (Boshen)
- 6133a50 transformer: Use a single integration test for faster
compilation (#7099 ) (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-11-04 17:40:05 +08:00
Boshen
40d8acfbd1
feat(codegen): improvement printing of legal comments ( #7111 )
2024-11-04 08:56:00 +00:00
Boshen
caa4b1fd2a
feat(codegen): improve printing of comments ( #7108 )
2024-11-04 05:12:59 +00:00
Boshen
001058a8e4
feat(codegen): always print legal comments on its own line ( #7089 )
2024-11-02 15:55:23 +08:00
Boshen
dd79c1bfb3
refactor(codegen): replace daachorse with string match for annotation comment ( #7064 )
2024-11-02 14:16:10 +08:00
Boshen
413973df66
feat(codegen): print linked and external legal comment ( #7059 )
...
part of #7050
2024-11-02 04:08:14 +00:00
Boshen
ee27b92465
feat(codegen): print eof legal comments ( #7058 )
...
part of https://github.com/oxc-project/oxc/issues/7050
2024-11-01 16:56:57 +00:00
Boshen
6516f9eabc
feat(codegen): print inline legal comments ( #7054 )
...
part of https://github.com/oxc-project/oxc/issues/7050
2024-11-01 16:56:56 +00:00
Boshen
0bb1aa4c64
refactor(codegen): move options to its own file ( #7053 )
2024-11-01 09:28:59 +00:00
oxc-bot
238e0866cb
release(crates): v0.34.0 ( #6908 )
...
## [0.34.0] - 2024-10-26
- 4618aa2 transformer: [**BREAKING**] Rename `TransformerOptions::react`
to `jsx` (#6888 ) (Boshen)
- 90c786c regular_expression: [**BREAKING**] Support ES2025 Duplicated
named capture groups (#6847 ) (leaysgur)
- 67a7bde napi/parser: [**BREAKING**] Add typings to napi/parser (#6796 )
(ottomated)
### Features
- 1145341 ast_tools: Output typescript to a separate package (#6755 )
(ottomated)
- 4429754 ecmascript: Constant eval `null` to number (#6879 ) (Boshen)
- fd57e00 ecmascript: Add abstract_relational_comparison to dce (#6846 )
(Boshen)
- 8bcaf59 minifier: Late peeophole optimization (#6882 ) (Boshen)
- 860cbca minifier: Implement folding simple arrow fns (#6875 ) (camc314)
- c26020e minifier: Implement folding String.prototype.replaceAll
(#6871 ) (camc314)
- 50744f3 minifier: Implement folding String.prototype.replace (#6870 )
(camc314)
- fccf82e minifier: Implement folding `substring` string fns (#6869 )
(camc314)
- e6a5a1b minifier: Implement folding `charCodeAt` string fns (#6475 )
(camc314)
- 0d0bb17 transformer: Complete the async-to-generator plugin (#6658 )
(Dunqing)
- 419343b traverse: Implement `GetAddress` for `Ancestor` (#6877 )
(overlookmotel)
### Bug Fixes
- a47c70e minifier: Fix remaining runtime bugs (#6855 ) (Boshen)
- 686727f minifier: Reference read has side effect (#6851 ) (Boshen)
- c658d93 minifier: Keep template literals with expressions (#6849 )
(Boshen)
- 4dc5e51 transformer: Only run typescript plugin for typescript source
(#6889 ) (Boshen)
- 076f5c3 transformer/typescript: Retain ExportNamedDeclaration without
specifiers and declaration (#6848 ) (Dunqing)
- b075982 types: Change @oxc/types package name (#6874 ) (ottomated)
### Documentation
- 6eeb0e6 ast: Mention typescript-eslint, field ordering and shape
(#6863 ) (Boshen)
- 99e3b32 napi: Remove JSON.parse from example (#6836 ) (ottomated)
### Refactor
- adb5039 allocator: Add `impl GetAddress for Address` (#6891 )
(overlookmotel)
- 3e7507f ast_tools: Reduce macro usage (#6895 ) (overlookmotel)
- 423d54c rust: Remove the annoying `clippy::wildcard_imports` (#6860 )
(Boshen)
- 2d95009 transformer: Implement `Debug` on `StatementInjector` internal
types (#6886 ) (overlookmotel)
- c383c34 transformer: Make `StatementInjectorStore` methods generic
over `GetAddress` (#6885 ) (overlookmotel)
- 1f29523 transformer: Rename ReactJsx to Jsx (#6883 ) (Boshen)
- 333b758 transformer: `StatementInjectorStore` methods take
`&Statement` as target (#6858 ) (overlookmotel)
- c19996c transformer: Add `StatementInjectorStore::insert_many_before`
method (#6857 ) (overlookmotel)
- 7339dde transformer: `StatementInjectorStore::insert_many_after` take
an iterator (#6856 ) (overlookmotel)
- 4348eae transformer/typescript: Re-order visitor methods (#6864 )
(overlookmotel)
- 3a56d59 transformer/typescript: Insert assignments after super by
`StatementInjector` (#6654 ) (Dunqing)
- a366fae traverse: Rename
`TraverseScoping::generate_binding_in_current_scope` (#6832 )
(overlookmotel)
- 3b99fe6 traverse: Move `generate_binding` to `TraverseScoping` (#6831 )
(overlookmotel)
- 60f487a traverse: `TraverseCtx::generate_binding` take an `Atom`
(#6830 ) (overlookmotel)
### Styling
- 262b2ed ast: Move crate doc comment to top of file (#6890 )
(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-26 09:39:53 +08:00
Boshen
423d54cb74
refactor(rust): remove the annoying clippy::wildcard_imports ( #6860 )
2024-10-24 13:57:19 +00:00
oxc-bot
8f392e828e
release(crates): v0.33.0 ( #6843 )
2024-10-24 10:29:22 +08:00
Boshen
05ef03dbab
fix(codegen): correct print __proto__ shorthand ( #6802 )
2024-10-23 07:16:00 +00:00
Boshen
1b7897cf01
fix(codegen): print #field in {} << 0; correctly ( #6799 )
2024-10-23 05:34:22 +00:00
Boshen
2f6ad42348
fix(codegen): print negative bigint 1n- -1n correctly after constant folding ( #6798 )
...
closes #6767
2024-10-23 04:56:50 +00:00
Boshen
8f179534c2
fix(coverage): remove some broken cases ( #6797 )
2024-10-23 03:10:49 +00:00
DonIsaac
374b972143
docs(codegen): add #![warn(missing_docs)] to oxc_codegen ( #6711 )
...
Part of https://github.com/oxc-project/backlog/issues/130
2024-10-21 00:13:57 +00:00
oxc-bot
de99391032
release(crates): v0.32.0 ( #6691 )
...
## [0.32.0] - 2024-10-19
- c0e9d7e codegen: [**BREAKING**] `Codegen::into_source_text` consume
`Codegen` (#6539 ) (overlookmotel)
- 782f0a7 codegen: [**BREAKING**] Rename `print_char` method to
`print_ascii_byte` (#6512 ) (overlookmotel)
- 91c87dd codegen: [**BREAKING**] Remove `Codegen::enableSourceMap` API
(#6452 ) (Boshen)
- 7645e5c codegen: [**BREAKING**] Remove CommentOptions API (#6451 )
(Boshen)
- 5200960 oxc: [**BREAKING**] Remove passing `Trivias` around (#6446 )
(Boshen)
- 2808973 ast: [**BREAKING**] Add `Program::comments` (#6445 ) (Boshen)
### Features
- 5ee1ef3 allocator: Add `Vec::into_boxed_slice` (#6195 ) (DonIsaac)
- d9718ad ast_tools: Support `#[scope(exit_before)]` (#6350 ) (DonIsaac)
- e5ed6a5 codegen: Print negative numbers (#6624 ) (Boshen)
- 15c04e5 ecmascript: Add feature flag for constant evaluation (Boshen)
- d11770d ecmascript: Add `StringToNumber` (#6576 ) (Boshen)
- e561880 ecmascript: Add constant_evaluation and side_effects code
(#6550 ) (Boshen)
- 3556062 ecmascript: Add `ConstantEvaluation` (#6549 ) (Boshen)
- 39c2e66 ecmascript: Add `ToBigInt` and `StringToBigInt` (#6508 )
(Boshen)
- 6f22538 ecmascript: Add `ToBoolean`, `ToNumber`, `ToString` (#6502 )
(Boshen)
- 15dfc1d isolated-declarations: Impl `Default` for options (#6372 )
(DonIsaac)
- 071e564 minifier: Finish implementing folding object expressions
(#6586 ) (camc314)
- 590925a minifier: Finish implementing folding array expressions
(#6575 ) (camc314)
- ef237cf minifier: Complete implementation of statement fusion (#6566 )
(camc314)
- 97c8a36 minifier: Implement `collapse-variable-declarations` (#6464 )
(dalaoshu)
- 096e590 minifier: Implement folding `charAt` string fns (#6436 )
(camc314)
- e5a6f5d minifier: Implement converting template literals to strings
(#6486 ) (camc314)
- 14d0590 minifier: Implement folding of simple function calls
(`Boolean`) (#6484 ) (camc314)
- 7fbc7b6 minifier: Implement folding of simple function calls
(`String`) (#6483 ) (camc314)
- a4f57a4 minifier: Implement folding `indexOf` and `lastIndexOf` string
fns (#6435 ) (camc314)
- 3677ef8 minifier: Dce ExpressionStatements with no side effect (#6457 )
(7086cmd)
- 06ea121 minifier: Fold for statement (#6450 ) (7086cmd)
- a9544ae minifier: Partially implement minification for some known
string methods (#6424 ) (camc314)
- 9dc4ee9 minifier: Implement block stmt support for `StatementFusion`
(#6422 ) (camc314)
- ebbf77d minifier: Implement calculations for NumberValue (#6419 )
(7086cmd)
- 97ac179 minifier: Arithmetic operations for infinity. (#6332 )
(7086cmd)
- 13b0b0b minifier: Fold literal object constructors on window (#6379 )
(dalaoshu)
- e310e52 parser: Generate `Serialize` impls in ast_tools (#6404 )
(ottomated)
- 58467a5 parser: Better handling of invalid modifiers (#6482 )
(DonIsaac)
- 8ea6b72 parser: Better errors for reserved words used as identifier
names (#6478 ) (DonIsaac)
- b5b0af9 regular_expression: Support RegExp Modifiers (#6410 )
(leaysgur)
- a01a5df transformer: Pass TransformerCtx to async-to-generator plugin
(#6633 ) (Dunqing)
- a9260cf transformer: `async-to-generator` plugin. (#5590 ) (Ethan Goh)
- 8fe1b0a transformer: Support helper loader (#6162 ) (Dunqing)
- ab51c2a transformer: Support `DefaultImport` in `ModuleImports`
(#6434 ) (Dunqing)
- a3dea9c transformer/async-to-generator: Handle arrow-function
correctly (#6640 ) (Dunqing)
- 41c8675 transformer/object-rest-spread: Using helper loader (#6449 )
(Dunqing)
### Bug Fixes
- ba385fc codegen: Panic occurred when printing the comment of the right
parenthesis (#6593 ) (Dunqing)
- 02bfbfe codegen: Preserve parenthesis for `ChainExpression` (#6430 )
(Dunqing)
- 2ade16e codegen: Invalid codegen when `in` inside bin expr in or loop
(#6431 ) (camc314)
- 6896efc codegen: Fix `in` in sequence expr in for loops (#6428 )
(camc314)
- 7cc05f1 data_structures: Fix compilation failure on older Rust
versions (#6526 ) (overlookmotel)
- 2ce3e5f identifier: Add `ZWSP` to `is_irregular_whitespace` (#6662 )
(Boshen)
- 2673397 isolated_declarations: Fix potential memory leak (#6622 )
(overlookmotel)
- 389d261 minifier: `~~` operator should only work on numbers (#6598 )
(Boshen)
- 16bea12 minifier: Use `to_js_string()` instead of `fs64::to_string`
(#6597 ) (Boshen)
- a71e8a0 minifier: Preserve init variable declarations when removing
`for` statements during DCE (#6551 ) (magic-akari)
- 721cf0f parser: Should be treated comments where after `(` as leading
comments of next token (#6588 ) (Dunqing)
- b1bf12c parser: Do not parse `as` and `satisfies` expression in
javascript (#6442 ) (Boshen)
- 9f9057b regular_expression: Fixed control Y regular expression (#6524 )
(Tapan Prakash)
- c822b48 regular_expression: Fix CharacterClass negative codegen
(#6415 ) (leaysgur)
- 384d5be regular_expression: Flatten Spans on regex AST nodes (#6396 )
(ottomated)
- 834ee2a semantic: `TSConditionalType` scope enter/exit locations
(#6351 ) (DonIsaac)
- 1d3d256 transformer: Correctly trim JSX (#6639 ) (magic-akari)
- c6f2b5f transformer: `HelperLoader` common transform: do not assume
`babelHelpers` is global (#6569 ) (overlookmotel)
- 85d93ed transformer: Arrow function transform: correctly resolve
`this` in class accessor properties (#6386 ) (overlookmotel)
### Performance
- 77f3a1a codegen: Check last char with byte methods (#6509 )
(overlookmotel)
- 18b68ff codegen: Optimize `CodeBuffer::print_ascii_byte` (#6516 )
(overlookmotel)
- 4d8bc8c parser: Precompute `is_typescript` (#6443 ) (Boshen)
- 7c20056 regex: Reduce string allocations in `Display` impls (#6528 )
(DonIsaac)
- f70a413 transformer: Object spread transform: do not lookup `Object`
binding if not needed (#6570 ) (overlookmotel)
- ac77c87 traverse: Optimize `TraverseScoping::generate_uid_name`
(#6663 ) (overlookmotel)
### Documentation
- 9f555d7 allocator: Clarify docs for `Box` (#6625 ) (overlookmotel)
- 06e75b0 allocator: Enable lint warnings on missing docs, and add
missing doc comments (#6613 ) (DonIsaac)
- 7e909a7 codegen: Fix example for `CodeBuffer::print_ascii_bytes`
(#6535 ) (overlookmotel)
- 235d357 codegen: Improve doc comments for `CodeBuffer` (#6511 )
(overlookmotel)
- c8fa2eb codegen: Correct and reformat doc comments for `CodeBuffer`
(#6504 ) (overlookmotel)
- 40d1ee4 codegen: Fix and reformat `CodeBuffer` examples (#6499 )
(overlookmotel)
- de22b81 data-structures: Enable lint warnings on missing docs, and add
missing doc comments (#6612 ) (DonIsaac)
- 9e9fa9e span: Enable lint warnings on missing docs (#6617 )
(overlookmotel)
- 6a194f9 span: Document validity of `ModuleKind::Unambiguous` (#6423 )
(Boshen)
- 335b7f2 syntax: Enable lint warnings on missing docs, and add a lot of
documentation (#6611 ) (DonIsaac)
- f3451d7 transformer/async-to-generator: Remove empty lines from doc
comment (#6642 ) (overlookmotel)
- 448388a transformer/module_imports: Update outdated comments (#6574 )
(Dunqing)
### Refactor
- 073b02a ast: Type params field before params in TS function
declaration types (#6391 ) (overlookmotel)
- 458f8f3 ast_tools: Consistent comments on `AstBuilder` methods (#6664 )
(overlookmotel)
- 51fc63d codegen: Rename `CodeBuffer::print_bytes_unchecked` method
(#6517 ) (overlookmotel)
- 05a2ebd codegen: Reorder dependencies in `Cargo.toml` (#6514 )
(overlookmotel)
- e7f3e28 codegen: Rename var in `CodeBuffer` (#6510 ) (overlookmotel)
- 1bbd383 codegen: Rename `CodeBuffer::print_ascii_bytes` method (#6507 )
(overlookmotel)
- cd9fe9e codegen: Rename vars in `CodeBuffer` methods (#6506 )
(overlookmotel)
- fc536a5 codegen: Inline `CodeBuffer` methods (#6501 ) (overlookmotel)
- 7420620 codegen: Add `CodeBuffer::as_bytes` method (#6498 )
(overlookmotel)
- 8ae174b codegen: Rename `CodeBuffer::print_byte_unchecked` method
(#6496 ) (overlookmotel)
- 5843e01 codegen: Shorten `CodeBuffer::take_source_text` (#6495 )
(overlookmotel)
- 951def6 codegen: Clarify safety comments in `CodeBuffer` (#6494 )
(overlookmotel)
- 84a51ee codegen: Rename vars in `CodeBuffer` (#6493 ) (overlookmotel)
- 05bd616 codegen: Add line break (#6492 ) (overlookmotel)
- 204bf55 codegen: Add `CodeBuffer` to fix soundness hole (#6148 )
(DonIsaac)
- 702b574 codegen: Only print necessary parentheses in TSAsExpression
(#6429 ) (Dunqing)
- aa6ba24 ecmascript: Improve string to number conversion (#6577 )
(magic-akari)
- 6d041fb ecmascript: Remove `NumberValue` (#6519 ) (Boshen)
- 856cab5 ecmascript: Move ToInt32 from `oxc_syntax` to `oxc_ecmascript`
(#6471 ) (Boshen)
- 1ba2a24 ecmascript: Remove `HasProto` which is not part of the spec
(#6470 ) (Boshen)
- a504f96 isolated-declarations: Mark return struct as non exhaustive
(#6374 ) (DonIsaac)
- f4cdc56 minifier: Use constant folding unary expression from
`oxc_ecmascript` (#6647 ) (Boshen)
- 67ad08a minifier: Unify `ValueType` (#6545 ) (Boshen)
- bbca743 minifier: Move string methods to `oxc_ecmascript` (#6472 )
(Boshen)
- 702c049 minifier: Move compress block to dce (#6468 ) (7086cmd)
- 46a38c6 minifier: Remove allow `clippy::unused_self` (#6441 ) (Boshen)
- 994b60b minifier: Use builtin get_number_value. (#6335 ) (7086cmd)
- 435a89c oxc: Remove useless `allocator.alloc(program)` calls (#6571 )
(Boshen)
- c45723b parser: Fix typo in var name (#6500 ) (overlookmotel)
- 1a90ec4 rust: Backport v1.82.0 changes to main branch first (#6690 )
(Boshen)
- 3faee66 span: Remove unused `ContentHash::content_hash_slice` (#6609 )
(DonIsaac)
- 9281234 transformer: Shorten imports (#6643 ) (overlookmotel)
- 3af0840 transformer: `HelperLoader`: add import immediately (#6601 )
(overlookmotel)
- f81aa7f transformer: `HelperLoader` common transform: comments (#6599 )
(overlookmotel)
- 679cc68 transformer: `HelperLoader` common transform: construct string
directly in arena (#6596 ) (overlookmotel)
- c346ebb transformer: `HelperLoader` common transform: `Helper` enum
(#6595 ) (overlookmotel)
- 7a028b3 transformer: Remove unnecessary `#![warn]` attr (#6585 )
(overlookmotel)
- 8c6afe0 transformer: Reorder imports (#6582 ) (overlookmotel)
- 779ff46 transformer: `HelperLoader` common transform: `Helper` struct
(#6568 ) (overlookmotel)
- bc24a24 transformer: `HelperLoader` common transform: use hashmap
`Entry` API (#6567 ) (overlookmotel)
- 9f02fc7 transformer: `HelperLoader` common transform: re-order fields
(#6565 ) (overlookmotel)
- 50ecade transformer: `HelperLoader` common transform: remove `Rc`s
(#6564 ) (overlookmotel)
- 1c1e9fc transformer: `HelperLoader` common transform: reorder methods
(#6563 ) (overlookmotel)
- c9054c8 transformer: Rename `ImportKind` to `Import` (#6561 )
(overlookmotel)
- 9542c4e transformer: Add more specific methods to `ModuleImportsStore`
(#6560 ) (overlookmotel)
- 7e57a1d transformer: `ImportKind` use `BoundIdentifier` (#6559 )
(overlookmotel)
- 602df9d transformer: Re-order fields of `Common` and `TransformCtx`
(#6562 ) (overlookmotel)
- 390abca transformer/async-to-generator: Use `helper_call_expr` (#6634 )
(Dunqing)
- 2ff917f transformer/async-to-generator: Move internal methods below
entry points (#6632 ) (Dunqing)
### Styling
- fb916b2 regular_expression: Re-order dependencies in `Cargo.toml`
(#6672 ) (overlookmotel)
- 9d43a11 transformer: Re-order dependencies (#6659 ) (overlookmotel)
### Testing
- e7c89a5 codegen: Uncomment passed tests that are related to trailing
comments (#6589 ) (Dunqing)
- d816b0b codegen: Add test for `CodeBuffer::print_byte_unchecked`
(#6497 ) (overlookmotel)
- c5deb32 minifier: Port the rest of tests (#6420 ) (7086cmd)
- e59da61 minifier: Add all test cases for
`collapse_variable_declarations` (#6421 ) (dalaoshu)
- 73d6a4a minifier: Port all replace_known_methods tests. (#6418 )
(7086cmd)
---------
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-19 23:09:35 +08:00
Boshen
1a90ec4b85
refactor(rust): backport v1.82.0 changes to main branch first ( #6690 )
2024-10-19 14:30:55 +00:00
Boshen
f4cdc56577
refactor(minifier): use constant folding unary expression from oxc_ecmascript ( #6647 )
2024-10-17 15:30:38 +00:00
Boshen
e5ed6a56a8
feat(codegen): print negative numbers ( #6624 )
2024-10-16 22:38:54 +00:00
Dunqing
ba385fc9c1
fix(codegen): panic occurred when printing the comment of the right parenthesis ( #6593 )
...
fix: https://github.com/oxc-project/monitor-oxc/actions/runs/11349185798/job/31564783192
It's hard to add a test for this because I haven't figured out caused by which plugin
2024-10-15 16:23:43 +00:00
Dunqing
e7c89a596b
test(codegen): uncomment passed tests that are related to trailing comments ( #6589 )
...
Just uncomment them and replace whitespace with `\t`
2024-10-15 16:23:41 +00:00
overlookmotel
c0e9d7eb77
refactor(codegen)!: Codegen::into_source_text consume Codegen ( #6539 )
...
Breaking change. `Codegen::into_source_text` consume `Codegen`, instead of taking the `CodeBuffer` and substituting an empty one.
Keeping the `Codegen` alive seems unintuitive, as its state is then out of sync. Consuming the `CodeBuffer` is also marginally cheaper.
2024-10-14 01:09:03 +00:00
overlookmotel
7e909a7e6c
docs(codegen): fix example for CodeBuffer::print_ascii_bytes ( #6535 )
...
Fix example and add a test.
2024-10-14 01:09:02 +00:00
overlookmotel
77f3a1a9dd
perf(codegen): check last char with byte methods ( #6509 )
...
When checking what last char in buffer is, avoid calculating a `char` when only comparing to an ASCII char (byte) anyway.
2024-10-14 01:09:02 +00:00
overlookmotel
18b68ff90e
perf(codegen): optimize CodeBuffer::print_ascii_byte ( #6516 )
...
Optimize `CodeBuffer`'s `print_byte_unchecked` and `print_ascii_byte` methods by making a fast path for when the buffer has sufficient capacity to be pushed to without growing.
As discussed in https://github.com/oxc-project/oxc/pull/6148#issuecomment-2381635390
2024-10-14 01:09:01 +00:00
overlookmotel
51fc63da45
refactor(codegen): rename CodeBuffer::print_bytes_unchecked method ( #6517 )
2024-10-13 13:14:49 +00:00
overlookmotel
782f0a7a69
refactor(codegen)!: rename print_char method to print_ascii_byte ( #6512 )
...
`print_ascii_byte` is more descriptive of what this method does, and makes clear the invariant that `byte` must be ASCII.
2024-10-13 12:51:37 +00:00
overlookmotel
05a2ebd03c
refactor(codegen): reorder dependencies in Cargo.toml ( #6514 )
2024-10-13 12:37:20 +00:00
overlookmotel
235d357600
docs(codegen): improve doc comments for CodeBuffer ( #6511 )
2024-10-13 12:21:39 +00:00
overlookmotel
e7f3e28076
refactor(codegen): rename var in CodeBuffer ( #6510 )
2024-10-13 11:58:39 +00:00
overlookmotel
1bbd383d0f
refactor(codegen): rename CodeBuffer::print_ascii_bytes method ( #6507 )
...
Pure refactor.
2024-10-13 11:19:09 +00:00
overlookmotel
cd9fe9ec03
refactor(codegen): rename vars in CodeBuffer methods ( #6506 )
...
Pure refactor. Consistently use `byte` for bytes, and `ch` for `char`s.
2024-10-13 11:10:10 +00:00
overlookmotel
c8fa2eb17a
docs(codegen): correct and reformat doc comments for CodeBuffer ( #6504 )
...
Comment about `take_source_text` was erroneous. Clean up and reformat other doc comments.
2024-10-13 11:10:09 +00:00
overlookmotel
fc536a5648
refactor(codegen): inline CodeBuffer methods ( #6501 )
...
These methods are all either trivial, or delegate to another method.
2024-10-13 10:55:07 +00:00
overlookmotel
40d1ee4588
docs(codegen): fix and reformat CodeBuffer examples ( #6499 )
...
Fix examples which would not compile.
2024-10-13 10:49:37 +00:00
overlookmotel
74206204dd
refactor(codegen): add CodeBuffer::as_bytes method ( #6498 )
...
`as_bytes` is clearer than `as_ref` (what kind of ref?)
2024-10-13 10:05:10 +00:00
overlookmotel
d816b0bd0e
test(codegen): add test for CodeBuffer::print_byte_unchecked ( #6497 )
...
Add test, and rename the rest of the test functions for `CodeBuffer`.
2024-10-13 09:51:50 +00:00
overlookmotel
8ae174bd36
refactor(codegen): rename CodeBuffer::print_byte_unchecked method ( #6496 )
...
Pure refactor. `*_unchecked` is the conventional name for unsafe methods, not `*_unsafe`.
2024-10-13 09:51:49 +00:00
overlookmotel
5843e01bed
refactor(codegen): shorten CodeBuffer::take_source_text ( #6495 )
...
Pure refactor.
2024-10-13 09:51:47 +00:00
overlookmotel
951def6e35
refactor(codegen): clarify safety comments in CodeBuffer ( #6494 )
2024-10-13 09:36:40 +00:00
overlookmotel
84a51ee576
refactor(codegen): rename vars in CodeBuffer ( #6493 )
...
Pure refactor. Just rename vars.
2024-10-13 09:36:39 +00:00
overlookmotel
05bd616d88
refactor(codegen): add line break ( #6492 )
2024-10-13 09:27:42 +00:00
DonIsaac
204bf5533e
refactor(codegen): add CodeBuffer to fix soundness hole ( #6148 )
...
# What This PR Does
Adds `CodeBuffer`, a simple wrapper over a `Vec<u8>` with a protective and reduced API for upholding UTF-8 validity guarantees. Closes #6147 .
Note that this struct is actually quite small. Most of the added lines are doc comments.
2024-10-13 09:14:48 +00:00
Dunqing
02bfbfeef5
fix(codegen): preserve parenthesis for ChainExpression ( #6430 )
...
close : #6385
The fixing way was referenced from `esbuild`, it is according to these [states](332727499e/internal/js_ast/js_ast.go (L590-L604)
)(determined in the parser) to determine whether to print parenthesis
Due to differences in implementation details, we are unable to record certain information like `esbuild` does in its parser. But fortunately, The `ParenthesisExpression` AST is actually like what `esbuild` stored states.
2024-10-13 08:03:37 +00:00
camc314
2ade16ece5
fix(codegen): invalid codegen when in inside bin expr in or loop ( #6431 )
...
https://github.com/oxc-project/monitor-oxc/actions/runs/11278829870 ??
2024-10-13 06:47:10 +00:00
camc314
6896efc00c
fix(codegen): fix in in sequence expr in for loops ( #6428 )
...
not sure if this is right, but it doesn't break any existing tests so hopefully?
2024-10-13 06:47:09 +00:00
Boshen
91c87dd380
refactor(codegen)!: remove Codegen::enableSourceMap API ( #6452 )
2024-10-12 04:56:43 +00:00