-
-
Notifications
You must be signed in to change notification settings - Fork 794
feat(js): update Boa to v0.21.0
#7888
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
feat(js): update Boa to v0.21.0
#7888
Conversation
|
WalkthroughBumps Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ 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)
🧰 Additional context used📓 Path-based instructions (2)**/*.{rs,toml}📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
**/*.rs📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
🧠 Learnings (2)📚 Learning: 2025-10-24T21:24:58.631ZApplied to files:
📚 Learning: 2025-10-15T09:21:24.116ZApplied to files:
⏰ 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)
🔇 Additional comments (3)
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. Comment |
CodSpeed Performance ReportMerging #7888 will not alter performanceComparing Summary
Footnotes
|
Boa v0.21.0Boa to v0.21.0
Boa to v0.21.0Boa to v0.21.0
Boa to v0.21.0Boa to v0.21.0
Boa to v0.21.0Boa to v0.21.0
|
Thanks for the reaction emoji. @siketyan Could you take a look at this? Thanks. |
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)
crates/biome_js_runtime/src/context.rs (1)
81-87: Don’t swallowctx.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_modulelooks good; consider guarding accidental overwrites.If duplicate registrations are unexpected, prefer
entry().or_insertor 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 thematchso"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
📒 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.rscrates/biome_plugin_loader/src/analyzer_js_plugin.rscrates/biome_js_runtime/src/plugin_api.rscrates/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.rscrates/biome_plugin_loader/src/analyzer_js_plugin.rscrates/biome_js_runtime/src/plugin_api.rscrates/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 toparse, avoiding re‑entrant borrow issues duringload.Also applies to: 68-76
crates/biome_plugin_loader/src/analyzer_js_plugin.rs (1)
109-113: LGTM – simplerJsValueconstruction.Cleaner and equivalent to the previous explicit
JsValue::String(...).
siketyan
left a 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.
Great work!
Summary
Update
Boato version0.21.0, which includes numerous JavaScript conformance improvements and bug fixes.Test Plan
All CI pass
Docs
N/A