Commit Graph
13 Commits
Author SHA1 Message Date
Boshen f585cb42cd feat(napi): add threadless WASI builds (#26898)
## Summary

- add threadless `wasm32-wasip1` builds and generated loaders for parser, minify, transform, transform-react, and transform-relay
- use the threadless bindings for browser and Cloudflare Workers while preserving threaded WASI and WebContainer fallbacks
- build and publish the new target in CI and release workflows

Closes #25271

## Testing

- native NAPI builds and package tests: 1,091 passed
- parser Chromium browser tests passed
- local workerd smoke tests passed for all five packages
- deployed Workers using local package tarballs passed for all five packages and reported `wasm32-wasip1`
- packed main-package file lists match the published `0.150.0` packages
- `just fmt`, `just check`, `just lint`, `just doc`, `just ast`, targeted Oxlint, typos, and `git diff --check` passed
- `just ready` reaches three unrelated Oxlint ANSI-color snapshot mismatches in this non-interactive environment; no pending snapshots remain

## AI assistance

Codex was used to help implement and test this change. The contributor remains responsible for reviewing and understanding the changes before merge.
2026-09-23 06:54:41 +00:00
leaysgur db446518ca fix(napi): disable reuseWorker in browser bindings (#25640)
Fixes #25610

AI assistance: Codex was used to implement this change.
2026-08-14 11:11:20 +00:00
camc314 24946bea55 refactor(napi/parser): use rolldown for browser bundle (#22231) 2026-05-07 17:03:57 +00:00
BoshenandYuji Sugiura 523a30a016 style(all): apply oxfmt default options (#16091)
Embrace the defaults!

---------

Co-authored-by: Yuji Sugiura <y.sugiura.0316@gmail.com>
2025-11-25 15:56:24 +09:00
overlookmotel 5877752586 ci(lint): enable no-console rule (#16053)
Enable `no-console` rule in our linting setup. Add `oxlint-disable` comments where we do want to log (in scripts).
2025-11-24 12:06:00 +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
overlookmotel bb040bc2d5 refactor(parser, linter): replace .mjs files with .js (#14045)
Now that `apps/oxlint` and `napi/parser` are both ESM packages (#13723 and #14042), we can use `.js` file extensions for all ESM files, rather than the mix of `.js` and `.mjs` file we had previously.

It's less confusing having to remember what's `.js` and what's `.mjs`, and avoids ugly workarounds like #14038 (`.d.mts`??).
2025-09-23 14:47:40 +00:00
overlookmotel b1da5d5ce6 feat(napi/parser)!: change oxc-parser to ESM (#14042)
Completion of the work begun in #13432. Make `oxc-parser` package fully ESM.

Aside from adding `"type": "module"` to `package.json`, only other change required is renaming `webcontainer-fallback.js` -> `webcontainer-fallback.cjs`. All other files already have the extension matching their ESM/CommonJS content.
2025-09-23 14:28:31 +00:00
overlookmotel 4ee94a3308 feat(napi/parser): export visitor keys (#13927)
Add visitor keys export to `oxc-parser` NPM package. This is useful in itself, but also the first step towards an ESTree walker.

Visitor keys are based on `@typescript-eslint/visitor-keys`.

It'd be ideal to generate visitor keys direct from Oxc's own types, but that's proving difficult due to all the custom serializers we use to translate to ESTree. So using the shortcut of borrowing from TS-ESLint for now.

Oxc's AST is slightly different from TS-ESTree (notably Oxc's AST adds `ParenthesizedExpression`). But apart from those few differences, TS-ESLint's AST and Oxc's are identical, and I made a PR to TS-ESLint earlier this year (https://github.com/typescript-eslint/typescript-eslint/pull/11279) to ensure visitor key order is correct, and matches Oxc.

To avoid adding a runtime dependency on `@typescript-eslint/visitor-keys`, extract the data from TS-ESLint in `oxc_ast_tools`, amend for Oxc/TS-ESTree differences, and re-output it as a simple object literal.

This approach will be faster at runtime, as the object's shape is consistent, and also avoids a dependency.
2025-09-22 11:08:46 +00:00
overlookmotel 80c2d03ab4 ci(release): fix release workflow for NAPI packages (#13979)
Fix (hopefully) the release workflow for NAPI packages, after it was broken by #13899.
2025-09-21 14:57:24 +00:00
overlookmotel 329b7e7150 refactor(napi/parser): move scripts to scripts directory (#13900)
Continuation of #13899. Move scripts from root of `napi/parser` package into a `scripts` directory.
2025-09-19 08:46:43 +00:00
Boshen 07e24a8123 ci(wasm): clean up test-wasm32-wasip1-threads (#9840) 2025-03-18 04:18:21 +00:00
overlookmotel 2985bf3d37 ci(wasm): check wasm32-wasip1-threads build (#9569)
Duplicate of #9555, but just stacked on top of #9566.

`napi-rs` for some reason omits the `export * from '@oxc-project/types';` line from `index.d.ts` when building for WASM.

I don't know how to fix that, so added a hacky script to fix up `index.d.ts` manually. This is not at all ideal, but at least it now compiles and CI passes.
2025-03-06 01:34:21 +00:00