expo-gl 11.1.2 → 11.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,7 +10,17 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
- ## 11.1.2 — 2022-02-01
13
+ ## 11.2.0 — 2022-04-18
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fix support for React Native 0.68 by building `expo-gl-cpp` from source. ([#17060](https://github.com/expo/expo/pull/17060) by [@wkozyra95](https://github.com/wkozyra95))
18
+
19
+ ### ⚠️ Notices
20
+
21
+ - On Android bump `compileSdkVersion` to `31`, `targetSdkVersion` to `31` and `Java` version to `11`. ([#16941](https://github.com/expo/expo/pull/16941) by [@bbarthec](https://github.com/bbarthec))
22
+
23
+ ## 11.1.2 - 2022-02-01
14
24
 
15
25
  ### 🐛 Bug fixes
16
26
 
package/README.md CHANGED
@@ -4,12 +4,12 @@ Provides GLView that acts as OpenGL ES render target and gives GL context object
4
4
 
5
5
  # API documentation
6
6
 
7
- - [Documentation for the master branch](https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/sdk/gl-view.md)
8
- - [Documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/gl-view/)
7
+ - [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/gl-view.md)
8
+ - [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/gl-view/)
9
9
 
10
10
  # Installation in managed Expo projects
11
11
 
12
- For managed [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/gl-view/).
12
+ For [managed](https://docs.expo.dev/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/gl-view/).
13
13
 
14
14
  # Installation in bare React Native projects
15
15
 
@@ -17,7 +17,7 @@ For bare React Native projects, you must ensure that you have [installed and con
17
17
 
18
18
  ### Install expo-gl-cpp
19
19
 
20
- expo-gl requires that you also install and configure [expo-gl-cpp](https://github.com/expo/expo/tree/master/packages/expo-gl-cpp).
20
+ expo-gl requires that you also install and configure [expo-gl-cpp](https://github.com/expo/expo/tree/main/packages/expo-gl-cpp).
21
21
 
22
22
  ### Add the package to your npm dependencies
23
23
 
@@ -3,20 +3,35 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '11.1.2'
6
+ version = '11.2.0'
7
7
 
8
8
  buildscript {
9
+ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
10
+ if (expoModulesCorePlugin.exists()) {
11
+ apply from: expoModulesCorePlugin
12
+ applyKotlinExpoModulesCorePlugin()
13
+ }
14
+
9
15
  // Simple helper that allows the root project to override versions declared by this library.
10
16
  ext.safeExtGet = { prop, fallback ->
11
17
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
12
18
  }
13
19
 
20
+ // Ensures backward compatibility
21
+ ext.getKotlinVersion = {
22
+ if (ext.has("kotlinVersion")) {
23
+ ext.kotlinVersion()
24
+ } else {
25
+ ext.safeExtGet("kotlinVersion", "1.6.10")
26
+ }
27
+ }
28
+
14
29
  repositories {
15
30
  mavenCentral()
16
31
  }
17
32
 
18
33
  dependencies {
19
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.4.21')}")
34
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
20
35
  }
21
36
  }
22
37
 
@@ -44,18 +59,22 @@ afterEvaluate {
44
59
  }
45
60
 
46
61
  android {
47
- compileSdkVersion safeExtGet("compileSdkVersion", 30)
62
+ compileSdkVersion safeExtGet("compileSdkVersion", 31)
48
63
 
49
64
  compileOptions {
50
- sourceCompatibility JavaVersion.VERSION_1_8
51
- targetCompatibility JavaVersion.VERSION_1_8
65
+ sourceCompatibility JavaVersion.VERSION_11
66
+ targetCompatibility JavaVersion.VERSION_11
67
+ }
68
+
69
+ kotlinOptions {
70
+ jvmTarget = JavaVersion.VERSION_11.majorVersion
52
71
  }
53
72
 
54
73
  defaultConfig {
55
74
  minSdkVersion safeExtGet("minSdkVersion", 21)
56
- targetSdkVersion safeExtGet("targetSdkVersion", 30)
75
+ targetSdkVersion safeExtGet("targetSdkVersion", 31)
57
76
  versionCode 31
58
- versionName "11.1.2"
77
+ versionName "11.2.0"
59
78
  }
60
79
 
61
80
  sourceSets.main {
@@ -71,5 +90,5 @@ dependencies {
71
90
  implementation project(':expo-gl-cpp')
72
91
  implementation project(':expo-modules-core')
73
92
 
74
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.4.21')}"
93
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
75
94
  }
package/build/Canvas.d.ts CHANGED
@@ -4,3 +4,4 @@ declare const CanvasWrapper: React.FunctionComponent<ViewProps & {
4
4
  canvasRef: React.Ref<HTMLCanvasElement>;
5
5
  }>;
6
6
  export default CanvasWrapper;
7
+ //# sourceMappingURL=Canvas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Canvas.d.ts","sourceRoot":"","sources":["../src/Canvas.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAmD,SAAS,EAAE,MAAM,cAAc,CAAC;AA2B1F,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAC1C,SAAS,GAAG;IACV,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;CACzC,CAyEF,CAAC;AAEF,eAAe,aAAa,CAAC"}
package/build/Canvas.js CHANGED
@@ -7,7 +7,7 @@ function getElement(component) {
7
7
  try {
8
8
  return findDOMNode(component);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,GACF,GAAG,KAAK,CAAC;QAEV,IAAI,KAAK,KAAK,IAAI,EAAE,KAAK,IAAI,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE;YACnD,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;YAE3B,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;aACvB;SACF;IACH,CAAC,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,GAAG,CAAC,OAAO,IAAI,IAAI,EAAE;YACvB,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;SACpB;IACH,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,gBAAgB,EAAE,CAAC;IACrB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC;QAClC,IAAI,MAAM,EAAE;YACV,gBAAgB,EAAE,CAAC;SACpB;QACD,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAClC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,OAAO,CACL,oBAAC,IAAI,OAAK,KAAK,EAAE,aAAa,EAAC,UAAU,EAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ;QACpE,oBAAC,MAAM,IAAC,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,CAAC,YAAY,GAAI;QACxF,QAAQ,CACJ,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { Platform } from 'expo-modules-core';\nimport * as React from 'react';\nimport { findDOMNode } from 'react-dom';\nimport { LayoutChangeEvent, PixelRatio, StyleSheet, View, ViewProps } from 'react-native';\nimport createElement from 'react-native-web/dist/exports/createElement';\n\nfunction getElement(component) {\n try {\n return findDOMNode(component);\n } catch (e) {\n return component;\n }\n}\n\nfunction setRef<T>(refProp: React.Ref<T>, ref: T | null) {\n if (!refProp) return;\n\n if (typeof refProp === 'function') {\n refProp(ref);\n } else if ('current' in refProp) {\n // @ts-ignore\n refProp.current = ref;\n }\n}\n\nconst Canvas = React.forwardRef(\n (props: React.ComponentProps<typeof View>, ref: React.Ref<HTMLCanvasElement>) =>\n createElement('canvas', { ...props, ref })\n);\n\nconst CanvasWrapper: React.FunctionComponent<\n ViewProps & {\n canvasRef: React.Ref<HTMLCanvasElement>;\n }\n> = ({ pointerEvents, children, ...props }) => {\n const [size, setSize] = React.useState<{ width: number; height: number } | null>(null);\n\n const ref = React.useRef<View>(null);\n const _canvasRef = React.useRef<HTMLCanvasElement>(null);\n\n function updateCanvasSize(): void {\n const canvas = _canvasRef.current;\n // eslint-disable-next-line no-undef\n if (typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement) {\n const size = getSize();\n const scale = PixelRatio.get();\n\n canvas.style.width = `${size.width}px`;\n canvas.style.height = `${size.height}px`;\n\n canvas.width = size.width * scale;\n canvas.height = size.height * scale;\n }\n }\n\n function getSize(): { width: number; height: number } {\n if (size) {\n return size;\n } else if (!ref.current || !Platform.isDOMAvailable) {\n return { width: 0, height: 0 };\n }\n const element = getElement(ref.current);\n const { offsetWidth: width = 0, offsetHeight: height = 0 } = element;\n return { width, height };\n }\n\n const onLayout = (event: LayoutChangeEvent) => {\n const {\n nativeEvent: {\n layout: { width, height },\n },\n } = event;\n\n if (width !== size?.width || height !== size.height) {\n setSize({ width, height });\n\n if (props.onLayout) {\n props.onLayout(event);\n }\n }\n };\n\n React.useEffect(() => {\n if (ref.current != null) {\n setSize(getSize());\n }\n }, [ref]);\n\n React.useEffect(() => {\n updateCanvasSize();\n }, [size]);\n\n React.useEffect(() => {\n const canvas = _canvasRef.current;\n if (canvas) {\n updateCanvasSize();\n }\n setRef(props.canvasRef, canvas);\n }, [_canvasRef]);\n\n return (\n <View {...props} pointerEvents=\"box-none\" ref={ref} onLayout={onLayout}>\n <Canvas ref={_canvasRef} pointerEvents={pointerEvents} style={StyleSheet.absoluteFill} />\n {children}\n </View>\n );\n};\n\nexport default CanvasWrapper;\n"]}
1
+ {"version":3,"file":"Canvas.js","sourceRoot":"","sources":["../src/Canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAqB,UAAU,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAC;AAC1F,OAAO,aAAa,MAAM,6CAA6C,CAAC;AAExE,SAAS,UAAU,CAAC,SAAS;IAC3B,IAAI;QACF,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;KAC/B;IAAC,MAAM;QACN,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AAED,SAAS,MAAM,CAAI,OAAqB,EAAE,GAAa;IACrD,IAAI,CAAC,OAAO;QAAE,OAAO;IAErB,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;QACjC,OAAO,CAAC,GAAG,CAAC,CAAC;KACd;SAAM,IAAI,SAAS,IAAI,OAAO,EAAE;QAC/B,aAAa;QACb,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC;KACvB;AACH,CAAC;AAED,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAC7B,CAAC,KAAwC,EAAE,GAAiC,EAAE,EAAE,CAC9E,aAAa,CAAC,QAAQ,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,CAAC,CAC7C,CAAC;AAEF,MAAM,aAAa,GAIf,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE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ACJ,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { Platform } from 'expo-modules-core';\nimport * as React from 'react';\nimport { findDOMNode } from 'react-dom';\nimport { LayoutChangeEvent, PixelRatio, StyleSheet, View, ViewProps } from 'react-native';\nimport createElement from 'react-native-web/dist/exports/createElement';\n\nfunction getElement(component) {\n try {\n return findDOMNode(component);\n } catch {\n return component;\n }\n}\n\nfunction setRef<T>(refProp: React.Ref<T>, ref: T | null) {\n if (!refProp) return;\n\n if (typeof refProp === 'function') {\n refProp(ref);\n } else if ('current' in refProp) {\n // @ts-ignore\n refProp.current = ref;\n }\n}\n\nconst Canvas = React.forwardRef(\n (props: React.ComponentProps<typeof View>, ref: React.Ref<HTMLCanvasElement>) =>\n createElement('canvas', { ...props, ref })\n);\n\nconst CanvasWrapper: React.FunctionComponent<\n ViewProps & {\n canvasRef: React.Ref<HTMLCanvasElement>;\n }\n> = ({ pointerEvents, children, ...props }) => {\n const [size, setSize] = React.useState<{ width: number; height: number } | null>(null);\n\n const ref = React.useRef<View>(null);\n const _canvasRef = React.useRef<HTMLCanvasElement>(null);\n\n function updateCanvasSize(): void {\n const canvas = _canvasRef.current;\n // eslint-disable-next-line no-undef\n if (typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement) {\n const size = getSize();\n const scale = PixelRatio.get();\n\n canvas.style.width = `${size.width}px`;\n canvas.style.height = `${size.height}px`;\n\n canvas.width = size.width * scale;\n canvas.height = size.height * scale;\n }\n }\n\n function getSize(): { width: number; height: number } {\n if (size) {\n return size;\n } else if (!ref.current || !Platform.isDOMAvailable) {\n return { width: 0, height: 0 };\n }\n const element = getElement(ref.current);\n const { offsetWidth: width = 0, offsetHeight: height = 0 } = element;\n return { width, height };\n }\n\n const onLayout = (event: LayoutChangeEvent) => {\n const {\n nativeEvent: {\n layout: { width, height },\n },\n } = event;\n\n if (width !== size?.width || height !== size.height) {\n setSize({ width, height });\n\n if (props.onLayout) {\n props.onLayout(event);\n }\n }\n };\n\n React.useEffect(() => {\n if (ref.current != null) {\n setSize(getSize());\n }\n }, [ref]);\n\n React.useEffect(() => {\n updateCanvasSize();\n }, [size]);\n\n React.useEffect(() => {\n const canvas = _canvasRef.current;\n if (canvas) {\n updateCanvasSize();\n }\n setRef(props.canvasRef, canvas);\n }, [_canvasRef]);\n\n return (\n <View {...props} pointerEvents=\"box-none\" ref={ref} onLayout={onLayout}>\n <Canvas ref={_canvasRef} pointerEvents={pointerEvents} style={StyleSheet.absoluteFill} />\n {children}\n </View>\n );\n};\n\nexport default CanvasWrapper;\n"]}
@@ -7,3 +7,4 @@ declare const _default: {
7
7
  37442: string;
8
8
  };
9
9
  export default _default;
10
+ //# sourceMappingURL=GLErrors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GLErrors.d.ts","sourceRoot":"","sources":["../src/GLErrors.ts"],"names":[],"mappings":";;;;;;;;AAAA,wBAOE"}
@@ -3,3 +3,4 @@ import { ExpoWebGLRenderingContext } from './GLView.types';
3
3
  * Sets up `__expoSetLogging` method providing some logging options useful when debugging GL calls.
4
4
  */
5
5
  export declare function configureLogging(gl: ExpoWebGLRenderingContext): void;
6
+ //# sourceMappingURL=GLUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GLUtils.d.ts","sourceRoot":"","sources":["../src/GLUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAmB,MAAM,gBAAgB,CAAC;AAO5E;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,yBAAyB,GAAG,IAAI,CAgFpE"}
package/build/GLView.d.ts CHANGED
@@ -40,3 +40,4 @@ export declare class GLView extends React.Component<GLViewProps> {
40
40
  destroyObjectAsync(glObject: WebGLObject): Promise<boolean>;
41
41
  takeSnapshotAsync(options?: SnapshotOptions): Promise<GLSnapshot>;
42
42
  }
43
+ //# sourceMappingURL=GLView.d.ts.map
@@ -0,0 +1 @@
1
+ {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CAAC,GAAG,CAAC;IAOnC,wBAAwB,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;IAmBrF,kBAAkB,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAO3D,iBAAiB,CAAC,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;CAO5E"}
@@ -75,3 +75,4 @@ export declare enum GLLoggingOption {
75
75
  */
76
76
  ALL = 15
77
77
  }
78
+ //# sourceMappingURL=GLView.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GLView.types.d.ts","sourceRoot":"","sources":["../src/GLView.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,oBAAY,kBAAkB,GAAG;IAC/B,WAAW,EAAE;QACX,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,IAAI,CAAC,EAAE;QACL,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,WAAW,yBAA0B,SAAQ,sBAAsB;IACvE,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,IAAI,IAAI,CAAC;IACpB,QAAQ,IAAI,IAAI,CAAC;IACjB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;CACjD;AAED,oBAAY,iBAAiB,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;AAE1F;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD;;;OAGG;IACH,eAAe,CAAC,EAAE,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAErD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,oBAAY,eAAe;IACzB;;OAEG;IACH,QAAQ,IAAI;IAEZ;;OAEG;IACH,YAAY,IAAI;IAEhB;;;OAGG;IACH,UAAU,IAAI;IAEd;;OAEG;IACH,iBAAiB,IAAI;IAErB;;;OAGG;IACH,gBAAgB,IAAI;IAEpB;;OAEG;IACH,GAAG,KAAmE;CACvE"}
@@ -34,3 +34,4 @@ export declare class GLView extends React.Component<GLViewProps> {
34
34
  createCameraTextureAsync(): Promise<void>;
35
35
  destroyObjectAsync(glObject: WebGLObject): Promise<void>;
36
36
  }
37
+ //# sourceMappingURL=GLView.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GLView.web.d.ts","sourceRoot":"","sources":["../src/GLView.web.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EACL,eAAe,EACf,iBAAiB,EAEjB,UAAU,EACV,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAmExB,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD,eAAe,EAAE,CAAC,EAAE,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACrD,iBAAiB,CAAC,EAAE,CAAC,EA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@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
package/build/types.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export interface WebGLObject {
2
2
  }
3
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;CAAG"}
@@ -6,30 +6,30 @@
6
6
  <array>
7
7
  <dict>
8
8
  <key>LibraryIdentifier</key>
9
- <string>ios-arm64</string>
9
+ <string>ios-arm64_x86_64-simulator</string>
10
10
  <key>LibraryPath</key>
11
11
  <string>EXGL.framework</string>
12
12
  <key>SupportedArchitectures</key>
13
13
  <array>
14
14
  <string>arm64</string>
15
+ <string>x86_64</string>
15
16
  </array>
16
17
  <key>SupportedPlatform</key>
17
18
  <string>ios</string>
19
+ <key>SupportedPlatformVariant</key>
20
+ <string>simulator</string>
18
21
  </dict>
19
22
  <dict>
20
23
  <key>LibraryIdentifier</key>
21
- <string>ios-arm64_x86_64-simulator</string>
24
+ <string>ios-arm64</string>
22
25
  <key>LibraryPath</key>
23
26
  <string>EXGL.framework</string>
24
27
  <key>SupportedArchitectures</key>
25
28
  <array>
26
29
  <string>arm64</string>
27
- <string>x86_64</string>
28
30
  </array>
29
31
  <key>SupportedPlatform</key>
30
32
  <string>ios</string>
31
- <key>SupportedPlatformVariant</key>
32
- <string>simulator</string>
33
33
  </dict>
34
34
  </array>
35
35
  <key>CFBundlePackageType</key>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-gl",
3
- "version": "11.1.2",
3
+ "version": "11.2.0",
4
4
  "description": "Provides GLView that acts as OpenGL ES render target and gives GL context object implementing WebGL 2.0 specification.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -37,7 +37,7 @@
37
37
  "preset": "expo-module-scripts"
38
38
  },
39
39
  "dependencies": {
40
- "expo-gl-cpp": "~11.1.0",
40
+ "expo-gl-cpp": "~11.2.0",
41
41
  "invariant": "^2.2.4"
42
42
  },
43
43
  "devDependencies": {
@@ -45,10 +45,10 @@
45
45
  "@types/offscreencanvas": "2019.6.4",
46
46
  "@types/webgl2": "^0.0.6",
47
47
  "expo-module-scripts": "^2.0.0",
48
- "react-test-renderer": "~17.0.1"
48
+ "react-test-renderer": "~17.0.2"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "expo": "*"
52
52
  },
53
- "gitHead": "ba24eba18bf4f4d4b0d54828992d81a2bb18246a"
53
+ "gitHead": "22dce752354bb429c84851bc4389abe47a766b1f"
54
54
  }
package/src/Canvas.tsx CHANGED
@@ -7,7 +7,7 @@ import createElement from 'react-native-web/dist/exports/createElement';
7
7
  function getElement(component) {
8
8
  try {
9
9
  return findDOMNode(component);
10
- } catch (e) {
10
+ } catch {
11
11
  return component;
12
12
  }
13
13
  }