feat(wintertc): migrate structuredClone, queueMicrotask and timers from boa_runtime#5419
feat(wintertc): migrate structuredClone, queueMicrotask and timers from boa_runtime#5419KaustubhOG wants to merge 4 commits into
Conversation
Test262 conformance changes
Tested main commit: |
Move the structuredClone implementation and its supporting JsValueStore serialization core (the store module) from boa_runtime into boa_wintertc, following the same move-and-re-export pattern used for atob/btoa (boa-dev#5418). - core/runtime/src/clone and core/runtime/src/store are deleted; the code now lives only in boa_wintertc. - boa_runtime re-exports both (pub use boa_wintertc::{clone, store}) so the public paths boa_runtime::clone and boa_runtime::store are unchanged, and boa_runtime::message keeps compiling against crate::store. - StructuredCloneExtension delegates to boa_wintertc::clone::register. - rustc-hash moves with store into boa_wintertc's dependencies; runtime keeps it because console still uses it. store must be public in boa_wintertc so boa_runtime can re-export it for the message module; net public surface across both crates is unchanged.
Move the queueMicrotask implementation from boa_runtime into boa_wintertc, following the move-and-re-export pattern used for atob/btoa (boa-dev#5418). - core/runtime/src/microtask is deleted; the code now lives only in boa_wintertc. - boa_runtime re-exports it (pub use boa_wintertc::microtask) so the public path boa_runtime::microtask::register is unchanged. - MicrotaskExtension delegates to boa_wintertc::microtask::register. The unit test is rewritten to record execution order in a global array rather than through console, since console is not part of boa_wintertc's test surface (it is still a stub pending its own migration).
Move setTimeout/clearTimeout/setInterval/clearInterval from boa_runtime::interval into boa_wintertc::timers, following the move-and-re-export pattern used for atob/btoa (boa-dev#5418). The module is renamed interval -> timers to match its TC55 category. - core/runtime/src/interval.rs and its tests are deleted; the code now lives only in boa_wintertc::timers. - boa_runtime re-exports it under the historical name (pub use boa_wintertc::timers as interval) so the public path boa_runtime::interval (used by e.g. the WPT harness's clear_all) and the register(context) signature are unchanged. - TimeoutExtension delegates to boa_wintertc::timers::register. - boa_wintertc mirrors boa_runtime's test-only allow(clippy::needless_raw_string_hashes); runtime's now-unused inspect_context_async test helper gains allow(unused).
8e9d3f9 to
a0ee786
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5419 +/- ##
===========================================
+ Coverage 47.24% 62.65% +15.41%
===========================================
Files 476 531 +55
Lines 46892 59079 +12187
===========================================
+ Hits 22154 37018 +14864
+ Misses 24738 22061 -2677 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
hey @jedel1043 Batched three trivial move + re-export migrations here (structuredClone, |
| /// `structuredClone`, re-exported from [`boa_wintertc`]. | ||
| /// | ||
| /// This API is part of the `WinterTC` (TC55) Minimum Common Web API and is implemented in | ||
| /// `boa_wintertc`. It is re-exported here so `boa_runtime` users keep a single import path. |
There was a problem hiding this comment.
All of these exports repeat basically the same thing: part of WinterTC and reexported here. I suggest unifying all these messages into a single doc description on the module root, then just in-lining the docs of each component here.
There was a problem hiding this comment.
yeah make sense it was unwanted noisee , let me remove it
The base64, clone, microtask, timers, and store re-exports each carried a near-identical doc comment repeating that the API is part of WinterTC (TC55) and re-exported from boa_wintertc. Consolidate that shared explanation into a single section on the crate root and let #[doc(inline)] surface each component's own documentation, per review feedback.
Summary
Continues the boa_runtime -> boa_wintertc migration started with atob/btoa (#5418),moving three more modules with the same move + re-export pattern. Code lives only inboa_wintertc; boa_runtime re-exports it (public paths unchanged) and the *Extension structs delegate.
Changes
clone->boa_wintertc::clone. Itsstoredependency (JsValueStore) also moves toboa_wintertc::store, since boa_wintertc cannot depend on boa_runtime.storestays public and is re-exported, soboa_runtime::messagekeeps compiling.rustc-hashmoves with it.microtask->boa_wintertc::microtask.interval->boa_wintertc::timers(renamed to its TC55 category). Re-exported aspub use boa_wintertc::timers as interval, soboa_runtime::interval(incl.clear_all, used by the WPT harness) is unchanged.Notes / deviations
storeis a non-TC55 helper that is now public in boa_wintertc. Net public surfac across both crates is unchanged (it was already public in boa_runtime); happy to make itpub(crate)oncemessagealso migrates.console,sinceconsoleis still a stub in boa_wintertc.