Skip to content

refactor(builtin): drop deprecated BytesView byte-order conversions - #4101

Merged
bobzhang merged 1 commit into
mainfrom
cleanup/remove-deprecated-bytesview-conversions
Aug 19, 2026
Merged

refactor(builtin): drop deprecated BytesView byte-order conversions#4101
bobzhang merged 1 commit into
mainfrom
cleanup/remove-deprecated-bytesview-conversions

Conversation

@bobzhang

Copy link
Copy Markdown
Contributor

Removes the ten #deprecated + #doc(hidden) byte-order helpers on BytesView:

  • to_uint_be / to_uint_le
  • to_uint64_be / to_uint64_le
  • to_int_be / to_int_le
  • to_int64_be / to_int64_le
  • to_double_be / to_double_le

Every one of them already carried a deprecation pointing at the u32be / u32le / u64be / u64le bit patterns, and the last six were literally thin wrappers around exactly those patterns.

Why it's safe

  • No call sites remain. The tests in bytes/view_test.mbt that used to exercise these were migrated to bit-pattern matching earlier; only their test names still mention the old spellings.
  • No .mbti diff. moon info --target wasm,wasm-gc,js,native produces no interface change — the helpers were #doc(hidden), so they never appeared in the generated interface.

Verification

  • moon check --deny-warn clean
  • moon test --target all green on wasm / wasm-gc / js / native
  • moon info && moon fmt produce no further diff

🤖 Generated with Claude Code

Removes the ten `#deprecated` + `#doc(hidden)` byte-order helpers on
`BytesView`: `to_uint_be/le`, `to_uint64_be/le`, `to_int_be/le`,
`to_int64_be/le` and `to_double_be/le`. All of them told callers to use
the `u32be`/`u32le`/`u64be`/`u64le` bit patterns instead, and the last
four were already thin wrappers around exactly those patterns.

No call sites remain in the repository -- the tests in
`bytes/view_test.mbt` that once exercised these functions were migrated
to bit-pattern matching earlier and only their test names still mention
the old spellings.

`moon info` produces no `.mbti` diff: the helpers were `#doc(hidden)`,
so they never appeared in the generated interface.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 19, 2026 04:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the builtin byte utilities by removing deprecated, #doc(hidden) byte-order conversion helpers from BytesView, relying instead on the existing u32be/u32le/u64be/u64le bit-pattern matches as the supported mechanism.

Changes:

  • Removed 10 deprecated BytesView byte-order conversion methods (to_uint*, to_int*, to_double*) from builtin/bytesview.mbt.
  • Eliminated the associated hidden documentation blocks for those methods, leaving the remaining BytesView API intact.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 6162

Coverage decreased (-0.006%) to 90.686%

Details

  • Coverage decreased (-0.006%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 1 coverage regression across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
builtin/to_string.mbt 1 96.3%

Coverage Stats

Coverage Status
Relevant Lines: 17898
Covered Lines: 16231
Line Coverage: 90.69%
Coverage Strength: 331805.53 hits per line

💛 - Coveralls

@bobzhang
bobzhang merged commit cb67bcb into main Aug 19, 2026
16 checks passed
@bobzhang
bobzhang deleted the cleanup/remove-deprecated-bytesview-conversions branch August 19, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants