Skip to content

Commit

Permalink
fix(🌎): examples on web (#2273)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon authored Mar 10, 2024
1 parent 73157c1 commit a5a79c7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"typescript": "5.1.6",
"url-loader": "4.1.1",
"webpack": "5.76.0",
"webpack-cli": "4.9.2",
"webpack-cli": "4.10.0",
"webpack-dev-server": "4.8.1"
},
"resolutions": {
Expand Down
28 changes: 13 additions & 15 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2977,10 +2977,8 @@
nanoid "^3.1.23"

"@shopify/react-native-skia@link:../package":
version "0.1.0-development"
dependencies:
canvaskit-wasm "0.39.1"
react-reconciler "0.27.0"
version "0.0.0"
uid ""

"@sideway/address@^4.1.3":
version "4.1.4"
Expand Down Expand Up @@ -3812,19 +3810,19 @@
resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.21.tgz#b181202daec30d66ccd67264de23814cfd176d3a"
integrity sha512-pUrWq3V5PiSGFLeLxoGqReTZmiiXwY3jRkIG5sLLKjyqNxrwm/04b4nw7LSmGWJcKk59XOM/YRTUwOzo4MMlow==

"@webpack-cli/configtest@^1.1.1":
"@webpack-cli/configtest@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.2.0.tgz#7b20ce1c12533912c3b217ea68262365fa29a6f5"
integrity sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==

"@webpack-cli/info@^1.4.1":
"@webpack-cli/info@^1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.5.0.tgz#6c78c13c5874852d6e2dd17f08a41f3fe4c261b1"
integrity sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==
dependencies:
envinfo "^7.7.3"

"@webpack-cli/serve@^1.6.1":
"@webpack-cli/serve@^1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.7.0.tgz#e1993689ac42d2b16e9194376cfb6753f6254db1"
integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==
Expand Down Expand Up @@ -10858,18 +10856,18 @@ webidl-conversions@^3.0.0:
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==

webpack-cli@4.9.2:
version "4.9.2"
resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.9.2.tgz#77c1adaea020c3f9e2db8aad8ea78d235c83659d"
integrity sha512-m3/AACnBBzK/kMTcxWHcZFPrw/eQuY4Df1TxvIWfWM2x7mRqBQCqKEd96oCUa9jkapLBaFfRce33eGDb4Pr7YQ==
webpack-cli@4.10.0:
version "4.10.0"
resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.10.0.tgz#37c1d69c8d85214c5a65e589378f53aec64dab31"
integrity sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==
dependencies:
"@discoveryjs/json-ext" "^0.5.0"
"@webpack-cli/configtest" "^1.1.1"
"@webpack-cli/info" "^1.4.1"
"@webpack-cli/serve" "^1.6.1"
"@webpack-cli/configtest" "^1.2.0"
"@webpack-cli/info" "^1.5.0"
"@webpack-cli/serve" "^1.7.0"
colorette "^2.0.14"
commander "^7.0.0"
execa "^5.0.0"
cross-spawn "^7.0.3"
fastest-levenshtein "^1.0.12"
import-local "^3.0.2"
interpret "^2.2.0"
Expand Down
4 changes: 2 additions & 2 deletions package/src/renderer/Offscreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export const drawAsImageFromPicture = (picture: SkPicture, size: SkSize) => {
canvas.drawPicture(picture);
surface.flush();
const image = surface.makeImageSnapshot();
// If we are not on the main thread, we need to make the image non-texture.
if (!isOnMainThread()) {
// If we are not on the main thread or if we are on Web, we need to make the image non-texture.
if (!isOnMainThread() || Platform.OS === "web") {
return image.makeNonTextureImage();
} else {
return image;
Expand Down

0 comments on commit a5a79c7

Please sign in to comment.