From 29bebfc684ff04fc90dd86f5889b46080533c589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Thu, 19 May 2016 22:26:48 +0200 Subject: [PATCH] migrate to RN 0.25.0 --- README.md | 4 ++-- RNGL.podspec | 2 +- example/.flowconfig | 2 +- example/ios/example.xcodeproj/project.pbxproj | 4 ++-- example/package.json | 9 ++++----- example/src/AdvancedEffects/Banner.js | 2 +- example/src/AdvancedEffects/Intro.js | 6 +++--- example/src/AdvancedEffects/Slideshow.js | 3 ++- example/src/AdvancedEffects/Transition.js | 5 +++-- example/src/AdvancedEffects/Vignette.js | 2 +- example/src/AdvancedEffects/index.js | 6 ++---- example/src/Hearts/index.js | 7 ++----- example/src/Simple/AnimatedHelloGL.js | 3 ++- example/src/Simple/Button.js | 9 ++------- example/src/Simple/OneFingerResponse.js | 5 +++-- example/src/Simple/index.js | 11 ++--------- example/src/Tests/NativeLayer.js | 3 ++- example/src/Tests/index.js | 8 ++------ example/src/index.js | 12 ++---------- src/GLCanvas.captureFrame.android.js | 2 +- src/GLCanvas.captureFrame.ios.js | 8 +++----- src/GLCanvas.js | 8 +++----- src/Surface.js | 6 ++---- src/index.js | 2 +- 24 files changed, 49 insertions(+), 80 deletions(-) diff --git a/README.md b/README.md index e15bcc9..5634fbe 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ **[Gitbook documentation](http://projectseptemberinc.gitbooks.io/gl-react/content/) / [Github](https://github.com/ProjectSeptemberInc/gl-react-native/) / [gl-react](https://github.com/ProjectSeptemberInc/gl-react/)** / [#gl-react on reactiflux](https://discordapp.com/channels/102860784329052160/106102146109325312) -# icon gl-react-native ![](https://img.shields.io/badge/react--native-%200.21.x-05F561.svg) ![](https://img.shields.io/badge/gl--react-%202.2.x-05F561.svg) +# icon gl-react-native ![](https://img.shields.io/badge/react--native-%200.25.x-05F561.svg) ![](https://img.shields.io/badge/gl--react-%202.2.x-05F561.svg) OpenGL bindings for React Native to implement complex effects over images and components, in the descriptive VDOM paradigm. @@ -50,7 +50,7 @@ import com.projectseptember.RNGL.RNGLPackage; @Override protected List getPackages() { return Arrays.asList( - new MainReactPackage(), + new MainReactPackage(), ... new RNGLPackage() ); diff --git a/RNGL.podspec b/RNGL.podspec index 89827cc..1fd74de 100644 --- a/RNGL.podspec +++ b/RNGL.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "RNGL" - s.version = "2.24.0" + s.version = "2.25.0" s.homepage = "https://github.com/ProjectSeptemberInc/gl-react-native" s.platform = :ios, "8.0" s.source = { :git => "https://github.com/ProjectSeptemberInc/gl-react-native.git" } diff --git a/example/.flowconfig b/example/.flowconfig index cbd0785..f4e32c6 100644 --- a/example/.flowconfig +++ b/example/.flowconfig @@ -22,7 +22,7 @@ .*/node_modules/fbjs/lib/crc32.js .*/node_modules/fbjs/lib/ErrorUtils.js -# Flow has a built-in definition for the 'react' module which we prefer to use +# Flow has a built-in definition for the "react" module which we prefer to use # over the currently-untyped source .*/node_modules/react/react.js .*/node_modules/react/lib/React.js diff --git a/example/ios/example.xcodeproj/project.pbxproj b/example/ios/example.xcodeproj/project.pbxproj index a146101..e006a93 100644 --- a/example/ios/example.xcodeproj/project.pbxproj +++ b/example/ios/example.xcodeproj/project.pbxproj @@ -23,7 +23,7 @@ 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 3469C4C71C723AD300AE6E0E /* libRCTMaterialKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3469C4C61C723AC400AE6E0E /* libRCTMaterialKit.a */; }; 3469C4C81C723AD300AE6E0E /* libRNFS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3469C4C01C723ABC00AE6E0E /* libRNFS.a */; }; - 3469C4C91C723AD300AE6E0E /* libRNGL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3469C4BA1C723AB400AE6E0E /* libRNGL.a */; }; + 34BA81381CEDCC6100FCF175 /* libRNGL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3469C4BA1C723AB400AE6E0E /* libRNGL.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; /* End PBXBuildFile section */ @@ -167,9 +167,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 34BA81381CEDCC6100FCF175 /* libRNGL.a in Frameworks */, 3469C4C71C723AD300AE6E0E /* libRCTMaterialKit.a in Frameworks */, 3469C4C81C723AD300AE6E0E /* libRNFS.a in Frameworks */, - 3469C4C91C723AD300AE6E0E /* libRNGL.a in Frameworks */, 146834051AC3E58100842450 /* libReact.a in Frameworks */, 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, diff --git a/example/package.json b/example/package.json index 593706b..95d7191 100644 --- a/example/package.json +++ b/example/package.json @@ -7,15 +7,14 @@ }, "dependencies": { "crypto": "0.0.3", - "fbjs": "^0.6.1", "gl-react": "^2.2.0", "gl-react-blur": "^1.2.2", "gl-react-native": "file:..", "glsl-transitions": "^2016.2.15", - "react": "^0.14.7", - "react-native": "^0.24.0", - "react-native-fs": "^1.2.0", - "react-native-material-kit": "^0.3.0", + "react": "^0.14.8", + "react-native": "^0.25.1", + "react-native-fs": "^1.4.0", + "react-native-material-kit": "PyYoshi/react-native-material-kit#rn-0.25.1", "react-transform-hmr": "^1.0.2", "seedrandom": "gre/seedrandom#released" } diff --git a/example/src/AdvancedEffects/Banner.js b/example/src/AdvancedEffects/Banner.js index 179c192..5af5f93 100644 --- a/example/src/AdvancedEffects/Banner.js +++ b/example/src/AdvancedEffects/Banner.js @@ -1,4 +1,4 @@ -import React from "react-native"; +import React from "react"; import GL from "gl-react"; import {Surface} from "gl-react-native"; const shaders = GL.Shaders.create({ diff --git a/example/src/AdvancedEffects/Intro.js b/example/src/AdvancedEffects/Intro.js index b68b3a3..8494efe 100644 --- a/example/src/AdvancedEffects/Intro.js +++ b/example/src/AdvancedEffects/Intro.js @@ -1,8 +1,8 @@ -import React from "react-native"; -const { +import React from "react"; +import { View, Text, -} = React; +} from "react-native"; import GL from "gl-react"; import {Surface} from "gl-react-native"; diff --git a/example/src/AdvancedEffects/Slideshow.js b/example/src/AdvancedEffects/Slideshow.js index 19d335c..51a7c68 100644 --- a/example/src/AdvancedEffects/Slideshow.js +++ b/example/src/AdvancedEffects/Slideshow.js @@ -1,4 +1,5 @@ -import React, { View, Text, StyleSheet } from "react-native"; +import React from "react"; +import {View, Text, StyleSheet} from "react-native"; import GL from "gl-react"; import {Surface} from "gl-react-native"; import TransitionGenerator from "./TransitionGenerator"; diff --git a/example/src/AdvancedEffects/Transition.js b/example/src/AdvancedEffects/Transition.js index 8e507b4..1e1bb32 100644 --- a/example/src/AdvancedEffects/Transition.js +++ b/example/src/AdvancedEffects/Transition.js @@ -1,9 +1,10 @@ -import React from "react-native"; +import {PixelRatio} from "react-native"; +import React from "react"; import GL from "gl-react"; module.exports = GL.createComponent( ({ width, height, shader, progress, from, to, uniforms }) => { - const scale = React.PixelRatio.get(); + const scale = PixelRatio.get(); return UIManager.measure( - React.findNodeHandle(this.refs.surface), + findNodeHandle(this.refs.surface), (a, b, w, h, x, y) => this.setState({ pressed: 1, diff --git a/example/src/Simple/index.js b/example/src/Simple/index.js index 6fa741c..8aa63ca 100644 --- a/example/src/Simple/index.js +++ b/example/src/Simple/index.js @@ -1,12 +1,5 @@ -import React, { - StyleSheet, - Text, - View, - Image, - TextInput, - Component, - TouchableOpacity, -} from "react-native"; +import React, {Component} from "react"; +import {StyleSheet, Text, View, Image, TextInput, TouchableOpacity} from "react-native"; import { Surface } from "gl-react-native"; diff --git a/example/src/Tests/NativeLayer.js b/example/src/Tests/NativeLayer.js index 2b89084..376f5b6 100644 --- a/example/src/Tests/NativeLayer.js +++ b/example/src/Tests/NativeLayer.js @@ -1,4 +1,5 @@ -import React, { View } from "react-native"; +import React from "react"; +import {View} from "react-native"; class NativeLayer extends React.Component { render () { diff --git a/example/src/Tests/index.js b/example/src/Tests/index.js index 70db20b..e42bcae 100644 --- a/example/src/Tests/index.js +++ b/example/src/Tests/index.js @@ -1,9 +1,5 @@ -import React, { - Text, - View, - ScrollView, - Image, -} from "react-native"; +import React from "react"; +import {Text, View, ScrollView, Image} from "react-native"; import {Surface} from "gl-react-native"; import {Blur} from "gl-react-blur"; import Add from "./Add"; diff --git a/example/src/index.js b/example/src/index.js index b80079d..56b99fa 100644 --- a/example/src/index.js +++ b/example/src/index.js @@ -1,13 +1,5 @@ -import React, { - StyleSheet, - Component, - View, - PropTypes, - Text, - TouchableOpacity, - Navigator, - AsyncStorage, -} from "react-native"; +import React, {Component, PropTypes} from "react"; +import {StyleSheet, View, Text, TouchableOpacity, Navigator, AsyncStorage} from "react-native"; const screens = { Simple: require("./Simple"), diff --git a/src/GLCanvas.captureFrame.android.js b/src/GLCanvas.captureFrame.android.js index 2c24195..bdbabbd 100644 --- a/src/GLCanvas.captureFrame.android.js +++ b/src/GLCanvas.captureFrame.android.js @@ -7,7 +7,7 @@ invariant(GLCanvas, Make sure you have properly configured it. See README install instructions. -React.NativeModules.UIManager.GLCanvas is %s`, GLCanvas); +NativeModules.UIManager.GLCanvas is %s`, GLCanvas); const {Commands} = GLCanvas; module.exports = (handle, config) => UIManager.dispatchViewManagerCommand(handle, Commands.captureFrame, [ config ]); diff --git a/src/GLCanvas.captureFrame.ios.js b/src/GLCanvas.captureFrame.ios.js index fac4a0d..a8f8387 100644 --- a/src/GLCanvas.captureFrame.ios.js +++ b/src/GLCanvas.captureFrame.ios.js @@ -1,13 +1,11 @@ import invariant from "invariant"; -import React from "react-native"; -const { - NativeModules: { GLCanvasManager } -} = React; +import { NativeModules } from "react-native"; +const { GLCanvasManager } = NativeModules; invariant(GLCanvasManager, `gl-react-native: the native module is not available. Make sure you have properly configured it. See README install instructions. -React.NativeModules.GLCanvasManager is %s`, GLCanvasManager); +NativeModules.GLCanvasManager is %s`, GLCanvasManager); module.exports = (handle, config) => GLCanvasManager.capture(handle, config); diff --git a/src/GLCanvas.js b/src/GLCanvas.js index 4696991..1297b9e 100644 --- a/src/GLCanvas.js +++ b/src/GLCanvas.js @@ -1,8 +1,6 @@ import invariant from "invariant"; -import React, { - Component, - requireNativeComponent, -} from "react-native"; +import React, {Component} from "react"; +import {requireNativeComponent, findNodeHandle} from "react-native"; import defer from "promise-defer"; import captureFrame from "./GLCanvas.captureFrame"; @@ -36,7 +34,7 @@ class GLCanvas extends Component { _addPendingCaptureFrame (config) { const key = serializeOption(config); return this._pendingCaptureFrame[key] || ( - (captureFrame(React.findNodeHandle(this.refs.native), config), + (captureFrame(findNodeHandle(this.refs.native), config), this._pendingCaptureFrame[key] = defer()) ); } diff --git a/src/Surface.js b/src/Surface.js index 79b279c..88f95a8 100644 --- a/src/Surface.js +++ b/src/Surface.js @@ -1,9 +1,7 @@ import invariant from "invariant"; import {createSurface} from "gl-react"; -import React, { - View, - PixelRatio -} from "react-native"; +import React from "react"; +import {View, PixelRatio} from "react-native"; import GLCanvas from "./GLCanvas"; invariant(typeof createSurface === "function", diff --git a/src/index.js b/src/index.js index 7dcbe04..436871f 100644 --- a/src/index.js +++ b/src/index.js @@ -8,7 +8,7 @@ invariant(RNGLContext, Make sure you have properly configured it. See README install instructions. -React.NativeModules.RNGLContext is %s`, RNGLContext); +NativeModules.RNGLContext is %s`, RNGLContext); // Hook Shaders to RNGLContext Shaders.setImplementation({ -- 2.26.2