Skip to content

feat(wintertc): migrate atob/btoa from boa_runtime#5418

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

feat(wintertc): migrate atob/btoa from boa_runtime#5418
KaustubhOG wants to merge 1 commit into
boa-dev:mainfrom
KaustubhOG:feat/wintertc-migrate-base64

Conversation

@KaustubhOG

Copy link
Copy Markdown
Contributor

This Pull Request is part of the TC55 migration tracked in #4988, and builds on the skeleton crate from #5105.

It moves the base64 module (atob and btoa) from boa_runtime into the dedicated boa_wintertc crate as the first migration step toward hosting the WinterTC TC55 Minimum Common Web API in its own crate.

It changes the following:

  • Moves the base64 module (mod.rs and tests.rs) into boa_wintertc. The implementation is unchanged; the only difference from the boa_runtime version is a short TC55 status note added to the module documentation.
  • Ports the test harness (TestAction and run_test_actions_with) into boa_wintertc so the migrated unit tests run unchanged. This harness will be reused by later migrations.
  • Adds dependencies to core/wintertc/Cargo.toml: the base64 dependency, plus indoc, textwrap, and futures-lite as dev dependencies.

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

File boa_runtime (source) boa_wintertc before boa_wintertc after
base64/mod.rs 82 (unchanged) 23 (stub) 86
base64/tests.rs 154 (unchanged) 0 (did not exist) 154

The 4 extra lines in mod.rs are the TC55 status doc note; the code itself is identical. tests.rs is byte for byte the same.

Approach: boa_runtime keeps its own base64 module for now, so there is no behaviour change for existing users and no new cross-crate dependency is introduced in this PR. Wiring boa_runtime to re-export from boa_wintertc (and removing the duplicate) is intended as a follow up, once the dependency direction between the two crates is agreed.

Testing:

  • cargo test -p boa_wintertc: all six base64 unit tests pass, plus the crate doctest.
  • cargo clippy -p boa_wintertc --all-features --all-targets: clean, no warnings.
  • cargo fmt -p boa_wintertc -- --check: clean.
  • cargo test -p boa_runtime base64: still passes (source untouched).

Out of scope:

  • WPT is not run here: the WPT runner currently targets boa_runtime, so it does not yet exercise the boa_wintertc copy. That is covered automatically once the re-export follow up lands.
  • Test262 does not apply, as atob and btoa are Web APIs rather than ECMAScript.

Move the base64 module (atob and btoa) into the boa_wintertc crate as
the first step of migrating the existing Web APIs into the dedicated
TC55 crate.

The implementation is moved unchanged; the only difference from the
boa_runtime version is a short TC55 status note added to the module
documentation. boa_runtime keeps its own base64 module for now, so
there is no behaviour change for existing users.

The test harness (TestAction and run_test_actions_with) is ported into
boa_wintertc so the migrated unit tests run unchanged. All six base64
unit tests pass.
@KaustubhOG KaustubhOG requested a review from a team as a code owner June 28, 2026 22:30
@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. and removed Waiting On Review Waiting on reviews from the maintainers labels Jun 28, 2026
@github-actions github-actions Bot added this to the v1.0.0 milestone Jun 28, 2026
@github-actions

Copy link
Copy Markdown

Test262 conformance changes

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

Tested main commit: 8a1e8fe07f626f7a067afc2c9885d5d87de4bb5d
Tested PR commit: b6a01d5620533055b0ff48ffebc0788fc4dc2c7a
Compare commits: 8a1e8fe...b6a01d5

@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.32%. Comparing base (6ddc2b4) to head (b6a01d5).
⚠️ Report is 985 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5418       +/-   ##
===========================================
+ Coverage   47.24%   60.32%   +13.07%     
===========================================
  Files         476      567       +91     
  Lines       46892    63163    +16271     
===========================================
+ Hits        22154    38102    +15948     
- Misses      24738    25061      +323     

☔ 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.

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-Tests Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant