Skip to content

feat(wintertc): migrate console from boa_runtime#5441

Open
KaustubhOG wants to merge 1 commit into
boa-dev:mainfrom
KaustubhOG:feat/wintertc-migrate-console
Open

feat(wintertc): migrate console from boa_runtime#5441
KaustubhOG wants to merge 1 commit into
boa-dev:mainfrom
KaustubhOG:feat/wintertc-migrate-console

Conversation

@KaustubhOG

Copy link
Copy Markdown
Contributor

Part of the TC55 migration (#4988), following the move + re-export pattern from #5418.

Changes:

  • Moves console (mod.rs, table.rs, tests.rs) into boa_wintertc unchanged — only additions are a TC55 doc note and a register entry point wrapping Console::register_with_logger.
  • Deletes core/runtime/src/console/; boa_runtime::console is now #[doc(inline)] pub use boa_wintertc::console; and ConsoleExtension delegates to it. Public API unchanged.
  • Moves comfy-table from boa_runtime to boa_wintertc (console was its only user); adds boa_gc + rustc-hash to boa_wintertc.
  • Two small boa_runtime test fixes since console's #[cfg(test)] helpers left the crate: microtask/tests.rs gets a local RecordingLogger (goes away when microtask migrates), and run_test_actions is #[allow(unused)] (only feature-gated tests use it now).

Line counts (before and after, in both locations):

File boa_runtime (before) boa_wintertc before boa_wintertc after
console/mod.rs 1008 (deleted) 23 (stub) 1027
console/table.rs 214 (deleted) 0 (did not exist) 214
console/tests.rs 853 (deleted) 0 (did not exist) 852

mod.rs gains 19 lines (doc note + register wrapper); table.rs is identical; tests.rs is one line shorter after merging two imports.

@github-actions github-actions Bot added Waiting On Review Waiting on reviews from the maintainers C-Dependencies Pull requests that update a dependency file C-Tests Issues and PRs related to the tests. C-Runtime Issues and PRs related to Boa's runtime features labels Jul 20, 2026
@github-actions github-actions Bot added this to the v1.0.0 milestone Jul 20, 2026
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

Test262 conformance changes

Test result main count PR count difference
Total 53,125 53,125 0
Passed 51,073 51,073 0
Ignored 1,482 1,482 0
Failed 570 570 0
Panics 0 0 0
Conformance 96.14% 96.14% 0.00%

Tested main commit: 5718cc81111ceff12d6054ab948146a45bc6e114
Tested PR commit: 422e9c5f489cd3e8462e325f09b7a8c1a150e19c
Compare commits: 5718cc8...422e9c5

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.88079% with 97 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.69%. Comparing base (6ddc2b4) to head (422e9c5).
⚠️ Report is 1001 commits behind head on main.

Files with missing lines Patch % Lines
core/wintertc/src/console/mod.rs 67.77% 97 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5441       +/-   ##
===========================================
+ Coverage   47.24%   62.69%   +15.44%     
===========================================
  Files         476      533       +57     
  Lines       46892    59085    +12193     
===========================================
+ Hits        22154    37041    +14887     
+ Misses      24738    22044     -2694     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@KaustubhOG
KaustubhOG marked this pull request as ready for review July 20, 2026 19:53
@KaustubhOG
KaustubhOG requested a review from a team as a code owner July 20, 2026 19:53
This Pull Request is part of the TC55 migration tracked in boa-dev#4988, and
follows the move + re-export pattern established by the base64 migration
(boa-dev#5418).

**It changes the following:**

- **Moves the `console` module** (`mod.rs`, `table.rs`, and `tests.rs`)
into `boa_wintertc`. The implementation is **unchanged**: `table.rs` is
byte for byte identical, `tests.rs` differs only in one import path
(`Logger`/`NullLogger` now come from the console module rather than the
`boa_runtime` crate root), and `mod.rs` only gains a short TC55 status
note and a thin `register` wrapper (see below).
- **Deletes `core/runtime/src/console/`** and **re-exports the module
from `boa_runtime`**: `boa_runtime::console` is now `#[doc(inline)] pub
use boa_wintertc::console;`. The crate-root re-export `pub use
console::{Console, ConsoleState, DefaultLogger, Logger, NullLogger}`
keeps resolving through it, so the public API is unchanged.
- **Delegates the extension**: `ConsoleExtension` now calls
`boa_wintertc::console::Console::register_with_logger`. It stays in the
default extension set, so there is no behaviour change for existing
users.
- **Adds a `register` entry point** to `boa_wintertc::console` so it
plugs into `boa_wintertc::register` like the other modules. It installs
`console` with the `DefaultLogger`; `register_with_logger` remains the
way to supply a custom logger.
- **Moves the `comfy-table` dependency** from `boa_runtime` to
`boa_wintertc`, as the moved module was its only user, and adds `boa_gc`
and `rustc-hash` to `boa_wintertc` (both already used by the console
implementation).
- **Allows `needless_raw_string_hashes` in test builds** of
`boa_wintertc`, matching `boa_runtime`; the console tests use raw JS
strings kept copy-pastable.

**Two adjustments in `boa_runtime` where console's tests were shared:**

- `microtask/tests.rs` used `console::tests::RecordingLogger`, a
`#[cfg(test)]` helper that has now left the crate. It defines its own
small `RecordingLogger` locally instead. This is temporary: the helper
goes away when `microtask` migrates.
- `run_test_actions` (the test harness variant that registers a console)
was previously kept alive by the always-compiled console tests. Its only
remaining callers are the feature-gated `fetch`, `url`, and `abort`
tests, so it is now `#[allow(unused)]` to stay warning-free under
`--no-default-features`.

**Line counts (before and after, in both locations):**

| File | `boa_runtime` (before) | `boa_wintertc` before | `boa_wintertc` after |
| --- | --- | --- | --- |
| `console/mod.rs` | 1008 (deleted) | 23 (stub) | 1027 |
| `console/table.rs` | 214 (deleted) | 0 (did not exist) | 214 |
| `console/tests.rs` | 853 (deleted) | 0 (did not exist) | 852 |

`mod.rs` gains 19 lines: the TC55 status doc note and the `register`
wrapper. `table.rs` is identical; `tests.rs` is one line shorter after
merging two imports into one.

**Testing:**

- `cargo test -p boa_wintertc`: all console unit tests pass (46 total
including base64 and the doctest).
- `cargo test -p boa_runtime` and `--all-features`: pass, with console
now exercised through the re-export.
- `cargo clippy -p boa_wintertc` and `-p boa_runtime`, each with
`--all-features --all-targets` and `--no-default-features`: clean.
- `cargo fmt --all -- --check` and `cargo doc --no-deps`: clean.
- Verified `console.log`/`info`/`warn`/`error`, `group` indentation,
`console.table`, `count`, and `dir` end to end through `boa_cli`.

**Out of scope:**

- **WPT** is unchanged: the runner targets `boa_runtime`, which reaches
this implementation through the re-export.
- **Test262** does not apply, as `console` is a Web API rather than
ECMAScript.
@KaustubhOG
KaustubhOG force-pushed the feat/wintertc-migrate-console branch from 9ab907e to 422e9c5 Compare July 23, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Dependencies Pull requests that update a dependency file C-Runtime Issues and PRs related to Boa's runtime features C-Tests Issues and PRs related to the tests. Waiting On Review Waiting on reviews from the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant