Skip to content

feat(typescript-web): scaffold the Web bridge release with worker-build - #4056

Closed
sxlijin wants to merge 1 commit into
canaryfrom
sam/typescript-web-worker-build-scaffold
Closed

sxlijin wants to merge 1 commit into
canaryfrom
sam/typescript-web-worker-build-scaffold

Conversation

@sxlijin

@sxlijin sxlijin commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

This is an alternative to #4052 for comparing the TypeScript Web SDK release scaffolding. It keeps the same package/release scope, but generates the Workers Wasm entrypoint through Cloudflare's workers-rs / worker-build toolchain instead of adapting wasm-bindgen's bundler output directly.

  • pin worker and worker-build 0.8.5 with their wasm-bindgen 0.2.125 toolchain
  • enable workers-rs only for the workerd build through a worker-build Cargo feature, leaving browser Wasm unchanged
  • generate the Workers entrypoint and Wasm module with worker-build
  • adapt the generated WorkerEntrypoint.prototype methods back into the named library API expected by @boundaryml/baml-bridge-web
  • install worker-build through mise locally and in the Web SDK release workflow

Tradeoffs

  • adds the workers-rs dependency graph and a larger Cargo.lock delta
  • couples the package to the matching worker-build / wasm-bindgen versions
  • currently disables release symbol stripping only for worker-build because workers-rs 0.8.5 requires the externref table for panic-recovery wrappers: [BUG] Can no longer compile with strip = true cloudflare/workers-rs#1014
  • keeps the generated worker-build entrypoint untouched, but adds a small facade over its prototype-based exports

The runtime remains intentionally scaffold-only, matching #4052: the package imports and exposes its API, but runtime calls may fail until the Web/Workers implementation change is applied.

Validation

  • mise run stow
  • mise run fmt
  • mise run clippy
  • actionlint .github/workflows/build2-web-sdk.reusable.yaml
  • debug and release package builds
  • pnpm pack --dry-run
  • Vitest Workers import/API smoke test

@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 6:57am
promptfiddle Building Building Preview, Comment Jul 16, 2026 6:57am
promptfiddle2 Ready Ready Preview, Comment Jul 16, 2026 6:57am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: fdfc81d6-2369-41a9-8c67-2bc5160e8ec0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sam/typescript-web-worker-build-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 – beps July 16, 2026 06:51 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 16, 2026 06:57 Inactive
@github-actions

Copy link
Copy Markdown

Binary size checks passed

✅ 7 passed

Artifact Platform File Gzip Gated on Baseline Delta Status
✅ baml-cli Linux 🔒 22.8 MB 9.7 MB file 22.8 MB +58.0 KB (+0.3%) OK
✅ packed-program Linux 🔒 16.3 MB 6.8 MB file 16.3 MB +24.6 KB (+0.2%) OK
✅ baml-cli macOS 🔒 17.6 MB 8.5 MB file 17.5 MB +49.7 KB (+0.3%) OK
✅ packed-program macOS 🔒 12.6 MB 6.0 MB file 12.6 MB +32 B (+0.0%) OK
✅ baml-cli Windows 🔒 19.1 MB 8.7 MB file 18.7 MB +414.7 KB (+2.2%) OK
✅ packed-program Windows 🔒 13.5 MB 6.1 MB file 13.5 MB +5.6 KB (+0.0%) OK
✅ bridge_wasm WASM 15.2 MB 🔒 4.3 MB gzip 4.3 MB +5.2 KB (+0.1%) 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

@sxlijin

sxlijin commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of #4052, which now includes the cargo-nextest setup for building and installing @boundaryml/baml-bridge-web into the TypeScript test fixtures.

@sxlijin sxlijin closed this Jul 16, 2026
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 16, 2026 07:12 Inactive
@sxlijin
sxlijin deleted the sam/typescript-web-worker-build-scaffold branch July 20, 2026 22:08

This branch was previously deployed

3 inactive deployments
Preview – promptfiddle — eb2109ae Deployed Jul 16, 2026 by vercel[bot]
Preview – promptfiddle2 — eb2109ae Deployed Jul 16, 2026 by vercel[bot]
Preview – beps — eb2109ae 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