Skip to content

docs: update base64 guide - #33040

Merged
alii merged 2 commits into
oven-sh:mainfrom
pxseu:pxseu/update-base64-docs
Jun 29, 2026
Merged

alii merged 2 commits into
oven-sh:mainfrom
pxseu:pxseu/update-base64-docs

Conversation

@pxseu

@pxseu pxseu commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

The guide for base64 show's outdated methods for handling the process.

I've updated the base64 guide to recommend Uint8Array.prototype.toBase64() and Uint8Array.fromBase64() for encoding and decoding base64 data.

These APIs operate on bytes directly, which makes them a better default than btoa() and atob() for binary data and for strings once converted through TextEncoder / TextDecoder. The guide now includes examples for byte arrays, UTF-8 strings, and Buffer, and keeps btoa() / atob() documented as legacy compatibility APIs.

Also updates the Web APIs reference to list Uint8Array base64 helpers alongside the related encoding and decoding APIs.

How did you verify your code works?

No source code has been modified.

@claude claude Bot 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.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/guides/util/base64.mdx`:
- Around line 27-35: Clarify the Buffer/Base64 docs so they don’t imply Buffer
has the same Uint8Array static API: the current example in the base64 guide
mixes Buffer.from(...).toBase64() with Buffer.from(encoded, "base64"), which can
confuse readers about fromBase64(). Update the surrounding text and example near
the base64 snippet to state that Buffer inherits toBase64() from Uint8Array, but
decoding here is using Buffer.from(..., "base64"), or alternatively show the
Uint8Array.fromBase64() path and then wrap the result in Buffer if that is the
intended guidance.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 863c9669-d830-400d-96ad-54e2b253eee6

📥 Commits

Reviewing files that changed from the base of the PR and between f789198 and 6e32ca2.

📒 Files selected for processing (2)
  • docs/guides/util/base64.mdx
  • docs/runtime/web-apis.mdx

Comment thread docs/guides/util/base64.mdx Outdated
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f455dd54-9039-41c3-9900-842ba521e5eb

📥 Commits

Reviewing files that changed from the base of the PR and between f789198 and e0faec6.

📒 Files selected for processing (2)
  • docs/guides/util/base64.mdx
  • docs/runtime/web-apis.mdx

Walkthrough

The base64 guide is rewritten to focus on Uint8Array.prototype.toBase64()/fromBase64() with TextEncoder/TextDecoder and Buffer examples, replacing the previous btoa/atob-centered content. A warning block notes btoa/atob remain available but should be avoided for binary data. The Web APIs table adds Uint8Array base64 helpers to the encoding row.

Changes

Base64 docs update

Layer / File(s) Summary
Base64 guide rewrite and Web APIs table
docs/guides/util/base64.mdx, docs/runtime/web-apis.mdx
Guide content replaced with Uint8Array toBase64/fromBase64 examples including UTF-8 string handling via TextEncoder/TextDecoder and Buffer; <Warning> block added for btoa/atob; Web APIs table encoding row updated to list Uint8Array helpers alongside existing entries.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main documentation update to the base64 guide.
Description check ✅ Passed The description follows the template and covers both the change summary and a verification note.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@alii

alii commented Jun 29, 2026

Copy link
Copy Markdown
Member

yeah

@alii
alii merged commit 033e0b1 into oven-sh:main Jun 29, 2026
1 check was pending
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.

2 participants