Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 165 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ swc_ecma_ast = "19.0"
swc_ecma_visit = "19.0"
swc_common = "18.0"
swc_ecma_codegen = "21.0"
swc_bundler = "37.0"
swc_ecma_loader = "18.0"
swc_ecma_transforms_base = "32.0"
swc_ecma_transforms_react = "35.0"
swc_ecma_transforms_typescript = "35.0"
Expand Down
7 changes: 7 additions & 0 deletions changelog.d/9602-bun-runtime-compiler.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Added

- Added the native `Bun.Transpiler` and in-memory `Bun.build` subsets used by
runtime hook modules, including TypeScript/JSX lowering, import scanning,
external modules, and `onResolve`/`onLoad` plugin hooks. Build failures now
return useful filename and source-position logs instead of terminating the
process. (#9602)
8 changes: 8 additions & 0 deletions changelog.d/9625-bun-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### Bun compatibility

- **`Bun.serve` and `import { serve } from "bun"` now run on Perry's native
HTTP server.** The facade supports ephemeral ports, hostname binding,
Fetch `Request`/`Response` handlers (including async returns and the `error`
callback), `requestIP`, observable server properties, and
`stop`/`ref`/`unref` lifecycle methods. TLS options fail explicitly with
`ERR_NOT_SUPPORTED` until native TLS support is added.
15 changes: 15 additions & 0 deletions crates/perry-api-manifest/src/entries/part_4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,13 @@ pub(crate) const API_MANIFEST_PART_4: &[ApiEntry] = &[
// (Zig-std wyhash, BigInt result), and the module-level
// `pathToFileURL` / `fileURLToPath` aliases of node:url.
// Implementation: perry-runtime `bun_compat`.
class("bun", "Transpiler"),
method("bun", "Transpiler", false, None),
method("bun", "build", false, None),
method("bun", "transformSync", true, Some("Transpiler")),
method("bun", "transform", true, Some("Transpiler")),
method("bun", "scanImports", true, Some("Transpiler")),
method("bun", "scan", true, Some("Transpiler")),
method("bun", "stringWidth", false, None),
method("bun", "hash", false, None),
method("bun", "deepEquals", false, None),
Expand All @@ -1114,6 +1121,14 @@ pub(crate) const API_MANIFEST_PART_4: &[ApiEntry] = &[
method("bun", "write", false, None),
method("bun", "spawn", false, None),
method("bun", "Terminal", false, None),
method_sig(
"bun",
"serve",
false,
None,
&[p_any("options")],
TypeSpec::Any,
),
method("bun", "pathToFileURL", false, None),
method("bun", "fileURLToPath", false, None),
// #8537 — OpenCode compatibility coverage added these dispatch rows
Expand Down
Loading
Loading