-
-
Notifications
You must be signed in to change notification settings - Fork 794
ci: bundle WASM manually #8271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: bundle WASM manually #8271
Conversation
|
| BIOME_WEBSITE_REPO: biomejs/website | ||
| BIOME_PUSH_ON_MAIN_EVENT_TYPE: biome-push-on-main-event | ||
| WASM_PACK_CACHE_KEY: wasm-pack-cache | ||
| WASM_CACHE_KEY: wasm-cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cache key changes were mine
| # https://rust-lang.github.io/rustup/concepts/profiles.html | ||
| profile = "default" | ||
| channel = "1.91.1" | ||
| targets = ["wasm32-unknown-unknown"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude wanted us to install the target in CI lol. I suggested a different approach
WalkthroughThis PR migrates WASM build tooling from wasm-pack to a just-based workflow. CI workflows now install Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.github/workflows/beta.yml (1)
174-182: Step ordering differs from pull_request_node.yml; recommend aligning.This workflow installs just before the Rust toolchain, whereas pull_request_node.yml does the reverse. Whilst both work, standardising step order across workflows improves consistency. Also,
wasm-optremains unpinned—consider adding a version constraint.Please verify the preferred step ordering (just then toolchain, or toolchain then just) and align pull_request_node.yml, beta.yml, and preview.yml consistently.
.github/workflows/preview.yml (1)
170-178: Step ordering and wasm-opt version consistency issues persist here too.As flagged in beta.yml, this workflow installs just before the Rust toolchain (opposite of pull_request_node.yml). Additionally,
wasm-optremains unpinned. Recommend coordinating these concerns across all three workflows (pull_request_node.yml, beta.yml, preview.yml) in a follow-up pass to reduce maintenance burden.Please align step ordering and version pinning for wasm-opt across all workflows as part of a separate refactoring task.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (13)
.github/workflows/beta.yml(1 hunks).github/workflows/beta_js_api.yml(1 hunks).github/workflows/preview.yml(1 hunks).github/workflows/pull_request_node.yml(2 hunks).github/workflows/release.yml(2 hunks).github/workflows/repository_dispatch.yml(2 hunks)CONTRIBUTING.md(2 hunks)justfile(2 hunks)packages/@biomejs/js-api/package.json(1 hunks)packages/@biomejs/wasm-bundler/.gitignore(1 hunks)packages/@biomejs/wasm-nodejs/.gitignore(1 hunks)packages/@biomejs/wasm-web/.gitignore(1 hunks)rust-toolchain.toml(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
CONTRIBUTING.md
📄 CodeRabbit inference engine (AGENTS.md)
Review and follow the contribution guidelines defined in CONTRIBUTING.md
Files:
CONTRIBUTING.md
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:03:52.014Z
Learning: For bugfix/feature PRs visible to Biome toolchain users or affecting published crates, create a changeset using the `just new-changeset` command with appropriate package selection, change type (major/minor/patch), and description.
Learnt from: arendjr
Repo: biomejs/biome PR: 7593
File: crates/biome_service/src/workspace/server.rs:1306-1306
Timestamp: 2025-09-25T12:32:59.003Z
Learning: In the biomejs/biome project, do not flag compilation errors during code review as they are handled by the existing test infrastructure and CI. Focus on other code quality aspects instead.
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:03:52.014Z
Learning: Before committing and opening a PR, run `just f` to format Rust and TOML files, `just l` to lint the whole project, and run appropriate code generation commands (`just gen-analyzer` for linter work, `just gen-bindings` for workspace work).
📚 Learning: 2025-11-24T18:03:52.014Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:03:52.014Z
Learning: Before committing and opening a PR, run `just f` to format Rust and TOML files, `just l` to lint the whole project, and run appropriate code generation commands (`just gen-analyzer` for linter work, `just gen-bindings` for workspace work).
Applied to files:
.github/workflows/pull_request_node.yml.github/workflows/beta_js_api.yml.github/workflows/release.yml.github/workflows/beta.ymljustfileCONTRIBUTING.mdpackages/@biomejs/js-api/package.json
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
packages/@biomejs/wasm-bundler/.gitignorepackages/@biomejs/wasm-web/.gitignorepackages/@biomejs/wasm-nodejs/.gitignore
📚 Learning: 2025-11-24T18:06:12.017Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.017Z
Learning: Applies to crates/biome_service/src/workspace*.rs : Implement the Workspace trait in the Biome Service to manage internal state of projects, including open documents, project layout instances, and module graph instances
Applied to files:
packages/@biomejs/wasm-bundler/.gitignorepackages/@biomejs/wasm-web/.gitignorepackages/@biomejs/wasm-nodejs/.gitignore
📚 Learning: 2025-11-24T18:03:52.014Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:03:52.014Z
Learning: Use `pnpm` for Node.js package management in the repository. Run `pnpm install` from the root before using changeset commands, and use `pnpm --filter` to run commands for specific packages.
Applied to files:
.github/workflows/beta_js_api.yml.github/workflows/release.ymlCONTRIBUTING.md.github/workflows/repository_dispatch.yml
📚 Learning: 2025-11-24T18:03:52.014Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:03:52.014Z
Learning: For bugfix/feature PRs visible to Biome toolchain users or affecting published crates, create a changeset using the `just new-changeset` command with appropriate package selection, change type (major/minor/patch), and description.
Applied to files:
.github/workflows/release.ymlrust-toolchain.tomljustfileCONTRIBUTING.mdpackages/@biomejs/js-api/package.json
📚 Learning: 2025-11-24T18:04:42.146Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.146Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Code blocks in documentation can use 'ignore' property to exclude snippets from automatic validation (use sparingly)
Applied to files:
packages/@biomejs/wasm-web/.gitignorepackages/@biomejs/wasm-nodejs/.gitignore
📚 Learning: 2025-11-24T18:03:52.013Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:03:52.013Z
Learning: Applies to **/*.rs : Use snapshot testing with the `insta` crate for testing in Rust projects. Accept or reject snapshots using `cargo insta accept`, `cargo insta reject`, or `cargo insta review`.
Applied to files:
justfileCONTRIBUTING.md
📚 Learning: 2025-11-24T18:05:20.343Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.343Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/Cargo.toml : Include development dependencies in `Cargo.toml` for formatter tests: `biome_formatter_test`, `biome_<language>_factory`, `biome_<language>_parser`, `biome_parser`, `biome_service`, `countme`, `iai`, `quickcheck`, `quickcheck_macros`, and `tests_macros`
Applied to files:
justfileCONTRIBUTING.mdpackages/@biomejs/js-api/package.json
📚 Learning: 2025-11-24T18:06:03.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.536Z
Learning: Applies to crates/biome_parser/**/*.ungram : Write grammar for new languages using the `ungrammar` DSL and create a `.ungram` file in the `xtask/codegen` folder
Applied to files:
justfile
📚 Learning: 2025-11-24T18:04:47.032Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_aria_metadata/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:47.032Z
Learning: Applies to crates/biome_aria_metadata/**/build.rs : The `build.rs` script uses `aria-data.json` to generate ARIA metadata
Applied to files:
justfile
📚 Learning: 2025-11-24T18:06:03.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.536Z
Learning: Create two new crates `biome_{language}_syntax` and `biome_{language}_factory` using `cargo new --lib` for new language parsers
Applied to files:
justfileCONTRIBUTING.md
📚 Learning: 2025-11-24T18:06:12.017Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.017Z
Learning: Debug the WorkspaceWatcher by starting the daemon with cargo run --bin=biome -- start and running commands such as cargo run --bin=biome -- lint --use-server <path>
Applied to files:
justfileCONTRIBUTING.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: Documentation
- GitHub Check: End-to-end tests
- GitHub Check: Test Node.js API
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Check Dependencies
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check JS Files
- GitHub Check: autofix
🔇 Additional comments (20)
CONTRIBUTING.md (2)
134-134: Documentation accurately reflects toolchain migration.The updates correctly reference wasm-bindgen-cli and wasm-opt, and the instruction to use
just install-tools(line 346) aligns with the earlier list of installed tools (line 134). Well integrated.Also applies to: 346-346
406-406: Verify changeset creation for toolchain changes affecting published crates.This PR modifies the WASM build process for the @biomejs/biome package. Per contribution guidelines, changes visible to toolchain users or affecting published crates should include a changeset. Please confirm whether
just new-changesetwas run and a changeset file created.packages/@biomejs/wasm-bundler/.gitignore (1)
1-5: Standard WASM build artifact entries—looks good.These follow wasm-bindgen's typical output naming; consistent with sibling wasm-web and wasm-nodejs packages.
packages/@biomejs/wasm-web/.gitignore (1)
1-4: Web WASM artifact entries—approved.Minor difference from wasm-bundler (no biome_wasm_bg.js) likely reflects target-specific build output; consistent with web build conventions.
packages/@biomejs/wasm-nodejs/.gitignore (1)
1-4: Node.js WASM artifact entries—approved.Mirrors wasm-web package; aligned with Node.js build output expectations.
rust-toolchain.toml (1)
6-6: Essential for WASM support—approved.The wasm32-unknown-unknown target is required for compiling WASM with the new just-based build pipeline.
.github/workflows/pull_request_node.yml (2)
56-58: Just installation looks appropriate—approved.Step ordering is correct: toolchain before just setup; just before build commands.
39-39: Based on my verification, I can confirm that the original review comment is accurate and justified. Here's what I found:Verification Summary:
Pattern confirmed across workflows: The unpinned
wasm-optappears consistently in:
pull_request_node.ymlline 39beta.ymlline 180preview.ymlline 176Inconsistency with wasm-bindgen-cli: In all three workflows,
wasm-bindgen-cliIS pinned to@0.2.105, whilewasm-opthas no version constraint.Web search confirmed best practices: Industry standards clearly recommend pinning wasm-opt (Binaryen) to a specific version for reproducibility. Unpinned versions can auto-download latest, causing CI flakiness and non-reproducible builds.
moonrepo/setup-rust supports versioning: The action supports version syntax (e.g.,
[email protected]), confirming that pinningwasm-optshould be technically feasible.No documented justification: No comments or documentation in the repository explain why
wasm-optis intentionally left unpinned.
Unpinned
wasm-optcreates reproducibility risk across CI workflows.The
wasm-optbinary is installed without a version constraint inmoonrepo/setup-rust, whilewasm-bindgen-cliis pinned to0.2.105. This pattern appears consistently inpull_request_node.yml,beta.yml, andpreview.yml.Without pinning, CI runs may pull different
wasm-optversions, causing non-deterministic builds and potential breakage from upstream Binaryen releases. Pin to a specific version (e.g.,[email protected]) to ensure consistency across all builds..github/workflows/beta.yml (1)
184-189: Build commands updated correctly to just-based recipes—approved.Commands properly delegate to
just build-wasm-bundler,build-wasm-node, andbuild-wasm-webrecipes..github/workflows/preview.yml (1)
160-165: Matrix entries correctly mapped to just recipes—approved.The mapping from target names to just-recipe variables is clear and maintainable.
.github/workflows/beta_js_api.yml (1)
45-52: I'll help you verify the review comment about the inconsistent tooling installation approach. Let me start by examining the workflow files to understand the actual state of the codebase.
<function_calls>
#!/bin/bashFind all workflow files
find .github/workflows -name ".yml" -o -name ".yaml" 2>/dev/null | sort
</function_calls>
#!/bin/bashSearch for moonrepo/setup-rust usage across workflows
echo "=== Searching for moonrepo/setup-rust ==="
rg "moonrepo/setup-rust" .github/workflows/ -A 2echo ""
echo "=== Searching for wasm-tools installations ==="
rg "wasm-tools" .github/workflows/ -B 2 -A 1echo ""
echo "=== Searching for wasm-opt installations ==="
rg "wasm-opt" .github/workflows/ -B 2 -A 1echo ""
echo "=== Searching for wasm-bindgen-cli installations ==="
rg "wasm-bindgen-cli" .github/workflows/ -B 2 -A 1
</function_calls>Now let me search for web information about wasm-tools vs wasm-opt:
<function_calls>
wasm-tools vs wasm-opt differences
</function_calls>.github/workflows/release.yml (3)
247-253: LGTM! Matrix updated for just-based builds.The matrix entries correctly map to the new just recipes defined in the justfile.
269-269: LGTM! Build command updated.The build step now correctly invokes just with the appropriate recipe from the matrix.
258-266: Version consistency verified—[email protected] matches the pinned dependency.The wasm-bindgen-cli version (0.2.105) pinned in the workflow is consistent with the wasm-bindgen dependency declared in
crates/biome_wasm/Cargo.toml(line 31). All related packages (wasm-bindgen, wasm-bindgen-macro, wasm-bindgen-macro-support, and wasm-bindgen-shared) are locked to 0.2.105 in Cargo.lock. No ABI incompatibility risk..github/workflows/repository_dispatch.yml (2)
16-16: LGTM! Cache key consistently renamed.The cache key and related step names correctly reflect the new wasm tooling.
Also applies to: 30-30, 37-37, 53-53, 57-57, 62-62, 68-68
39-50: LGTM! Tooling updated consistently.The workflow now uses just-based builds. Same version verification concern applies as noted in release.yml.
justfile (3)
13-20: LGTM! Tool installation updated.The install and upgrade commands correctly reference the new WASM tooling with consistent version pinning.
90-93: Verify wasm-opt debug flag in release builds.The release builds include
-gin wasm-opt, which preserves debug information. This increases binary size. Confirm this is intentional for production debugging purposes.If debug info isn't needed in production, apply this diff to remove the
-gflag:wasm-opt packages/@biomejs/wasm-bundler/biome_wasm_bg.wasm \ -o packages/@biomejs/wasm-bundler/biome_wasm_bg.wasm \ -Os \ - -g +(Apply similar changes to build-wasm-node and build-wasm-web targets.)
Also applies to: 111-114, 132-135
74-136: Well-structured WASM build targets.The new just recipes provide clear separation between development and release builds with appropriate optimizations for each.
packages/@biomejs/js-api/package.json (1)
14-19: LGTM! Scripts migrated to just.The build scripts now delegate to just recipes whilst preserving their names for compatibility.
1571a0f to
d568b59
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/repository_dispatch.yml (1)
16-68: Partial migration incomplete: Onlyrepository_dispatch.ymlhas the cache management pattern.The verification confirms the review concern. While
repository_dispatch.ymlimplements cache management withWASM_CACHE_KEY,actions/cache/restore, andactions/cache/save, the following workflows building identical WASM targets lack this caching pattern:
- beta.yml: Build WASM job has
setup-just+moonrepo/[email protected]with[email protected]but no cache management- preview.yml: Matrix-based WASM builds with same tooling, no cache management
- release.yml: WASM jobs with same tooling, no cache management
- beta_js_api.yml: Uses a different build approach entirely (
cargo install wasm-bindgen-cli+ pnpm instead ofmoonrepo/setup-rust+just)- pull_request_node.yml: Not a WASM build job; only uses
wasm-bindgen-clifor the Node.js API binaryRequired: Either (1) add identical cache management to
beta.yml,preview.yml, andrelease.yml, or (2) document whyrepository_dispatch.ymlalone needs caching while others don't.
🧹 Nitpick comments (2)
.github/workflows/release.yml (1)
265-265: Consider pinningwasm-optversion for reproducibility.Currently,
wasm-optis installed without an explicit version constraint. This could lead to non-deterministic build results across CI runs if a new version is released. As a code-quality concern, consider pinning it to a specific version (e.g.,[email protected]or similar) to ensure consistent optimisation output.Also applies to: 304-304
crates/biome_wasm/Cargo.toml (1)
52-53: Stale wasm-pack metadata now unused.The
[package.metadata.wasm-pack.profile.profiling]section won't be read since the PR replaces wasm-pack with manual builds. Consider removing it or verify it's retained intentionally for documentation.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (14)
.github/workflows/beta.yml(1 hunks).github/workflows/beta_js_api.yml(1 hunks).github/workflows/preview.yml(1 hunks).github/workflows/pull_request_node.yml(2 hunks).github/workflows/release.yml(2 hunks).github/workflows/repository_dispatch.yml(2 hunks)CONTRIBUTING.md(2 hunks)crates/biome_wasm/Cargo.toml(3 hunks)justfile(2 hunks)packages/@biomejs/js-api/package.json(1 hunks)packages/@biomejs/wasm-bundler/.gitignore(1 hunks)packages/@biomejs/wasm-nodejs/.gitignore(1 hunks)packages/@biomejs/wasm-web/.gitignore(1 hunks)rust-toolchain.toml(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (10)
- packages/@biomejs/wasm-bundler/.gitignore
- .github/workflows/pull_request_node.yml
- .github/workflows/preview.yml
- packages/@biomejs/wasm-web/.gitignore
- rust-toolchain.toml
- CONTRIBUTING.md
- .github/workflows/beta.yml
- justfile
- .github/workflows/beta_js_api.yml
- packages/@biomejs/js-api/package.json
🧰 Additional context used
📓 Path-based instructions (1)
**/Cargo.toml
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use workspace dependencies defined in the root
Cargo.tomlfor internal crates, specifyingworkspace = truein each crate's Cargo.toml. Use path dependencies for dev-dependencies to avoid requiring published versions.
Files:
crates/biome_wasm/Cargo.toml
🧠 Learnings (23)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:03:52.024Z
Learning: For bugfix/feature PRs visible to Biome toolchain users or affecting published crates, create a changeset using the `just new-changeset` command with appropriate package selection, change type (major/minor/patch), and description.
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:03:52.024Z
Learning: Before committing and opening a PR, run `just f` to format Rust and TOML files, `just l` to lint the whole project, and run appropriate code generation commands (`just gen-analyzer` for linter work, `just gen-bindings` for workspace work).
📚 Learning: 2025-11-24T18:03:52.024Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:03:52.024Z
Learning: Use `pnpm` for Node.js package management in the repository. Run `pnpm install` from the root before using changeset commands, and use `pnpm --filter` to run commands for specific packages.
Applied to files:
.github/workflows/repository_dispatch.yml.github/workflows/release.yml
📚 Learning: 2025-11-24T18:03:52.024Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:03:52.024Z
Learning: Before committing and opening a PR, run `just f` to format Rust and TOML files, `just l` to lint the whole project, and run appropriate code generation commands (`just gen-analyzer` for linter work, `just gen-bindings` for workspace work).
Applied to files:
.github/workflows/release.yml
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/Cargo.toml : Include development dependencies in `Cargo.toml` for formatter tests: `biome_formatter_test`, `biome_<language>_factory`, `biome_<language>_parser`, `biome_parser`, `biome_service`, `countme`, `iai`, `quickcheck`, `quickcheck_macros`, and `tests_macros`
Applied to files:
crates/biome_wasm/Cargo.toml
📚 Learning: 2025-11-24T18:03:52.024Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:03:52.024Z
Learning: For bugfix/feature PRs visible to Biome toolchain users or affecting published crates, create a changeset using the `just new-changeset` command with appropriate package selection, change type (major/minor/patch), and description.
Applied to files:
crates/biome_wasm/Cargo.toml
📚 Learning: 2025-11-24T18:04:42.160Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.160Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : The first paragraph of rule documentation must be a single line and serves as the brief description for the rule overview page
Applied to files:
crates/biome_wasm/Cargo.toml
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Store type data in linear vectors instead of using recursive data structures with `Arc` for improved data locality and performance
Applied to files:
crates/biome_wasm/Cargo.toml
📚 Learning: 2025-11-24T18:04:42.160Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.160Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Rules should only have severity set to 'error' if they report hard errors, dangerous code, or accessibility issues; use 'warn' for possibly erroneous code; use 'info' for stylistic suggestions
Applied to files:
crates/biome_wasm/Cargo.toml
📚 Learning: 2025-11-24T18:04:42.160Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.160Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Avoid deep indentation in rule implementations by using Rust helper functions like 'map', 'filter', and 'and_then' instead of nested if-let statements
Applied to files:
crates/biome_wasm/Cargo.toml
📚 Learning: 2025-11-24T18:04:42.160Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.160Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Code blocks in documentation marked with 'options' should contain only rule-specific options in JSON/JSONC format, while 'full_options' contains complete biome.json configuration
Applied to files:
crates/biome_wasm/Cargo.toml
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/context.rs : Define `<Language>FormatContext` struct in a `context.rs` file containing `comments` and `source_map` fields, implementing `FormatContext` and `CstFormatContext` traits
Applied to files:
crates/biome_wasm/Cargo.toml
📚 Learning: 2025-11-24T18:04:42.160Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.160Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Deprecated rules must include a 'deprecated' field in the 'declare_lint_rule!' macro with the reason for deprecation
Applied to files:
crates/biome_wasm/Cargo.toml
📚 Learning: 2025-11-24T18:04:42.160Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.160Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : The rule option serde configuration must include 'rename_all = "camelCase"' to match biome.json naming conventions
Applied to files:
crates/biome_wasm/Cargo.toml
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace*.rs : Implement the Workspace trait in the Biome Service to manage internal state of projects, including open documents, project layout instances, and module graph instances
Applied to files:
crates/biome_wasm/Cargo.tomlpackages/@biomejs/wasm-nodejs/.gitignore
📚 Learning: 2025-11-24T18:03:52.024Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:03:52.024Z
Learning: Applies to **/Cargo.toml : Use workspace dependencies defined in the root `Cargo.toml` for internal crates, specifying `workspace = true` in each crate's Cargo.toml. Use path dependencies for dev-dependencies to avoid requiring published versions.
Applied to files:
crates/biome_wasm/Cargo.toml
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Debug the WorkspaceWatcher by starting the daemon with cargo run --bin=biome -- start and running commands such as cargo run --bin=biome -- lint --use-server <path>
Applied to files:
crates/biome_wasm/Cargo.toml
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Use the `dbg_write!` macro to debug formatter output instead of other logging methods
Applied to files:
crates/biome_wasm/Cargo.toml
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper types from the biome_diagnostics::v2 module (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) or implement the Advices trait yourself for custom advice handling
Applied to files:
crates/biome_wasm/Cargo.toml
📚 Learning: 2025-11-24T18:04:42.160Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.160Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Code blocks in documentation marked with 'expect_diagnostic' must emit exactly one diagnostic for the build system to generate it automatically
Applied to files:
crates/biome_wasm/Cargo.toml
📚 Learning: 2025-11-24T18:04:42.160Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.160Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : The rule option serde configuration must include 'deny_unknown_fields' to raise errors for extraneous fields in configuration
Applied to files:
crates/biome_wasm/Cargo.toml
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
crates/biome_wasm/Cargo.tomlpackages/@biomejs/wasm-nodejs/.gitignore
📚 Learning: 2025-09-25T12:32:59.003Z
Learnt from: arendjr
Repo: biomejs/biome PR: 7593
File: crates/biome_service/src/workspace/server.rs:1306-1306
Timestamp: 2025-09-25T12:32:59.003Z
Learning: In the biomejs/biome project, do not flag compilation errors during code review as they are handled by the existing test infrastructure and CI. Focus on other code quality aspects instead.
Applied to files:
packages/@biomejs/wasm-nodejs/.gitignore
📚 Learning: 2025-11-24T18:04:42.160Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:42.160Z
Learning: Applies to crates/biome_analyze/**/biome_*_analyze/lib/src/**/!(mod).rs : Code blocks in documentation can use 'ignore' property to exclude snippets from automatic validation (use sparingly)
Applied to files:
packages/@biomejs/wasm-nodejs/.gitignore
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: Check JS Files
- GitHub Check: Documentation
- GitHub Check: Test Node.js API
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: autofix
- GitHub Check: Check Dependencies
- GitHub Check: Lint project (depot-windows-2022)
🔇 Additional comments (6)
packages/@biomejs/wasm-nodejs/.gitignore (1)
1-4: Spot on—these are the expected wasm-bindgen outputs.Ignoring the generated TypeScript definitions and WASM artefacts is correct and consistent with the other wasm packages in the monorepo. These shouldn't be version-controlled as they're produced during the build step using wasm-bindgen-cli.
crates/biome_wasm/Cargo.toml (3)
5-5: Verify Rust edition "2024" is intentional.Line 5 specifies
edition = "2024", which is very recent. Confirm this aligns with the project's MSRV and other crates' editions, especially since the PR notes most changes were AI-generated.
21-39: Excellent version coordination comment.Workspace dependencies follow guidelines correctly, and the comment on lines 31–32 about coordinating wasm-bindgen version with CLI tooling is exactly what's needed for this migration.
41-47: Build dependencies follow workspace pattern correctly.All internal crates use
workspace = true, and external dependencies are pinned appropriately..github/workflows/repository_dispatch.yml (2)
42-47: Version pinning for wasm-opt differs from wasm-bindgen-cli.The wasm-bindgen-cli is pinned to 0.2.105, but wasm-opt lacks a version constraint. Whilst this may be intentional (always use latest wasm-opt), it could lead to inconsistent builds across CI runs if wasm-opt releases a breaking change.
Clarify whether wasm-opt should also be pinned to a specific version for reproducibility, or document why floating the version is acceptable here.
50-50: Thejust build-wasm-webrecipe exists and is properly defined.Verified at line 125 of the justfile. The recipe compiles the wasm library, generates TypeScript bindings for the web target, and optimizes the resulting binary using wasm-opt. This is a complete and appropriate replacement for the previous build approach.
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: dyc3 <[email protected]>
Summary
Note
The majority of the changes were created by AI, but heavily tested by me
wasm-packhas been officially deprecated, so it's best to create our own compilation step.Fortunately for us, we don't have particular requirements, so what we need is just
wasm-bindgen-cliandwasm-opt.Inspiration: https://github.com/GraphiteEditor/Graphite/pull/2931/files#diff-306b09e83966cce07e3bca0fc9f2d5d89af003da10ba0a7131292c29697e9001
Since we now rely on
justto run the compiling commands, I updated the workflow jobs to usejustinstead. I added their github action to the workflows: https://github.com/casey/just#github-actionsAs for
wasm-optandwasm-bindgen-cli, they are added using themoonrepoaction, which allows to install cargo binaries.wasm-bindgen-cliandwasm-bindgengo in pair, so the version of the CLI must be pinned when it's installed.Test Plan
@js-apipackageImportant
We should merge this PR after our next patch to reduce errors and allocate some time to fix possible regressions
Docs
Claude code updated the contribution guide