Replace webpack/yarn build with Bun - #3836
Draft
Shadowfiend wants to merge 12 commits into
Draft
Conversation
We improve device detection and add Stax and Flex to the supported device list. Connections with these are still a little wobbly, but successful signatures have happened!
Shadowfiend
marked this pull request as draft
February 24, 2026 17:49
Shadowfiend
force-pushed
the
move-to-bun
branch
from
February 24, 2026 17:52
2a10b3b to
aa02c7a
Compare
Bun's bundler handles JSX, TypeScript, and tree-shaking natively, removing the need for Babel and most webpack plugins. Key design decisions: - Node polyfills: Bun auto-polyfills buffer, stream, crypto, etc. for target:"browser", but doesn't provide them as globals. A plugin injects a shim into entrypoints that sets Buffer and process on globalThis. The define-with-require() approach doesn't work (Bun parses values as JSON). - process.env.*: Source files are scanned for all process.env references and each gets a compile-time define, matching dotenv-webpack's behavior. Without this, unreplaced references hit the missing process global at runtime. - WASM: Files are base64-encoded inline using module.exports (not export default) to avoid CJS interop wrapping that breaks atob() consumers like argon2. - Dev builds: Branch name is overlaid as a badge on the extension icon and appended to the version string so different dev builds are visually distinguishable. - Adds eslint peer deps that yarn hoisted from @thesis-co/eslint-config but bun does not. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The new Bun-based build system replaces all of these: - webpack.config.ts and its custom plugins - babel.config.js and ui/.babelrc.js (Bun handles JSX/TS natively) - yarn.lock (replaced by bun.lock) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bun uses pkg@version.patch (with url-encoded scopes) rather than yarn's pkg+version.patch format. The patch contents are unchanged. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds oven-sh/setup-bun action to the GitHub workflow and switches all yarn commands to bun equivalents. Dockerfile now pulls bun binary from the official oven/bun image. Removes NODE_OPTIONS=--openssl-legacy-provider which was a Node/webpack workaround no longer needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shadowfiend
force-pushed
the
move-to-bun
branch
from
February 24, 2026 17:54
aa02c7a to
5f2d04a
Compare
The ESLint 8 + Prettier 3 + @thesis-co/eslint-config setup had ~20 transitive deps and was causing peer-dep issues after the yarn-to-bun migration. oxlint (Rust, 690+ built-in rules) and oxfmt (100% Prettier JS/TS conformance, 30x faster) eliminate that overhead. - oxlint v1.50, oxfmt v0.35, oxlint-tsgolint v0.15 added - 15 eslint/prettier packages removed - .oxlintrc.json: correctness:error, suspicious:warn, plugins for react/jsx-a11y/import/typescript/jest, key custom rules preserved - .oxfmtrc.json: migrated from .prettierrc (semi:false, printWidth:80) - lint scripts now use oxlint --type-aware and oxfmt --check - Rules new to this migration (no-floating-promises, jsx-key, jest rules, etc.) downgraded to warn to avoid blocking; can be promoted incrementally Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Converted all eslint-disable/eslint-disable-next-line/eslint-disable-line comments to the oxlint equivalents (oxlint-disable, oxlint-disable- next-line, oxlint-disable-line). @typescript-eslint/ rule prefixes become typescript/. Comments for rules that don't exist in oxlint (no-restricted-syntax, no-underscore-dangle, @typescript-eslint/ no-use-before-define, etc.) were removed. Two unused imports (AnyAsset, AnyAction) caught by oxlint were also removed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shadowfiend
force-pushed
the
move-to-bun
branch
from
February 24, 2026 19:46
e65f276 to
35d1e3c
Compare
Ran oxfmt --write . to bring all JS/TS/CSS files into conformance with the new formatter (100% Prettier-compatible output, semi:false, printWidth:80). This is a formatting-only change with no semantic modifications. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shadowfiend
force-pushed
the
move-to-bun
branch
2 times, most recently
from
February 24, 2026 20:38
a53e042 to
12c3852
Compare
bun:test provides jest-compatible globals (jest.fn, jest.mock, etc.) natively, so Jest itself is no longer needed. The setupJest.* files are replaced by setupBun.* equivalents that wire up happy-dom globals, fake-indexeddb, fetch stubs, and logger levels for bun's test runner. Also adds an isolated test runner script for debugging cross-file state pollution. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Without the styled-jsx babel plugin, tests render unscoped <style> tags, causing CSS collisions when multiple instances of the same component are rendered. This adds a bun test-runner plugin that runs styled-jsx files through babel, matching the production build pipeline (build-plugins/styled-jsx.ts). Includes a workaround for a bun bug where registering any plugin causes Error.captureStackTrace to fail in CJS modules like follow-redirects. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shadowfiend
force-pushed
the
move-to-bun
branch
from
February 25, 2026 03:14
12c3852 to
9189efa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
process.env.*references to generate compile-time defines (matching dotenv-webpack behavior)Notes
Buffer/processas globals — a plugin injects these via entrypoint shimsdefinewithrequire()expressions doesn't work in Bun (values are parsed as JSON) — this was the source of the"require('buffer').Buffer".from is not a functionerrorsmodule.exportsinstead ofexport defaultto avoid CJS interop wrapping that brokeatob()consumers (argon2)eslint-plugin-import,eslint-plugin-prettier,eslint-plugin-no-only-tests, etc.) — yarn hoisted these but bun doesn'tTest plan
bun run build.tsproduces working dev buildbun run build.ts --productionproduces production buildprocess.envorBuffererrors🤖 Generated with Claude Code