Add wasip1 npm build target - #4733
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an official WASI Preview 1 WebAssembly npm build target and avoids unsupported signal handling under WASI.
Changes:
- Publishes standalone
wasip1/wasmplatform packages. - Produces
.wasmbinaries with adjacent TypeScript libraries. - Replaces signal watchers with cancellable contexts on WASI.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
Herebyfile.mjs |
Adds WASI packaging, naming, and release support. |
cmd/tsgo/main.go |
Introduces WASI-safe context creation. |
cmd/tsgo/lsp.go |
Uses the WASI-safe context for LSP. |
cmd/tsgo/api.go |
Uses the WASI-safe context for API mode. |
| ...inputPackageJson, | ||
| name: mainNativePreviewPackage.npmPackageName, | ||
| optionalDependencies: Object.fromEntries(platforms.map(p => [p.npmPackageName, getVersion()])), | ||
| optionalDependencies: Object.fromEntries(platforms.filter(p => p.nodeOs !== "wasip1").map(p => [p.npmPackageName, getVersion()])), |
There was a problem hiding this comment.
That's basically expected at this stage, unless we make the shim able to load in Node the wasm blob, which, as far as I can tell is unstable. But I need to recheck.
|
wasip1 lacks |
|
Thank you for contributing to the TypeScript native port! Development has moved from this repository back to the main microsoft/TypeScript repository. GitHub does not have PR transfer functionality, so we're closing this PR here. If this change is still relevant, please reopen it as a new pull request in See microsoft/typescript-go#4918 for more information about the move. |
Fixes microsoft/TypeScript#63858
Fixes microsoft/TypeScript#63862
This does not bundle the lib.d.ts files in the binary, but instead assumes that
tsc.wasmwill live in the right place, which implies the host has mounted the files. I feel like this is probably fine, but, maybe it's not.