Skip to content

Commit 76c7699

Browse files
authored
fix(📦): fix missing React imports (#284)
1 parent 578ad98 commit 76c7699

File tree

6 files changed

+50
-30
lines changed

6 files changed

+50
-30
lines changed

‎.github/workflows/ci.yml‎

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
18-
static-analysis:
18+
build:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2323

2424
- name: Setup
2525
uses: ./.github/actions/setup
@@ -36,42 +36,56 @@ jobs:
3636
- name: Typecheck files
3737
run: yarn tsc
3838

39-
test:
40-
runs-on: macos-latest
41-
steps:
42-
- name: Checkout
43-
uses: actions/checkout@v3
44-
45-
- name: Setup
46-
uses: ./.github/actions/setup
47-
with:
48-
github_token: ${{ secrets.GITHUB_TOKEN }}
49-
50-
- name: Install Chrome
51-
run: npx puppeteer browsers install chrome
39+
- name: Build
40+
working-directory: packages/webgpu
41+
run: yarn build
5242

53-
- name: Run reference test suite
43+
- name: Package
5444
working-directory: packages/webgpu
55-
run: yarn test:ref
45+
run: yarn pack
5646

57-
- name: Build package
58-
run: yarn build
47+
- name: Upload package artifact
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: package
51+
path: packages/webgpu/package.tgz
52+
compression-level: 0
53+
54+
# These are disabled since they are not useful in the context of
55+
# GitHub Actions CI and they slow down the workflow significantly.
56+
# test:
57+
# runs-on: macos-latest
58+
# steps:
59+
# - name: Checkout
60+
# uses: actions/checkout@v4
61+
62+
# - name: Setup
63+
# uses: ./.github/actions/setup
64+
# with:
65+
# github_token: ${{ secrets.GITHUB_TOKEN }}
66+
67+
# - name: Install Chrome
68+
# run: npx puppeteer browsers install chrome
69+
70+
# - name: Run reference test suite
71+
# working-directory: packages/webgpu
72+
# run: yarn test:ref
5973

6074
build-android:
6175
runs-on: macos-latest
6276
env:
6377
TURBO_CACHE_DIR: .turbo/android
6478
steps:
6579
- name: Checkout
66-
uses: actions/checkout@v3
80+
uses: actions/checkout@v4
6781

6882
- name: Setup
6983
uses: ./.github/actions/setup
7084
with:
7185
github_token: ${{ secrets.GITHUB_TOKEN }}
7286

7387
- name: Cache turborepo for Android
74-
uses: actions/cache@v3
88+
uses: actions/cache@v4
7589
with:
7690
path: ${{ env.TURBO_CACHE_DIR }}
7791
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
@@ -112,7 +126,7 @@ jobs:
112126

113127
- name: Cache Gradle
114128
if: env.turbo_cache_hit != 1
115-
uses: actions/cache@v3
129+
uses: actions/cache@v4
116130
with:
117131
path: |
118132
~/.gradle/wrapper
@@ -133,15 +147,15 @@ jobs:
133147
TURBO_CACHE_DIR: .turbo/ios
134148
steps:
135149
- name: Checkout
136-
uses: actions/checkout@v3
150+
uses: actions/checkout@v4
137151

138152
- name: Setup
139153
uses: ./.github/actions/setup
140154
with:
141155
github_token: ${{ secrets.GITHUB_TOKEN }}
142156

143157
- name: Cache turborepo for iOS
144-
uses: actions/cache@v3
158+
uses: actions/cache@v4
145159
with:
146160
path: ${{ env.TURBO_CACHE_DIR }}
147161
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}

‎apps/example/ios/Podfile.lock‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,7 +1865,7 @@ PODS:
18651865
- ReactCommon/turbomodule/core
18661866
- SocketRocket
18671867
- Yoga
1868-
- react-native-wgpu (0.4.0):
1868+
- react-native-wgpu (0.4.1):
18691869
- boost
18701870
- DoubleConversion
18711871
- fast_float
@@ -2903,7 +2903,7 @@ SPEC CHECKSUMS:
29032903
React-microtasksnativemodule: 75b6604b667d297292345302cc5bfb6b6aeccc1b
29042904
react-native-safe-area-context: c6e2edd1c1da07bdce287fa9d9e60c5f7b514616
29052905
react-native-skia: 5bf2b2107cd7f2d806fd364f5e16b1c7554ed3cd
2906-
react-native-wgpu: 5abf760f89d1517255e48de1b5208d2a307109a0
2906+
react-native-wgpu: 9b91079473265b91dc2c60c692845b70a4f0182b
29072907
React-NativeModulesApple: 879fbdc5dcff7136abceb7880fe8a2022a1bd7c3
29082908
React-oscompat: 93b5535ea7f7dff46aaee4f78309a70979bdde9d
29092909
React-perflogger: 5536d2df3d18fe0920263466f7b46a56351c0510

‎packages/webgpu/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-wgpu",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "React Native WebGPU",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

‎packages/webgpu/src/Canvas.tsx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
import React, {
2+
forwardRef,
3+
useImperativeHandle,
4+
useRef,
5+
useState,
6+
} from "react";
17
import type { ViewProps } from "react-native";
28
import { Platform, View } from "react-native";
3-
import { forwardRef, useImperativeHandle, useRef, useState } from "react";
49

510
import WebGPUNativeView from "./WebGPUViewNativeComponent";
611

‎packages/webgpu/src/hooks.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import type { ReactNode } from "react";
2-
import {
1+
import React, {
32
createContext,
43
useContext,
54
useEffect,
65
useLayoutEffect,
76
useRef,
87
useState,
98
} from "react";
9+
import type { ReactNode } from "react";
1010

1111
import type { CanvasRef, NativeCanvas } from "./Canvas";
1212

‎packages/webgpu/tsconfig.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"compilerOptions": {
44
"module": "esnext",
55
"noUncheckedIndexedAccess": false,
6+
"jsx": "react",
67
"types": ["@webgpu/types", "@types/node", "@types/jest"]
78
}
89
}

0 commit comments

Comments
 (0)