Skip to content

fix(react-native): use own WebGPU flag constants, release 0.1.5 - #9

Merged
MiloszFilimowski merged 2 commits into
mainfrom
fix/own-webgpu-constants
Sep 16, 2026
Merged

MiloszFilimowski merged 2 commits into
mainfrom
fix/own-webgpu-constants

Conversation

@MiloszFilimowski

@MiloszFilimowski MiloszFilimowski commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

react-native-webgpu 0.8.4 and newer evaluates its constants module before the native install has run (main/index.tsx now imports install.ts, which imports constants.ts), so GPUTextureUsage, GPUShaderStage and GPUBufferUsage imported from the package are undefined. With react-native-webgpu 0.10.1 every camera effect failed at setup:

Background blur failed [TypeError: Cannot read property 'TEXTURE_BINDING' of undefined]
Camera effect failed [TypeError: Cannot read property 'FRAGMENT' of undefined]

The flag values are fixed by the WebGPU spec and the web path already uses our own TEXTURE_USAGE / BUFFER_USAGE in core/constants.ts, so the React Native files now use those too (plus a new SHADER_STAGE). What remains from react-native-webgpu is the GPUSharedTextureMemory type and WebGPUModule.

Second commit bumps the version to 0.1.5 and the dev dependency to react-native-webgpu 0.10.1 (peer range stays >=0.5.15; the package works on both).

Verified on the iOS simulator with react-native-webgpu 0.10.1: blur and the docs' WebGPU tutorial effect run at 30 fps, footprint flat over 40 s. yarn test (tsc, lint, prettier) passes against the 0.10.1 types.

Why we want 0.10.1: it ships wcandillon/react-native-webgpu#478, which fixes the per-frame graphics memory leak on Android (200 MB to 1 GB saw-tooth with any camera effect on 0.5.15). The docs (fishjam-cloud/documentation#287) now require video-effects 0.1.5 and react-native-webgpu 0.10.1 together.

After merging: gh release create v0.1.5 --title v0.1.5 --generate-notes publishes to npm through the release workflow.

react-native-webgpu >= 0.8.4 evaluates its constants module before the native
install runs, so GPUTextureUsage, GPUShaderStage and GPUBufferUsage imported
from it are undefined and every camera effect failed with
"Cannot read property 'TEXTURE_BINDING' of undefined". The values are fixed
by the WebGPU spec, so use the package's own constants (core/constants.ts)
like the web path already does.
@MiloszFilimowski MiloszFilimowski changed the title fix(react-native): use own WebGPU flag constants fix(react-native): use own WebGPU flag constants, release 0.1.5 Sep 16, 2026
@MiloszFilimowski
MiloszFilimowski merged commit 105f9d0 into main Sep 16, 2026
1 check passed
@MiloszFilimowski
MiloszFilimowski deleted the fix/own-webgpu-constants branch September 16, 2026 09:13
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