Skip to content

feat(typescript-web): scaffold the Web bridge release - #4052

Merged
sxlijin merged 1 commit into
canaryfrom
sam/typescript-web-scaffold
Jul 16, 2026
Merged

sxlijin merged 1 commit into
canaryfrom
sam/typescript-web-scaffold

Conversation

@sxlijin

@sxlijin sxlijin commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add the publishable @boundaryml/baml-bridge-web package with browser and workerd exports and a TypeScript API aligned with the shared bridge_cffi call surface.
  • Build both browser and workerd WASM artifacts in release and debug modes, copy the shared TypeScript protocol/runtime helpers, and verify the npm tarball contents.
  • Add version stamping, CI validation, release artifact construction, and trusted npm publishing for the new package.

Runtime boundary

This PR intentionally does not add sys_wasm, browser fetch/read-file operations, host-call dispatch, or other SysOp wiring. Runtime initialization exposes the intended API but returns @boundaryml/baml-bridge-web runtime support is not implemented yet; the next PR replaces these stubs with the functional implementation.

Impact

This is stack 2 of 3 and is based on sam/bridge-cffi-wasm. It establishes a releasable package and workflow independently from the platform-specific runtime implementation.

Checks

  • mise run stow
  • mise run fmt
  • mise run clippy
  • pnpm build
  • npm pack --dry-run --json
  • scripts/baml-language-version check
  • actionlint for the Web build, publish, and language release workflows
  • WASM smoke check confirming the intentional runtime-initialization error

Summary by CodeRabbit

  • New Features
    • Added a WebAssembly-based browser/edge runtime for the TypeScript SDK, including runtime initialization plus function invocation and cancellation.
    • Added the @boundaryml/baml-bridge-web npm package with default and Workerd entrypoints.
    • Added reusable build and publish workflows, and integrated Web SDK publishing into the release pipeline (so downstream releases wait on success).
  • Bug Fixes
    • Nightly release validation now checks version alignment between Node and web packages.
  • Tests
    • Updated TypeScript SDK test setup to build/install both bridges and provision Chromium once.

@vercel

vercel Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
beps Ready Ready Preview, Comment Jul 16, 2026 7:44pm
promptfiddle Ready Ready Preview, Comment Jul 16, 2026 7:44pm
promptfiddle2 Ready Ready Preview, Comment Jul 16, 2026 7:44pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a WebAssembly-backed TypeScript Web SDK package, browser and workerd packaging scripts, unified TypeScript test integration, and release workflows that build, verify, publish, and version the web bridge.

Changes

Web SDK delivery

