Skip to content

fix(🍏): build on tvOS and visionOS again, and check every Apple SDK in CI - #607

Merged
wcandillon merged 3 commits into
mainfrom
fix/tvos-extended-dynamic-range
Nov 3, 2026
Merged

wcandillon merged 3 commits into
mainfrom
fix/tvos-extended-dynamic-range

Conversation

@wcandillon

@wcandillon wcandillon commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Description

Fixes #606. Since 0.20.0 (#597), react-native-webgpu no longer compiles for tvOS: CAMetalLayer.wantsExtendedDynamicRangeContent is declared API_UNAVAILABLE(tvos, watchos) in the SDK, and @available is a runtime check, so it can't hide an API the SDK marks unavailable.

The property is now compiled only on iOS, macOS and visionOS, as the issue suggested (listing the platforms that support it instead of excluding the ones that don't). On tvOS, toneMapping: { mode: "extended" } behaves like "standard", and the canvas API docs now say so.

Also fixed: visionOS

The new CI check found the same kind of problem on visionOS, which the podspec does declare: -[AVAsset tracksWithMediaType:] (video player, #496) is unavailable there. On visionOS the video track is now read with loadTracksWithMediaType:completionHandler:. Other platforms keep the existing path, since the new API needs macOS 12 and the podspec targets 10.15. The visionOS path compiles but hasn't been run on a device or simulator.

CI: apple-sdks workflow

packages/webgpu/scripts/check-apple-sdks.sh runs clang++ -fsyntax-only on the Apple sources against the iOS, iOS simulator, macOS, visionOS, tvOS and tvOS simulator SDKs. The workflow runs it on a hosted macos-latest runner, with no yarn install, pods or simulator: it only downloads the Dawn headers (about 1 MB) for the version pinned in packages/webgpu/package.json. It runs on PRs that touch apple/, cpp/ or the Dawn version.

It covers MetalLayerColorSpace.mm and AppleVideoPlayer.mm. The other files under apple/ need React and codegen headers, which only exist after a pod install, so they aren't covered.

Locally (packages/webgpu/scripts/check-apple-sdks.sh, using Dawn headers from node_modules):

  • on main: fails on appletvos and appletvsimulator (MetalLayerColorSpace.mm) and on xros (AppleVideoPlayer.mm)
  • on this branch: passes on all six SDKs

The check passes -w, so warnings that were already there don't show (for example, kCGColorSpaceExtendedDisplayP3 requires macOS 11 while the podspec targets 10.15, from #586).

tracksWithMediaType: is unavailable on visionOS, so the package did not
compile there.
Runs on a hosted macos-latest runner without yarn install or pods: only
the Dawn headers are downloaded.
@wcandillon wcandillon changed the title fix(🍏): don't compile wantsExtendedDynamicRangeContent on tvOS fix(🍏): build on tvOS and visionOS again, and check every Apple SDK in CI Nov 3, 2026
@wcandillon
wcandillon merged commit 8cf6f9c into main Nov 3, 2026
6 of 7 checks passed
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 0.21.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

wcandillon added a commit that referenced this pull request Nov 4, 2026
…pple TV (#609)

* fix(🍏): declare tvOS in the podspec so autolinking links the pod on Apple TV (#608)

React Native's CocoaPods autolinking skips any pod whose podspec does not
list the Podfile target's platform, so on a tvOS target react-native-webgpu
was silently left out of the installed pods. The Dawn xcframework already
ships tvOS device and simulator slices and the sources build on tvOS since
#607; only the platforms declaration was missing. The tvOS floor matches the
iOS one, as in react-native-tvos' own min_supported_versions.

* docs: list tvOS in the home page hero

* fix(🍏): stop declaring visionOS, the Dawn package ships no visionOS slice

Since #507 Dawn comes from react-native-webgpu-dawn, whose xcframework has
no xros or xrsimulator slice, so a visionOS target autolinked the pod and
then failed to link it. Drop the claim from the podspec and the docs until
the Dawn package ships visionOS binaries again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wantsExtendedDynamicRangeContent isn't available on tvOS, causing compilation error on 0.20.0

1 participant