Skip to content

Fix ReadableStream demos on iOS Safari - #8613

Open
aurorascharff wants to merge 1 commit into
reactjs:mainfrom
aurorascharff:codex/ios-stream-compat
Open

Fix ReadableStream demos on iOS Safari#8613
aurorascharff wants to merge 1 commit into
reactjs:mainfrom
aurorascharff:codex/ios-stream-compat

Conversation

@aurorascharff

@aurorascharff aurorascharff commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace for await...of with ReadableStream.getReader() in all five browser-run stream demos
  • flush each TextDecoder after the stream completes
  • keep the existing rendering and iframe behavior unchanged

https://react-ke9zjr6ve-react-foundation.vercel.app/

Why

WebKit only added async iteration support for ReadableStream in Safari 26.4. On older iOS versions, clicking Render the page disables the button and then fails before writing content to the preview iframe. The reader API is supported on older Safari versions and is already used elsewhere in the docs.

WebKit release notes: https://webkit.org/blog/17862/webkit-features-for-safari-26-4/#readablestream-async-iteration

Validation

  • yarn eslint src/content/reference/react-dom/browser.md src/content/reference/react/Suspense.md src/content/reference/react/use.md src/content/reference/react-dom/server/resume.md
  • yarn lint-heading-ids
  • verified no remaining for await...of usage under src/content
  • tested the local browser sandbox end to end: the rendered page displays the article editor with no console warnings or errors

@github-actions

Copy link
Copy Markdown

Size changes

Details

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

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.

1 participant