Layer / File(s) Summary
Platform-specific bridge runtime
baml_language/Cargo.toml, baml_language/stow.toml, baml_language/sdks/typescript/bridge_typescript_web/...
Adds the wasm-bindgen bridge crate and exports runtime calls, async calls, call identifiers, cancellation, and matching TypeScript declarations.
TypeScript web runtime package
baml_language/sdks/typescript/bridge_typescript_web/...
Adds the npm package, web/workerd exports, runtime wrappers, encoding/decoding helpers, cancellation context, handles, media classes, and compatibility APIs.
Wasm and Workerd packaging
baml_language/sdks/typescript/bridge_typescript_web/scripts/*
Builds web and bundler WASM targets, synchronizes shared runtime sources, patches generated loaders, and assembles workerd files.
Unified TypeScript test integration
baml_language/sdk_tests/..., baml_language/.config/nextest.toml
Renames the TypeScript test target, builds both bridges, updates fixture dependencies, installs Chromium, and emits the unified test harness scaffold.
Build, publish, and version integration
.github/workflows/*, scripts/baml-language-version
Adds Web SDK artifact build and npm publication jobs, release gating, workflow change detection, and web package version stamping and validation.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ReleasePlan
  participant BuildWebSDK
  participant WebArtifact
  participant PublishWebSDK
  participant NpmRegistry
  ReleasePlan->>BuildWebSDK: provide release_plan_json and source_sha
  BuildWebSDK->>WebArtifact: upload web-sdk-dist
  PublishWebSDK->>WebArtifact: download web-sdk-dist
  PublishWebSDK->>NpmRegistry: publish package with channel tag
  NpmRegistry-->>PublishWebSDK: report published or existing version
Loading

Possibly related PRs

Poem

A bunny packed the wasm bright,
Then hopped through npm’s release night.
Web calls bloom, cancellations fly,
Chromium gleams beneath the sky.
“Build, stamp, publish!” sings the hare—
A web bridge now is everywhere!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 62.96% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the PR’s main change: scaffolding the TypeScript Web bridge release workflow and package.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sam/typescript-web-scaffold

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

⏭️ Performance benchmarks were skipped

Perf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to canary/main.

To run them on this PR, do any of the following, then push a commit (or re-run CI):

  • Add RUN_CODSPEED=1 to the PR description, or
  • Include run-perf or /perf in the PR title or any commit message.

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 16, 2026 05:43 Inactive
@github-actions

github-actions Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Binary size checks passed

✅ 7 passed

Artifact Platform File Gzip Gated on Baseline Delta Status
✅ baml-cli Linux 🔒 23.1 MB 9.8 MB file 22.8 MB +312.3 KB (+1.4%) OK
✅ packed-program Linux 🔒 16.4 MB 6.9 MB file 16.3 MB +102.4 KB (+0.6%) OK
✅ baml-cli macOS 🔒 17.8 MB 8.5 MB file 17.5 MB +252.6 KB (+1.4%) OK
✅ packed-program macOS 🔒 12.7 MB 6.0 MB file 12.6 MB +50.2 KB (+0.4%) OK
✅ baml-cli Windows 🔒 19.2 MB 8.7 MB file 18.7 MB +489.0 KB (+2.6%) OK
✅ packed-program Windows 🔒 13.6 MB 6.1 MB file 13.5 MB +73.2 KB (+0.5%) OK
✅ bridge_wasm WASM 15.3 MB 🔒 4.3 MB gzip 4.3 MB +14.6 KB (+0.3%) OK

🔒 = the size this artifact is GATED on (ceiling + delta). Binaries gate on file size (installed binary); WASM gates on gzip (download size). The other size is shown for information only.


Generated by cargo size-gate · workflow run

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 16, 2026 05:58 Inactive
@sxlijin
sxlijin force-pushed the sam/typescript-web-scaffold branch from 0c41654 to 57373b4 Compare July 16, 2026 06:08
@vercel
vercel Bot temporarily deployed to Preview – beps July 16, 2026 06:09 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 16, 2026 06:16 Inactive
Base automatically changed from sam/bridge-cffi-wasm to canary July 16, 2026 06:19
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 16, 2026 06:29 Inactive
@sxlijin
sxlijin marked this pull request as ready for review July 16, 2026 06:51
@sxlijin
sxlijin force-pushed the sam/typescript-web-scaffold branch from 57373b4 to a712c84 Compare July 16, 2026 06:52
@vercel
vercel Bot temporarily deployed to Preview – beps July 16, 2026 06:53 Inactive
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
putComment timed out

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 57373b405f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const instance = new WebAssembly.Instance(workerdModule, {
"./bridge_web_core_bg.js": imports,
});
imports.__wbg_set_wasm(instance.exports);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Call the wasm-bindgen start hook in Workerd

When the workerd export is used, this replacement bypasses wasm-pack's generated bundler wrapper and only sets the wasm exports; it never invokes the wasm-bindgen start export afterward. The browser build still goes through the generated init path, but in Workers any initialization emitted into __wbindgen_start is skipped before stageRuntimeBytecode/callFunction* run, so the Worker artifact can fail or behave differently from the browser artifact. Add the same start call, guarded if necessary, after setting the wasm exports.

Useful? React with 👍 / 👎.

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 16, 2026 07:00 Inactive
@sxlijin
sxlijin force-pushed the sam/typescript-web-scaffold branch from a712c84 to fa1d751 Compare July 16, 2026 07:04
@vercel
vercel Bot temporarily deployed to Preview – beps July 16, 2026 07:05 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 16, 2026 07:12 Inactive
@sxlijin
sxlijin force-pushed the sam/typescript-web-scaffold branch from fa1d751 to 30b7aec Compare July 16, 2026 07:14
@vercel
vercel Bot temporarily deployed to Preview – beps July 16, 2026 07:15 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
baml_language/sdks/typescript/bridge_typescript_web/scripts/sync-node-runtime.mjs (1)

23-34: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Redundant modification of distProto/baml_cffi.js.

The loop iterates over distProto to patch baml_cffi.js, but this patched file is immediately overwritten by the esbuild step on line 30. The modification in distProto is completely redundant since the bundled output will reflect the patched shared/proto entry point anyway.

You can simplify the loop to strictly target shared/proto.

♻️ Proposed refactor
-for (const directory of [resolve(shared, "proto"), distProto]) {
-  const protoPath = resolve(directory, "baml_cffi.js");
-  const proto = readFileSync(protoPath, "utf8").replace('import $protobuf from "protobufjs/minimal.js";', 'import * as $protobuf from "protobufjs/minimal.js";');
-  writeFileSync(protoPath, proto);
-}
+const protoPath = resolve(shared, "proto/baml_cffi.js");
+const proto = readFileSync(protoPath, "utf8").replace('import $protobuf from "protobufjs/minimal.js";', 'import * as $protobuf from "protobufjs/minimal.js";');
+writeFileSync(protoPath, proto);
+
 await build({
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@baml_language/sdks/typescript/bridge_typescript_web/scripts/sync-node-runtime.mjs`
around lines 23 - 34, Remove distProto from the directory iteration in
sync-node-runtime.mjs, so the replacement runs only on
shared/proto/baml_cffi.js. Keep the subsequent build call unchanged, using the
patched shared entry point to generate the distProto output.
baml_language/sdks/typescript/bridge_typescript_web/scripts/prepare-workerd-package.mjs (1)

20-23: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Make the protobuf import replacement more resilient.

Relying on the exact string "var $protobuf = __toESM(require_minimal2(), 1);" is brittle because it targets a specific internal esbuild identifier (require_minimal2()). If esbuild updates its generation strategy or dependencies change, this identifier could become require_minimal() or require_minimal3(), immediately breaking the build script.

Consider using a regular expression to match the import structure instead.

♻️ Proposed refactor
-const protobufImport = "var $protobuf = __toESM(require_minimal2(), 1);";
-const workerdSafeProto = workerdProto.replace(protobufImport, `${protobufImport}
-$protobuf.util.Buffer = null;
-$protobuf.configure();`);
+const protobufImportRegex = /(var\s+\$protobuf\s*=\s*__toESM[^;]+;)/;
+const workerdSafeProto = workerdProto.replace(protobufImportRegex, `$1\n$protobuf.util.Buffer = null;\n$protobuf.configure();`);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@baml_language/sdks/typescript/bridge_typescript_web/scripts/prepare-workerd-package.mjs`
around lines 20 - 23, Update the protobuf import replacement in the
prepare-workerd-package script to match the generated import structure with a
regular expression rather than the exact require_minimal2() identifier. Preserve
the existing injected Buffer reset and protobuf configuration statements, while
allowing esbuild’s require_minimal identifier suffix to vary.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@baml_language/sdks/typescript/bridge_typescript_web/scripts/prepare-workerd-package.mjs`:
- Around line 20-23: Update the protobuf import replacement in the
prepare-workerd-package script to match the generated import structure with a
regular expression rather than the exact require_minimal2() identifier. Preserve
the existing injected Buffer reset and protobuf configuration statements, while
allowing esbuild’s require_minimal identifier suffix to vary.

In
`@baml_language/sdks/typescript/bridge_typescript_web/scripts/sync-node-runtime.mjs`:
- Around line 23-34: Remove distProto from the directory iteration in
sync-node-runtime.mjs, so the replacement runs only on
shared/proto/baml_cffi.js. Keep the subsequent build call unchanged, using the
patched shared entry point to generate the distProto output.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 78b5bb90-d537-4673-b9f1-907ff546d893

📥 Commits

Reviewing files that changed from the base of the PR and between bd55eab and fa1d751.

⛔ Files ignored due to path filters (2)
  • baml_language/Cargo.lock is excluded by !**/*.lock
  • baml_language/sdks/typescript/bridge_typescript_web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (24)
  • .github/workflows/build2-web-sdk.reusable.yaml
  • .github/workflows/ci.yaml
  • .github/workflows/publish2-web-sdk.yaml
  • .github/workflows/release-baml-language.yml
  • baml_language/.config/nextest.toml
  • baml_language/Cargo.toml
  • baml_language/sdk_tests/crates/typescript/setup.ps1
  • baml_language/sdk_tests/crates/typescript/setup.sh
  • baml_language/sdk_tests/harness_setup/src/templates/package.json
  • baml_language/sdks/typescript/bridge_typescript_web/.gitignore
  • baml_language/sdks/typescript/bridge_typescript_web/Cargo.toml
  • baml_language/sdks/typescript/bridge_typescript_web/package.json
  • baml_language/sdks/typescript/bridge_typescript_web/pnpm-workspace.yaml
  • baml_language/sdks/typescript/bridge_typescript_web/scripts/build-wasm-release.mjs
  • baml_language/sdks/typescript/bridge_typescript_web/scripts/prepare-wasm-package.mjs
  • baml_language/sdks/typescript/bridge_typescript_web/scripts/prepare-workerd-package.mjs
  • baml_language/sdks/typescript/bridge_typescript_web/scripts/sync-node-runtime.mjs
  • baml_language/sdks/typescript/bridge_typescript_web/src/lib.rs
  • baml_language/sdks/typescript/bridge_typescript_web/tsconfig.json
  • baml_language/sdks/typescript/bridge_typescript_web/typescript_src/index.ts
  • baml_language/sdks/typescript/bridge_typescript_web/typescript_src/native.ts
  • baml_language/sdks/typescript/bridge_typescript_web/typescript_src/wasm/bridge_web_core.d.ts
  • baml_language/stow.toml
  • scripts/baml-language-version

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 16, 2026 07:21 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 16, 2026 07:37 Inactive
@sxlijin
sxlijin added this pull request to the merge queue Jul 16, 2026
@sxlijin
sxlijin removed this pull request from the merge queue due to a manual request Jul 16, 2026
@sxlijin
sxlijin force-pushed the sam/typescript-web-scaffold branch from 30b7aec to 38782ae Compare July 16, 2026 19:22
@vercel
vercel Bot temporarily deployed to Preview – beps July 16, 2026 19:24 Inactive
@sxlijin
sxlijin enabled auto-merge July 16, 2026 19:30
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 16, 2026 19:30 Inactive
@sxlijin
sxlijin added this pull request to the merge queue Jul 16, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
baml_language/sdk_tests/crates/typescript/setup.ps1 (1)

1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Replace the em-dash to resolve the encoding warning.

The em-dash (—) is a non-ASCII character, which triggers a PSScriptAnalyzer warning (PSUseBOMForUnicodeEncodedFile) because the file lacks a Byte Order Mark (BOM). Replacing it with a regular ASCII dash (-) will resolve the warning without requiring you to change the file's encoding.

♻️ Proposed fix
-# Per-fixture pnpm setup for the sdk_test_typescript crate — Windows.
+# Per-fixture pnpm setup for the sdk_test_typescript crate - Windows.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@baml_language/sdk_tests/crates/typescript/setup.ps1` at line 1, Replace the
em dash in the setup.ps1 header comment with a standard ASCII hyphen, leaving
the rest of the comment and script unchanged.

Source: Linters/SAST tools

baml_language/sdk_tests/harness_setup/src/typescript.rs (1)

482-482: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider adding an attw check for the new bridge_typescript_web package.

Since this PR unifies the test integration framework and adds the new bridge_typescript_web package, it would be highly beneficial to assert its npm packaging structure is correct using attw (Are The Types Wrong) inside the generated tests, exactly as is currently done for bridge_typescript in the lines preceding this block.

🚀 Proposed addition for web bridge validation

Modify the top of the test scaffold block to append the parallel web test within write_fixtures_tests_rs:

             "sdks/typescript/bridge_typescript",
             "pnpm exec attw --pack --profile esm-only",
             "{cache_subdir}",
             "{cache_env_var}",
         );
     }}
 }}
+
+mod bridge_typescript_web {{
+    #[test]
+    fn attw() {{
+        ::sdk_test_harness_runner::run_workspace_cmd(
+            "sdks/typescript/bridge_typescript_web",
+            "pnpm exec attw --pack --profile esm-only",
+            "{cache_subdir}",
+            "{cache_env_var}",
+        );
+    }}
+}}
 "#,
         cache_subdir = CACHE_SUBDIR,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@baml_language/sdk_tests/harness_setup/src/typescript.rs` at line 482, Extend
write_fixtures_tests_rs to generate an attw packaging validation for the
bridge_typescript_web package, mirroring the existing bridge_typescript check in
the surrounding test scaffold. Ensure the generated test verifies the web
package’s npm type structure using the same setup and assertions as the existing
bridge validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@baml_language/sdk_tests/crates/typescript/setup.ps1`:
- Line 1: Replace the em dash in the setup.ps1 header comment with a standard
ASCII hyphen, leaving the rest of the comment and script unchanged.

In `@baml_language/sdk_tests/harness_setup/src/typescript.rs`:
- Line 482: Extend write_fixtures_tests_rs to generate an attw packaging
validation for the bridge_typescript_web package, mirroring the existing
bridge_typescript check in the surrounding test scaffold. Ensure the generated
test verifies the web package’s npm type structure using the same setup and
assertions as the existing bridge validation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1e8df05b-5219-4c3e-8bc2-f1c78b1c5bc6

📥 Commits

Reviewing files that changed from the base of the PR and between 30b7aec and 38782ae.

⛔ Files ignored due to path filters (2)
  • baml_language/Cargo.lock is excluded by !**/*.lock
  • baml_language/sdks/typescript/bridge_typescript_web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (36)
  • .github/workflows/build2-web-sdk.reusable.yaml
  • .github/workflows/cargo-tests.reusable.yaml
  • .github/workflows/ci.yaml
  • .github/workflows/publish2-web-sdk.yaml
  • .github/workflows/release-baml-language.yml
  • baml_language/.config/nextest.toml
  • baml_language/Cargo.toml
  • baml_language/sdk_tests/DEVELOPMENT.md
  • baml_language/sdk_tests/README.md
  • baml_language/sdk_tests/crates/python_pydantic2/setup.sh
  • baml_language/sdk_tests/crates/typescript/Cargo.toml
  • baml_language/sdk_tests/crates/typescript/llm_functions/customizable/streaming_e2e.node.test.ts
  • baml_language/sdk_tests/crates/typescript/setup.ps1
  • baml_language/sdk_tests/crates/typescript/setup.sh
  • baml_language/sdk_tests/crates/typescript/src/lib.rs
  • baml_language/sdk_tests/harness_runner/Cargo.toml
  • baml_language/sdk_tests/harness_runner/src/lib.rs
  • baml_language/sdk_tests/harness_setup/src/lib.rs
  • baml_language/sdk_tests/harness_setup/src/python_pydantic2.rs
  • baml_language/sdk_tests/harness_setup/src/templates/package.json
  • baml_language/sdk_tests/harness_setup/src/typescript.rs
  • baml_language/sdks/typescript/bridge_typescript_web/.gitignore
  • baml_language/sdks/typescript/bridge_typescript_web/Cargo.toml
  • baml_language/sdks/typescript/bridge_typescript_web/package.json
  • baml_language/sdks/typescript/bridge_typescript_web/pnpm-workspace.yaml
  • baml_language/sdks/typescript/bridge_typescript_web/scripts/build-wasm-release.mjs
  • baml_language/sdks/typescript/bridge_typescript_web/scripts/prepare-wasm-package.mjs
  • baml_language/sdks/typescript/bridge_typescript_web/scripts/prepare-workerd-package.mjs
  • baml_language/sdks/typescript/bridge_typescript_web/scripts/sync-node-runtime.mjs
  • baml_language/sdks/typescript/bridge_typescript_web/src/lib.rs
  • baml_language/sdks/typescript/bridge_typescript_web/tsconfig.json
  • baml_language/sdks/typescript/bridge_typescript_web/typescript_src/index.ts
  • baml_language/sdks/typescript/bridge_typescript_web/typescript_src/native.ts
  • baml_language/sdks/typescript/bridge_typescript_web/typescript_src/wasm/bridge_web_core.d.ts
  • baml_language/stow.toml
  • scripts/baml-language-version
🚧 Files skipped from review as they are similar to previous changes (20)
  • baml_language/sdks/typescript/bridge_typescript_web/.gitignore
  • baml_language/sdks/typescript/bridge_typescript_web/Cargo.toml
  • baml_language/sdks/typescript/bridge_typescript_web/typescript_src/wasm/bridge_web_core.d.ts
  • baml_language/sdks/typescript/bridge_typescript_web/tsconfig.json
  • baml_language/sdks/typescript/bridge_typescript_web/scripts/build-wasm-release.mjs
  • baml_language/stow.toml
  • baml_language/Cargo.toml
  • baml_language/sdks/typescript/bridge_typescript_web/package.json
  • scripts/baml-language-version
  • baml_language/sdk_tests/crates/typescript/setup.sh
  • baml_language/sdks/typescript/bridge_typescript_web/scripts/prepare-workerd-package.mjs
  • .github/workflows/publish2-web-sdk.yaml
  • baml_language/sdk_tests/harness_setup/src/templates/package.json
  • baml_language/sdks/typescript/bridge_typescript_web/scripts/sync-node-runtime.mjs
  • baml_language/sdks/typescript/bridge_typescript_web/typescript_src/index.ts
  • baml_language/sdks/typescript/bridge_typescript_web/scripts/prepare-wasm-package.mjs
  • .github/workflows/release-baml-language.yml
  • .github/workflows/ci.yaml
  • .github/workflows/build2-web-sdk.reusable.yaml
  • baml_language/sdks/typescript/bridge_typescript_web/typescript_src/native.ts

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 16, 2026 19:44 Inactive
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 16, 2026
@sxlijin
sxlijin added this pull request to the merge queue Jul 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 16, 2026
@sxlijin
sxlijin added this pull request to the merge queue Jul 16, 2026
Merged via the queue into canary with commit 06f82ed Jul 16, 2026
51 checks passed
@sxlijin
sxlijin deleted the sam/typescript-web-scaffold branch July 16, 2026 20:23
pull Bot pushed a commit to justinlietz93/baml that referenced this pull request Jul 17, 2026
…#4062)

## Summary

- add `sdk_test_typescript_web` for browser and Cloudflare Workers test
generation
- run Web/Workers ESM and TypeScript validation against the scaffold
bridge
- copy one shared test source tree into every runtime and select
runtime-specific suites inline through `BAML_TEST_RUNTIME`
- remove the `.node.test.ts`/`.web.test.ts`/`.workers.test.ts` routing
convention
- import the generated SDK in the runtime-selection test
- generate `vitest_web` and `vitest_workers` tests but keep them ignored
until BoundaryML#4006

## Stack

BoundaryML#4052 is merged. This PR adds the mergeable test scaffolding on
`canary`; BoundaryML#4006 supplies the runtime implementation and removes only the
two Vitest ignore annotations.

## Validation

- `cargo nextest run -p sdk_test_typescript_web -E all()
--no-fail-fast`: 18 passed, 8 skipped
- all Web/Workers ESM and TypeScript checks pass
- exactly the Web/Workers Vitest checks are skipped
- `mise run fmt`, `mise run stow`, and `mise run clippy` pass
- cumulative BoundaryML#4006: 26 passed, 0 skipped

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added TypeScript SDK test coverage for browser and Cloudflare Workers
runtimes.
  * Added runtime-aware testing for Node, Web, and Workers environments.
* Expanded validation for cancellation, standard-library functions,
media, and handle-based values.

* **Bug Fixes**
* Improved WebAssembly tooling installation reliability across supported
build and test workflows.

* **Documentation**
* Updated SDK testing documentation with the new runtime targets,
commands, and setup guidance.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

This branch was previously deployed

3 inactive deployments
Preview – promptfiddle — 38782aee Deployed Jul 16, 2026 by vercel[bot]
Preview – promptfiddle2 — 38782aee Deployed Jul 16, 2026 by vercel[bot]
Preview – beps — 38782aee Deployed Jul 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant