Skip to content

Commit

Permalink
feat: introduce latest skia version
Browse files Browse the repository at this point in the history
Key Highlights:
- Updated skia version to newest release, 1.0.2
- Shifted responsibility of initializing Skia on web to client
- Fixed example application Expo Router implementation to load skia
  before rendering the app
  • Loading branch information
e-younan committed Mar 12, 2024
1 parent 761cb73 commit d8740f5
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 66 deletions.
5 changes: 5 additions & 0 deletions example/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import "@expo/metro-runtime";
import { App } from "expo-router/build/qualified-entry";
import { renderRootComponent } from "expo-router/build/renderRootComponent";

renderRootComponent(App);
6 changes: 6 additions & 0 deletions example/index.web.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import "@expo/metro-runtime";
import { LoadSkiaWeb } from "@shopify/react-native-skia/lib/module/web";
import { App } from "expo-router/build/qualified-entry";
import { renderRootComponent } from "expo-router/build/renderRootComponent";

LoadSkiaWeb().then(() => renderRootComponent(App));
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ PODS:
- React-debug
- react-native-safe-area-context (4.8.2):
- React-Core
- react-native-skia (0.1.241):
- react-native-skia (1.0.2):
- glog
- RCT-Folly (= 2022.05.16.00)
- React
Expand Down Expand Up @@ -1502,7 +1502,7 @@ SPEC CHECKSUMS:
React-logger: 0a57b68dd2aec7ff738195f081f0520724b35dab
React-Mapbuffer: 63913773ed7f96b814a2521e13e6d010282096ad
react-native-safe-area-context: 0ee144a6170530ccc37a0fd9388e28d06f516a89
react-native-skia: 8fa65cf8828f6f8f9629e1577c0b079b7160d422
react-native-skia: 0c09a4baff5db09a88dc6c9bfba25bcf4f5bbe8a
React-nativeconfig: d7af5bae6da70fa15ce44f045621cf99ed24087c
React-NativeModulesApple: 0123905d5699853ac68519607555a9a4f5c7b3ac
React-perflogger: 8a1e1af5733004bdd91258dcefbde21e0d1faccd
Expand Down
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "example",
"version": "1.0.0",
"main": "expo-router/entry",
"main": "index",
"scripts": {
"start": "expo start --dev-client",
"android": "expo run:android",
Expand All @@ -11,7 +11,7 @@
},
"dependencies": {
"@expo/metro-runtime": "~3.1.3",
"@shopify/react-native-skia": "^0.1.241",
"@shopify/react-native-skia": "1.0.2",
"expo": "~50.0.8",
"expo-blur": "~12.9.2",
"expo-constants": "~15.4.5",
Expand Down
8 changes: 4 additions & 4 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2305,10 +2305,10 @@
component-type "^1.2.1"
join-component "^1.1.0"

"@shopify/react-native-skia@^0.1.241":
version "0.1.241"
resolved "https://registry.yarnpkg.com/@shopify/react-native-skia/-/react-native-skia-0.1.241.tgz#592471a565f3a7792e03a453eaf922518dd994e5"
integrity sha512-jQFJHiNUVONTGPPnL7LIJc3kg6x4PBPh3m7NAJuTxuhB8VOSVlQR3UWd4tDHHJgj7otG3S2dbHD7+bftxM5cFA==
"@shopify/react-native-skia@1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@shopify/react-native-skia/-/react-native-skia-1.0.2.tgz#3ffa54f5df524ebae0ce55bee1e9efbe3e7cf959"
integrity sha512-w6qS+jCeUGKDJAOok5QJV6flWlvFt0Vmc9mNXi2n4jfHkQ+uccYVHFCXazhCAc5b8mFjcfMNygy12SVgP4d46g==
dependencies:
canvaskit-wasm "0.39.1"
react-reconciler "0.27.0"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"@types/react": "17.0.21"
},
"peerDependencies": {
"@shopify/react-native-skia": "0.1.241",
"@shopify/react-native-skia": "1.0.2",
"react": ">=18.0.0",
"react-native": ">=0.71.0",
"react-native-gesture-handler": ">=2.0.0",
Expand Down
6 changes: 0 additions & 6 deletions src/components/SkiaComponents.tsx

This file was deleted.

49 changes: 0 additions & 49 deletions src/components/SkiaComponents.web.tsx

This file was deleted.

3 changes: 3 additions & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { LineChart } from "./LineChart";
export type { LineChartProps } from "./LineChart";
export { AxisLabelComponentProps } from "./LineChart/AxisLabel";
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export { LineChart, type LineChartProps } from "./components/SkiaComponents";
export { type AxisLabelComponentProps } from "./components/LineChart/AxisLabel";
export { LineChart, type LineChartProps, type AxisLabelComponentProps } from "./components";

0 comments on commit d8740f5

Please sign in to comment.