Commit Graph

96 Commits

Author SHA1 Message Date
Boshen c90ab786d0 release(crates): oxc v0.104.0 (#17096)
### 🚀 Features

- d209c21 allocator: Add cap to FixedSizeAllocatorPool and block when
exhausted (#17023) (Cameron)
- fb2af91 allocator: Add bitset utils (#17042) (zhaoting zhou)
- c16082c tasks/compat_data: Integrate `node-compat-table` (#16831)
(Boshen)
- 5586823 span: Extract TS declaration file check to its own function
(#17037) (camchenry)
- 3d2b492 minifier: Fold iife arrow functions in call expressions
(#16477) (Armano)
- 67e9f9e codegen: Keep comments on the export specifiers (#16943)
(夕舞八弦)
- cb515fa parser: Improve error message for `yield` as identifier usage
(#16950) (sapphi-red)
- dcc856b parser: Add help for `new_dynamic_import` error (#16949)
(sapphi-red)
- c3c79f8 parser: Improve import attribute value error message (#16948)
(sapphi-red)
- 291b57b ast_tools: Generate TS declaration files for deserializer and
walk files (#16912) (camc314)
- 74eae13 minifier: Remove unused import specifiers (#16797) (camc314)

### 🐛 Bug Fixes

- fb9e193 linter: OOM problems with custom plugins (#17082)
(overlookmotel)
- e59132b parser/napi: Fix lazy deser (#17069) (overlookmotel)
- a92faf0 ast_tools: Support `u128` in `assert_layouts` generator
(#17050) (overlookmotel)
- 47b4c2f minifier/docs: Correct hyperlink path in OPTIMIZATIONS.md
(#16986) (GRK)
- 3002649 transformer/typescript: Remove unused import equals
declaration (#16776) (Dunqing)
- 5a2af88 regular_expression: Correct named capture group reference
error (#16952) (sapphi-red)

### ⚡ Performance

- b657bb6 allocator: Reduce time `Mutex` lock is held in
`FixedSizeAllocatorPool::get` (#17079) (overlookmotel)
- 1f3b19b ast: `#[ast]` macro use `#[repr(transparent)]` for
single-field structs (#17052) (overlookmotel)
- 225f229 parser: Use SmallVec for duplicate default export detection
(#16801) (camc314)

### 📚 Documentation

- a9c419f traverse: Update safety comments (#16944) (overlookmotel)

Co-authored-by: overlookmotel <557937+overlookmotel@users.noreply.github.com>
2025-12-19 02:14:06 +00:00
Boshen 6fca2f7f60 chore(infra): use oxfmt for all files, remove dprint (#16599)
Toml formatting is missing but there's only a few toml files, can wait
for oxfmt plugins.

- [x] Something is slow, can't figure out why, need #16607
2025-12-15 12:06:24 +00:00
Boshen e6ad960231 release(crates): oxc v0.103.0 (#16887) 2025-12-15 18:17:19 +08:00
Boshen 745873e4cd release(crates): oxc v0.102.0 (#16595)
### 💥 BREAKING CHANGES

- 083fea9 napi/parser: [**BREAKING**] Represent empty optional fields on
JS side as `null` (#16411) (overlookmotel)

### 🚀 Features

- 7a2afee parser: Add TS1174 error for classes extending multiple base
classes (#15993) (sapphi-red)
- da87812 semantic: Add TS2309 error for export assignment with other
exports (#15992) (sapphi-red)
- d6d2bcd minifier: Remove unused function calls that are marked by
`manual_pure_functions` (#16534) (sapphi-red)
- c90f053 minifier: Support `.` separated values for
`compress.treeshake.manualPureFunctions` (#16529) (sapphi-red)
- a607cc4 codegen: Preserve comments between CatchClause's param and
body (#16167) (copilot-swe-agent)
- 8c10694 semantic: Expose get_comment_at method (#16439) (camc314)
- 3981e7a ast: Add get_comment_at to lookup a comment by span (#16438)
(camc314)

### 🐛 Bug Fixes

- 699406a napi/parser: Move `ExportEntry::module_request` field to first
(#16412) (overlookmotel)
- 12bd794 napi/parser: Move `ExportEntry::module_request` field to last
(#16403) (overlookmotel)

### ⚡ Performance

- 790beeb napi/parser: Do not remove extraneous options on JS side
(#16447) (overlookmotel)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2025-12-08 11:47:22 +00:00
Boshen 701ab87e3e release(crates): oxc v0.101.0 (#16381) 2025-12-02 17:19:30 +08:00
Boshen 08727586bc release(crates): oxc v0.100.0 (#16331)
### 💥 BREAKING CHANGES

- 74cf572 ast: [**BREAKING**] Make `source` field of `TSImportType` a
`StringLiteral` (#16114) (copilot-swe-agent)
- 43156ae ast: [**BREAKING**] Rename `TSImportType` `argument` field to
`source` (#16110) (overlookmotel)
- 934d873 napi: [**BREAKING**] Drop `armv7-unknown-linux-musleabihf`
support (#16105) (Boshen)

### 🚀 Features

- 669afe0 ast: Add `Expression::is_jsx` method (#16154) (Dunqing)
- 17a8caa parser: Add diagnostic for JSX identifiers with hyphens
(#16133) (camchenry)
- 0549ae5 parser: Add diagnostic for expected ident after optional chain
(#16132) (camchenry)
- db839ae parser: Improve diagnostic for unexpected optional
declarations (#16131) (camchenry)
- bab4bc8 napi/parser: Add type annotations to parse-raw-worker test
(#15998) (camc314)

### 🐛 Bug Fixes

- 35ed36c traverse: Fix panic when truncating non-ASCII variable names
(#16265) (peter)
- 9149a26 linter/plugins, napi/parser: Deep freeze visitor keys (#16293)
(overlookmotel)
- 6b54dab minifier: Incorrect non-null object condition simplification
with `&&` and `||` (#16161) (sapphi-red)
- 9cc20a1 minifier: Avoid merging side effectful expressions to next
assignment statement if the side effect may change the left hand side
reference (#16165) (sapphi-red)
- 91eb3f2 ast/estree: Convert `TSImportType` `argument` field to
`Literal` (#16109) (overlookmotel)
- 1199cee parser: Reject invalid modifiers on parameter properties with
binding patterns (#16083) (camc314)
- f376325 traverse: Remove `console.log` from build script (#16049)
(overlookmotel)

### ⚡ Performance

- 82d784f lexer: Reduce bounds checks in `Lexer::get_string` (#16317)
(overlookmotel)
- cc2f352 span: Add `#[inline]` to `Atom` methods (#16311)
(overlookmotel)
- ffca070 span: Add `#[repr(transparent)]` to `Atom` (#16310)
(overlookmotel)
- 02bdf90 linter/plugins, napi/parser: Reuse arrays in visitor keys
(#16294) (overlookmotel)

### 📚 Documentation

- 891e0b4 parser: Add note about falling back to parse TSType in
TSImportType (#16119) (camc314)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2025-12-01 15:01:33 +00:00
Boshen 7252123e5e release(crates): oxc v0.99.0 (#16037)
### 💥 BREAKING CHANGES

- cbb27fd ast: [**BREAKING**] Add `TSGlobalDeclaration` type (#15712)
(overlookmotel)

### 🚀 Features

- 0c1f82b linter/plugins: Add `tokens` property to `Program` (#16020)
(overlookmotel)
- 6cff132 span: Add `Span::merge_within` method (#15869) (sapphi-red)
- 102365d allocator/vec: Add `Vec::into_bump_slice` method (#15770)
(Dunqing)

### 🐛 Bug Fixes

- e2ca770 codegen: Add support for printing type arguments in new
expressions (#15963) (Ives van Hoorne)
- 2bd3cb6 apps, editors, napi: Fix `oxlint-disable` comments (#16014)
(overlookmotel)
- 622cb5e parser: Preserve legal comments with @preserve/@license when
preceded by other annotations (#15929) (copilot-swe-agent)
- 7c46a9e transformer/tagged-template-transform: Handle `\n` escape
sequences (#15830) (Dunqing)
- f386efc minifier: Avoid generating invalid spans (#15778) (sapphi-red)
- d4ff004 parser: Forbid invalid modifiers on `module` and `global`
(#15723) (overlookmotel)
- 2191ae9 semantic: Allow reserved keywords in typescript ambient
contexts (#15495) (sapphi-red)
- 7d1ebad isolated-declarations: Incorrect nested namespace output in
isolated declarations (#15800) (copilot-swe-agent)

### ⚡ Performance

- b4b0ed8 transformer/typescript: Reverse order of checks (#15722)
(overlookmotel)

### 📚 Documentation

- c81a331 data_structures: Doc comments on fields of `Stack` (#15793)
(overlookmotel)
- cfae31d allocator: Use `allocator` as var name in examples (#15781)
(overlookmotel)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2025-11-24 10:06:24 +00:00
Boshen c588bc59ac release(crates): oxc v0.98.0 (#15771)
### 💥 BREAKING CHANGES

- ea51b0b napi: [**BREAKING**] Standardize function naming with sync
suffixes (#15661) (Boshen)

### 🚀 Features

- 77efb76 parser: Improve error message for invalid switch clauses
(#15728) (sapphi-red)
- 5691727 parser: Improve `import source` `from` error message (#15727)
(sapphi-red)
- b7404bc parser: Improve error message for missing function body
(#15726) (sapphi-red)
- 71c2fb0 parser: Improve error message when JSX is found while not
enabled (#15725) (sapphi-red)
- 56e7e44 minifier: Disable removal of unnecessary `use strict`
directives for DCE (#15691) (sapphi-red)
- 8a61cfd allocator, ast: Introduce `UnstableAddress` trait (#15700)
(overlookmotel)
- f5ce55a napi: Export all options using wildcard exports (Boshen)
- 68703b9 minifier: Rotate binary expressions to remove parentheses
(#15473) (sapphi-red)

### 🐛 Bug Fixes

- c023ba6 semantic: Do not duplicate statements in temp `Vec` when
binding `TSModuleDeclaration`s (#15724) (overlookmotel)
- d60ca81 parser: Reject `import something 'source'` (#15746)
(sapphi-red)
- e0728fa ast: Exclude comment end position from `is_inside_comment`
check (#15753) (camc314)
- 9f54a36 semantic: Error on `\00` in strict mode (#15743) (sapphi-red)
- 440a977 ast: Include rest properties when using
`get_binding_identifiers` (#15710) (camc314)

### ⚡ Performance

- 1f09d3c parser: Faster checking for invalid modifiers (#15717)
(overlookmotel)
- d8d4e31 ast: Use loop instead of recursion in
`TSModuleDeclarationBody::as_module_block_mut` (#15713) (overlookmotel)

### 📚 Documentation

- e033d50 ast: Clarify behavior of
`TSModuleDeclaration::has_use_strict_directive` (#15730) (overlookmotel)
- 9eda70f allocator: Improve docs for `Address` methods (#15697)
(overlookmotel)
2025-11-17 12:38:34 +00:00
Boshen ea51b0b5c8 feat(napi)!: standardize function naming with sync suffixes (#15661)
closes #15576

## Summary

Standardizes function naming across all NAPI packages (parser, transform, minify) with a consistent pattern:
- Async functions: `verb` (no suffix)
- Sync functions: `verbSync` (with Sync suffix)

## Changes

### Breaking Changes

**napi/parser:**
- `parseAsync` → `parse` (async)
- `parseSync` remains unchanged (sync)

**napi/transform:**
- `transformAsync` → `transform` (async)
- `transform` → `transformSync` (sync)
- `isolatedDeclaration` → `isolatedDeclarationSync` (sync)
- Added new `isolatedDeclaration` function (async)
- `moduleRunnerTransform` → `moduleRunnerTransformSync` (sync)
- Added new `moduleRunnerTransform` function (async)

**napi/minify:**
- `minify` → `minifySync` (sync)
- Added new `minify` function (async)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-11-13 12:28:23 +00:00
Boshen 98585f01a1 release(crates): oxc v0.97.0 (#15582) 2025-11-11 17:18:13 +08:00
Boshen 14fe64a935 release(crates): v0.96.0 (#15115) 2025-10-30 15:43:06 +08:00
Brooooooklyn f472631b73 chore(napi): update cli and js bindings (#14917)
Ref: https://github.com/oxc-project/oxc/issues/14732#issuecomment-3431289160
2025-10-23 09:47:23 +00:00
Boshen 454ee94ff3 release(crates): v0.95.0 (#14619) 2025-10-15 15:06:05 +08:00
renovate[bot] 502a2f8df2 chore(deps): lock file maintenance npm packages (#14363) 2025-10-06 21:45:39 +08:00
Boshen f88f5f4593 release(crates): v0.94.0 (#14377) 2025-10-06 20:48:05 +08:00
Boshen aa0689fe38 release(crates): v0.93.0 (#14194) 2025-09-28 14:13:41 +08:00
Boshen 1b3f437468 release(crates): v0.92.0 (#14067) 2025-09-24 12:18:07 +08:00
overlookmotel 2f9e16da2e fix(napi/minifier, napi/transformer): rename CommonJS file to .cjs (#14047)
`webcontainer-fallback.js` in `napi/minify` and `napi/transform` are CommonJS files, but these packages are ESM. Rename them to `webcontainer-fallback.cjs` to avoid module resolution errors/fallbacks.
2025-09-23 14:47:40 +00:00
Boshen fb347da614 release(crates): v0.91.0 (#13961) 2025-09-21 13:23:09 +08:00
overlookmotel 21bbf959b8 fix(napi): rebuild bindings file for NAPI packages (#13889)
#13888 broke CI because it didn't run `pnpm build` to update version number in NAPI bindings files.

I don't think the published packages are broken, because it only matters if `NAPI_RS_ENFORCE_VERSION_CHECK` env is set.
2025-09-18 14:37:42 +00:00
Boshen 70c402b9f9 feat(napi/transform): add async transform function (#13881)
## Summary

This PR adds an async transform function to the NAPI transform package, following the same pattern used in the parser package for consistency.

Closes #10900

## Changes

- Added `transformAsync` function that returns a Promise
- Implemented `TransformTask` struct with `napi::Task` trait
- Reuses existing transform logic from the synchronous version
- Added comprehensive tests to verify async behavior

## Test Plan

Added tests in `test/transform.test.ts` that verify:
- Async function works correctly
- Produces identical results to sync version
- Properly handles errors

All existing tests continue to pass.

🤖 Generated with [Claude Code](https://claude.ai/code)
2025-09-18 12:44:53 +00:00
Boshen 9796ec12d7 fix(napi): fix binding files 2025-09-15 14:55:01 +08:00
renovate[bot] b4e9d2c379 chore(deps): lock file maintenance npm packages (#13758)
Co-authored-by: Boshen <boshenc@gmail.com>
2025-09-15 13:15:05 +08:00
Boshen 34d0a014f6 feat(napi/minify,transform)!: change module type to ESM (#13349)
part of #13329
2025-08-28 12:47:24 +00:00
Boshen fa2d3f1481 chore(deps): napi v3 (#12388) 2025-07-18 11:45:19 +00:00
LongYinan ab0dd29a2b fix(napi): napi build cache problem (#11479) 2025-06-05 12:16:08 +08:00
Boshen 1401839036 feat(napi): add webcontainer fallback to transform and minify packages (#11471) 2025-06-04 08:11:01 +00:00
Boshen 0c2d1c1e80 Revert "chore(napi): upgrade to napi@3.0.0-beta.4" (#11474)
Reverts oxc-project/oxc#11466
2025-06-04 16:03:12 +08:00
LongYinan 81af6b3988 chore(napi): upgrade to napi@3.0.0-beta.4 (#11466)
Regenerate the binding files
2025-06-04 11:49:19 +08:00
Boshen d67c9e583b feat(napi): bump napi to beta (#11159) 2025-05-19 15:05:34 +00:00
renovate[bot] e34967eb20 chore(deps): lock file maintenance npm packages (#10273) 2025-04-07 16:43:16 +08:00
Dunqing ffd485c74c feat(transformer, napi/transform): expose moduleRunnerTransform function (#9532)
Expose a `moduleRunnerTransform` function that `Vite` can directly use it to speed-up ssr transform. In this way, `Vitest` also benefits without having to wait for `rolldown-vite`.
2025-03-04 14:53:51 +00:00
Boshen c933c6d67a chore(deps): bump napi (#9274) 2025-02-21 23:33:21 +08:00
Boshen aa9d7e47ea build(napi): napi build --no-dts-cache (#8499) 2025-01-15 07:02:29 +00:00
Boshen c98457db5c feat(napi/transformer): add runtime helper mode (#7727)
part of #7599
2024-12-08 15:29:55 +00:00
Boshen 85eec3c82e feat(napi/transform,napi/parser): return structured error object (#7724)
closes #7261
2024-12-08 14:11:56 +00:00
Boshen dc741e471f chore: do not format napi generated files 2024-09-08 13:42:15 +08:00
Boshen d00a1f6511 chore: use dprint to format js, json and markdown 2024-09-08 13:24:58 +08:00
Boshen 01d85de834 fix(napi/transform): update napi files 2024-08-06 19:35:58 +08:00
DonIsaac 9b51e045c7 refactor: overhaul napi transformer package (#4592)
## What This PR Does
- Support declaration emit with `transform()`
- Consolidate shared parsing and error reporting logic into a `TransformContext`
- Add JSDoc comments to options

I'm getting this package ready for consumption in [oxc-jest](https://github.com/oxc-project/oxc-jest).
2024-08-06 01:14:10 +00:00
Boshen 27cbd551fb chore: bump napi to v3 (#4365) 2024-07-19 14:06:33 +00:00
Boshen 725571aad1 feat(napi/transformer): add jsx option to force parsing with jsx (#4133)
To mimic the esbuild `loader=jsx` or babel `babel-plugin-syntax-jsx` behavior.
2024-07-10 11:12:10 +00:00
Boshen e44963acda Revert "chore(napi/transform): support wasm build (#3933)"
This reverts commit 3e9e4c9912.
2024-06-30 22:04:36 +08:00
Dunqing 3e9e4c9912 chore(napi/transform): support wasm build (#3933)
~~Encountered the same problem as
https://github.com/oxc-project/oxc-resolver/issues/190. Fixed in
napi@2.16.7, but oxc use `3.x`~~

Fixed in napi@3.0.0-alpha.3
2024-06-30 19:49:02 +08:00
underfin d3cd3ea2de feat: oxc transform binding (#3896)
closes #3877

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2024-06-26 21:57:19 +08:00
Boshen f42c325a06 refactor(napi): change "isolated declarations" to "transform" (#3721) 2024-06-17 14:09:18 +00:00