Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Gumichocopengin8
Copy link
Contributor

@Gumichocopengin8 Gumichocopengin8 commented Oct 27, 2025

Summary

Update Boa to version 0.21.0, which includes numerous JavaScript conformance improvements and bug fixes.

Test Plan

All CI pass

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Oct 27, 2025

⚠️ No Changeset found

Latest commit: 19a94dc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 27, 2025

Walkthrough

Bumps boa_engine in the workspace Cargo.toml from 0.20.0 to 0.21.0. In crates/biome_js_runtime: context.rs removes an unused import and suppresses the return value of ctx.run_jobs(); module_loader.rs refactors load_imported_module to self: Rc<JsModuleLoader>, return Module/error directly, use &RefCell<&mut boa_engine::Context>, add register_module, and remove get_module. plugin_api.rs changes register_diagnostic to use context-aware string conversion and adds information and hint severities. analyzer_js_plugin.rs tweaks JsValue construction for a path argument.

Suggested labels

A-Resolver, A-Parser, A-Core

Suggested reviewers

  • siketyan

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "feat(js): update Boa to v0.21.0" directly and clearly describes the primary change in the pull request. The changeset confirms this is precisely what has been done—the boa_engine dependency has been bumped from 0.20.0 to 0.21.0 across multiple files. The title is concise, specific, and uses appropriate conventional commit formatting with a clear scope (js) and meaningful description. A developer reviewing the commit history would immediately understand the core change.
Description Check ✅ Passed The pull request description is clearly related to the changeset. It explicitly states the objective to "Update Boa to version 0.21.0" and provides context by referencing the Boa changelog and citing JavaScript conformance improvements as motivation. While the description is relatively brief, it covers the essential purpose of the update, includes relevant links, and indicates that the test plan (CI passing) has been satisfied. The description is not off-topic or misleading—it accurately reflects what the changeset accomplishes.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d67533e and 19a94dc.

📒 Files selected for processing (1)
  • crates/biome_js_runtime/src/plugin_api.rs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{rs,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Format Rust and TOML files before committing (e.g., via just f)

Files:

  • crates/biome_js_runtime/src/plugin_api.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Document rules, assists, and their options with inline rustdoc in the Rust source

Files:

  • crates/biome_js_runtime/src/plugin_api.rs
🧠 Learnings (2)
📚 Learning: 2025-10-24T21:24:58.631Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.631Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : Default severity is information; override severity intentionally using biome_diagnostics::Severity when needed

Applied to files:

  • crates/biome_js_runtime/src/plugin_api.rs
📚 Learning: 2025-10-15T09:21:24.116Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:21:24.116Z
Learning: Specify static properties (category, severity, description, message, location, tags) with `#[diagnostic(...)]`

Applied to files:

  • crates/biome_js_runtime/src/plugin_api.rs
⏰ 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). (23)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: End-to-end tests
  • GitHub Check: autofix
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Check Dependencies
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_package)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_css_parser)
🔇 Additional comments (3)
crates/biome_js_runtime/src/plugin_api.rs (3)

28-33: Cleaner argument handling.

The direct slice pattern matching with let [severity, message] = args else is more concise than the previous args.get(0..2) approach, and the explicit context parameter (addressing the past review comment) is spot on for Boa v0.21.0.


36-36: Context-aware string conversions for Boa v0.21.0.

Both to_string(context)? calls before to_std_string_lossy() correctly adapt to the updated Boa API, with proper error propagation.

Also applies to: 52-52


40-47: Expanded severity support and robust error handling.

Adding "information" and "hint" severities broadens the diagnostic API, and the explicit error return with all valid options is far clearer than the previous fallback approach.


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 and usage tips.

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 27, 2025

CodSpeed Performance Report

Merging #7888 will not alter performance

Comparing Gumichocopengin8:chore/update-boa-0.21.0 (19a94dc) with main (cb4fdc2)

Summary

✅ 53 untouched
⏩ 85 skipped1

Footnotes

  1. 85 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Gumichocopengin8 Gumichocopengin8 marked this pull request as draft October 27, 2025 03:13
@Gumichocopengin8 Gumichocopengin8 changed the title chore: update boa v0.21.0 fix: update boa v0.21.0 Oct 27, 2025
@Gumichocopengin8 Gumichocopengin8 changed the title fix: update boa v0.21.0 feat: update boa v0.21.0 Oct 27, 2025
@Gumichocopengin8 Gumichocopengin8 changed the title feat: update boa v0.21.0 feat: Update Boa v0.21.0 Oct 27, 2025
@github-actions github-actions bot added A-Project Area: project L-JavaScript Language: JavaScript and super languages labels Oct 27, 2025
@Gumichocopengin8 Gumichocopengin8 changed the title feat: Update Boa v0.21.0 feat: Update Boa to v0.21.0 Oct 27, 2025
@Gumichocopengin8 Gumichocopengin8 changed the title feat: Update Boa to v0.21.0 fix: Update Boa to v0.21.0 Oct 27, 2025
@Gumichocopengin8 Gumichocopengin8 changed the title fix: Update Boa to v0.21.0 feat(js): Update Boa to v0.21.0 Oct 27, 2025
@Gumichocopengin8 Gumichocopengin8 changed the title feat(js): Update Boa to v0.21.0 feat(js): update Boa to v0.21.0 Oct 27, 2025
@Gumichocopengin8 Gumichocopengin8 marked this pull request as ready for review October 27, 2025 04:49
@Gumichocopengin8
Copy link
Contributor Author

Thanks for the reaction emoji. @siketyan Could you take a look at this? Thanks.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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)
crates/biome_js_runtime/src/context.rs (1)

81-87: Don’t swallow ctx.run_jobs() errors; propagate to avoid busy‑loops.

In Boa 0.21, Context::run_jobs(&mut self) -> JsResult<()>. Ignoring its result can mask job failures and keep the loop spinning if the promise never settles. Handle the error and return early. (docs.rs)

Apply this minimal fix:

-                    let _ = ctx.run_jobs();
+                    if let Err(err) = ctx.run_jobs() {
+                        break Err(err);
+                    }
🧹 Nitpick comments (4)
crates/biome_js_runtime/src/module_loader.rs (2)

27-29: register_module looks good; consider guarding accidental overwrites.

If duplicate registrations are unexpected, prefer entry().or_insert or assert to catch accidental re‑registration. Otherwise, keep as‑is.


53-61: Tighten caching and enrich errors.

  • Cache is unbounded; consider LRU/size cap or a clear() hook to avoid unbounded growth on large projects.
  • Include specifier and referrer path in error messages to aid debugging.

Example tweak to errors:

- Err(JsNativeError::error().with_message(err.to_string()).into())
+ Err(JsNativeError::error()
+     .with_message(format!("Resolve failed for '{specifier}' from '{:?}': {err}", referrer.path()))
+     .into())

Also applies to: 63-81

crates/biome_js_runtime/src/plugin_api.rs (2)

35-47: Severity handling expansion is great; consider case‑insensitive matching.

Normalise with .to_lowercase() before the match so "Warning"/"INFO" also work.

-                let severity =
-                    match severity.to_string(_context)?.to_std_string_lossy().as_str() {
+                let sev = severity.to_string(_context)?.to_std_string_lossy().to_lowercase();
+                let severity = match sev.as_str() {
                     "fatal" => Severity::Fatal,
                     "error" => Severity::Error,
                     "warning" => Severity::Warning,
                     "information" => Severity::Information,
                     "hint" => Severity::Hint,
                     _ => return Err(JsNativeError::typ()

29-33: Tweak the error message to match behaviour.

We coerce via to_string(...); say “two arguments (severity, message)” instead of “two string arguments”.

-                        .with_message("registerDiagnostic() expects two string arguments")
+                        .with_message("registerDiagnostic() expects two arguments: severity and message")
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4cefb99 and d67533e.

📒 Files selected for processing (4)
  • crates/biome_js_runtime/src/context.rs (1 hunks)
  • crates/biome_js_runtime/src/module_loader.rs (3 hunks)
  • crates/biome_js_runtime/src/plugin_api.rs (2 hunks)
  • crates/biome_plugin_loader/src/analyzer_js_plugin.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{rs,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Format Rust and TOML files before committing (e.g., via just f)

Files:

  • crates/biome_js_runtime/src/context.rs
  • crates/biome_plugin_loader/src/analyzer_js_plugin.rs
  • crates/biome_js_runtime/src/plugin_api.rs
  • crates/biome_js_runtime/src/module_loader.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Document rules, assists, and their options with inline rustdoc in the Rust source

Files:

  • crates/biome_js_runtime/src/context.rs
  • crates/biome_plugin_loader/src/analyzer_js_plugin.rs
  • crates/biome_js_runtime/src/plugin_api.rs
  • crates/biome_js_runtime/src/module_loader.rs
🧠 Learnings (2)
📚 Learning: 2025-10-24T21:24:58.631Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.631Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : Default severity is information; override severity intentionally using biome_diagnostics::Severity when needed

Applied to files:

  • crates/biome_js_runtime/src/plugin_api.rs
📚 Learning: 2025-10-15T09:21:24.116Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:21:24.116Z
Learning: Specify static properties (category, severity, description, message, location, tags) with `#[diagnostic(...)]`

Applied to files:

  • crates/biome_js_runtime/src/plugin_api.rs
🔇 Additional comments (2)
crates/biome_js_runtime/src/module_loader.rs (1)

33-39: Alignment with Boa 0.21 loader API looks correct.

Rc receiver and &RefCell<&mut Context> usage are appropriate; borrowing is scoped to parse, avoiding re‑entrant borrow issues during load.

Also applies to: 68-76

crates/biome_plugin_loader/src/analyzer_js_plugin.rs (1)

109-113: LGTM – simpler JsValue construction.

Cleaner and equivalent to the previous explicit JsValue::String(...).

Copy link
Member

@siketyan siketyan left a comment

Choose a reason for hiding this comment

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

Great work!

@siketyan siketyan merged commit 03009ba into biomejs:main Oct 27, 2025
27 checks passed
Conaclos pushed a commit that referenced this pull request Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Project Area: project L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants