Shakespeare's esbuild-wasm pipeline now handles the Vite/webpack-compatible
patterns for module workers and static asset URLs, so projects using
new Worker(new URL('./w.ts', import.meta.url), { type: 'module' })
new SharedWorker(new URL('./w.ts', import.meta.url), { type: 'module' })
new URL('./logo.svg', import.meta.url)
build correctly under Shakespeare instead of emitting a 404'ing URL
that pointed at the source-file path inside the main bundle.
Mechanics:
- A new detection pass (src/lib/build/workerPlugin.ts) is invoked from
the fs plugin's onLoad for .ts/.tsx/.js/.jsx/.mjs files. It cheaply
regex-prefilters on 'new URL(' so 99% of files pay zero overhead,
then strips TS/JSX via esbuild.transform and parses with acorn +
acorn-jsx for the handful of files that actually match. The string
literal spec inside each matched new URL() call is replaced with a
unique placeholder token, preserving the enclosing new URL(...,
import.meta.url) shape so runtime resolution against the main
bundle URL still works.
- bundle() now runs a per-worker sub-build (esbuild.build) with the
same plugin stack, producing a hashed ESM chunk alongside the main
output. The queue drains recursively so nested workers / assets
discovered during a sub-build are handled in the same bundle call.
- Non-source assets are copied into the output with content-hashed
filenames (SHA-256 when SubtleCrypto is available, FNV-1a fallback
for test environments).
- After all sub-builds finish, placeholder tokens are string-replaced
in every JS output with the corresponding './<emitted-filename>'.
- updateCSPForEsmSh gains an emittedWorkers option; when set it
additionally ensures worker-src and child-src exist and extends
them with the ESM CDN so module workers can import from esm.sh.
Errors (with file:line context) are raised for classic (non-module)
workers, dynamic specifiers, and unresolvable worker specs. Plain
new URL() pointing at a source file emits a console warning and is
left untransformed.
Tests: 16 new workerPlugin unit tests cover detection, errors,
dedup, and quote-style handling; 4 new CSP tests cover the
emittedWorkers path.
Shakespeare 🎭
Shakespeare is an open-source AI app builder that runs entirely in your browser.
Features
- Use any AI provider OpenAI, Anthropic, OpenRouter, xAI, ZAI, Deepseek, and more
- Buy credits anonymously with Nostr and Lightning ⚡
- Redeem gift cards with shareable links for instant credits
- Runs entirely in the browser No backend required
How it Works
Shakespeare is a React PWA that stores files in IndexedDB with LightningFS. Your browser connects directly to AI providers and git services (through isomorphic-git) to enable you to build and deploy AI apps entirely from your device.
Shakespeare hosts no backend (except for a couple microservices in the services/ directory; these are fully configurable within Shakespeare's settings). All your code and configuration is stored in your browser.
Configure any AI providers and git services you want. Configuration is stored entirely in the browser in localStorage.
You can then push and pull code to syncronize your work across devices.
Shakespeare can work on any type of project. But it is specialized to build React applications in TypeScript, which it compiles in the browser with esbuild-wasm and custom plugins. Any codebase can be worked on, but only compatible projects can be previewed directly in Shakespeare.
Open Source
Shakespeare is proudly Open Source software licensed under the GNU AGPLv3. The purpose of Shakespeare is to provide a free and open platform for building AI applications that respects user privacy and freedom.
Mirrors
Shakespeare is available on the following URLs: