From 5f6a6a14bdd751bc467742e11d17bfe3667fc104 Mon Sep 17 00:00:00 2001 From: Brenton Simpson Date: Sat, 28 Feb 2015 10:28:29 -0800 Subject: [PATCH 01/79] Copy editing Corrected spelling and punctuation; simplified some language. --- docs/Text.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/Text.md b/docs/Text.md index f830582c9..a40f2d97b 100644 --- a/docs/Text.md +++ b/docs/Text.md @@ -13,7 +13,7 @@ In iOS, the way to display formatted text is by using `NSAttributedString`: you ``` -Behind the scenes, this is going to be converted to a flat NSAttributedString that contains the following information +Behind the scenes, this is going to be converted to a flat `NSAttributedString` that contains the following information ```javascript "I am bold and red" @@ -23,7 +23,7 @@ Behind the scenes, this is going to be converted to a flat NSAttributedString th ## Containers -The `` element is special relative to layout, everything inside is no longer using the flexbox layout but using text layout. This means that elements inside of a `` are no longer rectangles but wrap when they see the end of the line. +The `` element is special relative to layout: everything inside is no longer using the flexbox layout but using text layout. This means that elements inside of a `` are no longer rectangles, but wrap when they see the end of the line. ```javascript @@ -47,7 +47,7 @@ The `` element is special relative to layout, everything inside is no long ## Limited Style Inheritance -On the web, the usual way to set a font family and size for the entire document is to write +On the web, the usual way to set a font family and size for the entire document is to write: ```css /* CSS, *not* React Native */ @@ -58,9 +58,9 @@ html { } ``` -When the browser is trying to render a text node, it's going to go all the way up to the root element of the tree and find an element with a `font-size` attribute. An unexpected property with this system is that **any** node can have `font-size` attribute, including a `
`. The reason why it was designed this way is that it is convenient, even though not really semantically correct. +When the browser is trying to render a text node, it's going to go all the way up to the root element of the tree and find an element with a `font-size` attribute. An unexpected property of this system is that **any** node can have `font-size` attribute, including a `
`. This was designed for convenience, even though not really semantically correct. -In React Native, we are more strict about it. The first place where it'll show up is that you have to wrap all the text nodes inside of a `` component. It is not allowed to have a text node directly under a ``. +In React Native, we are more strict about it: **you must wrap all the text nodes inside of a `` component**; you cannot have a text node directly under a ``. ```javascript // BAD: will fatal, can't have a text node as child of a @@ -76,7 +76,7 @@ In React Native, we are more strict about it. The first place where it'll show u ``` -You also lose the ability to setup a default font for an entire subtree. The recommended way to use consistent fonts and sizes across your application is to create a component `MyAppText` that's going to set them and use this component all across your app. You can also make other components such as `MyAppHeaderText` for other kind of texts. +You also lose the ability to set up a default font for an entire subtree. The recommended way to use consistent fonts and sizes across your application is to create a component `MyAppText` that includes them and use this component across your app. You can also use this component to make more specific components like `MyAppHeaderText` for other kinds of text. ```javascript @@ -96,8 +96,8 @@ React Native still has the concept of style inheritance, but limited to text sub ``` -We believe that this more constrained way to style text will yield better apps. +We believe that this more constrained way to style text will yield better apps: -- (Developper) React components are designed with strong isolation properties in mind, you should be able to drop a component anywhere in your application and it will look and behave the same way, as long as the props are the same. Having text properties be inherited from outside of the props breaks isolation. +- (Developer) React components are designed with strong isolation in mind: You should be able to drop a component anywhere in your application, trusting that as long as the props are the same, it will look and behave the same way. Text properties that could inherit from outside of the props would break this isolation. -- (Implementor) The implementation of React Native is also simplified. We do not need to have a `fontFamily` field on every single element and we do not need to potentially traverse the tree up to the root every time we display a text node. The style inheritance is only encoded inside of the native Text component and doesn't leak to other components or the system itself. +- (Implementor) The implementation of React Native is also simplified. We do not need to have a `fontFamily` field on every single element, and we do not need to potentially traverse the tree up to the root every time we display a text node. The style inheritance is only encoded inside of the native Text component and doesn't leak to other components or the system itself. From 9bebc7e519f1bb03a8d2960727682bb2ca0af9fa Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Mon, 2 Mar 2015 10:42:31 -0800 Subject: [PATCH 02/79] Updates from Wed Feb 25 - [react-packager] Fix lint errors | Amjad Masad - [react-packager] fix a typo s/pacakge/package | Chengyin Liu - [react-packager] Fix jest tests | Amjad Masad - [Image] Really improve the quality of mis-sized images w/trilinear filtering | James Ide --- .eslintrc | 7 +- ReactKit/Views/RCTNetworkImageView.m | 4 + ReactKit/Views/RCTStaticImage.m | 4 + jestSupport/env.js | 5 ++ jestSupport/scriptPreprocess.js | 4 + package.json | 9 +- packager/react-packager/, | 0 packager/react-packager/.jshintrc | 86 ------------------- packager/react-packager/package.json | 14 --- .../src/Activity/__tests__/Activity-test.js | 2 + packager/react-packager/src/Activity/index.js | 2 + .../DependencyResolver/ModuleDescriptor.js | 4 +- .../__tests__/DependencyGraph-test.js | 80 +++++++++++++---- .../haste/DependencyGraph/docblock.js | 10 ++- .../haste/DependencyGraph/example.js | 25 ------ .../haste/DependencyGraph/index.js | 9 +- .../__tests__/HasteDependencyResolver-test.js | 13 ++- .../src/DependencyResolver/haste/index.js | 24 +++--- .../haste/polyfills/console.js | 10 ++- .../haste/polyfills/error-guard.js | 2 +- .../haste/polyfills/polyfills.js | 2 +- .../haste/polyfills/prelude.js | 1 + .../haste/polyfills/prelude_dev.js | 1 + .../haste/polyfills/require.js | 1 + .../src/DependencyResolver/index.js | 2 + .../src/DependencyResolver/node/index.js | 13 +-- .../FileWatcher/__tests__/FileWatcher-test.js | 10 ++- .../react-packager/src/JSTransformer/Cache.js | 16 ++-- .../src/JSTransformer/__tests__/Cache-test.js | 1 - .../react-packager/src/JSTransformer/index.js | 7 +- .../react-packager/src/Packager/Package.js | 3 +- .../src/Packager/__mocks__/source-map.js | 5 -- .../src/Packager/__tests__/Package-test.js | 16 ++-- .../react-packager/src/Packager/base64-vlq.js | 9 +- .../src/Server/__tests__/Server-test.js | 78 +++++++++-------- packager/react-packager/src/Server/index.js | 4 +- .../react-packager/src/fb-path-utils/index.js | 14 --- .../src/lib/__mocks__/declareOpts.js | 2 + .../src/lib/__tests__/declareOpts-test.js | 2 + .../react-packager/src/lib/declareOpts.js | 2 + 40 files changed, 227 insertions(+), 276 deletions(-) create mode 100644 jestSupport/env.js delete mode 100644 packager/react-packager/, delete mode 100644 packager/react-packager/.jshintrc delete mode 100644 packager/react-packager/package.json delete mode 100644 packager/react-packager/src/DependencyResolver/haste/DependencyGraph/example.js delete mode 100644 packager/react-packager/src/Packager/__mocks__/source-map.js delete mode 100644 packager/react-packager/src/fb-path-utils/index.js diff --git a/.eslintrc b/.eslintrc index b037ffe48..9dd9df8a4 100644 --- a/.eslintrc +++ b/.eslintrc @@ -21,7 +21,7 @@ "Map": true, "module": false, "process": false, - "Promise": false, + "Promise": true, "requestAnimationFrame": true, "require": false, "Set": true, @@ -29,7 +29,8 @@ "setInterval": false, "setTimeout": false, "window": false, - "XMLHttpRequest": false + "XMLHttpRequest": false, + "pit": false }, "rules": { @@ -148,7 +149,7 @@ "no-multi-spaces": 0, "brace-style": 0, // enforce one true brace style (off by default) "camelcase": 0, // require camel case names - "consistent-this": 1, // enforces consistent naming when capturing the current execution context (off by default) + "consistent-this": [1, "self"], // enforces consistent naming when capturing the current execution context (off by default) "eol-last": 1, // enforce newline at the end of file, with no multiple empty lines "func-names": 0, // require function expressions to have a name (off by default) "func-style": 0, // enforces use of function declarations or expressions (off by default) diff --git a/ReactKit/Views/RCTNetworkImageView.m b/ReactKit/Views/RCTNetworkImageView.m index 2a739cea7..c0c6443cb 100644 --- a/ReactKit/Views/RCTNetworkImageView.m +++ b/ReactKit/Views/RCTNetworkImageView.m @@ -52,6 +52,8 @@ if (reset) { self.layer.contentsScale = _defaultImage.scale; self.layer.contents = (__bridge id)_defaultImage.CGImage; + self.layer.minificationFilter = kCAFilterTrilinear; + self.layer.magnificationFilter = kCAFilterTrilinear; } if ([imageURL.pathExtension caseInsensitiveCompare:@"gif"] == NSOrderedSame) { _downloadToken = [_imageDownloader downloadDataForURL:imageURL block:^(NSData *data, NSError *error) { @@ -61,6 +63,8 @@ self.layer.bounds = CGRectMake(0, 0, CGImageGetWidth(firstFrame), CGImageGetHeight(firstFrame)); self.layer.contentsScale = 1.0; self.layer.contentsGravity = kCAGravityResizeAspect; + self.layer.minificationFilter = kCAFilterLinear; + self.layer.magnificationFilter = kCAFilterLinear; [self.layer addAnimation:animation forKey:@"contents"]; } // TODO: handle errors diff --git a/ReactKit/Views/RCTStaticImage.m b/ReactKit/Views/RCTStaticImage.m index 829044de5..b57b763ed 100644 --- a/ReactKit/Views/RCTStaticImage.m +++ b/ReactKit/Views/RCTStaticImage.m @@ -20,6 +20,10 @@ if (!UIEdgeInsetsEqualToEdgeInsets(UIEdgeInsetsZero, _capInsets)) { image = [image resizableImageWithCapInsets:_capInsets resizingMode:UIImageResizingModeStretch]; } + + // Apply trilinear filtering to smooth out mis-sized images + self.layer.minificationFilter = kCAFilterTrilinear; + self.layer.magnificationFilter = kCAFilterTrilinear; super.image = image; } diff --git a/jestSupport/env.js b/jestSupport/env.js new file mode 100644 index 000000000..16f264feb --- /dev/null +++ b/jestSupport/env.js @@ -0,0 +1,5 @@ +'use strict'; + +global.setImmediate = global.setImmediate || function(fn) { + return setTimeout(fn, 0); +}; diff --git a/jestSupport/scriptPreprocess.js b/jestSupport/scriptPreprocess.js index 9231196c8..02d3f6341 100644 --- a/jestSupport/scriptPreprocess.js +++ b/jestSupport/scriptPreprocess.js @@ -10,6 +10,10 @@ module.exports = { transformSource: transformSource, process: function(src, fileName) { + if (fileName.match(/node_modules/)) { + return src; + } + try { return transformSource(src); } catch(e) { diff --git a/package.json b/package.json index 93a723ff5..322716b45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native", - "version": "0.0.1", + "version": "0.1.0", "description": "Build native apps with React!", "repository": { "type": "git", @@ -8,12 +8,15 @@ }, "jest": { "scriptPreprocessor": "jestSupport/scriptPreprocess.js", + "setupEnvScriptFile": "jestSupport/env.js", "testPathIgnorePatterns": [ - "/node_modules/", - "/packager/" + "/node_modules/" ], "testFileExtensions": [ "js" + ], + "unmockedModulePathPatterns": [ + "source-map" ] }, "scripts": { diff --git a/packager/react-packager/, b/packager/react-packager/, deleted file mode 100644 index e69de29bb..000000000 diff --git a/packager/react-packager/.jshintrc b/packager/react-packager/.jshintrc deleted file mode 100644 index 7a3f79a72..000000000 --- a/packager/react-packager/.jshintrc +++ /dev/null @@ -1,86 +0,0 @@ -{ - "-W093": true, - "asi": false, - "bitwise": true, - "boss": false, - "browser": false, - "camelcase": true, - "couch": false, - "curly": true, - "debug": false, - "devel": true, - "dojo": false, - "eqeqeq": true, - "eqnull": true, - "esnext": true, - "evil": false, - "expr": true, - "forin": false, - "freeze": true, - "funcscope": true, - "gcl": false, - "globals": { - "Promise": true, - "React": true, - "XMLHttpRequest": true, - "document": true, - "location": true, - "window": true - }, - "globalstrict": true, - "immed": false, - "indent": 2, - "iterator": false, - "jquery": false, - "lastsemic": false, - "latedef": false, - "laxbreak": true, - "laxcomma": false, - "loopfunc": false, - "maxcomplexity": false, - "maxdepth": false, - "maxerr": 50, - "maxlen": 80, - "maxparams": false, - "maxstatements": false, - "mootools": false, - "moz": false, - "multistr": false, - "newcap": true, - "noarg": true, - "node": true, - "noempty": false, - "nonbsp": true, - "nonew": true, - "nonstandard": false, - "notypeof": false, - "noyield": false, - "phantom": false, - "plusplus": false, - "predef": [ - "afterEach", - "beforeEach", - "describe", - "expect", - "it", - "jest", - "pit" - ], - "proto": false, - "prototypejs": false, - "quotmark": true, - "rhino": false, - "scripturl": false, - "shadow": false, - "smarttabs": false, - "strict": false, - "sub": false, - "supernew": false, - "trailing": true, - "undef": true, - "unused": true, - "validthis": false, - "worker": false, - "wsh": false, - "yui": false -} diff --git a/packager/react-packager/package.json b/packager/react-packager/package.json deleted file mode 100644 index 0ac47c257..000000000 --- a/packager/react-packager/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "react-packager", - "version": "0.1.0", - "description": "", - "main": "index.js", - "jest": { - "unmockedModulePathPatterns": [ - "source-map" - ], - "testPathIgnorePatterns": [ - "JSAppServer/node_modules" - ] - } -} diff --git a/packager/react-packager/src/Activity/__tests__/Activity-test.js b/packager/react-packager/src/Activity/__tests__/Activity-test.js index 7a2bdf481..bd0265f96 100644 --- a/packager/react-packager/src/Activity/__tests__/Activity-test.js +++ b/packager/react-packager/src/Activity/__tests__/Activity-test.js @@ -1,3 +1,5 @@ +'use strict'; + jest.autoMockOff(); describe('Activity', function() { diff --git a/packager/react-packager/src/Activity/index.js b/packager/react-packager/src/Activity/index.js index a60f87b08..611ccb0b1 100644 --- a/packager/react-packager/src/Activity/index.js +++ b/packager/react-packager/src/Activity/index.js @@ -1,3 +1,5 @@ +'use strict'; + var COLLECTION_PERIOD = 1000; var _endedEvents = Object.create(null); diff --git a/packager/react-packager/src/DependencyResolver/ModuleDescriptor.js b/packager/react-packager/src/DependencyResolver/ModuleDescriptor.js index 0898767a8..f1a30545c 100644 --- a/packager/react-packager/src/DependencyResolver/ModuleDescriptor.js +++ b/packager/react-packager/src/DependencyResolver/ModuleDescriptor.js @@ -1,3 +1,5 @@ +'use strict'; + function ModuleDescriptor(fields) { if (!fields.id) { throw new Error('Missing required fields id'); @@ -28,7 +30,7 @@ ModuleDescriptor.prototype.toJSON = function() { id: this.id, path: this.path, dependencies: this.dependencies - } + }; }; module.exports = ModuleDescriptor; diff --git a/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/__tests__/DependencyGraph-test.js b/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/__tests__/DependencyGraph-test.js index fe8a18b61..1c268c6b0 100644 --- a/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/__tests__/DependencyGraph-test.js +++ b/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/__tests__/DependencyGraph-test.js @@ -9,8 +9,6 @@ jest .dontMock('../docblock') .setMock('../../../ModuleDescriptor', function(data) {return data;}); -var q = require('q'); - describe('DependencyGraph', function() { var DependencyGraph; var fileWatcher; @@ -46,7 +44,10 @@ describe('DependencyGraph', function() { } }); - var dgraph = new DependencyGraph({roots: [root], fileWatcher: fileWatcher}); + var dgraph = new DependencyGraph({ + roots: [root], + fileWatcher: fileWatcher + }); return dgraph.load().then(function() { expect(dgraph.getOrderedDependencies('/root/index.js')) .toEqual([ @@ -75,7 +76,10 @@ describe('DependencyGraph', function() { } }); - var dgraph = new DependencyGraph({roots: [root], fileWatcher: fileWatcher}); + var dgraph = new DependencyGraph({ + roots: [root], + fileWatcher: fileWatcher + }); return dgraph.load().then(function() { expect(dgraph.getOrderedDependencies('/root/index.js')) .toEqual([ @@ -105,7 +109,10 @@ describe('DependencyGraph', function() { } }); - var dgraph = new DependencyGraph({roots: [root], fileWatcher: fileWatcher}); + var dgraph = new DependencyGraph({ + roots: [root], + fileWatcher: fileWatcher + }); return dgraph.load().then(function() { expect(dgraph.getOrderedDependencies('/root/index.js')) .toEqual([ @@ -135,7 +142,10 @@ describe('DependencyGraph', function() { } }); - var dgraph = new DependencyGraph({roots: [root], fileWatcher: fileWatcher}); + var dgraph = new DependencyGraph({ + roots: [root], + fileWatcher: fileWatcher + }); return dgraph.load().then(function() { expect(dgraph.getOrderedDependencies('/root/index.js')) .toEqual([ @@ -175,7 +185,10 @@ describe('DependencyGraph', function() { } }); - var dgraph = new DependencyGraph({roots: [root], fileWatcher: fileWatcher}); + var dgraph = new DependencyGraph({ + roots: [root], + fileWatcher: fileWatcher + }); return dgraph.load().then(function() { expect(dgraph.getOrderedDependencies('/root/somedir/somefile.js')) .toEqual([ @@ -216,7 +229,10 @@ describe('DependencyGraph', function() { } }); - var dgraph = new DependencyGraph({roots: [root], fileWatcher: fileWatcher}); + var dgraph = new DependencyGraph({ + roots: [root], + fileWatcher: fileWatcher + }); return dgraph.load().then(function() { expect(dgraph.getOrderedDependencies('/root/index.js')) .toEqual([ @@ -245,7 +261,10 @@ describe('DependencyGraph', function() { } }); - var dgraph = new DependencyGraph({roots: [root], fileWatcher: fileWatcher}); + var dgraph = new DependencyGraph({ + roots: [root], + fileWatcher: fileWatcher + }); return dgraph.load().then(function() { expect(dgraph.getOrderedDependencies('/root/index.js')) .toEqual([ @@ -280,7 +299,10 @@ describe('DependencyGraph', function() { } }); - var dgraph = new DependencyGraph({roots: [root], fileWatcher: fileWatcher}); + var dgraph = new DependencyGraph({ + roots: [root], + fileWatcher: fileWatcher + }); return dgraph.load().then(function() { expect(dgraph.getOrderedDependencies('/root/index.js')) .toEqual([ @@ -320,7 +342,10 @@ describe('DependencyGraph', function() { } }); - var dgraph = new DependencyGraph({roots: [root], fileWatcher: fileWatcher}); + var dgraph = new DependencyGraph({ + roots: [root], + fileWatcher: fileWatcher + }); return dgraph.load().then(function() { expect(dgraph.getOrderedDependencies('/root/index.js')) .toEqual([ @@ -360,7 +385,10 @@ describe('DependencyGraph', function() { } }); - var dgraph = new DependencyGraph({roots: [root], fileWatcher: fileWatcher}); + var dgraph = new DependencyGraph({ + roots: [root], + fileWatcher: fileWatcher + }); return dgraph.load().then(function() { expect(dgraph.getOrderedDependencies('/root/index.js')) .toEqual([ @@ -386,7 +414,6 @@ describe('DependencyGraph', function() { }); describe('file watch updating', function() { - var fileWatcher; var triggerFileChange; beforeEach(function() { @@ -428,7 +455,10 @@ describe('DependencyGraph', function() { } }); - var dgraph = new DependencyGraph({roots: [root], fileWatcher: fileWatcher}); + var dgraph = new DependencyGraph({ + roots: [root], + fileWatcher: fileWatcher + }); return dgraph.load().then(function() { filesystem.root['index.js'] = filesystem.root['index.js'].replace('require("foo")', ''); @@ -476,7 +506,10 @@ describe('DependencyGraph', function() { } }); - var dgraph = new DependencyGraph({roots: [root], fileWatcher: fileWatcher}); + var dgraph = new DependencyGraph({ + roots: [root], + fileWatcher: fileWatcher + }); return dgraph.load().then(function() { filesystem.root['index.js'] = filesystem.root['index.js'].replace('require("foo")', ''); @@ -524,7 +557,10 @@ describe('DependencyGraph', function() { } }); - var dgraph = new DependencyGraph({roots: [root], fileWatcher: fileWatcher}); + var dgraph = new DependencyGraph({ + roots: [root], + fileWatcher: fileWatcher + }); return dgraph.load().then(function() { delete filesystem.root.foo; triggerFileChange('delete', 'foo.js', root); @@ -571,7 +607,10 @@ describe('DependencyGraph', function() { } }); - var dgraph = new DependencyGraph({roots: [root], fileWatcher: fileWatcher}); + var dgraph = new DependencyGraph({ + roots: [root], + fileWatcher: fileWatcher + }); return dgraph.load().then(function() { filesystem.root['bar.js'] = [ '/**', @@ -679,7 +718,7 @@ describe('DependencyGraph', function() { pit('should ignore directory updates', function() { var root = '/root'; - var filesystem = fs.__setMockFilesystem({ + fs.__setMockFilesystem({ 'root': { 'index.js': [ '/**', @@ -703,7 +742,10 @@ describe('DependencyGraph', function() { } } }); - var dgraph = new DependencyGraph({roots: [root], fileWatcher: fileWatcher}); + var dgraph = new DependencyGraph({ + roots: [root], + fileWatcher: fileWatcher + }); return dgraph.load().then(function() { triggerFileChange('change', 'aPackage', '/root', { isDirectory: function(){ return true; } diff --git a/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/docblock.js b/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/docblock.js index 52cac03ba..c2b6ac984 100644 --- a/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/docblock.js +++ b/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/docblock.js @@ -14,6 +14,7 @@ * limitations under the License. */ +'use strict'; var docblockRe = /^\s*(\/\*\*(.|\r?\n)*?\*\/)/; @@ -35,7 +36,8 @@ var commentStartRe = /^\/\*\*?/; var commentEndRe = /\*\/$/; var wsRe = /[\t ]+/g; var stringStartRe = /(\r?\n|^) *\*/g; -var multilineRe = /(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *([^@\r\n\s][^@\r\n]+?) *\r?\n/g; +var multilineRe = + /(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *([^@\r\n\s][^@\r\n]+?) *\r?\n/g; var propertyRe = /(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g; /** @@ -51,15 +53,15 @@ function parse(docblock) { // Normalize multi-line directives var prev = ''; - while (prev != docblock) { + while (prev !== docblock) { prev = docblock; - docblock = docblock.replace(multilineRe, "\n$1 $2\n"); + docblock = docblock.replace(multilineRe, '\n$1 $2\n'); } docblock = docblock.trim(); var result = []; var match; - while (match = propertyRe.exec(docblock)) { + while ((match = propertyRe.exec(docblock))) { result.push([match[1], match[2]]); } diff --git a/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/example.js b/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/example.js deleted file mode 100644 index 02e6c5928..000000000 --- a/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/example.js +++ /dev/null @@ -1,25 +0,0 @@ -var path = require('path'); -var DependecyGraph = require('./'); - -var example_project = path.resolve(__dirname, '../../../../example_project'); -var watcher = new (require('../../../FileWatcher'))({projectRoot: example_project}); -var graph = new DependecyGraph({ - fileWatcher: watcher, - root: example_project -}); - -graph.load().then(function() { - var index = path.join(example_project, 'index.js'); - console.log(graph.getOrderedDependencies(index)); -}).done(); - -watcher.getWatcher().then(function(watcher) { - watcher.on('all', function() { - setImmediate(function() { - graph.load().then(function() { - var index = path.join(example_project, 'index.js'); - console.log(graph.getOrderedDependencies(index)); - }); - }) - }); -}); diff --git a/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js b/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js index 6a7d8bbac..ce6318562 100644 --- a/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js +++ b/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js @@ -139,7 +139,7 @@ DependecyGraph.prototype.resolveDependency = function( depModuleId, fromModule.id ); - return; + return null; } var main = packageJson.main || 'index'; @@ -147,7 +147,7 @@ DependecyGraph.prototype.resolveDependency = function( dep = this._graph[modulePath]; if (dep == null) { throw new Error( - 'Cannot find package main file for pacakge: ' + packageJson._root + 'Cannot find package main file for package: ' + packageJson._root ); } return dep; @@ -223,7 +223,7 @@ DependecyGraph.prototype._search = function() { .then(function(filePaths) { filePaths = filePaths.filter(function(filePath) { if (filePath == null) { - return false + return false; } return !self._ignoreFilePath(filePath); @@ -454,7 +454,8 @@ DependecyGraph.prototype._getAbsolutePath = function(filePath) { return filePath; } - for (var i = 0, root; root = this._roots[i]; i++) { + for (var i = 0; i < this._roots.length; i++) { + var root = this._roots[i]; var absPath = path.join(root, filePath); if (this._graph[absPath]) { return absPath; diff --git a/packager/react-packager/src/DependencyResolver/haste/__tests__/HasteDependencyResolver-test.js b/packager/react-packager/src/DependencyResolver/haste/__tests__/HasteDependencyResolver-test.js index d3c4a7d9f..9704c5b59 100644 --- a/packager/react-packager/src/DependencyResolver/haste/__tests__/HasteDependencyResolver-test.js +++ b/packager/react-packager/src/DependencyResolver/haste/__tests__/HasteDependencyResolver-test.js @@ -1,3 +1,4 @@ +'use strict'; jest.dontMock('../') .dontMock('q') @@ -7,7 +8,6 @@ var q = require('q'); describe('HasteDependencyResolver', function() { var HasteDependencyResolver; - var DependencyGraph; beforeEach(function() { // For the polyfillDeps @@ -15,7 +15,6 @@ describe('HasteDependencyResolver', function() { return b; }); HasteDependencyResolver = require('../'); - DependencyGraph = require('../DependencyGraph'); }); describe('getDependencies', function() { @@ -223,7 +222,7 @@ describe('HasteDependencyResolver', function() { }); var depGraph = depResolver._depGraph; - var dependencies = ['x', 'y', 'z'] + var dependencies = ['x', 'y', 'z']; var code = [ 'require("x")', 'require("y")', @@ -248,10 +247,10 @@ describe('HasteDependencyResolver', function() { }, code); expect(processedCode).toEqual([ - "__d('test module',[\"changed\",\"y\"],function(global," + - " require, requireDynamic, requireLazy, module, exports) {" + - " require('changed')", - "require('y')", + '__d(\'test module\',["changed","y"],function(global,' + + ' require, requireDynamic, requireLazy, module, exports) {' + + ' require(\'changed\')', + 'require(\'y\')', 'require("z")});', ].join('\n')); }); diff --git a/packager/react-packager/src/DependencyResolver/haste/index.js b/packager/react-packager/src/DependencyResolver/haste/index.js index dc4976493..9cb0661ac 100644 --- a/packager/react-packager/src/DependencyResolver/haste/index.js +++ b/packager/react-packager/src/DependencyResolver/haste/index.js @@ -6,14 +6,15 @@ var DependencyGraph = require('./DependencyGraph'); var ModuleDescriptor = require('../ModuleDescriptor'); var declareOpts = require('../../lib/declareOpts'); -var DEFINE_MODULE_CODE = - '__d(' + - '\'_moduleName_\',' + - '_deps_,' + - 'function(global, require, requireDynamic, requireLazy, module, exports) {'+ - ' _code_' + - '}' + - ');'; +var DEFINE_MODULE_CODE = [ + '__d(', + '\'_moduleName_\',', + '_deps_,', + 'function(global, require, requireDynamic, requireLazy, module, exports) {', + ' _code_', + '}', + ');', +].join(''); var DEFINE_MODULE_REPLACE_RE = /_moduleName_|_code_|_deps_/g; @@ -116,7 +117,6 @@ HasteDependencyResolver.prototype.wrapModule = function(module, code) { return code; } - var depGraph = this._depGraph; var resolvedDeps = Object.create(null); var resolvedDepsArr = []; @@ -131,9 +131,9 @@ HasteDependencyResolver.prototype.wrapModule = function(module, code) { var relativizedCode = code.replace(REL_REQUIRE_STMT, function(codeMatch, depName) { - var dep = resolvedDeps[depName]; - if (dep != null) { - return 'require(\'' + dep + '\')'; + var depId = resolvedDeps[depName]; + if (depId != null) { + return 'require(\'' + depId + '\')'; } else { return codeMatch; } diff --git a/packager/react-packager/src/DependencyResolver/haste/polyfills/console.js b/packager/react-packager/src/DependencyResolver/haste/polyfills/console.js index 4c9ddce1f..bb83822d5 100644 --- a/packager/react-packager/src/DependencyResolver/haste/polyfills/console.js +++ b/packager/react-packager/src/DependencyResolver/haste/polyfills/console.js @@ -20,7 +20,9 @@ * @polyfill */ +/*eslint global-strict:0*/ (function(global) { + 'use strict'; var OBJECT_COLUMN_NAME = '(index)'; @@ -45,7 +47,7 @@ if (typeof arg.toString === 'function') { try { return arg.toString(); - } catch (e) { + } catch (E) { return 'unknown'; } } @@ -53,7 +55,7 @@ } }).join(', '); global.nativeLoggingHook(str); - }; + } var repeat = function(element, n) { return Array.apply(null, Array(n)).map(function() { return element; }); @@ -120,7 +122,7 @@ // logged string, which would shift the header and screw up // the table global.nativeLoggingHook('\n' + table.join('\n')); - }; + } global.console = { error: doNativeLog, @@ -130,7 +132,7 @@ table: consoleTablePolyfill }; - }; + } if (typeof module !== 'undefined') { module.exports = setupConsole; diff --git a/packager/react-packager/src/DependencyResolver/haste/polyfills/error-guard.js b/packager/react-packager/src/DependencyResolver/haste/polyfills/error-guard.js index 687a4a19c..745d650ea 100644 --- a/packager/react-packager/src/DependencyResolver/haste/polyfills/error-guard.js +++ b/packager/react-packager/src/DependencyResolver/haste/polyfills/error-guard.js @@ -39,7 +39,7 @@ return ErrorUtils._inGuard; }, guard: function(fun, name, context) { - if (typeof fun !== "function") { + if (typeof fun !== 'function') { console.warn('A function must be passed to ErrorUtils.guard, got ', fun); return null; } diff --git a/packager/react-packager/src/DependencyResolver/haste/polyfills/polyfills.js b/packager/react-packager/src/DependencyResolver/haste/polyfills/polyfills.js index 2fd322463..75f742790 100644 --- a/packager/react-packager/src/DependencyResolver/haste/polyfills/polyfills.js +++ b/packager/react-packager/src/DependencyResolver/haste/polyfills/polyfills.js @@ -22,7 +22,7 @@ // WARNING: This is an optimized version that fails on hasOwnProperty checks // and non objects. It's not spec-compliant. It's a perf optimization. - +/* eslint global-strict:0 */ Object.assign = function(target, sources) { if (__DEV__) { if (target == null) { diff --git a/packager/react-packager/src/DependencyResolver/haste/polyfills/prelude.js b/packager/react-packager/src/DependencyResolver/haste/polyfills/prelude.js index 95c66983b..9f4db44e2 100644 --- a/packager/react-packager/src/DependencyResolver/haste/polyfills/prelude.js +++ b/packager/react-packager/src/DependencyResolver/haste/polyfills/prelude.js @@ -1 +1,2 @@ +/* eslint global-strict:0 */ __DEV__ = false; diff --git a/packager/react-packager/src/DependencyResolver/haste/polyfills/prelude_dev.js b/packager/react-packager/src/DependencyResolver/haste/polyfills/prelude_dev.js index a5ca53b7a..26b26a076 100644 --- a/packager/react-packager/src/DependencyResolver/haste/polyfills/prelude_dev.js +++ b/packager/react-packager/src/DependencyResolver/haste/polyfills/prelude_dev.js @@ -1 +1,2 @@ +/* eslint global-strict:0 */ __DEV__ = true; diff --git a/packager/react-packager/src/DependencyResolver/haste/polyfills/require.js b/packager/react-packager/src/DependencyResolver/haste/polyfills/require.js index 3b5d6d87a..e7fdde250 100644 --- a/packager/react-packager/src/DependencyResolver/haste/polyfills/require.js +++ b/packager/react-packager/src/DependencyResolver/haste/polyfills/require.js @@ -1,3 +1,4 @@ +/* eslint global-strict:0,eqeqeq:0,no-bitwise:0,no-undef:0 */ (function(global) { // avoid redefining require() diff --git a/packager/react-packager/src/DependencyResolver/index.js b/packager/react-packager/src/DependencyResolver/index.js index 79eb48c11..f42ecb8a7 100644 --- a/packager/react-packager/src/DependencyResolver/index.js +++ b/packager/react-packager/src/DependencyResolver/index.js @@ -1,3 +1,5 @@ +'use strict'; + var HasteDependencyResolver = require('./haste'); var NodeDependencyResolver = require('./node'); diff --git a/packager/react-packager/src/DependencyResolver/node/index.js b/packager/react-packager/src/DependencyResolver/node/index.js index 0d3b807ef..da03cc7ea 100644 --- a/packager/react-packager/src/DependencyResolver/node/index.js +++ b/packager/react-packager/src/DependencyResolver/node/index.js @@ -1,17 +1,12 @@ +'use strict'; + var Promise = require('q').Promise; var ModuleDescriptor = require('../ModuleDescriptor'); var mdeps = require('module-deps'); var path = require('path'); -var fs = require('fs'); -// var REQUIRE_RUNTIME = fs.readFileSync( -// path.join(__dirname, 'require.js') -// ).toString(); - -exports.getRuntimeCode = function() { - return REQUIRE_RUNTIME; -}; +exports.getRuntimeCode = function() {}; exports.wrapModule = function(id, source) { return Promise.resolve( @@ -21,7 +16,7 @@ exports.wrapModule = function(id, source) { }; exports.getDependencies = function(root, fileEntryPath) { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { fileEntryPath = path.join(process.cwd(), root, fileEntryPath); var md = mdeps(); diff --git a/packager/react-packager/src/FileWatcher/__tests__/FileWatcher-test.js b/packager/react-packager/src/FileWatcher/__tests__/FileWatcher-test.js index 8baae9e11..fc8a7a41c 100644 --- a/packager/react-packager/src/FileWatcher/__tests__/FileWatcher-test.js +++ b/packager/react-packager/src/FileWatcher/__tests__/FileWatcher-test.js @@ -1,8 +1,12 @@ 'use strict'; -jest.dontMock('../') - .dontMock('q') - .setMock('child_process', { exec: function(cmd, cb) { cb(null, '/usr/bin/watchman') } }); +jest + .dontMock('../') + .dontMock('q') + .setMock( + 'child_process', + { exec: function(cmd, cb) { cb(null, '/usr/bin/watchman'); } } + ); describe('FileWatcher', function() { var FileWatcher; diff --git a/packager/react-packager/src/JSTransformer/Cache.js b/packager/react-packager/src/JSTransformer/Cache.js index f04ffe9fe..f43418e30 100644 --- a/packager/react-packager/src/JSTransformer/Cache.js +++ b/packager/react-packager/src/JSTransformer/Cache.js @@ -1,9 +1,9 @@ 'use strict'; var path = require('path'); -var version = require('../../package.json').version; +var version = require('../../../../package.json').version; var tmpdir = require('os').tmpDir(); -var pathUtils = require('../fb-path-utils'); +var isAbsolutePath = require('absolute-path'); var declareOpts = require('../lib/declareOpts'); var fs = require('fs'); var _ = require('underscore'); @@ -48,7 +48,7 @@ function Cache(options) { } Cache.prototype.get = function(filepath, loaderCb) { - if (!pathUtils.isAbsolutePath(filepath)) { + if (!isAbsolutePath(filepath)) { throw new Error('Use absolute paths'); } @@ -62,7 +62,7 @@ Cache.prototype.get = function(filepath, loaderCb) { }; Cache.prototype._set = function(filepath, loaderPromise) { - return this._data[filepath] = loaderPromise.then(function(data) { + this._data[filepath] = loaderPromise.then(function(data) { return [ data, q.nfbind(fs.stat)(filepath) @@ -74,10 +74,12 @@ Cache.prototype._set = function(filepath, loaderPromise) { mtime: stat.mtime.getTime(), }; }.bind(this)); + + return this._data[filepath]; }; Cache.prototype.invalidate = function(filepath){ - if(this._has(filepath)) { + if (this._has(filepath)) { delete this._data[filepath]; } }; @@ -94,7 +96,7 @@ Cache.prototype._persistCache = function() { var data = this._data; var cacheFilepath = this._cacheFilePath; - return this._persisting = q.all(_.values(data)) + this._persisting = q.all(_.values(data)) .then(function(values) { var json = Object.create(null); Object.keys(data).forEach(function(key, i) { @@ -106,6 +108,8 @@ Cache.prototype._persistCache = function() { this._persisting = null; return true; }.bind(this)); + + return this._persisting; }; function loadCacheSync(cacheFilepath) { diff --git a/packager/react-packager/src/JSTransformer/__tests__/Cache-test.js b/packager/react-packager/src/JSTransformer/__tests__/Cache-test.js index c77c63843..232d6ff44 100644 --- a/packager/react-packager/src/JSTransformer/__tests__/Cache-test.js +++ b/packager/react-packager/src/JSTransformer/__tests__/Cache-test.js @@ -5,7 +5,6 @@ jest .dontMock('path') .dontMock('q') .dontMock('absolute-path') - .dontMock('../../fb-path-utils') .dontMock('../Cache'); var q = require('q'); diff --git a/packager/react-packager/src/JSTransformer/index.js b/packager/react-packager/src/JSTransformer/index.js index ade206a74..4f98d588c 100644 --- a/packager/react-packager/src/JSTransformer/index.js +++ b/packager/react-packager/src/JSTransformer/index.js @@ -7,6 +7,7 @@ var Cache = require('./Cache'); var _ = require('underscore'); var workerFarm = require('worker-farm'); var declareOpts = require('../lib/declareOpts'); +var util = require('util'); var readFile = q.nfbind(fs.readFile); @@ -75,9 +76,7 @@ Transformer.prototype.kill = function() { Transformer.prototype.invalidateFile = function(filePath) { this._cache.invalidate(filePath); - //TODO: We can read the file and put it into the cache right here - // This would simplify some caching logic as we can be sure that the cache is up to date -} +}; Transformer.prototype.loadFileAndTransform = function( transformSets, @@ -116,7 +115,7 @@ Transformer.prototype.loadFileAndTransform = function( }; function TransformError() {} -TransformError.__proto__ = SyntaxError.prototype; +util.inherits(TransformError, SyntaxError); function formatEsprimaError(err, filename, source) { if (!(err.lineNumber && err.column)) { diff --git a/packager/react-packager/src/Packager/Package.js b/packager/react-packager/src/Packager/Package.js index 787684bc2..a4080d3b3 100644 --- a/packager/react-packager/src/Packager/Package.js +++ b/packager/react-packager/src/Packager/Package.js @@ -1,7 +1,6 @@ 'use strict'; var _ = require('underscore'); -var SourceMapGenerator = require('source-map').SourceMapGenerator; var base64VLQ = require('./base64-vlq'); module.exports = Package; @@ -102,7 +101,7 @@ Package.prototype._getMappings = function() { mappings += ';'; } } - if (i != modules.length - 1) { + if (i !== modules.length - 1) { mappings += ';'; } } diff --git a/packager/react-packager/src/Packager/__mocks__/source-map.js b/packager/react-packager/src/Packager/__mocks__/source-map.js deleted file mode 100644 index 08c127f6d..000000000 --- a/packager/react-packager/src/Packager/__mocks__/source-map.js +++ /dev/null @@ -1,5 +0,0 @@ -var SourceMapGenerator = jest.genMockFn(); -SourceMapGenerator.prototype.addMapping = jest.genMockFn(); -SourceMapGenerator.prototype.setSourceContent = jest.genMockFn(); -SourceMapGenerator.prototype.toJSON = jest.genMockFn(); -exports.SourceMapGenerator = SourceMapGenerator; diff --git a/packager/react-packager/src/Packager/__tests__/Package-test.js b/packager/react-packager/src/Packager/__tests__/Package-test.js index d18bb4d6c..d269eb577 100644 --- a/packager/react-packager/src/Packager/__tests__/Package-test.js +++ b/packager/react-packager/src/Packager/__tests__/Package-test.js @@ -50,13 +50,13 @@ describe('Package', function() { describe('sourcemap package', function() { it('should create sourcemap', function() { - var ppackage = new Package('test_url'); - ppackage.addModule('transformed foo;\n', 'source foo', 'foo path'); - ppackage.addModule('transformed bar;\n', 'source bar', 'bar path'); - ppackage.setMainModuleId('foo'); - ppackage.finalize({runMainModule: true}); - var s = ppackage.getSourceMap(); - expect(s).toEqual(genSourceMap(ppackage._modules)); + var p = new Package('test_url'); + p.addModule('transformed foo;\n', 'source foo', 'foo path'); + p.addModule('transformed bar;\n', 'source bar', 'bar path'); + p.setMainModuleId('foo'); + p.finalize({runMainModule: true}); + var s = p.getSourceMap(); + expect(s).toEqual(genSourceMap(p._modules)); }); }); }); @@ -92,4 +92,4 @@ describe('Package', function() { ); } return sourceMapGen.toJSON(); -}; + } diff --git a/packager/react-packager/src/Packager/base64-vlq.js b/packager/react-packager/src/Packager/base64-vlq.js index 91d490b7d..4483a507a 100644 --- a/packager/react-packager/src/Packager/base64-vlq.js +++ b/packager/react-packager/src/Packager/base64-vlq.js @@ -35,9 +35,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/*eslint no-bitwise:0,quotes:0,global-strict:0*/ + var charToIntMap = {}; var intToCharMap = {}; - + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' .split('') .forEach(function (ch, index) { @@ -55,7 +57,7 @@ base64.encode = function base64_encode(aNumber) { } throw new TypeError("Must be between 0 and 63: " + aNumber); }; - + /** * Decode a single base 64 digit to an integer. */ @@ -65,7 +67,7 @@ base64.decode = function base64_decode(aChar) { } throw new TypeError("Not a valid base 64 digit: " + aChar); }; - + // A single base 64 digit can contain 6 bits of data. For the base 64 variable @@ -165,4 +167,3 @@ exports.decode = function base64VLQ_decode(aStr, aOutParam) { aOutParam.value = fromVLQSigned(result); aOutParam.rest = aStr.slice(i); }; - diff --git a/packager/react-packager/src/Server/__tests__/Server-test.js b/packager/react-packager/src/Server/__tests__/Server-test.js index 690c7e068..a9951f601 100644 --- a/packager/react-packager/src/Server/__tests__/Server-test.js +++ b/packager/react-packager/src/Server/__tests__/Server-test.js @@ -1,4 +1,6 @@ -jest.setMock('worker-farm', function(){ return function(){}; }) +'use strict'; + +jest.setMock('worker-farm', function() { return function() {}; }) .dontMock('q') .dontMock('os') .dontMock('errno/custom') @@ -8,9 +10,8 @@ jest.setMock('worker-farm', function(){ return function(){}; }) var q = require('q'); -describe('processRequest', function(){ +describe('processRequest', function() { var server; - var Activity; var Packager; var FileWatcher; @@ -21,16 +22,16 @@ describe('processRequest', function(){ polyfillModuleNames: null }; - var makeRequest = function(requestHandler, requrl){ + var makeRequest = function(requestHandler, requrl) { var deferred = q.defer(); requestHandler({ url: requrl },{ - end: function(res){ + end: function(res) { deferred.resolve(res); } },{ - next: function(){} + next: function() {} } ); return deferred.promise; @@ -40,8 +41,7 @@ describe('processRequest', function(){ var watcherFunc = jest.genMockFunction(); var requestHandler; - beforeEach(function(){ - Activity = require('../../Activity'); + beforeEach(function() { Packager = require('../../Packager'); FileWatcher = require('../../FileWatcher'); @@ -50,7 +50,7 @@ describe('processRequest', function(){ getSource: function() { return 'this is the source'; }, - getSourceMap: function(){ + getSourceMap: function() { return 'this is the source map'; }, }); @@ -65,26 +65,32 @@ describe('processRequest', function(){ requestHandler = server.processRequest.bind(server); }); - pit('returns JS bundle source on request of *.bundle',function(){ - result = makeRequest(requestHandler,'mybundle.includeRequire.runModule.bundle'); - return result.then(function(response){ - expect(response).toEqual("this is the source"); + pit('returns JS bundle source on request of *.bundle',function() { + return makeRequest( + requestHandler, + 'mybundle.includeRequire.runModule.bundle' + ).then(function(response) { + expect(response).toEqual('this is the source'); }); }); - pit('returns sourcemap on request of *.map', function(){ - result = makeRequest(requestHandler,'mybundle.includeRequire.runModule.bundle.map'); - return result.then(function(response){ - expect(response).toEqual('"this is the source map"'); + pit('returns sourcemap on request of *.map', function() { + makeRequest( + requestHandler, + 'mybundle.includeRequire.runModule.bundle.map' + ).then(function(response) { + expect(response).toEqual('this is the source map'); }); }); - pit('watches all files in projectRoot', function(){ - result = makeRequest(requestHandler,'mybundle.includeRequire.runModule.bundle'); - return result.then(function(response){ + pit('watches all files in projectRoot', function() { + makeRequest( + requestHandler, + 'mybundle.includeRequire.runModule.bundle' + ).then(function(response) { expect(watcherFunc.mock.calls[0][0]).toEqual('all'); expect(watcherFunc.mock.calls[0][1]).not.toBe(null); - }) + }); }); @@ -101,8 +107,10 @@ describe('processRequest', function(){ }); pit('invalides files in package when file is updated', function() { - result = makeRequest(requestHandler,'mybundle.includeRequire.runModule.bundle'); - return result.then(function(response){ + makeRequest( + requestHandler, + 'mybundle.includeRequire.runModule.bundle' + ).then(function(response) { var onFileChange = watcherFunc.mock.calls[0][1]; onFileChange('all','path/file.js', options.projectRoots[0]); expect(invalidatorFunc.mock.calls[0][0]).toEqual('root/path/file.js'); @@ -114,41 +122,41 @@ describe('processRequest', function(){ packageFunc .mockReturnValueOnce( q({ - getSource: function(){ - return "this is the first source" + getSource: function() { + return 'this is the first source'; }, - getSourceMap: function(){}, + getSourceMap: function() {}, }) ) .mockReturnValue( q({ - getSource: function(){ - return "this is the rebuilt source" + getSource: function() { + return 'this is the rebuilt source'; }, - getSourceMap: function(){}, + getSourceMap: function() {}, }) ); Packager.prototype.package = packageFunc; var Server = require('../../Server'); - var server = new Server(options); + server = new Server(options); requestHandler = server.processRequest.bind(server); return makeRequest(requestHandler,'mybundle.includeRequire.runModule.bundle') - .then(function(response){ - expect(response).toEqual("this is the first source"); + .then(function(response) { + expect(response).toEqual('this is the first source'); expect(packageFunc.mock.calls.length).toBe(1); triggerFileChange('all','path/file.js', options.projectRoots[0]); jest.runAllTimers(); }) - .then(function(){ + .then(function() { expect(packageFunc.mock.calls.length).toBe(2); return makeRequest(requestHandler,'mybundle.includeRequire.runModule.bundle') - .then(function(response){ - expect(response).toEqual("this is the rebuilt source"); + .then(function(response) { + expect(response).toEqual('this is the rebuilt source'); }); }); }); diff --git a/packager/react-packager/src/Server/index.js b/packager/react-packager/src/Server/index.js index 611d703e3..1f5b7ff18 100644 --- a/packager/react-packager/src/Server/index.js +++ b/packager/react-packager/src/Server/index.js @@ -1,3 +1,5 @@ +'use strict'; + var url = require('url'); var path = require('path'); var declareOpts = require('../lib/declareOpts'); @@ -154,7 +156,7 @@ Server.prototype.processRequest = function(req, res, next) { var startReqEventId = Activity.startEvent('request:' + req.url); var options = getOptionsFromPath(url.parse(req.url).pathname); - var building = this._packages[req.url] || this._buildPackage(options) + var building = this._packages[req.url] || this._buildPackage(options); this._packages[req.url] = building; building.then( function(p) { diff --git a/packager/react-packager/src/fb-path-utils/index.js b/packager/react-packager/src/fb-path-utils/index.js deleted file mode 100644 index b4a1cb967..000000000 --- a/packager/react-packager/src/fb-path-utils/index.js +++ /dev/null @@ -1,14 +0,0 @@ -var absolutePath = require('absolute-path'); -var path = require('path'); -var pathIsInside = require('path-is-inside'); - -function isAbsolutePath(pathStr) { - return absolutePath(pathStr); -} - -function isChildPath(parentPath, childPath) { - return pathIsInside(parentPath, childPath); -} - -exports.isAbsolutePath = isAbsolutePath; -exports.isChildPath = isChildPath; diff --git a/packager/react-packager/src/lib/__mocks__/declareOpts.js b/packager/react-packager/src/lib/__mocks__/declareOpts.js index 2f7ae1f6b..1afe4e297 100644 --- a/packager/react-packager/src/lib/__mocks__/declareOpts.js +++ b/packager/react-packager/src/lib/__mocks__/declareOpts.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = function(declared) { return function(opts) { for (var p in declared) { diff --git a/packager/react-packager/src/lib/__tests__/declareOpts-test.js b/packager/react-packager/src/lib/__tests__/declareOpts-test.js index 044e3a1c6..66ae174fb 100644 --- a/packager/react-packager/src/lib/__tests__/declareOpts-test.js +++ b/packager/react-packager/src/lib/__tests__/declareOpts-test.js @@ -1,3 +1,5 @@ +'use strict'; + jest.autoMockOff(); var declareOpts = require('../declareOpts'); diff --git a/packager/react-packager/src/lib/declareOpts.js b/packager/react-packager/src/lib/declareOpts.js index 2bac59f33..ddd06061a 100644 --- a/packager/react-packager/src/lib/declareOpts.js +++ b/packager/react-packager/src/lib/declareOpts.js @@ -10,6 +10,8 @@ * var myOptions = validate(someOptions); */ +'use strict'; + var Joi = require('joi'); module.exports = function(descriptor) { From 258c6b1b5455bf1ba32ede1c9cf5f041b5b2b20c Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Mon, 2 Mar 2015 10:45:03 -0800 Subject: [PATCH 03/79] Updates from Thu Feb 26 - [Children] Expose React.Children like web React | James Ide - Remove touch handler assertions - not always true | Tadeu Zagallo - [treehouse] Add support for clear button on UITextFields | Sumeet Vaidya - [Touch] Suite of touchable events on TouchableHighlight/Opacity | James Ide - [Images] Bail out when GIF data is in unexpected format instead of crashing | James Ide --- Examples/UIExplorer/TouchableExample.js | 56 ++++++++++++++++++- .../Components/TextInput/TextInput.ios.js | 16 ++++++ .../Touchable/TouchableFeedbackPropType.js | 22 ++++++++ .../Touchable/TouchableHighlight.js | 8 +++ .../Components/Touchable/TouchableOpacity.js | 13 +++-- .../Touchable/TouchableWithoutFeedback.js | 9 +-- Libraries/ReactIOS/ReactIOS.js | 8 +++ ReactKit/Base/RCTConvert.m | 3 + ReactKit/Base/RCTTouchHandler.m | 21 +++++-- 9 files changed, 138 insertions(+), 18 deletions(-) create mode 100644 Libraries/Components/Touchable/TouchableFeedbackPropType.js diff --git a/Examples/UIExplorer/TouchableExample.js b/Examples/UIExplorer/TouchableExample.js index 7aa2be01c..66a919a3c 100644 --- a/Examples/UIExplorer/TouchableExample.js +++ b/Examples/UIExplorer/TouchableExample.js @@ -12,6 +12,7 @@ var { StyleSheet, Text, TouchableHighlight, + TouchableOpacity, View, } = React; @@ -57,6 +58,13 @@ exports.examples = [ render: function() { return ; }, +}, { + title: 'Touchable feedback events', + description: ' components accept onPress, onPressIn, ' + + 'onPressOut, and onLongPress as props.', + render: function() { + return ; + }, }]; var TextOnPressBox = React.createClass({ @@ -95,11 +103,46 @@ var TextOnPressBox = React.createClass({ } }); +var TouchableFeedbackEvents = React.createClass({ + getInitialState: function() { + return { + eventLog: [], + }; + }, + render: function() { + return ( + + + this._appendEvent('press')} + onPressIn={() => this._appendEvent('pressIn')} + onPressOut={() => this._appendEvent('pressOut')} + onLongPress={() => this._appendEvent('longPress')}> + + Press Me + + + + + {this.state.eventLog.map((e, ii) => {e})} + + + ); + }, + _appendEvent: function(eventName) { + var limit = 6; + var eventLog = this.state.eventLog.slice(0, limit - 1); + eventLog.unshift(eventName); + this.setState({eventLog}); + }, +}); + var heartImage = {uri: 'https://pbs.twimg.com/media/BlXBfT3CQAA6cVZ.png:small'}; var styles = StyleSheet.create({ row: { - alignItems: 'center', + justifyContent: 'center', flexDirection: 'row', }, icon: { @@ -113,6 +156,9 @@ var styles = StyleSheet.create({ text: { fontSize: 16, }, + button: { + color: '#007AFF', + }, wrapper: { borderRadius: 8, }, @@ -127,6 +173,14 @@ var styles = StyleSheet.create({ borderColor: '#f0f0f0', backgroundColor: '#f9f9f9', }, + eventLogBox: { + padding: 10, + margin: 10, + height: 120, + borderWidth: 1 / PixelRatio.get(), + borderColor: '#f0f0f0', + backgroundColor: '#f9f9f9', + }, textBlock: { fontWeight: 'bold', color: 'blue', diff --git a/Libraries/Components/TextInput/TextInput.ios.js b/Libraries/Components/TextInput/TextInput.ios.js index 2bd194d17..fef9c16f0 100644 --- a/Libraries/Components/TextInput/TextInput.ios.js +++ b/Libraries/Components/TextInput/TextInput.ios.js @@ -68,6 +68,15 @@ var autoCapitalizeMode = { characters: nativeConstants.AllCharacters }; +var clearButtonModeConstants = NativeModulesDeprecated.RKUIManager.UITextField.clearButtonMode; + +var clearButtonModeTypes = { + never: clearButtonModeConstants.Never, + whileEditing: clearButtonModeConstants.WhileEditing, + unlessEditing: clearButtonModeConstants.UnlessEditing, + always: clearButtonModeConstants.Always, +}; + var keyboardType = { default: 'default', numeric: 'numeric', @@ -90,6 +99,7 @@ var RKTextViewAttributes = merge(ReactIOSViewAttributes.UIView, { var RKTextFieldAttributes = merge(RKTextViewAttributes, { caretHidden: true, enabled: true, + clearButtonMode: true, }); var onlyMultiline = { @@ -105,6 +115,7 @@ var notMultiline = { var TextInput = React.createClass({ statics: { autoCapitalizeMode: autoCapitalizeMode, + clearButtonModeTypes: clearButtonModeTypes, keyboardType: keyboardType, }, @@ -188,6 +199,10 @@ var TextInput = React.createClass({ * and/or laggy typing, depending on how you process onChange events. */ controlled: PropTypes.bool, + /** + * When the clear button should appear on the right side of the text view + */ + clearButtonMode: PropTypes.oneOf(getObjectValues(clearButtonModeTypes)), style: Text.stylePropType, }, @@ -316,6 +331,7 @@ var TextInput = React.createClass({ text={this.state.bufferedValue} autoCapitalize={this.props.autoCapitalize} autoCorrect={this.props.autoCorrect} + clearButtonMode={this.props.clearButtonMode} />; } else { for (var propKey in notMultiline) { diff --git a/Libraries/Components/Touchable/TouchableFeedbackPropType.js b/Libraries/Components/Touchable/TouchableFeedbackPropType.js new file mode 100644 index 000000000..336b091c6 --- /dev/null +++ b/Libraries/Components/Touchable/TouchableFeedbackPropType.js @@ -0,0 +1,22 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule TouchableFeedbackPropType + * @flow + */ +'use strict'; + +var { PropTypes } = require('React'); + +var TouchableFeedbackPropType = { + /** + * Called when the touch is released, but not if cancelled (e.g. by a scroll + * that steals the responder lock). + */ + onPress: PropTypes.func, + onPressIn: PropTypes.func, + onPressOut: PropTypes.func, + onLongPress: PropTypes.func, +}; + +module.exports = TouchableFeedbackPropType; diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index da721cff8..9381f52d6 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -11,6 +11,7 @@ var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); var StyleSheet = require('StyleSheet'); var TimerMixin = require('TimerMixin'); var Touchable = require('Touchable'); +var TouchableFeedbackPropType = require('TouchableFeedbackPropType'); var View = require('View'); var cloneWithProps = require('cloneWithProps'); @@ -50,6 +51,7 @@ var DEFAULT_PROPS = { var TouchableHighlight = React.createClass({ propTypes: { + ...TouchableFeedbackPropType, /** * Called when the touch is released, but not if cancelled (e.g. by * a scroll that steals the responder lock). @@ -127,12 +129,14 @@ var TouchableHighlight = React.createClass({ this.clearTimeout(this._hideTimeout); this._hideTimeout = null; this._showUnderlay(); + this.props.onPressIn && this.props.onPressIn(); }, touchableHandleActivePressOut: function() { if (!this._hideTimeout) { this._hideUnderlay(); } + this.props.onPressOut && this.props.onPressOut(); }, touchableHandlePress: function() { @@ -142,6 +146,10 @@ var TouchableHighlight = React.createClass({ this.props.onPress && this.props.onPress(); }, + touchableHandleLongPress: function() { + this.props.onLongPress && this.props.onLongPress(); + }, + touchableGetPressRectOffset: function() { return PRESS_RECT_OFFSET; // Always make sure to predeclare a constant! }, diff --git a/Libraries/Components/Touchable/TouchableOpacity.js b/Libraries/Components/Touchable/TouchableOpacity.js index a1bd8f4e3..cb68d6df3 100644 --- a/Libraries/Components/Touchable/TouchableOpacity.js +++ b/Libraries/Components/Touchable/TouchableOpacity.js @@ -9,6 +9,7 @@ var NativeMethodsMixin = require('NativeMethodsMixin'); var POPAnimationMixin = require('POPAnimationMixin'); var React = require('React'); var Touchable = require('Touchable'); +var TouchableFeedbackPropType = require('TouchableFeedbackPropType'); var cloneWithProps = require('cloneWithProps'); var ensureComponentIsNative = require('ensureComponentIsNative'); @@ -41,11 +42,7 @@ var TouchableOpacity = React.createClass({ mixins: [Touchable.Mixin, NativeMethodsMixin, POPAnimationMixin], propTypes: { - /** - * Called when the touch is released, but not if cancelled (e.g. by - * a scroll that steals the responder lock). - */ - onPress: React.PropTypes.func, + ...TouchableFeedbackPropType, /** * Determines what the opacity of the wrapped view should be when touch is * active. @@ -97,10 +94,12 @@ var TouchableOpacity = React.createClass({ this.refs[CHILD_REF].setNativeProps({ opacity: this.props.activeOpacity }); + this.props.onPressIn && this.props.onPressIn(); }, touchableHandleActivePressOut: function() { this.setOpacityTo(1.0); + this.props.onPressOut && this.props.onPressOut(); }, touchableHandlePress: function() { @@ -108,6 +107,10 @@ var TouchableOpacity = React.createClass({ this.props.onPress && this.props.onPress(); }, + touchableHandleLongPress: function() { + this.props.onLongPress && this.props.onLongPress(); + }, + touchableGetPressRectOffset: function() { return PRESS_RECT_OFFSET; // Always make sure to predeclare a constant! }, diff --git a/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/Libraries/Components/Touchable/TouchableWithoutFeedback.js index 66a82d59c..74fbf43a1 100644 --- a/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -7,7 +7,7 @@ var React = require('React'); var Touchable = require('Touchable'); -var View = require('View'); +var TouchableFeedbackPropType = require('TouchableFeedbackPropType'); var copyProperties = require('copyProperties'); var onlyChild = require('onlyChild'); @@ -29,12 +29,7 @@ var PRESS_RECT_OFFSET = {top: 20, left: 20, right: 20, bottom: 30}; var TouchableWithoutFeedback = React.createClass({ mixins: [Touchable.Mixin], - propTypes: { - onPress: React.PropTypes.func, - onPressIn: React.PropTypes.func, - onPressOut: React.PropTypes.func, - onLongPress: React.PropTypes.func, - }, + propTypes: TouchableFeedbackPropType, getInitialState: function() { return this.touchableGetInitialState(); diff --git a/Libraries/ReactIOS/ReactIOS.js b/Libraries/ReactIOS/ReactIOS.js index f0a1ed782..0022e09bd 100644 --- a/Libraries/ReactIOS/ReactIOS.js +++ b/Libraries/ReactIOS/ReactIOS.js @@ -6,6 +6,7 @@ "use strict"; +var ReactChildren = require('ReactChildren'); var ReactComponent = require('ReactComponent'); var ReactCompositeComponent = require('ReactCompositeComponent'); var ReactContext = require('ReactContext'); @@ -20,6 +21,7 @@ var ReactPropTypes = require('ReactPropTypes'); var deprecated = require('deprecated'); var invariant = require('invariant'); +var onlyChild = require('onlyChild'); ReactIOSDefaultInjection.inject(); @@ -73,6 +75,12 @@ var render = function(component, mountInto) { var ReactIOS = { hasReactIOSInitialized: false, + Children: { + map: ReactChildren.map, + forEach: ReactChildren.forEach, + count: ReactChildren.count, + only: onlyChild + }, PropTypes: ReactPropTypes, createClass: ReactCompositeComponent.createClass, createElement: createElement, diff --git a/ReactKit/Base/RCTConvert.m b/ReactKit/Base/RCTConvert.m index 752d03ced..ab79cd861 100644 --- a/ReactKit/Base/RCTConvert.m +++ b/ReactKit/Base/RCTConvert.m @@ -446,6 +446,9 @@ RCT_STRUCT_CONVERTER(CGAffineTransform, (@[@"a", @"b", @"c", @"d", @"tx", @"ty"] } imageSource = CGImageSourceCreateWithData((CFDataRef)data, NULL); + } else { + RCTLogMustFix(@"Expected NSString or NSData for GIF, received %@: %@", [json class], json); + return nil; } if (!UTTypeConformsTo(CGImageSourceGetType(imageSource), kUTTypeGIF)) { diff --git a/ReactKit/Base/RCTTouchHandler.m b/ReactKit/Base/RCTTouchHandler.m index c56f996cc..a23cd70c7 100644 --- a/ReactKit/Base/RCTTouchHandler.m +++ b/ReactKit/Base/RCTTouchHandler.m @@ -77,9 +77,10 @@ typedef NS_ENUM(NSInteger, RCTTouchEventType) { } targetView = targetView.superview; } - - RCTAssert(targetView.reactTag && targetView.userInteractionEnabled, - @"No react view found for touch - something went wrong."); + + if (!targetView.reactTag || !targetView.userInteractionEnabled) { + return; + } // Get new, unique touch id const NSUInteger RCTMaxTouches = 11; // This is the maximum supported by iDevices @@ -113,7 +114,10 @@ typedef NS_ENUM(NSInteger, RCTTouchEventType) { { for (UITouch *touch in touches) { NSUInteger index = [_nativeTouches indexOfObject:touch]; - RCTAssert(index != NSNotFound, @"Touch is already removed. This is a critical bug."); + if(index == NSNotFound) { + continue; + } + [_touchViews removeObjectAtIndex:index]; [_nativeTouches removeObjectAtIndex:index]; [_reactTouches removeObjectAtIndex:index]; @@ -159,10 +163,17 @@ typedef NS_ENUM(NSInteger, RCTTouchEventType) { NSMutableArray *changedIndexes = [[NSMutableArray alloc] init]; for (UITouch *touch in touches) { NSInteger index = [_nativeTouches indexOfObject:touch]; - RCTAssert(index != NSNotFound, @"Touch not found. This is a critical bug."); + if (index == NSNotFound) { + continue; + } + [self _updateReactTouchAtIndex:index]; [changedIndexes addObject:@(index)]; } + + if (changedIndexes.count == 0) { + return; + } // Deep copy the touches because they will be accessed from another thread // TODO: would it be safer to do this in the bridge or executor, rather than trusting caller? From 0b09ed0667e67794b2db0f21ea8d837f20706502 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Mon, 2 Mar 2015 10:52:16 -0800 Subject: [PATCH 04/79] Updates from Fri Feb 27 - [react-packager] transformModulePath option is not actually required | Amjad Masad - Implement TextInput.clearButtonMode added by D1875684 on OSS fork + example | Tadeu Zagallo - [ReactNative] Use local CocoaPod config for ReactNative modules | Spencer Ahrens - [ReactNative] Pull out some OSS modules into separate libs | Spencer Ahrens - Enqueue events at 60fps + profiling helpers | Tadeu Zagallo --- .gitignore | 5 +- Examples/Movies/AppDelegate.m | 2 +- .../Movies/Movies.xcodeproj/project.pbxproj | 139 +- .../contents.xcworkspacedata | 10 + Examples/Movies/Podfile | 6 + Examples/Movies/Podfile.lock | 32 + .../Public/RCTDataManager}/RCTDataManager.h | 0 .../RCTNetworkImage}/RCTImageDownloader.h | 0 .../RCTNetworkImage}/RCTNetworkImageView.h | 0 .../RCTNetworkImageViewManager.h | 0 .../Public/RCTText}/RCTRawTextManager.h | 0 .../Public/RCTText}/RCTShadowRawText.h | 0 .../Headers/Public/RCTText}/RCTShadowText.h | 0 .../Pods/Headers/Public/RCTText}/RCTText.h | 0 .../Headers/Public/RCTText}/RCTTextManager.h | 0 .../Pods/Headers/Public/ReactKit/Layout.h | 148 + .../Headers/Public/ReactKit/RCTAlertManager.h | 9 + .../Public/ReactKit/RCTAnimationType.h | 11 + .../Pods/Headers/Public/ReactKit/RCTAssert.h | 36 + .../Public/ReactKit/RCTAutoInsetsProtocol.h | 13 + .../Pods/Headers/Public/ReactKit/RCTBridge.h | 107 + .../Headers/Public/ReactKit/RCTBridgeModule.h | 64 + .../Pods/Headers/Public/ReactKit/RCTCache.h | 22 + .../Public/ReactKit/RCTContextExecutor.h | 21 + .../Pods/Headers/Public/ReactKit/RCTConvert.h | 85 + .../Public/ReactKit/RCTEventDispatcher.h | 66 + .../Public/ReactKit/RCTExceptionsManager.h | 9 + .../Headers/Public/ReactKit/RCTInvalidating.h | 16 + .../Public/ReactKit/RCTJSMethodRegistrar.h | 24 + .../Public/ReactKit/RCTJavaScriptExecutor.h | 35 + .../Headers/Public/ReactKit/RCTKeyCommands.h | 28 + .../Pods/Headers/Public/ReactKit/RCTLog.h | 69 + .../Pods/Headers/Public/ReactKit/RCTNavItem.h | 14 + .../Public/ReactKit/RCTNavItemManager.h | 8 + .../Headers/Public/ReactKit/RCTNavigator.h | 26 + .../Public/ReactKit/RCTNavigatorManager.h | 8 + .../Public/ReactKit/RCTPointerEvents.h | 10 + .../Pods/Headers/Public/ReactKit/RCTRedBox.h | 16 + .../Headers/Public/ReactKit/RCTRootView.h | 44 + .../Headers/Public/ReactKit/RCTScrollView.h | 37 + .../Public/ReactKit/RCTScrollViewManager.h | 8 + .../Public/ReactKit/RCTScrollableProtocol.h | 18 + .../Headers/Public/ReactKit/RCTShadowView.h | 159 + .../Headers/Public/ReactKit/RCTSparseArray.h | 31 + .../Headers/Public/ReactKit/RCTStaticImage.h | 10 + .../Public/ReactKit/RCTStaticImageManager.h | 7 + .../Public/ReactKit/RCTStatusBarManager.h | 9 + .../Headers/Public/ReactKit/RCTTextField.h | 15 + .../Public/ReactKit/RCTTextFieldManager.h | 8 + .../Pods/Headers/Public/ReactKit/RCTTiming.h | 10 + .../Headers/Public/ReactKit/RCTTouchHandler.h | 15 + .../RCTUIActivityIndicatorViewManager.h | 7 + .../Headers/Public/ReactKit/RCTUIManager.h | 26 + .../Pods/Headers/Public/ReactKit/RCTUtils.h | 41 + .../Pods/Headers/Public/ReactKit/RCTView.h | 24 + .../Headers/Public/ReactKit/RCTViewManager.h | 148 + .../Public/ReactKit/RCTViewNodeProtocol.h | 26 + .../Public/ReactKit/RCTWebViewExecutor.h | 35 + .../ReactKit/RCTWrapperViewController.h | 24 + .../Headers/Public/ReactKit/UIView+ReactKit.h | 11 + .../Local Podspecs/RCTDataManager.podspec | 28 + .../Local Podspecs/RCTNetworkImage.podspec | 28 + .../Pods/Local Podspecs/RCTText.podspec | 28 + .../Pods/Local Podspecs/ReactKit.podspec | 16 + Examples/Movies/Pods/Manifest.lock | 32 + .../Pods/Pods.xcodeproj/project.pbxproj | 4284 +++++++++++++++++ .../Pods-RCTDataManager-Private.xcconfig | 5 + .../Pods-RCTDataManager-dummy.m | 5 + .../Pods-RCTDataManager-prefix.pch | 5 + .../Pods-RCTDataManager.xcconfig | 0 .../Pods-RCTNetworkImage-Private.xcconfig | 5 + .../Pods-RCTNetworkImage-dummy.m | 5 + .../Pods-RCTNetworkImage-prefix.pch | 5 + .../Pods-RCTNetworkImage.xcconfig | 0 .../Pods-RCTText-Private.xcconfig | 5 + .../Pods-RCTText/Pods-RCTText-dummy.m | 5 + .../Pods-RCTText/Pods-RCTText-prefix.pch | 5 + .../Pods-RCTText/Pods-RCTText.xcconfig | 0 .../Pods-ReactKit-Private.xcconfig | 5 + .../Pods-ReactKit/Pods-ReactKit-dummy.m | 5 + .../Pods-ReactKit/Pods-ReactKit-prefix.pch | 5 + .../Pods-ReactKit/Pods-ReactKit.xcconfig | 0 .../Pods/Pods-acknowledgements.markdown | 3 + .../Pods/Pods-acknowledgements.plist | 29 + .../Target Support Files/Pods/Pods-dummy.m | 5 + .../Pods/Pods-environment.h | 32 + .../Pods/Pods-resources.sh | 74 + .../Pods/Pods.debug.xcconfig | 6 + .../Pods/Pods.release.xcconfig | 6 + Examples/TicTacToe/AppDelegate.m | 2 +- Examples/TicTacToe/Podfile | 5 + Examples/TicTacToe/Podfile.lock | 26 + .../RCTNetworkImage/RCTImageDownloader.h | 22 + .../RCTNetworkImage/RCTNetworkImageView.h | 32 + .../RCTNetworkImageViewManager.h | 8 + .../Public/RCTText/RCTRawTextManager.h | 7 + .../Headers/Public/RCTText/RCTShadowRawText.h | 9 + .../Headers/Public/RCTText/RCTShadowText.h | 26 + .../Pods/Headers/Public/RCTText/RCTText.h | 13 + .../Headers/Public/RCTText/RCTTextManager.h | 8 + .../Pods/Headers/Public/ReactKit/Layout.h | 148 + .../Headers/Public/ReactKit/RCTAlertManager.h | 9 + .../Public/ReactKit/RCTAnimationType.h | 11 + .../Pods/Headers/Public/ReactKit/RCTAssert.h | 36 + .../Public/ReactKit/RCTAutoInsetsProtocol.h | 13 + .../Pods/Headers/Public/ReactKit/RCTBridge.h | 107 + .../Headers/Public/ReactKit/RCTBridgeModule.h | 64 + .../Pods/Headers/Public/ReactKit/RCTCache.h | 22 + .../Public/ReactKit/RCTContextExecutor.h | 21 + .../Pods/Headers/Public/ReactKit/RCTConvert.h | 85 + .../Public/ReactKit/RCTEventDispatcher.h | 66 + .../Public/ReactKit/RCTExceptionsManager.h | 9 + .../Headers/Public/ReactKit/RCTInvalidating.h | 16 + .../Public/ReactKit/RCTJSMethodRegistrar.h | 24 + .../Public/ReactKit/RCTJavaScriptExecutor.h | 35 + .../Headers/Public/ReactKit/RCTKeyCommands.h | 28 + .../Pods/Headers/Public/ReactKit/RCTLog.h | 69 + .../Pods/Headers/Public/ReactKit/RCTNavItem.h | 14 + .../Public/ReactKit/RCTNavItemManager.h | 8 + .../Headers/Public/ReactKit/RCTNavigator.h | 26 + .../Public/ReactKit/RCTNavigatorManager.h | 8 + .../Public/ReactKit/RCTPointerEvents.h | 10 + .../Pods/Headers/Public/ReactKit/RCTRedBox.h | 16 + .../Headers/Public/ReactKit/RCTRootView.h | 44 + .../Headers/Public/ReactKit/RCTScrollView.h | 37 + .../Public/ReactKit/RCTScrollViewManager.h | 8 + .../Public/ReactKit/RCTScrollableProtocol.h | 18 + .../Headers/Public/ReactKit/RCTShadowView.h | 159 + .../Headers/Public/ReactKit/RCTSparseArray.h | 31 + .../Headers/Public/ReactKit/RCTStaticImage.h | 10 + .../Public/ReactKit/RCTStaticImageManager.h | 7 + .../Public/ReactKit/RCTStatusBarManager.h | 9 + .../Headers/Public/ReactKit/RCTTextField.h | 15 + .../Public/ReactKit/RCTTextFieldManager.h | 8 + .../Pods/Headers/Public/ReactKit/RCTTiming.h | 10 + .../Headers/Public/ReactKit/RCTTouchHandler.h | 15 + .../RCTUIActivityIndicatorViewManager.h | 7 + .../Headers/Public/ReactKit/RCTUIManager.h | 26 + .../Pods/Headers/Public/ReactKit/RCTUtils.h | 41 + .../Pods/Headers/Public/ReactKit/RCTView.h | 24 + .../Headers/Public/ReactKit/RCTViewManager.h | 148 + .../Public/ReactKit/RCTViewNodeProtocol.h | 26 + .../Public/ReactKit/RCTWebViewExecutor.h | 35 + .../ReactKit/RCTWrapperViewController.h | 24 + .../Headers/Public/ReactKit/UIView+ReactKit.h | 11 + .../Local Podspecs/RCTNetworkImage.podspec | 28 + .../Pods/Local Podspecs/RCTText.podspec | 28 + .../Pods/Local Podspecs/ReactKit.podspec | 16 + Examples/TicTacToe/Pods/Manifest.lock | 26 + .../Pods/Pods.xcodeproj/project.pbxproj | 3898 +++++++++++++++ .../Pods-RCTNetworkImage-Private.xcconfig | 5 + .../Pods-RCTNetworkImage-dummy.m | 5 + .../Pods-RCTNetworkImage-prefix.pch | 5 + .../Pods-RCTNetworkImage.xcconfig | 0 .../Pods-RCTText-Private.xcconfig | 5 + .../Pods-RCTText/Pods-RCTText-dummy.m | 5 + .../Pods-RCTText/Pods-RCTText-prefix.pch | 5 + .../Pods-RCTText/Pods-RCTText.xcconfig | 0 .../Pods-ReactKit-Private.xcconfig | 5 + .../Pods-ReactKit/Pods-ReactKit-dummy.m | 5 + .../Pods-ReactKit/Pods-ReactKit-prefix.pch | 5 + .../Pods-ReactKit/Pods-ReactKit.xcconfig | 0 .../Pods/Pods-acknowledgements.markdown | 3 + .../Pods/Pods-acknowledgements.plist | 29 + .../Target Support Files/Pods/Pods-dummy.m | 5 + .../Pods/Pods-environment.h | 26 + .../Pods/Pods-resources.sh | 74 + .../Pods/Pods.debug.xcconfig | 6 + .../Pods/Pods.release.xcconfig | 6 + .../TicTacToe.xcodeproj/project.pbxproj | 91 +- .../contents.xcworkspacedata | 10 + Examples/UIExplorer/TextInputExample.js | 33 + .../UIExplorer.xcodeproj/project.pbxproj | 171 +- Libraries/{Components => }/Image/Image.ios.js | 0 .../{Components => }/Image/ImageResizeMode.js | 0 .../Image/ImageSourcePropType.js | 0 .../Image/ImageStylePropTypes.js | 0 Libraries/Image/RCTImageDownloader.h | 22 + .../Image}/RCTImageDownloader.m | 0 Libraries/Image/RCTNetworkImage.podspec | 28 + .../RCTNetworkImage.xcodeproj/project.pbxproj | 367 ++ Libraries/Image/RCTNetworkImageView.h | 32 + .../Image}/RCTNetworkImageView.m | 0 Libraries/Image/RCTNetworkImageViewManager.h | 8 + .../Image}/RCTNetworkImageViewManager.m | 0 Libraries/{Components => }/Image/ix.js | 0 Libraries/Network/RCTDataManager.h | 10 + .../Network}/RCTDataManager.m | 0 Libraries/Network/RCTDataManager.podspec | 28 + .../RCTDataManager.xcodeproj/project.pbxproj | 355 ++ .../XMLHttpRequest.ios.js | 0 .../{Components => }/Text/ExpandingText.js | 0 Libraries/Text/RCTRawTextManager.h | 7 + .../Text}/RCTRawTextManager.m | 0 Libraries/Text/RCTShadowRawText.h | 9 + .../Text}/RCTShadowRawText.m | 0 Libraries/Text/RCTShadowText.h | 26 + .../Views => Libraries/Text}/RCTShadowText.m | 0 Libraries/Text/RCTText.h | 13 + {ReactKit/Views => Libraries/Text}/RCTText.m | 0 Libraries/Text/RCTText.podspec | 28 + .../Text/RCTText.xcodeproj/project.pbxproj | 379 ++ Libraries/Text/RCTTextManager.h | 8 + .../Views => Libraries/Text}/RCTTextManager.m | 0 Libraries/{Components => }/Text/Text.js | 0 .../Text/TextStylePropTypes.js | 0 ReactKit/Base/RCTRootView.h | 3 + ReactKit/Base/RCTRootView.m | 11 + ReactKit/Base/RCTTouchHandler.h | 6 +- ReactKit/Base/RCTTouchHandler.m | 158 +- ReactKit/Modules/RCTUIManager.m | 39 + ReactKit/ReactKit.podspec | 16 + ReactKit/ReactKit.xcodeproj/project.pbxproj | 62 +- .../xcshareddata/xcschemes/ReactKit.xcscheme | 110 - ReactKit/Views/RCTTextFieldManager.m | 1 + .../react-packager/src/JSTransformer/index.js | 2 +- packager/react-packager/src/Packager/index.js | 2 +- packager/react-packager/src/Server/index.js | 2 +- 218 files changed, 14048 insertions(+), 278 deletions(-) create mode 100644 Examples/Movies/Movies.xcworkspace/contents.xcworkspacedata create mode 100644 Examples/Movies/Podfile create mode 100644 Examples/Movies/Podfile.lock rename {ReactKit/Modules => Examples/Movies/Pods/Headers/Public/RCTDataManager}/RCTDataManager.h (100%) rename {ReactKit/Base => Examples/Movies/Pods/Headers/Public/RCTNetworkImage}/RCTImageDownloader.h (100%) rename {ReactKit/Views => Examples/Movies/Pods/Headers/Public/RCTNetworkImage}/RCTNetworkImageView.h (100%) rename {ReactKit/Views => Examples/Movies/Pods/Headers/Public/RCTNetworkImage}/RCTNetworkImageViewManager.h (100%) rename {ReactKit/Views => Examples/Movies/Pods/Headers/Public/RCTText}/RCTRawTextManager.h (100%) rename {ReactKit/Views => Examples/Movies/Pods/Headers/Public/RCTText}/RCTShadowRawText.h (100%) rename {ReactKit/Views => Examples/Movies/Pods/Headers/Public/RCTText}/RCTShadowText.h (100%) rename {ReactKit/Views => Examples/Movies/Pods/Headers/Public/RCTText}/RCTText.h (100%) rename {ReactKit/Views => Examples/Movies/Pods/Headers/Public/RCTText}/RCTTextManager.h (100%) create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/Layout.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTAlertManager.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTAnimationType.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTAssert.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTAutoInsetsProtocol.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridge.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridgeModule.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTCache.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTContextExecutor.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTConvert.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTEventDispatcher.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTExceptionsManager.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTInvalidating.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTJSMethodRegistrar.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTKeyCommands.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTLog.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavItem.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavItemManager.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigator.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigatorManager.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTPointerEvents.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTRedBox.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTRootView.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollView.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollViewManager.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollableProtocol.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTShadowView.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTSparseArray.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTStaticImage.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTStaticImageManager.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTStatusBarManager.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextField.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextFieldManager.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTTiming.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTTouchHandler.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIActivityIndicatorViewManager.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIManager.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTUtils.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTView.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewManager.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTWebViewExecutor.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/UIView+ReactKit.h create mode 100644 Examples/Movies/Pods/Local Podspecs/RCTDataManager.podspec create mode 100644 Examples/Movies/Pods/Local Podspecs/RCTNetworkImage.podspec create mode 100644 Examples/Movies/Pods/Local Podspecs/RCTText.podspec create mode 100644 Examples/Movies/Pods/Local Podspecs/ReactKit.podspec create mode 100644 Examples/Movies/Pods/Manifest.lock create mode 100644 Examples/Movies/Pods/Pods.xcodeproj/project.pbxproj create mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-Private.xcconfig create mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-dummy.m create mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-prefix.pch create mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager.xcconfig create mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-Private.xcconfig create mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-dummy.m create mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch create mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage.xcconfig create mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-Private.xcconfig create mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-dummy.m create mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch create mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText.xcconfig create mode 100644 Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-Private.xcconfig create mode 100644 Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-dummy.m create mode 100644 Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch create mode 100644 Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit.xcconfig create mode 100644 Examples/Movies/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown create mode 100644 Examples/Movies/Pods/Target Support Files/Pods/Pods-acknowledgements.plist create mode 100644 Examples/Movies/Pods/Target Support Files/Pods/Pods-dummy.m create mode 100644 Examples/Movies/Pods/Target Support Files/Pods/Pods-environment.h create mode 100755 Examples/Movies/Pods/Target Support Files/Pods/Pods-resources.sh create mode 100644 Examples/Movies/Pods/Target Support Files/Pods/Pods.debug.xcconfig create mode 100644 Examples/Movies/Pods/Target Support Files/Pods/Pods.release.xcconfig create mode 100644 Examples/TicTacToe/Podfile create mode 100644 Examples/TicTacToe/Podfile.lock create mode 100644 Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTImageDownloader.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageViewManager.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTRawTextManager.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTShadowRawText.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTShadowText.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTText.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTTextManager.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/Layout.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAlertManager.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAnimationType.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAssert.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAutoInsetsProtocol.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridge.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridgeModule.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTCache.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTContextExecutor.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTConvert.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTEventDispatcher.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTExceptionsManager.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTInvalidating.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJSMethodRegistrar.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTKeyCommands.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLog.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavItem.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavItemManager.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigator.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigatorManager.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTPointerEvents.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTRedBox.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTRootView.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollView.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollViewManager.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollableProtocol.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTShadowView.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTSparseArray.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStaticImage.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStaticImageManager.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStatusBarManager.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextField.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextFieldManager.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTiming.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTouchHandler.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIActivityIndicatorViewManager.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIManager.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUtils.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTView.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewManager.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWebViewExecutor.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/UIView+ReactKit.h create mode 100644 Examples/TicTacToe/Pods/Local Podspecs/RCTNetworkImage.podspec create mode 100644 Examples/TicTacToe/Pods/Local Podspecs/RCTText.podspec create mode 100644 Examples/TicTacToe/Pods/Local Podspecs/ReactKit.podspec create mode 100644 Examples/TicTacToe/Pods/Manifest.lock create mode 100644 Examples/TicTacToe/Pods/Pods.xcodeproj/project.pbxproj create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-Private.xcconfig create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-dummy.m create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage.xcconfig create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-Private.xcconfig create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-dummy.m create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText.xcconfig create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-Private.xcconfig create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-dummy.m create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit.xcconfig create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-acknowledgements.plist create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-dummy.m create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-environment.h create mode 100755 Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-resources.sh create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods/Pods.debug.xcconfig create mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods/Pods.release.xcconfig create mode 100644 Examples/TicTacToe/TicTacToe.xcworkspace/contents.xcworkspacedata rename Libraries/{Components => }/Image/Image.ios.js (100%) rename Libraries/{Components => }/Image/ImageResizeMode.js (100%) rename Libraries/{Components => }/Image/ImageSourcePropType.js (100%) rename Libraries/{Components => }/Image/ImageStylePropTypes.js (100%) create mode 100644 Libraries/Image/RCTImageDownloader.h rename {ReactKit/Base => Libraries/Image}/RCTImageDownloader.m (100%) create mode 100644 Libraries/Image/RCTNetworkImage.podspec create mode 100644 Libraries/Image/RCTNetworkImage.xcodeproj/project.pbxproj create mode 100644 Libraries/Image/RCTNetworkImageView.h rename {ReactKit/Views => Libraries/Image}/RCTNetworkImageView.m (100%) create mode 100644 Libraries/Image/RCTNetworkImageViewManager.h rename {ReactKit/Views => Libraries/Image}/RCTNetworkImageViewManager.m (100%) rename Libraries/{Components => }/Image/ix.js (100%) create mode 100644 Libraries/Network/RCTDataManager.h rename {ReactKit/Modules => Libraries/Network}/RCTDataManager.m (100%) create mode 100644 Libraries/Network/RCTDataManager.podspec create mode 100644 Libraries/Network/RCTDataManager.xcodeproj/project.pbxproj rename Libraries/{XMLHttpRequest => Network}/XMLHttpRequest.ios.js (100%) rename Libraries/{Components => }/Text/ExpandingText.js (100%) create mode 100644 Libraries/Text/RCTRawTextManager.h rename {ReactKit/Views => Libraries/Text}/RCTRawTextManager.m (100%) create mode 100644 Libraries/Text/RCTShadowRawText.h rename {ReactKit/Views => Libraries/Text}/RCTShadowRawText.m (100%) create mode 100644 Libraries/Text/RCTShadowText.h rename {ReactKit/Views => Libraries/Text}/RCTShadowText.m (100%) create mode 100644 Libraries/Text/RCTText.h rename {ReactKit/Views => Libraries/Text}/RCTText.m (100%) create mode 100644 Libraries/Text/RCTText.podspec create mode 100644 Libraries/Text/RCTText.xcodeproj/project.pbxproj create mode 100644 Libraries/Text/RCTTextManager.h rename {ReactKit/Views => Libraries/Text}/RCTTextManager.m (100%) rename Libraries/{Components => }/Text/Text.js (100%) rename Libraries/{Components => }/Text/TextStylePropTypes.js (100%) create mode 100644 ReactKit/ReactKit.podspec delete mode 100644 ReactKit/ReactKit.xcodeproj/xcshareddata/xcschemes/ReactKit.xcscheme diff --git a/.gitignore b/.gitignore index 392c6ee02..6f1bc0b9c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ # Xcode -# !**/*.xcodeproj !**/*.pbxproj !**/*.xcworkspacedata @@ -22,4 +21,8 @@ DerivedData *.ipa *.xcuserstate +# OS X +.DS_Store + +# Node node_modules diff --git a/Examples/Movies/AppDelegate.m b/Examples/Movies/AppDelegate.m index c01fc2ca9..a402c7901 100644 --- a/Examples/Movies/AppDelegate.m +++ b/Examples/Movies/AppDelegate.m @@ -2,7 +2,7 @@ #import "AppDelegate.h" -#import "RCTRootView.h" +#import @implementation AppDelegate diff --git a/Examples/Movies/Movies.xcodeproj/project.pbxproj b/Examples/Movies/Movies.xcodeproj/project.pbxproj index e2fd6fc01..6e3846623 100644 --- a/Examples/Movies/Movies.xcodeproj/project.pbxproj +++ b/Examples/Movies/Movies.xcodeproj/project.pbxproj @@ -11,19 +11,9 @@ 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 8323482C1A77B59500B55238 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832348291A77B50100B55238 /* libReactKit.a */; }; + 8A63AAB95DEC603F81CC9914 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C80E9DAC4721961D27A5C59 /* libPods.a */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 832348281A77B50100B55238 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 834D32361A76971A00F38302 /* ReactKit.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; - remoteInfo = ReactKit; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXFileReference section */ 13B07F961A680F5B00A75B9A /* Movies.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Movies.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; @@ -32,7 +22,17 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 834D32361A76971A00F38302 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = ""; }; + 1C80E9DAC4721961D27A5C59 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 484633F6AF8FF4B8EB89512A /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; + 5845B59FBF51C4AAA4222097 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + 587650991A9EA0C6008B8F17 /* libPods-RCTDataManager.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-RCTDataManager.a"; path = "Pods/build/Debug-iphoneos/libPods-RCTDataManager.a"; sourceTree = ""; }; + 5876509A1A9EA0C6008B8F17 /* libPods-RCTNetworkImage.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-RCTNetworkImage.a"; path = "Pods/build/Debug-iphoneos/libPods-RCTNetworkImage.a"; sourceTree = ""; }; + 5876509B1A9EA0C6008B8F17 /* libPods-RCTText.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-RCTText.a"; path = "Pods/build/Debug-iphoneos/libPods-RCTText.a"; sourceTree = ""; }; + 5876509C1A9EA0C6008B8F17 /* libPods-ReactKit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-ReactKit.a"; path = "Pods/build/Debug-iphoneos/libPods-ReactKit.a"; sourceTree = ""; }; + 587650A11A9EA235008B8F17 /* libPods-RCTDataManager.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-RCTDataManager.a"; path = "Pods/build/Debug-iphoneos/libPods-RCTDataManager.a"; sourceTree = ""; }; + 587650A21A9EA235008B8F17 /* libPods-RCTNetworkImage.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-RCTNetworkImage.a"; path = "Pods/build/Debug-iphoneos/libPods-RCTNetworkImage.a"; sourceTree = ""; }; + 587650A31A9EA235008B8F17 /* libPods-RCTText.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-RCTText.a"; path = "Pods/build/Debug-iphoneos/libPods-RCTText.a"; sourceTree = ""; }; + 587650A41A9EA235008B8F17 /* libPods-ReactKit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-ReactKit.a"; path = "Pods/build/Debug-iphoneos/libPods-ReactKit.a"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -40,13 +40,22 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 8323482C1A77B59500B55238 /* libReactKit.a in Frameworks */, + 8A63AAB95DEC603F81CC9914 /* libPods.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 0D1AC39A16823DF8332A23B7 /* Pods */ = { + isa = PBXGroup; + children = ( + 5845B59FBF51C4AAA4222097 /* Pods.debug.xcconfig */, + 484633F6AF8FF4B8EB89512A /* Pods.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; 13B07FAE1A68108700A75B9A /* Movies */ = { isa = PBXGroup; children = ( @@ -60,20 +69,13 @@ name = Movies; sourceTree = ""; }; - 832348241A77B50100B55238 /* Products */ = { - isa = PBXGroup; - children = ( - 832348291A77B50100B55238 /* libReactKit.a */, - ); - name = Products; - sourceTree = ""; - }; 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( - 834D32361A76971A00F38302 /* ReactKit.xcodeproj */, 13B07FAE1A68108700A75B9A /* Movies */, 83CBBA001A601CBA00E9B192 /* Products */, + 0D1AC39A16823DF8332A23B7 /* Pods */, + B748CE19D7EAD496E0205240 /* Frameworks */, ); sourceTree = ""; }; @@ -85,6 +87,22 @@ name = Products; sourceTree = ""; }; + B748CE19D7EAD496E0205240 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 587650A11A9EA235008B8F17 /* libPods-RCTDataManager.a */, + 587650A21A9EA235008B8F17 /* libPods-RCTNetworkImage.a */, + 587650A31A9EA235008B8F17 /* libPods-RCTText.a */, + 587650A41A9EA235008B8F17 /* libPods-ReactKit.a */, + 587650991A9EA0C6008B8F17 /* libPods-RCTDataManager.a */, + 5876509A1A9EA0C6008B8F17 /* libPods-RCTNetworkImage.a */, + 5876509B1A9EA0C6008B8F17 /* libPods-RCTText.a */, + 5876509C1A9EA0C6008B8F17 /* libPods-ReactKit.a */, + 1C80E9DAC4721961D27A5C59 /* libPods.a */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -92,9 +110,11 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Movies" */; buildPhases = ( + 480757813B188E9D7AD89A37 /* Check Pods Manifest.lock */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, + 602457BB761A1DB37CEBD865 /* Copy Pods Resources */, ); buildRules = ( ); @@ -125,12 +145,6 @@ mainGroup = 83CBB9F61A601CBA00E9B192; productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 832348241A77B50100B55238 /* Products */; - ProjectRef = 834D32361A76971A00F38302 /* ReactKit.xcodeproj */; - }, - ); projectRoot = ""; targets = ( 13B07F861A680F5B00A75B9A /* Movies */, @@ -138,16 +152,6 @@ }; /* End PBXProject section */ -/* Begin PBXReferenceProxy section */ - 832348291A77B50100B55238 /* libReactKit.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libReactKit.a; - remoteRef = 832348281A77B50100B55238 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - /* Begin PBXResourcesBuildPhase section */ 13B07F8E1A680F5B00A75B9A /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -160,6 +164,39 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 480757813B188E9D7AD89A37 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 602457BB761A1DB37CEBD865 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 13B07F871A680F5B00A75B9A /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -186,22 +223,44 @@ /* Begin XCBuildConfiguration section */ 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 5845B59FBF51C4AAA4222097 /* Pods.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = "-ObjC"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Pods/build/Debug-iphoneos", + ); + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "$(inherited)"; PRODUCT_NAME = Movies; }; name = Debug; }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 484633F6AF8FF4B8EB89512A /* Pods.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = "-ObjC"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Pods/build/Debug-iphoneos", + ); + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "$(inherited)"; PRODUCT_NAME = Movies; }; name = Release; diff --git a/Examples/Movies/Movies.xcworkspace/contents.xcworkspacedata b/Examples/Movies/Movies.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..c4885a713 --- /dev/null +++ b/Examples/Movies/Movies.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Examples/Movies/Podfile b/Examples/Movies/Podfile new file mode 100644 index 000000000..c8e32868d --- /dev/null +++ b/Examples/Movies/Podfile @@ -0,0 +1,6 @@ +source 'https://github.com/CocoaPods/Specs.git' + +pod 'RCTDataManager', :path => '../../Libraries/Network' +pod 'RCTNetworkImage', :path => '../../Libraries/Image' +pod 'RCTText', :path => '../../Libraries/Text' +pod 'ReactKit', :path => '../../ReactKit' diff --git a/Examples/Movies/Podfile.lock b/Examples/Movies/Podfile.lock new file mode 100644 index 000000000..cc2a8f981 --- /dev/null +++ b/Examples/Movies/Podfile.lock @@ -0,0 +1,32 @@ +PODS: + - RCTDataManager (0.0.1): + - ReactKit (~> 0.0.1) + - RCTNetworkImage (0.0.1): + - ReactKit (~> 0.0.1) + - RCTText (0.0.1): + - ReactKit (~> 0.0.1) + - ReactKit (0.0.1) + +DEPENDENCIES: + - RCTDataManager (from `../../Libraries/Network`) + - RCTNetworkImage (from `../../Libraries/Image`) + - RCTText (from `../../Libraries/Text`) + - ReactKit (from `../../ReactKit`) + +EXTERNAL SOURCES: + RCTDataManager: + :path: ../../Libraries/Network + RCTNetworkImage: + :path: ../../Libraries/Image + RCTText: + :path: ../../Libraries/Text + ReactKit: + :path: ../../ReactKit + +SPEC CHECKSUMS: + RCTDataManager: d38d2a6555886d68e8de623c4b97e2acdf01ed3e + RCTNetworkImage: 6d99735875916e098a65c68a54a72e67e24a402a + RCTText: 5c0cf4635241e8c02e8933853df03809d2dc8327 + ReactKit: 65c02c1e95951c198e491d2a4c1972675d4af254 + +COCOAPODS: 0.35.0 diff --git a/ReactKit/Modules/RCTDataManager.h b/Examples/Movies/Pods/Headers/Public/RCTDataManager/RCTDataManager.h similarity index 100% rename from ReactKit/Modules/RCTDataManager.h rename to Examples/Movies/Pods/Headers/Public/RCTDataManager/RCTDataManager.h diff --git a/ReactKit/Base/RCTImageDownloader.h b/Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTImageDownloader.h similarity index 100% rename from ReactKit/Base/RCTImageDownloader.h rename to Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTImageDownloader.h diff --git a/ReactKit/Views/RCTNetworkImageView.h b/Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h similarity index 100% rename from ReactKit/Views/RCTNetworkImageView.h rename to Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h diff --git a/ReactKit/Views/RCTNetworkImageViewManager.h b/Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageViewManager.h similarity index 100% rename from ReactKit/Views/RCTNetworkImageViewManager.h rename to Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageViewManager.h diff --git a/ReactKit/Views/RCTRawTextManager.h b/Examples/Movies/Pods/Headers/Public/RCTText/RCTRawTextManager.h similarity index 100% rename from ReactKit/Views/RCTRawTextManager.h rename to Examples/Movies/Pods/Headers/Public/RCTText/RCTRawTextManager.h diff --git a/ReactKit/Views/RCTShadowRawText.h b/Examples/Movies/Pods/Headers/Public/RCTText/RCTShadowRawText.h similarity index 100% rename from ReactKit/Views/RCTShadowRawText.h rename to Examples/Movies/Pods/Headers/Public/RCTText/RCTShadowRawText.h diff --git a/ReactKit/Views/RCTShadowText.h b/Examples/Movies/Pods/Headers/Public/RCTText/RCTShadowText.h similarity index 100% rename from ReactKit/Views/RCTShadowText.h rename to Examples/Movies/Pods/Headers/Public/RCTText/RCTShadowText.h diff --git a/ReactKit/Views/RCTText.h b/Examples/Movies/Pods/Headers/Public/RCTText/RCTText.h similarity index 100% rename from ReactKit/Views/RCTText.h rename to Examples/Movies/Pods/Headers/Public/RCTText/RCTText.h diff --git a/ReactKit/Views/RCTTextManager.h b/Examples/Movies/Pods/Headers/Public/RCTText/RCTTextManager.h similarity index 100% rename from ReactKit/Views/RCTTextManager.h rename to Examples/Movies/Pods/Headers/Public/RCTText/RCTTextManager.h diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/Layout.h b/Examples/Movies/Pods/Headers/Public/ReactKit/Layout.h new file mode 100644 index 000000000..51f72493b --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/Layout.h @@ -0,0 +1,148 @@ +/** + * @generated SignedSource<<58298c7a8815a8675e970b0347dedfed>> + * + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * !! This file is a check-in from github! !! + * !! !! + * !! You should not modify this file directly. Instead: !! + * !! 1) Go to https://github.com/facebook/css-layout !! + * !! 2) Make a pull request and get it merged !! + * !! 3) Execute ./import.sh to pull in the latest version !! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#ifndef __LAYOUT_H +#define __LAYOUT_H + +#include +#include +#define CSS_UNDEFINED NAN + +typedef enum { + CSS_FLEX_DIRECTION_COLUMN = 0, + CSS_FLEX_DIRECTION_ROW +} css_flex_direction_t; + +typedef enum { + CSS_JUSTIFY_FLEX_START = 0, + CSS_JUSTIFY_CENTER, + CSS_JUSTIFY_FLEX_END, + CSS_JUSTIFY_SPACE_BETWEEN, + CSS_JUSTIFY_SPACE_AROUND +} css_justify_t; + +// Note: auto is only a valid value for alignSelf. It is NOT a valid value for +// alignItems. +typedef enum { + CSS_ALIGN_AUTO = 0, + CSS_ALIGN_FLEX_START, + CSS_ALIGN_CENTER, + CSS_ALIGN_FLEX_END, + CSS_ALIGN_STRETCH +} css_align_t; + +typedef enum { + CSS_POSITION_RELATIVE = 0, + CSS_POSITION_ABSOLUTE +} css_position_type_t; + +typedef enum { + CSS_NOWRAP = 0, + CSS_WRAP +} css_wrap_type_t; + +// Note: left and top are shared between position[2] and position[4], so +// they have to be before right and bottom. +typedef enum { + CSS_LEFT = 0, + CSS_TOP, + CSS_RIGHT, + CSS_BOTTOM, + CSS_POSITION_COUNT +} css_position_t; + +typedef enum { + CSS_WIDTH = 0, + CSS_HEIGHT +} css_dimension_t; + +typedef struct { + float position[2]; + float dimensions[2]; + + // Instead of recomputing the entire layout every single time, we + // cache some information to break early when nothing changed + bool should_update; + float last_requested_dimensions[2]; + float last_parent_max_width; + float last_dimensions[2]; + float last_position[2]; +} css_layout_t; + +typedef struct { + float dimensions[2]; +} css_dim_t; + +typedef struct { + css_flex_direction_t flex_direction; + css_justify_t justify_content; + css_align_t align_items; + css_align_t align_self; + css_position_type_t position_type; + css_wrap_type_t flex_wrap; + float flex; + float margin[4]; + float position[4]; + /** + * You should skip all the rules that contain negative values for the + * following attributes. For example: + * {padding: 10, paddingLeft: -5} + * should output: + * {left: 10 ...} + * the following two are incorrect: + * {left: -5 ...} + * {left: 0 ...} + */ + float padding[4]; + float border[4]; + float dimensions[2]; +} css_style_t; + +typedef struct css_node { + css_style_t style; + css_layout_t layout; + int children_count; + + css_dim_t (*measure)(void *context, float width); + void (*print)(void *context); + struct css_node* (*get_child)(void *context, int i); + bool (*is_dirty)(void *context); + void *context; +} css_node_t; + + +// Lifecycle of nodes and children +css_node_t *new_css_node(void); +void init_css_node(css_node_t *node); +void free_css_node(css_node_t *node); + +// Print utilities +typedef enum { + CSS_PRINT_LAYOUT = 1, + CSS_PRINT_STYLE = 2, + CSS_PRINT_CHILDREN = 4, +} css_print_options_t; +void print_css_node(css_node_t *node, css_print_options_t options); + +// Function that computes the layout! +void layoutNode(css_node_t *node, float maxWidth); +bool isUndefined(float value); + +#endif diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAlertManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAlertManager.h new file mode 100644 index 000000000..e24e0bc95 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAlertManager.h @@ -0,0 +1,9 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTBridgeModule.h" + +@interface RCTAlertManager : NSObject + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAnimationType.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAnimationType.h new file mode 100644 index 000000000..dae90b845 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAnimationType.h @@ -0,0 +1,11 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +typedef NS_ENUM(NSInteger, RCTAnimationType) { + RCTAnimationTypeSpring = 0, + RCTAnimationTypeLinear, + RCTAnimationTypeEaseIn, + RCTAnimationTypeEaseOut, + RCTAnimationTypeEaseInEaseOut, +}; diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAssert.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAssert.h new file mode 100644 index 000000000..66f670430 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAssert.h @@ -0,0 +1,36 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#define RCTErrorDomain @"RCTErrorDomain" + +#define RCTAssert(condition, message, ...) _RCTAssert(condition, message, ##__VA_ARGS__) +#define RCTCAssert(condition, message, ...) _RCTCAssert(condition, message, ##__VA_ARGS__) + +typedef void (^RCTAssertFunction)(BOOL condition, NSString *message, ...); + +extern RCTAssertFunction RCTInjectedAssertFunction; +extern RCTAssertFunction RCTInjectedCAssertFunction; + +void RCTInjectAssertFunctions(RCTAssertFunction assertFunction, RCTAssertFunction cAssertFunction); + +#define _RCTAssert(condition, message, ...) \ +do { \ + if (RCTInjectedAssertFunction) { \ + RCTInjectedAssertFunction(condition, message, ##__VA_ARGS__); \ + } else { \ + NSAssert(condition, message, ##__VA_ARGS__); \ + } \ +} while (false) + +#define _RCTCAssert(condition, message, ...) \ +do { \ + if (RCTInjectedCAssertFunction) { \ + RCTInjectedCAssertFunction(condition, message, ##__VA_ARGS__); \ + } else { \ + NSCAssert(condition, message, ##__VA_ARGS__); \ + } \ +} while (false) + +#define RCTAssertMainThread() RCTAssert([NSThread isMainThread], @"This method must be called on the main thread"); +#define RCTCAssertMainThread() RCTCAssert([NSThread isMainThread], @"This function must be called on the main thread"); diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAutoInsetsProtocol.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAutoInsetsProtocol.h new file mode 100644 index 000000000..4f1cd4ba2 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAutoInsetsProtocol.h @@ -0,0 +1,13 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +/** + * Defines a View that wants to support auto insets adjustment + */ +@protocol RCTAutoInsetsProtocol + +@property (nonatomic, assign, readwrite) UIEdgeInsets contentInset; +@property (nonatomic, assign, readwrite) BOOL automaticallyAdjustContentInsets; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridge.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridge.h new file mode 100644 index 000000000..9a890a07a --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridge.h @@ -0,0 +1,107 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTBridgeModule.h" +#import "RCTInvalidating.h" +#import "RCTJavaScriptExecutor.h" + +@class RCTBridge; +@class RCTEventDispatcher; +@class RCTRootView; + +/** + * Utilities for constructing common response objects. When sending a + * systemError back to JS, it's important to describe whether or not it was a + * system error, or API usage error. System errors should never happen and are + * therefore logged using `RCTLogError()`. API usage errors are expected if the + * API is misused and will therefore not be logged using `RCTLogError()`. The JS + * application code is expected to handle them. Regardless of type, each error + * should be logged at most once. + */ +static inline NSDictionary *RCTSystemErrorObject(NSString *msg) +{ + return @{@"systemError": msg ?: @""}; +} + +static inline NSDictionary *RCTAPIErrorObject(NSString *msg) +{ + return @{@"apiError": msg ?: @""}; +} + +/** + * This block can be used to instantiate modules that require additional + * init parameters, or additional configuration prior to being used. + */ +typedef NSArray *(^RCTBridgeModuleProviderBlock)(RCTBridge *bridge); + +/** + * Async batched bridge used to communicate with the JavaScript application. + */ +@interface RCTBridge : NSObject + +/** + * The designated initializer. This creates a new bridge on top of the specified + * executor. The bridge should then be used for all subsequent communication + * with the JavaScript code running in the executor. Modules will be automatically + * instantiated using the default contructor, but you can optionally pass in a + * module provider block to manually instantiate modules that require additional + * init parameters or configuration. + */ +- (instancetype)initWithJavaScriptExecutor:(id)javaScriptExecutor + moduleProvider:(RCTBridgeModuleProviderBlock)block NS_DESIGNATED_INITIALIZER; + +/** + * This method is used to call functions in the JavaScript application context. + * It is primarily intended for use by modules that require two-way communication + * with the JavaScript code. + */ +- (void)enqueueJSCall:(NSString *)moduleDotMethod args:(NSArray *)args; + +/** + * This method is used to execute a new application script. It is called + * internally whenever a JS application bundle is loaded/reloaded, but should + * probably not be used at any other time. + */ +- (void)enqueueApplicationScript:(NSString *)script url:(NSURL *)url onComplete:(RCTJavaScriptCompleteBlock)onComplete; + +/** + * The event dispatcher is a wrapper around -enqueueJSCall:args: that provides a + * higher-level interface for sending UI events such as touches and text input. + */ +@property (nonatomic, readonly) RCTEventDispatcher *eventDispatcher; + +/** + * A dictionary of all registered RCTBridgeModule instances, keyed by moduleName. + */ +@property (nonatomic, copy, readonly) NSDictionary *modules; + +/** + * The shadow queue is used to execute callbacks from the JavaScript code. All + * native hooks (e.g. exported module methods) will be executed on the shadow + * queue. + */ +@property (nonatomic, readonly) dispatch_queue_t shadowQueue; + +// For use in implementing delegates, which may need to queue responses. +- (RCTResponseSenderBlock)createResponseSenderBlock:(NSInteger)callbackID; + +/** + * Register a root view with the bridge. Theorectically, a single bridge can + * support multiple root views, however this feature is not currently exposed + * and may eventually be removed. + */ +- (void)registerRootView:(RCTRootView *)rootView; + +/** + * Global logging function that will print to both xcode and JS debugger consoles. + * + * NOTE: Use via RCTLog* macros defined in RCTLog.h + * TODO (#5906496): should log function be exposed here, or could it be a module? + */ ++ (void)log:(NSArray *)objects level:(NSString *)level; + +/** + * Method to check that a valid executor exists with which to log + */ ++ (BOOL)hasValidJSExecutor; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridgeModule.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridgeModule.h new file mode 100644 index 000000000..d9df70a22 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridgeModule.h @@ -0,0 +1,64 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTJSMethodRegistrar.h" + +@class RCTBridge; + +/** + * The type of a block that is capable of sending a response to a bridged + * operation. Use this for returning callback methods to JS. + */ +typedef void (^RCTResponseSenderBlock)(NSArray *response); + +/** + * Provides the interface needed to register a bridge module. + */ +@protocol RCTBridgeModule +@optional + +/** + * Optional initializer for modules that require access + * to bridge features, such as sending events or making JS calls + */ +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +/** + * The module name exposed to JS. If omitted, this will be inferred + * automatically by using the native module's class name. + */ ++ (NSString *)moduleName; + +/** + * Place this macro inside the method body of any method you want to expose + * to JS. The optional js_name argument will be used as the JS method name + * (the method will be namespaced to the module name, as specified above). + * If omitted, the JS method name will match the first part of the Objective-C + * method selector name (up to the first colon). + */ +#define RCT_EXPORT(js_name) __attribute__((used, section("__DATA,RCTExport" \ +))) static const char *__rct_export_entry__[] = { __func__, #js_name } + +/** + * Injects constants into JS. These constants are made accessible via + * NativeModules.moduleName.X. Note that this method is not inherited when you + * subclass a module, and you should not call [super constantsToExport] when + * implementing it. + */ ++ (NSDictionary *)constantsToExport; + +/** + * Some "constants" are not really constant, and need to be re-generated + * each time the bridge module is created. Support for this feature is + * deprecated and may be going away or changing, but for now you can use + * the -constantsToExport instance method to register these "pseudo-constants". + */ +- (NSDictionary *)constantsToExport; + +/** + * Notifies the module that a batch of JS method invocations has just completed. + */ +- (void)batchDidComplete; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTCache.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTCache.h new file mode 100644 index 000000000..75943ae4f --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTCache.h @@ -0,0 +1,22 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTCache : NSObject + +- (instancetype)init; // name = @"default" +- (instancetype)initWithName:(NSString *)name; + +@property (nonatomic, assign) NSUInteger maximumDiskSize; // in bytes + +#pragma mark - Retrieval + +- (BOOL)hasDataForKey:(NSString *)key; +- (void)fetchDataForKey:(NSString *)key completionHandler:(void (^)(NSData *data))completionHandler; + +#pragma mark - Insertion + +- (void)setData:(NSData *)data forKey:(NSString *)key; +- (void)removeAllData; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTContextExecutor.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTContextExecutor.h new file mode 100644 index 000000000..638ad8ba6 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTContextExecutor.h @@ -0,0 +1,21 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTJavaScriptExecutor.h" + +// TODO (#5906496): Might RCTJSCoreExecutor be a better name for this? + +/** + * Uses a JavaScriptCore context as the execution engine. + */ +@interface RCTContextExecutor : NSObject + +/** + * Configures the executor to run JavaScript on a custom performer. + * You probably don't want to use this; use -init instead. + */ +- (instancetype)initWithJavaScriptThread:(NSThread *)javaScriptThread + globalContextRef:(JSGlobalContextRef)context; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTConvert.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTConvert.h new file mode 100644 index 000000000..51a6b76ce --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTConvert.h @@ -0,0 +1,85 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import +#import + +#import "Layout.h" +#import "RCTPointerEvents.h" +#import "RCTAnimationType.h" + +/** + * This class provides a collection of conversion functions for mapping + * JSON objects to native types and classes. These are useful when writing + * custom RCTViewManager setter methods. + */ +@interface RCTConvert : NSObject + ++ (BOOL)BOOL:(id)json; ++ (double)double:(id)json; ++ (float)float:(id)json; ++ (int)int:(id)json; + ++ (NSString *)NSString:(id)json; ++ (NSNumber *)NSNumber:(id)json; ++ (NSInteger)NSInteger:(id)json; ++ (NSUInteger)NSUInteger:(id)json; + ++ (NSURL *)NSURL:(id)json; ++ (NSURLRequest *)NSURLRequest:(id)json; + ++ (NSDate *)NSDate:(id)json; ++ (NSTimeZone *)NSTimeZone:(id)json; ++ (NSTimeInterval)NSTimeInterval:(id)json; + ++ (NSTextAlignment)NSTextAlignment:(id)json; ++ (NSWritingDirection)NSWritingDirection:(id)json; ++ (UITextAutocapitalizationType)UITextAutocapitalizationType:(id)json; ++ (UIKeyboardType)UIKeyboardType:(id)json; + ++ (CGFloat)CGFloat:(id)json; ++ (CGPoint)CGPoint:(id)json; ++ (CGSize)CGSize:(id)json; ++ (CGRect)CGRect:(id)json; ++ (UIEdgeInsets)UIEdgeInsets:(id)json; + ++ (CATransform3D)CATransform3D:(id)json; ++ (CGAffineTransform)CGAffineTransform:(id)json; + ++ (UIColor *)UIColor:(id)json; ++ (CGColorRef)CGColor:(id)json; + ++ (CAKeyframeAnimation *)GIF:(id)json; ++ (UIImage *)UIImage:(id)json; ++ (CGImageRef)CGImage:(id)json; + ++ (UIFont *)UIFont:(UIFont *)font withSize:(id)json; ++ (UIFont *)UIFont:(UIFont *)font withWeight:(id)json; ++ (UIFont *)UIFont:(UIFont *)font withFamily:(id)json; ++ (UIFont *)UIFont:(UIFont *)font withFamily:(id)json size:(id)json weight:(id)json; + ++ (BOOL)css_overflow:(id)json; ++ (css_flex_direction_t)css_flex_direction_t:(id)json; ++ (css_justify_t)css_justify_t:(id)json; ++ (css_align_t)css_align_t:(id)json; ++ (css_position_type_t)css_position_type_t:(id)json; ++ (css_wrap_type_t)css_wrap_type_t:(id)json; + ++ (RCTPointerEvents)RCTPointerEvents:(id)json; ++ (RCTAnimationType)RCTAnimationType:(id)json; + +@end + +/** + * This function will attempt to set a property using a json value by first + * inferring the correct type from all available information, and then + * applying an appropriate conversion method. If the property does not + * exist, or the type cannot be inferred, the function will return NO. + */ +BOOL RCTSetProperty(id target, NSString *keypath, id json); + +/** + * This function attempts to copy a property from the source object to the + * destination object using KVC. If the property does not exist, or cannot + * be set, it will do nothing and return NO. + */ +BOOL RCTCopyProperty(id target, id source, NSString *keypath); diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTEventDispatcher.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTEventDispatcher.h new file mode 100644 index 000000000..5c97c8de6 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTEventDispatcher.h @@ -0,0 +1,66 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@class RCTBridge; + +typedef NS_ENUM(NSInteger, RCTTextEventType) { + RCTTextEventTypeFocus, + RCTTextEventTypeBlur, + RCTTextEventTypeChange, + RCTTextEventTypeSubmit, + RCTTextEventTypeEnd +}; + +typedef NS_ENUM(NSInteger, RCTScrollEventType) { + RCTScrollEventTypeStart, + RCTScrollEventTypeMove, + RCTScrollEventTypeEnd, + RCTScrollEventTypeStartDeceleration, + RCTScrollEventTypeEndDeceleration, + RCTScrollEventTypeEndAnimation, +}; + +/** + * This class wraps the -[RCTBridge enqueueJSCall:args:] method, and + * provides some convenience methods for generating event calls. + */ +@interface RCTEventDispatcher : NSObject + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +/** + * Send an application-specific event that does not relate to a specific + * view, e.g. a navigation or data update notification. + */ +- (void)sendAppEventWithName:(NSString *)name body:(id)body; + +/** + * Send a device or iOS event that does not relate to a specific view, + * e.g.rotation, location, keyboard show/hide, background/awake, etc. + */ +- (void)sendDeviceEventWithName:(NSString *)name body:(id)body; + +/** + * Send a user input event. The body dictionary must contain a "target" + * parameter, representing the react tag of the view sending the event + */ +- (void)sendInputEventWithName:(NSString *)name body:(NSDictionary *)body; + +/** + * Send a text input/focus event. + */ +- (void)sendTextEventWithType:(RCTTextEventType)type + reactTag:(NSNumber *)reactTag + text:(NSString *)text; + +/** + * Send a scroll event. + * (You can send a fake scroll event by passing nil for scrollView). + */ +- (void)sendScrollEventWithType:(RCTScrollEventType)type + reactTag:(NSNumber *)reactTag + scrollView:(UIScrollView *)scrollView + userData:(NSDictionary *)userData; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTExceptionsManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTExceptionsManager.h new file mode 100644 index 000000000..02ea33202 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTExceptionsManager.h @@ -0,0 +1,9 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTBridgeModule.h" + +@interface RCTExceptionsManager : NSObject + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTInvalidating.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTInvalidating.h new file mode 100644 index 000000000..e810519fd --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTInvalidating.h @@ -0,0 +1,16 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +// TODO (#5906496): is there a reason for this protocol? It seems to be +// used in a number of places where it isn't really required - only the +// RCTBridge actually ever calls casts to it - in all other +// cases it is simply a way of adding some method definitions to classes + +@protocol RCTInvalidating + +@property (nonatomic, assign, readonly, getter = isValid) BOOL valid; + +- (void)invalidate; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTJSMethodRegistrar.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTJSMethodRegistrar.h new file mode 100644 index 000000000..20a35a96b --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTJSMethodRegistrar.h @@ -0,0 +1,24 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@class RCTBridge; + +/** + * Provides an interface to register JS methods to be called via the bridge. + */ +@protocol RCTJSMethodRegistrar +@optional + +/** + * An array of JavaScript methods that the class will call via the + * -[RCTBridge enqueueJSCall:args:] method. Each method should be specified + * as a string of the form "JSModuleName.jsMethodName". Attempting to call a + * method that has not been registered will result in an error. If a method + * has already been registered by another class, it is not necessary to + * register it again, but it is good practice. Registering the same method + * more than once is silently ignored and will not result in an error. + */ ++ (NSArray *)JSMethods; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h new file mode 100644 index 000000000..7062570a4 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h @@ -0,0 +1,35 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTInvalidating.h" + +typedef void (^RCTJavaScriptCompleteBlock)(NSError *error); +typedef void (^RCTJavaScriptCallback)(id objcValue, NSError *error); + +/** + * Abstracts away a JavaScript execution context - we may be running code in a + * web view (for debugging purposes), or may be running code in a `JSContext`. + */ +@protocol RCTJavaScriptExecutor + +/** + * Executes given method with arguments on JS thread and calls the given callback + * with JSValue and JSContext as a result of the JS module call. + */ +- (void)executeJSCall:(NSString *)name + method:(NSString *)method + arguments:(NSArray *)arguments + callback:(RCTJavaScriptCallback)onComplete; + +/** + * Runs an application script, and notifies of the script load being complete via `onComplete`. + */ +- (void)executeApplicationScript:(NSString *)script + sourceURL:(NSURL *)url + onComplete:(RCTJavaScriptCompleteBlock)onComplete; + +- (void)injectJSONText:(NSString *)script + asGlobalObjectNamed:(NSString *)objectName + callback:(RCTJavaScriptCompleteBlock)onComplete; +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTKeyCommands.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTKeyCommands.h new file mode 100644 index 000000000..f6748826e --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTKeyCommands.h @@ -0,0 +1,28 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTKeyCommands : NSObject + ++ (instancetype)sharedInstance; + +/** + * Register a keyboard command. + */ +- (void)registerKeyCommandWithInput:(NSString *)input + modifierFlags:(UIKeyModifierFlags)flags + action:(void (^)(UIKeyCommand *command))block; + +/** + * Unregister a keyboard command. + */ +- (void)unregisterKeyCommandWithInput:(NSString *)input + modifierFlags:(UIKeyModifierFlags)flags; + +/** + * Check if a command is registered. + */ +- (BOOL)isKeyCommandRegisteredForInput:(NSString *)input + modifierFlags:(UIKeyModifierFlags)flags; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTLog.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTLog.h new file mode 100644 index 000000000..a97d13458 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTLog.h @@ -0,0 +1,69 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTAssert.h" +#import "RCTRedBox.h" + +#define RCTLOG_INFO 1 +#define RCTLOG_WARN 2 +#define RCTLOG_ERROR 3 +#define RCTLOG_MUSTFIX 4 + +// If set to e.g. `RCTLOG_ERROR`, will assert after logging the first error. +#if DEBUG +#define RCTLOG_FATAL_LEVEL RCTLOG_MUSTFIX +#define RCTLOG_REDBOX_LEVEL RCTLOG_ERROR +#else +#define RCTLOG_FATAL_LEVEL (RCTLOG_MUSTFIX + 1) +#define RCTLOG_REDBOX_LEVEL (RCTLOG_MUSTFIX + 1) +#endif + +// If defined, only log messages that match this regex will fatal +#define RCTLOG_FATAL_REGEX nil + +#define _RCTLog(__RCTLog__level, ...) do { \ + NSString *__RCTLog__levelStr; \ + switch(__RCTLog__level) { \ + case RCTLOG_INFO: __RCTLog__levelStr = @"info"; break; \ + case RCTLOG_WARN: __RCTLog__levelStr = @"warn"; break; \ + case RCTLOG_ERROR: __RCTLog__levelStr = @"error"; break; \ + case RCTLOG_MUSTFIX: __RCTLog__levelStr = @"mustfix"; break; \ + } \ + NSString *__RCTLog__msg = _RCTLogObjects(RCTLogFormat(__VA_ARGS__), __RCTLog__levelStr); \ + if (__RCTLog__level >= RCTLOG_FATAL_LEVEL) { \ + BOOL __RCTLog__fail = YES; \ + if (RCTLOG_FATAL_REGEX) { \ + NSError *__RCTLog__e; \ + NSRegularExpression *__RCTLog__regex = [NSRegularExpression regularExpressionWithPattern:RCTLOG_FATAL_REGEX options:0 error:&__RCTLog__e]; \ + __RCTLog__fail = [__RCTLog__regex numberOfMatchesInString:__RCTLog__msg options:0 range:NSMakeRange(0, [__RCTLog__msg length])] > 0; \ + } \ + RCTCAssert(!__RCTLog__fail, @"RCTLOG_FATAL_LEVEL %@: %@", __RCTLog__levelStr, __RCTLog__msg); \ + } \ + if (__RCTLog__level >= RCTLOG_REDBOX_LEVEL) { \ + RCTRedBox *__RCTLog__redBox = [RCTRedBox sharedInstance]; \ + [__RCTLog__redBox showErrorMessage:__RCTLog__msg]; \ + } \ +} while (0) + +#define RCTLog(...) _RCTLog(RCTLOG_INFO, __VA_ARGS__) +#define RCTLogInfo(...) _RCTLog(RCTLOG_INFO, __VA_ARGS__) +#define RCTLogWarn(...) _RCTLog(RCTLOG_WARN, __VA_ARGS__) +#define RCTLogError(...) _RCTLog(RCTLOG_ERROR, __VA_ARGS__) +#define RCTLogMustFix(...) _RCTLog(RCTLOG_MUSTFIX, __VA_ARGS__) + +#define RCTLogFormat(...) _RCTLogFormat(__FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__) +#define RCTLogFormatString(...) _RCTLogFormatString(__FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__) + +#ifdef __cplusplus +extern "C" { +#endif + +NSString *_RCTLogObjects(NSArray *objects, NSString *level); +NSArray *_RCTLogFormat(const char *file, int lineNumber, const char *funcName, NSString *format, ...) NS_FORMAT_FUNCTION(4,5); +NSString *_RCTLogFormatString(const char *file, int lineNumber, const char *funcName, NSString *format, ...) NS_FORMAT_FUNCTION(4,5); + +#ifdef __cplusplus +} +#endif + +typedef void (^RCTLogFunction)(NSString *format, NSString *str); +void RCTInjectLogFunction(RCTLogFunction func); diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavItem.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavItem.h new file mode 100644 index 000000000..68f12fd45 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavItem.h @@ -0,0 +1,14 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTNavItem : UIView + +@property (nonatomic, copy) NSString *title; +@property (nonatomic, copy) NSString *rightButtonTitle; +@property (nonatomic, copy) NSString *backButtonTitle; +@property (nonatomic, copy) UIColor *tintColor; +@property (nonatomic, copy) UIColor *barTintColor; +@property (nonatomic, copy) UIColor *titleTextColor; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavItemManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavItemManager.h new file mode 100644 index 000000000..3c2a32105 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavItemManager.h @@ -0,0 +1,8 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTNavItemManager : RCTViewManager + +@end + diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigator.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigator.h new file mode 100644 index 000000000..5d928efa7 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigator.h @@ -0,0 +1,26 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTInvalidating.h" + +@class RCTEventDispatcher; + +@interface RCTNavigator : UIView + +@property (nonatomic, strong) UIView *reactNavSuperviewLink; +@property (nonatomic, assign) NSInteger requestedTopOfStack; + +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; + +/** + * Schedules a JavaScript navigation and prevents `UIKit` from navigating until + * JavaScript has sent its scheduled navigation. + * + * @returns Whether or not a JavaScript driven navigation could be + * scheduled/reserved. If returning `NO`, JavaScript should usually just do + * nothing at all. + */ +- (BOOL)requestSchedulingJavaScriptNavigation; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigatorManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigatorManager.h new file mode 100644 index 000000000..d32d21096 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigatorManager.h @@ -0,0 +1,8 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTNavigatorManager : RCTViewManager + +@end + diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTPointerEvents.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTPointerEvents.h new file mode 100644 index 000000000..522bcce4c --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTPointerEvents.h @@ -0,0 +1,10 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +typedef NS_ENUM(NSInteger, RCTPointerEvents) { + RCTPointerEventsUnspecified = 0, // Default + RCTPointerEventsNone, + RCTPointerEventsBoxNone, + RCTPointerEventsBoxOnly, +}; diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTRedBox.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTRedBox.h new file mode 100644 index 000000000..82137eb06 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTRedBox.h @@ -0,0 +1,16 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTRedBox : NSObject + ++ (instancetype)sharedInstance; + +- (void)showErrorMessage:(NSString *)message; +- (void)showErrorMessage:(NSString *)message withDetails:(NSString *)details; +- (void)showErrorMessage:(NSString *)message withStack:(NSArray *)stack; +- (void)updateErrorMessage:(NSString *)message withStack:(NSArray *)stack; + +- (void)dismiss; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTRootView.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTRootView.h new file mode 100644 index 000000000..240c000c3 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTRootView.h @@ -0,0 +1,44 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTRootView : UIView + +/** + * The URL of the bundled application script (required). + * Setting this will clear the view contents, and trigger + * an asynchronous load/download and execution of the script. + */ +@property (nonatomic, strong) NSURL *scriptURL; + +/** + * The name of the JavaScript module to execute within the + * specified scriptURL (required). Setting this will not have + * any immediate effect, but it must be done prior to loading + * the script. + */ +@property (nonatomic, copy) NSString *moduleName; + +/** + * The default properties to apply to the view when the script bundle + * is first loaded. Defaults to nil/empty. + */ +@property (nonatomic, copy) NSDictionary *initialProperties; + +/** + * The class of the RCTJavaScriptExecutor to use with this view. + * If not specified, it will default to using RCTContextExecutor. + * Changes will take effect next time the bundle is reloaded. + */ +@property (nonatomic, strong) Class executorClass; + +/** + * Reload this root view, or all root views, respectively. + */ +- (void)reload; ++ (void)reloadAll; + +- (void)startOrResetInteractionTiming; +- (NSDictionary *)endAndResetInteractionTiming; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollView.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollView.h new file mode 100644 index 000000000..82667b205 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollView.h @@ -0,0 +1,37 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTAutoInsetsProtocol.h" +#import "RCTScrollableProtocol.h" +#import "RCTView.h" + +@protocol UIScrollViewDelegate; + +@class RCTEventDispatcher; + +@interface RCTScrollView : RCTView + +/** + * If the `contentSize` is not provided, then the `contentSize` will + * automatically be determined by the size of the `RKScrollView` subview. + * + * The `RCTScrollView` may have at most one single subview. This will ensure + * that the scroll view's `contentSize` will be efficiently set to the size of + * the single subview's frame. That frame size will be determined somewhat + * efficiently since it will have already been computed by the off-main-thread + * layout system. + */ +@property (nonatomic, readonly) UIScrollView *scrollView; +@property (nonatomic, readonly) UIView *contentView; + +@property (nonatomic, assign) CGSize contentSize; +@property (nonatomic, assign) UIEdgeInsets contentInset; +@property (nonatomic, assign) BOOL automaticallyAdjustContentInsets; +@property (nonatomic, assign) NSUInteger throttleScrollCallbackMS; +@property (nonatomic, assign) BOOL centerContent; +@property (nonatomic, copy) NSArray *stickyHeaderIndices; + +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollViewManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollViewManager.h new file mode 100644 index 000000000..835e1c322 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollViewManager.h @@ -0,0 +1,8 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTScrollViewManager : RCTViewManager + +@end + diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollableProtocol.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollableProtocol.h new file mode 100644 index 000000000..a0ae7b611 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollableProtocol.h @@ -0,0 +1,18 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +/** + * Contains any methods related to scrolling. Any `RCTView` that has scrolling + * features should implement these methods. + */ +@protocol RCTScrollableProtocol + +@property (nonatomic, readwrite, weak) NSObject *nativeMainScrollDelegate; +@property (nonatomic, readonly) CGSize contentSize; + +- (void)scrollToOffset:(CGPoint)offset; +- (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated; +- (void)zoomToRect:(CGRect)rect animated:(BOOL)animated; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTShadowView.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTShadowView.h new file mode 100644 index 000000000..ec2b8c353 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTShadowView.h @@ -0,0 +1,159 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "Layout.h" +#import "RCTViewNodeProtocol.h" + +@class RCTSparseArray; + +// TODO: amalgamate these enums? +typedef NS_ENUM(NSUInteger, RCTLayoutLifecycle) { + RCTLayoutLifecycleUninitialized = 0, + RCTLayoutLifecycleComputed, + RCTLayoutLifecycleDirtied, +}; + +// TODO: is this still needed? +typedef NS_ENUM(NSUInteger, RCTPropagationLifecycle) { + RCTPropagationLifecycleUninitialized = 0, + RCTPropagationLifecycleComputed, + RCTPropagationLifecycleDirtied, +}; + +// TODO: move this to text node? +typedef NS_ENUM(NSUInteger, RCTTextLifecycle) { + RCTTextLifecycleUninitialized = 0, + RCTTextLifecycleComputed, + RCTTextLifecycleDirtied, +}; + +// TODO: is this redundact now? +typedef void (^RCTApplierBlock)(RCTSparseArray *); + +/** + * ShadowView tree mirrors RCT view tree. Every node is highly stateful. + * 1. A node is in one of three lifecycles: uninitialized, computed, dirtied. + * 1. RCTBridge may call any of the padding/margin/width/height/top/left setters. A setter would dirty + * the node and all of its ancestors. + * 2. At the end of each Bridge transaction, we call collectUpdatedFrames:widthConstraint:heightConstraint + * at the root node to recursively lay out the entire hierarchy. + * 3. If a node is "computed" and the constraint passed from above is identical to the constraint used to + * perform the last computation, we skip laying out the subtree entirely. + */ +@interface RCTShadowView : NSObject + +@property (nonatomic, weak, readonly) RCTShadowView *superview; +@property (nonatomic, assign, readonly) css_node_t *cssNode; +@property (nonatomic, copy) NSString *moduleName; +@property (nonatomic, assign) BOOL isBGColorExplicitlySet; // Used to propogate to children +@property (nonatomic, strong) UIColor *backgroundColor; // Used to propogate to children +@property (nonatomic, assign) RCTLayoutLifecycle layoutLifecycle; + +/** + * isNewView - Used to track the first time the view is introduced into the hierarchy. It is initialized YES, then is + * set to NO in RCTUIManager after the layout pass is done and all frames have been extracted to be applied to the + * corresponding UIViews. + */ +@property (nonatomic, assign, getter=isNewView) BOOL newView; + +/** + * Is this the shadowView for an RCTRootView + */ +@property (nonatomic, assign, getter=isReactRootView) BOOL reactRootView; + +/** + * Position and dimensions. + * Defaults to { 0, 0, NAN, NAN }. + */ +@property (nonatomic, assign) CGFloat top; +@property (nonatomic, assign) CGFloat left; +@property (nonatomic, assign) CGFloat width; +@property (nonatomic, assign) CGFloat height; +@property (nonatomic, assign) CGRect frame; + +- (void)setTopLeft:(CGPoint)topLeft; +- (void)setSize:(CGSize)size; + +/** + * Border. Defaults to { 0, 0, 0, 0 }. + */ +@property (nonatomic, assign) CGFloat borderTop; +@property (nonatomic, assign) CGFloat borderLeft; +@property (nonatomic, assign) CGFloat borderWidth; +@property (nonatomic, assign) CGFloat borderHeight; + +- (void)setBorderWidth:(CGFloat)value; + +/** + * Margin. Defaults to { 0, 0, 0, 0 }. + */ +@property (nonatomic, assign) CGFloat marginTop; +@property (nonatomic, assign) CGFloat marginLeft; +@property (nonatomic, assign) CGFloat marginBottom; +@property (nonatomic, assign) CGFloat marginRight; + +- (void)setMargin:(CGFloat)margin; +- (void)setMarginVertical:(CGFloat)margin; +- (void)setMarginHorizontal:(CGFloat)margin; + +/** + * Padding. Defaults to { 0, 0, 0, 0 }. + */ +@property (nonatomic, assign) CGFloat paddingTop; +@property (nonatomic, assign) CGFloat paddingLeft; +@property (nonatomic, assign) CGFloat paddingBottom; +@property (nonatomic, assign) CGFloat paddingRight; + +- (void)setPadding:(CGFloat)padding; +- (void)setPaddingVertical:(CGFloat)padding; +- (void)setPaddingHorizontal:(CGFloat)padding; + +- (UIEdgeInsets)paddingAsInsets; + +/** + * Flexbox properties. All zero/disabled by default + */ +@property (nonatomic, assign) css_flex_direction_t flexDirection; +@property (nonatomic, assign) css_justify_t justifyContent; +@property (nonatomic, assign) css_align_t alignSelf; +@property (nonatomic, assign) css_align_t alignItems; +@property (nonatomic, assign) css_position_type_t positionType; +@property (nonatomic, assign) css_wrap_type_t flexWrap; +@property (nonatomic, assign) CGFloat flex; + +- (void)collectUpdatedProperties:(NSMutableSet *)viewsWithNewProperties parentProperties:(NSDictionary *)parentProperties; +- (void)collectRootUpdatedFrames:(NSMutableSet *)viewsWithNewFrame parentConstraint:(CGSize)parentConstraint; +- (void)fillCSSNode:(css_node_t *)node; + +// The following are implementation details exposed to subclasses. Do not call them directly +- (void)dirtyLayout; +- (BOOL)isLayoutDirty; + +// TODO: is this still needed? +- (void)dirtyPropagation; +- (BOOL)isPropagationDirty; + +// TODO: move this to text node? +- (void)dirtyText; +- (BOOL)isTextDirty; +- (void)setTextComputed; + +/** + * Triggers a recalculation of the shadow view's layout. + */ +- (void)updateShadowViewLayout; + +/** + * Computes the recursive offset, meaning the sum of all descendant offsets - + * this is the sum of all positions inset from parents. This is not merely the + * sum of `top`/`left`s, as this function uses the *actual* positions of + * children, not the style specified positions - it computes this based on the + * resulting layout. It does not yet compensate for native scroll view insets or + * transforms or anchor points. Returns an array containing the `x, y, width, + * height` of the shadow view relative to the ancestor, or `nil` if the `view` + * is not a descendent of `ancestor`. + */ ++ (CGRect)measureLayout:(RCTShadowView *)view relativeTo:(RCTShadowView *)ancestor; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTSparseArray.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTSparseArray.h new file mode 100644 index 000000000..47ad346f1 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTSparseArray.h @@ -0,0 +1,31 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTSparseArray : NSObject + +- (instancetype)initWithCapacity:(NSUInteger)capacity NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithSparseArray:(RCTSparseArray *)sparseArray NS_DESIGNATED_INITIALIZER; + ++ (instancetype)sparseArray; ++ (instancetype)sparseArrayWithCapacity:(NSUInteger)capacity; ++ (instancetype)sparseArrayWithSparseArray:(RCTSparseArray *)sparseArray; + +// Use nil object to remove at idx. +- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx; +- (id)objectAtIndexedSubscript:(NSUInteger)idx; + +// Use nil obj to remove at key. +- (void)setObject:(id)obj forKeyedSubscript:(NSNumber *)key; +- (id)objectForKeyedSubscript:(NSNumber *)key; + +@property (readonly, nonatomic) NSUInteger count; +@property (readonly, nonatomic, copy) NSArray *allIndexes; +@property (readonly, nonatomic, copy) NSArray *allObjects; + +- (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSNumber *idx, BOOL *stop))block; +- (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (^)(id obj, NSNumber *idx, BOOL *stop))block; + +- (void)removeAllObjects; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStaticImage.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStaticImage.h new file mode 100644 index 000000000..75906be39 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStaticImage.h @@ -0,0 +1,10 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTStaticImage : UIImageView + +@property (nonatomic, assign) UIEdgeInsets capInsets; +@property (nonatomic, assign) UIImageRenderingMode renderingMode; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStaticImageManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStaticImageManager.h new file mode 100644 index 000000000..ab89cb96b --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStaticImageManager.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTStaticImageManager : RCTViewManager + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStatusBarManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStatusBarManager.h new file mode 100644 index 000000000..830393521 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStatusBarManager.h @@ -0,0 +1,9 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTBridgeModule.h" + +@interface RCTStatusBarManager : NSObject + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextField.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextField.h new file mode 100644 index 000000000..2a0225f27 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextField.h @@ -0,0 +1,15 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@class RCTEventDispatcher; + +@interface RCTTextField : UITextField + +@property (nonatomic, assign) BOOL caretHidden; +@property (nonatomic, assign) BOOL autoCorrect; +@property (nonatomic, assign) UIEdgeInsets paddingEdgeInsets; // TODO: contentInset + +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextFieldManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextFieldManager.h new file mode 100644 index 000000000..1f83a47d8 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextFieldManager.h @@ -0,0 +1,8 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTTextFieldManager : RCTViewManager + +@end + diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTiming.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTiming.h new file mode 100644 index 000000000..aa55c2521 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTiming.h @@ -0,0 +1,10 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTBridgeModule.h" +#import "RCTInvalidating.h" + +@interface RCTTiming : NSObject + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTouchHandler.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTouchHandler.h new file mode 100644 index 000000000..53379a78a --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTouchHandler.h @@ -0,0 +1,15 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTInvalidating.h" + +@class RCTBridge; + +@interface RCTTouchHandler : UIGestureRecognizer + +- (instancetype)initWithBridge:(RCTBridge *)bridge; +- (void)startOrResetInteractionTiming; +- (NSDictionary *)endAndResetInteractionTiming; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIActivityIndicatorViewManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIActivityIndicatorViewManager.h new file mode 100644 index 000000000..d67661359 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIActivityIndicatorViewManager.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTUIActivityIndicatorViewManager : RCTViewManager + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIManager.h new file mode 100644 index 000000000..87e91118a --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIManager.h @@ -0,0 +1,26 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTBridgeModule.h" +#import "RCTInvalidating.h" + +@class RCTRootView; + +@protocol RCTScrollableProtocol; + +@interface RCTUIManager : NSObject + +@property (nonatomic, weak) id mainScrollView; + +/** + * Allows native environment code to respond to "the main scroll view" events. + * see `RCTUIManager`'s `setMainScrollViewTag`. + */ +@property (nonatomic, readwrite, weak) id nativeMainScrollDelegate; + +- (void)registerRootView:(RCTRootView *)rootView; + ++ (UIView *)JSResponder; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUtils.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUtils.h new file mode 100644 index 000000000..3612b1f27 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUtils.h @@ -0,0 +1,41 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import +#import +#import + +#import "RCTAssert.h" + +// Macro to indicate when inherited initializer is not to be used +#define RCT_NOT_DESIGNATED_INITIALIZER() \ +do { \ + RCTAssert(NO, @"%@ is not the designated initializer for instances of %@.", NSStringFromSelector(_cmd), [self class]); \ + return nil; \ +} while (0) + +// Utility functions for JSON object <-> string serialization/deserialization +NSString *RCTJSONStringify(id jsonObject, NSError **error); +id RCTJSONParse(NSString *jsonString, NSError **error); + +// Get MD5 hash of a string (TODO: currently unused. Remove?) +NSString *RCTMD5Hash(NSString *string); + +// Get screen metrics in a thread-safe way +CGFloat RCTScreenScale(void); +CGSize RCTScreenSize(void); + +// Round float coordinates to nearest whole screen pixel (not point) +CGFloat RCTRoundPixelValue(CGFloat value); +CGFloat RCTCeilPixelValue(CGFloat value); +CGFloat RCTFloorPixelValue(CGFloat value); + +// Get current time, for precise performance metrics +NSTimeInterval RCTTGetAbsoluteTime(void); + +// Method swizzling +void RCTSwapClassMethods(Class cls, SEL original, SEL replacement); +void RCTSwapInstanceMethods(Class cls, SEL original, SEL replacement); + +// Module subclass support +BOOL RCTClassOverridesClassMethod(Class cls, SEL selector); +BOOL RCTClassOverridesInstanceMethod(Class cls, SEL selector); diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTView.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTView.h new file mode 100644 index 000000000..77dee1df8 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTView.h @@ -0,0 +1,24 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTView.h" + +#import + +#import "RCTPointerEvents.h" + +@protocol RCTAutoInsetsProtocol; + +@interface RCTView : UIView + +@property (nonatomic, assign) RCTPointerEvents pointerEvents; +@property (nonatomic, copy) NSString *overrideAccessibilityLabel; + ++ (void)autoAdjustInsetsForView:(UIView *)parentView + withScrollView:(UIScrollView *)scrollView + updateOffset:(BOOL)updateOffset; + ++ (UIViewController *)backingViewControllerForView:(UIView *)view; + ++ (UIEdgeInsets)contentInsetsForView:(UIView *)curView; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewManager.h new file mode 100644 index 000000000..e77be09c1 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewManager.h @@ -0,0 +1,148 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTConvert.h" +#import "RCTLog.h" + +@class RCTEventDispatcher; +@class RCTShadowView; +@class RCTSparseArray; +@class RCTUIManager; + +typedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, RCTSparseArray *viewRegistry); + +@interface RCTViewManager : NSObject + +/** + * Designated initializer for view modules. Override this when subclassing. + */ +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; + +/** + * The event dispatcher is used to send events back to the JavaScript application. + * It can either be used directly by the module, or passed on to instantiated + * view subclasses so that they can handle their own events. + */ +@property (nonatomic, readonly, weak) RCTEventDispatcher *eventDispatcher; + +/** + * The module name exposed to React JS. If omitted, this will be inferred + * automatically by using the view module's class name. It is better to not + * override this, and just follow standard naming conventions for your view + * module subclasses. + */ ++ (NSString *)moduleName; + +/** + * This method instantiates a native view to be managed by the module. Override + * this to return a custom view instance, which may be preconfigured with default + * properties, subviews, etc. This method will be called many times, and should + * return a fresh instance each time. The view module MUST NOT cache the returned + * view and return the same instance for subsequent calls. + */ +- (UIView *)view; + +/** + * This method instantiates a shadow view to be managed by the module. If omitted, + * an ordinary RCTShadowView instance will be created, which is typically fine for + * most view types. As with the -view method, the -shadowView method should return + * a fresh instance each time it is called. + */ +- (RCTShadowView *)shadowView; + +/** + * Returns a dictionary of config data passed to JS that defines eligible events + * that can be placed on native views. This should return bubbling + * directly-dispatched event types and specify what names should be used to + * subscribe to either form (bubbling/capturing). + * + * Returned dictionary should be of the form: @{ + * @"onTwirl": { + * @"phasedRegistrationNames": @{ + * @"bubbled": @"onTwirl", + * @"captured": @"onTwirlCaptured" + * } + * } + * } + * + * Note that this method is not inherited when you subclass a view module, and + * you should not call [super customBubblingEventTypes] when overriding it. + */ ++ (NSDictionary *)customBubblingEventTypes; + +/** + * Returns a dictionary of config data passed to JS that defines eligible events + * that can be placed on native views. This should return non-bubbling + * directly-dispatched event types. + * + * Returned dictionary should be of the form: @{ + * @"onTwirl": { + * @"registrationName": @"onTwirl" + * } + * } + * + * Note that this method is not inherited when you subclass a view module, and + * you should not call [super customDirectEventTypes] when overriding it. + */ ++ (NSDictionary *)customDirectEventTypes; + +/** + * Injects constants into JS. These constants are made accessible via + * NativeModules.moduleName.X. Note that this method is not inherited when you + * subclass a view module, and you should not call [super constantsToExport] + * when overriding it. + */ ++ (NSDictionary *)constantsToExport; + +/** + * To deprecate, hopefully + */ +- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(RCTSparseArray *)shadowViewRegistry; + +/** + * Informal protocol for setting view and shadowView properties. + * Implement methods matching these patterns to set any properties that + * require special treatment (e.g. where the type or name cannot be inferred). + * + * - (void)set_:(id)property + * forView:(UIView *)view + * withDefaultView:(UIView *)defaultView; + * + * - (void)set_:(id)property + * forShadowView:(RCTShadowView *)view + * withDefaultView:(RCTShadowView *)defaultView; + * + * For simple cases, use the macros below: + */ + +/** + * This handles the simple case, where JS and native property names match + * And the type can be automatically inferred. + */ +#define RCT_EXPORT_VIEW_PROPERTY(name) \ +RCT_REMAP_VIEW_PROPERTY(name, name) + +/** + * This macro maps a named property on the module to an arbitrary key path + * within the view. + */ +#define RCT_REMAP_VIEW_PROPERTY(name, keypath) \ +- (void)set_##name:(id)json forView:(id)view withDefaultView:(id)defaultView { \ + if ((json && !RCTSetProperty(view, @#keypath, json)) || \ + (!json && !RCTCopyProperty(view, defaultView, @#keypath))) { \ + RCTLogMustFix(@"%@ does not have setter for `%s` property", [view class], #name); \ + } \ +} + +/** + * These are useful in cases where the module's superclass handles a + * property, but you wish to "unhandle" it, so it will be ignored. + */ +#define RCT_IGNORE_VIEW_PROPERTY(name) \ +- (void)set_##name:(id)value forView:(id)view withDefaultView:(id)defaultView {} + +#define RCT_IGNORE_SHADOW_PROPERTY(name) \ +- (void)set_##name:(id)value forShadowView:(id)view withDefaultView:(id)defaultView {} + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h new file mode 100644 index 000000000..1fa3e252b --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h @@ -0,0 +1,26 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +/** + + * Logical node in a tree of application components. Both `ShadowView`s and + * `UIView+ReactKit`s conform to this. Allows us to write utilities that + * reason about trees generally. + */ +@protocol RCTViewNodeProtocol + +@property (nonatomic, strong) NSNumber *reactTag; + +- (void)insertReactSubview:(id)subview atIndex:(NSInteger)atIndex; +- (void)removeReactSubview:(id)subview; +- (NSMutableArray *)reactSubviews; +- (NSNumber *)reactTagAtPoint:(CGPoint)point; + +// View is an RCTRootView +- (BOOL)isReactRootView; + +@optional + +// TODO: Deprecate this +- (void)reactBridgeDidFinishTransaction; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTWebViewExecutor.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTWebViewExecutor.h new file mode 100644 index 000000000..7f695f3f3 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTWebViewExecutor.h @@ -0,0 +1,35 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTJavaScriptExecutor.h" + +/** + * Uses an embedded web view merely for the purpose of being able to reuse the + * existing webkit debugging tools. Fulfills the role of a very constrained + * `JSContext`, which we call `RCTJavaScriptExecutor`. + * + * TODO: To ensure production-identical execution, scrub the window + * environment. And ensure main thread operations are actually added to a queue + * instead of being executed immediately if already on the main thread. + */ +@interface RCTWebViewExecutor : NSObject + +// Only one callback stored - will only be invoked for the latest issued +// application script request. +@property (nonatomic, copy) RCTJavaScriptCompleteBlock onApplicationScriptLoaded; + +/** + * Instantiate with a specific webview instance + */ +- (instancetype)initWithWebView:(UIWebView *)webView NS_DESIGNATED_INITIALIZER; + +/** + * Invoke this to reclaim the web view for reuse. This is necessary in order to + * allow debuggers to remain open, when creating a new `RCTWebViewExecutor`. + * This guards against the web view being invalidated, and makes sure the + * `delegate` is cleared first. + */ +- (UIWebView *)invalidateAndReclaimWebView; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h new file mode 100644 index 000000000..d8f22270a --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h @@ -0,0 +1,24 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@class RCTEventDispatcher; +@class RCTNavItem; +@class RCTWrapperViewController; + +@protocol RCTWrapperViewControllerNavigationListener + +- (void)wrapperViewController:(RCTWrapperViewController *)wrapperViewController +didMoveToNavigationController:(UINavigationController *)navigationController; + +@end + +@interface RCTWrapperViewController : UIViewController + +- (instancetype)initWithContentView:(UIView *)contentView eventDispatcher:(RCTEventDispatcher *)eventDispatcher; +- (instancetype)initWithNavItem:(RCTNavItem *)navItem eventDispatcher:(RCTEventDispatcher *)eventDispatcher; + +@property (nonatomic, readwrite, weak) id navigationListener; +@property (nonatomic, strong, readwrite) RCTNavItem *navItem; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/UIView+ReactKit.h b/Examples/Movies/Pods/Headers/Public/ReactKit/UIView+ReactKit.h new file mode 100644 index 000000000..3e45da8e7 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/UIView+ReactKit.h @@ -0,0 +1,11 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTViewNodeProtocol.h" + +//TODO: let's try to eliminate this category if possible + +@interface UIView (ReactKit) + +@end diff --git a/Examples/Movies/Pods/Local Podspecs/RCTDataManager.podspec b/Examples/Movies/Pods/Local Podspecs/RCTDataManager.podspec new file mode 100644 index 000000000..84df787b8 --- /dev/null +++ b/Examples/Movies/Pods/Local Podspecs/RCTDataManager.podspec @@ -0,0 +1,28 @@ +Pod::Spec.new do |spec| + spec.name = 'RCTDataManager' + spec.version = '0.0.1' + spec.summary = 'Provides basic networking capabilities in ReactNative apps.' + spec.description = <<-DESC + Use XMLHttpRequest to fetch data over the network. + DESC + spec.homepage = 'https://facebook.github.io/react-native/' + spec.license = { :type => 'BSD' } + spec.author = 'Facebook' + spec.platform = :ios, '7.0' + spec.requires_arc = true + spec.source_files = '**/*.{h,m,c}' + spec.dependency "ReactKit", "~> 0.0.1" + + # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Link your library with frameworks, or libraries. Libraries do not include + # the lib prefix of their name. + # + + # s.framework = "SomeFramework" + # s.frameworks = "SomeFramework", "AnotherFramework" + + # s.library = "iconv" + #spec.libraries = "RCTDataManager", "ReactKit" + +end diff --git a/Examples/Movies/Pods/Local Podspecs/RCTNetworkImage.podspec b/Examples/Movies/Pods/Local Podspecs/RCTNetworkImage.podspec new file mode 100644 index 000000000..47eb0e5f6 --- /dev/null +++ b/Examples/Movies/Pods/Local Podspecs/RCTNetworkImage.podspec @@ -0,0 +1,28 @@ +Pod::Spec.new do |spec| + spec.name = 'RCTNetworkImage' + spec.version = '0.0.1' + spec.summary = 'Provides basic Text capabilities in ReactNative apps.' + spec.description = <<-DESC + Text can be rendered in ReactNative apps with the component using this module. + DESC + spec.homepage = 'https://facebook.github.io/react-native/' + spec.license = { :type => 'BSD' } + spec.author = 'Facebook' + spec.platform = :ios, '7.0' + spec.requires_arc = true + spec.source_files = '**/*.{h,m,c}' + spec.dependency "ReactKit", "~> 0.0.1" + + # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Link your library with frameworks, or libraries. Libraries do not include + # the lib prefix of their name. + # + + # s.framework = "SomeFramework" + # s.frameworks = "SomeFramework", "AnotherFramework" + + # s.library = "iconv" + #spec.libraries = "RCTNetworkImage", "ReactKit" + +end diff --git a/Examples/Movies/Pods/Local Podspecs/RCTText.podspec b/Examples/Movies/Pods/Local Podspecs/RCTText.podspec new file mode 100644 index 000000000..656e0ee74 --- /dev/null +++ b/Examples/Movies/Pods/Local Podspecs/RCTText.podspec @@ -0,0 +1,28 @@ +Pod::Spec.new do |spec| + spec.name = 'RCTText' + spec.version = '0.0.1' + spec.summary = 'Provides basic Text capabilities in ReactNative apps.' + spec.description = <<-DESC + Text can be rendered in ReactNative apps with the component using this module. + DESC + spec.homepage = 'https://facebook.github.io/react-native/' + spec.license = { :type => 'BSD' } + spec.author = 'Facebook' + spec.platform = :ios, '7.0' + spec.requires_arc = true + spec.source_files = '**/*.{h,m,c}' + spec.dependency "ReactKit", "~> 0.0.1" + + # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Link your library with frameworks, or libraries. Libraries do not include + # the lib prefix of their name. + # + + # s.framework = "SomeFramework" + # s.frameworks = "SomeFramework", "AnotherFramework" + + # s.library = "iconv" + #spec.libraries = "RCTText", "ReactKit" + +end diff --git a/Examples/Movies/Pods/Local Podspecs/ReactKit.podspec b/Examples/Movies/Pods/Local Podspecs/ReactKit.podspec new file mode 100644 index 000000000..3e1a8a6e2 --- /dev/null +++ b/Examples/Movies/Pods/Local Podspecs/ReactKit.podspec @@ -0,0 +1,16 @@ +Pod::Spec.new do |spec| + spec.name = 'ReactKit' + spec.version = '0.0.1' + spec.summary = 'An implementation of React that targets UIKit for iOS' + spec.description = <<-DESC + Our first React Native implementation is ReactKit, targeting iOS. We are also working on an Android implementation which we will release later. ReactKit apps are built using the React JS framework, and render directly to native UIKit elements using a fully asynchronous architecture. There is no browser and no HTML. We have picked what we think is the best set of features from these and other technologies to build what we hope to become the best product development framework available, with an emphasis on iteration speed, developer delight, continuity of technology, and absolutely beautiful and fast products with no compromises in quality or capability. + DESC + spec.homepage = 'https://facebook.github.io/react-native/' + spec.license = { :type => 'BSD' } + spec.author = 'Facebook' + spec.platform = :ios, '7.0' + spec.requires_arc = true + spec.source_files = '**/*.{h,m,c}' + spec.public_header_files = "**/*.h" + #spec.library = "ReactKit" +end diff --git a/Examples/Movies/Pods/Manifest.lock b/Examples/Movies/Pods/Manifest.lock new file mode 100644 index 000000000..cc2a8f981 --- /dev/null +++ b/Examples/Movies/Pods/Manifest.lock @@ -0,0 +1,32 @@ +PODS: + - RCTDataManager (0.0.1): + - ReactKit (~> 0.0.1) + - RCTNetworkImage (0.0.1): + - ReactKit (~> 0.0.1) + - RCTText (0.0.1): + - ReactKit (~> 0.0.1) + - ReactKit (0.0.1) + +DEPENDENCIES: + - RCTDataManager (from `../../Libraries/Network`) + - RCTNetworkImage (from `../../Libraries/Image`) + - RCTText (from `../../Libraries/Text`) + - ReactKit (from `../../ReactKit`) + +EXTERNAL SOURCES: + RCTDataManager: + :path: ../../Libraries/Network + RCTNetworkImage: + :path: ../../Libraries/Image + RCTText: + :path: ../../Libraries/Text + ReactKit: + :path: ../../ReactKit + +SPEC CHECKSUMS: + RCTDataManager: d38d2a6555886d68e8de623c4b97e2acdf01ed3e + RCTNetworkImage: 6d99735875916e098a65c68a54a72e67e24a402a + RCTText: 5c0cf4635241e8c02e8933853df03809d2dc8327 + ReactKit: 65c02c1e95951c198e491d2a4c1972675d4af254 + +COCOAPODS: 0.35.0 diff --git a/Examples/Movies/Pods/Pods.xcodeproj/project.pbxproj b/Examples/Movies/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 000000000..4c4cbbb99 --- /dev/null +++ b/Examples/Movies/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,4284 @@ + + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + 01DCDFB27A48C1C7A65C2FE6 + + fileRef + 6DDC3764218E410C0E170649 + isa + PBXBuildFile + + 048B0A5A6D3AE173A67CAE93 + + children + + ADAA64389F188489440FF394 + 7643C57FD9EC1838B0876BBD + 1E172C103C8DDDD51C260454 + 07EC0B27D8891E964C48E4D7 + + isa + PBXGroup + name + Support Files + path + ../../Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager + sourceTree + <group> + + 0612C8DB98399C9428864589 + + fileRef + 12E89F4AD5820CD9722AD8D0 + isa + PBXBuildFile + + 06C6AEB41647779AE72D05D0 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTView.h + path + Views/RCTView.h + sourceTree + <group> + + 07192780F349FFB50B16BAE0 + + fileRef + 2CD30CF1663697474B87D08E + isa + PBXBuildFile + + 075ECFDD9BCF0E8901AE8625 + + children + + 581AF9074AC1929D0D1DAB9E + F5B54251AEB97ECA54054310 + 90D5389E9D73CDBB276C1B34 + 9DD770C9F0909D7B663F79B9 + 19DA60B0FDB51F564823798C + + isa + PBXGroup + sourceTree + <group> + + 07EC0B27D8891E964C48E4D7 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-RCTDataManager-prefix.pch + sourceTree + <group> + + 09567798D374D77BC5D172B2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTRawTextManager.m + sourceTree + <group> + + 0A9F33FAC1AE68D789D1776C + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-ReactKit.a + sourceTree + BUILT_PRODUCTS_DIR + + 0AC9EE10D9CD5E34ACCC37E0 + + buildActionMask + 2147483647 + files + + 275C0B2E6CA279611D94AA46 + AC11EC6BAF7ED8F76E48397C + 79BE258178E49FD51E2CC4B8 + 7CAF752A4A0E37B9583A87DB + CDB49A44CDED422DC861AC80 + + isa + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 0B6D46780D0C5F037B9E50AF + + fileRef + 99F944FDFA42E71DFD034D19 + isa + PBXBuildFile + + 0C7A5A737917BA18817CC207 + + children + + 88505E4377E9058030C956B9 + 48C4ACFA9C0F6598C47536AE + 35138A0F59E8056491258E07 + B1A56B88049B3F5961BAEF1F + 36CB892D416C92B38A7AB919 + 9F9D9AED8316D779EAEA6CBB + 6ECB652E72348E5A2B4636FC + + isa + PBXGroup + name + Pods + path + Target Support Files/Pods + sourceTree + <group> + + 0D505D056F591E9588F343AA + + containerPortal + BF94ECC553449F9486D48453 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + F3743E4364DCD50F66E07E03 + remoteInfo + Pods-ReactKit + + 0D8B5E4BC6B802176DDD88E5 + + fileRef + E64248B361B8929CFE00FADC + isa + PBXBuildFile + + 0EA55D4BFB9E3A24AB05482E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTBridgeModule.h + path + Base/RCTBridgeModule.h + sourceTree + <group> + + 0EAFFB5E66ACE63398007604 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTUIActivityIndicatorViewManager.m + path + Views/RCTUIActivityIndicatorViewManager.m + sourceTree + <group> + + 100E0F66BB2561CD9C5403B1 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTShadowText.h + sourceTree + <group> + + 106C230D038A62D2C37E5D75 + + fileRef + 59BF11297A6B39FFEBBB7861 + isa + PBXBuildFile + + 12E89F4AD5820CD9722AD8D0 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTViewNodeProtocol.h + path + Base/RCTViewNodeProtocol.h + sourceTree + <group> + + 149C58083427CE1CD36C8B10 + + fileRef + B6BB65B0F788DFF2F121D4F7 + isa + PBXBuildFile + + 1592E2F41A2DC2C927EBBF12 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTRootView.h + path + Base/RCTRootView.h + sourceTree + <group> + + 15F0D204E7BD9B1607786736 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTAnimationType.h + path + Base/RCTAnimationType.h + sourceTree + <group> + + 1782BB92C0A529BF6AD72DFF + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTJavaScriptExecutor.h + path + Base/RCTJavaScriptExecutor.h + sourceTree + <group> + + 17C0992A90EEBE80108AEF54 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTWrapperViewController.h + path + Views/RCTWrapperViewController.h + sourceTree + <group> + + 19CACF004F780E3053926DAD + + isa + PBXTargetDependency + name + Pods-ReactKit + target + F3743E4364DCD50F66E07E03 + targetProxy + 0D505D056F591E9588F343AA + + 19DA60B0FDB51F564823798C + + children + + 0C7A5A737917BA18817CC207 + + isa + PBXGroup + name + Targets Support Files + sourceTree + <group> + + 1AD314273817E152C7E315BA + + fileRef + 3ED59FDCF3B8DE44DD4C1667 + isa + PBXBuildFile + + 1B55097A38652E47A94193F2 + + fileRef + 1EA900AAF1440F65670A2F9D + isa + PBXBuildFile + + 1D2F520811E96888A497E24D + + isa + PBXTargetDependency + name + Pods-RCTDataManager + target + 932A9309F808F533D40582BB + targetProxy + 21457A5B7E5C5541936A2CAD + + 1E172C103C8DDDD51C260454 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-RCTDataManager-dummy.m + sourceTree + <group> + + 1EA900AAF1440F65670A2F9D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTLog.m + path + Base/RCTLog.m + sourceTree + <group> + + 1F99DFDC314091E129914F82 + + buildConfigurations + + 4CA65E88D9B0A200CE9C9118 + 36CE53F49AD09C21E10675B8 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 2108DCEFAE6CF37482CF1C0A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTKeyCommands.m + path + Base/RCTKeyCommands.m + sourceTree + <group> + + 21457A5B7E5C5541936A2CAD + + containerPortal + BF94ECC553449F9486D48453 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 932A9309F808F533D40582BB + remoteInfo + Pods-RCTDataManager + + 21B434F724639E29EE45E44A + + isa + PBXTargetDependency + name + Pods-ReactKit + target + F3743E4364DCD50F66E07E03 + targetProxy + ED320F983C718810619BABED + + 237ECCFD5EBD9B7C1250F4EB + + fileRef + 9574DCBBFE4EFAB138C43844 + isa + PBXBuildFile + + 2409A610D6AB34EA92D33BE8 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTScrollableProtocol.h + path + Base/RCTScrollableProtocol.h + sourceTree + <group> + + 246059A6C46C6F40327D9399 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-RCTNetworkImage.a + sourceTree + BUILT_PRODUCTS_DIR + + 2572FEE8678A128A03571950 + + fileRef + 56FB9B47588CF0F36FC96390 + isa + PBXBuildFile + + 275C0B2E6CA279611D94AA46 + + fileRef + 6D4728D5CA14DC2EE7EA3544 + isa + PBXBuildFile + + 284A37E0CFFCA95AD5134C06 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTUtils.h + path + Base/RCTUtils.h + sourceTree + <group> + + 290C5E10241C0B2C924F14E6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTViewManager.h + path + Views/RCTViewManager.h + sourceTree + <group> + + 291C4B433C922679BD458D5D + + fileRef + 6AEEF603053FE768ED3E5E4D + isa + PBXBuildFile + + 2BA58703E0C4B2559E28AE42 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTUIManager.m + path + Modules/RCTUIManager.m + sourceTree + <group> + + 2CD30CF1663697474B87D08E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTAutoInsetsProtocol.h + path + Base/RCTAutoInsetsProtocol.h + sourceTree + <group> + + 2D208141DE8BC9DD7F5B8235 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTAlertManager.m + path + Modules/RCTAlertManager.m + sourceTree + <group> + + 2F5591055141A2D7A7918CE8 + + fileRef + C6EB359CFF6D72170FEF1C91 + isa + PBXBuildFile + + 311B1F10DB6ECD376C2C410D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTNetworkImageView.h + sourceTree + <group> + + 31A2F342B0F590C341B80E22 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTShadowRawText.m + sourceTree + <group> + + 33E7FC15EBE6599AD3335BD8 + + buildConfigurationList + 71F3A1261352CEB12D1EFE4E + buildPhases + + DB81D9FD0801A42A48152E0C + 9C430EF11704FB8793CA009C + + buildRules + + dependencies + + 1D2F520811E96888A497E24D + 88CBD87EEA9FF31AAF273687 + BAD9616489752B70E709809C + 21B434F724639E29EE45E44A + + isa + PBXNativeTarget + name + Pods + productName + Pods + productReference + 84D089AE2FBBC9A674F6ED90 + productType + com.apple.product-type.library.static + + 341FFB9C954C6FBBDA1D4CBB + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-ReactKit-prefix.pch + sourceTree + <group> + + 34DBA23002D2E96B79EF3FBE + + fileRef + 8FEF9214746F53A78E8F115F + isa + PBXBuildFile + + 35138A0F59E8056491258E07 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-dummy.m + sourceTree + <group> + + 369763B76533786A8E5353A4 + + fileRef + 4B4D221F3651E112595964E6 + isa + PBXBuildFile + + 36CB892D416C92B38A7AB919 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.script.sh + path + Pods-resources.sh + sourceTree + <group> + + 36CE53F49AD09C21E10675B8 + + baseConfigurationReference + D7A44E0FB5FD0083354541D0 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 38E413F00F71503B4358BF3A + + buildActionMask + 2147483647 + files + + 538D24A47F778BE37D482A70 + B233C279B7F95C416BE7460F + 01DCDFB27A48C1C7A65C2FE6 + 6FC60E013E6B084708F80E1D + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 3AB2DFC2566FB389056F3BAC + + baseConfigurationReference + 9F9D9AED8316D779EAEA6CBB + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + 3AF0EA123B1D6D47095D8F69 + + baseConfigurationReference + 7643C57FD9EC1838B0876BBD + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-prefix.pch + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 3C0A45593BBE3C2A57E72C81 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTDataManager.m + sourceTree + <group> + + 3D1E50AF744E283AA07F6B6A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTStaticImageManager.h + path + Views/RCTStaticImageManager.h + sourceTree + <group> + + 3D6FC3872FA9FE79857A9533 + + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + CLANG_CXX_LANGUAGE_STANDARD + gnu++0x + CLANG_CXX_LIBRARY + libc++ + CLANG_ENABLE_MODULES + YES + CLANG_ENABLE_OBJC_ARC + YES + CLANG_WARN_BOOL_CONVERSION + YES + CLANG_WARN_CONSTANT_CONVERSION + YES + CLANG_WARN_DIRECT_OBJC_ISA_USAGE + YES + CLANG_WARN_EMPTY_BODY + YES + CLANG_WARN_ENUM_CONVERSION + YES + CLANG_WARN_INT_CONVERSION + YES + CLANG_WARN_OBJC_ROOT_CLASS + YES + COPY_PHASE_STRIP + YES + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + GCC_WARN_64_TO_32_BIT_CONVERSION + YES + GCC_WARN_ABOUT_RETURN_TYPE + YES + GCC_WARN_UNDECLARED_SELECTOR + YES + GCC_WARN_UNINITIALIZED_AUTOS + YES + GCC_WARN_UNUSED_FUNCTION + YES + GCC_WARN_UNUSED_VARIABLE + YES + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + ONLY_ACTIVE_ARCH + YES + STRIP_INSTALLED_PRODUCT + NO + + isa + XCBuildConfiguration + name + Debug + + 3E42DBB95C1805122AE2171D + + fileRef + 290C5E10241C0B2C924F14E6 + isa + PBXBuildFile + + 3ED59FDCF3B8DE44DD4C1667 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTBridge.m + path + Base/RCTBridge.m + sourceTree + <group> + + 3EDE783B10222492880DD3AB + + buildActionMask + 2147483647 + files + + 63E51C8504EA2C10E68B02ED + + isa + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 3FFDD3C8378B7BB621BC78E9 + + fileRef + DFA3EC5E1764BCB1C6CDEC48 + isa + PBXBuildFile + + 41135E6FEF13B7C0629B2504 + + buildConfigurations + + 3D6FC3872FA9FE79857A9533 + C2E82E03DD326AD6B9E61CA8 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 4144C0A7A0B5E9B910A49112 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-RCTNetworkImage-prefix.pch + sourceTree + <group> + + 41D67C49FE5405FBC354B2D8 + + fileRef + FFAA9FB176212ECB441C158B + isa + PBXBuildFile + + 42DD1ABF71E7DDE8F625D75F + + buildActionMask + 2147483647 + files + + DDFF4F45838A985D83EB4388 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 432AFAC69A94AA5F06088B28 + + fileRef + D9E56A6CF4CE4A04E95C3014 + isa + PBXBuildFile + + 44B64536F5CA954B8E61E64A + + fileRef + 31A2F342B0F590C341B80E22 + isa + PBXBuildFile + + 45315E8BEBC17056E67EC4FB + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTUtils.m + path + Base/RCTUtils.m + sourceTree + <group> + + 455EF31DC16195410CAEED8B + + baseConfigurationReference + 98E2279571F800AAEC885852 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 46DBB7DDD201455CC7822443 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + UIView+ReactKit.h + path + Views/UIView+ReactKit.h + sourceTree + <group> + + 4819361C459238E768D0623F + + fileRef + F13F01D5CEF7D509D7FB3A75 + isa + PBXBuildFile + + 486A508147DE414B1C54DB3B + + fileRef + CF75A4E5C983EFE50EF23864 + isa + PBXBuildFile + + 48BCE09A6E673A5F0771E3A0 + + fileRef + BC0819432142676ED7CD8D13 + isa + PBXBuildFile + + 48C4ACFA9C0F6598C47536AE + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Pods-acknowledgements.plist + sourceTree + <group> + + 4B4D221F3651E112595964E6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTUIManager.h + path + Modules/RCTUIManager.h + sourceTree + <group> + + 4B5DA911DA22390C5E95B750 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTImageDownloader.m + sourceTree + <group> + + 4BE2DDA0BCC878EB8CB26C5A + + fileRef + 56F3B2390EEE3D197152D75F + isa + PBXBuildFile + + 4C96B8E009C3509E8C4A58F4 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTUIActivityIndicatorViewManager.h + path + Views/RCTUIActivityIndicatorViewManager.h + sourceTree + <group> + + 4CA65E88D9B0A200CE9C9118 + + baseConfigurationReference + D7A44E0FB5FD0083354541D0 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + 4DEEE0266BA65632F6A0E7B1 + + fileRef + 2BA58703E0C4B2559E28AE42 + isa + PBXBuildFile + + 504176B67DCF8860EE15B6DE + + fileRef + 94FE868251742B4D99E9D44C + isa + PBXBuildFile + + 5219B1A509941D57D929D39A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTNavItem.h + path + Views/RCTNavItem.h + sourceTree + <group> + + 52B8E3C21D812BBDA6A21D90 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTImageDownloader.h + sourceTree + <group> + + 52C2F8683752617A087B61F9 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTTextFieldManager.h + path + Views/RCTTextFieldManager.h + sourceTree + <group> + + 5346BE5B4464865BE370DAE3 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTSparseArray.m + path + Base/RCTSparseArray.m + sourceTree + <group> + + 538D24A47F778BE37D482A70 + + fileRef + CECB70566BB387FCC3E72F82 + isa + PBXBuildFile + + 5424AF4790E65783BDA933AE + + fileRef + 1E172C103C8DDDD51C260454 + isa + PBXBuildFile + + 556F7551D750FD292977EAF3 + + containerPortal + BF94ECC553449F9486D48453 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + DF58F2F4E6B0B43A57E1D871 + remoteInfo + Pods-RCTNetworkImage + + 56F3B2390EEE3D197152D75F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTShadowText.m + sourceTree + <group> + + 56FB9B47588CF0F36FC96390 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTEventDispatcher.h + path + Base/RCTEventDispatcher.h + sourceTree + <group> + + 5789BD634633A460A15D2CFB + + buildActionMask + 2147483647 + files + + 73E9110E36C881B06618F651 + BE549016B7D84400A9C21554 + E03E37E50B395F68909D68F1 + 7BFF3710C1742EDD464C3907 + 1AD314273817E152C7E315BA + FCF9FA9A52C6466496834D9B + 72812F427CD41F84EDF7463F + B311A068CB02A3CB5731DF3F + AE2F0C5806A4C1B2923B9AA4 + C830647EE856312FD4703ADA + 6CBFC20798CA2E3F0D05E09A + 1B55097A38652E47A94193F2 + 8415074B62BAA6A44BAFDB9E + 5D6D65155F2608108E24323C + 8239340F32AD35797AFF5916 + A0519A4649CCB73011B039D4 + B917A72C88A3FFCC8B3A78BF + B7BF08D30812CE93EE5B73B8 + A827664554976694F2C33FCC + A8A1B6892A1330983405EBBE + 98C030E0A13DB99C7DF1BB7F + E2DE70C97989E3B70384CE53 + 504176B67DCF8860EE15B6DE + 76644CC3854953214A130D8B + 80DD4040D6A9CCBB3CD0EF7A + DF8895F638ACA4C5989F506D + BCDA3D97529987F3AF6E1E94 + CCDED8EEB351B73EEC8B9F7E + 819EE00153E0D7A318574D69 + A55433F81EC7E8C30974067B + 4DEEE0266BA65632F6A0E7B1 + A245979CC966F650E1C70D22 + 48BCE09A6E673A5F0771E3A0 + F8A906774F36E8CD2451E82E + 6A98A23B930054B26DC54F35 + 7AA8475783959E32EDA602E8 + 8A95730DCFBE1F08DB29B75A + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 581AF9074AC1929D0D1DAB9E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text + name + Podfile + path + ../Podfile + sourceTree + SOURCE_ROOT + xcLanguageSpecificationIdentifier + xcode.lang.ruby + + 5840BACA98667C60F6B3A0C1 + + buildConfigurations + + BD4F6574C5906CCB6FC42D7F + BBE817045F170ECDCB05EF56 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 59186CF0F15087A1C2B440DD + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTEventDispatcher.m + path + Base/RCTEventDispatcher.m + sourceTree + <group> + + 59BF11297A6B39FFEBBB7861 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + Layout.h + path + Layout/Layout.h + sourceTree + <group> + + 5A0B5C72A1AA647B3A4B14F6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTKeyCommands.h + path + Base/RCTKeyCommands.h + sourceTree + <group> + + 5BC09E97F41420AF1394ADCE + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + UIView+ReactKit.m + path + Views/UIView+ReactKit.m + sourceTree + <group> + + 5BE5302E054DBFAF040EF61B + + fileRef + EEE942E8275043E8ADF16BE2 + isa + PBXBuildFile + + 5C36071912941101A0924D87 + + children + + 9574DCBBFE4EFAB138C43844 + + isa + PBXGroup + name + iOS + sourceTree + <group> + + 5D6D65155F2608108E24323C + + fileRef + 94F63AC21292EE02A10FEC17 + isa + PBXBuildFile + + 5DCF6A84FBACA3015BC22399 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTNetworkImageViewManager.m + sourceTree + <group> + + 5E5C5A95047BB06B9931B5DF + + isa + PBXTargetDependency + name + Pods-ReactKit + target + F3743E4364DCD50F66E07E03 + targetProxy + EFDFA99290EC74C5612841DA + + 5F5E7CC68557DA53129800AD + + fileRef + 0EA55D4BFB9E3A24AB05482E + isa + PBXBuildFile + + 5F835835D10C7DFB6A9CF6A3 + + containerPortal + BF94ECC553449F9486D48453 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 607D2E44EB1F20343CE3456B + remoteInfo + Pods-RCTText + + 5F8F95C34626059B26772C85 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTTextManager.h + sourceTree + <group> + + 607D2E44EB1F20343CE3456B + + buildConfigurationList + 7122D1CC40CFBB02C49EA8FE + buildPhases + + 8915B8D680F07A5E87AE7951 + CD226C6942B1DF7EA0A2D228 + 0AC9EE10D9CD5E34ACCC37E0 + + buildRules + + dependencies + + 860C43275459A739AC102F54 + + isa + PBXNativeTarget + name + Pods-RCTText + productName + Pods-RCTText + productReference + 8E4605DF173DA988811CD0D0 + productType + com.apple.product-type.library.static + + 63A3B7B3C237D15908758757 + + children + + BF7B4B3789866923E16FA948 + D7A44E0FB5FD0083354541D0 + CECB70566BB387FCC3E72F82 + 4144C0A7A0B5E9B910A49112 + + isa + PBXGroup + name + Support Files + path + ../../Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage + sourceTree + <group> + + 63E51C8504EA2C10E68B02ED + + fileRef + 88C9CCC953EB2CBD7D57EED8 + isa + PBXBuildFile + + 65319A04EE7272D8823EC289 + + children + + 6D4728D5CA14DC2EE7EA3544 + 09567798D374D77BC5D172B2 + 98AF860C16DE530EE9D5FAD5 + 31A2F342B0F590C341B80E22 + 100E0F66BB2561CD9C5403B1 + 56F3B2390EEE3D197152D75F + E7825F1E43104ED6A50EDB98 + 8FEF9214746F53A78E8F115F + 5F8F95C34626059B26772C85 + 77338B0BEA88CD60DC1ABF10 + EBE596AB2811F489419F35E9 + + isa + PBXGroup + name + RCTText + path + ../../../Libraries/Text + sourceTree + <group> + + 68F34AEA31C32834FA5BC3A8 + + baseConfigurationReference + 6ECB652E72348E5A2B4636FC + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_PRECOMPILE_PREFIX_HEADER + YES + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 69E8EA4F874212E989F8E5F8 + + fileRef + 06C6AEB41647779AE72D05D0 + isa + PBXBuildFile + + 6A98A23B930054B26DC54F35 + + fileRef + B998DFBC2EC7B340775C2514 + isa + PBXBuildFile + + 6AEEF603053FE768ED3E5E4D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTSparseArray.h + path + Base/RCTSparseArray.h + sourceTree + <group> + + 6CBFC20798CA2E3F0D05E09A + + fileRef + 2108DCEFAE6CF37482CF1C0A + isa + PBXBuildFile + + 6D4728D5CA14DC2EE7EA3544 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTRawTextManager.h + sourceTree + <group> + + 6DDC3764218E410C0E170649 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTNetworkImageView.m + sourceTree + <group> + + 6E6299B7449D2F456EA2F26F + + fileRef + 5219B1A509941D57D929D39A + isa + PBXBuildFile + + 6ECB652E72348E5A2B4636FC + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods.release.xcconfig + sourceTree + <group> + + 6FC60E013E6B084708F80E1D + + fileRef + 5DCF6A84FBACA3015BC22399 + isa + PBXBuildFile + + 7050957C06196020470EC5C2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTScrollViewManager.m + path + Views/RCTScrollViewManager.m + sourceTree + <group> + + 70C56F45AD4CAD933ACBE2D4 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTBridge.h + path + Base/RCTBridge.h + sourceTree + <group> + + 710A1B01FA9E8F0E95876C75 + + children + + 8A7EF5F8BDA27A8EFB7E7B50 + 8F5CED50CE2BB3EBC5A0C8B7 + 9D269D2372F1ADF83E59D0E1 + 341FFB9C954C6FBBDA1D4CBB + + isa + PBXGroup + name + Support Files + path + ../Examples/Movies/Pods/Target Support Files/Pods-ReactKit + sourceTree + <group> + + 7122D1CC40CFBB02C49EA8FE + + buildConfigurations + + 788577F7D39EEA8E639BA335 + 455EF31DC16195410CAEED8B + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 7158773877C1566031B98AA7 + + buildActionMask + 2147483647 + files + + FE86C2EE891C09720566A5D9 + E340F8420234B32BB795E0EE + F0B848BA6E9EB162430D912B + + isa + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 7196F57776FE75B146C23681 + + fileRef + 35138A0F59E8056491258E07 + isa + PBXBuildFile + + 71F3A1261352CEB12D1EFE4E + + buildConfigurations + + 3AB2DFC2566FB389056F3BAC + 68F34AEA31C32834FA5BC3A8 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 7244C28261391D75E3F0B0EF + + fileRef + 46DBB7DDD201455CC7822443 + isa + PBXBuildFile + + 7253CC6B6B8F6AE678B3B19C + + buildActionMask + 2147483647 + files + + 106C230D038A62D2C37E5D75 + 432AFAC69A94AA5F06088B28 + 946BDFB1A5D5787E85175DC1 + F3DAEC86B758048B5930EF1B + 07192780F349FFB50B16BAE0 + 7F35C840463DEBE2ACAF026B + 5F5E7CC68557DA53129800AD + 85B47B09FA27F727DAFF911C + 0D8B5E4BC6B802176DDD88E5 + A803356E590BE34243DE7EFE + 2572FEE8678A128A03571950 + B9F42C9908AD31F4BC1F091D + 7650C106B8A5FA38ED23274F + 5BE5302E054DBFAF040EF61B + 907AF60B5B92038D240EC19C + D41179E6AAD395F25177A5F8 + CEFADE7A58F7E4400EE18E25 + 6E6299B7449D2F456EA2F26F + 7611C500CF8043E1E1A8FEA5 + DF924C16971D9C2C83A36133 + F4AB97BA6A8BC00071F62ED2 + 4819361C459238E768D0623F + 837435BB2245CCE3D1565029 + 73BE5712EFEC793AD4B710E1 + BD4CB1806A00FC955BECE0B1 + 2F5591055141A2D7A7918CE8 + 85FA6019949634CBE9A346BE + 149C58083427CE1CD36C8B10 + 291C4B433C922679BD458D5D + AC2A48152BD918215CA11AD5 + F26F1444F50B137ED3B72374 + 486A508147DE414B1C54DB3B + 3FFDD3C8378B7BB621BC78E9 + C3F3445613B7F46DC6BF3E3B + 8620DB570E79F86DF025BEC8 + 41D67C49FE5405FBC354B2D8 + 7FDFCDB3E73CFA4EF24EFC43 + 369763B76533786A8E5353A4 + C8D2916466298AD52317576B + 69E8EA4F874212E989F8E5F8 + 3E42DBB95C1805122AE2171D + 0612C8DB98399C9428864589 + 0B6D46780D0C5F037B9E50AF + B8EFB7E653F82E82FDEBD4EF + 7244C28261391D75E3F0B0EF + + isa + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 72812F427CD41F84EDF7463F + + fileRef + EF98585B892E19B5AE731973 + isa + PBXBuildFile + + 737BA62A1374F34098A61A3C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTNavigator.h + path + Views/RCTNavigator.h + sourceTree + <group> + + 73BE5712EFEC793AD4B710E1 + + fileRef + 1592E2F41A2DC2C927EBBF12 + isa + PBXBuildFile + + 73E9110E36C881B06618F651 + + fileRef + CBE8ADD69617298088FF9ACF + isa + PBXBuildFile + + 7440BE86AA8D5D86F9E0972C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTViewManager.m + path + Views/RCTViewManager.m + sourceTree + <group> + + 7611C500CF8043E1E1A8FEA5 + + fileRef + E59EC5A1D60FD731E0AA3C44 + isa + PBXBuildFile + + 7643C57FD9EC1838B0876BBD + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTDataManager-Private.xcconfig + sourceTree + <group> + + 7650C106B8A5FA38ED23274F + + fileRef + C37AAC16F286B1DB8F7BD60C + isa + PBXBuildFile + + 76644CC3854953214A130D8B + + fileRef + CF563F829B165F3323ABC0A1 + isa + PBXBuildFile + + 77338B0BEA88CD60DC1ABF10 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTTextManager.m + sourceTree + <group> + + 788577F7D39EEA8E639BA335 + + baseConfigurationReference + 98E2279571F800AAEC885852 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + 78C294F35FA33A84D8E83D01 + + buildActionMask + 2147483647 + files + + 5424AF4790E65783BDA933AE + AF2BC09B042EBB50F1A78EB5 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 793AE1E6D8A0F5D66EC764FC + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTExceptionsManager.h + path + Modules/RCTExceptionsManager.h + sourceTree + <group> + + 79AC1D0DBC09CA9546BA5DC2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTConvert.m + path + Base/RCTConvert.m + sourceTree + <group> + + 79BE258178E49FD51E2CC4B8 + + fileRef + 100E0F66BB2561CD9C5403B1 + isa + PBXBuildFile + + 79CA05DA910EEC1FB74AF8B1 + + fileRef + 9574DCBBFE4EFAB138C43844 + isa + PBXBuildFile + + 7AA8475783959E32EDA602E8 + + fileRef + DD631F9387065E2C8158E9D2 + isa + PBXBuildFile + + 7AF4222A15F4D8545D8C75EE + + fileRef + 09567798D374D77BC5D172B2 + isa + PBXBuildFile + + 7BFF3710C1742EDD464C3907 + + fileRef + C3885B5209E462E315C1A082 + isa + PBXBuildFile + + 7CAF752A4A0E37B9583A87DB + + fileRef + E7825F1E43104ED6A50EDB98 + isa + PBXBuildFile + + 7D3032A8B618BED47A896B35 + + children + + 52B8E3C21D812BBDA6A21D90 + 4B5DA911DA22390C5E95B750 + 311B1F10DB6ECD376C2C410D + 6DDC3764218E410C0E170649 + D01D41AF354CCA45EB9E3F09 + 5DCF6A84FBACA3015BC22399 + 63A3B7B3C237D15908758757 + + isa + PBXGroup + name + RCTNetworkImage + path + ../../../Libraries/Image + sourceTree + <group> + + 7EFF5F80196820ED0BAC85A2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTStatusBarManager.m + path + Modules/RCTStatusBarManager.m + sourceTree + <group> + + 7F35C840463DEBE2ACAF026B + + fileRef + 70C56F45AD4CAD933ACBE2D4 + isa + PBXBuildFile + + 7FDFCDB3E73CFA4EF24EFC43 + + fileRef + 4C96B8E009C3509E8C4A58F4 + isa + PBXBuildFile + + 800F02FE328BD54F6A90FD91 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTAssert.h + path + Base/RCTAssert.h + sourceTree + <group> + + 80DD4040D6A9CCBB3CD0EF7A + + fileRef + 7EFF5F80196820ED0BAC85A2 + isa + PBXBuildFile + + 80FE5B00B155529379660FC4 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTTiming.m + path + Modules/RCTTiming.m + sourceTree + <group> + + 819EE00153E0D7A318574D69 + + fileRef + A3895AC4CDB2372877228F14 + isa + PBXBuildFile + + 8239340F32AD35797AFF5916 + + fileRef + CA8DFA708A0CA7DF5695D590 + isa + PBXBuildFile + + 83566DF45DEB3320EB352903 + + containerPortal + BF94ECC553449F9486D48453 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + F3743E4364DCD50F66E07E03 + remoteInfo + Pods-ReactKit + + 837435BB2245CCE3D1565029 + + fileRef + D324AB785A55E2706E36A274 + isa + PBXBuildFile + + 8415074B62BAA6A44BAFDB9E + + fileRef + CEEE4CFBC9BE5736ECAB62E6 + isa + PBXBuildFile + + 84D089AE2FBBC9A674F6ED90 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods.a + sourceTree + BUILT_PRODUCTS_DIR + + 84DC232D4E0A3B5F77BD4BC2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTTextField.m + path + Views/RCTTextField.m + sourceTree + <group> + + 85AD0EB6443ECE478262D6C6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTExceptionsManager.m + path + Modules/RCTExceptionsManager.m + sourceTree + <group> + + 85B47B09FA27F727DAFF911C + + fileRef + 95C56C7BFE0773470DD423D4 + isa + PBXBuildFile + + 85FA6019949634CBE9A346BE + + fileRef + 2409A610D6AB34EA92D33BE8 + isa + PBXBuildFile + + 860C43275459A739AC102F54 + + isa + PBXTargetDependency + name + Pods-ReactKit + target + F3743E4364DCD50F66E07E03 + targetProxy + 83566DF45DEB3320EB352903 + + 8620DB570E79F86DF025BEC8 + + fileRef + A0E7CDD7949470FE40475426 + isa + PBXBuildFile + + 8775A8D4E6338D61BF1064C5 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTShadowView.m + path + Views/RCTShadowView.m + sourceTree + <group> + + 880D38F15FF447F995573AB3 + + fileRef + 77338B0BEA88CD60DC1ABF10 + isa + PBXBuildFile + + 88505E4377E9058030C956B9 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text + path + Pods-acknowledgements.markdown + sourceTree + <group> + + 88C9CCC953EB2CBD7D57EED8 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTDataManager.h + sourceTree + <group> + + 88CBD87EEA9FF31AAF273687 + + isa + PBXTargetDependency + name + Pods-RCTNetworkImage + target + DF58F2F4E6B0B43A57E1D871 + targetProxy + 556F7551D750FD292977EAF3 + + 8915B8D680F07A5E87AE7951 + + buildActionMask + 2147483647 + files + + 9CAF0499B0A74F5CFA2A1E3B + 7AF4222A15F4D8545D8C75EE + 44B64536F5CA954B8E61E64A + 4BE2DDA0BCC878EB8CB26C5A + 34DBA23002D2E96B79EF3FBE + 880D38F15FF447F995573AB3 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 8A7EF5F8BDA27A8EFB7E7B50 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-ReactKit.xcconfig + sourceTree + <group> + + 8A95730DCFBE1F08DB29B75A + + fileRef + 5BC09E97F41420AF1394ADCE + isa + PBXBuildFile + + 8AAEE8636EA9A9FF644ED344 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTText.xcconfig + sourceTree + <group> + + 8B70E5434E2CB2792BB8CC44 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTNavigatorManager.m + path + Views/RCTNavigatorManager.m + sourceTree + <group> + + 8E4605DF173DA988811CD0D0 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-RCTText.a + sourceTree + BUILT_PRODUCTS_DIR + + 8F5CED50CE2BB3EBC5A0C8B7 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-ReactKit-Private.xcconfig + sourceTree + <group> + + 8FEF9214746F53A78E8F115F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTText.m + sourceTree + <group> + + 907AF60B5B92038D240EC19C + + fileRef + 1782BB92C0A529BF6AD72DFF + isa + PBXBuildFile + + 90D5389E9D73CDBB276C1B34 + + children + + 5C36071912941101A0924D87 + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + 932A9309F808F533D40582BB + + buildConfigurationList + AC60249688E27C48CD0E62A1 + buildPhases + + 78C294F35FA33A84D8E83D01 + 42DD1ABF71E7DDE8F625D75F + 3EDE783B10222492880DD3AB + + buildRules + + dependencies + + 5E5C5A95047BB06B9931B5DF + + isa + PBXNativeTarget + name + Pods-RCTDataManager + productName + Pods-RCTDataManager + productReference + C9D66CDB1AB4CA948A39E26D + productType + com.apple.product-type.library.static + + 9361F6C165FFAD1CE1130BA7 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTStaticImage.h + path + Views/RCTStaticImage.h + sourceTree + <group> + + 946BDFB1A5D5787E85175DC1 + + fileRef + 15F0D204E7BD9B1607786736 + isa + PBXBuildFile + + 94F63AC21292EE02A10FEC17 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTNavItemManager.m + path + Views/RCTNavItemManager.m + sourceTree + <group> + + 94FE868251742B4D99E9D44C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTStaticImage.m + path + Views/RCTStaticImage.m + sourceTree + <group> + + 9574DCBBFE4EFAB138C43844 + + isa + PBXFileReference + lastKnownFileType + wrapper.framework + name + Foundation.framework + path + Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/Foundation.framework + sourceTree + DEVELOPER_DIR + + 95C56C7BFE0773470DD423D4 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTCache.h + path + Base/RCTCache.h + sourceTree + <group> + + 98AF860C16DE530EE9D5FAD5 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTShadowRawText.h + sourceTree + <group> + + 98C030E0A13DB99C7DF1BB7F + + fileRef + 8775A8D4E6338D61BF1064C5 + isa + PBXBuildFile + + 98E2279571F800AAEC885852 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTText-Private.xcconfig + sourceTree + <group> + + 99F944FDFA42E71DFD034D19 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTWebViewExecutor.h + path + Executors/RCTWebViewExecutor.h + sourceTree + <group> + + 9C430EF11704FB8793CA009C + + buildActionMask + 2147483647 + files + + 79CA05DA910EEC1FB74AF8B1 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 9CAACB75648220203821AF2C + + buildActionMask + 2147483647 + files + + 237ECCFD5EBD9B7C1250F4EB + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 9CAF0499B0A74F5CFA2A1E3B + + fileRef + DFBDE4922D5AE7807A0676AB + isa + PBXBuildFile + + 9D269D2372F1ADF83E59D0E1 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-ReactKit-dummy.m + sourceTree + <group> + + 9DD770C9F0909D7B663F79B9 + + children + + 84D089AE2FBBC9A674F6ED90 + C9D66CDB1AB4CA948A39E26D + 246059A6C46C6F40327D9399 + 8E4605DF173DA988811CD0D0 + 0A9F33FAC1AE68D789D1776C + + isa + PBXGroup + name + Products + sourceTree + <group> + + 9F9D9AED8316D779EAEA6CBB + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods.debug.xcconfig + sourceTree + <group> + + A0519A4649CCB73011B039D4 + + fileRef + 8B70E5434E2CB2792BB8CC44 + isa + PBXBuildFile + + A0E7CDD7949470FE40475426 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTTiming.h + path + Modules/RCTTiming.h + sourceTree + <group> + + A23F22A624E7020BCB6E7BA5 + + baseConfigurationReference + 7643C57FD9EC1838B0876BBD + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-prefix.pch + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + A245979CC966F650E1C70D22 + + fileRef + 45315E8BEBC17056E67EC4FB + isa + PBXBuildFile + + A381C58516139C34B8364CD6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTConvert.h + path + Base/RCTConvert.h + sourceTree + <group> + + A3895AC4CDB2372877228F14 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTTouchHandler.m + path + Base/RCTTouchHandler.m + sourceTree + <group> + + A55433F81EC7E8C30974067B + + fileRef + 0EAFFB5E66ACE63398007604 + isa + PBXBuildFile + + A70A067FFB2FCBB711D7F5FD + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTTextFieldManager.m + path + Views/RCTTextFieldManager.m + sourceTree + <group> + + A803356E590BE34243DE7EFE + + fileRef + A381C58516139C34B8364CD6 + isa + PBXBuildFile + + A827664554976694F2C33FCC + + fileRef + E6F823FCA4D283EAAAD0D577 + isa + PBXBuildFile + + A8A1B6892A1330983405EBBE + + fileRef + 7050957C06196020470EC5C2 + isa + PBXBuildFile + + AABC0F0E4C257651C752A272 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTNavigatorManager.h + path + Views/RCTNavigatorManager.h + sourceTree + <group> + + AB42C08CAF730F8AF9C8ADAB + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTRedBox.m + path + Base/RCTRedBox.m + sourceTree + <group> + + AC11EC6BAF7ED8F76E48397C + + fileRef + 98AF860C16DE530EE9D5FAD5 + isa + PBXBuildFile + + AC2A48152BD918215CA11AD5 + + fileRef + 9361F6C165FFAD1CE1130BA7 + isa + PBXBuildFile + + AC60249688E27C48CD0E62A1 + + buildConfigurations + + A23F22A624E7020BCB6E7BA5 + 3AF0EA123B1D6D47095D8F69 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + ADAA64389F188489440FF394 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTDataManager.xcconfig + sourceTree + <group> + + AE2F0C5806A4C1B2923B9AA4 + + fileRef + 59186CF0F15087A1C2B440DD + isa + PBXBuildFile + + AE5A12E81280D6C3660A8555 + + fileRef + 9574DCBBFE4EFAB138C43844 + isa + PBXBuildFile + + AF2BC09B042EBB50F1A78EB5 + + fileRef + 3C0A45593BBE3C2A57E72C81 + isa + PBXBuildFile + + B1A56B88049B3F5961BAEF1F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-environment.h + sourceTree + <group> + + B233C279B7F95C416BE7460F + + fileRef + 4B5DA911DA22390C5E95B750 + isa + PBXBuildFile + + B311A068CB02A3CB5731DF3F + + fileRef + 79AC1D0DBC09CA9546BA5DC2 + isa + PBXBuildFile + + B31D0718AFFBEBA633A5AB25 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTLog.h + path + Base/RCTLog.h + sourceTree + <group> + + B6BB65B0F788DFF2F121D4F7 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTShadowView.h + path + Views/RCTShadowView.h + sourceTree + <group> + + B7BF08D30812CE93EE5B73B8 + + fileRef + F101BBCEB615F24C5BA2B161 + isa + PBXBuildFile + + B8EFB7E653F82E82FDEBD4EF + + fileRef + 17C0992A90EEBE80108AEF54 + isa + PBXBuildFile + + B917A72C88A3FFCC8B3A78BF + + fileRef + AB42C08CAF730F8AF9C8ADAB + isa + PBXBuildFile + + B998DFBC2EC7B340775C2514 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTWebViewExecutor.m + path + Executors/RCTWebViewExecutor.m + sourceTree + <group> + + B9F42C9908AD31F4BC1F091D + + fileRef + 793AE1E6D8A0F5D66EC764FC + isa + PBXBuildFile + + BAD9616489752B70E709809C + + isa + PBXTargetDependency + name + Pods-RCTText + target + 607D2E44EB1F20343CE3456B + targetProxy + 5F835835D10C7DFB6A9CF6A3 + + BBE817045F170ECDCB05EF56 + + baseConfigurationReference + 8F5CED50CE2BB3EBC5A0C8B7 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + BC0819432142676ED7CD8D13 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTView.m + path + Views/RCTView.m + sourceTree + <group> + + BCDA3D97529987F3AF6E1E94 + + fileRef + A70A067FFB2FCBB711D7F5FD + isa + PBXBuildFile + + BD4CB1806A00FC955BECE0B1 + + fileRef + E56829432E0DA699D11DF890 + isa + PBXBuildFile + + BD4F6574C5906CCB6FC42D7F + + baseConfigurationReference + 8F5CED50CE2BB3EBC5A0C8B7 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + BE549016B7D84400A9C21554 + + fileRef + 9D269D2372F1ADF83E59D0E1 + isa + PBXBuildFile + + BF7B4B3789866923E16FA948 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTNetworkImage.xcconfig + sourceTree + <group> + + BF94ECC553449F9486D48453 + + attributes + + LastUpgradeCheck + 0510 + + buildConfigurationList + 41135E6FEF13B7C0629B2504 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + + mainGroup + 075ECFDD9BCF0E8901AE8625 + productRefGroup + 9DD770C9F0909D7B663F79B9 + projectDirPath + + projectReferences + + projectRoot + + targets + + 33E7FC15EBE6599AD3335BD8 + 932A9309F808F533D40582BB + DF58F2F4E6B0B43A57E1D871 + 607D2E44EB1F20343CE3456B + F3743E4364DCD50F66E07E03 + + + C2E82E03DD326AD6B9E61CA8 + + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + CLANG_CXX_LANGUAGE_STANDARD + gnu++0x + CLANG_CXX_LIBRARY + libc++ + CLANG_ENABLE_MODULES + YES + CLANG_ENABLE_OBJC_ARC + YES + CLANG_WARN_BOOL_CONVERSION + YES + CLANG_WARN_CONSTANT_CONVERSION + YES + CLANG_WARN_DIRECT_OBJC_ISA_USAGE + YES + CLANG_WARN_EMPTY_BODY + YES + CLANG_WARN_ENUM_CONVERSION + YES + CLANG_WARN_INT_CONVERSION + YES + CLANG_WARN_OBJC_ROOT_CLASS + YES + COPY_PHASE_STRIP + NO + ENABLE_NS_ASSERTIONS + NO + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_PREPROCESSOR_DEFINITIONS + + RELEASE=1 + + GCC_WARN_64_TO_32_BIT_CONVERSION + YES + GCC_WARN_ABOUT_RETURN_TYPE + YES + GCC_WARN_UNDECLARED_SELECTOR + YES + GCC_WARN_UNINITIALIZED_AUTOS + YES + GCC_WARN_UNUSED_FUNCTION + YES + GCC_WARN_UNUSED_VARIABLE + YES + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + STRIP_INSTALLED_PRODUCT + NO + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + C37AAC16F286B1DB8F7BD60C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTInvalidating.h + path + Base/RCTInvalidating.h + sourceTree + <group> + + C3885B5209E462E315C1A082 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTAssert.m + path + Base/RCTAssert.m + sourceTree + <group> + + C3F3445613B7F46DC6BF3E3B + + fileRef + 52C2F8683752617A087B61F9 + isa + PBXBuildFile + + C6EB359CFF6D72170FEF1C91 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTScrollViewManager.h + path + Views/RCTScrollViewManager.h + sourceTree + <group> + + C830647EE856312FD4703ADA + + fileRef + 85AD0EB6443ECE478262D6C6 + isa + PBXBuildFile + + C8D2916466298AD52317576B + + fileRef + 284A37E0CFFCA95AD5134C06 + isa + PBXBuildFile + + C9D66CDB1AB4CA948A39E26D + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-RCTDataManager.a + sourceTree + BUILT_PRODUCTS_DIR + + CA8DFA708A0CA7DF5695D590 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTNavigator.m + path + Views/RCTNavigator.m + sourceTree + <group> + + CBE8ADD69617298088FF9ACF + + includeInIndex + 1 + isa + PBXFileReference + name + Layout.c + path + Layout/Layout.c + sourceTree + <group> + + CC953A5B7DFF969670A89AF9 + + fileRef + 9574DCBBFE4EFAB138C43844 + isa + PBXBuildFile + + CCDED8EEB351B73EEC8B9F7E + + fileRef + 80FE5B00B155529379660FC4 + isa + PBXBuildFile + + CD226C6942B1DF7EA0A2D228 + + buildActionMask + 2147483647 + files + + CC953A5B7DFF969670A89AF9 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + CDB49A44CDED422DC861AC80 + + fileRef + 5F8F95C34626059B26772C85 + isa + PBXBuildFile + + CECB70566BB387FCC3E72F82 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-RCTNetworkImage-dummy.m + sourceTree + <group> + + CEEE4CFBC9BE5736ECAB62E6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTNavItem.m + path + Views/RCTNavItem.m + sourceTree + <group> + + CEFADE7A58F7E4400EE18E25 + + fileRef + B31D0718AFFBEBA633A5AB25 + isa + PBXBuildFile + + CF563F829B165F3323ABC0A1 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTStaticImageManager.m + path + Views/RCTStaticImageManager.m + sourceTree + <group> + + CF75A4E5C983EFE50EF23864 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTStatusBarManager.h + path + Modules/RCTStatusBarManager.h + sourceTree + <group> + + D01D41AF354CCA45EB9E3F09 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTNetworkImageViewManager.h + sourceTree + <group> + + D324AB785A55E2706E36A274 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTRedBox.h + path + Base/RCTRedBox.h + sourceTree + <group> + + D34FE18B7D368E5AD6584E23 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTCache.m + path + Base/RCTCache.m + sourceTree + <group> + + D41179E6AAD395F25177A5F8 + + fileRef + 5A0B5C72A1AA647B3A4B14F6 + isa + PBXBuildFile + + D606AC45A684300C958D9C0C + + children + + 88C9CCC953EB2CBD7D57EED8 + 3C0A45593BBE3C2A57E72C81 + 048B0A5A6D3AE173A67CAE93 + + isa + PBXGroup + name + RCTDataManager + path + ../../../Libraries/Network + sourceTree + <group> + + D7A44E0FB5FD0083354541D0 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTNetworkImage-Private.xcconfig + sourceTree + <group> + + D9E56A6CF4CE4A04E95C3014 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTAlertManager.h + path + Modules/RCTAlertManager.h + sourceTree + <group> + + DB81D9FD0801A42A48152E0C + + buildActionMask + 2147483647 + files + + 7196F57776FE75B146C23681 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + DD25A411976BA72A8CB95128 + + children + + CBE8ADD69617298088FF9ACF + 59BF11297A6B39FFEBBB7861 + D9E56A6CF4CE4A04E95C3014 + 2D208141DE8BC9DD7F5B8235 + 15F0D204E7BD9B1607786736 + 800F02FE328BD54F6A90FD91 + C3885B5209E462E315C1A082 + 2CD30CF1663697474B87D08E + 70C56F45AD4CAD933ACBE2D4 + 3ED59FDCF3B8DE44DD4C1667 + 0EA55D4BFB9E3A24AB05482E + 95C56C7BFE0773470DD423D4 + D34FE18B7D368E5AD6584E23 + E64248B361B8929CFE00FADC + EF98585B892E19B5AE731973 + A381C58516139C34B8364CD6 + 79AC1D0DBC09CA9546BA5DC2 + 56FB9B47588CF0F36FC96390 + 59186CF0F15087A1C2B440DD + 793AE1E6D8A0F5D66EC764FC + 85AD0EB6443ECE478262D6C6 + C37AAC16F286B1DB8F7BD60C + EEE942E8275043E8ADF16BE2 + 1782BB92C0A529BF6AD72DFF + 5A0B5C72A1AA647B3A4B14F6 + 2108DCEFAE6CF37482CF1C0A + B31D0718AFFBEBA633A5AB25 + 1EA900AAF1440F65670A2F9D + 5219B1A509941D57D929D39A + CEEE4CFBC9BE5736ECAB62E6 + E59EC5A1D60FD731E0AA3C44 + 94F63AC21292EE02A10FEC17 + 737BA62A1374F34098A61A3C + CA8DFA708A0CA7DF5695D590 + AABC0F0E4C257651C752A272 + 8B70E5434E2CB2792BB8CC44 + F13F01D5CEF7D509D7FB3A75 + D324AB785A55E2706E36A274 + AB42C08CAF730F8AF9C8ADAB + 1592E2F41A2DC2C927EBBF12 + F101BBCEB615F24C5BA2B161 + E56829432E0DA699D11DF890 + E6F823FCA4D283EAAAD0D577 + C6EB359CFF6D72170FEF1C91 + 7050957C06196020470EC5C2 + 2409A610D6AB34EA92D33BE8 + B6BB65B0F788DFF2F121D4F7 + 8775A8D4E6338D61BF1064C5 + 6AEEF603053FE768ED3E5E4D + 5346BE5B4464865BE370DAE3 + 9361F6C165FFAD1CE1130BA7 + 94FE868251742B4D99E9D44C + 3D1E50AF744E283AA07F6B6A + CF563F829B165F3323ABC0A1 + CF75A4E5C983EFE50EF23864 + 7EFF5F80196820ED0BAC85A2 + DFA3EC5E1764BCB1C6CDEC48 + 84DC232D4E0A3B5F77BD4BC2 + 52C2F8683752617A087B61F9 + A70A067FFB2FCBB711D7F5FD + A0E7CDD7949470FE40475426 + 80FE5B00B155529379660FC4 + FFAA9FB176212ECB441C158B + A3895AC4CDB2372877228F14 + 4C96B8E009C3509E8C4A58F4 + 0EAFFB5E66ACE63398007604 + 4B4D221F3651E112595964E6 + 2BA58703E0C4B2559E28AE42 + 284A37E0CFFCA95AD5134C06 + 45315E8BEBC17056E67EC4FB + 06C6AEB41647779AE72D05D0 + BC0819432142676ED7CD8D13 + 290C5E10241C0B2C924F14E6 + 7440BE86AA8D5D86F9E0972C + 12E89F4AD5820CD9722AD8D0 + 99F944FDFA42E71DFD034D19 + B998DFBC2EC7B340775C2514 + 17C0992A90EEBE80108AEF54 + DD631F9387065E2C8158E9D2 + 46DBB7DDD201455CC7822443 + 5BC09E97F41420AF1394ADCE + 710A1B01FA9E8F0E95876C75 + + isa + PBXGroup + name + ReactKit + path + ../../../ReactKit + sourceTree + <group> + + DD631F9387065E2C8158E9D2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTWrapperViewController.m + path + Views/RCTWrapperViewController.m + sourceTree + <group> + + DDFF4F45838A985D83EB4388 + + fileRef + 9574DCBBFE4EFAB138C43844 + isa + PBXBuildFile + + DF58F2F4E6B0B43A57E1D871 + + buildConfigurationList + 1F99DFDC314091E129914F82 + buildPhases + + 38E413F00F71503B4358BF3A + 9CAACB75648220203821AF2C + 7158773877C1566031B98AA7 + + buildRules + + dependencies + + 19CACF004F780E3053926DAD + + isa + PBXNativeTarget + name + Pods-RCTNetworkImage + productName + Pods-RCTNetworkImage + productReference + 246059A6C46C6F40327D9399 + productType + com.apple.product-type.library.static + + DF8895F638ACA4C5989F506D + + fileRef + 84DC232D4E0A3B5F77BD4BC2 + isa + PBXBuildFile + + DF924C16971D9C2C83A36133 + + fileRef + 737BA62A1374F34098A61A3C + isa + PBXBuildFile + + DFA3EC5E1764BCB1C6CDEC48 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTTextField.h + path + Views/RCTTextField.h + sourceTree + <group> + + DFBDE4922D5AE7807A0676AB + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-RCTText-dummy.m + sourceTree + <group> + + E03E37E50B395F68909D68F1 + + fileRef + 2D208141DE8BC9DD7F5B8235 + isa + PBXBuildFile + + E2DE70C97989E3B70384CE53 + + fileRef + 5346BE5B4464865BE370DAE3 + isa + PBXBuildFile + + E340F8420234B32BB795E0EE + + fileRef + 311B1F10DB6ECD376C2C410D + isa + PBXBuildFile + + E56829432E0DA699D11DF890 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTScrollView.h + path + Views/RCTScrollView.h + sourceTree + <group> + + E59EC5A1D60FD731E0AA3C44 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTNavItemManager.h + path + Views/RCTNavItemManager.h + sourceTree + <group> + + E64248B361B8929CFE00FADC + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTContextExecutor.h + path + Executors/RCTContextExecutor.h + sourceTree + <group> + + E6F823FCA4D283EAAAD0D577 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTScrollView.m + path + Views/RCTScrollView.m + sourceTree + <group> + + E7825F1E43104ED6A50EDB98 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTText.h + sourceTree + <group> + + EBE596AB2811F489419F35E9 + + children + + 8AAEE8636EA9A9FF644ED344 + 98E2279571F800AAEC885852 + DFBDE4922D5AE7807A0676AB + F59352A24B5D8F8B1FF74ABC + + isa + PBXGroup + name + Support Files + path + ../../Examples/Movies/Pods/Target Support Files/Pods-RCTText + sourceTree + <group> + + ED320F983C718810619BABED + + containerPortal + BF94ECC553449F9486D48453 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + F3743E4364DCD50F66E07E03 + remoteInfo + Pods-ReactKit + + EEE942E8275043E8ADF16BE2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTJSMethodRegistrar.h + path + Base/RCTJSMethodRegistrar.h + sourceTree + <group> + + EF98585B892E19B5AE731973 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTContextExecutor.m + path + Executors/RCTContextExecutor.m + sourceTree + <group> + + EFDFA99290EC74C5612841DA + + containerPortal + BF94ECC553449F9486D48453 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + F3743E4364DCD50F66E07E03 + remoteInfo + Pods-ReactKit + + F0B848BA6E9EB162430D912B + + fileRef + D01D41AF354CCA45EB9E3F09 + isa + PBXBuildFile + + F101BBCEB615F24C5BA2B161 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTRootView.m + path + Base/RCTRootView.m + sourceTree + <group> + + F13F01D5CEF7D509D7FB3A75 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTPointerEvents.h + path + Base/RCTPointerEvents.h + sourceTree + <group> + + F190DBB178201E2AC54C7F70 + + buildActionMask + 2147483647 + files + + AE5A12E81280D6C3660A8555 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + F26F1444F50B137ED3B72374 + + fileRef + 3D1E50AF744E283AA07F6B6A + isa + PBXBuildFile + + F3743E4364DCD50F66E07E03 + + buildConfigurationList + 5840BACA98667C60F6B3A0C1 + buildPhases + + 5789BD634633A460A15D2CFB + F190DBB178201E2AC54C7F70 + 7253CC6B6B8F6AE678B3B19C + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Pods-ReactKit + productName + Pods-ReactKit + productReference + 0A9F33FAC1AE68D789D1776C + productType + com.apple.product-type.library.static + + F3DAEC86B758048B5930EF1B + + fileRef + 800F02FE328BD54F6A90FD91 + isa + PBXBuildFile + + F4AB97BA6A8BC00071F62ED2 + + fileRef + AABC0F0E4C257651C752A272 + isa + PBXBuildFile + + F59352A24B5D8F8B1FF74ABC + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-RCTText-prefix.pch + sourceTree + <group> + + F5B54251AEB97ECA54054310 + + children + + D606AC45A684300C958D9C0C + 7D3032A8B618BED47A896B35 + 65319A04EE7272D8823EC289 + DD25A411976BA72A8CB95128 + + isa + PBXGroup + name + Development Pods + sourceTree + <group> + + F8A906774F36E8CD2451E82E + + fileRef + 7440BE86AA8D5D86F9E0972C + isa + PBXBuildFile + + FCF9FA9A52C6466496834D9B + + fileRef + D34FE18B7D368E5AD6584E23 + isa + PBXBuildFile + + FE86C2EE891C09720566A5D9 + + fileRef + 52B8E3C21D812BBDA6A21D90 + isa + PBXBuildFile + + FFAA9FB176212ECB441C158B + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTTouchHandler.h + path + Base/RCTTouchHandler.h + sourceTree + <group> + + + rootObject + BF94ECC553449F9486D48453 + + diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-Private.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-Private.xcconfig new file mode 100644 index 000000000..218750234 --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-Private.xcconfig @@ -0,0 +1,5 @@ +#include "Pods-RCTDataManager.xcconfig" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/RCTDataManager" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTDataManager" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" +OTHER_LDFLAGS = -ObjC +PODS_ROOT = ${SRCROOT} \ No newline at end of file diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-dummy.m b/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-dummy.m new file mode 100644 index 000000000..d24331906 --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_RCTDataManager : NSObject +@end +@implementation PodsDummy_Pods_RCTDataManager +@end diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-prefix.pch b/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-prefix.pch new file mode 100644 index 000000000..95cf11d9f --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-prefix.pch @@ -0,0 +1,5 @@ +#ifdef __OBJC__ +#import +#endif + +#import "Pods-environment.h" diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager.xcconfig new file mode 100644 index 000000000..e69de29bb diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-Private.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-Private.xcconfig new file mode 100644 index 000000000..a6d8b3f6b --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-Private.xcconfig @@ -0,0 +1,5 @@ +#include "Pods-RCTNetworkImage.xcconfig" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/RCTNetworkImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTDataManager" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" +OTHER_LDFLAGS = -ObjC +PODS_ROOT = ${SRCROOT} \ No newline at end of file diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-dummy.m b/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-dummy.m new file mode 100644 index 000000000..04c9099fa --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_RCTNetworkImage : NSObject +@end +@implementation PodsDummy_Pods_RCTNetworkImage +@end diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch b/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch new file mode 100644 index 000000000..95cf11d9f --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch @@ -0,0 +1,5 @@ +#ifdef __OBJC__ +#import +#endif + +#import "Pods-environment.h" diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage.xcconfig new file mode 100644 index 000000000..e69de29bb diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-Private.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-Private.xcconfig new file mode 100644 index 000000000..bad687207 --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-Private.xcconfig @@ -0,0 +1,5 @@ +#include "Pods-RCTText.xcconfig" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/RCTText" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTDataManager" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" +OTHER_LDFLAGS = -ObjC +PODS_ROOT = ${SRCROOT} \ No newline at end of file diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-dummy.m b/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-dummy.m new file mode 100644 index 000000000..0ee407269 --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_RCTText : NSObject +@end +@implementation PodsDummy_Pods_RCTText +@end diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch b/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch new file mode 100644 index 000000000..95cf11d9f --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch @@ -0,0 +1,5 @@ +#ifdef __OBJC__ +#import +#endif + +#import "Pods-environment.h" diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText.xcconfig new file mode 100644 index 000000000..e69de29bb diff --git a/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-Private.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-Private.xcconfig new file mode 100644 index 000000000..0cbb59168 --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-Private.xcconfig @@ -0,0 +1,5 @@ +#include "Pods-ReactKit.xcconfig" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/ReactKit" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTDataManager" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" +OTHER_LDFLAGS = -ObjC +PODS_ROOT = ${SRCROOT} \ No newline at end of file diff --git a/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-dummy.m b/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-dummy.m new file mode 100644 index 000000000..ab3f82b8c --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_ReactKit : NSObject +@end +@implementation PodsDummy_Pods_ReactKit +@end diff --git a/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch b/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch new file mode 100644 index 000000000..95cf11d9f --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch @@ -0,0 +1,5 @@ +#ifdef __OBJC__ +#import +#endif + +#import "Pods-environment.h" diff --git a/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit.xcconfig new file mode 100644 index 000000000..e69de29bb diff --git a/Examples/Movies/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown b/Examples/Movies/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown new file mode 100644 index 000000000..255149a82 --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown @@ -0,0 +1,3 @@ +# Acknowledgements +This application makes use of the following third party libraries: +Generated by CocoaPods - http://cocoapods.org diff --git a/Examples/Movies/Pods/Target Support Files/Pods/Pods-acknowledgements.plist b/Examples/Movies/Pods/Target Support Files/Pods/Pods-acknowledgements.plist new file mode 100644 index 000000000..e4edebe92 --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods/Pods-acknowledgements.plist @@ -0,0 +1,29 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - http://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/Examples/Movies/Pods/Target Support Files/Pods/Pods-dummy.m b/Examples/Movies/Pods/Target Support Files/Pods/Pods-dummy.m new file mode 100644 index 000000000..ade64bd1a --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods/Pods-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods : NSObject +@end +@implementation PodsDummy_Pods +@end diff --git a/Examples/Movies/Pods/Target Support Files/Pods/Pods-environment.h b/Examples/Movies/Pods/Target Support Files/Pods/Pods-environment.h new file mode 100644 index 000000000..67012b5ac --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods/Pods-environment.h @@ -0,0 +1,32 @@ + +// To check if a library is compiled with CocoaPods you +// can use the `COCOAPODS` macro definition which is +// defined in the xcconfigs so it is available in +// headers also when they are imported in the client +// project. + + +// RCTDataManager +#define COCOAPODS_POD_AVAILABLE_RCTDataManager +#define COCOAPODS_VERSION_MAJOR_RCTDataManager 0 +#define COCOAPODS_VERSION_MINOR_RCTDataManager 0 +#define COCOAPODS_VERSION_PATCH_RCTDataManager 1 + +// RCTNetworkImage +#define COCOAPODS_POD_AVAILABLE_RCTNetworkImage +#define COCOAPODS_VERSION_MAJOR_RCTNetworkImage 0 +#define COCOAPODS_VERSION_MINOR_RCTNetworkImage 0 +#define COCOAPODS_VERSION_PATCH_RCTNetworkImage 1 + +// RCTText +#define COCOAPODS_POD_AVAILABLE_RCTText +#define COCOAPODS_VERSION_MAJOR_RCTText 0 +#define COCOAPODS_VERSION_MINOR_RCTText 0 +#define COCOAPODS_VERSION_PATCH_RCTText 1 + +// ReactKit +#define COCOAPODS_POD_AVAILABLE_ReactKit +#define COCOAPODS_VERSION_MAJOR_ReactKit 0 +#define COCOAPODS_VERSION_MINOR_ReactKit 0 +#define COCOAPODS_VERSION_PATCH_ReactKit 1 + diff --git a/Examples/Movies/Pods/Target Support Files/Pods/Pods-resources.sh b/Examples/Movies/Pods/Target Support Files/Pods/Pods-resources.sh new file mode 100755 index 000000000..e149064a0 --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods/Pods-resources.sh @@ -0,0 +1,74 @@ +#!/bin/sh +set -e + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +install_resource() +{ + case $1 in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.framework) + echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" + xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ;; + /*) + echo "$1" + echo "$1" >> "$RESOURCES_TO_COPY" + ;; + *) + echo "${PODS_ROOT}/$1" + echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]]; then + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ `find . -name '*.xcassets' | wc -l` -ne 0 ] +then + case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; + esac + find "${PWD}" -name "*.xcassets" -print0 | xargs -0 actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/Examples/Movies/Pods/Target Support Files/Pods/Pods.debug.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods/Pods.debug.xcconfig new file mode 100644 index 000000000..2f6368289 --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods/Pods.debug.xcconfig @@ -0,0 +1,6 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTDataManager" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" +OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/RCTDataManager" -isystem "${PODS_ROOT}/Headers/Public/RCTNetworkImage" -isystem "${PODS_ROOT}/Headers/Public/RCTText" -isystem "${PODS_ROOT}/Headers/Public/ReactKit" +OTHER_LDFLAGS = -ObjC -l"Pods-RCTDataManager" -l"Pods-RCTNetworkImage" -l"Pods-RCTText" -l"Pods-ReactKit" +OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Examples/Movies/Pods/Target Support Files/Pods/Pods.release.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods/Pods.release.xcconfig new file mode 100644 index 000000000..2f6368289 --- /dev/null +++ b/Examples/Movies/Pods/Target Support Files/Pods/Pods.release.xcconfig @@ -0,0 +1,6 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTDataManager" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" +OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/RCTDataManager" -isystem "${PODS_ROOT}/Headers/Public/RCTNetworkImage" -isystem "${PODS_ROOT}/Headers/Public/RCTText" -isystem "${PODS_ROOT}/Headers/Public/ReactKit" +OTHER_LDFLAGS = -ObjC -l"Pods-RCTDataManager" -l"Pods-RCTNetworkImage" -l"Pods-RCTText" -l"Pods-ReactKit" +OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Examples/TicTacToe/AppDelegate.m b/Examples/TicTacToe/AppDelegate.m index 52e682752..245bf2bd2 100644 --- a/Examples/TicTacToe/AppDelegate.m +++ b/Examples/TicTacToe/AppDelegate.m @@ -2,7 +2,7 @@ #import "AppDelegate.h" -#import "RCTRootView.h" +#import @implementation AppDelegate diff --git a/Examples/TicTacToe/Podfile b/Examples/TicTacToe/Podfile new file mode 100644 index 000000000..61aedac11 --- /dev/null +++ b/Examples/TicTacToe/Podfile @@ -0,0 +1,5 @@ +source 'https://github.com/CocoaPods/Specs.git' + +pod 'RCTText', :path => '../../Libraries/Text' +pod 'RCTNetworkImage', :path => '../../Libraries/Image' +pod 'ReactKit', :path => '../../ReactKit' diff --git a/Examples/TicTacToe/Podfile.lock b/Examples/TicTacToe/Podfile.lock new file mode 100644 index 000000000..79377f7f5 --- /dev/null +++ b/Examples/TicTacToe/Podfile.lock @@ -0,0 +1,26 @@ +PODS: + - RCTNetworkImage (0.0.1): + - ReactKit (~> 0.0.1) + - RCTText (0.0.1): + - ReactKit (~> 0.0.1) + - ReactKit (0.0.1) + +DEPENDENCIES: + - RCTNetworkImage (from `../../Libraries/Image`) + - RCTText (from `../../Libraries/Text`) + - ReactKit (from `../../ReactKit`) + +EXTERNAL SOURCES: + RCTNetworkImage: + :path: ../../Libraries/Image + RCTText: + :path: ../../Libraries/Text + ReactKit: + :path: ../../ReactKit + +SPEC CHECKSUMS: + RCTNetworkImage: 6d99735875916e098a65c68a54a72e67e24a402a + RCTText: 5c0cf4635241e8c02e8933853df03809d2dc8327 + ReactKit: 65c02c1e95951c198e491d2a4c1972675d4af254 + +COCOAPODS: 0.35.0 diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTImageDownloader.h b/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTImageDownloader.h new file mode 100644 index 000000000..b525ea1a7 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTImageDownloader.h @@ -0,0 +1,22 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +typedef void (^RCTDataDownloadBlock)(NSData *data, NSError *error); +typedef void (^RCTImageDownloadBlock)(UIImage *image, NSError *error); + +@interface RCTImageDownloader : NSObject + ++ (instancetype)sharedInstance; + +- (id)downloadDataForURL:(NSURL *)url + block:(RCTDataDownloadBlock)block; + +- (id)downloadImageForURL:(NSURL *)url + size:(CGSize)size + scale:(CGFloat)scale + block:(RCTImageDownloadBlock)block; + +- (void)cancelDownload:(id)downloadToken; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h b/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h new file mode 100644 index 000000000..c99ed0689 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h @@ -0,0 +1,32 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@class RCTImageDownloader; + +@interface RCTNetworkImageView : UIView + +- (instancetype)initWithFrame:(CGRect)frame imageDownloader:(RCTImageDownloader *)imageDownloader; + +/** + * An image that will appear while the view is loading the image from the network, + * or when imageURL is nil. Defaults to nil. + */ +@property (nonatomic, strong) UIImage *defaultImage; + +/** + * Specify a URL for an image. The image will be asynchronously loaded and displayed. + */ +@property (nonatomic, strong) NSURL *imageURL; + +/** + * By default, changing imageURL will reset whatever existing image was present + * and revert to defaultImage while the new image loads. In certain obscure cases you + * may want to disable this behavior and instead keep displaying the previous image + * while the new one loads. In this case, pass NO for resetToDefaultImageWhileLoading. + * (If you set imageURL to nil, however, resetToDefaultImageWhileLoading is ignored; + * that will always reset to the default image.) + */ +- (void)setImageURL:(NSURL *)imageURL resetToDefaultImageWhileLoading:(BOOL)reset; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageViewManager.h b/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageViewManager.h new file mode 100644 index 000000000..5b34e6060 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageViewManager.h @@ -0,0 +1,8 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTNetworkImageViewManager : RCTViewManager + +@end + diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTRawTextManager.h b/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTRawTextManager.h new file mode 100644 index 000000000..4c67fd328 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTRawTextManager.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTRawTextManager : RCTViewManager + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTShadowRawText.h b/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTShadowRawText.h new file mode 100644 index 000000000..d1bdc7d72 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTShadowRawText.h @@ -0,0 +1,9 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTShadowView.h" + +@interface RCTShadowRawText : RCTShadowView + +@property (nonatomic, copy) NSString *text; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTShadowText.h b/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTShadowText.h new file mode 100644 index 000000000..ddaf2ebe7 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTShadowText.h @@ -0,0 +1,26 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTShadowView.h" + +extern NSString *const RCTIsHighlightedAttributeName; +extern NSString *const RCTReactTagAttributeName; + +@interface RCTShadowText : RCTShadowView + +@property (nonatomic, assign) NSWritingDirection writingDirection; +@property (nonatomic, strong) UIColor *textBackgroundColor; +@property (nonatomic, strong) UIColor *color; +@property (nonatomic, strong) UIFont *font; +@property (nonatomic, copy) NSString *fontFamily; +@property (nonatomic, assign) CGFloat fontSize; +@property (nonatomic, copy) NSString *fontWeight; +@property (nonatomic, assign) BOOL isHighlighted; +@property (nonatomic, assign) CGFloat lineHeight; +@property (nonatomic, assign) NSInteger maxNumberOfLines; +@property (nonatomic, assign) CGSize shadowOffset; +@property (nonatomic, assign) NSTextAlignment textAlign; +@property (nonatomic, assign) NSLineBreakMode truncationMode; + +- (NSAttributedString *)attributedString; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTText.h b/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTText.h new file mode 100644 index 000000000..80ba3f234 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTText.h @@ -0,0 +1,13 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTText : UIView + +@property (nonatomic, copy) NSAttributedString *attributedText; +@property (nonatomic, assign) NSLineBreakMode lineBreakMode; +@property (nonatomic, assign) NSUInteger numberOfLines; + +- (NSNumber *)reactTagAtPoint:(CGPoint)point; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTTextManager.h b/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTTextManager.h new file mode 100644 index 000000000..0359cce40 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTTextManager.h @@ -0,0 +1,8 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTTextManager : RCTViewManager + +@end + diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/Layout.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/Layout.h new file mode 100644 index 000000000..51f72493b --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/Layout.h @@ -0,0 +1,148 @@ +/** + * @generated SignedSource<<58298c7a8815a8675e970b0347dedfed>> + * + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * !! This file is a check-in from github! !! + * !! !! + * !! You should not modify this file directly. Instead: !! + * !! 1) Go to https://github.com/facebook/css-layout !! + * !! 2) Make a pull request and get it merged !! + * !! 3) Execute ./import.sh to pull in the latest version !! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#ifndef __LAYOUT_H +#define __LAYOUT_H + +#include +#include +#define CSS_UNDEFINED NAN + +typedef enum { + CSS_FLEX_DIRECTION_COLUMN = 0, + CSS_FLEX_DIRECTION_ROW +} css_flex_direction_t; + +typedef enum { + CSS_JUSTIFY_FLEX_START = 0, + CSS_JUSTIFY_CENTER, + CSS_JUSTIFY_FLEX_END, + CSS_JUSTIFY_SPACE_BETWEEN, + CSS_JUSTIFY_SPACE_AROUND +} css_justify_t; + +// Note: auto is only a valid value for alignSelf. It is NOT a valid value for +// alignItems. +typedef enum { + CSS_ALIGN_AUTO = 0, + CSS_ALIGN_FLEX_START, + CSS_ALIGN_CENTER, + CSS_ALIGN_FLEX_END, + CSS_ALIGN_STRETCH +} css_align_t; + +typedef enum { + CSS_POSITION_RELATIVE = 0, + CSS_POSITION_ABSOLUTE +} css_position_type_t; + +typedef enum { + CSS_NOWRAP = 0, + CSS_WRAP +} css_wrap_type_t; + +// Note: left and top are shared between position[2] and position[4], so +// they have to be before right and bottom. +typedef enum { + CSS_LEFT = 0, + CSS_TOP, + CSS_RIGHT, + CSS_BOTTOM, + CSS_POSITION_COUNT +} css_position_t; + +typedef enum { + CSS_WIDTH = 0, + CSS_HEIGHT +} css_dimension_t; + +typedef struct { + float position[2]; + float dimensions[2]; + + // Instead of recomputing the entire layout every single time, we + // cache some information to break early when nothing changed + bool should_update; + float last_requested_dimensions[2]; + float last_parent_max_width; + float last_dimensions[2]; + float last_position[2]; +} css_layout_t; + +typedef struct { + float dimensions[2]; +} css_dim_t; + +typedef struct { + css_flex_direction_t flex_direction; + css_justify_t justify_content; + css_align_t align_items; + css_align_t align_self; + css_position_type_t position_type; + css_wrap_type_t flex_wrap; + float flex; + float margin[4]; + float position[4]; + /** + * You should skip all the rules that contain negative values for the + * following attributes. For example: + * {padding: 10, paddingLeft: -5} + * should output: + * {left: 10 ...} + * the following two are incorrect: + * {left: -5 ...} + * {left: 0 ...} + */ + float padding[4]; + float border[4]; + float dimensions[2]; +} css_style_t; + +typedef struct css_node { + css_style_t style; + css_layout_t layout; + int children_count; + + css_dim_t (*measure)(void *context, float width); + void (*print)(void *context); + struct css_node* (*get_child)(void *context, int i); + bool (*is_dirty)(void *context); + void *context; +} css_node_t; + + +// Lifecycle of nodes and children +css_node_t *new_css_node(void); +void init_css_node(css_node_t *node); +void free_css_node(css_node_t *node); + +// Print utilities +typedef enum { + CSS_PRINT_LAYOUT = 1, + CSS_PRINT_STYLE = 2, + CSS_PRINT_CHILDREN = 4, +} css_print_options_t; +void print_css_node(css_node_t *node, css_print_options_t options); + +// Function that computes the layout! +void layoutNode(css_node_t *node, float maxWidth); +bool isUndefined(float value); + +#endif diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAlertManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAlertManager.h new file mode 100644 index 000000000..e24e0bc95 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAlertManager.h @@ -0,0 +1,9 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTBridgeModule.h" + +@interface RCTAlertManager : NSObject + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAnimationType.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAnimationType.h new file mode 100644 index 000000000..dae90b845 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAnimationType.h @@ -0,0 +1,11 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +typedef NS_ENUM(NSInteger, RCTAnimationType) { + RCTAnimationTypeSpring = 0, + RCTAnimationTypeLinear, + RCTAnimationTypeEaseIn, + RCTAnimationTypeEaseOut, + RCTAnimationTypeEaseInEaseOut, +}; diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAssert.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAssert.h new file mode 100644 index 000000000..66f670430 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAssert.h @@ -0,0 +1,36 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#define RCTErrorDomain @"RCTErrorDomain" + +#define RCTAssert(condition, message, ...) _RCTAssert(condition, message, ##__VA_ARGS__) +#define RCTCAssert(condition, message, ...) _RCTCAssert(condition, message, ##__VA_ARGS__) + +typedef void (^RCTAssertFunction)(BOOL condition, NSString *message, ...); + +extern RCTAssertFunction RCTInjectedAssertFunction; +extern RCTAssertFunction RCTInjectedCAssertFunction; + +void RCTInjectAssertFunctions(RCTAssertFunction assertFunction, RCTAssertFunction cAssertFunction); + +#define _RCTAssert(condition, message, ...) \ +do { \ + if (RCTInjectedAssertFunction) { \ + RCTInjectedAssertFunction(condition, message, ##__VA_ARGS__); \ + } else { \ + NSAssert(condition, message, ##__VA_ARGS__); \ + } \ +} while (false) + +#define _RCTCAssert(condition, message, ...) \ +do { \ + if (RCTInjectedCAssertFunction) { \ + RCTInjectedCAssertFunction(condition, message, ##__VA_ARGS__); \ + } else { \ + NSCAssert(condition, message, ##__VA_ARGS__); \ + } \ +} while (false) + +#define RCTAssertMainThread() RCTAssert([NSThread isMainThread], @"This method must be called on the main thread"); +#define RCTCAssertMainThread() RCTCAssert([NSThread isMainThread], @"This function must be called on the main thread"); diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAutoInsetsProtocol.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAutoInsetsProtocol.h new file mode 100644 index 000000000..4f1cd4ba2 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAutoInsetsProtocol.h @@ -0,0 +1,13 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +/** + * Defines a View that wants to support auto insets adjustment + */ +@protocol RCTAutoInsetsProtocol + +@property (nonatomic, assign, readwrite) UIEdgeInsets contentInset; +@property (nonatomic, assign, readwrite) BOOL automaticallyAdjustContentInsets; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridge.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridge.h new file mode 100644 index 000000000..9a890a07a --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridge.h @@ -0,0 +1,107 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTBridgeModule.h" +#import "RCTInvalidating.h" +#import "RCTJavaScriptExecutor.h" + +@class RCTBridge; +@class RCTEventDispatcher; +@class RCTRootView; + +/** + * Utilities for constructing common response objects. When sending a + * systemError back to JS, it's important to describe whether or not it was a + * system error, or API usage error. System errors should never happen and are + * therefore logged using `RCTLogError()`. API usage errors are expected if the + * API is misused and will therefore not be logged using `RCTLogError()`. The JS + * application code is expected to handle them. Regardless of type, each error + * should be logged at most once. + */ +static inline NSDictionary *RCTSystemErrorObject(NSString *msg) +{ + return @{@"systemError": msg ?: @""}; +} + +static inline NSDictionary *RCTAPIErrorObject(NSString *msg) +{ + return @{@"apiError": msg ?: @""}; +} + +/** + * This block can be used to instantiate modules that require additional + * init parameters, or additional configuration prior to being used. + */ +typedef NSArray *(^RCTBridgeModuleProviderBlock)(RCTBridge *bridge); + +/** + * Async batched bridge used to communicate with the JavaScript application. + */ +@interface RCTBridge : NSObject + +/** + * The designated initializer. This creates a new bridge on top of the specified + * executor. The bridge should then be used for all subsequent communication + * with the JavaScript code running in the executor. Modules will be automatically + * instantiated using the default contructor, but you can optionally pass in a + * module provider block to manually instantiate modules that require additional + * init parameters or configuration. + */ +- (instancetype)initWithJavaScriptExecutor:(id)javaScriptExecutor + moduleProvider:(RCTBridgeModuleProviderBlock)block NS_DESIGNATED_INITIALIZER; + +/** + * This method is used to call functions in the JavaScript application context. + * It is primarily intended for use by modules that require two-way communication + * with the JavaScript code. + */ +- (void)enqueueJSCall:(NSString *)moduleDotMethod args:(NSArray *)args; + +/** + * This method is used to execute a new application script. It is called + * internally whenever a JS application bundle is loaded/reloaded, but should + * probably not be used at any other time. + */ +- (void)enqueueApplicationScript:(NSString *)script url:(NSURL *)url onComplete:(RCTJavaScriptCompleteBlock)onComplete; + +/** + * The event dispatcher is a wrapper around -enqueueJSCall:args: that provides a + * higher-level interface for sending UI events such as touches and text input. + */ +@property (nonatomic, readonly) RCTEventDispatcher *eventDispatcher; + +/** + * A dictionary of all registered RCTBridgeModule instances, keyed by moduleName. + */ +@property (nonatomic, copy, readonly) NSDictionary *modules; + +/** + * The shadow queue is used to execute callbacks from the JavaScript code. All + * native hooks (e.g. exported module methods) will be executed on the shadow + * queue. + */ +@property (nonatomic, readonly) dispatch_queue_t shadowQueue; + +// For use in implementing delegates, which may need to queue responses. +- (RCTResponseSenderBlock)createResponseSenderBlock:(NSInteger)callbackID; + +/** + * Register a root view with the bridge. Theorectically, a single bridge can + * support multiple root views, however this feature is not currently exposed + * and may eventually be removed. + */ +- (void)registerRootView:(RCTRootView *)rootView; + +/** + * Global logging function that will print to both xcode and JS debugger consoles. + * + * NOTE: Use via RCTLog* macros defined in RCTLog.h + * TODO (#5906496): should log function be exposed here, or could it be a module? + */ ++ (void)log:(NSArray *)objects level:(NSString *)level; + +/** + * Method to check that a valid executor exists with which to log + */ ++ (BOOL)hasValidJSExecutor; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridgeModule.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridgeModule.h new file mode 100644 index 000000000..d9df70a22 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridgeModule.h @@ -0,0 +1,64 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTJSMethodRegistrar.h" + +@class RCTBridge; + +/** + * The type of a block that is capable of sending a response to a bridged + * operation. Use this for returning callback methods to JS. + */ +typedef void (^RCTResponseSenderBlock)(NSArray *response); + +/** + * Provides the interface needed to register a bridge module. + */ +@protocol RCTBridgeModule +@optional + +/** + * Optional initializer for modules that require access + * to bridge features, such as sending events or making JS calls + */ +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +/** + * The module name exposed to JS. If omitted, this will be inferred + * automatically by using the native module's class name. + */ ++ (NSString *)moduleName; + +/** + * Place this macro inside the method body of any method you want to expose + * to JS. The optional js_name argument will be used as the JS method name + * (the method will be namespaced to the module name, as specified above). + * If omitted, the JS method name will match the first part of the Objective-C + * method selector name (up to the first colon). + */ +#define RCT_EXPORT(js_name) __attribute__((used, section("__DATA,RCTExport" \ +))) static const char *__rct_export_entry__[] = { __func__, #js_name } + +/** + * Injects constants into JS. These constants are made accessible via + * NativeModules.moduleName.X. Note that this method is not inherited when you + * subclass a module, and you should not call [super constantsToExport] when + * implementing it. + */ ++ (NSDictionary *)constantsToExport; + +/** + * Some "constants" are not really constant, and need to be re-generated + * each time the bridge module is created. Support for this feature is + * deprecated and may be going away or changing, but for now you can use + * the -constantsToExport instance method to register these "pseudo-constants". + */ +- (NSDictionary *)constantsToExport; + +/** + * Notifies the module that a batch of JS method invocations has just completed. + */ +- (void)batchDidComplete; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTCache.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTCache.h new file mode 100644 index 000000000..75943ae4f --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTCache.h @@ -0,0 +1,22 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTCache : NSObject + +- (instancetype)init; // name = @"default" +- (instancetype)initWithName:(NSString *)name; + +@property (nonatomic, assign) NSUInteger maximumDiskSize; // in bytes + +#pragma mark - Retrieval + +- (BOOL)hasDataForKey:(NSString *)key; +- (void)fetchDataForKey:(NSString *)key completionHandler:(void (^)(NSData *data))completionHandler; + +#pragma mark - Insertion + +- (void)setData:(NSData *)data forKey:(NSString *)key; +- (void)removeAllData; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTContextExecutor.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTContextExecutor.h new file mode 100644 index 000000000..638ad8ba6 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTContextExecutor.h @@ -0,0 +1,21 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTJavaScriptExecutor.h" + +// TODO (#5906496): Might RCTJSCoreExecutor be a better name for this? + +/** + * Uses a JavaScriptCore context as the execution engine. + */ +@interface RCTContextExecutor : NSObject + +/** + * Configures the executor to run JavaScript on a custom performer. + * You probably don't want to use this; use -init instead. + */ +- (instancetype)initWithJavaScriptThread:(NSThread *)javaScriptThread + globalContextRef:(JSGlobalContextRef)context; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTConvert.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTConvert.h new file mode 100644 index 000000000..51a6b76ce --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTConvert.h @@ -0,0 +1,85 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import +#import + +#import "Layout.h" +#import "RCTPointerEvents.h" +#import "RCTAnimationType.h" + +/** + * This class provides a collection of conversion functions for mapping + * JSON objects to native types and classes. These are useful when writing + * custom RCTViewManager setter methods. + */ +@interface RCTConvert : NSObject + ++ (BOOL)BOOL:(id)json; ++ (double)double:(id)json; ++ (float)float:(id)json; ++ (int)int:(id)json; + ++ (NSString *)NSString:(id)json; ++ (NSNumber *)NSNumber:(id)json; ++ (NSInteger)NSInteger:(id)json; ++ (NSUInteger)NSUInteger:(id)json; + ++ (NSURL *)NSURL:(id)json; ++ (NSURLRequest *)NSURLRequest:(id)json; + ++ (NSDate *)NSDate:(id)json; ++ (NSTimeZone *)NSTimeZone:(id)json; ++ (NSTimeInterval)NSTimeInterval:(id)json; + ++ (NSTextAlignment)NSTextAlignment:(id)json; ++ (NSWritingDirection)NSWritingDirection:(id)json; ++ (UITextAutocapitalizationType)UITextAutocapitalizationType:(id)json; ++ (UIKeyboardType)UIKeyboardType:(id)json; + ++ (CGFloat)CGFloat:(id)json; ++ (CGPoint)CGPoint:(id)json; ++ (CGSize)CGSize:(id)json; ++ (CGRect)CGRect:(id)json; ++ (UIEdgeInsets)UIEdgeInsets:(id)json; + ++ (CATransform3D)CATransform3D:(id)json; ++ (CGAffineTransform)CGAffineTransform:(id)json; + ++ (UIColor *)UIColor:(id)json; ++ (CGColorRef)CGColor:(id)json; + ++ (CAKeyframeAnimation *)GIF:(id)json; ++ (UIImage *)UIImage:(id)json; ++ (CGImageRef)CGImage:(id)json; + ++ (UIFont *)UIFont:(UIFont *)font withSize:(id)json; ++ (UIFont *)UIFont:(UIFont *)font withWeight:(id)json; ++ (UIFont *)UIFont:(UIFont *)font withFamily:(id)json; ++ (UIFont *)UIFont:(UIFont *)font withFamily:(id)json size:(id)json weight:(id)json; + ++ (BOOL)css_overflow:(id)json; ++ (css_flex_direction_t)css_flex_direction_t:(id)json; ++ (css_justify_t)css_justify_t:(id)json; ++ (css_align_t)css_align_t:(id)json; ++ (css_position_type_t)css_position_type_t:(id)json; ++ (css_wrap_type_t)css_wrap_type_t:(id)json; + ++ (RCTPointerEvents)RCTPointerEvents:(id)json; ++ (RCTAnimationType)RCTAnimationType:(id)json; + +@end + +/** + * This function will attempt to set a property using a json value by first + * inferring the correct type from all available information, and then + * applying an appropriate conversion method. If the property does not + * exist, or the type cannot be inferred, the function will return NO. + */ +BOOL RCTSetProperty(id target, NSString *keypath, id json); + +/** + * This function attempts to copy a property from the source object to the + * destination object using KVC. If the property does not exist, or cannot + * be set, it will do nothing and return NO. + */ +BOOL RCTCopyProperty(id target, id source, NSString *keypath); diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTEventDispatcher.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTEventDispatcher.h new file mode 100644 index 000000000..5c97c8de6 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTEventDispatcher.h @@ -0,0 +1,66 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@class RCTBridge; + +typedef NS_ENUM(NSInteger, RCTTextEventType) { + RCTTextEventTypeFocus, + RCTTextEventTypeBlur, + RCTTextEventTypeChange, + RCTTextEventTypeSubmit, + RCTTextEventTypeEnd +}; + +typedef NS_ENUM(NSInteger, RCTScrollEventType) { + RCTScrollEventTypeStart, + RCTScrollEventTypeMove, + RCTScrollEventTypeEnd, + RCTScrollEventTypeStartDeceleration, + RCTScrollEventTypeEndDeceleration, + RCTScrollEventTypeEndAnimation, +}; + +/** + * This class wraps the -[RCTBridge enqueueJSCall:args:] method, and + * provides some convenience methods for generating event calls. + */ +@interface RCTEventDispatcher : NSObject + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +/** + * Send an application-specific event that does not relate to a specific + * view, e.g. a navigation or data update notification. + */ +- (void)sendAppEventWithName:(NSString *)name body:(id)body; + +/** + * Send a device or iOS event that does not relate to a specific view, + * e.g.rotation, location, keyboard show/hide, background/awake, etc. + */ +- (void)sendDeviceEventWithName:(NSString *)name body:(id)body; + +/** + * Send a user input event. The body dictionary must contain a "target" + * parameter, representing the react tag of the view sending the event + */ +- (void)sendInputEventWithName:(NSString *)name body:(NSDictionary *)body; + +/** + * Send a text input/focus event. + */ +- (void)sendTextEventWithType:(RCTTextEventType)type + reactTag:(NSNumber *)reactTag + text:(NSString *)text; + +/** + * Send a scroll event. + * (You can send a fake scroll event by passing nil for scrollView). + */ +- (void)sendScrollEventWithType:(RCTScrollEventType)type + reactTag:(NSNumber *)reactTag + scrollView:(UIScrollView *)scrollView + userData:(NSDictionary *)userData; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTExceptionsManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTExceptionsManager.h new file mode 100644 index 000000000..02ea33202 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTExceptionsManager.h @@ -0,0 +1,9 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTBridgeModule.h" + +@interface RCTExceptionsManager : NSObject + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTInvalidating.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTInvalidating.h new file mode 100644 index 000000000..e810519fd --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTInvalidating.h @@ -0,0 +1,16 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +// TODO (#5906496): is there a reason for this protocol? It seems to be +// used in a number of places where it isn't really required - only the +// RCTBridge actually ever calls casts to it - in all other +// cases it is simply a way of adding some method definitions to classes + +@protocol RCTInvalidating + +@property (nonatomic, assign, readonly, getter = isValid) BOOL valid; + +- (void)invalidate; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJSMethodRegistrar.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJSMethodRegistrar.h new file mode 100644 index 000000000..20a35a96b --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJSMethodRegistrar.h @@ -0,0 +1,24 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@class RCTBridge; + +/** + * Provides an interface to register JS methods to be called via the bridge. + */ +@protocol RCTJSMethodRegistrar +@optional + +/** + * An array of JavaScript methods that the class will call via the + * -[RCTBridge enqueueJSCall:args:] method. Each method should be specified + * as a string of the form "JSModuleName.jsMethodName". Attempting to call a + * method that has not been registered will result in an error. If a method + * has already been registered by another class, it is not necessary to + * register it again, but it is good practice. Registering the same method + * more than once is silently ignored and will not result in an error. + */ ++ (NSArray *)JSMethods; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h new file mode 100644 index 000000000..7062570a4 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h @@ -0,0 +1,35 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTInvalidating.h" + +typedef void (^RCTJavaScriptCompleteBlock)(NSError *error); +typedef void (^RCTJavaScriptCallback)(id objcValue, NSError *error); + +/** + * Abstracts away a JavaScript execution context - we may be running code in a + * web view (for debugging purposes), or may be running code in a `JSContext`. + */ +@protocol RCTJavaScriptExecutor + +/** + * Executes given method with arguments on JS thread and calls the given callback + * with JSValue and JSContext as a result of the JS module call. + */ +- (void)executeJSCall:(NSString *)name + method:(NSString *)method + arguments:(NSArray *)arguments + callback:(RCTJavaScriptCallback)onComplete; + +/** + * Runs an application script, and notifies of the script load being complete via `onComplete`. + */ +- (void)executeApplicationScript:(NSString *)script + sourceURL:(NSURL *)url + onComplete:(RCTJavaScriptCompleteBlock)onComplete; + +- (void)injectJSONText:(NSString *)script + asGlobalObjectNamed:(NSString *)objectName + callback:(RCTJavaScriptCompleteBlock)onComplete; +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTKeyCommands.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTKeyCommands.h new file mode 100644 index 000000000..f6748826e --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTKeyCommands.h @@ -0,0 +1,28 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTKeyCommands : NSObject + ++ (instancetype)sharedInstance; + +/** + * Register a keyboard command. + */ +- (void)registerKeyCommandWithInput:(NSString *)input + modifierFlags:(UIKeyModifierFlags)flags + action:(void (^)(UIKeyCommand *command))block; + +/** + * Unregister a keyboard command. + */ +- (void)unregisterKeyCommandWithInput:(NSString *)input + modifierFlags:(UIKeyModifierFlags)flags; + +/** + * Check if a command is registered. + */ +- (BOOL)isKeyCommandRegisteredForInput:(NSString *)input + modifierFlags:(UIKeyModifierFlags)flags; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLog.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLog.h new file mode 100644 index 000000000..a97d13458 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLog.h @@ -0,0 +1,69 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTAssert.h" +#import "RCTRedBox.h" + +#define RCTLOG_INFO 1 +#define RCTLOG_WARN 2 +#define RCTLOG_ERROR 3 +#define RCTLOG_MUSTFIX 4 + +// If set to e.g. `RCTLOG_ERROR`, will assert after logging the first error. +#if DEBUG +#define RCTLOG_FATAL_LEVEL RCTLOG_MUSTFIX +#define RCTLOG_REDBOX_LEVEL RCTLOG_ERROR +#else +#define RCTLOG_FATAL_LEVEL (RCTLOG_MUSTFIX + 1) +#define RCTLOG_REDBOX_LEVEL (RCTLOG_MUSTFIX + 1) +#endif + +// If defined, only log messages that match this regex will fatal +#define RCTLOG_FATAL_REGEX nil + +#define _RCTLog(__RCTLog__level, ...) do { \ + NSString *__RCTLog__levelStr; \ + switch(__RCTLog__level) { \ + case RCTLOG_INFO: __RCTLog__levelStr = @"info"; break; \ + case RCTLOG_WARN: __RCTLog__levelStr = @"warn"; break; \ + case RCTLOG_ERROR: __RCTLog__levelStr = @"error"; break; \ + case RCTLOG_MUSTFIX: __RCTLog__levelStr = @"mustfix"; break; \ + } \ + NSString *__RCTLog__msg = _RCTLogObjects(RCTLogFormat(__VA_ARGS__), __RCTLog__levelStr); \ + if (__RCTLog__level >= RCTLOG_FATAL_LEVEL) { \ + BOOL __RCTLog__fail = YES; \ + if (RCTLOG_FATAL_REGEX) { \ + NSError *__RCTLog__e; \ + NSRegularExpression *__RCTLog__regex = [NSRegularExpression regularExpressionWithPattern:RCTLOG_FATAL_REGEX options:0 error:&__RCTLog__e]; \ + __RCTLog__fail = [__RCTLog__regex numberOfMatchesInString:__RCTLog__msg options:0 range:NSMakeRange(0, [__RCTLog__msg length])] > 0; \ + } \ + RCTCAssert(!__RCTLog__fail, @"RCTLOG_FATAL_LEVEL %@: %@", __RCTLog__levelStr, __RCTLog__msg); \ + } \ + if (__RCTLog__level >= RCTLOG_REDBOX_LEVEL) { \ + RCTRedBox *__RCTLog__redBox = [RCTRedBox sharedInstance]; \ + [__RCTLog__redBox showErrorMessage:__RCTLog__msg]; \ + } \ +} while (0) + +#define RCTLog(...) _RCTLog(RCTLOG_INFO, __VA_ARGS__) +#define RCTLogInfo(...) _RCTLog(RCTLOG_INFO, __VA_ARGS__) +#define RCTLogWarn(...) _RCTLog(RCTLOG_WARN, __VA_ARGS__) +#define RCTLogError(...) _RCTLog(RCTLOG_ERROR, __VA_ARGS__) +#define RCTLogMustFix(...) _RCTLog(RCTLOG_MUSTFIX, __VA_ARGS__) + +#define RCTLogFormat(...) _RCTLogFormat(__FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__) +#define RCTLogFormatString(...) _RCTLogFormatString(__FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__) + +#ifdef __cplusplus +extern "C" { +#endif + +NSString *_RCTLogObjects(NSArray *objects, NSString *level); +NSArray *_RCTLogFormat(const char *file, int lineNumber, const char *funcName, NSString *format, ...) NS_FORMAT_FUNCTION(4,5); +NSString *_RCTLogFormatString(const char *file, int lineNumber, const char *funcName, NSString *format, ...) NS_FORMAT_FUNCTION(4,5); + +#ifdef __cplusplus +} +#endif + +typedef void (^RCTLogFunction)(NSString *format, NSString *str); +void RCTInjectLogFunction(RCTLogFunction func); diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavItem.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavItem.h new file mode 100644 index 000000000..68f12fd45 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavItem.h @@ -0,0 +1,14 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTNavItem : UIView + +@property (nonatomic, copy) NSString *title; +@property (nonatomic, copy) NSString *rightButtonTitle; +@property (nonatomic, copy) NSString *backButtonTitle; +@property (nonatomic, copy) UIColor *tintColor; +@property (nonatomic, copy) UIColor *barTintColor; +@property (nonatomic, copy) UIColor *titleTextColor; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavItemManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavItemManager.h new file mode 100644 index 000000000..3c2a32105 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavItemManager.h @@ -0,0 +1,8 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTNavItemManager : RCTViewManager + +@end + diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigator.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigator.h new file mode 100644 index 000000000..5d928efa7 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigator.h @@ -0,0 +1,26 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTInvalidating.h" + +@class RCTEventDispatcher; + +@interface RCTNavigator : UIView + +@property (nonatomic, strong) UIView *reactNavSuperviewLink; +@property (nonatomic, assign) NSInteger requestedTopOfStack; + +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; + +/** + * Schedules a JavaScript navigation and prevents `UIKit` from navigating until + * JavaScript has sent its scheduled navigation. + * + * @returns Whether or not a JavaScript driven navigation could be + * scheduled/reserved. If returning `NO`, JavaScript should usually just do + * nothing at all. + */ +- (BOOL)requestSchedulingJavaScriptNavigation; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigatorManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigatorManager.h new file mode 100644 index 000000000..d32d21096 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigatorManager.h @@ -0,0 +1,8 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTNavigatorManager : RCTViewManager + +@end + diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTPointerEvents.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTPointerEvents.h new file mode 100644 index 000000000..522bcce4c --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTPointerEvents.h @@ -0,0 +1,10 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +typedef NS_ENUM(NSInteger, RCTPointerEvents) { + RCTPointerEventsUnspecified = 0, // Default + RCTPointerEventsNone, + RCTPointerEventsBoxNone, + RCTPointerEventsBoxOnly, +}; diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTRedBox.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTRedBox.h new file mode 100644 index 000000000..82137eb06 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTRedBox.h @@ -0,0 +1,16 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTRedBox : NSObject + ++ (instancetype)sharedInstance; + +- (void)showErrorMessage:(NSString *)message; +- (void)showErrorMessage:(NSString *)message withDetails:(NSString *)details; +- (void)showErrorMessage:(NSString *)message withStack:(NSArray *)stack; +- (void)updateErrorMessage:(NSString *)message withStack:(NSArray *)stack; + +- (void)dismiss; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTRootView.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTRootView.h new file mode 100644 index 000000000..240c000c3 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTRootView.h @@ -0,0 +1,44 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTRootView : UIView + +/** + * The URL of the bundled application script (required). + * Setting this will clear the view contents, and trigger + * an asynchronous load/download and execution of the script. + */ +@property (nonatomic, strong) NSURL *scriptURL; + +/** + * The name of the JavaScript module to execute within the + * specified scriptURL (required). Setting this will not have + * any immediate effect, but it must be done prior to loading + * the script. + */ +@property (nonatomic, copy) NSString *moduleName; + +/** + * The default properties to apply to the view when the script bundle + * is first loaded. Defaults to nil/empty. + */ +@property (nonatomic, copy) NSDictionary *initialProperties; + +/** + * The class of the RCTJavaScriptExecutor to use with this view. + * If not specified, it will default to using RCTContextExecutor. + * Changes will take effect next time the bundle is reloaded. + */ +@property (nonatomic, strong) Class executorClass; + +/** + * Reload this root view, or all root views, respectively. + */ +- (void)reload; ++ (void)reloadAll; + +- (void)startOrResetInteractionTiming; +- (NSDictionary *)endAndResetInteractionTiming; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollView.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollView.h new file mode 100644 index 000000000..82667b205 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollView.h @@ -0,0 +1,37 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTAutoInsetsProtocol.h" +#import "RCTScrollableProtocol.h" +#import "RCTView.h" + +@protocol UIScrollViewDelegate; + +@class RCTEventDispatcher; + +@interface RCTScrollView : RCTView + +/** + * If the `contentSize` is not provided, then the `contentSize` will + * automatically be determined by the size of the `RKScrollView` subview. + * + * The `RCTScrollView` may have at most one single subview. This will ensure + * that the scroll view's `contentSize` will be efficiently set to the size of + * the single subview's frame. That frame size will be determined somewhat + * efficiently since it will have already been computed by the off-main-thread + * layout system. + */ +@property (nonatomic, readonly) UIScrollView *scrollView; +@property (nonatomic, readonly) UIView *contentView; + +@property (nonatomic, assign) CGSize contentSize; +@property (nonatomic, assign) UIEdgeInsets contentInset; +@property (nonatomic, assign) BOOL automaticallyAdjustContentInsets; +@property (nonatomic, assign) NSUInteger throttleScrollCallbackMS; +@property (nonatomic, assign) BOOL centerContent; +@property (nonatomic, copy) NSArray *stickyHeaderIndices; + +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollViewManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollViewManager.h new file mode 100644 index 000000000..835e1c322 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollViewManager.h @@ -0,0 +1,8 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTScrollViewManager : RCTViewManager + +@end + diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollableProtocol.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollableProtocol.h new file mode 100644 index 000000000..a0ae7b611 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollableProtocol.h @@ -0,0 +1,18 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +/** + * Contains any methods related to scrolling. Any `RCTView` that has scrolling + * features should implement these methods. + */ +@protocol RCTScrollableProtocol + +@property (nonatomic, readwrite, weak) NSObject *nativeMainScrollDelegate; +@property (nonatomic, readonly) CGSize contentSize; + +- (void)scrollToOffset:(CGPoint)offset; +- (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated; +- (void)zoomToRect:(CGRect)rect animated:(BOOL)animated; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTShadowView.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTShadowView.h new file mode 100644 index 000000000..ec2b8c353 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTShadowView.h @@ -0,0 +1,159 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "Layout.h" +#import "RCTViewNodeProtocol.h" + +@class RCTSparseArray; + +// TODO: amalgamate these enums? +typedef NS_ENUM(NSUInteger, RCTLayoutLifecycle) { + RCTLayoutLifecycleUninitialized = 0, + RCTLayoutLifecycleComputed, + RCTLayoutLifecycleDirtied, +}; + +// TODO: is this still needed? +typedef NS_ENUM(NSUInteger, RCTPropagationLifecycle) { + RCTPropagationLifecycleUninitialized = 0, + RCTPropagationLifecycleComputed, + RCTPropagationLifecycleDirtied, +}; + +// TODO: move this to text node? +typedef NS_ENUM(NSUInteger, RCTTextLifecycle) { + RCTTextLifecycleUninitialized = 0, + RCTTextLifecycleComputed, + RCTTextLifecycleDirtied, +}; + +// TODO: is this redundact now? +typedef void (^RCTApplierBlock)(RCTSparseArray *); + +/** + * ShadowView tree mirrors RCT view tree. Every node is highly stateful. + * 1. A node is in one of three lifecycles: uninitialized, computed, dirtied. + * 1. RCTBridge may call any of the padding/margin/width/height/top/left setters. A setter would dirty + * the node and all of its ancestors. + * 2. At the end of each Bridge transaction, we call collectUpdatedFrames:widthConstraint:heightConstraint + * at the root node to recursively lay out the entire hierarchy. + * 3. If a node is "computed" and the constraint passed from above is identical to the constraint used to + * perform the last computation, we skip laying out the subtree entirely. + */ +@interface RCTShadowView : NSObject + +@property (nonatomic, weak, readonly) RCTShadowView *superview; +@property (nonatomic, assign, readonly) css_node_t *cssNode; +@property (nonatomic, copy) NSString *moduleName; +@property (nonatomic, assign) BOOL isBGColorExplicitlySet; // Used to propogate to children +@property (nonatomic, strong) UIColor *backgroundColor; // Used to propogate to children +@property (nonatomic, assign) RCTLayoutLifecycle layoutLifecycle; + +/** + * isNewView - Used to track the first time the view is introduced into the hierarchy. It is initialized YES, then is + * set to NO in RCTUIManager after the layout pass is done and all frames have been extracted to be applied to the + * corresponding UIViews. + */ +@property (nonatomic, assign, getter=isNewView) BOOL newView; + +/** + * Is this the shadowView for an RCTRootView + */ +@property (nonatomic, assign, getter=isReactRootView) BOOL reactRootView; + +/** + * Position and dimensions. + * Defaults to { 0, 0, NAN, NAN }. + */ +@property (nonatomic, assign) CGFloat top; +@property (nonatomic, assign) CGFloat left; +@property (nonatomic, assign) CGFloat width; +@property (nonatomic, assign) CGFloat height; +@property (nonatomic, assign) CGRect frame; + +- (void)setTopLeft:(CGPoint)topLeft; +- (void)setSize:(CGSize)size; + +/** + * Border. Defaults to { 0, 0, 0, 0 }. + */ +@property (nonatomic, assign) CGFloat borderTop; +@property (nonatomic, assign) CGFloat borderLeft; +@property (nonatomic, assign) CGFloat borderWidth; +@property (nonatomic, assign) CGFloat borderHeight; + +- (void)setBorderWidth:(CGFloat)value; + +/** + * Margin. Defaults to { 0, 0, 0, 0 }. + */ +@property (nonatomic, assign) CGFloat marginTop; +@property (nonatomic, assign) CGFloat marginLeft; +@property (nonatomic, assign) CGFloat marginBottom; +@property (nonatomic, assign) CGFloat marginRight; + +- (void)setMargin:(CGFloat)margin; +- (void)setMarginVertical:(CGFloat)margin; +- (void)setMarginHorizontal:(CGFloat)margin; + +/** + * Padding. Defaults to { 0, 0, 0, 0 }. + */ +@property (nonatomic, assign) CGFloat paddingTop; +@property (nonatomic, assign) CGFloat paddingLeft; +@property (nonatomic, assign) CGFloat paddingBottom; +@property (nonatomic, assign) CGFloat paddingRight; + +- (void)setPadding:(CGFloat)padding; +- (void)setPaddingVertical:(CGFloat)padding; +- (void)setPaddingHorizontal:(CGFloat)padding; + +- (UIEdgeInsets)paddingAsInsets; + +/** + * Flexbox properties. All zero/disabled by default + */ +@property (nonatomic, assign) css_flex_direction_t flexDirection; +@property (nonatomic, assign) css_justify_t justifyContent; +@property (nonatomic, assign) css_align_t alignSelf; +@property (nonatomic, assign) css_align_t alignItems; +@property (nonatomic, assign) css_position_type_t positionType; +@property (nonatomic, assign) css_wrap_type_t flexWrap; +@property (nonatomic, assign) CGFloat flex; + +- (void)collectUpdatedProperties:(NSMutableSet *)viewsWithNewProperties parentProperties:(NSDictionary *)parentProperties; +- (void)collectRootUpdatedFrames:(NSMutableSet *)viewsWithNewFrame parentConstraint:(CGSize)parentConstraint; +- (void)fillCSSNode:(css_node_t *)node; + +// The following are implementation details exposed to subclasses. Do not call them directly +- (void)dirtyLayout; +- (BOOL)isLayoutDirty; + +// TODO: is this still needed? +- (void)dirtyPropagation; +- (BOOL)isPropagationDirty; + +// TODO: move this to text node? +- (void)dirtyText; +- (BOOL)isTextDirty; +- (void)setTextComputed; + +/** + * Triggers a recalculation of the shadow view's layout. + */ +- (void)updateShadowViewLayout; + +/** + * Computes the recursive offset, meaning the sum of all descendant offsets - + * this is the sum of all positions inset from parents. This is not merely the + * sum of `top`/`left`s, as this function uses the *actual* positions of + * children, not the style specified positions - it computes this based on the + * resulting layout. It does not yet compensate for native scroll view insets or + * transforms or anchor points. Returns an array containing the `x, y, width, + * height` of the shadow view relative to the ancestor, or `nil` if the `view` + * is not a descendent of `ancestor`. + */ ++ (CGRect)measureLayout:(RCTShadowView *)view relativeTo:(RCTShadowView *)ancestor; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTSparseArray.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTSparseArray.h new file mode 100644 index 000000000..47ad346f1 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTSparseArray.h @@ -0,0 +1,31 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTSparseArray : NSObject + +- (instancetype)initWithCapacity:(NSUInteger)capacity NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithSparseArray:(RCTSparseArray *)sparseArray NS_DESIGNATED_INITIALIZER; + ++ (instancetype)sparseArray; ++ (instancetype)sparseArrayWithCapacity:(NSUInteger)capacity; ++ (instancetype)sparseArrayWithSparseArray:(RCTSparseArray *)sparseArray; + +// Use nil object to remove at idx. +- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx; +- (id)objectAtIndexedSubscript:(NSUInteger)idx; + +// Use nil obj to remove at key. +- (void)setObject:(id)obj forKeyedSubscript:(NSNumber *)key; +- (id)objectForKeyedSubscript:(NSNumber *)key; + +@property (readonly, nonatomic) NSUInteger count; +@property (readonly, nonatomic, copy) NSArray *allIndexes; +@property (readonly, nonatomic, copy) NSArray *allObjects; + +- (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSNumber *idx, BOOL *stop))block; +- (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (^)(id obj, NSNumber *idx, BOOL *stop))block; + +- (void)removeAllObjects; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStaticImage.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStaticImage.h new file mode 100644 index 000000000..75906be39 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStaticImage.h @@ -0,0 +1,10 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTStaticImage : UIImageView + +@property (nonatomic, assign) UIEdgeInsets capInsets; +@property (nonatomic, assign) UIImageRenderingMode renderingMode; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStaticImageManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStaticImageManager.h new file mode 100644 index 000000000..ab89cb96b --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStaticImageManager.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTStaticImageManager : RCTViewManager + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStatusBarManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStatusBarManager.h new file mode 100644 index 000000000..830393521 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStatusBarManager.h @@ -0,0 +1,9 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTBridgeModule.h" + +@interface RCTStatusBarManager : NSObject + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextField.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextField.h new file mode 100644 index 000000000..2a0225f27 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextField.h @@ -0,0 +1,15 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@class RCTEventDispatcher; + +@interface RCTTextField : UITextField + +@property (nonatomic, assign) BOOL caretHidden; +@property (nonatomic, assign) BOOL autoCorrect; +@property (nonatomic, assign) UIEdgeInsets paddingEdgeInsets; // TODO: contentInset + +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextFieldManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextFieldManager.h new file mode 100644 index 000000000..1f83a47d8 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextFieldManager.h @@ -0,0 +1,8 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTTextFieldManager : RCTViewManager + +@end + diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTiming.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTiming.h new file mode 100644 index 000000000..aa55c2521 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTiming.h @@ -0,0 +1,10 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTBridgeModule.h" +#import "RCTInvalidating.h" + +@interface RCTTiming : NSObject + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTouchHandler.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTouchHandler.h new file mode 100644 index 000000000..53379a78a --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTouchHandler.h @@ -0,0 +1,15 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTInvalidating.h" + +@class RCTBridge; + +@interface RCTTouchHandler : UIGestureRecognizer + +- (instancetype)initWithBridge:(RCTBridge *)bridge; +- (void)startOrResetInteractionTiming; +- (NSDictionary *)endAndResetInteractionTiming; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIActivityIndicatorViewManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIActivityIndicatorViewManager.h new file mode 100644 index 000000000..d67661359 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIActivityIndicatorViewManager.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTUIActivityIndicatorViewManager : RCTViewManager + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIManager.h new file mode 100644 index 000000000..87e91118a --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIManager.h @@ -0,0 +1,26 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTBridgeModule.h" +#import "RCTInvalidating.h" + +@class RCTRootView; + +@protocol RCTScrollableProtocol; + +@interface RCTUIManager : NSObject + +@property (nonatomic, weak) id mainScrollView; + +/** + * Allows native environment code to respond to "the main scroll view" events. + * see `RCTUIManager`'s `setMainScrollViewTag`. + */ +@property (nonatomic, readwrite, weak) id nativeMainScrollDelegate; + +- (void)registerRootView:(RCTRootView *)rootView; + ++ (UIView *)JSResponder; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUtils.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUtils.h new file mode 100644 index 000000000..3612b1f27 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUtils.h @@ -0,0 +1,41 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import +#import +#import + +#import "RCTAssert.h" + +// Macro to indicate when inherited initializer is not to be used +#define RCT_NOT_DESIGNATED_INITIALIZER() \ +do { \ + RCTAssert(NO, @"%@ is not the designated initializer for instances of %@.", NSStringFromSelector(_cmd), [self class]); \ + return nil; \ +} while (0) + +// Utility functions for JSON object <-> string serialization/deserialization +NSString *RCTJSONStringify(id jsonObject, NSError **error); +id RCTJSONParse(NSString *jsonString, NSError **error); + +// Get MD5 hash of a string (TODO: currently unused. Remove?) +NSString *RCTMD5Hash(NSString *string); + +// Get screen metrics in a thread-safe way +CGFloat RCTScreenScale(void); +CGSize RCTScreenSize(void); + +// Round float coordinates to nearest whole screen pixel (not point) +CGFloat RCTRoundPixelValue(CGFloat value); +CGFloat RCTCeilPixelValue(CGFloat value); +CGFloat RCTFloorPixelValue(CGFloat value); + +// Get current time, for precise performance metrics +NSTimeInterval RCTTGetAbsoluteTime(void); + +// Method swizzling +void RCTSwapClassMethods(Class cls, SEL original, SEL replacement); +void RCTSwapInstanceMethods(Class cls, SEL original, SEL replacement); + +// Module subclass support +BOOL RCTClassOverridesClassMethod(Class cls, SEL selector); +BOOL RCTClassOverridesInstanceMethod(Class cls, SEL selector); diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTView.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTView.h new file mode 100644 index 000000000..77dee1df8 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTView.h @@ -0,0 +1,24 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTView.h" + +#import + +#import "RCTPointerEvents.h" + +@protocol RCTAutoInsetsProtocol; + +@interface RCTView : UIView + +@property (nonatomic, assign) RCTPointerEvents pointerEvents; +@property (nonatomic, copy) NSString *overrideAccessibilityLabel; + ++ (void)autoAdjustInsetsForView:(UIView *)parentView + withScrollView:(UIScrollView *)scrollView + updateOffset:(BOOL)updateOffset; + ++ (UIViewController *)backingViewControllerForView:(UIView *)view; + ++ (UIEdgeInsets)contentInsetsForView:(UIView *)curView; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewManager.h new file mode 100644 index 000000000..e77be09c1 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewManager.h @@ -0,0 +1,148 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTConvert.h" +#import "RCTLog.h" + +@class RCTEventDispatcher; +@class RCTShadowView; +@class RCTSparseArray; +@class RCTUIManager; + +typedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, RCTSparseArray *viewRegistry); + +@interface RCTViewManager : NSObject + +/** + * Designated initializer for view modules. Override this when subclassing. + */ +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; + +/** + * The event dispatcher is used to send events back to the JavaScript application. + * It can either be used directly by the module, or passed on to instantiated + * view subclasses so that they can handle their own events. + */ +@property (nonatomic, readonly, weak) RCTEventDispatcher *eventDispatcher; + +/** + * The module name exposed to React JS. If omitted, this will be inferred + * automatically by using the view module's class name. It is better to not + * override this, and just follow standard naming conventions for your view + * module subclasses. + */ ++ (NSString *)moduleName; + +/** + * This method instantiates a native view to be managed by the module. Override + * this to return a custom view instance, which may be preconfigured with default + * properties, subviews, etc. This method will be called many times, and should + * return a fresh instance each time. The view module MUST NOT cache the returned + * view and return the same instance for subsequent calls. + */ +- (UIView *)view; + +/** + * This method instantiates a shadow view to be managed by the module. If omitted, + * an ordinary RCTShadowView instance will be created, which is typically fine for + * most view types. As with the -view method, the -shadowView method should return + * a fresh instance each time it is called. + */ +- (RCTShadowView *)shadowView; + +/** + * Returns a dictionary of config data passed to JS that defines eligible events + * that can be placed on native views. This should return bubbling + * directly-dispatched event types and specify what names should be used to + * subscribe to either form (bubbling/capturing). + * + * Returned dictionary should be of the form: @{ + * @"onTwirl": { + * @"phasedRegistrationNames": @{ + * @"bubbled": @"onTwirl", + * @"captured": @"onTwirlCaptured" + * } + * } + * } + * + * Note that this method is not inherited when you subclass a view module, and + * you should not call [super customBubblingEventTypes] when overriding it. + */ ++ (NSDictionary *)customBubblingEventTypes; + +/** + * Returns a dictionary of config data passed to JS that defines eligible events + * that can be placed on native views. This should return non-bubbling + * directly-dispatched event types. + * + * Returned dictionary should be of the form: @{ + * @"onTwirl": { + * @"registrationName": @"onTwirl" + * } + * } + * + * Note that this method is not inherited when you subclass a view module, and + * you should not call [super customDirectEventTypes] when overriding it. + */ ++ (NSDictionary *)customDirectEventTypes; + +/** + * Injects constants into JS. These constants are made accessible via + * NativeModules.moduleName.X. Note that this method is not inherited when you + * subclass a view module, and you should not call [super constantsToExport] + * when overriding it. + */ ++ (NSDictionary *)constantsToExport; + +/** + * To deprecate, hopefully + */ +- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(RCTSparseArray *)shadowViewRegistry; + +/** + * Informal protocol for setting view and shadowView properties. + * Implement methods matching these patterns to set any properties that + * require special treatment (e.g. where the type or name cannot be inferred). + * + * - (void)set_:(id)property + * forView:(UIView *)view + * withDefaultView:(UIView *)defaultView; + * + * - (void)set_:(id)property + * forShadowView:(RCTShadowView *)view + * withDefaultView:(RCTShadowView *)defaultView; + * + * For simple cases, use the macros below: + */ + +/** + * This handles the simple case, where JS and native property names match + * And the type can be automatically inferred. + */ +#define RCT_EXPORT_VIEW_PROPERTY(name) \ +RCT_REMAP_VIEW_PROPERTY(name, name) + +/** + * This macro maps a named property on the module to an arbitrary key path + * within the view. + */ +#define RCT_REMAP_VIEW_PROPERTY(name, keypath) \ +- (void)set_##name:(id)json forView:(id)view withDefaultView:(id)defaultView { \ + if ((json && !RCTSetProperty(view, @#keypath, json)) || \ + (!json && !RCTCopyProperty(view, defaultView, @#keypath))) { \ + RCTLogMustFix(@"%@ does not have setter for `%s` property", [view class], #name); \ + } \ +} + +/** + * These are useful in cases where the module's superclass handles a + * property, but you wish to "unhandle" it, so it will be ignored. + */ +#define RCT_IGNORE_VIEW_PROPERTY(name) \ +- (void)set_##name:(id)value forView:(id)view withDefaultView:(id)defaultView {} + +#define RCT_IGNORE_SHADOW_PROPERTY(name) \ +- (void)set_##name:(id)value forShadowView:(id)view withDefaultView:(id)defaultView {} + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h new file mode 100644 index 000000000..1fa3e252b --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h @@ -0,0 +1,26 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +/** + + * Logical node in a tree of application components. Both `ShadowView`s and + * `UIView+ReactKit`s conform to this. Allows us to write utilities that + * reason about trees generally. + */ +@protocol RCTViewNodeProtocol + +@property (nonatomic, strong) NSNumber *reactTag; + +- (void)insertReactSubview:(id)subview atIndex:(NSInteger)atIndex; +- (void)removeReactSubview:(id)subview; +- (NSMutableArray *)reactSubviews; +- (NSNumber *)reactTagAtPoint:(CGPoint)point; + +// View is an RCTRootView +- (BOOL)isReactRootView; + +@optional + +// TODO: Deprecate this +- (void)reactBridgeDidFinishTransaction; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWebViewExecutor.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWebViewExecutor.h new file mode 100644 index 000000000..7f695f3f3 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWebViewExecutor.h @@ -0,0 +1,35 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTJavaScriptExecutor.h" + +/** + * Uses an embedded web view merely for the purpose of being able to reuse the + * existing webkit debugging tools. Fulfills the role of a very constrained + * `JSContext`, which we call `RCTJavaScriptExecutor`. + * + * TODO: To ensure production-identical execution, scrub the window + * environment. And ensure main thread operations are actually added to a queue + * instead of being executed immediately if already on the main thread. + */ +@interface RCTWebViewExecutor : NSObject + +// Only one callback stored - will only be invoked for the latest issued +// application script request. +@property (nonatomic, copy) RCTJavaScriptCompleteBlock onApplicationScriptLoaded; + +/** + * Instantiate with a specific webview instance + */ +- (instancetype)initWithWebView:(UIWebView *)webView NS_DESIGNATED_INITIALIZER; + +/** + * Invoke this to reclaim the web view for reuse. This is necessary in order to + * allow debuggers to remain open, when creating a new `RCTWebViewExecutor`. + * This guards against the web view being invalidated, and makes sure the + * `delegate` is cleared first. + */ +- (UIWebView *)invalidateAndReclaimWebView; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h new file mode 100644 index 000000000..d8f22270a --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h @@ -0,0 +1,24 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@class RCTEventDispatcher; +@class RCTNavItem; +@class RCTWrapperViewController; + +@protocol RCTWrapperViewControllerNavigationListener + +- (void)wrapperViewController:(RCTWrapperViewController *)wrapperViewController +didMoveToNavigationController:(UINavigationController *)navigationController; + +@end + +@interface RCTWrapperViewController : UIViewController + +- (instancetype)initWithContentView:(UIView *)contentView eventDispatcher:(RCTEventDispatcher *)eventDispatcher; +- (instancetype)initWithNavItem:(RCTNavItem *)navItem eventDispatcher:(RCTEventDispatcher *)eventDispatcher; + +@property (nonatomic, readwrite, weak) id navigationListener; +@property (nonatomic, strong, readwrite) RCTNavItem *navItem; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/UIView+ReactKit.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/UIView+ReactKit.h new file mode 100644 index 000000000..3e45da8e7 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/UIView+ReactKit.h @@ -0,0 +1,11 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTViewNodeProtocol.h" + +//TODO: let's try to eliminate this category if possible + +@interface UIView (ReactKit) + +@end diff --git a/Examples/TicTacToe/Pods/Local Podspecs/RCTNetworkImage.podspec b/Examples/TicTacToe/Pods/Local Podspecs/RCTNetworkImage.podspec new file mode 100644 index 000000000..47eb0e5f6 --- /dev/null +++ b/Examples/TicTacToe/Pods/Local Podspecs/RCTNetworkImage.podspec @@ -0,0 +1,28 @@ +Pod::Spec.new do |spec| + spec.name = 'RCTNetworkImage' + spec.version = '0.0.1' + spec.summary = 'Provides basic Text capabilities in ReactNative apps.' + spec.description = <<-DESC + Text can be rendered in ReactNative apps with the component using this module. + DESC + spec.homepage = 'https://facebook.github.io/react-native/' + spec.license = { :type => 'BSD' } + spec.author = 'Facebook' + spec.platform = :ios, '7.0' + spec.requires_arc = true + spec.source_files = '**/*.{h,m,c}' + spec.dependency "ReactKit", "~> 0.0.1" + + # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Link your library with frameworks, or libraries. Libraries do not include + # the lib prefix of their name. + # + + # s.framework = "SomeFramework" + # s.frameworks = "SomeFramework", "AnotherFramework" + + # s.library = "iconv" + #spec.libraries = "RCTNetworkImage", "ReactKit" + +end diff --git a/Examples/TicTacToe/Pods/Local Podspecs/RCTText.podspec b/Examples/TicTacToe/Pods/Local Podspecs/RCTText.podspec new file mode 100644 index 000000000..656e0ee74 --- /dev/null +++ b/Examples/TicTacToe/Pods/Local Podspecs/RCTText.podspec @@ -0,0 +1,28 @@ +Pod::Spec.new do |spec| + spec.name = 'RCTText' + spec.version = '0.0.1' + spec.summary = 'Provides basic Text capabilities in ReactNative apps.' + spec.description = <<-DESC + Text can be rendered in ReactNative apps with the component using this module. + DESC + spec.homepage = 'https://facebook.github.io/react-native/' + spec.license = { :type => 'BSD' } + spec.author = 'Facebook' + spec.platform = :ios, '7.0' + spec.requires_arc = true + spec.source_files = '**/*.{h,m,c}' + spec.dependency "ReactKit", "~> 0.0.1" + + # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Link your library with frameworks, or libraries. Libraries do not include + # the lib prefix of their name. + # + + # s.framework = "SomeFramework" + # s.frameworks = "SomeFramework", "AnotherFramework" + + # s.library = "iconv" + #spec.libraries = "RCTText", "ReactKit" + +end diff --git a/Examples/TicTacToe/Pods/Local Podspecs/ReactKit.podspec b/Examples/TicTacToe/Pods/Local Podspecs/ReactKit.podspec new file mode 100644 index 000000000..3e1a8a6e2 --- /dev/null +++ b/Examples/TicTacToe/Pods/Local Podspecs/ReactKit.podspec @@ -0,0 +1,16 @@ +Pod::Spec.new do |spec| + spec.name = 'ReactKit' + spec.version = '0.0.1' + spec.summary = 'An implementation of React that targets UIKit for iOS' + spec.description = <<-DESC + Our first React Native implementation is ReactKit, targeting iOS. We are also working on an Android implementation which we will release later. ReactKit apps are built using the React JS framework, and render directly to native UIKit elements using a fully asynchronous architecture. There is no browser and no HTML. We have picked what we think is the best set of features from these and other technologies to build what we hope to become the best product development framework available, with an emphasis on iteration speed, developer delight, continuity of technology, and absolutely beautiful and fast products with no compromises in quality or capability. + DESC + spec.homepage = 'https://facebook.github.io/react-native/' + spec.license = { :type => 'BSD' } + spec.author = 'Facebook' + spec.platform = :ios, '7.0' + spec.requires_arc = true + spec.source_files = '**/*.{h,m,c}' + spec.public_header_files = "**/*.h" + #spec.library = "ReactKit" +end diff --git a/Examples/TicTacToe/Pods/Manifest.lock b/Examples/TicTacToe/Pods/Manifest.lock new file mode 100644 index 000000000..79377f7f5 --- /dev/null +++ b/Examples/TicTacToe/Pods/Manifest.lock @@ -0,0 +1,26 @@ +PODS: + - RCTNetworkImage (0.0.1): + - ReactKit (~> 0.0.1) + - RCTText (0.0.1): + - ReactKit (~> 0.0.1) + - ReactKit (0.0.1) + +DEPENDENCIES: + - RCTNetworkImage (from `../../Libraries/Image`) + - RCTText (from `../../Libraries/Text`) + - ReactKit (from `../../ReactKit`) + +EXTERNAL SOURCES: + RCTNetworkImage: + :path: ../../Libraries/Image + RCTText: + :path: ../../Libraries/Text + ReactKit: + :path: ../../ReactKit + +SPEC CHECKSUMS: + RCTNetworkImage: 6d99735875916e098a65c68a54a72e67e24a402a + RCTText: 5c0cf4635241e8c02e8933853df03809d2dc8327 + ReactKit: 65c02c1e95951c198e491d2a4c1972675d4af254 + +COCOAPODS: 0.35.0 diff --git a/Examples/TicTacToe/Pods/Pods.xcodeproj/project.pbxproj b/Examples/TicTacToe/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 000000000..970a5d205 --- /dev/null +++ b/Examples/TicTacToe/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,3898 @@ + + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + 005E47CD37DA97006CE65B99 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTText.h + sourceTree + <group> + + 00CA6F6E234DA9FAFC268F4C + + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + CLANG_CXX_LANGUAGE_STANDARD + gnu++0x + CLANG_CXX_LIBRARY + libc++ + CLANG_ENABLE_MODULES + YES + CLANG_ENABLE_OBJC_ARC + YES + CLANG_WARN_BOOL_CONVERSION + YES + CLANG_WARN_CONSTANT_CONVERSION + YES + CLANG_WARN_DIRECT_OBJC_ISA_USAGE + YES + CLANG_WARN_EMPTY_BODY + YES + CLANG_WARN_ENUM_CONVERSION + YES + CLANG_WARN_INT_CONVERSION + YES + CLANG_WARN_OBJC_ROOT_CLASS + YES + COPY_PHASE_STRIP + NO + ENABLE_NS_ASSERTIONS + NO + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_PREPROCESSOR_DEFINITIONS + + RELEASE=1 + + GCC_WARN_64_TO_32_BIT_CONVERSION + YES + GCC_WARN_ABOUT_RETURN_TYPE + YES + GCC_WARN_UNDECLARED_SELECTOR + YES + GCC_WARN_UNINITIALIZED_AUTOS + YES + GCC_WARN_UNUSED_FUNCTION + YES + GCC_WARN_UNUSED_VARIABLE + YES + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + STRIP_INSTALLED_PRODUCT + NO + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 02011DF072CE86BD3AD237F3 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTUIManager.h + path + Modules/RCTUIManager.h + sourceTree + <group> + + 03219EE301E4BE34C4E26BF5 + + buildActionMask + 2147483647 + files + + ED09FCD5EBB9DAA998867B1F + 51DA8A2705C963385CCF407E + 244F3E3D12A6582888A3FDAC + 55461293CD520E1A61389C81 + BFEF41FE0A9C6E4BF083A1C4 + + isa + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 0446F952AD32FA99CE53021F + + buildActionMask + 2147483647 + files + + 43AA89FA9AC4BA1666D9422F + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 046F50050C1051EB89B1CC2D + + fileRef + 569C3E0B54CE022FD9433B66 + isa + PBXBuildFile + + 0524E24381502D7EB46CCF29 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTBridge.h + path + Base/RCTBridge.h + sourceTree + <group> + + 054AB43B546728B2ACD9DE38 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-dummy.m + sourceTree + <group> + + 0678F15E5799E801FBBB82EE + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTWebViewExecutor.m + path + Executors/RCTWebViewExecutor.m + sourceTree + <group> + + 068A30BD4A2404B5DAEBE221 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTShadowView.h + path + Views/RCTShadowView.h + sourceTree + <group> + + 0966A648227568DA76319358 + + fileRef + 2461A7AF21FB638CED912FE3 + isa + PBXBuildFile + + 097BE8E1E29CD333D067E047 + + buildConfigurations + + DFEDA529E62F398E0E66A864 + CCCA2CC55157BFF72767CEAB + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 0C288D473E48E342E2E09095 + + fileRef + 22669B7FF7DBBF51202945CD + isa + PBXBuildFile + + 0D3A42D393008EEAD192C928 + + fileRef + 12FAC13993C100C3FDBD0DD8 + isa + PBXBuildFile + + 0D4B28DA9FC2C4CB2B2874B3 + + fileRef + 5F3DD45AD214483F15E95111 + isa + PBXBuildFile + + 0D723FDEF5CC9DBD086EAB39 + + fileRef + 7E1B11B9B4C3FFCEFFD1F35D + isa + PBXBuildFile + + 0EC776D336E22CBCEE4678E8 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods.a + sourceTree + BUILT_PRODUCTS_DIR + + 0F992DA69BD971F9C2BF439E + + fileRef + 78082D94239F5CEB5959B0B2 + isa + PBXBuildFile + + 12FAC13993C100C3FDBD0DD8 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTNavigatorManager.m + path + Views/RCTNavigatorManager.m + sourceTree + <group> + + 132DE36D6DB2D0F70C09CE89 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTAlertManager.m + path + Modules/RCTAlertManager.m + sourceTree + <group> + + 14F2CD18D70F8E4D68AC5B7A + + buildActionMask + 2147483647 + files + + BB0B04F7F63902EED012528E + 8ECFD3E48BD636104455BB71 + 38E3244F957866F7F0C32D86 + 62A59B690CB532CADE33707A + 28C1D5D42E3F1D2B39F0705C + 640DB00247945B46A90D77BB + EA79968832417354B40F6352 + 6817FF9F9174ADBAD78127A3 + 1AED708527053A371CD9B773 + D879CE28A1189AB3CA754538 + A9BAD3EC8ABCA9694CAF96F7 + 2DAADC70BCF143DF7CA581E1 + 9E520B28129AD787FE9C67D8 + 1CEA503C817DE70221AD83F8 + 4F949B8D09B678579C19C66A + FAE203974E438996878047C2 + 5D95EA92C79D8C7588A091E2 + F9ECFBDEC272AF69A54935F9 + B9DEE348987356C83C27DD9E + 4639D2C096C861AE4FEDB1BE + E1C485676C801FFCB46D93D0 + F68991A42B4CF608AF91EBB5 + 83C5FDC3F8BE71F2109194A8 + C07D1DDFE8D93ECEDF0E97C1 + ABFBF65F5D61F7EA440E25A8 + 404B71EC96CEA99711DAE44C + 69E62A75FE90251221950A25 + 7DE6E8E2D2109F67434864E2 + 47ECAF504BAF1A40ECB4755C + 0966A648227568DA76319358 + 4DA996F14A25031E40FF5B20 + 6966836B9D0C1BA7F411C883 + 716937CEA06BA6300F2CFD38 + 7A9E043C29916787D48A9DC3 + 97C2676E499C58904665B945 + 77BFD1192ACD1153CD3B92C2 + 759D943C6812DD195ABE9354 + 4E9FB0C0547065C3A59FF16D + F069246D046DFFE7CF05DE92 + C618E1B2CFF909C6273ABD4D + 529B63BA987480726B6C3FC3 + C77D22DADA6D43EC7CC8478A + 2566A98F79CE35E42FC8FBB8 + 046F50050C1051EB89B1CC2D + D4D507D020AD79183E1DD916 + + isa + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 15478769A7025E67403CF8F6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTText.m + sourceTree + <group> + + 1568A6E0A0EFBABC6271F94D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTUtils.m + path + Base/RCTUtils.m + sourceTree + <group> + + 156E154B035C85C750DA3DE2 + + buildConfigurationList + E484553771DAF5F08178C966 + buildPhases + + C043A8B738F0E880E4E71CF4 + DDEDAE8AD808715BBCF5DC6C + + buildRules + + dependencies + + EDBE5D54C93BC128C25036AD + 3ACDD0E0A9EED6CBCC130B09 + 85336AD28D003EA10FC44AD9 + + isa + PBXNativeTarget + name + Pods + productName + Pods + productReference + 0EC776D336E22CBCEE4678E8 + productType + com.apple.product-type.library.static + + 15D063218D733290ACAF6ECD + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTScrollableProtocol.h + path + Base/RCTScrollableProtocol.h + sourceTree + <group> + + 16B69D05ABC152C41B9129FB + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTLog.h + path + Base/RCTLog.h + sourceTree + <group> + + 16E1299D87C2B7BE1D68024F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTRawTextManager.m + sourceTree + <group> + + 175C559D2A89B7FC27EFD6C5 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTViewNodeProtocol.h + path + Base/RCTViewNodeProtocol.h + sourceTree + <group> + + 198FD8078EB2E34708CAF463 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTNetworkImageViewManager.m + sourceTree + <group> + + 1AED708527053A371CD9B773 + + fileRef + 289322DAF960C6BD7F2FD8E1 + isa + PBXBuildFile + + 1B437510B4F6BE59E0B8B24F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text + path + Pods-acknowledgements.markdown + sourceTree + <group> + + 1CEA503C817DE70221AD83F8 + + fileRef + E5FC33A15846273C981E0322 + isa + PBXBuildFile + + 1E0B27EFE9498593A53775FC + + fileRef + FCAC9AFE3E61C78E93EA7E8C + isa + PBXBuildFile + + 1E8BDC022A45A44FA90E9BF5 + + fileRef + 3CC9DC0433D77149CC4DE5DE + isa + PBXBuildFile + + 20F2231C1AEED2919F583DC7 + + buildConfigurationList + 919FCDB927A3933126B3DCFE + buildPhases + + 7D6A37C994847E772C6CF039 + 0446F952AD32FA99CE53021F + 14F2CD18D70F8E4D68AC5B7A + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Pods-ReactKit + productName + Pods-ReactKit + productReference + C575BB07E7B92FA3EBC10949 + productType + com.apple.product-type.library.static + + 22669B7FF7DBBF51202945CD + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTContextExecutor.m + path + Executors/RCTContextExecutor.m + sourceTree + <group> + + 22CB86FDC9D99844724FDDD3 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTTextFieldManager.m + path + Views/RCTTextFieldManager.m + sourceTree + <group> + + 244F3E3D12A6582888A3FDAC + + fileRef + FF03E617D571F159152581FC + isa + PBXBuildFile + + 245789C2D4A68C88E27641D9 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTScrollView.h + path + Views/RCTScrollView.h + sourceTree + <group> + + 2461A7AF21FB638CED912FE3 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTStaticImage.h + path + Views/RCTStaticImage.h + sourceTree + <group> + + 2566A98F79CE35E42FC8FBB8 + + fileRef + 9FF2D7B800439FD8B4118089 + isa + PBXBuildFile + + 2603E0CD923E37E10EED21A8 + + fileRef + 97138ACEE67BD2BDF8A3DEA0 + isa + PBXBuildFile + + 26C00EEFB778EFB7A6703E20 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTAnimationType.h + path + Base/RCTAnimationType.h + sourceTree + <group> + + 27F37EEF056BA05A9FE6548A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTExceptionsManager.h + path + Modules/RCTExceptionsManager.h + sourceTree + <group> + + 289322DAF960C6BD7F2FD8E1 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTContextExecutor.h + path + Executors/RCTContextExecutor.h + sourceTree + <group> + + 28C1D5D42E3F1D2B39F0705C + + fileRef + CEAD6D174912D6D124A031D9 + isa + PBXBuildFile + + 2A5A7AE725AB3B07B61A40E9 + + baseConfigurationReference + A9E3206FA20E2CAD15028412 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_PRECOMPILE_PREFIX_HEADER + YES + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 2DA5F87EA2CDCEA0ED668578 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTExceptionsManager.m + path + Modules/RCTExceptionsManager.m + sourceTree + <group> + + 2DAADC70BCF143DF7CA581E1 + + fileRef + 27F37EEF056BA05A9FE6548A + isa + PBXBuildFile + + 2E00E46C249C163EBC0418DC + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTUIActivityIndicatorViewManager.h + path + Views/RCTUIActivityIndicatorViewManager.h + sourceTree + <group> + + 2F6BBA653E86409B28911661 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTLog.m + path + Base/RCTLog.m + sourceTree + <group> + + 320294F910FF631F87E183B5 + + baseConfigurationReference + 504F7E363A7AFC9A64B86154 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 32FFFCBE06BA47E77A58F52F + + fileRef + 22CB86FDC9D99844724FDDD3 + isa + PBXBuildFile + + 33E69C46AB97309D4EBFA432 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTViewManager.m + path + Views/RCTViewManager.m + sourceTree + <group> + + 358919F57C8842F2A160F855 + + fileRef + 6AC9ACC04495648FA5060FCD + isa + PBXBuildFile + + 38E3244F957866F7F0C32D86 + + fileRef + 26C00EEFB778EFB7A6703E20 + isa + PBXBuildFile + + 391E46E8F975CA6362AB5DE5 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTText.xcconfig + sourceTree + <group> + + 39206929A27DEBF5CBACB942 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-RCTText.a + sourceTree + BUILT_PRODUCTS_DIR + + 3938293AC4D9C3C8B8DDFDC7 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTViewManager.h + path + Views/RCTViewManager.h + sourceTree + <group> + + 3ACDD0E0A9EED6CBCC130B09 + + isa + PBXTargetDependency + name + Pods-RCTText + target + F5D2C09AFAA6986D234BF953 + targetProxy + E1C5A97B9865CABC567B000A + + 3CC9DC0433D77149CC4DE5DE + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTCache.m + path + Base/RCTCache.m + sourceTree + <group> + + 3D3089A4A62A68E4D5BB4562 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTBridge.m + path + Base/RCTBridge.m + sourceTree + <group> + + 3F06663863E59C187B84EAD2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTStaticImageManager.h + path + Views/RCTStaticImageManager.h + sourceTree + <group> + + 3FDDE45F64AE789BEAED2125 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTNavItem.h + path + Views/RCTNavItem.h + sourceTree + <group> + + 404B71EC96CEA99711DAE44C + + fileRef + E991F096165FA74435C7282D + isa + PBXBuildFile + + 411AACA7B5F606DA03793980 + + fileRef + F6CC16FA65BD5A265088B6B6 + isa + PBXBuildFile + + 427D3517A7FBC3A92AF9E9D4 + + children + + 5D7BCEA99DDC0B36A4C4EB31 + + isa + PBXGroup + name + Targets Support Files + sourceTree + <group> + + 42FCE12743FD1B4702208E0D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTUtils.h + path + Base/RCTUtils.h + sourceTree + <group> + + 430F4C781E2E7EE9F8CB83FD + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-ReactKit-Private.xcconfig + sourceTree + <group> + + 43AA89FA9AC4BA1666D9422F + + fileRef + 5D5E4CDC94FE8212303F96ED + isa + PBXBuildFile + + 44161614652ABCC200708F4A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTShadowRawText.h + sourceTree + <group> + + 45775545A25B55D8FF631FF5 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTShadowView.m + path + Views/RCTShadowView.m + sourceTree + <group> + + 4608EE51074A11B61B7BAB45 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTNetworkImage.xcconfig + sourceTree + <group> + + 4637476226C7CEC79C7DE49E + + fileRef + 1568A6E0A0EFBABC6271F94D + isa + PBXBuildFile + + 4639D2C096C861AE4FEDB1BE + + fileRef + B40A54F9CD6C17782376DE87 + isa + PBXBuildFile + + 4648080B27A50C8D028851B3 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTAssert.m + path + Base/RCTAssert.m + sourceTree + <group> + + 47B228B88421B943C6005B10 + + fileRef + F731109AFE06344ABBC4BBE6 + isa + PBXBuildFile + + 47ECAF504BAF1A40ECB4755C + + fileRef + 6C59A8B8703F0BD79C458591 + isa + PBXBuildFile + + 48039B7A25006CE8F45E9619 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + UIView+ReactKit.h + path + Views/UIView+ReactKit.h + sourceTree + <group> + + 491280116436017C4FEC9FD8 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + Layout.h + path + Layout/Layout.h + sourceTree + <group> + + 49199899EB7E17720A69A6A0 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTNavItemManager.h + path + Views/RCTNavItemManager.h + sourceTree + <group> + + 4DA996F14A25031E40FF5B20 + + fileRef + 3F06663863E59C187B84EAD2 + isa + PBXBuildFile + + 4E9FB0C0547065C3A59FF16D + + fileRef + 02011DF072CE86BD3AD237F3 + isa + PBXBuildFile + + 4F949B8D09B678579C19C66A + + fileRef + DD1AEBDB914EF5C49CAAEB46 + isa + PBXBuildFile + + 504F7E363A7AFC9A64B86154 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTText-Private.xcconfig + sourceTree + <group> + + 51DA8A2705C963385CCF407E + + fileRef + 44161614652ABCC200708F4A + isa + PBXBuildFile + + 523EDE48CB10BED172EA70AA + + fileRef + DF17E391C45D5B66999F6D99 + isa + PBXBuildFile + + 529B63BA987480726B6C3FC3 + + fileRef + 3938293AC4D9C3C8B8DDFDC7 + isa + PBXBuildFile + + 530A6D73CAFF37DCB5A52103 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTScrollViewManager.m + path + Views/RCTScrollViewManager.m + sourceTree + <group> + + 54481109ECD4CD40F5F746F8 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTPointerEvents.h + path + Base/RCTPointerEvents.h + sourceTree + <group> + + 55461293CD520E1A61389C81 + + fileRef + 005E47CD37DA97006CE65B99 + isa + PBXBuildFile + + 5675366766067D60156EEAA1 + + fileRef + A53374892CD6B26138B38ADB + isa + PBXBuildFile + + 569C3E0B54CE022FD9433B66 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTWrapperViewController.h + path + Views/RCTWrapperViewController.h + sourceTree + <group> + + 58A59E47157F3E11F33C044F + + buildActionMask + 2147483647 + files + + 7795BA5CF034328C6FAB5599 + 5C917B8E0FE26AB41B2FD624 + 0F992DA69BD971F9C2BF439E + + isa + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 5A541D6A294BA6E01BD0CD3A + + baseConfigurationReference + 430F4C781E2E7EE9F8CB83FD + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 5A8146BE2B9A4E8B080899C7 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTStatusBarManager.h + path + Modules/RCTStatusBarManager.h + sourceTree + <group> + + 5C917B8E0FE26AB41B2FD624 + + fileRef + 79ED42B49D21E04D9AA9DC7F + isa + PBXBuildFile + + 5D44D4115556BA5F81C67E07 + + fileRef + EA77880FBBE6AA7511841605 + isa + PBXBuildFile + + 5D5E4CDC94FE8212303F96ED + + isa + PBXFileReference + lastKnownFileType + wrapper.framework + name + Foundation.framework + path + Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/Foundation.framework + sourceTree + DEVELOPER_DIR + + 5D7BCEA99DDC0B36A4C4EB31 + + children + + 1B437510B4F6BE59E0B8B24F + 8F72A8B191D5505279E9254D + 054AB43B546728B2ACD9DE38 + 6B2DF6A0713908E45F8EBE75 + 7DA2E9C4F2BA3289E2668E17 + 6C4193D7074A9FE2AADD31C2 + A9E3206FA20E2CAD15028412 + + isa + PBXGroup + name + Pods + path + Target Support Files/Pods + sourceTree + <group> + + 5D95EA92C79D8C7588A091E2 + + fileRef + 16B69D05ABC152C41B9129FB + isa + PBXBuildFile + + 5F3DD45AD214483F15E95111 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTShadowRawText.m + sourceTree + <group> + + 5F70F61D02759E49CFA5E3EB + + fileRef + 2DA5F87EA2CDCEA0ED668578 + isa + PBXBuildFile + + 60662361B9CC9A2A8D49F638 + + isa + PBXTargetDependency + name + Pods-ReactKit + target + 20F2231C1AEED2919F583DC7 + targetProxy + 7EDCA4090C484196C36B1977 + + 62A59B690CB532CADE33707A + + fileRef + 6FCFD749EEB3861EB75C0534 + isa + PBXBuildFile + + 640DB00247945B46A90D77BB + + fileRef + 0524E24381502D7EB46CCF29 + isa + PBXBuildFile + + 648F4790538BD82BF2B083EF + + baseConfigurationReference + 430F4C781E2E7EE9F8CB83FD + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + 6499B8CCEC40B282FFAADFA6 + + containerPortal + E88354D347CCC1EAC2E787C1 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 76D2A8D67E04D111A7938CED + remoteInfo + Pods-RCTNetworkImage + + 6522F5D072C47020817339D9 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTInvalidating.h + path + Base/RCTInvalidating.h + sourceTree + <group> + + 6707B683A72305367066EE6C + + fileRef + 33E69C46AB97309D4EBFA432 + isa + PBXBuildFile + + 6817FF9F9174ADBAD78127A3 + + fileRef + D0F5EC95B7EE03515326948E + isa + PBXBuildFile + + 69220AD94D86BCE4FAE46678 + + children + + 4608EE51074A11B61B7BAB45 + A95BFEC22FBAC588E1B491ED + C9AA6ACBFD421C3D6FAC5329 + C8F7D06CE3D7F4FDED21933F + + isa + PBXGroup + name + Support Files + path + ../../Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage + sourceTree + <group> + + 6966836B9D0C1BA7F411C883 + + fileRef + 5A8146BE2B9A4E8B080899C7 + isa + PBXBuildFile + + 69E62A75FE90251221950A25 + + fileRef + 15D063218D733290ACAF6ECD + isa + PBXBuildFile + + 6AC9ACC04495648FA5060FCD + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTRedBox.m + path + Base/RCTRedBox.m + sourceTree + <group> + + 6B2DF6A0713908E45F8EBE75 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-environment.h + sourceTree + <group> + + 6BC3EB96204A30E4A472DDE4 + + fileRef + 97BAEC30E32259F061CCB7DE + isa + PBXBuildFile + + 6BEE757D0B19EB927C04C0FA + + children + + 0EC776D336E22CBCEE4678E8 + BCDC97F48090DACB87DEC04E + 39206929A27DEBF5CBACB942 + C575BB07E7B92FA3EBC10949 + + isa + PBXGroup + name + Products + sourceTree + <group> + + 6C4193D7074A9FE2AADD31C2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods.debug.xcconfig + sourceTree + <group> + + 6C59A8B8703F0BD79C458591 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTSparseArray.h + path + Base/RCTSparseArray.h + sourceTree + <group> + + 6C5C7F49C76DFD009CE24F54 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTRootView.h + path + Base/RCTRootView.h + sourceTree + <group> + + 6D757E59E707D9B3474721D7 + + buildConfigurations + + CDCB9B4306F2967192C1DAAA + 00CA6F6E234DA9FAFC268F4C + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 6DA156177295C36FC390E8E9 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTShadowText.m + sourceTree + <group> + + 6E38F96F68680D013AD0812A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTWrapperViewController.m + path + Views/RCTWrapperViewController.m + sourceTree + <group> + + 6FCFD749EEB3861EB75C0534 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTAssert.h + path + Base/RCTAssert.h + sourceTree + <group> + + 716937CEA06BA6300F2CFD38 + + fileRef + F6F6566819F8D0B545E28AC4 + isa + PBXBuildFile + + 71B93A65A95640972062EC29 + + fileRef + 45775545A25B55D8FF631FF5 + isa + PBXBuildFile + + 72B306867705C5CA14B74DF2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTNavItemManager.m + path + Views/RCTNavItemManager.m + sourceTree + <group> + + 7308A06BDA47FB20E2FC8005 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTConvert.h + path + Base/RCTConvert.h + sourceTree + <group> + + 759D943C6812DD195ABE9354 + + fileRef + 2E00E46C249C163EBC0418DC + isa + PBXBuildFile + + 76D2A8D67E04D111A7938CED + + buildConfigurationList + 097BE8E1E29CD333D067E047 + buildPhases + + BD29342538528D6DE4038BD2 + DEA6A4B98EA82BEDE81ED513 + 58A59E47157F3E11F33C044F + + buildRules + + dependencies + + B495C09D4F5093AAB731E194 + + isa + PBXNativeTarget + name + Pods-RCTNetworkImage + productName + Pods-RCTNetworkImage + productReference + BCDC97F48090DACB87DEC04E + productType + com.apple.product-type.library.static + + 7701A5C43F0A8424984C6A6A + + fileRef + 6DA156177295C36FC390E8E9 + isa + PBXBuildFile + + 772EDE81A05CD3EA28A869CC + + baseConfigurationReference + 504F7E363A7AFC9A64B86154 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + 7795BA5CF034328C6FAB5599 + + fileRef + 895928D325843E9D8B7285FA + isa + PBXBuildFile + + 77AEC7F8659C91198FFFF673 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTNavigatorManager.h + path + Views/RCTNavigatorManager.h + sourceTree + <group> + + 77BFD1192ACD1153CD3B92C2 + + fileRef + B2D7892A9C3245D8D7431C23 + isa + PBXBuildFile + + 78082D94239F5CEB5959B0B2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTNetworkImageViewManager.h + sourceTree + <group> + + 79ED42B49D21E04D9AA9DC7F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTNetworkImageView.h + sourceTree + <group> + + 7A9E043C29916787D48A9DC3 + + fileRef + B32480BC0BA8A8BA551E9D00 + isa + PBXBuildFile + + 7B322FB23DF6316D9D0FAB4F + + fileRef + 8E13E32022B45DA13AFC5404 + isa + PBXBuildFile + + 7D62F170107D856DB97A0F27 + + fileRef + 2F6BBA653E86409B28911661 + isa + PBXBuildFile + + 7D6A37C994847E772C6CF039 + + buildActionMask + 2147483647 + files + + FB19B6A03634D6CC16E8D731 + 8C49B230561E49F529C012B5 + 949E5950C7964E60EE8037C2 + BE52F839238A59D2AB82159E + EC5F81AEBB86DCC1C9ECDE59 + 1E8BDC022A45A44FA90E9BF5 + 0C288D473E48E342E2E09095 + 7B322FB23DF6316D9D0FAB4F + 81A3FE9526EC90CC18E84790 + 5F70F61D02759E49CFA5E3EB + 523EDE48CB10BED172EA70AA + 7D62F170107D856DB97A0F27 + AC1A530CDB55406B05665766 + AF5A50F21A42CD8E0BBDF109 + 7EBF30F9E8C4AD6523928C97 + 0D3A42D393008EEAD192C928 + 358919F57C8842F2A160F855 + 2603E0CD923E37E10EED21A8 + E52753A376176D518B300161 + D65313F8C82EBB8E719F5006 + 71B93A65A95640972062EC29 + 0D723FDEF5CC9DBD086EAB39 + 9A489A5B6D91FD9AA80B1B50 + 47B228B88421B943C6005B10 + 5675366766067D60156EEAA1 + 1E0B27EFE9498593A53775FC + 32FFFCBE06BA47E77A58F52F + B1DC103317576FEAB1449D9F + 6BC3EB96204A30E4A472DDE4 + FADF4B43BFFF2AEF6F4A43B8 + 5D44D4115556BA5F81C67E07 + 4637476226C7CEC79C7DE49E + E5508477224F57D3312AC5B9 + 6707B683A72305367066EE6C + EDBE9B4FBE2888A89C7FAAAE + 8631A36CD036B7126537AE0B + F092F906C8A9E95FD09661CE + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 7DA2E9C4F2BA3289E2668E17 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.script.sh + path + Pods-resources.sh + sourceTree + <group> + + 7DE6E8E2D2109F67434864E2 + + fileRef + 068A30BD4A2404B5DAEBE221 + isa + PBXBuildFile + + 7E1B11B9B4C3FFCEFFD1F35D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTSparseArray.m + path + Base/RCTSparseArray.m + sourceTree + <group> + + 7EBF30F9E8C4AD6523928C97 + + fileRef + B70F784E53C151C33E1130FF + isa + PBXBuildFile + + 7EDCA4090C484196C36B1977 + + containerPortal + E88354D347CCC1EAC2E787C1 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 20F2231C1AEED2919F583DC7 + remoteInfo + Pods-ReactKit + + 80DBEC5108DFE1F49442F2F9 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text + name + Podfile + path + ../Podfile + sourceTree + SOURCE_ROOT + xcLanguageSpecificationIdentifier + xcode.lang.ruby + + 81A3FE9526EC90CC18E84790 + + fileRef + B42844BBEB0C3FCBB4CB7C98 + isa + PBXBuildFile + + 8307F3BCFAD957D08281164A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTTiming.m + path + Modules/RCTTiming.m + sourceTree + <group> + + 8399DB76B770CB32FA2CD5FF + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTKeyCommands.h + path + Base/RCTKeyCommands.h + sourceTree + <group> + + 83C5FDC3F8BE71F2109194A8 + + fileRef + DE4BA2446E5FB9E2F0C98C34 + isa + PBXBuildFile + + 84A6E86621CA19A1F15ECC01 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTRawTextManager.h + sourceTree + <group> + + 85336AD28D003EA10FC44AD9 + + isa + PBXTargetDependency + name + Pods-ReactKit + target + 20F2231C1AEED2919F583DC7 + targetProxy + 89109953D98B8498BE8FE817 + + 8631A36CD036B7126537AE0B + + fileRef + 6E38F96F68680D013AD0812A + isa + PBXBuildFile + + 88F100D7F9D61D558EF80D8A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTView.m + path + Views/RCTView.m + sourceTree + <group> + + 89109953D98B8498BE8FE817 + + containerPortal + E88354D347CCC1EAC2E787C1 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 20F2231C1AEED2919F583DC7 + remoteInfo + Pods-ReactKit + + 895928D325843E9D8B7285FA + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTImageDownloader.h + sourceTree + <group> + + 8C49B230561E49F529C012B5 + + fileRef + A3731A42F61C724D93CD6A2E + isa + PBXBuildFile + + 8E13E32022B45DA13AFC5404 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTConvert.m + path + Base/RCTConvert.m + sourceTree + <group> + + 8ECFD3E48BD636104455BB71 + + fileRef + E7FA1D0590C4CB610C0FECF2 + isa + PBXBuildFile + + 8F72A8B191D5505279E9254D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Pods-acknowledgements.plist + sourceTree + <group> + + 919FCDB927A3933126B3DCFE + + buildConfigurations + + 648F4790538BD82BF2B083EF + 5A541D6A294BA6E01BD0CD3A + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 932B25E8D26A525CAF6ABCC0 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + UIView+ReactKit.m + path + Views/UIView+ReactKit.m + sourceTree + <group> + + 943F495152CC9318EB9F83B1 + + fileRef + 5D5E4CDC94FE8212303F96ED + isa + PBXBuildFile + + 949E5950C7964E60EE8037C2 + + fileRef + 132DE36D6DB2D0F70C09CE89 + isa + PBXBuildFile + + 9659D9A2FEA529295FE42173 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTScrollView.m + path + Views/RCTScrollView.m + sourceTree + <group> + + 97138ACEE67BD2BDF8A3DEA0 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTRootView.m + path + Base/RCTRootView.m + sourceTree + <group> + + 97BAEC30E32259F061CCB7DE + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTTouchHandler.m + path + Base/RCTTouchHandler.m + sourceTree + <group> + + 97C2676E499C58904665B945 + + fileRef + 9AAFEB3BA8925E0E14AE9A9E + isa + PBXBuildFile + + 9A489A5B6D91FD9AA80B1B50 + + fileRef + E55746E91186F585B21DFB68 + isa + PBXBuildFile + + 9AAFEB3BA8925E0E14AE9A9E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTTiming.h + path + Modules/RCTTiming.h + sourceTree + <group> + + 9B18ECDA237344C06A230FB3 + + containerPortal + E88354D347CCC1EAC2E787C1 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 20F2231C1AEED2919F583DC7 + remoteInfo + Pods-ReactKit + + 9C1FE5B0BAC9A97A8309591C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTUIActivityIndicatorViewManager.m + path + Views/RCTUIActivityIndicatorViewManager.m + sourceTree + <group> + + 9C8A29CEE6A594FF4F429DB3 + + children + + 84A6E86621CA19A1F15ECC01 + 16E1299D87C2B7BE1D68024F + 44161614652ABCC200708F4A + 5F3DD45AD214483F15E95111 + FF03E617D571F159152581FC + 6DA156177295C36FC390E8E9 + 005E47CD37DA97006CE65B99 + 15478769A7025E67403CF8F6 + F213CCB9CD13022BCF3B8578 + DA90B4FBB6B34AAFB1C03F28 + DAC7254DBCF13C5C31A7AF31 + + isa + PBXGroup + name + RCTText + path + ../../../Libraries/Text + sourceTree + <group> + + 9E520B28129AD787FE9C67D8 + + fileRef + 6522F5D072C47020817339D9 + isa + PBXBuildFile + + 9FF2D7B800439FD8B4118089 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTWebViewExecutor.h + path + Executors/RCTWebViewExecutor.h + sourceTree + <group> + + A3731A42F61C724D93CD6A2E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-ReactKit-dummy.m + sourceTree + <group> + + A53374892CD6B26138B38ADB + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTStatusBarManager.m + path + Modules/RCTStatusBarManager.m + sourceTree + <group> + + A551474C8E2F85DBAEF20B96 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTImageDownloader.m + sourceTree + <group> + + A63CEAE583EF5324F7786345 + + fileRef + C9AA6ACBFD421C3D6FAC5329 + isa + PBXBuildFile + + A95BFEC22FBAC588E1B491ED + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTNetworkImage-Private.xcconfig + sourceTree + <group> + + A9BAD3EC8ABCA9694CAF96F7 + + fileRef + ACC753B0E880892739890CD6 + isa + PBXBuildFile + + A9CA493A1D0DBFFAC416CF2B + + buildActionMask + 2147483647 + files + + BE926BD26838E67A959563DD + F69EE0ADB66942B5A2F06409 + 0D4B28DA9FC2C4CB2B2874B3 + 7701A5C43F0A8424984C6A6A + F6129F258DCA7C19228C218D + D1ADF19017FFB8A53F8F0885 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + A9E3206FA20E2CAD15028412 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods.release.xcconfig + sourceTree + <group> + + AB98ECCECFE588B641E804DD + + children + + 895928D325843E9D8B7285FA + A551474C8E2F85DBAEF20B96 + 79ED42B49D21E04D9AA9DC7F + F6CC16FA65BD5A265088B6B6 + 78082D94239F5CEB5959B0B2 + 198FD8078EB2E34708CAF463 + 69220AD94D86BCE4FAE46678 + + isa + PBXGroup + name + RCTNetworkImage + path + ../../../Libraries/Image + sourceTree + <group> + + ABFBF65F5D61F7EA440E25A8 + + fileRef + 245789C2D4A68C88E27641D9 + isa + PBXBuildFile + + AC1A530CDB55406B05665766 + + fileRef + DD9C58FDC618EFB182668F97 + isa + PBXBuildFile + + ACC753B0E880892739890CD6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTEventDispatcher.h + path + Base/RCTEventDispatcher.h + sourceTree + <group> + + AF5A50F21A42CD8E0BBDF109 + + fileRef + 72B306867705C5CA14B74DF2 + isa + PBXBuildFile + + B1DC103317576FEAB1449D9F + + fileRef + 8307F3BCFAD957D08281164A + isa + PBXBuildFile + + B2D7892A9C3245D8D7431C23 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTTouchHandler.h + path + Base/RCTTouchHandler.h + sourceTree + <group> + + B32480BC0BA8A8BA551E9D00 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTTextFieldManager.h + path + Views/RCTTextFieldManager.h + sourceTree + <group> + + B32BDD61D5D87B095411A92F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-ReactKit.xcconfig + sourceTree + <group> + + B40A54F9CD6C17782376DE87 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTNavigator.h + path + Views/RCTNavigator.h + sourceTree + <group> + + B42844BBEB0C3FCBB4CB7C98 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTEventDispatcher.m + path + Base/RCTEventDispatcher.m + sourceTree + <group> + + B495C09D4F5093AAB731E194 + + isa + PBXTargetDependency + name + Pods-ReactKit + target + 20F2231C1AEED2919F583DC7 + targetProxy + 9B18ECDA237344C06A230FB3 + + B70F784E53C151C33E1130FF + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTNavigator.m + path + Views/RCTNavigator.m + sourceTree + <group> + + B9DEE348987356C83C27DD9E + + fileRef + 49199899EB7E17720A69A6A0 + isa + PBXBuildFile + + BB0B04F7F63902EED012528E + + fileRef + 491280116436017C4FEC9FD8 + isa + PBXBuildFile + + BCDC97F48090DACB87DEC04E + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-RCTNetworkImage.a + sourceTree + BUILT_PRODUCTS_DIR + + BD29342538528D6DE4038BD2 + + buildActionMask + 2147483647 + files + + A63CEAE583EF5324F7786345 + D3EA0626B08FB41301B71BA7 + 411AACA7B5F606DA03793980 + E2BA10A9D9813750516AA99F + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + BD88172D1A926B95F1965628 + + fileRef + 5D5E4CDC94FE8212303F96ED + isa + PBXBuildFile + + BE52F839238A59D2AB82159E + + fileRef + 4648080B27A50C8D028851B3 + isa + PBXBuildFile + + BE926BD26838E67A959563DD + + fileRef + E68B47098BE36BB1B90E7BD6 + isa + PBXBuildFile + + BFEF41FE0A9C6E4BF083A1C4 + + fileRef + F213CCB9CD13022BCF3B8578 + isa + PBXBuildFile + + C043A8B738F0E880E4E71CF4 + + buildActionMask + 2147483647 + files + + F7531B3CBFEDA85A72BF6805 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + C07D1DDFE8D93ECEDF0E97C1 + + fileRef + 6C5C7F49C76DFD009CE24F54 + isa + PBXBuildFile + + C09FDA6F8073916E1DC7FB77 + + children + + B32BDD61D5D87B095411A92F + 430F4C781E2E7EE9F8CB83FD + A3731A42F61C724D93CD6A2E + FDBD9515B1715137A4E1AD37 + + isa + PBXGroup + name + Support Files + path + ../Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit + sourceTree + <group> + + C23EA0774A0BD0ACB68E5B0F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTView.h + path + Views/RCTView.h + sourceTree + <group> + + C426A0F89138E32710FFDBCD + + children + + 80DBEC5108DFE1F49442F2F9 + FE1E926B5C3C10CA3797023E + C521253141932511E561C093 + 6BEE757D0B19EB927C04C0FA + 427D3517A7FBC3A92AF9E9D4 + + isa + PBXGroup + sourceTree + <group> + + C521253141932511E561C093 + + children + + D503EB0531912E6E58954932 + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + C575BB07E7B92FA3EBC10949 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-ReactKit.a + sourceTree + BUILT_PRODUCTS_DIR + + C618E1B2CFF909C6273ABD4D + + fileRef + C23EA0774A0BD0ACB68E5B0F + isa + PBXBuildFile + + C77D22DADA6D43EC7CC8478A + + fileRef + 175C559D2A89B7FC27EFD6C5 + isa + PBXBuildFile + + C8F7D06CE3D7F4FDED21933F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-RCTNetworkImage-prefix.pch + sourceTree + <group> + + C9AA6ACBFD421C3D6FAC5329 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-RCTNetworkImage-dummy.m + sourceTree + <group> + + CCCA2CC55157BFF72767CEAB + + baseConfigurationReference + A95BFEC22FBAC588E1B491ED + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + CDCB9B4306F2967192C1DAAA + + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + CLANG_CXX_LANGUAGE_STANDARD + gnu++0x + CLANG_CXX_LIBRARY + libc++ + CLANG_ENABLE_MODULES + YES + CLANG_ENABLE_OBJC_ARC + YES + CLANG_WARN_BOOL_CONVERSION + YES + CLANG_WARN_CONSTANT_CONVERSION + YES + CLANG_WARN_DIRECT_OBJC_ISA_USAGE + YES + CLANG_WARN_EMPTY_BODY + YES + CLANG_WARN_ENUM_CONVERSION + YES + CLANG_WARN_INT_CONVERSION + YES + CLANG_WARN_OBJC_ROOT_CLASS + YES + COPY_PHASE_STRIP + YES + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + GCC_WARN_64_TO_32_BIT_CONVERSION + YES + GCC_WARN_ABOUT_RETURN_TYPE + YES + GCC_WARN_UNDECLARED_SELECTOR + YES + GCC_WARN_UNINITIALIZED_AUTOS + YES + GCC_WARN_UNUSED_FUNCTION + YES + GCC_WARN_UNUSED_VARIABLE + YES + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + ONLY_ACTIVE_ARCH + YES + STRIP_INSTALLED_PRODUCT + NO + + isa + XCBuildConfiguration + name + Debug + + CEAD6D174912D6D124A031D9 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTAutoInsetsProtocol.h + path + Base/RCTAutoInsetsProtocol.h + sourceTree + <group> + + CEDE7930A786744ACDE6592B + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-RCTText-prefix.pch + sourceTree + <group> + + D0F5EC95B7EE03515326948E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTCache.h + path + Base/RCTCache.h + sourceTree + <group> + + D1ADF19017FFB8A53F8F0885 + + fileRef + DA90B4FBB6B34AAFB1C03F28 + isa + PBXBuildFile + + D3EA0626B08FB41301B71BA7 + + fileRef + A551474C8E2F85DBAEF20B96 + isa + PBXBuildFile + + D43D7636AEF4C472723FF075 + + buildConfigurations + + 772EDE81A05CD3EA28A869CC + 320294F910FF631F87E183B5 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + D4D507D020AD79183E1DD916 + + fileRef + 48039B7A25006CE8F45E9619 + isa + PBXBuildFile + + D503EB0531912E6E58954932 + + children + + 5D5E4CDC94FE8212303F96ED + + isa + PBXGroup + name + iOS + sourceTree + <group> + + D65313F8C82EBB8E719F5006 + + fileRef + 530A6D73CAFF37DCB5A52103 + isa + PBXBuildFile + + D879CE28A1189AB3CA754538 + + fileRef + 7308A06BDA47FB20E2FC8005 + isa + PBXBuildFile + + DA90B4FBB6B34AAFB1C03F28 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTTextManager.m + sourceTree + <group> + + DAC7254DBCF13C5C31A7AF31 + + children + + 391E46E8F975CA6362AB5DE5 + 504F7E363A7AFC9A64B86154 + E68B47098BE36BB1B90E7BD6 + CEDE7930A786744ACDE6592B + + isa + PBXGroup + name + Support Files + path + ../../Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText + sourceTree + <group> + + DD1AEBDB914EF5C49CAAEB46 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTJavaScriptExecutor.h + path + Base/RCTJavaScriptExecutor.h + sourceTree + <group> + + DD9C58FDC618EFB182668F97 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTNavItem.m + path + Views/RCTNavItem.m + sourceTree + <group> + + DDEDAE8AD808715BBCF5DC6C + + buildActionMask + 2147483647 + files + + BD88172D1A926B95F1965628 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + DE4BA2446E5FB9E2F0C98C34 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTRedBox.h + path + Base/RCTRedBox.h + sourceTree + <group> + + DEA6A4B98EA82BEDE81ED513 + + buildActionMask + 2147483647 + files + + 943F495152CC9318EB9F83B1 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + DF17E391C45D5B66999F6D99 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTKeyCommands.m + path + Base/RCTKeyCommands.m + sourceTree + <group> + + DFEDA529E62F398E0E66A864 + + baseConfigurationReference + A95BFEC22FBAC588E1B491ED + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + E00F5EA71F725792D7FE1C0F + + children + + E9A7A3D5EC8AAF878D6A2CBE + 491280116436017C4FEC9FD8 + E7FA1D0590C4CB610C0FECF2 + 132DE36D6DB2D0F70C09CE89 + 26C00EEFB778EFB7A6703E20 + 6FCFD749EEB3861EB75C0534 + 4648080B27A50C8D028851B3 + CEAD6D174912D6D124A031D9 + 0524E24381502D7EB46CCF29 + 3D3089A4A62A68E4D5BB4562 + EE90F905D6EA51C12DA5F4ED + D0F5EC95B7EE03515326948E + 3CC9DC0433D77149CC4DE5DE + 289322DAF960C6BD7F2FD8E1 + 22669B7FF7DBBF51202945CD + 7308A06BDA47FB20E2FC8005 + 8E13E32022B45DA13AFC5404 + ACC753B0E880892739890CD6 + B42844BBEB0C3FCBB4CB7C98 + 27F37EEF056BA05A9FE6548A + 2DA5F87EA2CDCEA0ED668578 + 6522F5D072C47020817339D9 + E5FC33A15846273C981E0322 + DD1AEBDB914EF5C49CAAEB46 + 8399DB76B770CB32FA2CD5FF + DF17E391C45D5B66999F6D99 + 16B69D05ABC152C41B9129FB + 2F6BBA653E86409B28911661 + 3FDDE45F64AE789BEAED2125 + DD9C58FDC618EFB182668F97 + 49199899EB7E17720A69A6A0 + 72B306867705C5CA14B74DF2 + B40A54F9CD6C17782376DE87 + B70F784E53C151C33E1130FF + 77AEC7F8659C91198FFFF673 + 12FAC13993C100C3FDBD0DD8 + 54481109ECD4CD40F5F746F8 + DE4BA2446E5FB9E2F0C98C34 + 6AC9ACC04495648FA5060FCD + 6C5C7F49C76DFD009CE24F54 + 97138ACEE67BD2BDF8A3DEA0 + 245789C2D4A68C88E27641D9 + 9659D9A2FEA529295FE42173 + E991F096165FA74435C7282D + 530A6D73CAFF37DCB5A52103 + 15D063218D733290ACAF6ECD + 068A30BD4A2404B5DAEBE221 + 45775545A25B55D8FF631FF5 + 6C59A8B8703F0BD79C458591 + 7E1B11B9B4C3FFCEFFD1F35D + 2461A7AF21FB638CED912FE3 + E55746E91186F585B21DFB68 + 3F06663863E59C187B84EAD2 + F731109AFE06344ABBC4BBE6 + 5A8146BE2B9A4E8B080899C7 + A53374892CD6B26138B38ADB + F6F6566819F8D0B545E28AC4 + FCAC9AFE3E61C78E93EA7E8C + B32480BC0BA8A8BA551E9D00 + 22CB86FDC9D99844724FDDD3 + 9AAFEB3BA8925E0E14AE9A9E + 8307F3BCFAD957D08281164A + B2D7892A9C3245D8D7431C23 + 97BAEC30E32259F061CCB7DE + 2E00E46C249C163EBC0418DC + 9C1FE5B0BAC9A97A8309591C + 02011DF072CE86BD3AD237F3 + EA77880FBBE6AA7511841605 + 42FCE12743FD1B4702208E0D + 1568A6E0A0EFBABC6271F94D + C23EA0774A0BD0ACB68E5B0F + 88F100D7F9D61D558EF80D8A + 3938293AC4D9C3C8B8DDFDC7 + 33E69C46AB97309D4EBFA432 + 175C559D2A89B7FC27EFD6C5 + 9FF2D7B800439FD8B4118089 + 0678F15E5799E801FBBB82EE + 569C3E0B54CE022FD9433B66 + 6E38F96F68680D013AD0812A + 48039B7A25006CE8F45E9619 + 932B25E8D26A525CAF6ABCC0 + C09FDA6F8073916E1DC7FB77 + + isa + PBXGroup + name + ReactKit + path + ../../../ReactKit + sourceTree + <group> + + E1C485676C801FFCB46D93D0 + + fileRef + 77AEC7F8659C91198FFFF673 + isa + PBXBuildFile + + E1C5A97B9865CABC567B000A + + containerPortal + E88354D347CCC1EAC2E787C1 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + F5D2C09AFAA6986D234BF953 + remoteInfo + Pods-RCTText + + E2BA10A9D9813750516AA99F + + fileRef + 198FD8078EB2E34708CAF463 + isa + PBXBuildFile + + E484553771DAF5F08178C966 + + buildConfigurations + + EF728A6C52298117E9505250 + 2A5A7AE725AB3B07B61A40E9 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + E52753A376176D518B300161 + + fileRef + 9659D9A2FEA529295FE42173 + isa + PBXBuildFile + + E5508477224F57D3312AC5B9 + + fileRef + 88F100D7F9D61D558EF80D8A + isa + PBXBuildFile + + E55746E91186F585B21DFB68 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTStaticImage.m + path + Views/RCTStaticImage.m + sourceTree + <group> + + E5FC33A15846273C981E0322 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTJSMethodRegistrar.h + path + Base/RCTJSMethodRegistrar.h + sourceTree + <group> + + E68B47098BE36BB1B90E7BD6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-RCTText-dummy.m + sourceTree + <group> + + E7FA1D0590C4CB610C0FECF2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTAlertManager.h + path + Modules/RCTAlertManager.h + sourceTree + <group> + + E88354D347CCC1EAC2E787C1 + + attributes + + LastUpgradeCheck + 0510 + + buildConfigurationList + 6D757E59E707D9B3474721D7 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + + mainGroup + C426A0F89138E32710FFDBCD + productRefGroup + 6BEE757D0B19EB927C04C0FA + projectDirPath + + projectReferences + + projectRoot + + targets + + 156E154B035C85C750DA3DE2 + 76D2A8D67E04D111A7938CED + F5D2C09AFAA6986D234BF953 + 20F2231C1AEED2919F583DC7 + + + E991F096165FA74435C7282D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTScrollViewManager.h + path + Views/RCTScrollViewManager.h + sourceTree + <group> + + E9A7A3D5EC8AAF878D6A2CBE + + includeInIndex + 1 + isa + PBXFileReference + name + Layout.c + path + Layout/Layout.c + sourceTree + <group> + + EA77880FBBE6AA7511841605 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTUIManager.m + path + Modules/RCTUIManager.m + sourceTree + <group> + + EA79968832417354B40F6352 + + fileRef + EE90F905D6EA51C12DA5F4ED + isa + PBXBuildFile + + EA7CC42518555EE2C4B617E3 + + buildActionMask + 2147483647 + files + + FBE4E83A8EF948FF337B2436 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + EC5F81AEBB86DCC1C9ECDE59 + + fileRef + 3D3089A4A62A68E4D5BB4562 + isa + PBXBuildFile + + ED09FCD5EBB9DAA998867B1F + + fileRef + 84A6E86621CA19A1F15ECC01 + isa + PBXBuildFile + + EDBE5D54C93BC128C25036AD + + isa + PBXTargetDependency + name + Pods-RCTNetworkImage + target + 76D2A8D67E04D111A7938CED + targetProxy + 6499B8CCEC40B282FFAADFA6 + + EDBE9B4FBE2888A89C7FAAAE + + fileRef + 0678F15E5799E801FBBB82EE + isa + PBXBuildFile + + EE90F905D6EA51C12DA5F4ED + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTBridgeModule.h + path + Base/RCTBridgeModule.h + sourceTree + <group> + + EF728A6C52298117E9505250 + + baseConfigurationReference + 6C4193D7074A9FE2AADD31C2 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + F069246D046DFFE7CF05DE92 + + fileRef + 42FCE12743FD1B4702208E0D + isa + PBXBuildFile + + F092F906C8A9E95FD09661CE + + fileRef + 932B25E8D26A525CAF6ABCC0 + isa + PBXBuildFile + + F213CCB9CD13022BCF3B8578 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTTextManager.h + sourceTree + <group> + + F5D2C09AFAA6986D234BF953 + + buildConfigurationList + D43D7636AEF4C472723FF075 + buildPhases + + A9CA493A1D0DBFFAC416CF2B + EA7CC42518555EE2C4B617E3 + 03219EE301E4BE34C4E26BF5 + + buildRules + + dependencies + + 60662361B9CC9A2A8D49F638 + + isa + PBXNativeTarget + name + Pods-RCTText + productName + Pods-RCTText + productReference + 39206929A27DEBF5CBACB942 + productType + com.apple.product-type.library.static + + F6129F258DCA7C19228C218D + + fileRef + 15478769A7025E67403CF8F6 + isa + PBXBuildFile + + F68991A42B4CF608AF91EBB5 + + fileRef + 54481109ECD4CD40F5F746F8 + isa + PBXBuildFile + + F69EE0ADB66942B5A2F06409 + + fileRef + 16E1299D87C2B7BE1D68024F + isa + PBXBuildFile + + F6CC16FA65BD5A265088B6B6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTNetworkImageView.m + sourceTree + <group> + + F6F6566819F8D0B545E28AC4 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTTextField.h + path + Views/RCTTextField.h + sourceTree + <group> + + F731109AFE06344ABBC4BBE6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTStaticImageManager.m + path + Views/RCTStaticImageManager.m + sourceTree + <group> + + F7531B3CBFEDA85A72BF6805 + + fileRef + 054AB43B546728B2ACD9DE38 + isa + PBXBuildFile + + F9ECFBDEC272AF69A54935F9 + + fileRef + 3FDDE45F64AE789BEAED2125 + isa + PBXBuildFile + + FADF4B43BFFF2AEF6F4A43B8 + + fileRef + 9C1FE5B0BAC9A97A8309591C + isa + PBXBuildFile + + FAE203974E438996878047C2 + + fileRef + 8399DB76B770CB32FA2CD5FF + isa + PBXBuildFile + + FB19B6A03634D6CC16E8D731 + + fileRef + E9A7A3D5EC8AAF878D6A2CBE + isa + PBXBuildFile + + FBE4E83A8EF948FF337B2436 + + fileRef + 5D5E4CDC94FE8212303F96ED + isa + PBXBuildFile + + FCAC9AFE3E61C78E93EA7E8C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTTextField.m + path + Views/RCTTextField.m + sourceTree + <group> + + FDBD9515B1715137A4E1AD37 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-ReactKit-prefix.pch + sourceTree + <group> + + FE1E926B5C3C10CA3797023E + + children + + AB98ECCECFE588B641E804DD + 9C8A29CEE6A594FF4F429DB3 + E00F5EA71F725792D7FE1C0F + + isa + PBXGroup + name + Development Pods + sourceTree + <group> + + FF03E617D571F159152581FC + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTShadowText.h + sourceTree + <group> + + + rootObject + E88354D347CCC1EAC2E787C1 + + diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-Private.xcconfig b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-Private.xcconfig new file mode 100644 index 000000000..77326a26a --- /dev/null +++ b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-Private.xcconfig @@ -0,0 +1,5 @@ +#include "Pods-RCTNetworkImage.xcconfig" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/RCTNetworkImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" +OTHER_LDFLAGS = -ObjC +PODS_ROOT = ${SRCROOT} \ No newline at end of file diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-dummy.m b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-dummy.m new file mode 100644 index 000000000..04c9099fa --- /dev/null +++ b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_RCTNetworkImage : NSObject +@end +@implementation PodsDummy_Pods_RCTNetworkImage +@end diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch new file mode 100644 index 000000000..95cf11d9f --- /dev/null +++ b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch @@ -0,0 +1,5 @@ +#ifdef __OBJC__ +#import +#endif + +#import "Pods-environment.h" diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage.xcconfig b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage.xcconfig new file mode 100644 index 000000000..e69de29bb diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-Private.xcconfig b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-Private.xcconfig new file mode 100644 index 000000000..5e8e883ba --- /dev/null +++ b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-Private.xcconfig @@ -0,0 +1,5 @@ +#include "Pods-RCTText.xcconfig" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/RCTText" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" +OTHER_LDFLAGS = -ObjC +PODS_ROOT = ${SRCROOT} \ No newline at end of file diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-dummy.m b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-dummy.m new file mode 100644 index 000000000..0ee407269 --- /dev/null +++ b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_RCTText : NSObject +@end +@implementation PodsDummy_Pods_RCTText +@end diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch new file mode 100644 index 000000000..95cf11d9f --- /dev/null +++ b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch @@ -0,0 +1,5 @@ +#ifdef __OBJC__ +#import +#endif + +#import "Pods-environment.h" diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText.xcconfig b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText.xcconfig new file mode 100644 index 000000000..e69de29bb diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-Private.xcconfig b/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-Private.xcconfig new file mode 100644 index 000000000..5ad122e34 --- /dev/null +++ b/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-Private.xcconfig @@ -0,0 +1,5 @@ +#include "Pods-ReactKit.xcconfig" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/ReactKit" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" +OTHER_LDFLAGS = -ObjC +PODS_ROOT = ${SRCROOT} \ No newline at end of file diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-dummy.m b/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-dummy.m new file mode 100644 index 000000000..ab3f82b8c --- /dev/null +++ b/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_ReactKit : NSObject +@end +@implementation PodsDummy_Pods_ReactKit +@end diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch b/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch new file mode 100644 index 000000000..95cf11d9f --- /dev/null +++ b/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch @@ -0,0 +1,5 @@ +#ifdef __OBJC__ +#import +#endif + +#import "Pods-environment.h" diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit.xcconfig b/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit.xcconfig new file mode 100644 index 000000000..e69de29bb diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown new file mode 100644 index 000000000..255149a82 --- /dev/null +++ b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown @@ -0,0 +1,3 @@ +# Acknowledgements +This application makes use of the following third party libraries: +Generated by CocoaPods - http://cocoapods.org diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-acknowledgements.plist b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-acknowledgements.plist new file mode 100644 index 000000000..e4edebe92 --- /dev/null +++ b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-acknowledgements.plist @@ -0,0 +1,29 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - http://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-dummy.m b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-dummy.m new file mode 100644 index 000000000..ade64bd1a --- /dev/null +++ b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods : NSObject +@end +@implementation PodsDummy_Pods +@end diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-environment.h b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-environment.h new file mode 100644 index 000000000..ef6a41b65 --- /dev/null +++ b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-environment.h @@ -0,0 +1,26 @@ + +// To check if a library is compiled with CocoaPods you +// can use the `COCOAPODS` macro definition which is +// defined in the xcconfigs so it is available in +// headers also when they are imported in the client +// project. + + +// RCTNetworkImage +#define COCOAPODS_POD_AVAILABLE_RCTNetworkImage +#define COCOAPODS_VERSION_MAJOR_RCTNetworkImage 0 +#define COCOAPODS_VERSION_MINOR_RCTNetworkImage 0 +#define COCOAPODS_VERSION_PATCH_RCTNetworkImage 1 + +// RCTText +#define COCOAPODS_POD_AVAILABLE_RCTText +#define COCOAPODS_VERSION_MAJOR_RCTText 0 +#define COCOAPODS_VERSION_MINOR_RCTText 0 +#define COCOAPODS_VERSION_PATCH_RCTText 1 + +// ReactKit +#define COCOAPODS_POD_AVAILABLE_ReactKit +#define COCOAPODS_VERSION_MAJOR_ReactKit 0 +#define COCOAPODS_VERSION_MINOR_ReactKit 0 +#define COCOAPODS_VERSION_PATCH_ReactKit 1 + diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-resources.sh b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-resources.sh new file mode 100755 index 000000000..e149064a0 --- /dev/null +++ b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-resources.sh @@ -0,0 +1,74 @@ +#!/bin/sh +set -e + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +install_resource() +{ + case $1 in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.framework) + echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" + xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ;; + /*) + echo "$1" + echo "$1" >> "$RESOURCES_TO_COPY" + ;; + *) + echo "${PODS_ROOT}/$1" + echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]]; then + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ `find . -name '*.xcassets' | wc -l` -ne 0 ] +then + case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; + esac + find "${PWD}" -name "*.xcassets" -print0 | xargs -0 actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods.debug.xcconfig b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods.debug.xcconfig new file mode 100644 index 000000000..7e075cbab --- /dev/null +++ b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods.debug.xcconfig @@ -0,0 +1,6 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" +OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/RCTNetworkImage" -isystem "${PODS_ROOT}/Headers/Public/RCTText" -isystem "${PODS_ROOT}/Headers/Public/ReactKit" +OTHER_LDFLAGS = -ObjC -l"Pods-RCTNetworkImage" -l"Pods-RCTText" -l"Pods-ReactKit" +OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods.release.xcconfig b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods.release.xcconfig new file mode 100644 index 000000000..7e075cbab --- /dev/null +++ b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods.release.xcconfig @@ -0,0 +1,6 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" +OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/RCTNetworkImage" -isystem "${PODS_ROOT}/Headers/Public/RCTText" -isystem "${PODS_ROOT}/Headers/Public/ReactKit" +OTHER_LDFLAGS = -ObjC -l"Pods-RCTNetworkImage" -l"Pods-RCTText" -l"Pods-ReactKit" +OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj b/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj index 646876092..aed93cd37 100644 --- a/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj +++ b/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj @@ -11,19 +11,9 @@ 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 8323482C1A77B59500B55238 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832348291A77B50100B55238 /* libReactKit.a */; }; + 94A5470E6B9ACC86C8946DD4 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 57D137B3557DA44DA129DF68 /* libPods.a */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 832348281A77B50100B55238 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 834D32361A76971A00F38302 /* ReactKit.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; - remoteInfo = ReactKit; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXFileReference section */ 13B07F961A680F5B00A75B9A /* TicTacToe.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TicTacToe.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; @@ -32,7 +22,9 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 834D32361A76971A00F38302 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = ""; }; + 57D137B3557DA44DA129DF68 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + AE37E9319424945F93F61AC9 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + BE166B25F931D53146DC44FD /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -40,7 +32,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 8323482C1A77B59500B55238 /* libReactKit.a in Frameworks */, + 94A5470E6B9ACC86C8946DD4 /* libPods.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -60,20 +52,21 @@ name = TicTacToe; sourceTree = ""; }; - 832348241A77B50100B55238 /* Products */ = { + 626AAA547F04E200EB1B13D5 /* Frameworks */ = { isa = PBXGroup; children = ( - 832348291A77B50100B55238 /* libReactKit.a */, + 57D137B3557DA44DA129DF68 /* libPods.a */, ); - name = Products; + name = Frameworks; sourceTree = ""; }; 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( - 834D32361A76971A00F38302 /* ReactKit.xcodeproj */, 13B07FAE1A68108700A75B9A /* TicTacToe */, 83CBBA001A601CBA00E9B192 /* Products */, + C661FA21FC43E8C4E3D76705 /* Pods */, + 626AAA547F04E200EB1B13D5 /* Frameworks */, ); sourceTree = ""; }; @@ -85,6 +78,15 @@ name = Products; sourceTree = ""; }; + C661FA21FC43E8C4E3D76705 /* Pods */ = { + isa = PBXGroup; + children = ( + AE37E9319424945F93F61AC9 /* Pods.debug.xcconfig */, + BE166B25F931D53146DC44FD /* Pods.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -92,9 +94,11 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "TicTacToe" */; buildPhases = ( + 1604B0DABE720C58B4BD7B85 /* Check Pods Manifest.lock */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, + 90FB29DB1D5DDA0C9E91F4D0 /* Copy Pods Resources */, ); buildRules = ( ); @@ -125,12 +129,6 @@ mainGroup = 83CBB9F61A601CBA00E9B192; productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 832348241A77B50100B55238 /* Products */; - ProjectRef = 834D32361A76971A00F38302 /* ReactKit.xcodeproj */; - }, - ); projectRoot = ""; targets = ( 13B07F861A680F5B00A75B9A /* TicTacToe */, @@ -138,16 +136,6 @@ }; /* End PBXProject section */ -/* Begin PBXReferenceProxy section */ - 832348291A77B50100B55238 /* libReactKit.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libReactKit.a; - remoteRef = 832348281A77B50100B55238 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - /* Begin PBXResourcesBuildPhase section */ 13B07F8E1A680F5B00A75B9A /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -160,6 +148,39 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 1604B0DABE720C58B4BD7B85 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 90FB29DB1D5DDA0C9E91F4D0 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 13B07F871A680F5B00A75B9A /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -186,22 +207,22 @@ /* Begin XCBuildConfiguration section */ 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = AE37E9319424945F93F61AC9 /* Pods.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = TicTacToe; }; name = Debug; }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = BE166B25F931D53146DC44FD /* Pods.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = TicTacToe; }; name = Release; diff --git a/Examples/TicTacToe/TicTacToe.xcworkspace/contents.xcworkspacedata b/Examples/TicTacToe/TicTacToe.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..ff1c005b3 --- /dev/null +++ b/Examples/TicTacToe/TicTacToe.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Examples/UIExplorer/TextInputExample.js b/Examples/UIExplorer/TextInputExample.js index 656ccd4fc..e10dbc0f1 100644 --- a/Examples/UIExplorer/TextInputExample.js +++ b/Examples/UIExplorer/TextInputExample.js @@ -185,4 +185,37 @@ exports.examples = [ ); } }, + { + title: 'Clear button mode', + render: function () { + return ( + + + + + + + + + + + + + + + ); + } + }, ]; diff --git a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj index 73048cad9..798c95a21 100644 --- a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj +++ b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj @@ -11,17 +11,62 @@ 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 8323482C1A77B59500B55238 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832348291A77B50100B55238 /* libReactKit.a */; }; + 587651361A9EB175008B8F17 /* libRCTNetworkImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587651281A9EB168008B8F17 /* libRCTNetworkImage.a */; }; + 587651371A9EB175008B8F17 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587651301A9EB168008B8F17 /* libRCTText.a */; }; + 587651381A9EB175008B8F17 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587651351A9EB168008B8F17 /* libReactKit.a */; }; + 587651571A9F862F008B8F17 /* libRCTDataManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5876514F1A9F8619008B8F17 /* libRCTDataManager.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 832348281A77B50100B55238 /* PBXContainerItemProxy */ = { + 587651271A9EB168008B8F17 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 834D32361A76971A00F38302 /* ReactKit.xcodeproj */; + containerPortal = 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B5115D1A9E6B3D00147676; + remoteInfo = RCTNetworkImage; + }; + 587651291A9EB168008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511681A9E6B3D00147676; + remoteInfo = RCTNetworkImageTests; + }; + 5876512F1A9EB168008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B5119B1A9E6C1200147676; + remoteInfo = RCTText; + }; + 587651311A9EB168008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511A61A9E6C1300147676; + remoteInfo = RCTTextTests; + }; + 587651341A9EB168008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587651221A9EB168008B8F17 /* ReactKit.xcodeproj */; proxyType = 2; remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; remoteInfo = ReactKit; }; + 5876514E1A9F8619008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511DB1A9E6C8500147676; + remoteInfo = RCTDataManager; + }; + 587651501A9F8619008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511E61A9E6C8500147676; + remoteInfo = RCTDataManagerTests; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -32,7 +77,10 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 834D32361A76971A00F38302 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = ""; }; + 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetworkImage.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../Image/RCTNetworkImage.xcodeproj"; sourceTree = ""; }; + 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../Text/RCTText.xcodeproj"; sourceTree = ""; }; + 587651221A9EB168008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../../ReactKit/ReactKit.xcodeproj"; sourceTree = ""; }; + 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTDataManager.xcodeproj; path = ../../Libraries/Network/RCTDataManager.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -40,7 +88,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 8323482C1A77B59500B55238 /* libReactKit.a in Frameworks */, + 587651571A9F862F008B8F17 /* libRCTDataManager.a in Frameworks */, + 587651361A9EB175008B8F17 /* libRCTNetworkImage.a in Frameworks */, + 587651371A9EB175008B8F17 /* libRCTText.a in Frameworks */, + 587651381A9EB175008B8F17 /* libReactKit.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -60,10 +111,37 @@ name = UIExplorer; sourceTree = ""; }; - 832348241A77B50100B55238 /* Products */ = { + 5876511D1A9EB168008B8F17 /* Products */ = { isa = PBXGroup; children = ( - 832348291A77B50100B55238 /* libReactKit.a */, + 587651281A9EB168008B8F17 /* libRCTNetworkImage.a */, + 5876512A1A9EB168008B8F17 /* RCTNetworkImageTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 587651201A9EB168008B8F17 /* Products */ = { + isa = PBXGroup; + children = ( + 587651301A9EB168008B8F17 /* libRCTText.a */, + 587651321A9EB168008B8F17 /* RCTTextTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 587651231A9EB168008B8F17 /* Products */ = { + isa = PBXGroup; + children = ( + 587651351A9EB168008B8F17 /* libReactKit.a */, + ); + name = Products; + sourceTree = ""; + }; + 5876514A1A9F8619008B8F17 /* Products */ = { + isa = PBXGroup; + children = ( + 5876514F1A9F8619008B8F17 /* libRCTDataManager.a */, + 587651511A9F8619008B8F17 /* RCTDataManagerTests.xctest */, ); name = Products; sourceTree = ""; @@ -71,8 +149,11 @@ 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( - 834D32361A76971A00F38302 /* ReactKit.xcodeproj */, 13B07FAE1A68108700A75B9A /* UIExplorer */, + 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */, + 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */, + 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */, + 587651221A9EB168008B8F17 /* ReactKit.xcodeproj */, 83CBBA001A601CBA00E9B192 /* Products */, ); sourceTree = ""; @@ -127,8 +208,20 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 832348241A77B50100B55238 /* Products */; - ProjectRef = 834D32361A76971A00F38302 /* ReactKit.xcodeproj */; + ProductGroup = 5876514A1A9F8619008B8F17 /* Products */; + ProjectRef = 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */; + }, + { + ProductGroup = 5876511D1A9EB168008B8F17 /* Products */; + ProjectRef = 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */; + }, + { + ProductGroup = 587651201A9EB168008B8F17 /* Products */; + ProjectRef = 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */; + }, + { + ProductGroup = 587651231A9EB168008B8F17 /* Products */; + ProjectRef = 587651221A9EB168008B8F17 /* ReactKit.xcodeproj */; }, ); projectRoot = ""; @@ -139,11 +232,53 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 832348291A77B50100B55238 /* libReactKit.a */ = { + 587651281A9EB168008B8F17 /* libRCTNetworkImage.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTNetworkImage.a; + remoteRef = 587651271A9EB168008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5876512A1A9EB168008B8F17 /* RCTNetworkImageTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = RCTNetworkImageTests.xctest; + remoteRef = 587651291A9EB168008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 587651301A9EB168008B8F17 /* libRCTText.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTText.a; + remoteRef = 5876512F1A9EB168008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 587651321A9EB168008B8F17 /* RCTTextTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = RCTTextTests.xctest; + remoteRef = 587651311A9EB168008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 587651351A9EB168008B8F17 /* libReactKit.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libReactKit.a; - remoteRef = 832348281A77B50100B55238 /* PBXContainerItemProxy */; + remoteRef = 587651341A9EB168008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5876514F1A9F8619008B8F17 /* libRCTDataManager.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTDataManager.a; + remoteRef = 5876514E1A9F8619008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 587651511A9F8619008B8F17 /* RCTDataManagerTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = RCTDataManagerTests.xctest; + remoteRef = 587651501A9F8619008B8F17 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -188,6 +323,12 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + "$(SRCROOT)/../../ReactKitModules/**", + ); INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = "-ObjC"; @@ -199,6 +340,12 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + "$(SRCROOT)/../../ReactKitModules/**", + ); INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = "-ObjC"; diff --git a/Libraries/Components/Image/Image.ios.js b/Libraries/Image/Image.ios.js similarity index 100% rename from Libraries/Components/Image/Image.ios.js rename to Libraries/Image/Image.ios.js diff --git a/Libraries/Components/Image/ImageResizeMode.js b/Libraries/Image/ImageResizeMode.js similarity index 100% rename from Libraries/Components/Image/ImageResizeMode.js rename to Libraries/Image/ImageResizeMode.js diff --git a/Libraries/Components/Image/ImageSourcePropType.js b/Libraries/Image/ImageSourcePropType.js similarity index 100% rename from Libraries/Components/Image/ImageSourcePropType.js rename to Libraries/Image/ImageSourcePropType.js diff --git a/Libraries/Components/Image/ImageStylePropTypes.js b/Libraries/Image/ImageStylePropTypes.js similarity index 100% rename from Libraries/Components/Image/ImageStylePropTypes.js rename to Libraries/Image/ImageStylePropTypes.js diff --git a/Libraries/Image/RCTImageDownloader.h b/Libraries/Image/RCTImageDownloader.h new file mode 100644 index 000000000..b525ea1a7 --- /dev/null +++ b/Libraries/Image/RCTImageDownloader.h @@ -0,0 +1,22 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +typedef void (^RCTDataDownloadBlock)(NSData *data, NSError *error); +typedef void (^RCTImageDownloadBlock)(UIImage *image, NSError *error); + +@interface RCTImageDownloader : NSObject + ++ (instancetype)sharedInstance; + +- (id)downloadDataForURL:(NSURL *)url + block:(RCTDataDownloadBlock)block; + +- (id)downloadImageForURL:(NSURL *)url + size:(CGSize)size + scale:(CGFloat)scale + block:(RCTImageDownloadBlock)block; + +- (void)cancelDownload:(id)downloadToken; + +@end diff --git a/ReactKit/Base/RCTImageDownloader.m b/Libraries/Image/RCTImageDownloader.m similarity index 100% rename from ReactKit/Base/RCTImageDownloader.m rename to Libraries/Image/RCTImageDownloader.m diff --git a/Libraries/Image/RCTNetworkImage.podspec b/Libraries/Image/RCTNetworkImage.podspec new file mode 100644 index 000000000..47eb0e5f6 --- /dev/null +++ b/Libraries/Image/RCTNetworkImage.podspec @@ -0,0 +1,28 @@ +Pod::Spec.new do |spec| + spec.name = 'RCTNetworkImage' + spec.version = '0.0.1' + spec.summary = 'Provides basic Text capabilities in ReactNative apps.' + spec.description = <<-DESC + Text can be rendered in ReactNative apps with the component using this module. + DESC + spec.homepage = 'https://facebook.github.io/react-native/' + spec.license = { :type => 'BSD' } + spec.author = 'Facebook' + spec.platform = :ios, '7.0' + spec.requires_arc = true + spec.source_files = '**/*.{h,m,c}' + spec.dependency "ReactKit", "~> 0.0.1" + + # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Link your library with frameworks, or libraries. Libraries do not include + # the lib prefix of their name. + # + + # s.framework = "SomeFramework" + # s.frameworks = "SomeFramework", "AnotherFramework" + + # s.library = "iconv" + #spec.libraries = "RCTNetworkImage", "ReactKit" + +end diff --git a/Libraries/Image/RCTNetworkImage.xcodeproj/project.pbxproj b/Libraries/Image/RCTNetworkImage.xcodeproj/project.pbxproj new file mode 100644 index 000000000..0dc8304fa --- /dev/null +++ b/Libraries/Image/RCTNetworkImage.xcodeproj/project.pbxproj @@ -0,0 +1,367 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 58B511691A9E6B3D00147676 /* libRCTNetworkImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58B5115D1A9E6B3D00147676 /* libRCTNetworkImage.a */; }; + 58B5118F1A9E6BD600147676 /* RCTImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B5118A1A9E6BD600147676 /* RCTImageDownloader.m */; }; + 58B511901A9E6BD600147676 /* RCTNetworkImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B5118C1A9E6BD600147676 /* RCTNetworkImageView.m */; }; + 58B511911A9E6BD600147676 /* RCTNetworkImageViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B5118E1A9E6BD600147676 /* RCTNetworkImageViewManager.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 58B5116A1A9E6B3D00147676 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 58B511551A9E6B3D00147676 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 58B5115C1A9E6B3D00147676; + remoteInfo = RCTNetworkImage; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 58B5115B1A9E6B3D00147676 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 58B5115D1A9E6B3D00147676 /* libRCTNetworkImage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTNetworkImage.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 58B511681A9E6B3D00147676 /* RCTNetworkImageTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RCTNetworkImageTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 58B511891A9E6BD600147676 /* RCTImageDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageDownloader.h; sourceTree = ""; }; + 58B5118A1A9E6BD600147676 /* RCTImageDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageDownloader.m; sourceTree = ""; }; + 58B5118B1A9E6BD600147676 /* RCTNetworkImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNetworkImageView.h; sourceTree = ""; }; + 58B5118C1A9E6BD600147676 /* RCTNetworkImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTNetworkImageView.m; sourceTree = ""; }; + 58B5118D1A9E6BD600147676 /* RCTNetworkImageViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNetworkImageViewManager.h; sourceTree = ""; }; + 58B5118E1A9E6BD600147676 /* RCTNetworkImageViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTNetworkImageViewManager.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 58B5115A1A9E6B3D00147676 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 58B511651A9E6B3D00147676 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 58B511691A9E6B3D00147676 /* libRCTNetworkImage.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 58B511541A9E6B3D00147676 = { + isa = PBXGroup; + children = ( + 58B511891A9E6BD600147676 /* RCTImageDownloader.h */, + 58B5118A1A9E6BD600147676 /* RCTImageDownloader.m */, + 58B5118B1A9E6BD600147676 /* RCTNetworkImageView.h */, + 58B5118C1A9E6BD600147676 /* RCTNetworkImageView.m */, + 58B5118D1A9E6BD600147676 /* RCTNetworkImageViewManager.h */, + 58B5118E1A9E6BD600147676 /* RCTNetworkImageViewManager.m */, + 58B5115E1A9E6B3D00147676 /* Products */, + ); + sourceTree = ""; + }; + 58B5115E1A9E6B3D00147676 /* Products */ = { + isa = PBXGroup; + children = ( + 58B5115D1A9E6B3D00147676 /* libRCTNetworkImage.a */, + 58B511681A9E6B3D00147676 /* RCTNetworkImageTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 58B5115C1A9E6B3D00147676 /* RCTNetworkImage */ = { + isa = PBXNativeTarget; + buildConfigurationList = 58B511711A9E6B3D00147676 /* Build configuration list for PBXNativeTarget "RCTNetworkImage" */; + buildPhases = ( + 58B511591A9E6B3D00147676 /* Sources */, + 58B5115A1A9E6B3D00147676 /* Frameworks */, + 58B5115B1A9E6B3D00147676 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RCTNetworkImage; + productName = RCTNetworkImage; + productReference = 58B5115D1A9E6B3D00147676 /* libRCTNetworkImage.a */; + productType = "com.apple.product-type.library.static"; + }; + 58B511671A9E6B3D00147676 /* RCTNetworkImageTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 58B511741A9E6B3D00147676 /* Build configuration list for PBXNativeTarget "RCTNetworkImageTests" */; + buildPhases = ( + 58B511641A9E6B3D00147676 /* Sources */, + 58B511651A9E6B3D00147676 /* Frameworks */, + 58B511661A9E6B3D00147676 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 58B5116B1A9E6B3D00147676 /* PBXTargetDependency */, + ); + name = RCTNetworkImageTests; + productName = RCTNetworkImageTests; + productReference = 58B511681A9E6B3D00147676 /* RCTNetworkImageTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 58B511551A9E6B3D00147676 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = Facebook; + TargetAttributes = { + 58B5115C1A9E6B3D00147676 = { + CreatedOnToolsVersion = 6.1.1; + }; + 58B511671A9E6B3D00147676 = { + CreatedOnToolsVersion = 6.1.1; + }; + }; + }; + buildConfigurationList = 58B511581A9E6B3D00147676 /* Build configuration list for PBXProject "RCTNetworkImage" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 58B511541A9E6B3D00147676; + productRefGroup = 58B5115E1A9E6B3D00147676 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 58B5115C1A9E6B3D00147676 /* RCTNetworkImage */, + 58B511671A9E6B3D00147676 /* RCTNetworkImageTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 58B511661A9E6B3D00147676 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 58B511591A9E6B3D00147676 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 58B5118F1A9E6BD600147676 /* RCTImageDownloader.m in Sources */, + 58B511911A9E6BD600147676 /* RCTNetworkImageViewManager.m in Sources */, + 58B511901A9E6BD600147676 /* RCTNetworkImageView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 58B511641A9E6B3D00147676 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 58B5116B1A9E6B3D00147676 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 58B5115C1A9E6B3D00147676 /* RCTNetworkImage */; + targetProxy = 58B5116A1A9E6B3D00147676 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 58B5116F1A9E6B3D00147676 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 58B511701A9E6B3D00147676 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 58B511721A9E6B3D00147676 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 58B511731A9E6B3D00147676 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 58B511751A9E6B3D00147676 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = RCTNetworkImageTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 58B511761A9E6B3D00147676 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = RCTNetworkImageTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 58B511581A9E6B3D00147676 /* Build configuration list for PBXProject "RCTNetworkImage" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58B5116F1A9E6B3D00147676 /* Debug */, + 58B511701A9E6B3D00147676 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 58B511711A9E6B3D00147676 /* Build configuration list for PBXNativeTarget "RCTNetworkImage" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58B511721A9E6B3D00147676 /* Debug */, + 58B511731A9E6B3D00147676 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 58B511741A9E6B3D00147676 /* Build configuration list for PBXNativeTarget "RCTNetworkImageTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58B511751A9E6B3D00147676 /* Debug */, + 58B511761A9E6B3D00147676 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 58B511551A9E6B3D00147676 /* Project object */; +} diff --git a/Libraries/Image/RCTNetworkImageView.h b/Libraries/Image/RCTNetworkImageView.h new file mode 100644 index 000000000..c99ed0689 --- /dev/null +++ b/Libraries/Image/RCTNetworkImageView.h @@ -0,0 +1,32 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@class RCTImageDownloader; + +@interface RCTNetworkImageView : UIView + +- (instancetype)initWithFrame:(CGRect)frame imageDownloader:(RCTImageDownloader *)imageDownloader; + +/** + * An image that will appear while the view is loading the image from the network, + * or when imageURL is nil. Defaults to nil. + */ +@property (nonatomic, strong) UIImage *defaultImage; + +/** + * Specify a URL for an image. The image will be asynchronously loaded and displayed. + */ +@property (nonatomic, strong) NSURL *imageURL; + +/** + * By default, changing imageURL will reset whatever existing image was present + * and revert to defaultImage while the new image loads. In certain obscure cases you + * may want to disable this behavior and instead keep displaying the previous image + * while the new one loads. In this case, pass NO for resetToDefaultImageWhileLoading. + * (If you set imageURL to nil, however, resetToDefaultImageWhileLoading is ignored; + * that will always reset to the default image.) + */ +- (void)setImageURL:(NSURL *)imageURL resetToDefaultImageWhileLoading:(BOOL)reset; + +@end diff --git a/ReactKit/Views/RCTNetworkImageView.m b/Libraries/Image/RCTNetworkImageView.m similarity index 100% rename from ReactKit/Views/RCTNetworkImageView.m rename to Libraries/Image/RCTNetworkImageView.m diff --git a/Libraries/Image/RCTNetworkImageViewManager.h b/Libraries/Image/RCTNetworkImageViewManager.h new file mode 100644 index 000000000..5b34e6060 --- /dev/null +++ b/Libraries/Image/RCTNetworkImageViewManager.h @@ -0,0 +1,8 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTNetworkImageViewManager : RCTViewManager + +@end + diff --git a/ReactKit/Views/RCTNetworkImageViewManager.m b/Libraries/Image/RCTNetworkImageViewManager.m similarity index 100% rename from ReactKit/Views/RCTNetworkImageViewManager.m rename to Libraries/Image/RCTNetworkImageViewManager.m diff --git a/Libraries/Components/Image/ix.js b/Libraries/Image/ix.js similarity index 100% rename from Libraries/Components/Image/ix.js rename to Libraries/Image/ix.js diff --git a/Libraries/Network/RCTDataManager.h b/Libraries/Network/RCTDataManager.h new file mode 100644 index 000000000..47f80ba1c --- /dev/null +++ b/Libraries/Network/RCTDataManager.h @@ -0,0 +1,10 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTBridgeModule.h" + +@interface RCTDataManager : NSObject + +@end + diff --git a/ReactKit/Modules/RCTDataManager.m b/Libraries/Network/RCTDataManager.m similarity index 100% rename from ReactKit/Modules/RCTDataManager.m rename to Libraries/Network/RCTDataManager.m diff --git a/Libraries/Network/RCTDataManager.podspec b/Libraries/Network/RCTDataManager.podspec new file mode 100644 index 000000000..84df787b8 --- /dev/null +++ b/Libraries/Network/RCTDataManager.podspec @@ -0,0 +1,28 @@ +Pod::Spec.new do |spec| + spec.name = 'RCTDataManager' + spec.version = '0.0.1' + spec.summary = 'Provides basic networking capabilities in ReactNative apps.' + spec.description = <<-DESC + Use XMLHttpRequest to fetch data over the network. + DESC + spec.homepage = 'https://facebook.github.io/react-native/' + spec.license = { :type => 'BSD' } + spec.author = 'Facebook' + spec.platform = :ios, '7.0' + spec.requires_arc = true + spec.source_files = '**/*.{h,m,c}' + spec.dependency "ReactKit", "~> 0.0.1" + + # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Link your library with frameworks, or libraries. Libraries do not include + # the lib prefix of their name. + # + + # s.framework = "SomeFramework" + # s.frameworks = "SomeFramework", "AnotherFramework" + + # s.library = "iconv" + #spec.libraries = "RCTDataManager", "ReactKit" + +end diff --git a/Libraries/Network/RCTDataManager.xcodeproj/project.pbxproj b/Libraries/Network/RCTDataManager.xcodeproj/project.pbxproj new file mode 100644 index 000000000..b7cfed2a2 --- /dev/null +++ b/Libraries/Network/RCTDataManager.xcodeproj/project.pbxproj @@ -0,0 +1,355 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 58B511E71A9E6C8500147676 /* libRCTDataManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58B511DB1A9E6C8500147676 /* libRCTDataManager.a */; }; + 58B512081A9E6CE300147676 /* RCTDataManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B512071A9E6CE300147676 /* RCTDataManager.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 58B511E81A9E6C8500147676 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 58B511D31A9E6C8500147676 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 58B511DA1A9E6C8500147676; + remoteInfo = RCTDataManager; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 58B511D91A9E6C8500147676 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 58B511DB1A9E6C8500147676 /* libRCTDataManager.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTDataManager.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 58B511E61A9E6C8500147676 /* RCTDataManagerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RCTDataManagerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 58B512061A9E6CE300147676 /* RCTDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDataManager.h; sourceTree = ""; }; + 58B512071A9E6CE300147676 /* RCTDataManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDataManager.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 58B511D81A9E6C8500147676 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 58B511E31A9E6C8500147676 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 58B511E71A9E6C8500147676 /* libRCTDataManager.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 58B511D21A9E6C8500147676 = { + isa = PBXGroup; + children = ( + 58B512061A9E6CE300147676 /* RCTDataManager.h */, + 58B512071A9E6CE300147676 /* RCTDataManager.m */, + 58B511DC1A9E6C8500147676 /* Products */, + ); + sourceTree = ""; + }; + 58B511DC1A9E6C8500147676 /* Products */ = { + isa = PBXGroup; + children = ( + 58B511DB1A9E6C8500147676 /* libRCTDataManager.a */, + 58B511E61A9E6C8500147676 /* RCTDataManagerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 58B511DA1A9E6C8500147676 /* RCTDataManager */ = { + isa = PBXNativeTarget; + buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTDataManager" */; + buildPhases = ( + 58B511D71A9E6C8500147676 /* Sources */, + 58B511D81A9E6C8500147676 /* Frameworks */, + 58B511D91A9E6C8500147676 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RCTDataManager; + productName = RCTDataManager; + productReference = 58B511DB1A9E6C8500147676 /* libRCTDataManager.a */; + productType = "com.apple.product-type.library.static"; + }; + 58B511E51A9E6C8500147676 /* RCTDataManagerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 58B511F21A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTDataManagerTests" */; + buildPhases = ( + 58B511E21A9E6C8500147676 /* Sources */, + 58B511E31A9E6C8500147676 /* Frameworks */, + 58B511E41A9E6C8500147676 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 58B511E91A9E6C8500147676 /* PBXTargetDependency */, + ); + name = RCTDataManagerTests; + productName = RCTDataManagerTests; + productReference = 58B511E61A9E6C8500147676 /* RCTDataManagerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 58B511D31A9E6C8500147676 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = Facebook; + TargetAttributes = { + 58B511DA1A9E6C8500147676 = { + CreatedOnToolsVersion = 6.1.1; + }; + 58B511E51A9E6C8500147676 = { + CreatedOnToolsVersion = 6.1.1; + }; + }; + }; + buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTDataManager" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 58B511D21A9E6C8500147676; + productRefGroup = 58B511DC1A9E6C8500147676 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 58B511DA1A9E6C8500147676 /* RCTDataManager */, + 58B511E51A9E6C8500147676 /* RCTDataManagerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 58B511E41A9E6C8500147676 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 58B511D71A9E6C8500147676 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 58B512081A9E6CE300147676 /* RCTDataManager.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 58B511E21A9E6C8500147676 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 58B511E91A9E6C8500147676 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 58B511DA1A9E6C8500147676 /* RCTDataManager */; + targetProxy = 58B511E81A9E6C8500147676 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 58B511ED1A9E6C8500147676 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 58B511EE1A9E6C8500147676 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 58B511F01A9E6C8500147676 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 58B511F11A9E6C8500147676 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 58B511F31A9E6C8500147676 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = RCTDataManagerTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 58B511F41A9E6C8500147676 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = RCTDataManagerTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTDataManager" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58B511ED1A9E6C8500147676 /* Debug */, + 58B511EE1A9E6C8500147676 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTDataManager" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58B511F01A9E6C8500147676 /* Debug */, + 58B511F11A9E6C8500147676 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 58B511F21A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTDataManagerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58B511F31A9E6C8500147676 /* Debug */, + 58B511F41A9E6C8500147676 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 58B511D31A9E6C8500147676 /* Project object */; +} diff --git a/Libraries/XMLHttpRequest/XMLHttpRequest.ios.js b/Libraries/Network/XMLHttpRequest.ios.js similarity index 100% rename from Libraries/XMLHttpRequest/XMLHttpRequest.ios.js rename to Libraries/Network/XMLHttpRequest.ios.js diff --git a/Libraries/Components/Text/ExpandingText.js b/Libraries/Text/ExpandingText.js similarity index 100% rename from Libraries/Components/Text/ExpandingText.js rename to Libraries/Text/ExpandingText.js diff --git a/Libraries/Text/RCTRawTextManager.h b/Libraries/Text/RCTRawTextManager.h new file mode 100644 index 000000000..4c67fd328 --- /dev/null +++ b/Libraries/Text/RCTRawTextManager.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTRawTextManager : RCTViewManager + +@end diff --git a/ReactKit/Views/RCTRawTextManager.m b/Libraries/Text/RCTRawTextManager.m similarity index 100% rename from ReactKit/Views/RCTRawTextManager.m rename to Libraries/Text/RCTRawTextManager.m diff --git a/Libraries/Text/RCTShadowRawText.h b/Libraries/Text/RCTShadowRawText.h new file mode 100644 index 000000000..d1bdc7d72 --- /dev/null +++ b/Libraries/Text/RCTShadowRawText.h @@ -0,0 +1,9 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTShadowView.h" + +@interface RCTShadowRawText : RCTShadowView + +@property (nonatomic, copy) NSString *text; + +@end diff --git a/ReactKit/Views/RCTShadowRawText.m b/Libraries/Text/RCTShadowRawText.m similarity index 100% rename from ReactKit/Views/RCTShadowRawText.m rename to Libraries/Text/RCTShadowRawText.m diff --git a/Libraries/Text/RCTShadowText.h b/Libraries/Text/RCTShadowText.h new file mode 100644 index 000000000..ddaf2ebe7 --- /dev/null +++ b/Libraries/Text/RCTShadowText.h @@ -0,0 +1,26 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTShadowView.h" + +extern NSString *const RCTIsHighlightedAttributeName; +extern NSString *const RCTReactTagAttributeName; + +@interface RCTShadowText : RCTShadowView + +@property (nonatomic, assign) NSWritingDirection writingDirection; +@property (nonatomic, strong) UIColor *textBackgroundColor; +@property (nonatomic, strong) UIColor *color; +@property (nonatomic, strong) UIFont *font; +@property (nonatomic, copy) NSString *fontFamily; +@property (nonatomic, assign) CGFloat fontSize; +@property (nonatomic, copy) NSString *fontWeight; +@property (nonatomic, assign) BOOL isHighlighted; +@property (nonatomic, assign) CGFloat lineHeight; +@property (nonatomic, assign) NSInteger maxNumberOfLines; +@property (nonatomic, assign) CGSize shadowOffset; +@property (nonatomic, assign) NSTextAlignment textAlign; +@property (nonatomic, assign) NSLineBreakMode truncationMode; + +- (NSAttributedString *)attributedString; + +@end diff --git a/ReactKit/Views/RCTShadowText.m b/Libraries/Text/RCTShadowText.m similarity index 100% rename from ReactKit/Views/RCTShadowText.m rename to Libraries/Text/RCTShadowText.m diff --git a/Libraries/Text/RCTText.h b/Libraries/Text/RCTText.h new file mode 100644 index 000000000..80ba3f234 --- /dev/null +++ b/Libraries/Text/RCTText.h @@ -0,0 +1,13 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTText : UIView + +@property (nonatomic, copy) NSAttributedString *attributedText; +@property (nonatomic, assign) NSLineBreakMode lineBreakMode; +@property (nonatomic, assign) NSUInteger numberOfLines; + +- (NSNumber *)reactTagAtPoint:(CGPoint)point; + +@end diff --git a/ReactKit/Views/RCTText.m b/Libraries/Text/RCTText.m similarity index 100% rename from ReactKit/Views/RCTText.m rename to Libraries/Text/RCTText.m diff --git a/Libraries/Text/RCTText.podspec b/Libraries/Text/RCTText.podspec new file mode 100644 index 000000000..656e0ee74 --- /dev/null +++ b/Libraries/Text/RCTText.podspec @@ -0,0 +1,28 @@ +Pod::Spec.new do |spec| + spec.name = 'RCTText' + spec.version = '0.0.1' + spec.summary = 'Provides basic Text capabilities in ReactNative apps.' + spec.description = <<-DESC + Text can be rendered in ReactNative apps with the component using this module. + DESC + spec.homepage = 'https://facebook.github.io/react-native/' + spec.license = { :type => 'BSD' } + spec.author = 'Facebook' + spec.platform = :ios, '7.0' + spec.requires_arc = true + spec.source_files = '**/*.{h,m,c}' + spec.dependency "ReactKit", "~> 0.0.1" + + # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Link your library with frameworks, or libraries. Libraries do not include + # the lib prefix of their name. + # + + # s.framework = "SomeFramework" + # s.frameworks = "SomeFramework", "AnotherFramework" + + # s.library = "iconv" + #spec.libraries = "RCTText", "ReactKit" + +end diff --git a/Libraries/Text/RCTText.xcodeproj/project.pbxproj b/Libraries/Text/RCTText.xcodeproj/project.pbxproj new file mode 100644 index 000000000..e6e7b4aad --- /dev/null +++ b/Libraries/Text/RCTText.xcodeproj/project.pbxproj @@ -0,0 +1,379 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 58B511A71A9E6C1300147676 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58B5119B1A9E6C1200147676 /* libRCTText.a */; }; + 58B511CE1A9E6C5C00147676 /* RCTRawTextManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B511C71A9E6C5C00147676 /* RCTRawTextManager.m */; }; + 58B511CF1A9E6C5C00147676 /* RCTShadowRawText.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B511C91A9E6C5C00147676 /* RCTShadowRawText.m */; }; + 58B511D01A9E6C5C00147676 /* RCTShadowText.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B511CB1A9E6C5C00147676 /* RCTShadowText.m */; }; + 58B511D11A9E6C5C00147676 /* RCTTextManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B511CD1A9E6C5C00147676 /* RCTTextManager.m */; }; + 58B512161A9E6EFF00147676 /* RCTText.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B512141A9E6EFF00147676 /* RCTText.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 58B511A81A9E6C1300147676 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 58B511931A9E6C1200147676 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 58B5119A1A9E6C1200147676; + remoteInfo = RCTText; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 58B511991A9E6C1200147676 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 58B5119B1A9E6C1200147676 /* libRCTText.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTText.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 58B511A61A9E6C1300147676 /* RCTTextTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RCTTextTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 58B511C61A9E6C5C00147676 /* RCTRawTextManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRawTextManager.h; sourceTree = ""; }; + 58B511C71A9E6C5C00147676 /* RCTRawTextManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRawTextManager.m; sourceTree = ""; }; + 58B511C81A9E6C5C00147676 /* RCTShadowRawText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTShadowRawText.h; sourceTree = ""; }; + 58B511C91A9E6C5C00147676 /* RCTShadowRawText.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTShadowRawText.m; sourceTree = ""; }; + 58B511CA1A9E6C5C00147676 /* RCTShadowText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTShadowText.h; sourceTree = ""; }; + 58B511CB1A9E6C5C00147676 /* RCTShadowText.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTShadowText.m; sourceTree = ""; }; + 58B511CC1A9E6C5C00147676 /* RCTTextManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTextManager.h; sourceTree = ""; }; + 58B511CD1A9E6C5C00147676 /* RCTTextManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTextManager.m; sourceTree = ""; }; + 58B512141A9E6EFF00147676 /* RCTText.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTText.m; sourceTree = ""; }; + 58B512151A9E6EFF00147676 /* RCTText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTText.h; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 58B511981A9E6C1200147676 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 58B511A31A9E6C1300147676 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 58B511A71A9E6C1300147676 /* libRCTText.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 58B511921A9E6C1200147676 = { + isa = PBXGroup; + children = ( + 58B511C61A9E6C5C00147676 /* RCTRawTextManager.h */, + 58B511C71A9E6C5C00147676 /* RCTRawTextManager.m */, + 58B511C81A9E6C5C00147676 /* RCTShadowRawText.h */, + 58B511C91A9E6C5C00147676 /* RCTShadowRawText.m */, + 58B511CA1A9E6C5C00147676 /* RCTShadowText.h */, + 58B511CB1A9E6C5C00147676 /* RCTShadowText.m */, + 58B512151A9E6EFF00147676 /* RCTText.h */, + 58B512141A9E6EFF00147676 /* RCTText.m */, + 58B511CC1A9E6C5C00147676 /* RCTTextManager.h */, + 58B511CD1A9E6C5C00147676 /* RCTTextManager.m */, + 58B5119C1A9E6C1200147676 /* Products */, + ); + sourceTree = ""; + }; + 58B5119C1A9E6C1200147676 /* Products */ = { + isa = PBXGroup; + children = ( + 58B5119B1A9E6C1200147676 /* libRCTText.a */, + 58B511A61A9E6C1300147676 /* RCTTextTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 58B5119A1A9E6C1200147676 /* RCTText */ = { + isa = PBXNativeTarget; + buildConfigurationList = 58B511AF1A9E6C1300147676 /* Build configuration list for PBXNativeTarget "RCTText" */; + buildPhases = ( + 58B511971A9E6C1200147676 /* Sources */, + 58B511981A9E6C1200147676 /* Frameworks */, + 58B511991A9E6C1200147676 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RCTText; + productName = RCTText; + productReference = 58B5119B1A9E6C1200147676 /* libRCTText.a */; + productType = "com.apple.product-type.library.static"; + }; + 58B511A51A9E6C1300147676 /* RCTTextTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 58B511B21A9E6C1300147676 /* Build configuration list for PBXNativeTarget "RCTTextTests" */; + buildPhases = ( + 58B511A21A9E6C1300147676 /* Sources */, + 58B511A31A9E6C1300147676 /* Frameworks */, + 58B511A41A9E6C1300147676 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 58B511A91A9E6C1300147676 /* PBXTargetDependency */, + ); + name = RCTTextTests; + productName = RCTTextTests; + productReference = 58B511A61A9E6C1300147676 /* RCTTextTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 58B511931A9E6C1200147676 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = Facebook; + TargetAttributes = { + 58B5119A1A9E6C1200147676 = { + CreatedOnToolsVersion = 6.1.1; + }; + 58B511A51A9E6C1300147676 = { + CreatedOnToolsVersion = 6.1.1; + }; + }; + }; + buildConfigurationList = 58B511961A9E6C1200147676 /* Build configuration list for PBXProject "RCTText" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 58B511921A9E6C1200147676; + productRefGroup = 58B5119C1A9E6C1200147676 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 58B5119A1A9E6C1200147676 /* RCTText */, + 58B511A51A9E6C1300147676 /* RCTTextTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 58B511A41A9E6C1300147676 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 58B511971A9E6C1200147676 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 58B511D11A9E6C5C00147676 /* RCTTextManager.m in Sources */, + 58B511CE1A9E6C5C00147676 /* RCTRawTextManager.m in Sources */, + 58B512161A9E6EFF00147676 /* RCTText.m in Sources */, + 58B511CF1A9E6C5C00147676 /* RCTShadowRawText.m in Sources */, + 58B511D01A9E6C5C00147676 /* RCTShadowText.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 58B511A21A9E6C1300147676 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 58B511A91A9E6C1300147676 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 58B5119A1A9E6C1200147676 /* RCTText */; + targetProxy = 58B511A81A9E6C1300147676 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 58B511AD1A9E6C1300147676 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 58B511AE1A9E6C1300147676 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 58B511B01A9E6C1300147676 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 58B511B11A9E6C1300147676 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 58B511B31A9E6C1300147676 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = RCTTextTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 58B511B41A9E6C1300147676 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = RCTTextTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 58B511961A9E6C1200147676 /* Build configuration list for PBXProject "RCTText" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58B511AD1A9E6C1300147676 /* Debug */, + 58B511AE1A9E6C1300147676 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 58B511AF1A9E6C1300147676 /* Build configuration list for PBXNativeTarget "RCTText" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58B511B01A9E6C1300147676 /* Debug */, + 58B511B11A9E6C1300147676 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 58B511B21A9E6C1300147676 /* Build configuration list for PBXNativeTarget "RCTTextTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58B511B31A9E6C1300147676 /* Debug */, + 58B511B41A9E6C1300147676 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 58B511931A9E6C1200147676 /* Project object */; +} diff --git a/Libraries/Text/RCTTextManager.h b/Libraries/Text/RCTTextManager.h new file mode 100644 index 000000000..0359cce40 --- /dev/null +++ b/Libraries/Text/RCTTextManager.h @@ -0,0 +1,8 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTTextManager : RCTViewManager + +@end + diff --git a/ReactKit/Views/RCTTextManager.m b/Libraries/Text/RCTTextManager.m similarity index 100% rename from ReactKit/Views/RCTTextManager.m rename to Libraries/Text/RCTTextManager.m diff --git a/Libraries/Components/Text/Text.js b/Libraries/Text/Text.js similarity index 100% rename from Libraries/Components/Text/Text.js rename to Libraries/Text/Text.js diff --git a/Libraries/Components/Text/TextStylePropTypes.js b/Libraries/Text/TextStylePropTypes.js similarity index 100% rename from Libraries/Components/Text/TextStylePropTypes.js rename to Libraries/Text/TextStylePropTypes.js diff --git a/ReactKit/Base/RCTRootView.h b/ReactKit/Base/RCTRootView.h index f0c381638..240c000c3 100644 --- a/ReactKit/Base/RCTRootView.h +++ b/ReactKit/Base/RCTRootView.h @@ -38,4 +38,7 @@ - (void)reload; + (void)reloadAll; +- (void)startOrResetInteractionTiming; +- (NSDictionary *)endAndResetInteractionTiming; + @end diff --git a/ReactKit/Base/RCTRootView.m b/ReactKit/Base/RCTRootView.m index 5968357a9..703f86daf 100644 --- a/ReactKit/Base/RCTRootView.m +++ b/ReactKit/Base/RCTRootView.m @@ -131,6 +131,7 @@ static Class _globalExecutorClass; // Clean up [self removeGestureRecognizer:_touchHandler]; + [_touchHandler invalidate]; [_executor invalidate]; [_bridge invalidate]; @@ -231,4 +232,14 @@ static Class _globalExecutorClass; [[NSNotificationCenter defaultCenter] postNotificationName:RCTRootViewReloadNotification object:nil]; } +- (void)startOrResetInteractionTiming +{ + [_touchHandler startOrResetInteractionTiming]; +} + +- (NSDictionary *)endAndResetInteractionTiming +{ + return [_touchHandler endAndResetInteractionTiming]; +} + @end diff --git a/ReactKit/Base/RCTTouchHandler.h b/ReactKit/Base/RCTTouchHandler.h index e75bb1531..53379a78a 100644 --- a/ReactKit/Base/RCTTouchHandler.h +++ b/ReactKit/Base/RCTTouchHandler.h @@ -2,10 +2,14 @@ #import +#import "RCTInvalidating.h" + @class RCTBridge; -@interface RCTTouchHandler : UIGestureRecognizer +@interface RCTTouchHandler : UIGestureRecognizer - (instancetype)initWithBridge:(RCTBridge *)bridge; +- (void)startOrResetInteractionTiming; +- (NSDictionary *)endAndResetInteractionTiming; @end diff --git a/ReactKit/Base/RCTTouchHandler.m b/ReactKit/Base/RCTTouchHandler.m index a23cd70c7..36ab411fe 100644 --- a/ReactKit/Base/RCTTouchHandler.m +++ b/ReactKit/Base/RCTTouchHandler.m @@ -14,10 +14,42 @@ // TODO: this class behaves a lot like a module, and could be implemented as a // module if we were to assume that modules and RootViews had a 1:1 relationship +@interface RCTTouchEvent : NSObject + +@property (nonatomic, assign, readonly) NSUInteger id; +@property (nonatomic, copy, readonly) NSString *eventName; +@property (nonatomic, copy, readonly) NSArray *touches; +@property (nonatomic, copy, readonly) NSArray *changedIndexes; +@property (nonatomic, assign, readonly) CFTimeInterval originatingTime; + +@end + + +@implementation RCTTouchEvent + ++ (instancetype)touchWithEventName:(NSString *)eventName touches:(NSArray *)touches changedIndexes:(NSArray *)changedIndexes originatingTime:(CFTimeInterval)originatingTime +{ + RCTTouchEvent *touchEvent = [[self alloc] init]; + touchEvent->_id = [self newID]; + touchEvent->_eventName = [eventName copy]; + touchEvent->_touches = [touches copy]; + touchEvent->_changedIndexes = [changedIndexes copy]; + touchEvent->_originatingTime = originatingTime; + return touchEvent; +} + ++ (NSUInteger)newID +{ + static NSUInteger id = 0; + return ++id; +} + +@end + @implementation RCTTouchHandler { __weak RCTBridge *_bridge; - + /** * Arrays managed in parallel tracking native touch object along with the * native view that was touched, and the react touch data dictionary. @@ -27,6 +59,12 @@ NSMutableOrderedSet *_nativeTouches; NSMutableArray *_reactTouches; NSMutableArray *_touchViews; + + BOOL _recordingInteractionTiming; + CFTimeInterval _mostRecentEnqueueJS; + CADisplayLink *_displayLink; + NSMutableArray *_pendingTouches; + NSMutableArray *_bridgeInteractionTiming; } - (instancetype)initWithTarget:(id)target action:(SEL)action @@ -37,15 +75,21 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge { if ((self = [super initWithTarget:nil action:NULL])) { - + RCTAssert(bridge != nil, @"Expect an event dispatcher"); - + _bridge = bridge; - + _nativeTouches = [[NSMutableOrderedSet alloc] init]; _reactTouches = [[NSMutableArray alloc] init]; _touchViews = [[NSMutableArray alloc] init]; - + + _displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(_update:)]; + _pendingTouches = [[NSMutableArray alloc] init]; + _bridgeInteractionTiming = [[NSMutableArray alloc] init]; + + [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; + // `cancelsTouchesInView` is needed in order to be used as a top level event delegated recognizer. Otherwise, lower // level components not build using RCT, will fail to recognize gestures. self.cancelsTouchesInView = NO; @@ -53,6 +97,17 @@ return self; } +- (BOOL)isValid +{ + return _displayLink != nil; +} + +- (void)invalidate +{ + [_displayLink invalidate]; + _displayLink = nil; +} + typedef NS_ENUM(NSInteger, RCTTouchEventType) { RCTTouchEventTypeStart, RCTTouchEventTypeMove, @@ -65,10 +120,10 @@ typedef NS_ENUM(NSInteger, RCTTouchEventType) { - (void)_recordNewTouches:(NSSet *)touches { for (UITouch *touch in touches) { - + RCTAssert(![_nativeTouches containsObject:touch], @"Touch is already recorded. This is a critical bug."); - + // Find closest React-managed touchable view UIView *targetView = touch.view; while (targetView) { @@ -95,14 +150,14 @@ typedef NS_ENUM(NSInteger, RCTTouchEventType) { break; } } - + // Create touch NSMutableDictionary *reactTouch = [[NSMutableDictionary alloc] initWithCapacity:9]; reactTouch[@"target"] = [targetView reactTagAtPoint:[touch locationInView:targetView]]; reactTouch[@"identifier"] = @(touchID); reactTouch[@"touches"] = [NSNull null]; // We hijack this touchObj to serve both as an event reactTouch[@"changedTouches"] = [NSNull null]; // and as a Touch object, so making this JIT friendly. - + // Add to arrays [_touchViews addObject:targetView]; [_nativeTouches addObject:touch]; @@ -129,10 +184,10 @@ typedef NS_ENUM(NSInteger, RCTTouchEventType) { UITouch *nativeTouch = _nativeTouches[touchIndex]; CGPoint windowLocation = [nativeTouch locationInView:nativeTouch.window]; CGPoint rootViewLocation = [nativeTouch.window convertPoint:windowLocation toView:self.view]; - + UIView *touchView = _touchViews[touchIndex]; CGPoint touchViewLocation = [nativeTouch.window convertPoint:windowLocation toView:touchView]; - + NSMutableDictionary *reactTouch = _reactTouches[touchIndex]; reactTouch[@"pageX"] = @(rootViewLocation.x); reactTouch[@"pageY"] = @(rootViewLocation.y); @@ -157,9 +212,10 @@ typedef NS_ENUM(NSInteger, RCTTouchEventType) { * (start/end/move/cancel) and the indices that represent "changed" `Touch`es * from that array. */ -- (void)_updateAndDispatchTouches:(NSSet *)touches eventName:(NSString *)eventName +- (void)_updateAndDispatchTouches:(NSSet *)touches eventName:(NSString *)eventName originatingTime:(CFTimeInterval)originatingTime { // Update touches + CFTimeInterval enqueueTime = CACurrentMediaTime(); NSMutableArray *changedIndexes = [[NSMutableArray alloc] init]; for (UITouch *touch in touches) { NSInteger index = [_nativeTouches indexOfObject:touch]; @@ -181,10 +237,72 @@ typedef NS_ENUM(NSInteger, RCTTouchEventType) { for (NSDictionary *touch in _reactTouches) { [reactTouches addObject:[touch copy]]; } - + + RCTTouchEvent *touch = [RCTTouchEvent touchWithEventName:eventName + touches:reactTouches + changedIndexes:changedIndexes + originatingTime:originatingTime]; + [_pendingTouches addObject:touch]; + + if (_recordingInteractionTiming) { + [_bridgeInteractionTiming addObject:@{ + @"timeSeconds": @(touch.originatingTime), + @"operation": @"taskOriginated", + @"taskID": @(touch.id), + }]; + [_bridgeInteractionTiming addObject:@{ + @"timeSeconds": @(enqueueTime), + @"operation": @"taskEnqueuedPending", + @"taskID": @(touch.id), + }]; + } +} + +- (void)_update:(CADisplayLink *)sender +{ // Dispatch touch event - [_bridge enqueueJSCall:@"RCTEventEmitter.receiveTouches" - args:@[eventName, reactTouches, changedIndexes]]; + NSUInteger pendingCount = _pendingTouches.count; + for (RCTTouchEvent *touch in _pendingTouches) { + _mostRecentEnqueueJS = CACurrentMediaTime(); + [_bridge enqueueJSCall:@"RCTEventEmitter.receiveTouches" + args:@[touch.eventName, touch.touches, touch.changedIndexes]]; + } + + if (_recordingInteractionTiming) { + for (RCTTouchEvent *touch in _pendingTouches) { + [_bridgeInteractionTiming addObject:@{ + @"timeSeconds": @(sender.timestamp), + @"operation": @"frameAlignedDispatch", + @"taskID": @(touch.id), + }]; + } + + if (pendingCount > 0 || sender.timestamp - _mostRecentEnqueueJS < 0.1) { + [_bridgeInteractionTiming addObject:@{ + @"timeSeconds": @(sender.timestamp), + @"operation": @"mainThreadDisplayLink", + @"taskID": @([RCTTouchEvent newID]), + }]; + } + } + + [_pendingTouches removeAllObjects]; +} + +- (void)startOrResetInteractionTiming +{ + RCTAssertMainThread(); + [_bridgeInteractionTiming removeAllObjects]; + _recordingInteractionTiming = YES; +} + +- (NSDictionary *)endAndResetInteractionTiming +{ + RCTAssertMainThread(); + _recordingInteractionTiming = NO; + NSArray *_prevInteractionTimingData = _bridgeInteractionTiming; + _bridgeInteractionTiming = [[NSMutableArray alloc] init]; + return @{ @"interactionTiming": _prevInteractionTimingData }; } #pragma mark - Gesture Recognizer Delegate Callbacks @@ -193,11 +311,11 @@ typedef NS_ENUM(NSInteger, RCTTouchEventType) { { [super touchesBegan:touches withEvent:event]; self.state = UIGestureRecognizerStateBegan; - + // "start" has to record new touches before extracting the event. // "end"/"cancel" needs to remove the touch *after* extracting the event. [self _recordNewTouches:touches]; - [self _updateAndDispatchTouches:touches eventName:@"topTouchStart"]; + [self _updateAndDispatchTouches:touches eventName:@"topTouchStart" originatingTime:event.timestamp]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event @@ -206,20 +324,20 @@ typedef NS_ENUM(NSInteger, RCTTouchEventType) { if (self.state == UIGestureRecognizerStateFailed) { return; } - [self _updateAndDispatchTouches:touches eventName:@"topTouchMove"]; + [self _updateAndDispatchTouches:touches eventName:@"topTouchMove" originatingTime:event.timestamp]; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesEnded:touches withEvent:event]; - [self _updateAndDispatchTouches:touches eventName:@"topTouchEnd"]; + [self _updateAndDispatchTouches:touches eventName:@"topTouchEnd" originatingTime:event.timestamp]; [self _recordRemovedTouches:touches]; } - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesCancelled:touches withEvent:event]; - [self _updateAndDispatchTouches:touches eventName:@"topTouchCancel"]; + [self _updateAndDispatchTouches:touches eventName:@"topTouchCancel" originatingTime:event.timestamp]; [self _recordRemovedTouches:touches]; } diff --git a/ReactKit/Modules/RCTUIManager.m b/ReactKit/Modules/RCTUIManager.m index 3b1b56432..0b34a820b 100644 --- a/ReactKit/Modules/RCTUIManager.m +++ b/ReactKit/Modules/RCTUIManager.m @@ -1293,6 +1293,14 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView @"None": @(UITextAutocapitalizationTypeNone), }, }, + @"UITextField": @{ + @"clearButtonMode": @{ + @"Never": @(UITextFieldViewModeNever), + @"WhileEditing": @(UITextFieldViewModeWhileEditing), + @"UnlessEditing": @(UITextFieldViewModeUnlessEditing), + @"Always": @(UITextFieldViewModeAlways), + }, + }, @"UIView": @{ @"ContentMode": @{ @"ScaleToFill": @(UIViewContentModeScaleToFill), @@ -1342,6 +1350,37 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView _nextLayoutAnimation = [[RCTLayoutAnimation alloc] initWithDictionary:config callback:callback]; } +- (void)startOrResetInteractionTiming +{ + RCT_EXPORT(); + + NSSet *rootViewTags = [_rootViewTags copy]; + [self addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) { + for (NSNumber *reactTag in rootViewTags) { + RCTRootView *rootView = viewRegistry[reactTag]; + [rootView startOrResetInteractionTiming]; + } + }]; +} + +- (void)endAndResetInteractionTiming:(RCTResponseSenderBlock)onSuccess + onError:(RCTResponseSenderBlock)onError +{ + RCT_EXPORT(); + + NSSet *rootViewTags = [_rootViewTags copy]; + [self addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) { + NSMutableDictionary *timingData = [[NSMutableDictionary alloc] init]; + for (NSNumber *reactTag in rootViewTags) { + RCTRootView *rootView = viewRegistry[reactTag]; + if (rootView) { + timingData[reactTag.stringValue] = [rootView endAndResetInteractionTiming]; + } + } + onSuccess(@[ timingData ]); + }]; +} + static UIView *_jsResponder; + (UIView *)JSResponder diff --git a/ReactKit/ReactKit.podspec b/ReactKit/ReactKit.podspec new file mode 100644 index 000000000..3e1a8a6e2 --- /dev/null +++ b/ReactKit/ReactKit.podspec @@ -0,0 +1,16 @@ +Pod::Spec.new do |spec| + spec.name = 'ReactKit' + spec.version = '0.0.1' + spec.summary = 'An implementation of React that targets UIKit for iOS' + spec.description = <<-DESC + Our first React Native implementation is ReactKit, targeting iOS. We are also working on an Android implementation which we will release later. ReactKit apps are built using the React JS framework, and render directly to native UIKit elements using a fully asynchronous architecture. There is no browser and no HTML. We have picked what we think is the best set of features from these and other technologies to build what we hope to become the best product development framework available, with an emphasis on iteration speed, developer delight, continuity of technology, and absolutely beautiful and fast products with no compromises in quality or capability. + DESC + spec.homepage = 'https://facebook.github.io/react-native/' + spec.license = { :type => 'BSD' } + spec.author = 'Facebook' + spec.platform = :ios, '7.0' + spec.requires_arc = true + spec.source_files = '**/*.{h,m,c}' + spec.public_header_files = "**/*.h" + #spec.library = "ReactKit" +end diff --git a/ReactKit/ReactKit.xcodeproj/project.pbxproj b/ReactKit/ReactKit.xcodeproj/project.pbxproj index e342d22a3..3067cd8e4 100644 --- a/ReactKit/ReactKit.xcodeproj/project.pbxproj +++ b/ReactKit/ReactKit.xcodeproj/project.pbxproj @@ -10,12 +10,8 @@ 1302F0FD1A78550100EBEF02 /* RCTStaticImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 1302F0FA1A78550100EBEF02 /* RCTStaticImage.m */; }; 1302F0FE1A78550100EBEF02 /* RCTStaticImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1302F0FC1A78550100EBEF02 /* RCTStaticImageManager.m */; }; 134FCB361A6D42D900051CC8 /* RCTSparseArray.m in Sources */ = {isa = PBXBuildFile; fileRef = 83BEE46D1A6D19BC00B5863B /* RCTSparseArray.m */; }; - 134FCB371A6D4ED700051CC8 /* RCTRawTextManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 137029581A6C197000575408 /* RCTRawTextManager.m */; }; 134FCB3D1A6E7F0800051CC8 /* RCTContextExecutor.m in Sources */ = {isa = PBXBuildFile; fileRef = 134FCB3A1A6E7F0800051CC8 /* RCTContextExecutor.m */; }; 134FCB3E1A6E7F0800051CC8 /* RCTWebViewExecutor.m in Sources */ = {isa = PBXBuildFile; fileRef = 134FCB3C1A6E7F0800051CC8 /* RCTWebViewExecutor.m */; }; - 137029491A698FF000575408 /* RCTNetworkImageViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 137029401A698FF000575408 /* RCTNetworkImageViewManager.m */; }; - 137029501A6990A100575408 /* RCTNetworkImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1370294F1A6990A100575408 /* RCTNetworkImageView.m */; }; - 137029531A69923600575408 /* RCTImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 137029521A69923600575408 /* RCTImageDownloader.m */; }; 13723B501A82FD3C00F88898 /* RCTStatusBarManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */; }; 13A1F71E1A75392D00D3D453 /* RCTKeyCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A1F71D1A75392D00D3D453 /* RCTKeyCommands.m */; }; 13B07FEF1A69327A00A75B9A /* RCTAlertManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FE81A69327A00A75B9A /* RCTAlertManager.m */; }; @@ -23,9 +19,6 @@ 13B07FF21A69327A00A75B9A /* RCTTiming.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FEE1A69327A00A75B9A /* RCTTiming.m */; }; 13B080051A6947C200A75B9A /* RCTScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FF71A6947C200A75B9A /* RCTScrollView.m */; }; 13B080061A6947C200A75B9A /* RCTScrollViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FF91A6947C200A75B9A /* RCTScrollViewManager.m */; }; - 13B080071A6947C200A75B9A /* RCTShadowRawText.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FFB1A6947C200A75B9A /* RCTShadowRawText.m */; }; - 13B080081A6947C200A75B9A /* RCTShadowText.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FFD1A6947C200A75B9A /* RCTShadowText.m */; }; - 13B0800B1A6947C200A75B9A /* RCTTextManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080031A6947C200A75B9A /* RCTTextManager.m */; }; 13B0801A1A69489C00A75B9A /* RCTNavigator.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B0800D1A69489C00A75B9A /* RCTNavigator.m */; }; 13B0801B1A69489C00A75B9A /* RCTNavigatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B0800F1A69489C00A75B9A /* RCTNavigatorManager.m */; }; 13B0801C1A69489C00A75B9A /* RCTNavItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080111A69489C00A75B9A /* RCTNavItem.m */; }; @@ -34,7 +27,6 @@ 13B0801F1A69489C00A75B9A /* RCTTextFieldManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080171A69489C00A75B9A /* RCTTextFieldManager.m */; }; 13B080201A69489C00A75B9A /* RCTUIActivityIndicatorViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080191A69489C00A75B9A /* RCTUIActivityIndicatorViewManager.m */; }; 13B080261A694A8400A75B9A /* RCTWrapperViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080241A694A8400A75B9A /* RCTWrapperViewController.m */; }; - 13B080291A694C4900A75B9A /* RCTDataManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B080281A694C4900A75B9A /* RCTDataManager.m */; }; 13E0674A1A70F434002CDEE1 /* RCTUIManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067491A70F434002CDEE1 /* RCTUIManager.m */; }; 13E067551A70F44B002CDEE1 /* RCTShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E0674C1A70F44B002CDEE1 /* RCTShadowView.m */; }; 13E067561A70F44B002CDEE1 /* RCTViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E0674E1A70F44B002CDEE1 /* RCTViewManager.m */; }; @@ -43,7 +35,6 @@ 830A229E1A66C68A008503DA /* RCTRootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 830A229D1A66C68A008503DA /* RCTRootView.m */; }; 830BA4551A8E3BDA00D53203 /* RCTCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 830BA4541A8E3BDA00D53203 /* RCTCache.m */; }; 832348161A77A5AA00B55238 /* Layout.c in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FC71A68125100A75B9A /* Layout.c */; }; - 835DD1321A7FDFB600D561F7 /* RCTText.m in Sources */ = {isa = PBXBuildFile; fileRef = 835DD1311A7FDFB600D561F7 /* RCTText.m */; }; 83CBBA511A601E3B00E9B192 /* RCTAssert.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA4B1A601E3B00E9B192 /* RCTAssert.m */; }; 83CBBA521A601E3B00E9B192 /* RCTLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA4E1A601E3B00E9B192 /* RCTLog.m */; }; 83CBBA531A601E3B00E9B192 /* RCTUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA501A601E3B00E9B192 /* RCTUtils.m */; }; @@ -76,14 +67,6 @@ 134FCB3A1A6E7F0800051CC8 /* RCTContextExecutor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTContextExecutor.m; sourceTree = ""; }; 134FCB3B1A6E7F0800051CC8 /* RCTWebViewExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebViewExecutor.h; sourceTree = ""; }; 134FCB3C1A6E7F0800051CC8 /* RCTWebViewExecutor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWebViewExecutor.m; sourceTree = ""; }; - 1370293F1A698FF000575408 /* RCTNetworkImageViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNetworkImageViewManager.h; sourceTree = ""; }; - 137029401A698FF000575408 /* RCTNetworkImageViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTNetworkImageViewManager.m; sourceTree = ""; }; - 1370294E1A6990A100575408 /* RCTNetworkImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNetworkImageView.h; sourceTree = ""; }; - 1370294F1A6990A100575408 /* RCTNetworkImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTNetworkImageView.m; sourceTree = ""; }; - 137029511A69923600575408 /* RCTImageDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageDownloader.h; sourceTree = ""; }; - 137029521A69923600575408 /* RCTImageDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageDownloader.m; sourceTree = ""; }; - 137029571A6C197000575408 /* RCTRawTextManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRawTextManager.h; sourceTree = ""; }; - 137029581A6C197000575408 /* RCTRawTextManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRawTextManager.m; sourceTree = ""; }; 13723B4E1A82FD3C00F88898 /* RCTStatusBarManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTStatusBarManager.h; sourceTree = ""; }; 13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTStatusBarManager.m; sourceTree = ""; }; 13A1F71C1A75392D00D3D453 /* RCTKeyCommands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTKeyCommands.h; sourceTree = ""; }; @@ -101,12 +84,6 @@ 13B07FF71A6947C200A75B9A /* RCTScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTScrollView.m; sourceTree = ""; }; 13B07FF81A6947C200A75B9A /* RCTScrollViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTScrollViewManager.h; sourceTree = ""; }; 13B07FF91A6947C200A75B9A /* RCTScrollViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTScrollViewManager.m; sourceTree = ""; }; - 13B07FFA1A6947C200A75B9A /* RCTShadowRawText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTShadowRawText.h; sourceTree = ""; }; - 13B07FFB1A6947C200A75B9A /* RCTShadowRawText.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTShadowRawText.m; sourceTree = ""; }; - 13B07FFC1A6947C200A75B9A /* RCTShadowText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTShadowText.h; sourceTree = ""; }; - 13B07FFD1A6947C200A75B9A /* RCTShadowText.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTShadowText.m; sourceTree = ""; }; - 13B080021A6947C200A75B9A /* RCTTextManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTextManager.h; sourceTree = ""; }; - 13B080031A6947C200A75B9A /* RCTTextManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTextManager.m; sourceTree = ""; }; 13B0800C1A69489C00A75B9A /* RCTNavigator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNavigator.h; sourceTree = ""; }; 13B0800D1A69489C00A75B9A /* RCTNavigator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTNavigator.m; sourceTree = ""; }; 13B0800E1A69489C00A75B9A /* RCTNavigatorManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNavigatorManager.h; sourceTree = ""; }; @@ -123,8 +100,6 @@ 13B080191A69489C00A75B9A /* RCTUIActivityIndicatorViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIActivityIndicatorViewManager.m; sourceTree = ""; }; 13B080231A694A8400A75B9A /* RCTWrapperViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWrapperViewController.h; sourceTree = ""; }; 13B080241A694A8400A75B9A /* RCTWrapperViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWrapperViewController.m; sourceTree = ""; }; - 13B080271A694C4900A75B9A /* RCTDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDataManager.h; sourceTree = ""; }; - 13B080281A694C4900A75B9A /* RCTDataManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDataManager.m; sourceTree = ""; }; 13DB9D681A8CC58200429C20 /* RCTAnimationType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAnimationType.h; sourceTree = ""; }; 13E067481A70F434002CDEE1 /* RCTUIManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTUIManager.h; sourceTree = ""; }; 13E067491A70F434002CDEE1 /* RCTUIManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIManager.m; sourceTree = ""; }; @@ -143,8 +118,6 @@ 830A229D1A66C68A008503DA /* RCTRootView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootView.m; sourceTree = ""; }; 830BA4531A8E3BDA00D53203 /* RCTCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTCache.h; sourceTree = ""; }; 830BA4541A8E3BDA00D53203 /* RCTCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTCache.m; sourceTree = ""; }; - 835DD1301A7FDFB600D561F7 /* RCTText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTText.h; sourceTree = ""; }; - 835DD1311A7FDFB600D561F7 /* RCTText.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTText.m; sourceTree = ""; }; 83BEE46C1A6D19BC00B5863B /* RCTSparseArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSparseArray.h; sourceTree = ""; }; 83BEE46D1A6D19BC00B5863B /* RCTSparseArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSparseArray.m; sourceTree = ""; }; 83CBBA2E1A601D0E00E9B192 /* libReactKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libReactKit.a; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -206,8 +179,6 @@ children = ( 13B07FE71A69327A00A75B9A /* RCTAlertManager.h */, 13B07FE81A69327A00A75B9A /* RCTAlertManager.m */, - 13B080271A694C4900A75B9A /* RCTDataManager.h */, - 13B080281A694C4900A75B9A /* RCTDataManager.m */, 13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */, 13B07FEA1A69327A00A75B9A /* RCTExceptionsManager.m */, 13723B4E1A82FD3C00F88898 /* RCTStatusBarManager.h */, @@ -231,34 +202,20 @@ 13B080111A69489C00A75B9A /* RCTNavItem.m */, 13B080121A69489C00A75B9A /* RCTNavItemManager.h */, 13B080131A69489C00A75B9A /* RCTNavItemManager.m */, - 1370294E1A6990A100575408 /* RCTNetworkImageView.h */, - 1370294F1A6990A100575408 /* RCTNetworkImageView.m */, - 1370293F1A698FF000575408 /* RCTNetworkImageViewManager.h */, - 137029401A698FF000575408 /* RCTNetworkImageViewManager.m */, - 137029571A6C197000575408 /* RCTRawTextManager.h */, - 137029581A6C197000575408 /* RCTRawTextManager.m */, 13B07FF61A6947C200A75B9A /* RCTScrollView.h */, 13B07FF71A6947C200A75B9A /* RCTScrollView.m */, 13B07FF81A6947C200A75B9A /* RCTScrollViewManager.h */, 13B07FF91A6947C200A75B9A /* RCTScrollViewManager.m */, - 13B07FFA1A6947C200A75B9A /* RCTShadowRawText.h */, - 13B07FFB1A6947C200A75B9A /* RCTShadowRawText.m */, - 13B07FFC1A6947C200A75B9A /* RCTShadowText.h */, - 13B07FFD1A6947C200A75B9A /* RCTShadowText.m */, 13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */, 13E0674C1A70F44B002CDEE1 /* RCTShadowView.m */, 1302F0F91A78550100EBEF02 /* RCTStaticImage.h */, 1302F0FA1A78550100EBEF02 /* RCTStaticImage.m */, 1302F0FB1A78550100EBEF02 /* RCTStaticImageManager.h */, 1302F0FC1A78550100EBEF02 /* RCTStaticImageManager.m */, - 835DD1301A7FDFB600D561F7 /* RCTText.h */, - 835DD1311A7FDFB600D561F7 /* RCTText.m */, 13B080141A69489C00A75B9A /* RCTTextField.h */, 13B080151A69489C00A75B9A /* RCTTextField.m */, 13B080161A69489C00A75B9A /* RCTTextFieldManager.h */, 13B080171A69489C00A75B9A /* RCTTextFieldManager.m */, - 13B080021A6947C200A75B9A /* RCTTextManager.h */, - 13B080031A6947C200A75B9A /* RCTTextManager.m */, 13B080181A69489C00A75B9A /* RCTUIActivityIndicatorViewManager.h */, 13B080191A69489C00A75B9A /* RCTUIActivityIndicatorViewManager.m */, 13E0674F1A70F44B002CDEE1 /* RCTView.h */, @@ -317,8 +274,6 @@ 83CBBACB1A6023D300E9B192 /* RCTConvert.m */, 83CBBA651A601EF300E9B192 /* RCTEventDispatcher.h */, 83CBBA661A601EF300E9B192 /* RCTEventDispatcher.m */, - 137029511A69923600575408 /* RCTImageDownloader.h */, - 137029521A69923600575408 /* RCTImageDownloader.m */, 83CBBA4C1A601E3B00E9B192 /* RCTInvalidating.h */, 83CBBA631A601ECA00E9B192 /* RCTJavaScriptExecutor.h */, 13EFFCCF1A98E6FE002607DC /* RCTJSMethodRegistrar.h */, @@ -436,32 +391,23 @@ 13B0801F1A69489C00A75B9A /* RCTTextFieldManager.m in Sources */, 134FCB3D1A6E7F0800051CC8 /* RCTContextExecutor.m in Sources */, 13E067591A70F44B002CDEE1 /* UIView+ReactKit.m in Sources */, - 835DD1321A7FDFB600D561F7 /* RCTText.m in Sources */, - 137029531A69923600575408 /* RCTImageDownloader.m in Sources */, 83CBBA981A6020BB00E9B192 /* RCTTouchHandler.m in Sources */, 83CBBA521A601E3B00E9B192 /* RCTLog.m in Sources */, - 13B080071A6947C200A75B9A /* RCTShadowRawText.m in Sources */, 13B0801D1A69489C00A75B9A /* RCTNavItemManager.m in Sources */, - 137029501A6990A100575408 /* RCTNetworkImageView.m in Sources */, 13E067571A70F44B002CDEE1 /* RCTView.m in Sources */, 134FCB361A6D42D900051CC8 /* RCTSparseArray.m in Sources */, - 137029491A698FF000575408 /* RCTNetworkImageViewManager.m in Sources */, 13A1F71E1A75392D00D3D453 /* RCTKeyCommands.m in Sources */, 83CBBA531A601E3B00E9B192 /* RCTUtils.m in Sources */, 83CBBA601A601EAA00E9B192 /* RCTBridge.m in Sources */, - 13B080081A6947C200A75B9A /* RCTShadowText.m in Sources */, 13E067551A70F44B002CDEE1 /* RCTShadowView.m in Sources */, 13B0801A1A69489C00A75B9A /* RCTNavigator.m in Sources */, 830BA4551A8E3BDA00D53203 /* RCTCache.m in Sources */, 134FCB3E1A6E7F0800051CC8 /* RCTWebViewExecutor.m in Sources */, 13B0801C1A69489C00A75B9A /* RCTNavItem.m in Sources */, 83CBBA691A601EF300E9B192 /* RCTEventDispatcher.m in Sources */, - 134FCB371A6D4ED700051CC8 /* RCTRawTextManager.m in Sources */, - 13B0800B1A6947C200A75B9A /* RCTTextManager.m in Sources */, 13E0674A1A70F434002CDEE1 /* RCTUIManager.m in Sources */, 1302F0FE1A78550100EBEF02 /* RCTStaticImageManager.m in Sources */, 13B0801B1A69489C00A75B9A /* RCTNavigatorManager.m in Sources */, - 13B080291A694C4900A75B9A /* RCTDataManager.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -552,6 +498,10 @@ "$(inherited)", ); GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -562,6 +512,10 @@ isa = XCBuildConfiguration; buildSettings = { GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; diff --git a/ReactKit/ReactKit.xcodeproj/xcshareddata/xcschemes/ReactKit.xcscheme b/ReactKit/ReactKit.xcodeproj/xcshareddata/xcschemes/ReactKit.xcscheme deleted file mode 100644 index 17a608c33..000000000 --- a/ReactKit/ReactKit.xcodeproj/xcshareddata/xcschemes/ReactKit.xcscheme +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ReactKit/Views/RCTTextFieldManager.m b/ReactKit/Views/RCTTextFieldManager.m index 339a7803e..368bf1d7d 100644 --- a/ReactKit/Views/RCTTextFieldManager.m +++ b/ReactKit/Views/RCTTextFieldManager.m @@ -19,6 +19,7 @@ RCT_EXPORT_VIEW_PROPERTY(enabled) RCT_EXPORT_VIEW_PROPERTY(placeholder) RCT_EXPORT_VIEW_PROPERTY(text) RCT_EXPORT_VIEW_PROPERTY(font) +RCT_EXPORT_VIEW_PROPERTY(clearButtonMode) RCT_REMAP_VIEW_PROPERTY(autoCapitalize, autocapitalizationType) RCT_EXPORT_VIEW_PROPERTY(keyboardType) RCT_REMAP_VIEW_PROPERTY(color, textColor) diff --git a/packager/react-packager/src/JSTransformer/index.js b/packager/react-packager/src/JSTransformer/index.js index 4f98d588c..e3e713eef 100644 --- a/packager/react-packager/src/JSTransformer/index.js +++ b/packager/react-packager/src/JSTransformer/index.js @@ -40,7 +40,7 @@ var validateOpts = declareOpts({ }, transformModulePath: { type:'string', - required: true, + required: false, }, nonPersistent: { type: 'boolean', diff --git a/packager/react-packager/src/Packager/index.js b/packager/react-packager/src/Packager/index.js index ddcab6ee6..42295acc8 100644 --- a/packager/react-packager/src/Packager/index.js +++ b/packager/react-packager/src/Packager/index.js @@ -42,7 +42,7 @@ var validateOpts = declareOpts({ }, transformModulePath: { type:'string', - required: true, + required: false, }, nonPersistent: { type: 'boolean', diff --git a/packager/react-packager/src/Server/index.js b/packager/react-packager/src/Server/index.js index 1f5b7ff18..14b18c965 100644 --- a/packager/react-packager/src/Server/index.js +++ b/packager/react-packager/src/Server/index.js @@ -40,7 +40,7 @@ var validateOpts = declareOpts({ }, transformModulePath: { type:'string', - required: true, + required: false, }, nonPersistent: { type: 'boolean', From 70601412471437257bf594cf8da0c0ded100b462 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Mon, 2 Mar 2015 11:36:55 -0800 Subject: [PATCH 05/79] Updates from Mon Mar 2 - [ReactNative] Move merge & mergeInto from downstream to vendor | Christopher Chedeau - [ReactNative] Replace all the call sites of mergeInto by Object.assign | Christopher Chedeau - [WIP] Migrated View Managers over to new architecture | Nick Lockwood - [ReactNative] Replace all the call sites of copyProperties by Object.assign | Christopher Chedeau - [ReactNative] Migrate navigator.geolocation to open source | Christopher Chedeau - [ReactNative] Remove README.md, LICENSE and .travis.yml from fbobjc | Christopher Chedeau - [react-packager] Better transform errors | Amjad Masad - [React Native][react-packager] Fix test runner and fialing tests | Amjad Masad --- .../RCTNetworkImage/RCTNetworkImageView.h | 3 +- .../Pods/Headers/Public/ReactKit/RCTBridge.h | 46 +- .../Headers/Public/ReactKit/RCTBridgeModule.h | 24 +- .../Public/ReactKit/RCTJavaScriptExecutor.h | 2 +- .../Public/ReactKit/RCTLocationObserver.h | 7 + .../Pods/Headers/Public/ReactKit/RCTLog.h | 51 +- .../Headers/Public/ReactKit/RCTNavigator.h | 2 +- .../Headers/Public/ReactKit/RCTScrollView.h | 4 +- .../Headers/Public/ReactKit/RCTShadowView.h | 46 +- .../Headers/Public/ReactKit/RCTTextField.h | 2 +- .../Headers/Public/ReactKit/RCTTouchHandler.h | 2 +- .../Headers/Public/ReactKit/RCTUIManager.h | 30 + .../Pods/Headers/Public/ReactKit/RCTUtils.h | 19 +- .../Pods/Headers/Public/ReactKit/RCTView.h | 1 - .../Headers/Public/ReactKit/RCTViewManager.h | 55 +- .../Public/ReactKit/RCTViewNodeProtocol.h | 4 +- .../ReactKit/RCTWrapperViewController.h | 7 +- .../Pods/Pods.xcodeproj/project.pbxproj | 7940 +++++++++-------- .../RCTNetworkImage/RCTNetworkImageView.h | 3 +- .../Pods/Headers/Public/ReactKit/RCTBridge.h | 46 +- .../Headers/Public/ReactKit/RCTBridgeModule.h | 24 +- .../Public/ReactKit/RCTJavaScriptExecutor.h | 2 +- .../Public/ReactKit/RCTLocationObserver.h | 7 + .../Pods/Headers/Public/ReactKit/RCTLog.h | 51 +- .../Headers/Public/ReactKit/RCTNavigator.h | 2 +- .../Headers/Public/ReactKit/RCTScrollView.h | 4 +- .../Headers/Public/ReactKit/RCTShadowView.h | 46 +- .../Headers/Public/ReactKit/RCTTextField.h | 2 +- .../Headers/Public/ReactKit/RCTTouchHandler.h | 2 +- .../Headers/Public/ReactKit/RCTUIManager.h | 30 + .../Pods/Headers/Public/ReactKit/RCTUtils.h | 19 +- .../Pods/Headers/Public/ReactKit/RCTView.h | 1 - .../Headers/Public/ReactKit/RCTViewManager.h | 55 +- .../Public/ReactKit/RCTViewNodeProtocol.h | 4 +- .../ReactKit/RCTWrapperViewController.h | 7 +- .../Pods/Pods.xcodeproj/project.pbxproj | 6370 ++++++------- Examples/UIExplorer/GeoLocationExample.js | 72 + Examples/UIExplorer/Info.plist | 2 + .../UIExplorer.xcodeproj/project.pbxproj | 166 +- Examples/UIExplorer/UIExplorerList.js | 1 + .../Components/Navigation/NavigatorIOS.ios.js | 4 +- .../Components/TextInput/TextInput.ios.js | 3 +- .../Touchable/TouchableWithoutFeedback.js | 3 +- Libraries/GeoLocation/GeoLocation.js | 98 + Libraries/Image/RCTNetworkImageView.h | 3 +- Libraries/Image/RCTNetworkImageView.m | 5 - .../InitializeJavaScriptAppEngine.js | 6 + Libraries/Network/RCTDataManager.m | 3 +- .../RCTDataManager.xcodeproj/project.pbxproj | 8 + Libraries/Text/RCTTextManager.m | 50 +- Libraries/Utilities/Dimensions.js | 3 +- Libraries/vendor/core/merge.js | 50 + Libraries/vendor/core/mergeInto.js | 59 + ReactKit/Base/RCTBridge.h | 46 +- ReactKit/Base/RCTBridge.m | 654 +- ReactKit/Base/RCTBridgeModule.h | 24 +- ReactKit/Base/RCTJavaScriptExecutor.h | 2 +- ReactKit/Base/RCTLog.h | 51 +- ReactKit/Base/RCTLog.m | 36 +- ReactKit/Base/RCTRedBox.m | 47 +- ReactKit/Base/RCTRootView.m | 16 +- ReactKit/Base/RCTTouchHandler.h | 2 +- ReactKit/Base/RCTTouchHandler.m | 5 - ReactKit/Base/RCTUtils.h | 19 +- ReactKit/Base/RCTUtils.m | 25 + ReactKit/Base/RCTViewNodeProtocol.h | 4 +- ReactKit/Executors/RCTContextExecutor.m | 2 +- ReactKit/Modules/RCTAlertManager.m | 6 +- ReactKit/Modules/RCTLocationObserver.h | 7 + ReactKit/Modules/RCTLocationObserver.m | 185 + ReactKit/Modules/RCTStatusBarManager.m | 2 +- ReactKit/Modules/RCTTiming.m | 30 +- ReactKit/Modules/RCTUIManager.h | 30 + ReactKit/Modules/RCTUIManager.m | 370 +- ReactKit/ReactKit.xcodeproj/project.pbxproj | 6 + ReactKit/Views/RCTNavigator.h | 2 +- ReactKit/Views/RCTNavigator.m | 34 +- ReactKit/Views/RCTNavigatorManager.m | 25 +- ReactKit/Views/RCTScrollView.h | 4 +- ReactKit/Views/RCTScrollView.m | 8 +- ReactKit/Views/RCTScrollViewManager.m | 17 +- ReactKit/Views/RCTShadowView.h | 46 +- ReactKit/Views/RCTShadowView.m | 104 +- ReactKit/Views/RCTStaticImageManager.m | 6 +- ReactKit/Views/RCTTextField.h | 2 +- ReactKit/Views/RCTTextField.m | 9 +- ReactKit/Views/RCTTextFieldManager.m | 29 +- .../Views/RCTUIActivityIndicatorViewManager.m | 9 +- ReactKit/Views/RCTView.h | 1 - ReactKit/Views/RCTView.m | 8 +- ReactKit/Views/RCTViewManager.h | 55 +- ReactKit/Views/RCTViewManager.m | 88 +- ReactKit/Views/RCTWrapperViewController.h | 7 +- ReactKit/Views/RCTWrapperViewController.m | 5 - jestSupport/scriptPreprocess.js | 6 +- .../src/Activity/__tests__/Activity-test.js | 6 +- .../__tests__/DependencyGraph-test.js | 1 - .../src/FileWatcher/__mocks__/sane.js | 5 + .../src/JSTransformer/__mocks__/q.js | 6 + .../src/JSTransformer/__mocks__/underscore.js | 5 + .../src/JSTransformer/__tests__/Cache-test.js | 3 +- .../__tests__/Transformer-test.js | 5 +- .../react-packager/src/JSTransformer/index.js | 34 +- .../src/Packager/__tests__/Package-test.js | 6 +- .../src/Packager/__tests__/Packager-test.js | 2 +- packager/react-packager/src/Packager/index.js | 4 +- .../src/Server/__tests__/Server-test.js | 14 +- packager/react-packager/src/Server/index.js | 1 + packager/transformer.js | 9 +- 109 files changed, 9051 insertions(+), 8540 deletions(-) create mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTLocationObserver.h create mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLocationObserver.h create mode 100644 Examples/UIExplorer/GeoLocationExample.js create mode 100644 Libraries/GeoLocation/GeoLocation.js create mode 100644 Libraries/vendor/core/merge.js create mode 100644 Libraries/vendor/core/mergeInto.js create mode 100644 ReactKit/Modules/RCTLocationObserver.h create mode 100644 ReactKit/Modules/RCTLocationObserver.m create mode 100644 packager/react-packager/src/FileWatcher/__mocks__/sane.js create mode 100644 packager/react-packager/src/JSTransformer/__mocks__/q.js create mode 100644 packager/react-packager/src/JSTransformer/__mocks__/underscore.js diff --git a/Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h b/Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h index c99ed0689..920bf705c 100644 --- a/Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h +++ b/Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h @@ -6,7 +6,8 @@ @interface RCTNetworkImageView : UIView -- (instancetype)initWithFrame:(CGRect)frame imageDownloader:(RCTImageDownloader *)imageDownloader; +- (instancetype)initWithFrame:(CGRect)frame + imageDownloader:(RCTImageDownloader *)imageDownloader NS_DESIGNATED_INITIALIZER; /** * An image that will appear while the view is loading the image from the network, diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridge.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridge.h index 9a890a07a..4dcaee8e2 100644 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridge.h +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridge.h @@ -6,32 +6,16 @@ @class RCTBridge; @class RCTEventDispatcher; -@class RCTRootView; - -/** - * Utilities for constructing common response objects. When sending a - * systemError back to JS, it's important to describe whether or not it was a - * system error, or API usage error. System errors should never happen and are - * therefore logged using `RCTLogError()`. API usage errors are expected if the - * API is misused and will therefore not be logged using `RCTLogError()`. The JS - * application code is expected to handle them. Regardless of type, each error - * should be logged at most once. - */ -static inline NSDictionary *RCTSystemErrorObject(NSString *msg) -{ - return @{@"systemError": msg ?: @""}; -} - -static inline NSDictionary *RCTAPIErrorObject(NSString *msg) -{ - return @{@"apiError": msg ?: @""}; -} /** * This block can be used to instantiate modules that require additional * init parameters, or additional configuration prior to being used. + * The bridge will call this block to instatiate the modules, and will + * be responsible for invalidating/releasing them when the bridge is destroyed. + * For this reason, the block should always return new module instances, and + * module instances should not be shared between bridges. */ -typedef NSArray *(^RCTBridgeModuleProviderBlock)(RCTBridge *bridge); +typedef NSArray *(^RCTBridgeModuleProviderBlock)(void); /** * Async batched bridge used to communicate with the JavaScript application. @@ -42,12 +26,12 @@ typedef NSArray *(^RCTBridgeModuleProviderBlock)(RCTBridge *bridge); * The designated initializer. This creates a new bridge on top of the specified * executor. The bridge should then be used for all subsequent communication * with the JavaScript code running in the executor. Modules will be automatically - * instantiated using the default contructor, but you can optionally pass in a - * module provider block to manually instantiate modules that require additional - * init parameters or configuration. + * instantiated using the default contructor, but you can optionally pass in an + * array of pre-initialized module instances if they require additional init + * parameters or configuration. */ -- (instancetype)initWithJavaScriptExecutor:(id)javaScriptExecutor - moduleProvider:(RCTBridgeModuleProviderBlock)block NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithExecutor:(id)executor + moduleProvider:(RCTBridgeModuleProviderBlock)block NS_DESIGNATED_INITIALIZER; /** * This method is used to call functions in the JavaScript application context. @@ -81,16 +65,6 @@ typedef NSArray *(^RCTBridgeModuleProviderBlock)(RCTBridge *bridge); */ @property (nonatomic, readonly) dispatch_queue_t shadowQueue; -// For use in implementing delegates, which may need to queue responses. -- (RCTResponseSenderBlock)createResponseSenderBlock:(NSInteger)callbackID; - -/** - * Register a root view with the bridge. Theorectically, a single bridge can - * support multiple root views, however this feature is not currently exposed - * and may eventually be removed. - */ -- (void)registerRootView:(RCTRootView *)rootView; - /** * Global logging function that will print to both xcode and JS debugger consoles. * diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridgeModule.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridgeModule.h index d9df70a22..2627a0b9f 100644 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridgeModule.h +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridgeModule.h @@ -19,10 +19,12 @@ typedef void (^RCTResponseSenderBlock)(NSArray *response); @optional /** - * Optional initializer for modules that require access - * to bridge features, such as sending events or making JS calls + * A reference to the RCTBridge. Useful for modules that require access + * to bridge features, such as sending events or making JS calls. This + * will be set automatically by the bridge when it initializes the module. +* To implement this in your module, just add @synthesize bridge = _bridge; */ -- (instancetype)initWithBridge:(RCTBridge *)bridge; +@property (nonatomic, strong) RCTBridge *bridge; /** * The module name exposed to JS. If omitted, this will be inferred @@ -42,17 +44,11 @@ typedef void (^RCTResponseSenderBlock)(NSArray *response); /** * Injects constants into JS. These constants are made accessible via - * NativeModules.moduleName.X. Note that this method is not inherited when you - * subclass a module, and you should not call [super constantsToExport] when - * implementing it. - */ -+ (NSDictionary *)constantsToExport; - -/** - * Some "constants" are not really constant, and need to be re-generated - * each time the bridge module is created. Support for this feature is - * deprecated and may be going away or changing, but for now you can use - * the -constantsToExport instance method to register these "pseudo-constants". + * NativeModules.ModuleName.X. This method is called when the module is + * registered by the bridge. It is only called once for the lifetime of the + * bridge, so it is not suitable for returning dynamic values, but may be + * used for long-lived values such as session keys, that are regenerated only + * as part of a reload of the entire React application. */ - (NSDictionary *)constantsToExport; diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h index 7062570a4..4d32f1c2f 100644 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h @@ -5,7 +5,7 @@ #import "RCTInvalidating.h" typedef void (^RCTJavaScriptCompleteBlock)(NSError *error); -typedef void (^RCTJavaScriptCallback)(id objcValue, NSError *error); +typedef void (^RCTJavaScriptCallback)(id json, NSError *error); /** * Abstracts away a JavaScript execution context - we may be running code in a diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTLocationObserver.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTLocationObserver.h new file mode 100644 index 000000000..ad3ba2ce2 --- /dev/null +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTLocationObserver.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTBridgeModule.h" + +@interface RCTLocationObserver : NSObject + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTLog.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTLog.h index a97d13458..ba72bc8ff 100644 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTLog.h +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTLog.h @@ -20,28 +20,22 @@ // If defined, only log messages that match this regex will fatal #define RCTLOG_FATAL_REGEX nil -#define _RCTLog(__RCTLog__level, ...) do { \ - NSString *__RCTLog__levelStr; \ - switch(__RCTLog__level) { \ - case RCTLOG_INFO: __RCTLog__levelStr = @"info"; break; \ - case RCTLOG_WARN: __RCTLog__levelStr = @"warn"; break; \ - case RCTLOG_ERROR: __RCTLog__levelStr = @"error"; break; \ - case RCTLOG_MUSTFIX: __RCTLog__levelStr = @"mustfix"; break; \ - } \ - NSString *__RCTLog__msg = _RCTLogObjects(RCTLogFormat(__VA_ARGS__), __RCTLog__levelStr); \ - if (__RCTLog__level >= RCTLOG_FATAL_LEVEL) { \ - BOOL __RCTLog__fail = YES; \ - if (RCTLOG_FATAL_REGEX) { \ - NSError *__RCTLog__e; \ - NSRegularExpression *__RCTLog__regex = [NSRegularExpression regularExpressionWithPattern:RCTLOG_FATAL_REGEX options:0 error:&__RCTLog__e]; \ - __RCTLog__fail = [__RCTLog__regex numberOfMatchesInString:__RCTLog__msg options:0 range:NSMakeRange(0, [__RCTLog__msg length])] > 0; \ - } \ - RCTCAssert(!__RCTLog__fail, @"RCTLOG_FATAL_LEVEL %@: %@", __RCTLog__levelStr, __RCTLog__msg); \ - } \ - if (__RCTLog__level >= RCTLOG_REDBOX_LEVEL) { \ - RCTRedBox *__RCTLog__redBox = [RCTRedBox sharedInstance]; \ - [__RCTLog__redBox showErrorMessage:__RCTLog__msg]; \ - } \ +extern __unsafe_unretained NSString *RCTLogLevels[]; + +#define _RCTLog(_level, ...) do { \ + NSString *__RCTLog__levelStr = RCTLogLevels[_level - 1]; \ + NSString *__RCTLog__msg = RCTLogObjects(RCTLogFormat(__FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__), __RCTLog__levelStr); \ + if (_level >= RCTLOG_FATAL_LEVEL) { \ + BOOL __RCTLog__fail = YES; \ + if (RCTLOG_FATAL_REGEX) { \ + NSRegularExpression *__RCTLog__regex = [NSRegularExpression regularExpressionWithPattern:RCTLOG_FATAL_REGEX options:0 error:NULL]; \ + __RCTLog__fail = [__RCTLog__regex numberOfMatchesInString:__RCTLog__msg options:0 range:NSMakeRange(0, [__RCTLog__msg length])] > 0; \ + } \ + RCTCAssert(!__RCTLog__fail, @"RCTLOG_FATAL_LEVEL %@: %@", __RCTLog__levelStr, __RCTLog__msg); \ + } \ + if (_level >= RCTLOG_REDBOX_LEVEL) { \ + [[RCTRedBox sharedInstance] showErrorMessage:__RCTLog__msg]; \ + } \ } while (0) #define RCTLog(...) _RCTLog(RCTLOG_INFO, __VA_ARGS__) @@ -50,20 +44,15 @@ #define RCTLogError(...) _RCTLog(RCTLOG_ERROR, __VA_ARGS__) #define RCTLogMustFix(...) _RCTLog(RCTLOG_MUSTFIX, __VA_ARGS__) -#define RCTLogFormat(...) _RCTLogFormat(__FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__) -#define RCTLogFormatString(...) _RCTLogFormatString(__FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__) - #ifdef __cplusplus extern "C" { #endif -NSString *_RCTLogObjects(NSArray *objects, NSString *level); -NSArray *_RCTLogFormat(const char *file, int lineNumber, const char *funcName, NSString *format, ...) NS_FORMAT_FUNCTION(4,5); -NSString *_RCTLogFormatString(const char *file, int lineNumber, const char *funcName, NSString *format, ...) NS_FORMAT_FUNCTION(4,5); +NSString *RCTLogObjects(NSArray *objects, NSString *level); +NSArray *RCTLogFormat(const char *file, int lineNumber, const char *funcName, NSString *format, ...) NS_FORMAT_FUNCTION(4,5); + +void RCTInjectLogFunction(void (^logFunction)(NSString *msg)); #ifdef __cplusplus } #endif - -typedef void (^RCTLogFunction)(NSString *format, NSString *str); -void RCTInjectLogFunction(RCTLogFunction func); diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigator.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigator.h index 5d928efa7..c9051c753 100644 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigator.h +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigator.h @@ -11,7 +11,7 @@ @property (nonatomic, strong) UIView *reactNavSuperviewLink; @property (nonatomic, assign) NSInteger requestedTopOfStack; -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; /** * Schedules a JavaScript navigation and prevents `UIKit` from navigating until diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollView.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollView.h index 82667b205..204ddf494 100644 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollView.h +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollView.h @@ -12,6 +12,8 @@ @interface RCTScrollView : RCTView +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; + /** * If the `contentSize` is not provided, then the `contentSize` will * automatically be determined by the size of the `RKScrollView` subview. @@ -32,6 +34,4 @@ @property (nonatomic, assign) BOOL centerContent; @property (nonatomic, copy) NSArray *stickyHeaderIndices; -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; - @end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTShadowView.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTShadowView.h index ec2b8c353..9a09bad4f 100644 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTShadowView.h +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTShadowView.h @@ -3,29 +3,15 @@ #import #import "Layout.h" +#import "RCTUIManager.h" #import "RCTViewNodeProtocol.h" @class RCTSparseArray; -// TODO: amalgamate these enums? -typedef NS_ENUM(NSUInteger, RCTLayoutLifecycle) { - RCTLayoutLifecycleUninitialized = 0, - RCTLayoutLifecycleComputed, - RCTLayoutLifecycleDirtied, -}; - -// TODO: is this still needed? -typedef NS_ENUM(NSUInteger, RCTPropagationLifecycle) { - RCTPropagationLifecycleUninitialized = 0, - RCTPropagationLifecycleComputed, - RCTPropagationLifecycleDirtied, -}; - -// TODO: move this to text node? -typedef NS_ENUM(NSUInteger, RCTTextLifecycle) { - RCTTextLifecycleUninitialized = 0, - RCTTextLifecycleComputed, - RCTTextLifecycleDirtied, +typedef NS_ENUM(NSUInteger, RCTUpdateLifecycle) { + RCTUpdateLifecycleUninitialized = 0, + RCTUpdateLifecycleComputed, + RCTUpdateLifecycleDirtied, }; // TODO: is this redundact now? @@ -48,7 +34,7 @@ typedef void (^RCTApplierBlock)(RCTSparseArray *); @property (nonatomic, copy) NSString *moduleName; @property (nonatomic, assign) BOOL isBGColorExplicitlySet; // Used to propogate to children @property (nonatomic, strong) UIColor *backgroundColor; // Used to propogate to children -@property (nonatomic, assign) RCTLayoutLifecycle layoutLifecycle; +@property (nonatomic, assign) RCTUpdateLifecycle layoutLifecycle; /** * isNewView - Used to track the first time the view is introduced into the hierarchy. It is initialized YES, then is @@ -122,11 +108,23 @@ typedef void (^RCTApplierBlock)(RCTSparseArray *); @property (nonatomic, assign) css_wrap_type_t flexWrap; @property (nonatomic, assign) CGFloat flex; -- (void)collectUpdatedProperties:(NSMutableSet *)viewsWithNewProperties parentProperties:(NSDictionary *)parentProperties; -- (void)collectRootUpdatedFrames:(NSMutableSet *)viewsWithNewFrame parentConstraint:(CGSize)parentConstraint; -- (void)fillCSSNode:(css_node_t *)node; +/** + * Calculate property changes that need to be propagated to the view. + * The applierBlocks set contains RCTApplierBlock functions that must be applied + * on the main thread in order to update the view. + */ +- (void)collectUpdatedProperties:(NSMutableSet *)applierBlocks parentProperties:(NSDictionary *)parentProperties; -// The following are implementation details exposed to subclasses. Do not call them directly +/** + * Calculate all views whose frame needs updating after layout has been calculated. + * The viewsWithNewFrame set contains the reactTags of the views that need updating. + */ +- (void)collectRootUpdatedFrames:(NSMutableSet *)viewsWithNewFrame parentConstraint:(CGSize)parentConstraint; + +/** + * The following are implementation details exposed to subclasses. Do not call them directly + */ +- (void)fillCSSNode:(css_node_t *)node; - (void)dirtyLayout; - (BOOL)isLayoutDirty; diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextField.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextField.h index 2a0225f27..1688f8fdc 100644 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextField.h +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextField.h @@ -10,6 +10,6 @@ @property (nonatomic, assign) BOOL autoCorrect; @property (nonatomic, assign) UIEdgeInsets paddingEdgeInsets; // TODO: contentInset -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; @end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTouchHandler.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTouchHandler.h index 53379a78a..46c81b9ef 100644 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTouchHandler.h +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTouchHandler.h @@ -8,7 +8,7 @@ @interface RCTTouchHandler : UIGestureRecognizer -- (instancetype)initWithBridge:(RCTBridge *)bridge; +- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; - (void)startOrResetInteractionTiming; - (NSDictionary *)endAndResetInteractionTiming; diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIManager.h index 87e91118a..701c37f93 100644 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIManager.h +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIManager.h @@ -2,13 +2,18 @@ #import +#import "RCTBridge.h" #import "RCTBridgeModule.h" #import "RCTInvalidating.h" +#import "RCTViewManager.h" @class RCTRootView; @protocol RCTScrollableProtocol; +/** + * The RCTUIManager is the module responsible for updating the view hierarchy. + */ @interface RCTUIManager : NSObject @property (nonatomic, weak) id mainScrollView; @@ -19,8 +24,33 @@ */ @property (nonatomic, readwrite, weak) id nativeMainScrollDelegate; +/** + * Register a root view with the RCTUIManager. Theoretically, a single manager + * can support multiple root views, however this feature is not currently exposed + * and may eventually be removed. + */ - (void)registerRootView:(RCTRootView *)rootView; +/** + * Schedule a block to be executed on the UI thread. Useful if you need to execute + * view logic after all currently queued view updates have completed. + */ +- (void)addUIBlock:(RCTViewManagerUIBlock)block; + +/** + * The view that is currently first responder, according to the JS context. + */ + (UIView *)JSResponder; @end + +/** + * This category makes the current RCTUIManager instance available via the + * RCTBridge, which is useful for RCTBridgeModules or RCTViewManagers that + * need to access the RCTUIManager. + */ +@interface RCTBridge (RCTUIManager) + +@property (nonatomic, readonly) RCTUIManager *uiManager; + +@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUtils.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUtils.h index 3612b1f27..de203e4ae 100644 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUtils.h +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUtils.h @@ -1,17 +1,15 @@ // Copyright 2004-present Facebook. All Rights Reserved. +#import + #import #import -#import #import "RCTAssert.h" -// Macro to indicate when inherited initializer is not to be used -#define RCT_NOT_DESIGNATED_INITIALIZER() \ -do { \ - RCTAssert(NO, @"%@ is not the designated initializer for instances of %@.", NSStringFromSelector(_cmd), [self class]); \ - return nil; \ -} while (0) +#ifdef __cplusplus +extern "C" { +#endif // Utility functions for JSON object <-> string serialization/deserialization NSString *RCTJSONStringify(id jsonObject, NSError **error); @@ -39,3 +37,10 @@ void RCTSwapInstanceMethods(Class cls, SEL original, SEL replacement); // Module subclass support BOOL RCTClassOverridesClassMethod(Class cls, SEL selector); BOOL RCTClassOverridesInstanceMethod(Class cls, SEL selector); + +// Enumerate all classes that conform to NSObject protocol +void RCTEnumerateClasses(void (^block)(Class cls)); + +#ifdef __cplusplus +} +#endif diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTView.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTView.h index 77dee1df8..802336633 100644 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTView.h +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTView.h @@ -11,7 +11,6 @@ @interface RCTView : UIView @property (nonatomic, assign) RCTPointerEvents pointerEvents; -@property (nonatomic, copy) NSString *overrideAccessibilityLabel; + (void)autoAdjustInsetsForView:(UIView *)parentView withScrollView:(UIScrollView *)scrollView diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewManager.h index e77be09c1..d3b7c8a01 100644 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewManager.h +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewManager.h @@ -2,9 +2,11 @@ #import +#import "RCTBridgeModule.h" #import "RCTConvert.h" #import "RCTLog.h" +@class RCTBridge; @class RCTEventDispatcher; @class RCTShadowView; @class RCTSparseArray; @@ -12,19 +14,22 @@ typedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, RCTSparseArray *viewRegistry); -@interface RCTViewManager : NSObject +@interface RCTViewManager : NSObject /** - * Designated initializer for view modules. Override this when subclassing. + * The bridge can be used to access both the RCTUIIManager and the RCTEventDispatcher, + * allowing the manager (or the views that it manages) to manipulate the view + * hierarchy and send events back to the JS context. */ -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; +@property (nonatomic, strong) RCTBridge *bridge; /** * The event dispatcher is used to send events back to the JavaScript application. * It can either be used directly by the module, or passed on to instantiated * view subclasses so that they can handle their own events. */ -@property (nonatomic, readonly, weak) RCTEventDispatcher *eventDispatcher; +// TODO: remove this, as it can be accessed directly from bridge +@property (nonatomic, readonly) RCTEventDispatcher *eventDispatcher; /** * The module name exposed to React JS. If omitted, this will be inferred @@ -88,34 +93,19 @@ typedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, RCTSparseArray *v + (NSDictionary *)customDirectEventTypes; /** - * Injects constants into JS. These constants are made accessible via - * NativeModules.moduleName.X. Note that this method is not inherited when you - * subclass a view module, and you should not call [super constantsToExport] - * when overriding it. + * Called to notify manager that layout has finished, in case any calculated + * properties need to be copied over from shadow view to view. */ -+ (NSDictionary *)constantsToExport; +- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowView *)shadowView; /** - * To deprecate, hopefully + * Called after view hierarchy manipulation has finished, and all shadow props + * have been set, but before layout has been performed. Useful for performing + * custo layout logic or tasks that involve walking the view hierarchy. + * To be deprecated, hopefully. */ - (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(RCTSparseArray *)shadowViewRegistry; -/** - * Informal protocol for setting view and shadowView properties. - * Implement methods matching these patterns to set any properties that - * require special treatment (e.g. where the type or name cannot be inferred). - * - * - (void)set_:(id)property - * forView:(UIView *)view - * withDefaultView:(UIView *)defaultView; - * - * - (void)set_:(id)property - * forShadowView:(RCTShadowView *)view - * withDefaultView:(RCTShadowView *)defaultView; - * - * For simple cases, use the macros below: - */ - /** * This handles the simple case, where JS and native property names match * And the type can be automatically inferred. @@ -131,10 +121,21 @@ RCT_REMAP_VIEW_PROPERTY(name, name) - (void)set_##name:(id)json forView:(id)view withDefaultView:(id)defaultView { \ if ((json && !RCTSetProperty(view, @#keypath, json)) || \ (!json && !RCTCopyProperty(view, defaultView, @#keypath))) { \ - RCTLogMustFix(@"%@ does not have setter for `%s` property", [view class], #name); \ + RCTLogError(@"%@ does not have setter for `%s` property", [view class], #name); \ } \ } +/** + * These macros can be used when you need to provide custom logic for setting + * view properties. The macro should be followed by a method body, which can + * refer to "json", "view" and "defaultView" to implement the required logic. + */ +#define RCT_CUSTOM_VIEW_PROPERTY(name, viewType) \ +- (void)set_##name:(id)json forView:(viewType)view withDefaultView:(viewType)defaultView + +#define RCT_CUSTOM_SHADOW_PROPERTY(name, viewType) \ +- (void)set_##name:(id)json forShadowView:(viewType)view withDefaultView:(viewType)defaultView + /** * These are useful in cases where the module's superclass handles a * property, but you wish to "unhandle" it, so it will be ignored. diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h index 1fa3e252b..b6f59ea10 100644 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h @@ -8,7 +8,7 @@ */ @protocol RCTViewNodeProtocol -@property (nonatomic, strong) NSNumber *reactTag; +@property (nonatomic, copy) NSNumber *reactTag; - (void)insertReactSubview:(id)subview atIndex:(NSInteger)atIndex; - (void)removeReactSubview:(id)subview; @@ -21,6 +21,8 @@ @optional // TODO: Deprecate this +// This method is called after layout has been performed for all views known +// to the RCTViewManager. It is only called on UIViews, not shadow views. - (void)reactBridgeDidFinishTransaction; @end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h index d8f22270a..69075c6a4 100644 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h +++ b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h @@ -15,8 +15,11 @@ didMoveToNavigationController:(UINavigationController *)navigationController; @interface RCTWrapperViewController : UIViewController -- (instancetype)initWithContentView:(UIView *)contentView eventDispatcher:(RCTEventDispatcher *)eventDispatcher; -- (instancetype)initWithNavItem:(RCTNavItem *)navItem eventDispatcher:(RCTEventDispatcher *)eventDispatcher; +- (instancetype)initWithContentView:(UIView *)contentView + eventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithNavItem:(RCTNavItem *)navItem + eventDispatcher:(RCTEventDispatcher *)eventDispatcher; @property (nonatomic, readwrite, weak) id navigationListener; @property (nonatomic, strong, readwrite) RCTNavItem *navItem; diff --git a/Examples/Movies/Pods/Pods.xcodeproj/project.pbxproj b/Examples/Movies/Pods/Pods.xcodeproj/project.pbxproj index 4c4cbbb99..78abb2853 100644 --- a/Examples/Movies/Pods/Pods.xcodeproj/project.pbxproj +++ b/Examples/Movies/Pods/Pods.xcodeproj/project.pbxproj @@ -10,180 +10,42 @@ 46 objects - 01DCDFB27A48C1C7A65C2FE6 + 0173994FBD7222C1B4B85D39 - fileRef - 6DDC3764218E410C0E170649 - isa - PBXBuildFile - - 048B0A5A6D3AE173A67CAE93 - - children + buildConfigurations - ADAA64389F188489440FF394 - 7643C57FD9EC1838B0876BBD - 1E172C103C8DDDD51C260454 - 07EC0B27D8891E964C48E4D7 + F68B2AE07F4085B87FF52821 + C2BDC288A96EC2C204FACAE4 - isa - PBXGroup - name - Support Files - path - ../../Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager - sourceTree - <group> - - 0612C8DB98399C9428864589 - - fileRef - 12E89F4AD5820CD9722AD8D0 - isa - PBXBuildFile - - 06C6AEB41647779AE72D05D0 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTView.h - path - Views/RCTView.h - sourceTree - <group> - - 07192780F349FFB50B16BAE0 - - fileRef - 2CD30CF1663697474B87D08E - isa - PBXBuildFile - - 075ECFDD9BCF0E8901AE8625 - - children - - 581AF9074AC1929D0D1DAB9E - F5B54251AEB97ECA54054310 - 90D5389E9D73CDBB276C1B34 - 9DD770C9F0909D7B663F79B9 - 19DA60B0FDB51F564823798C - - isa - PBXGroup - sourceTree - <group> - - 07EC0B27D8891E964C48E4D7 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-RCTDataManager-prefix.pch - sourceTree - <group> - - 09567798D374D77BC5D172B2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTRawTextManager.m - sourceTree - <group> - - 0A9F33FAC1AE68D789D1776C - - explicitFileType - archive.ar - includeInIndex + defaultConfigurationIsVisible 0 + defaultConfigurationName + Release isa - PBXFileReference - path - libPods-ReactKit.a - sourceTree - BUILT_PRODUCTS_DIR + XCConfigurationList - 0AC9EE10D9CD5E34ACCC37E0 - - buildActionMask - 2147483647 - files - - 275C0B2E6CA279611D94AA46 - AC11EC6BAF7ED8F76E48397C - 79BE258178E49FD51E2CC4B8 - 7CAF752A4A0E37B9583A87DB - CDB49A44CDED422DC861AC80 - - isa - PBXHeadersBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 0B6D46780D0C5F037B9E50AF + 01B6DA188F10AE9FFA70E61D fileRef - 99F944FDFA42E71DFD034D19 + F2ABD2CA1B8437A717A8B02E isa PBXBuildFile - 0C7A5A737917BA18817CC207 - - children - - 88505E4377E9058030C956B9 - 48C4ACFA9C0F6598C47536AE - 35138A0F59E8056491258E07 - B1A56B88049B3F5961BAEF1F - 36CB892D416C92B38A7AB919 - 9F9D9AED8316D779EAEA6CBB - 6ECB652E72348E5A2B4636FC - - isa - PBXGroup - name - Pods - path - Target Support Files/Pods - sourceTree - <group> - - 0D505D056F591E9588F343AA - - containerPortal - BF94ECC553449F9486D48453 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - F3743E4364DCD50F66E07E03 - remoteInfo - Pods-ReactKit - - 0D8B5E4BC6B802176DDD88E5 + 01D7CE13EF89CFA0018C19A0 fileRef - E64248B361B8929CFE00FADC + 8A82870BBCE2FA926206ED2D isa PBXBuildFile - 0EA55D4BFB9E3A24AB05482E + 02C832411CE32F64BDD67CC1 + + fileRef + 96F2CE3DEDD063F8FA50FC85 + isa + PBXBuildFile + + 03530ADCDC580A57166AA806 includeInIndex 1 @@ -192,48 +54,13 @@ lastKnownFileType sourcecode.c.h name - RCTBridgeModule.h + RCTWebViewExecutor.h path - Base/RCTBridgeModule.h + Executors/RCTWebViewExecutor.h sourceTree <group> - 0EAFFB5E66ACE63398007604 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTUIActivityIndicatorViewManager.m - path - Views/RCTUIActivityIndicatorViewManager.m - sourceTree - <group> - - 100E0F66BB2561CD9C5403B1 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTShadowText.h - sourceTree - <group> - - 106C230D038A62D2C37E5D75 - - fileRef - 59BF11297A6B39FFEBBB7861 - isa - PBXBuildFile - - 12E89F4AD5820CD9722AD8D0 + 03FD3C8DB550D1282CBB9C3E includeInIndex 1 @@ -248,519 +75,60 @@ sourceTree <group> - 149C58083427CE1CD36C8B10 - - fileRef - B6BB65B0F788DFF2F121D4F7 - isa - PBXBuildFile - - 1592E2F41A2DC2C927EBBF12 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTRootView.h - path - Base/RCTRootView.h - sourceTree - <group> - - 15F0D204E7BD9B1607786736 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTAnimationType.h - path - Base/RCTAnimationType.h - sourceTree - <group> - - 1782BB92C0A529BF6AD72DFF - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTJavaScriptExecutor.h - path - Base/RCTJavaScriptExecutor.h - sourceTree - <group> - - 17C0992A90EEBE80108AEF54 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTWrapperViewController.h - path - Views/RCTWrapperViewController.h - sourceTree - <group> - - 19CACF004F780E3053926DAD - - isa - PBXTargetDependency - name - Pods-ReactKit - target - F3743E4364DCD50F66E07E03 - targetProxy - 0D505D056F591E9588F343AA - - 19DA60B0FDB51F564823798C - - children - - 0C7A5A737917BA18817CC207 - - isa - PBXGroup - name - Targets Support Files - sourceTree - <group> - - 1AD314273817E152C7E315BA - - fileRef - 3ED59FDCF3B8DE44DD4C1667 - isa - PBXBuildFile - - 1B55097A38652E47A94193F2 - - fileRef - 1EA900AAF1440F65670A2F9D - isa - PBXBuildFile - - 1D2F520811E96888A497E24D - - isa - PBXTargetDependency - name - Pods-RCTDataManager - target - 932A9309F808F533D40582BB - targetProxy - 21457A5B7E5C5541936A2CAD - - 1E172C103C8DDDD51C260454 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-RCTDataManager-dummy.m - sourceTree - <group> - - 1EA900AAF1440F65670A2F9D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTLog.m - path - Base/RCTLog.m - sourceTree - <group> - - 1F99DFDC314091E129914F82 - - buildConfigurations - - 4CA65E88D9B0A200CE9C9118 - 36CE53F49AD09C21E10675B8 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 2108DCEFAE6CF37482CF1C0A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTKeyCommands.m - path - Base/RCTKeyCommands.m - sourceTree - <group> - - 21457A5B7E5C5541936A2CAD - - containerPortal - BF94ECC553449F9486D48453 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 932A9309F808F533D40582BB - remoteInfo - Pods-RCTDataManager - - 21B434F724639E29EE45E44A - - isa - PBXTargetDependency - name - Pods-ReactKit - target - F3743E4364DCD50F66E07E03 - targetProxy - ED320F983C718810619BABED - - 237ECCFD5EBD9B7C1250F4EB - - fileRef - 9574DCBBFE4EFAB138C43844 - isa - PBXBuildFile - - 2409A610D6AB34EA92D33BE8 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTScrollableProtocol.h - path - Base/RCTScrollableProtocol.h - sourceTree - <group> - - 246059A6C46C6F40327D9399 - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods-RCTNetworkImage.a - sourceTree - BUILT_PRODUCTS_DIR - - 2572FEE8678A128A03571950 - - fileRef - 56FB9B47588CF0F36FC96390 - isa - PBXBuildFile - - 275C0B2E6CA279611D94AA46 - - fileRef - 6D4728D5CA14DC2EE7EA3544 - isa - PBXBuildFile - - 284A37E0CFFCA95AD5134C06 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTUtils.h - path - Base/RCTUtils.h - sourceTree - <group> - - 290C5E10241C0B2C924F14E6 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTViewManager.h - path - Views/RCTViewManager.h - sourceTree - <group> - - 291C4B433C922679BD458D5D - - fileRef - 6AEEF603053FE768ED3E5E4D - isa - PBXBuildFile - - 2BA58703E0C4B2559E28AE42 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTUIManager.m - path - Modules/RCTUIManager.m - sourceTree - <group> - - 2CD30CF1663697474B87D08E - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTAutoInsetsProtocol.h - path - Base/RCTAutoInsetsProtocol.h - sourceTree - <group> - - 2D208141DE8BC9DD7F5B8235 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTAlertManager.m - path - Modules/RCTAlertManager.m - sourceTree - <group> - - 2F5591055141A2D7A7918CE8 - - fileRef - C6EB359CFF6D72170FEF1C91 - isa - PBXBuildFile - - 311B1F10DB6ECD376C2C410D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTNetworkImageView.h - sourceTree - <group> - - 31A2F342B0F590C341B80E22 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTShadowRawText.m - sourceTree - <group> - - 33E7FC15EBE6599AD3335BD8 - - buildConfigurationList - 71F3A1261352CEB12D1EFE4E - buildPhases - - DB81D9FD0801A42A48152E0C - 9C430EF11704FB8793CA009C - - buildRules - - dependencies - - 1D2F520811E96888A497E24D - 88CBD87EEA9FF31AAF273687 - BAD9616489752B70E709809C - 21B434F724639E29EE45E44A - - isa - PBXNativeTarget - name - Pods - productName - Pods - productReference - 84D089AE2FBBC9A674F6ED90 - productType - com.apple.product-type.library.static - - 341FFB9C954C6FBBDA1D4CBB - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-ReactKit-prefix.pch - sourceTree - <group> - - 34DBA23002D2E96B79EF3FBE - - fileRef - 8FEF9214746F53A78E8F115F - isa - PBXBuildFile - - 35138A0F59E8056491258E07 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-dummy.m - sourceTree - <group> - - 369763B76533786A8E5353A4 - - fileRef - 4B4D221F3651E112595964E6 - isa - PBXBuildFile - - 36CB892D416C92B38A7AB919 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.script.sh - path - Pods-resources.sh - sourceTree - <group> - - 36CE53F49AD09C21E10675B8 - - baseConfigurationReference - D7A44E0FB5FD0083354541D0 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - 38E413F00F71503B4358BF3A + 044BBEB63131E9FE2F872148 buildActionMask 2147483647 files - 538D24A47F778BE37D482A70 - B233C279B7F95C416BE7460F - 01DCDFB27A48C1C7A65C2FE6 - 6FC60E013E6B084708F80E1D + 4E6A93805B58D09C4600FF05 + C282F1B7233E10C31D165549 + D75EAAB4BC589DDF11232D56 + A8C61C98F7AD6EECE46F23A1 + 33916283B42A90EB2B8F2140 + 01B6DA188F10AE9FFA70E61D + 633B6147455573AD11D33B17 + D76CEC171F408A47616D2702 + 5D9B90F9719D985B55F7C18C + 5ECB6108E445CF5DE8A722E1 + 062503FBD206E26790A623AD + 5B6F23C6AAC6BB99EE21DB9C + DC18D421A4941275A1E7BAD4 + BB31A06505EACAC92D4D0A0B + EFF3190D434856C25227FE84 + 41AF61FF5047AC2A90E63243 + 4EE692971713B878D06E68BF + E7374582F5A63129724C8E68 + 88B72F3A6A40EC4748301F91 + 29BBF9FA713A5AB704D306E9 + F8081DBFD37093C1EEE34411 + BCB593A7E334E01470803D73 + E3096E2B995B282B80B5EB43 + 35A397022DF088C1172B1838 + 8DCC86B6F4E41374D0531909 + 7DB6785802A84DD169F83470 + BF614E05BE9314CB6B03CFF4 + FE2FDD4E39D0988AC7EFFDA9 + 4D889E6AAD0CCC67149429C8 + E334AB4D0391D82A0DE38C55 + 02C832411CE32F64BDD67CC1 + 837C1CE5C1C60B6A6F190B9C + 6F52D92057414C873A177506 + 1679781612747FFA6AAE8C09 + CBD46C255D226CC91750FF6E + 1B7076F6FD3566344815F47D + 3AD6AA2C3BC5D95361491E47 + 24598A9A8938EC9559EC5124 isa PBXSourcesBuildPhase runOnlyForDeploymentPostprocessing 0 - 3AB2DFC2566FB389056F3BAC + 05D4613D8454536A0C582506 baseConfigurationReference - 9F9D9AED8316D779EAEA6CBB + 4C90FAF8FBD658990410C082 buildSettings ALWAYS_SEARCH_USER_PATHS @@ -804,10 +172,2405 @@ name Debug - 3AF0EA123B1D6D47095D8F69 + 062503FBD206E26790A623AD + + fileRef + 7ED6FCDD892431F7AC6D6C5A + isa + PBXBuildFile + + 0685D213EE86B64A622AFE5D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTTextField.m + path + Views/RCTTextField.m + sourceTree + <group> + + 06AAAC565037D8EF25720E03 + + fileRef + 7D2FB16662B96BDA8D478530 + isa + PBXBuildFile + + 093628ECA081B518E7705B0B + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTUIManager.h + path + Modules/RCTUIManager.h + sourceTree + <group> + + 0974827BD5B31C816AC72CAC + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-ReactKit.a + sourceTree + BUILT_PRODUCTS_DIR + + 09DD900CDB912629197918C6 baseConfigurationReference - 7643C57FD9EC1838B0876BBD + EACA5CCAD77673E65C1833FF + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-prefix.pch + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + 0AA8E7CAAA1EB4DFFBF6912C + + fileRef + 2EA25D395FD517EFB3A63CE0 + isa + PBXBuildFile + + 0B4C1F8311751A431A9E43EB + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTNavItem.h + path + Views/RCTNavItem.h + sourceTree + <group> + + 0D86E23D02587E54BDB5A0D7 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTShadowRawText.h + sourceTree + <group> + + 0D97C6D9FE8F0AF312C3ADBD + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text + name + Podfile + path + ../Podfile + sourceTree + SOURCE_ROOT + xcLanguageSpecificationIdentifier + xcode.lang.ruby + + 10C5E9DA9022285D577594CC + + buildConfigurations + + 6375425963FF6C21603732B4 + C3421858755177699D9E6345 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 10D002B7A1565F524A1F72C4 + + fileRef + C7DAA61CA1B9FB9112DC5983 + isa + PBXBuildFile + + 114860C3B3984FFBF421B47A + + containerPortal + AF4E3BAC82C6DDA51BDA9F71 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 13B7E1C57803F05652F30C1F + remoteInfo + Pods-ReactKit + + 11B7060CF244E44DEEF1FCD2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTNavigator.m + path + Views/RCTNavigator.m + sourceTree + <group> + + 13031656FE090AFA478A0C2E + + children + + 87B7D30CEC087A04E202DDF9 + EFC27C70A2E94665DCBD987F + 2E8B8AAB1186EB8F52D6EFC0 + + isa + PBXGroup + name + RCTDataManager + path + ../../../Libraries/Network + sourceTree + <group> + + 13B7E1C57803F05652F30C1F + + buildConfigurationList + 89592EB56DDBF7B54A3F915E + buildPhases + + 044BBEB63131E9FE2F872148 + 4F32A425781BE2418E5CD092 + EAAA2A06300750F7AF266715 + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Pods-ReactKit + productName + Pods-ReactKit + productReference + 0974827BD5B31C816AC72CAC + productType + com.apple.product-type.library.static + + 1475284FDEE790E29FEF888A + + fileRef + 7C11EEBC74FF8F6EFB8BD6E5 + isa + PBXBuildFile + + 1679781612747FFA6AAE8C09 + + fileRef + 3390C2E3EC519AA76A894A7D + isa + PBXBuildFile + + 17E61BB696CF0023E490D3CA + + fileRef + 2DA988B3C7927462F6BB59D3 + isa + PBXBuildFile + + 1ACF8F46B5AD479EC0466814 + + fileRef + 38F25FBF3DBBC640787DE1CA + isa + PBXBuildFile + + 1B7076F6FD3566344815F47D + + fileRef + E6E580D9802C99CB05F48910 + isa + PBXBuildFile + + 1C1136F66431443A895D4575 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTStaticImageManager.h + path + Views/RCTStaticImageManager.h + sourceTree + <group> + + 1D5C968D81BECC8D8DEDC3A7 + + isa + PBXTargetDependency + name + Pods-RCTDataManager + target + 3FF676DAA336F8ABDEA584D9 + targetProxy + 3D469FC246B36C81E1EA93D2 + + 1EDA6F4B89391190F7502F3D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTRootView.m + path + Base/RCTRootView.m + sourceTree + <group> + + 212CF767A11B52D3DC51414C + + children + + 0D97C6D9FE8F0AF312C3ADBD + D8261275342CB017F0469C64 + 9048736F9B1A3F0F27F9756B + D9BE4CF160D48568F7B2FACB + 638F2CE8FA7884834B7EAC77 + + isa + PBXGroup + sourceTree + <group> + + 22E5124B31E3B321E794DC94 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + Layout.h + path + Layout/Layout.h + sourceTree + <group> + + 22E9B6EECA586FBF58E275F4 + + fileRef + F1AF16AE6F3215C601C8BF2A + isa + PBXBuildFile + + 23395DE50939F65252BF47BB + + fileRef + 3AC91EE176996201C149C349 + isa + PBXBuildFile + + 2361BD02D0DF3561CD7AEF1B + + isa + PBXTargetDependency + name + Pods-RCTText + target + 7E2C54A003A5BC8A330804F4 + targetProxy + DACF3CCEA461A0EFF3A35E2F + + 24598A9A8938EC9559EC5124 + + fileRef + A8023D6299F24D6877BEF258 + isa + PBXBuildFile + + 25489EEC4989DEA64FAE8023 + + fileRef + 4D5D8632A9C98162B3121441 + isa + PBXBuildFile + + 257F1B1261EF6B02C93E5D38 + + buildConfigurations + + 5F0D2152E1F3FFF4904B8AD1 + 9A3A4BADEAD95DF2CD29E9FF + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 2642D314F24DD3D6748B767E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTShadowView.h + path + Views/RCTShadowView.h + sourceTree + <group> + + 26A204DC9AB5C60041E26549 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTNetworkImage-Private.xcconfig + sourceTree + <group> + + 26B3254CC05AAA7C7F9BAA92 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-RCTDataManager-prefix.pch + sourceTree + <group> + + 2857546735111E15C0AA45AC + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTExceptionsManager.h + path + Modules/RCTExceptionsManager.h + sourceTree + <group> + + 2873C87E10A36AE0FCBCC365 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTUtils.m + path + Base/RCTUtils.m + sourceTree + <group> + + 2909FAB5B87A982551EDB4EB + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTNetworkImageViewManager.m + sourceTree + <group> + + 293F7285A686B031D78DF112 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTTiming.m + path + Modules/RCTTiming.m + sourceTree + <group> + + 29BBF9FA713A5AB704D306E9 + + fileRef + 882FB9B260693792E2AFDABC + isa + PBXBuildFile + + 2DA988B3C7927462F6BB59D3 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTScrollableProtocol.h + path + Base/RCTScrollableProtocol.h + sourceTree + <group> + + 2E8B8AAB1186EB8F52D6EFC0 + + children + + F360C8A48A0EF89F49435FCC + EACA5CCAD77673E65C1833FF + B894B8E147E4FB2BB7ACA437 + 26B3254CC05AAA7C7F9BAA92 + + isa + PBXGroup + name + Support Files + path + ../../Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager + sourceTree + <group> + + 2EA25D395FD517EFB3A63CE0 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTImageDownloader.m + sourceTree + <group> + + 307038CC5432B6825D99CCBE + + fileRef + F70008E1D19432CFDECE123B + isa + PBXBuildFile + + 30DF4E19DFA1C80A5362DF26 + + buildActionMask + 2147483647 + files + + CD51637ED2FE910623A957AB + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 33092F9AC97DCFFCA7A6BEA5 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTSparseArray.m + path + Base/RCTSparseArray.m + sourceTree + <group> + + 3390C2E3EC519AA76A894A7D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTView.m + path + Views/RCTView.m + sourceTree + <group> + + 33916283B42A90EB2B8F2140 + + fileRef + 686E67C6B83BF51888A3313F + isa + PBXBuildFile + + 346B439D0B302F06A3944961 + + fileRef + C1273C2B1A34EE7896A3D5FA + isa + PBXBuildFile + + 354EDECEBDF81C85B10548DE + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTRawTextManager.h + sourceTree + <group> + + 355261A12E64B026B300EB1C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTNavigatorManager.m + path + Views/RCTNavigatorManager.m + sourceTree + <group> + + 35A397022DF088C1172B1838 + + fileRef + D394735C135D36533551DF37 + isa + PBXBuildFile + + 35FADD2E366746654FDF0073 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTUtils.h + path + Base/RCTUtils.h + sourceTree + <group> + + 36C25DD43B6139727D23ABDE + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTTextFieldManager.m + path + Views/RCTTextFieldManager.m + sourceTree + <group> + + 37701A8B9A2FBF4FBAA01F9C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTEventDispatcher.m + path + Base/RCTEventDispatcher.m + sourceTree + <group> + + 38F25FBF3DBBC640787DE1CA + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTJavaScriptExecutor.h + path + Base/RCTJavaScriptExecutor.h + sourceTree + <group> + + 3AC91EE176996201C149C349 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTText.h + sourceTree + <group> + + 3AD6AA2C3BC5D95361491E47 + + fileRef + 953CEE4B6D3D941453109D23 + isa + PBXBuildFile + + 3B1C86DC544A391311D0F119 + + fileRef + 43BB352AA7823226332FE80B + isa + PBXBuildFile + + 3B2EF60D760BB2D99E79CE51 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTUIActivityIndicatorViewManager.h + path + Views/RCTUIActivityIndicatorViewManager.h + sourceTree + <group> + + 3BDF7BEBB78C16E879E444E2 + + containerPortal + AF4E3BAC82C6DDA51BDA9F71 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 13B7E1C57803F05652F30C1F + remoteInfo + Pods-ReactKit + + 3C9A4805273F33EF92D439A4 + + fileRef + 35FADD2E366746654FDF0073 + isa + PBXBuildFile + + 3CD60F36DF6CEECFF4758BEE + + children + + 354EDECEBDF81C85B10548DE + 63887528ABF88595D89EDA8E + 0D86E23D02587E54BDB5A0D7 + 7D2FB16662B96BDA8D478530 + 4BC269B918F30C81607B1FEA + 4E4EF91447A42AE99235BDF8 + 3AC91EE176996201C149C349 + D2906EE46F872A418B6B33AB + B406BF0BF6506637A35D5167 + 45BE4B1D1F55EE3D947EB961 + 87E9F10D0A968F86A2D3E064 + + isa + PBXGroup + name + RCTText + path + ../../../Libraries/Text + sourceTree + <group> + + 3D469FC246B36C81E1EA93D2 + + containerPortal + AF4E3BAC82C6DDA51BDA9F71 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 3FF676DAA336F8ABDEA584D9 + remoteInfo + Pods-RCTDataManager + + 3DE934F8F76F207BD55AB677 + + fileRef + EE584546150D3E55E6515F2E + isa + PBXBuildFile + + 3E20F8895633E084956AFB54 + + fileRef + D0FD74048B7D3439EDC0DDCF + isa + PBXBuildFile + + 3F92F6DE3C2C780DD4346C6D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTStaticImage.h + path + Views/RCTStaticImage.h + sourceTree + <group> + + 3FF676DAA336F8ABDEA584D9 + + buildConfigurationList + 7E77223E8EF39DF16D41D603 + buildPhases + + 63359DD37C363E5C5515E6DE + 30DF4E19DFA1C80A5362DF26 + E4450895EB5C944681A11604 + + buildRules + + dependencies + + FE9545D71B365894A20387A0 + + isa + PBXNativeTarget + name + Pods-RCTDataManager + productName + Pods-RCTDataManager + productReference + 89664286C51C7DFFF1F672C7 + productType + com.apple.product-type.library.static + + 409B932149D89EC4BF4440F9 + + fileRef + 354EDECEBDF81C85B10548DE + isa + PBXBuildFile + + 4103A439B8CB9FEE139E77F9 + + containerPortal + AF4E3BAC82C6DDA51BDA9F71 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 13B7E1C57803F05652F30C1F + remoteInfo + Pods-ReactKit + + 41AF61FF5047AC2A90E63243 + + fileRef + 11B7060CF244E44DEEF1FCD2 + isa + PBXBuildFile + + 41D8E6FE5E575AF2F24ED506 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-environment.h + sourceTree + <group> + + 42E74C2012329B8DC0CDD8C0 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTAnimationType.h + path + Base/RCTAnimationType.h + sourceTree + <group> + + 43BB352AA7823226332FE80B + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTTiming.h + path + Modules/RCTTiming.h + sourceTree + <group> + + 44A3273EA768EAD9FB3033B0 + + fileRef + B5A92E4318F13DCE45C534F2 + isa + PBXBuildFile + + 45760E0B6F7A35A5C23C8B46 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTTouchHandler.h + path + Base/RCTTouchHandler.h + sourceTree + <group> + + 45BE4B1D1F55EE3D947EB961 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTTextManager.m + sourceTree + <group> + + 45D22F90E12DC985BE508454 + + fileRef + 03530ADCDC580A57166AA806 + isa + PBXBuildFile + + 472F97575D9645EDA8B23D43 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTRedBox.h + path + Base/RCTRedBox.h + sourceTree + <group> + + 48B2F9A5EEA775E9BDF2360D + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods.a + sourceTree + BUILT_PRODUCTS_DIR + + 496F484960908F7F255D665C + + fileRef + 8D0822A18641950E39DF6E85 + isa + PBXBuildFile + + 4B893B55D3B47F56554BCEEB + + fileRef + CC7A4C8E06F6C0B809F1ADF6 + isa + PBXBuildFile + + 4BC269B918F30C81607B1FEA + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTShadowText.h + sourceTree + <group> + + 4C90FAF8FBD658990410C082 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods.debug.xcconfig + sourceTree + <group> + + 4D5D8632A9C98162B3121441 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTNetworkImageView.m + sourceTree + <group> + + 4D889E6AAD0CCC67149429C8 + + fileRef + 293F7285A686B031D78DF112 + isa + PBXBuildFile + + 4E4EF91447A42AE99235BDF8 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTShadowText.m + sourceTree + <group> + + 4E58EBB9F3E15EDD045ABDA5 + + buildConfigurationList + 10C5E9DA9022285D577594CC + buildPhases + + 9B86394A814DD0363FFDB8E4 + AE10B2159AD52275F05F8AC9 + F6713859D76D7A17020FF1D7 + + buildRules + + dependencies + + 9E55FC1AF8AFBA8E3DA00D8E + + isa + PBXNativeTarget + name + Pods-RCTNetworkImage + productName + Pods-RCTNetworkImage + productReference + 5571F59D7888CF59E6621A86 + productType + com.apple.product-type.library.static + + 4E6A93805B58D09C4600FF05 + + fileRef + 55B5D865F1152367A8FBFA15 + isa + PBXBuildFile + + 4EE692971713B878D06E68BF + + fileRef + 355261A12E64B026B300EB1C + isa + PBXBuildFile + + 4F32A425781BE2418E5CD092 + + buildActionMask + 2147483647 + files + + 10D002B7A1565F524A1F72C4 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 4F4B2DFFE6DB1F3F056D7A88 + + fileRef + 958F3D9CD59D82649DC4BBD0 + isa + PBXBuildFile + + 516150EA2C83F095456330AE + + children + + 55B5D865F1152367A8FBFA15 + 22E5124B31E3B321E794DC94 + EA5B9962C9C69FF5B105130C + B9F1F805E855F9FFAAEE736B + 42E74C2012329B8DC0CDD8C0 + 89108038536B016307C54316 + F3FA21714693F02F20D877A2 + 7331993774BA4B5BCBE7AF55 + C18BF11BD79C83BBFB1BD210 + 686E67C6B83BF51888A3313F + 958F3D9CD59D82649DC4BBD0 + 8A82870BBCE2FA926206ED2D + F2ABD2CA1B8437A717A8B02E + FCFDA7AB4DB749DFF1E2511E + C1B075D45591A6568ECCD18C + 726EFD60805D922BEDE76C15 + 8A3990D8C3642C990B243791 + F1AF16AE6F3215C601C8BF2A + 37701A8B9A2FBF4FBAA01F9C + 2857546735111E15C0AA45AC + 74AA991D11A77BC7C2AC8B39 + FB45A4C5FE56C74F2EA4BD34 + 55CC7DF41E9AAAB8B442F56B + 38F25FBF3DBBC640787DE1CA + 8CA5B2C0AF0A2725E53213B8 + 7ED6FCDD892431F7AC6D6C5A + EE584546150D3E55E6515F2E + C7DB5E0D273A12A263E3DF66 + E646155312572FA2F9C110A7 + A019FBFA9536047BFD4E8566 + 0B4C1F8311751A431A9E43EB + E90505537034D18BAC56279F + CC7A4C8E06F6C0B809F1ADF6 + F603040661CEDD4C306E6127 + 8C22AEF2E3B1B90ABF364B0F + 11B7060CF244E44DEEF1FCD2 + B8787968B4F54434A7E1511D + 355261A12E64B026B300EB1C + 7CAEE77776D2737B9F4302B2 + 472F97575D9645EDA8B23D43 + C076C6CC906607E83876CCC2 + 8D0822A18641950E39DF6E85 + 1EDA6F4B89391190F7502F3D + 697FA9A4B81DC1D336772B85 + 882FB9B260693792E2AFDABC + 9A52282291CFFDE6377AD032 + B758DF7D0F574FFF532D9764 + 2DA988B3C7927462F6BB59D3 + 2642D314F24DD3D6748B767E + 8B41BD0CA63A64FE32256CE7 + C564A2FC0A0C23D983F6A99B + 33092F9AC97DCFFCA7A6BEA5 + 3F92F6DE3C2C780DD4346C6D + D394735C135D36533551DF37 + 1C1136F66431443A895D4575 + C5B608C0F41A84743C23F253 + 7C11EEBC74FF8F6EFB8BD6E5 + 79A57B4BA9D5AF486080B4FF + B5A92E4318F13DCE45C534F2 + 0685D213EE86B64A622AFE5D + D0FD74048B7D3439EDC0DDCF + 36C25DD43B6139727D23ABDE + 43BB352AA7823226332FE80B + 293F7285A686B031D78DF112 + 45760E0B6F7A35A5C23C8B46 + AD89D20777D9EE94627336E2 + 3B2EF60D760BB2D99E79CE51 + 96F2CE3DEDD063F8FA50FC85 + 093628ECA081B518E7705B0B + 86A99FB3CFC16EAE185D6C86 + 35FADD2E366746654FDF0073 + 2873C87E10A36AE0FCBCC365 + 5D4352EBC14E9D6839CC937E + 3390C2E3EC519AA76A894A7D + C816B4169D2425B6E0DCBF6F + 63310B6F2F3EBE6CC8C9A58A + 03FD3C8DB550D1282CBB9C3E + 03530ADCDC580A57166AA806 + E6E580D9802C99CB05F48910 + 60D9D364FBF1236491FDE4DD + 953CEE4B6D3D941453109D23 + B888803D97B219E6B4E00A03 + A8023D6299F24D6877BEF258 + FB5BEEF19CFBB7012E80C408 + + isa + PBXGroup + name + ReactKit + path + ../../../ReactKit + sourceTree + <group> + + 527AA636955F4145805B828C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods.release.xcconfig + sourceTree + <group> + + 5445A5107FDF059DA476582F + + fileRef + 3F92F6DE3C2C780DD4346C6D + isa + PBXBuildFile + + 556D48417573C2CCC7132F1A + + fileRef + 60D9D364FBF1236491FDE4DD + isa + PBXBuildFile + + 5571F59D7888CF59E6621A86 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-RCTNetworkImage.a + sourceTree + BUILT_PRODUCTS_DIR + + 55B5D865F1152367A8FBFA15 + + includeInIndex + 1 + isa + PBXFileReference + name + Layout.c + path + Layout/Layout.c + sourceTree + <group> + + 55CC7DF41E9AAAB8B442F56B + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTJSMethodRegistrar.h + path + Base/RCTJSMethodRegistrar.h + sourceTree + <group> + + 58B5D9EFD4CDD5F7431E1416 + + fileRef + 03FD3C8DB550D1282CBB9C3E + isa + PBXBuildFile + + 5B6F23C6AAC6BB99EE21DB9C + + fileRef + C7DB5E0D273A12A263E3DF66 + isa + PBXBuildFile + + 5D4352EBC14E9D6839CC937E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTView.h + path + Views/RCTView.h + sourceTree + <group> + + 5D9B90F9719D985B55F7C18C + + fileRef + 37701A8B9A2FBF4FBAA01F9C + isa + PBXBuildFile + + 5E978F1482C798C60C70F510 + + fileRef + C7DAA61CA1B9FB9112DC5983 + isa + PBXBuildFile + + 5ECB6108E445CF5DE8A722E1 + + fileRef + 74AA991D11A77BC7C2AC8B39 + isa + PBXBuildFile + + 5ED39030F4CF73704BE6DCB1 + + fileRef + EFC27C70A2E94665DCBD987F + isa + PBXBuildFile + + 5F0D2152E1F3FFF4904B8AD1 + + baseConfigurationReference + 9E440049436804CE51BB0FC0 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + 606C88223FB67B48CDAC1C52 + + buildActionMask + 2147483647 + files + + 7901388968A3D19E9512DA4B + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 60D9D364FBF1236491FDE4DD + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTWrapperViewController.h + path + Views/RCTWrapperViewController.h + sourceTree + <group> + + 6157197253F577A6D0DB0372 + + fileRef + 0D86E23D02587E54BDB5A0D7 + isa + PBXBuildFile + + 61A02A7F08FC7D80DFBA7084 + + fileRef + D2906EE46F872A418B6B33AB + isa + PBXBuildFile + + 63310B6F2F3EBE6CC8C9A58A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTViewManager.m + path + Views/RCTViewManager.m + sourceTree + <group> + + 63359DD37C363E5C5515E6DE + + buildActionMask + 2147483647 + files + + C8CCB40239E2009CC5655B6B + 5ED39030F4CF73704BE6DCB1 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 633B6147455573AD11D33B17 + + fileRef + C1B075D45591A6568ECCD18C + isa + PBXBuildFile + + 6375425963FF6C21603732B4 + + baseConfigurationReference + 26A204DC9AB5C60041E26549 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + 63887528ABF88595D89EDA8E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTRawTextManager.m + sourceTree + <group> + + 638F2CE8FA7884834B7EAC77 + + children + + C3908657E1A50F7F808796C1 + + isa + PBXGroup + name + Targets Support Files + sourceTree + <group> + + 645997F70491670B86F2BA96 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-RCTText.a + sourceTree + BUILT_PRODUCTS_DIR + + 64CFDB05AE3A6A9975FFBCEA + + fileRef + 2642D314F24DD3D6748B767E + isa + PBXBuildFile + + 6664ADDDE2CD563193D50725 + + fileRef + FCFDA7AB4DB749DFF1E2511E + isa + PBXBuildFile + + 673ACA8D38F46D1E3F6C7B36 + + fileRef + B8787968B4F54434A7E1511D + isa + PBXBuildFile + + 686E67C6B83BF51888A3313F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTBridge.m + path + Base/RCTBridge.m + sourceTree + <group> + + 697FA9A4B81DC1D336772B85 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTScrollView.h + path + Views/RCTScrollView.h + sourceTree + <group> + + 6A34E09DEECEAFFE61EE78A4 + + containerPortal + AF4E3BAC82C6DDA51BDA9F71 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 4E58EBB9F3E15EDD045ABDA5 + remoteInfo + Pods-RCTNetworkImage + + 6C14CDB69262D0CF9F277492 + + fileRef + 5D4352EBC14E9D6839CC937E + isa + PBXBuildFile + + 6F14A0EF8B554164C0913DD8 + + fileRef + 697FA9A4B81DC1D336772B85 + isa + PBXBuildFile + + 6F52D92057414C873A177506 + + fileRef + 2873C87E10A36AE0FCBCC365 + isa + PBXBuildFile + + 7055E300F1E69B7B2328046D + + fileRef + D7DCC1BDDF6B30BCCF621E17 + isa + PBXBuildFile + + 706802052B608499FD490789 + + fileRef + B406BF0BF6506637A35D5167 + isa + PBXBuildFile + + 726EFD60805D922BEDE76C15 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTConvert.h + path + Base/RCTConvert.h + sourceTree + <group> + + 7331993774BA4B5BCBE7AF55 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTAutoInsetsProtocol.h + path + Base/RCTAutoInsetsProtocol.h + sourceTree + <group> + + 74640D1CD100B3C90CF9387E + + buildActionMask + 2147483647 + files + + 7055E300F1E69B7B2328046D + E9778064D3F51028ADAE1A34 + 06AAAC565037D8EF25720E03 + 800F0AE9DD1C771B302C5840 + 61A02A7F08FC7D80DFBA7084 + 83BB290765484ABEA89B8CCA + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 74AA991D11A77BC7C2AC8B39 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTExceptionsManager.m + path + Modules/RCTExceptionsManager.m + sourceTree + <group> + + 7614DE0CECD1B9FF0338EB3F + + isa + PBXTargetDependency + name + Pods-ReactKit + target + 13B7E1C57803F05652F30C1F + targetProxy + 3BDF7BEBB78C16E879E444E2 + + 782532E10015155FB2604DE6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-ReactKit.xcconfig + sourceTree + <group> + + 7830A204AA05E610158D3092 + + containerPortal + AF4E3BAC82C6DDA51BDA9F71 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 13B7E1C57803F05652F30C1F + remoteInfo + Pods-ReactKit + + 78C6E228F82F244A224CDAAC + + fileRef + 8C22AEF2E3B1B90ABF364B0F + isa + PBXBuildFile + + 7901388968A3D19E9512DA4B + + fileRef + C7DAA61CA1B9FB9112DC5983 + isa + PBXBuildFile + + 79A57B4BA9D5AF486080B4FF + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTStatusBarManager.m + path + Modules/RCTStatusBarManager.m + sourceTree + <group> + + 7B3E398E836D3D5B284BE497 + + fileRef + 42E74C2012329B8DC0CDD8C0 + isa + PBXBuildFile + + 7C11EEBC74FF8F6EFB8BD6E5 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTStatusBarManager.h + path + Modules/RCTStatusBarManager.h + sourceTree + <group> + + 7CAEE77776D2737B9F4302B2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTPointerEvents.h + path + Base/RCTPointerEvents.h + sourceTree + <group> + + 7D2FB16662B96BDA8D478530 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTShadowRawText.m + sourceTree + <group> + + 7DB6785802A84DD169F83470 + + fileRef + 79A57B4BA9D5AF486080B4FF + isa + PBXBuildFile + + 7E2C54A003A5BC8A330804F4 + + buildConfigurationList + 257F1B1261EF6B02C93E5D38 + buildPhases + + 74640D1CD100B3C90CF9387E + 606C88223FB67B48CDAC1C52 + A90788D6B35021C956CEFB59 + + buildRules + + dependencies + + 7614DE0CECD1B9FF0338EB3F + + isa + PBXNativeTarget + name + Pods-RCTText + productName + Pods-RCTText + productReference + 645997F70491670B86F2BA96 + productType + com.apple.product-type.library.static + + 7E4612BAA564E326F5CE9D8E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTNetworkImageViewManager.h + sourceTree + <group> + + 7E53CCE7BC2F97B8D7A64AD0 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-ReactKit-prefix.pch + sourceTree + <group> + + 7E77223E8EF39DF16D41D603 + + buildConfigurations + + 09DD900CDB912629197918C6 + 963B62DCD1695389691DAA05 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 7ED6FCDD892431F7AC6D6C5A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTKeyCommands.m + path + Base/RCTKeyCommands.m + sourceTree + <group> + + 7EF8DB527F9619E040F0C6AE + + children + + C7DAA61CA1B9FB9112DC5983 + + isa + PBXGroup + name + iOS + sourceTree + <group> + + 800F0AE9DD1C771B302C5840 + + fileRef + 4E4EF91447A42AE99235BDF8 + isa + PBXBuildFile + + 8074519FA3432A12365C723C + + fileRef + E646155312572FA2F9C110A7 + isa + PBXBuildFile + + 81BC72A103E1C577C1B19212 + + baseConfigurationReference + 527AA636955F4145805B828C + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_PRECOMPILE_PREFIX_HEADER + YES + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 837C1CE5C1C60B6A6F190B9C + + fileRef + 86A99FB3CFC16EAE185D6C86 + isa + PBXBuildFile + + 8389891D3F795245EEC47D4B + + fileRef + 093628ECA081B518E7705B0B + isa + PBXBuildFile + + 83BB290765484ABEA89B8CCA + + fileRef + 45BE4B1D1F55EE3D947EB961 + isa + PBXBuildFile + + 83F79A097E2909089E3FC524 + + children + + D3875E94710A862C72C9D02D + 26A204DC9AB5C60041E26549 + F70008E1D19432CFDECE123B + 9A4B507CFD331E8018748CF1 + + isa + PBXGroup + name + Support Files + path + ../../Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage + sourceTree + <group> + + 86A99FB3CFC16EAE185D6C86 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTUIManager.m + path + Modules/RCTUIManager.m + sourceTree + <group> + + 87B7D30CEC087A04E202DDF9 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTDataManager.h + sourceTree + <group> + + 87E9F10D0A968F86A2D3E064 + + children + + 8FC0E1EC00909042A664442B + 9E440049436804CE51BB0FC0 + D7DCC1BDDF6B30BCCF621E17 + F398EE4EDB2C9867D5FF4E79 + + isa + PBXGroup + name + Support Files + path + ../../Examples/Movies/Pods/Target Support Files/Pods-RCTText + sourceTree + <group> + + 882FB9B260693792E2AFDABC + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTScrollView.m + path + Views/RCTScrollView.m + sourceTree + <group> + + 88B72F3A6A40EC4748301F91 + + fileRef + 1EDA6F4B89391190F7502F3D + isa + PBXBuildFile + + 89108038536B016307C54316 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTAssert.h + path + Base/RCTAssert.h + sourceTree + <group> + + 89592EB56DDBF7B54A3F915E + + buildConfigurations + + CDE95CDA8C87779EFE778F9A + D50240220E277743B098DBAD + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 89664286C51C7DFFF1F672C7 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-RCTDataManager.a + sourceTree + BUILT_PRODUCTS_DIR + + 8989408E16B49A592CECE05E + + fileRef + 55CC7DF41E9AAAB8B442F56B + isa + PBXBuildFile + + 8A3990D8C3642C990B243791 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTConvert.m + path + Base/RCTConvert.m + sourceTree + <group> + + 8A82870BBCE2FA926206ED2D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTCache.h + path + Base/RCTCache.h + sourceTree + <group> + + 8B41BD0CA63A64FE32256CE7 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTShadowView.m + path + Views/RCTShadowView.m + sourceTree + <group> + + 8BFDB4E6A534A18777DD9413 + + fileRef + 7E4612BAA564E326F5CE9D8E + isa + PBXBuildFile + + 8C22AEF2E3B1B90ABF364B0F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTNavigator.h + path + Views/RCTNavigator.h + sourceTree + <group> + + 8CA5B2C0AF0A2725E53213B8 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTKeyCommands.h + path + Base/RCTKeyCommands.h + sourceTree + <group> + + 8D0822A18641950E39DF6E85 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTRootView.h + path + Base/RCTRootView.h + sourceTree + <group> + + 8D89762D01606FF08D2D0415 + + fileRef + 9A52282291CFFDE6377AD032 + isa + PBXBuildFile + + 8DCC86B6F4E41374D0531909 + + fileRef + C5B608C0F41A84743C23F253 + isa + PBXBuildFile + + 8F2CA114699B27A7CF43562C + + buildConfigurationList + ECA2414C9D669EE25B29026B + buildPhases + + E79C749F7C18402B8FAC543A + F81FAD337D3D121CA8A5A4CA + + buildRules + + dependencies + + 1D5C968D81BECC8D8DEDC3A7 + D73FE49574ED6F2E1BE3AF20 + 2361BD02D0DF3561CD7AEF1B + DFFD02DED71CBF8CF075A273 + + isa + PBXNativeTarget + name + Pods + productName + Pods + productReference + 48B2F9A5EEA775E9BDF2360D + productType + com.apple.product-type.library.static + + 8FC0E1EC00909042A664442B + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTText.xcconfig + sourceTree + <group> + + 9048736F9B1A3F0F27F9756B + + children + + 7EF8DB527F9619E040F0C6AE + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + 90B9883EFAE5BB4CA68AA7ED + + fileRef + C564A2FC0A0C23D983F6A99B + isa + PBXBuildFile + + 953CEE4B6D3D941453109D23 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTWrapperViewController.m + path + Views/RCTWrapperViewController.m + sourceTree + <group> + + 958F3D9CD59D82649DC4BBD0 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTBridgeModule.h + path + Base/RCTBridgeModule.h + sourceTree + <group> + + 95F60EF688D3DC27638042A2 + + fileRef + 89108038536B016307C54316 + isa + PBXBuildFile + + 963B62DCD1695389691DAA05 + + baseConfigurationReference + EACA5CCAD77673E65C1833FF buildSettings ALWAYS_SEARCH_USER_PATHS @@ -854,7 +2617,1387 @@ name Release - 3C0A45593BBE3C2A57E72C81 + 965D54B6354201E9C547F888 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTNetworkImageView.h + sourceTree + <group> + + 96F2CE3DEDD063F8FA50FC85 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTUIActivityIndicatorViewManager.m + path + Views/RCTUIActivityIndicatorViewManager.m + sourceTree + <group> + + 9725F8B362AF089826F00A64 + + fileRef + 8CA5B2C0AF0A2725E53213B8 + isa + PBXBuildFile + + 99294162E5C2E03148EBF05C + + fileRef + 726EFD60805D922BEDE76C15 + isa + PBXBuildFile + + 9A3A4BADEAD95DF2CD29E9FF + + baseConfigurationReference + 9E440049436804CE51BB0FC0 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 9A4B507CFD331E8018748CF1 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-RCTNetworkImage-prefix.pch + sourceTree + <group> + + 9A52282291CFFDE6377AD032 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTScrollViewManager.h + path + Views/RCTScrollViewManager.h + sourceTree + <group> + + 9B86394A814DD0363FFDB8E4 + + buildActionMask + 2147483647 + files + + 307038CC5432B6825D99CCBE + 0AA8E7CAAA1EB4DFFBF6912C + 25489EEC4989DEA64FAE8023 + B1BD47DA44AC279A3EDA0440 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 9E440049436804CE51BB0FC0 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTText-Private.xcconfig + sourceTree + <group> + + 9E55FC1AF8AFBA8E3DA00D8E + + isa + PBXTargetDependency + name + Pods-ReactKit + target + 13B7E1C57803F05652F30C1F + targetProxy + 4103A439B8CB9FEE139E77F9 + + A019FBFA9536047BFD4E8566 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTLog.m + path + Base/RCTLog.m + sourceTree + <group> + + A1DCC56E57BB6053E663E32D + + fileRef + 7331993774BA4B5BCBE7AF55 + isa + PBXBuildFile + + A2CDF46CB581C9C678ECAC7C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text + path + Pods-acknowledgements.markdown + sourceTree + <group> + + A8023D6299F24D6877BEF258 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + UIView+ReactKit.m + path + Views/UIView+ReactKit.m + sourceTree + <group> + + A8C61C98F7AD6EECE46F23A1 + + fileRef + F3FA21714693F02F20D877A2 + isa + PBXBuildFile + + A8F2BA66EAD7DCC7C47897EC + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.script.sh + path + Pods-resources.sh + sourceTree + <group> + + A90788D6B35021C956CEFB59 + + buildActionMask + 2147483647 + files + + 409B932149D89EC4BF4440F9 + 6157197253F577A6D0DB0372 + DFF568166262DEA96AFD5450 + 23395DE50939F65252BF47BB + 706802052B608499FD490789 + + isa + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + AD2B1C2233FF46325D39E241 + + fileRef + F00FE630E41F44E6FFD45A71 + isa + PBXBuildFile + + AD89D20777D9EE94627336E2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTTouchHandler.m + path + Base/RCTTouchHandler.m + sourceTree + <group> + + AE10B2159AD52275F05F8AC9 + + buildActionMask + 2147483647 + files + + B58CA75AF8AD019B55CD1E32 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + AF4E3BAC82C6DDA51BDA9F71 + + attributes + + LastUpgradeCheck + 0510 + + buildConfigurationList + 0173994FBD7222C1B4B85D39 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + + mainGroup + 212CF767A11B52D3DC51414C + productRefGroup + D9BE4CF160D48568F7B2FACB + projectDirPath + + projectReferences + + projectRoot + + targets + + 8F2CA114699B27A7CF43562C + 3FF676DAA336F8ABDEA584D9 + 4E58EBB9F3E15EDD045ABDA5 + 7E2C54A003A5BC8A330804F4 + 13B7E1C57803F05652F30C1F + + + B1BD47DA44AC279A3EDA0440 + + fileRef + 2909FAB5B87A982551EDB4EB + isa + PBXBuildFile + + B406BF0BF6506637A35D5167 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTTextManager.h + sourceTree + <group> + + B58CA75AF8AD019B55CD1E32 + + fileRef + C7DAA61CA1B9FB9112DC5983 + isa + PBXBuildFile + + B5A92E4318F13DCE45C534F2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTTextField.h + path + Views/RCTTextField.h + sourceTree + <group> + + B758DF7D0F574FFF532D9764 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTScrollViewManager.m + path + Views/RCTScrollViewManager.m + sourceTree + <group> + + B8121D544B10403943F18595 + + fileRef + 87B7D30CEC087A04E202DDF9 + isa + PBXBuildFile + + B8787968B4F54434A7E1511D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTNavigatorManager.h + path + Views/RCTNavigatorManager.h + sourceTree + <group> + + B888803D97B219E6B4E00A03 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + UIView+ReactKit.h + path + Views/UIView+ReactKit.h + sourceTree + <group> + + B894B8E147E4FB2BB7ACA437 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-RCTDataManager-dummy.m + sourceTree + <group> + + B9160C07A1D8C010D44E96BB + + fileRef + FB45A4C5FE56C74F2EA4BD34 + isa + PBXBuildFile + + B9F1F805E855F9FFAAEE736B + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTAlertManager.m + path + Modules/RCTAlertManager.m + sourceTree + <group> + + BB31A06505EACAC92D4D0A0B + + fileRef + E90505537034D18BAC56279F + isa + PBXBuildFile + + BCB593A7E334E01470803D73 + + fileRef + 8B41BD0CA63A64FE32256CE7 + isa + PBXBuildFile + + BE5C6A85BE08DB53D14CE20A + + fileRef + 7CAEE77776D2737B9F4302B2 + isa + PBXBuildFile + + BF614E05BE9314CB6B03CFF4 + + fileRef + 0685D213EE86B64A622AFE5D + isa + PBXBuildFile + + C004F0768C26A0FC14249BB2 + + fileRef + 0B4C1F8311751A431A9E43EB + isa + PBXBuildFile + + C076C6CC906607E83876CCC2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTRedBox.m + path + Base/RCTRedBox.m + sourceTree + <group> + + C0BCC72ACD29F6AAC357B59C + + fileRef + 472F97575D9645EDA8B23D43 + isa + PBXBuildFile + + C1273C2B1A34EE7896A3D5FA + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTImageDownloader.h + sourceTree + <group> + + C18BF11BD79C83BBFB1BD210 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTBridge.h + path + Base/RCTBridge.h + sourceTree + <group> + + C1B075D45591A6568ECCD18C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTContextExecutor.m + path + Executors/RCTContextExecutor.m + sourceTree + <group> + + C282F1B7233E10C31D165549 + + fileRef + CD2F169E76E103DA4112FFEC + isa + PBXBuildFile + + C2BDC288A96EC2C204FACAE4 + + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + CLANG_CXX_LANGUAGE_STANDARD + gnu++0x + CLANG_CXX_LIBRARY + libc++ + CLANG_ENABLE_MODULES + YES + CLANG_ENABLE_OBJC_ARC + YES + CLANG_WARN_BOOL_CONVERSION + YES + CLANG_WARN_CONSTANT_CONVERSION + YES + CLANG_WARN_DIRECT_OBJC_ISA_USAGE + YES + CLANG_WARN_EMPTY_BODY + YES + CLANG_WARN_ENUM_CONVERSION + YES + CLANG_WARN_INT_CONVERSION + YES + CLANG_WARN_OBJC_ROOT_CLASS + YES + COPY_PHASE_STRIP + NO + ENABLE_NS_ASSERTIONS + NO + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_PREPROCESSOR_DEFINITIONS + + RELEASE=1 + + GCC_WARN_64_TO_32_BIT_CONVERSION + YES + GCC_WARN_ABOUT_RETURN_TYPE + YES + GCC_WARN_UNDECLARED_SELECTOR + YES + GCC_WARN_UNINITIALIZED_AUTOS + YES + GCC_WARN_UNUSED_FUNCTION + YES + GCC_WARN_UNUSED_VARIABLE + YES + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + STRIP_INSTALLED_PRODUCT + NO + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + C3421858755177699D9E6345 + + baseConfigurationReference + 26A204DC9AB5C60041E26549 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + C3908657E1A50F7F808796C1 + + children + + A2CDF46CB581C9C678ECAC7C + E1F996C0BFA1F4C1D6EFC235 + F00FE630E41F44E6FFD45A71 + 41D8E6FE5E575AF2F24ED506 + A8F2BA66EAD7DCC7C47897EC + 4C90FAF8FBD658990410C082 + 527AA636955F4145805B828C + + isa + PBXGroup + name + Pods + path + Target Support Files/Pods + sourceTree + <group> + + C564A2FC0A0C23D983F6A99B + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTSparseArray.h + path + Base/RCTSparseArray.h + sourceTree + <group> + + C5B608C0F41A84743C23F253 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTStaticImageManager.m + path + Views/RCTStaticImageManager.m + sourceTree + <group> + + C7DAA61CA1B9FB9112DC5983 + + isa + PBXFileReference + lastKnownFileType + wrapper.framework + name + Foundation.framework + path + Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/Foundation.framework + sourceTree + DEVELOPER_DIR + + C7DB5E0D273A12A263E3DF66 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTLocationObserver.m + path + Modules/RCTLocationObserver.m + sourceTree + <group> + + C816B4169D2425B6E0DCBF6F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTViewManager.h + path + Views/RCTViewManager.h + sourceTree + <group> + + C8CCB40239E2009CC5655B6B + + fileRef + B894B8E147E4FB2BB7ACA437 + isa + PBXBuildFile + + CBD46C255D226CC91750FF6E + + fileRef + 63310B6F2F3EBE6CC8C9A58A + isa + PBXBuildFile + + CC7A4C8E06F6C0B809F1ADF6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTNavItemManager.h + path + Views/RCTNavItemManager.h + sourceTree + <group> + + CD2F169E76E103DA4112FFEC + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-ReactKit-dummy.m + sourceTree + <group> + + CD51637ED2FE910623A957AB + + fileRef + C7DAA61CA1B9FB9112DC5983 + isa + PBXBuildFile + + CDE95CDA8C87779EFE778F9A + + baseConfigurationReference + E84F2418584963830725CDE6 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + D04E5DBEFDC4B2FA70ECBB57 + + fileRef + B888803D97B219E6B4E00A03 + isa + PBXBuildFile + + D0FD74048B7D3439EDC0DDCF + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTTextFieldManager.h + path + Views/RCTTextFieldManager.h + sourceTree + <group> + + D2906EE46F872A418B6B33AB + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTText.m + sourceTree + <group> + + D3875E94710A862C72C9D02D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTNetworkImage.xcconfig + sourceTree + <group> + + D394735C135D36533551DF37 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTStaticImage.m + path + Views/RCTStaticImage.m + sourceTree + <group> + + D50240220E277743B098DBAD + + baseConfigurationReference + E84F2418584963830725CDE6 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + D68FD95702012038D081A30C + + fileRef + C18BF11BD79C83BBFB1BD210 + isa + PBXBuildFile + + D73FE49574ED6F2E1BE3AF20 + + isa + PBXTargetDependency + name + Pods-RCTNetworkImage + target + 4E58EBB9F3E15EDD045ABDA5 + targetProxy + 6A34E09DEECEAFFE61EE78A4 + + D75EAAB4BC589DDF11232D56 + + fileRef + B9F1F805E855F9FFAAEE736B + isa + PBXBuildFile + + D76CEC171F408A47616D2702 + + fileRef + 8A3990D8C3642C990B243791 + isa + PBXBuildFile + + D7DCC1BDDF6B30BCCF621E17 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-RCTText-dummy.m + sourceTree + <group> + + D8261275342CB017F0469C64 + + children + + 13031656FE090AFA478A0C2E + EC0EF94CE6675DE213C63C55 + 3CD60F36DF6CEECFF4758BEE + 516150EA2C83F095456330AE + + isa + PBXGroup + name + Development Pods + sourceTree + <group> + + D8AC4BDDE87A9A5AEAFFE958 + + fileRef + 965D54B6354201E9C547F888 + isa + PBXBuildFile + + D9BE4CF160D48568F7B2FACB + + children + + 48B2F9A5EEA775E9BDF2360D + 89664286C51C7DFFF1F672C7 + 5571F59D7888CF59E6621A86 + 645997F70491670B86F2BA96 + 0974827BD5B31C816AC72CAC + + isa + PBXGroup + name + Products + sourceTree + <group> + + DACF3CCEA461A0EFF3A35E2F + + containerPortal + AF4E3BAC82C6DDA51BDA9F71 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 7E2C54A003A5BC8A330804F4 + remoteInfo + Pods-RCTText + + DC18D421A4941275A1E7BAD4 + + fileRef + A019FBFA9536047BFD4E8566 + isa + PBXBuildFile + + DFF568166262DEA96AFD5450 + + fileRef + 4BC269B918F30C81607B1FEA + isa + PBXBuildFile + + DFFD02DED71CBF8CF075A273 + + isa + PBXTargetDependency + name + Pods-ReactKit + target + 13B7E1C57803F05652F30C1F + targetProxy + 7830A204AA05E610158D3092 + + E1F996C0BFA1F4C1D6EFC235 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Pods-acknowledgements.plist + sourceTree + <group> + + E2FC6E20D98E105B4DE2C724 + + fileRef + 22E5124B31E3B321E794DC94 + isa + PBXBuildFile + + E3096E2B995B282B80B5EB43 + + fileRef + 33092F9AC97DCFFCA7A6BEA5 + isa + PBXBuildFile + + E334AB4D0391D82A0DE38C55 + + fileRef + AD89D20777D9EE94627336E2 + isa + PBXBuildFile + + E4450895EB5C944681A11604 + + buildActionMask + 2147483647 + files + + B8121D544B10403943F18595 + + isa + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + E5BB88DE7333103EDD6BFEFA + + fileRef + EA5B9962C9C69FF5B105130C + isa + PBXBuildFile + + E646155312572FA2F9C110A7 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTLog.h + path + Base/RCTLog.h + sourceTree + <group> + + E6E580D9802C99CB05F48910 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTWebViewExecutor.m + path + Executors/RCTWebViewExecutor.m + sourceTree + <group> + + E7374582F5A63129724C8E68 + + fileRef + C076C6CC906607E83876CCC2 + isa + PBXBuildFile + + E73A41337A1AF48B8A39A088 + + fileRef + 2857546735111E15C0AA45AC + isa + PBXBuildFile + + E79C749F7C18402B8FAC543A + + buildActionMask + 2147483647 + files + + AD2B1C2233FF46325D39E241 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + E84F2418584963830725CDE6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-ReactKit-Private.xcconfig + sourceTree + <group> + + E90505537034D18BAC56279F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTNavItem.m + path + Views/RCTNavItem.m + sourceTree + <group> + + E9778064D3F51028ADAE1A34 + + fileRef + 63887528ABF88595D89EDA8E + isa + PBXBuildFile + + EA5B9962C9C69FF5B105130C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTAlertManager.h + path + Modules/RCTAlertManager.h + sourceTree + <group> + + EAAA2A06300750F7AF266715 + + buildActionMask + 2147483647 + files + + E2FC6E20D98E105B4DE2C724 + E5BB88DE7333103EDD6BFEFA + 7B3E398E836D3D5B284BE497 + 95F60EF688D3DC27638042A2 + A1DCC56E57BB6053E663E32D + D68FD95702012038D081A30C + 4F4B2DFFE6DB1F3F056D7A88 + 01D7CE13EF89CFA0018C19A0 + 6664ADDDE2CD563193D50725 + 99294162E5C2E03148EBF05C + 22E9B6EECA586FBF58E275F4 + E73A41337A1AF48B8A39A088 + B9160C07A1D8C010D44E96BB + 8989408E16B49A592CECE05E + 1ACF8F46B5AD479EC0466814 + 9725F8B362AF089826F00A64 + 3DE934F8F76F207BD55AB677 + 8074519FA3432A12365C723C + C004F0768C26A0FC14249BB2 + 4B893B55D3B47F56554BCEEB + 78C6E228F82F244A224CDAAC + 673ACA8D38F46D1E3F6C7B36 + BE5C6A85BE08DB53D14CE20A + C0BCC72ACD29F6AAC357B59C + 496F484960908F7F255D665C + 6F14A0EF8B554164C0913DD8 + 8D89762D01606FF08D2D0415 + 17E61BB696CF0023E490D3CA + 64CFDB05AE3A6A9975FFBCEA + 90B9883EFAE5BB4CA68AA7ED + 5445A5107FDF059DA476582F + FF564CF868E1285B9045D6EE + 1475284FDEE790E29FEF888A + 44A3273EA768EAD9FB3033B0 + 3E20F8895633E084956AFB54 + 3B1C86DC544A391311D0F119 + FDAA8DAAE150AAE129BA4846 + FB31D58A343DF9884B38F1FC + 8389891D3F795245EEC47D4B + 3C9A4805273F33EF92D439A4 + 6C14CDB69262D0CF9F277492 + F45F64B628ABB38034419973 + 58B5D9EFD4CDD5F7431E1416 + 45D22F90E12DC985BE508454 + 556D48417573C2CCC7132F1A + D04E5DBEFDC4B2FA70ECBB57 + + isa + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + EACA5CCAD77673E65C1833FF + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTDataManager-Private.xcconfig + sourceTree + <group> + + EC0EF94CE6675DE213C63C55 + + children + + C1273C2B1A34EE7896A3D5FA + 2EA25D395FD517EFB3A63CE0 + 965D54B6354201E9C547F888 + 4D5D8632A9C98162B3121441 + 7E4612BAA564E326F5CE9D8E + 2909FAB5B87A982551EDB4EB + 83F79A097E2909089E3FC524 + + isa + PBXGroup + name + RCTNetworkImage + path + ../../../Libraries/Image + sourceTree + <group> + + ECA2414C9D669EE25B29026B + + buildConfigurations + + 05D4613D8454536A0C582506 + 81BC72A103E1C577C1B19212 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + EE584546150D3E55E6515F2E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTLocationObserver.h + path + Modules/RCTLocationObserver.h + sourceTree + <group> + + EFC27C70A2E94665DCBD987F includeInIndex 1 @@ -867,7 +4010,27 @@ sourceTree <group> - 3D1E50AF744E283AA07F6B6A + EFF3190D434856C25227FE84 + + fileRef + F603040661CEDD4C306E6127 + isa + PBXBuildFile + + F00FE630E41F44E6FFD45A71 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-dummy.m + sourceTree + <group> + + F1AF16AE6F3215C601C8BF2A includeInIndex 1 @@ -876,13 +4039,106 @@ lastKnownFileType sourcecode.c.h name - RCTStaticImageManager.h + RCTEventDispatcher.h path - Views/RCTStaticImageManager.h + Base/RCTEventDispatcher.h sourceTree <group> - 3D6FC3872FA9FE79857A9533 + F2ABD2CA1B8437A717A8B02E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTCache.m + path + Base/RCTCache.m + sourceTree + <group> + + F360C8A48A0EF89F49435FCC + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTDataManager.xcconfig + sourceTree + <group> + + F398EE4EDB2C9867D5FF4E79 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-RCTText-prefix.pch + sourceTree + <group> + + F3FA21714693F02F20D877A2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTAssert.m + path + Base/RCTAssert.m + sourceTree + <group> + + F45F64B628ABB38034419973 + + fileRef + C816B4169D2425B6E0DCBF6F + isa + PBXBuildFile + + F603040661CEDD4C306E6127 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTNavItemManager.m + path + Views/RCTNavItemManager.m + sourceTree + <group> + + F6713859D76D7A17020FF1D7 + + buildActionMask + 2147483647 + files + + 346B439D0B302F06A3944961 + D8AC4BDDE87A9A5AEAFFE958 + 8BFDB4E6A534A18777DD9413 + + isa + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + F68B2AE07F4085B87FF52821 buildSettings @@ -949,14 +4205,7 @@ name Debug - 3E42DBB95C1805122AE2171D - - fileRef - 290C5E10241C0B2C924F14E6 - isa - PBXBuildFile - - 3ED59FDCF3B8DE44DD4C1667 + F70008E1D19432CFDECE123B includeInIndex 1 @@ -964,2490 +4213,39 @@ PBXFileReference lastKnownFileType sourcecode.c.objc - name - RCTBridge.m path - Base/RCTBridge.m + Pods-RCTNetworkImage-dummy.m sourceTree <group> - 3EDE783B10222492880DD3AB + F8081DBFD37093C1EEE34411 + + fileRef + B758DF7D0F574FFF532D9764 + isa + PBXBuildFile + + F81FAD337D3D121CA8A5A4CA buildActionMask 2147483647 files - 63E51C8504EA2C10E68B02ED - - isa - PBXHeadersBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 3FFDD3C8378B7BB621BC78E9 - - fileRef - DFA3EC5E1764BCB1C6CDEC48 - isa - PBXBuildFile - - 41135E6FEF13B7C0629B2504 - - buildConfigurations - - 3D6FC3872FA9FE79857A9533 - C2E82E03DD326AD6B9E61CA8 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 4144C0A7A0B5E9B910A49112 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-RCTNetworkImage-prefix.pch - sourceTree - <group> - - 41D67C49FE5405FBC354B2D8 - - fileRef - FFAA9FB176212ECB441C158B - isa - PBXBuildFile - - 42DD1ABF71E7DDE8F625D75F - - buildActionMask - 2147483647 - files - - DDFF4F45838A985D83EB4388 + 5E978F1482C798C60C70F510 isa PBXFrameworksBuildPhase runOnlyForDeploymentPostprocessing 0 - 432AFAC69A94AA5F06088B28 + FB31D58A343DF9884B38F1FC fileRef - D9E56A6CF4CE4A04E95C3014 + 3B2EF60D760BB2D99E79CE51 isa PBXBuildFile - 44B64536F5CA954B8E61E64A - - fileRef - 31A2F342B0F590C341B80E22 - isa - PBXBuildFile - - 45315E8BEBC17056E67EC4FB - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTUtils.m - path - Base/RCTUtils.m - sourceTree - <group> - - 455EF31DC16195410CAEED8B - - baseConfigurationReference - 98E2279571F800AAEC885852 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - 46DBB7DDD201455CC7822443 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - UIView+ReactKit.h - path - Views/UIView+ReactKit.h - sourceTree - <group> - - 4819361C459238E768D0623F - - fileRef - F13F01D5CEF7D509D7FB3A75 - isa - PBXBuildFile - - 486A508147DE414B1C54DB3B - - fileRef - CF75A4E5C983EFE50EF23864 - isa - PBXBuildFile - - 48BCE09A6E673A5F0771E3A0 - - fileRef - BC0819432142676ED7CD8D13 - isa - PBXBuildFile - - 48C4ACFA9C0F6598C47536AE - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.plist.xml - path - Pods-acknowledgements.plist - sourceTree - <group> - - 4B4D221F3651E112595964E6 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTUIManager.h - path - Modules/RCTUIManager.h - sourceTree - <group> - - 4B5DA911DA22390C5E95B750 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTImageDownloader.m - sourceTree - <group> - - 4BE2DDA0BCC878EB8CB26C5A - - fileRef - 56F3B2390EEE3D197152D75F - isa - PBXBuildFile - - 4C96B8E009C3509E8C4A58F4 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTUIActivityIndicatorViewManager.h - path - Views/RCTUIActivityIndicatorViewManager.h - sourceTree - <group> - - 4CA65E88D9B0A200CE9C9118 - - baseConfigurationReference - D7A44E0FB5FD0083354541D0 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - - isa - XCBuildConfiguration - name - Debug - - 4DEEE0266BA65632F6A0E7B1 - - fileRef - 2BA58703E0C4B2559E28AE42 - isa - PBXBuildFile - - 504176B67DCF8860EE15B6DE - - fileRef - 94FE868251742B4D99E9D44C - isa - PBXBuildFile - - 5219B1A509941D57D929D39A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTNavItem.h - path - Views/RCTNavItem.h - sourceTree - <group> - - 52B8E3C21D812BBDA6A21D90 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTImageDownloader.h - sourceTree - <group> - - 52C2F8683752617A087B61F9 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTTextFieldManager.h - path - Views/RCTTextFieldManager.h - sourceTree - <group> - - 5346BE5B4464865BE370DAE3 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTSparseArray.m - path - Base/RCTSparseArray.m - sourceTree - <group> - - 538D24A47F778BE37D482A70 - - fileRef - CECB70566BB387FCC3E72F82 - isa - PBXBuildFile - - 5424AF4790E65783BDA933AE - - fileRef - 1E172C103C8DDDD51C260454 - isa - PBXBuildFile - - 556F7551D750FD292977EAF3 - - containerPortal - BF94ECC553449F9486D48453 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - DF58F2F4E6B0B43A57E1D871 - remoteInfo - Pods-RCTNetworkImage - - 56F3B2390EEE3D197152D75F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTShadowText.m - sourceTree - <group> - - 56FB9B47588CF0F36FC96390 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTEventDispatcher.h - path - Base/RCTEventDispatcher.h - sourceTree - <group> - - 5789BD634633A460A15D2CFB - - buildActionMask - 2147483647 - files - - 73E9110E36C881B06618F651 - BE549016B7D84400A9C21554 - E03E37E50B395F68909D68F1 - 7BFF3710C1742EDD464C3907 - 1AD314273817E152C7E315BA - FCF9FA9A52C6466496834D9B - 72812F427CD41F84EDF7463F - B311A068CB02A3CB5731DF3F - AE2F0C5806A4C1B2923B9AA4 - C830647EE856312FD4703ADA - 6CBFC20798CA2E3F0D05E09A - 1B55097A38652E47A94193F2 - 8415074B62BAA6A44BAFDB9E - 5D6D65155F2608108E24323C - 8239340F32AD35797AFF5916 - A0519A4649CCB73011B039D4 - B917A72C88A3FFCC8B3A78BF - B7BF08D30812CE93EE5B73B8 - A827664554976694F2C33FCC - A8A1B6892A1330983405EBBE - 98C030E0A13DB99C7DF1BB7F - E2DE70C97989E3B70384CE53 - 504176B67DCF8860EE15B6DE - 76644CC3854953214A130D8B - 80DD4040D6A9CCBB3CD0EF7A - DF8895F638ACA4C5989F506D - BCDA3D97529987F3AF6E1E94 - CCDED8EEB351B73EEC8B9F7E - 819EE00153E0D7A318574D69 - A55433F81EC7E8C30974067B - 4DEEE0266BA65632F6A0E7B1 - A245979CC966F650E1C70D22 - 48BCE09A6E673A5F0771E3A0 - F8A906774F36E8CD2451E82E - 6A98A23B930054B26DC54F35 - 7AA8475783959E32EDA602E8 - 8A95730DCFBE1F08DB29B75A - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 581AF9074AC1929D0D1DAB9E - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text - name - Podfile - path - ../Podfile - sourceTree - SOURCE_ROOT - xcLanguageSpecificationIdentifier - xcode.lang.ruby - - 5840BACA98667C60F6B3A0C1 - - buildConfigurations - - BD4F6574C5906CCB6FC42D7F - BBE817045F170ECDCB05EF56 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 59186CF0F15087A1C2B440DD - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTEventDispatcher.m - path - Base/RCTEventDispatcher.m - sourceTree - <group> - - 59BF11297A6B39FFEBBB7861 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - Layout.h - path - Layout/Layout.h - sourceTree - <group> - - 5A0B5C72A1AA647B3A4B14F6 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTKeyCommands.h - path - Base/RCTKeyCommands.h - sourceTree - <group> - - 5BC09E97F41420AF1394ADCE - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - UIView+ReactKit.m - path - Views/UIView+ReactKit.m - sourceTree - <group> - - 5BE5302E054DBFAF040EF61B - - fileRef - EEE942E8275043E8ADF16BE2 - isa - PBXBuildFile - - 5C36071912941101A0924D87 - - children - - 9574DCBBFE4EFAB138C43844 - - isa - PBXGroup - name - iOS - sourceTree - <group> - - 5D6D65155F2608108E24323C - - fileRef - 94F63AC21292EE02A10FEC17 - isa - PBXBuildFile - - 5DCF6A84FBACA3015BC22399 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTNetworkImageViewManager.m - sourceTree - <group> - - 5E5C5A95047BB06B9931B5DF - - isa - PBXTargetDependency - name - Pods-ReactKit - target - F3743E4364DCD50F66E07E03 - targetProxy - EFDFA99290EC74C5612841DA - - 5F5E7CC68557DA53129800AD - - fileRef - 0EA55D4BFB9E3A24AB05482E - isa - PBXBuildFile - - 5F835835D10C7DFB6A9CF6A3 - - containerPortal - BF94ECC553449F9486D48453 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 607D2E44EB1F20343CE3456B - remoteInfo - Pods-RCTText - - 5F8F95C34626059B26772C85 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTTextManager.h - sourceTree - <group> - - 607D2E44EB1F20343CE3456B - - buildConfigurationList - 7122D1CC40CFBB02C49EA8FE - buildPhases - - 8915B8D680F07A5E87AE7951 - CD226C6942B1DF7EA0A2D228 - 0AC9EE10D9CD5E34ACCC37E0 - - buildRules - - dependencies - - 860C43275459A739AC102F54 - - isa - PBXNativeTarget - name - Pods-RCTText - productName - Pods-RCTText - productReference - 8E4605DF173DA988811CD0D0 - productType - com.apple.product-type.library.static - - 63A3B7B3C237D15908758757 - - children - - BF7B4B3789866923E16FA948 - D7A44E0FB5FD0083354541D0 - CECB70566BB387FCC3E72F82 - 4144C0A7A0B5E9B910A49112 - - isa - PBXGroup - name - Support Files - path - ../../Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage - sourceTree - <group> - - 63E51C8504EA2C10E68B02ED - - fileRef - 88C9CCC953EB2CBD7D57EED8 - isa - PBXBuildFile - - 65319A04EE7272D8823EC289 - - children - - 6D4728D5CA14DC2EE7EA3544 - 09567798D374D77BC5D172B2 - 98AF860C16DE530EE9D5FAD5 - 31A2F342B0F590C341B80E22 - 100E0F66BB2561CD9C5403B1 - 56F3B2390EEE3D197152D75F - E7825F1E43104ED6A50EDB98 - 8FEF9214746F53A78E8F115F - 5F8F95C34626059B26772C85 - 77338B0BEA88CD60DC1ABF10 - EBE596AB2811F489419F35E9 - - isa - PBXGroup - name - RCTText - path - ../../../Libraries/Text - sourceTree - <group> - - 68F34AEA31C32834FA5BC3A8 - - baseConfigurationReference - 6ECB652E72348E5A2B4636FC - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - 69E8EA4F874212E989F8E5F8 - - fileRef - 06C6AEB41647779AE72D05D0 - isa - PBXBuildFile - - 6A98A23B930054B26DC54F35 - - fileRef - B998DFBC2EC7B340775C2514 - isa - PBXBuildFile - - 6AEEF603053FE768ED3E5E4D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTSparseArray.h - path - Base/RCTSparseArray.h - sourceTree - <group> - - 6CBFC20798CA2E3F0D05E09A - - fileRef - 2108DCEFAE6CF37482CF1C0A - isa - PBXBuildFile - - 6D4728D5CA14DC2EE7EA3544 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTRawTextManager.h - sourceTree - <group> - - 6DDC3764218E410C0E170649 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTNetworkImageView.m - sourceTree - <group> - - 6E6299B7449D2F456EA2F26F - - fileRef - 5219B1A509941D57D929D39A - isa - PBXBuildFile - - 6ECB652E72348E5A2B4636FC - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods.release.xcconfig - sourceTree - <group> - - 6FC60E013E6B084708F80E1D - - fileRef - 5DCF6A84FBACA3015BC22399 - isa - PBXBuildFile - - 7050957C06196020470EC5C2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTScrollViewManager.m - path - Views/RCTScrollViewManager.m - sourceTree - <group> - - 70C56F45AD4CAD933ACBE2D4 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTBridge.h - path - Base/RCTBridge.h - sourceTree - <group> - - 710A1B01FA9E8F0E95876C75 - - children - - 8A7EF5F8BDA27A8EFB7E7B50 - 8F5CED50CE2BB3EBC5A0C8B7 - 9D269D2372F1ADF83E59D0E1 - 341FFB9C954C6FBBDA1D4CBB - - isa - PBXGroup - name - Support Files - path - ../Examples/Movies/Pods/Target Support Files/Pods-ReactKit - sourceTree - <group> - - 7122D1CC40CFBB02C49EA8FE - - buildConfigurations - - 788577F7D39EEA8E639BA335 - 455EF31DC16195410CAEED8B - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 7158773877C1566031B98AA7 - - buildActionMask - 2147483647 - files - - FE86C2EE891C09720566A5D9 - E340F8420234B32BB795E0EE - F0B848BA6E9EB162430D912B - - isa - PBXHeadersBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 7196F57776FE75B146C23681 - - fileRef - 35138A0F59E8056491258E07 - isa - PBXBuildFile - - 71F3A1261352CEB12D1EFE4E - - buildConfigurations - - 3AB2DFC2566FB389056F3BAC - 68F34AEA31C32834FA5BC3A8 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 7244C28261391D75E3F0B0EF - - fileRef - 46DBB7DDD201455CC7822443 - isa - PBXBuildFile - - 7253CC6B6B8F6AE678B3B19C - - buildActionMask - 2147483647 - files - - 106C230D038A62D2C37E5D75 - 432AFAC69A94AA5F06088B28 - 946BDFB1A5D5787E85175DC1 - F3DAEC86B758048B5930EF1B - 07192780F349FFB50B16BAE0 - 7F35C840463DEBE2ACAF026B - 5F5E7CC68557DA53129800AD - 85B47B09FA27F727DAFF911C - 0D8B5E4BC6B802176DDD88E5 - A803356E590BE34243DE7EFE - 2572FEE8678A128A03571950 - B9F42C9908AD31F4BC1F091D - 7650C106B8A5FA38ED23274F - 5BE5302E054DBFAF040EF61B - 907AF60B5B92038D240EC19C - D41179E6AAD395F25177A5F8 - CEFADE7A58F7E4400EE18E25 - 6E6299B7449D2F456EA2F26F - 7611C500CF8043E1E1A8FEA5 - DF924C16971D9C2C83A36133 - F4AB97BA6A8BC00071F62ED2 - 4819361C459238E768D0623F - 837435BB2245CCE3D1565029 - 73BE5712EFEC793AD4B710E1 - BD4CB1806A00FC955BECE0B1 - 2F5591055141A2D7A7918CE8 - 85FA6019949634CBE9A346BE - 149C58083427CE1CD36C8B10 - 291C4B433C922679BD458D5D - AC2A48152BD918215CA11AD5 - F26F1444F50B137ED3B72374 - 486A508147DE414B1C54DB3B - 3FFDD3C8378B7BB621BC78E9 - C3F3445613B7F46DC6BF3E3B - 8620DB570E79F86DF025BEC8 - 41D67C49FE5405FBC354B2D8 - 7FDFCDB3E73CFA4EF24EFC43 - 369763B76533786A8E5353A4 - C8D2916466298AD52317576B - 69E8EA4F874212E989F8E5F8 - 3E42DBB95C1805122AE2171D - 0612C8DB98399C9428864589 - 0B6D46780D0C5F037B9E50AF - B8EFB7E653F82E82FDEBD4EF - 7244C28261391D75E3F0B0EF - - isa - PBXHeadersBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 72812F427CD41F84EDF7463F - - fileRef - EF98585B892E19B5AE731973 - isa - PBXBuildFile - - 737BA62A1374F34098A61A3C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTNavigator.h - path - Views/RCTNavigator.h - sourceTree - <group> - - 73BE5712EFEC793AD4B710E1 - - fileRef - 1592E2F41A2DC2C927EBBF12 - isa - PBXBuildFile - - 73E9110E36C881B06618F651 - - fileRef - CBE8ADD69617298088FF9ACF - isa - PBXBuildFile - - 7440BE86AA8D5D86F9E0972C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTViewManager.m - path - Views/RCTViewManager.m - sourceTree - <group> - - 7611C500CF8043E1E1A8FEA5 - - fileRef - E59EC5A1D60FD731E0AA3C44 - isa - PBXBuildFile - - 7643C57FD9EC1838B0876BBD - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTDataManager-Private.xcconfig - sourceTree - <group> - - 7650C106B8A5FA38ED23274F - - fileRef - C37AAC16F286B1DB8F7BD60C - isa - PBXBuildFile - - 76644CC3854953214A130D8B - - fileRef - CF563F829B165F3323ABC0A1 - isa - PBXBuildFile - - 77338B0BEA88CD60DC1ABF10 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTTextManager.m - sourceTree - <group> - - 788577F7D39EEA8E639BA335 - - baseConfigurationReference - 98E2279571F800AAEC885852 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - - isa - XCBuildConfiguration - name - Debug - - 78C294F35FA33A84D8E83D01 - - buildActionMask - 2147483647 - files - - 5424AF4790E65783BDA933AE - AF2BC09B042EBB50F1A78EB5 - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 793AE1E6D8A0F5D66EC764FC - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTExceptionsManager.h - path - Modules/RCTExceptionsManager.h - sourceTree - <group> - - 79AC1D0DBC09CA9546BA5DC2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTConvert.m - path - Base/RCTConvert.m - sourceTree - <group> - - 79BE258178E49FD51E2CC4B8 - - fileRef - 100E0F66BB2561CD9C5403B1 - isa - PBXBuildFile - - 79CA05DA910EEC1FB74AF8B1 - - fileRef - 9574DCBBFE4EFAB138C43844 - isa - PBXBuildFile - - 7AA8475783959E32EDA602E8 - - fileRef - DD631F9387065E2C8158E9D2 - isa - PBXBuildFile - - 7AF4222A15F4D8545D8C75EE - - fileRef - 09567798D374D77BC5D172B2 - isa - PBXBuildFile - - 7BFF3710C1742EDD464C3907 - - fileRef - C3885B5209E462E315C1A082 - isa - PBXBuildFile - - 7CAF752A4A0E37B9583A87DB - - fileRef - E7825F1E43104ED6A50EDB98 - isa - PBXBuildFile - - 7D3032A8B618BED47A896B35 - - children - - 52B8E3C21D812BBDA6A21D90 - 4B5DA911DA22390C5E95B750 - 311B1F10DB6ECD376C2C410D - 6DDC3764218E410C0E170649 - D01D41AF354CCA45EB9E3F09 - 5DCF6A84FBACA3015BC22399 - 63A3B7B3C237D15908758757 - - isa - PBXGroup - name - RCTNetworkImage - path - ../../../Libraries/Image - sourceTree - <group> - - 7EFF5F80196820ED0BAC85A2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTStatusBarManager.m - path - Modules/RCTStatusBarManager.m - sourceTree - <group> - - 7F35C840463DEBE2ACAF026B - - fileRef - 70C56F45AD4CAD933ACBE2D4 - isa - PBXBuildFile - - 7FDFCDB3E73CFA4EF24EFC43 - - fileRef - 4C96B8E009C3509E8C4A58F4 - isa - PBXBuildFile - - 800F02FE328BD54F6A90FD91 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTAssert.h - path - Base/RCTAssert.h - sourceTree - <group> - - 80DD4040D6A9CCBB3CD0EF7A - - fileRef - 7EFF5F80196820ED0BAC85A2 - isa - PBXBuildFile - - 80FE5B00B155529379660FC4 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTTiming.m - path - Modules/RCTTiming.m - sourceTree - <group> - - 819EE00153E0D7A318574D69 - - fileRef - A3895AC4CDB2372877228F14 - isa - PBXBuildFile - - 8239340F32AD35797AFF5916 - - fileRef - CA8DFA708A0CA7DF5695D590 - isa - PBXBuildFile - - 83566DF45DEB3320EB352903 - - containerPortal - BF94ECC553449F9486D48453 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - F3743E4364DCD50F66E07E03 - remoteInfo - Pods-ReactKit - - 837435BB2245CCE3D1565029 - - fileRef - D324AB785A55E2706E36A274 - isa - PBXBuildFile - - 8415074B62BAA6A44BAFDB9E - - fileRef - CEEE4CFBC9BE5736ECAB62E6 - isa - PBXBuildFile - - 84D089AE2FBBC9A674F6ED90 - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods.a - sourceTree - BUILT_PRODUCTS_DIR - - 84DC232D4E0A3B5F77BD4BC2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTTextField.m - path - Views/RCTTextField.m - sourceTree - <group> - - 85AD0EB6443ECE478262D6C6 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTExceptionsManager.m - path - Modules/RCTExceptionsManager.m - sourceTree - <group> - - 85B47B09FA27F727DAFF911C - - fileRef - 95C56C7BFE0773470DD423D4 - isa - PBXBuildFile - - 85FA6019949634CBE9A346BE - - fileRef - 2409A610D6AB34EA92D33BE8 - isa - PBXBuildFile - - 860C43275459A739AC102F54 - - isa - PBXTargetDependency - name - Pods-ReactKit - target - F3743E4364DCD50F66E07E03 - targetProxy - 83566DF45DEB3320EB352903 - - 8620DB570E79F86DF025BEC8 - - fileRef - A0E7CDD7949470FE40475426 - isa - PBXBuildFile - - 8775A8D4E6338D61BF1064C5 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTShadowView.m - path - Views/RCTShadowView.m - sourceTree - <group> - - 880D38F15FF447F995573AB3 - - fileRef - 77338B0BEA88CD60DC1ABF10 - isa - PBXBuildFile - - 88505E4377E9058030C956B9 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text - path - Pods-acknowledgements.markdown - sourceTree - <group> - - 88C9CCC953EB2CBD7D57EED8 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTDataManager.h - sourceTree - <group> - - 88CBD87EEA9FF31AAF273687 - - isa - PBXTargetDependency - name - Pods-RCTNetworkImage - target - DF58F2F4E6B0B43A57E1D871 - targetProxy - 556F7551D750FD292977EAF3 - - 8915B8D680F07A5E87AE7951 - - buildActionMask - 2147483647 - files - - 9CAF0499B0A74F5CFA2A1E3B - 7AF4222A15F4D8545D8C75EE - 44B64536F5CA954B8E61E64A - 4BE2DDA0BCC878EB8CB26C5A - 34DBA23002D2E96B79EF3FBE - 880D38F15FF447F995573AB3 - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 8A7EF5F8BDA27A8EFB7E7B50 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-ReactKit.xcconfig - sourceTree - <group> - - 8A95730DCFBE1F08DB29B75A - - fileRef - 5BC09E97F41420AF1394ADCE - isa - PBXBuildFile - - 8AAEE8636EA9A9FF644ED344 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTText.xcconfig - sourceTree - <group> - - 8B70E5434E2CB2792BB8CC44 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTNavigatorManager.m - path - Views/RCTNavigatorManager.m - sourceTree - <group> - - 8E4605DF173DA988811CD0D0 - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods-RCTText.a - sourceTree - BUILT_PRODUCTS_DIR - - 8F5CED50CE2BB3EBC5A0C8B7 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-ReactKit-Private.xcconfig - sourceTree - <group> - - 8FEF9214746F53A78E8F115F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTText.m - sourceTree - <group> - - 907AF60B5B92038D240EC19C - - fileRef - 1782BB92C0A529BF6AD72DFF - isa - PBXBuildFile - - 90D5389E9D73CDBB276C1B34 - - children - - 5C36071912941101A0924D87 - - isa - PBXGroup - name - Frameworks - sourceTree - <group> - - 932A9309F808F533D40582BB - - buildConfigurationList - AC60249688E27C48CD0E62A1 - buildPhases - - 78C294F35FA33A84D8E83D01 - 42DD1ABF71E7DDE8F625D75F - 3EDE783B10222492880DD3AB - - buildRules - - dependencies - - 5E5C5A95047BB06B9931B5DF - - isa - PBXNativeTarget - name - Pods-RCTDataManager - productName - Pods-RCTDataManager - productReference - C9D66CDB1AB4CA948A39E26D - productType - com.apple.product-type.library.static - - 9361F6C165FFAD1CE1130BA7 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTStaticImage.h - path - Views/RCTStaticImage.h - sourceTree - <group> - - 946BDFB1A5D5787E85175DC1 - - fileRef - 15F0D204E7BD9B1607786736 - isa - PBXBuildFile - - 94F63AC21292EE02A10FEC17 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTNavItemManager.m - path - Views/RCTNavItemManager.m - sourceTree - <group> - - 94FE868251742B4D99E9D44C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTStaticImage.m - path - Views/RCTStaticImage.m - sourceTree - <group> - - 9574DCBBFE4EFAB138C43844 - - isa - PBXFileReference - lastKnownFileType - wrapper.framework - name - Foundation.framework - path - Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/Foundation.framework - sourceTree - DEVELOPER_DIR - - 95C56C7BFE0773470DD423D4 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTCache.h - path - Base/RCTCache.h - sourceTree - <group> - - 98AF860C16DE530EE9D5FAD5 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTShadowRawText.h - sourceTree - <group> - - 98C030E0A13DB99C7DF1BB7F - - fileRef - 8775A8D4E6338D61BF1064C5 - isa - PBXBuildFile - - 98E2279571F800AAEC885852 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTText-Private.xcconfig - sourceTree - <group> - - 99F944FDFA42E71DFD034D19 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTWebViewExecutor.h - path - Executors/RCTWebViewExecutor.h - sourceTree - <group> - - 9C430EF11704FB8793CA009C - - buildActionMask - 2147483647 - files - - 79CA05DA910EEC1FB74AF8B1 - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 9CAACB75648220203821AF2C - - buildActionMask - 2147483647 - files - - 237ECCFD5EBD9B7C1250F4EB - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 9CAF0499B0A74F5CFA2A1E3B - - fileRef - DFBDE4922D5AE7807A0676AB - isa - PBXBuildFile - - 9D269D2372F1ADF83E59D0E1 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-ReactKit-dummy.m - sourceTree - <group> - - 9DD770C9F0909D7B663F79B9 - - children - - 84D089AE2FBBC9A674F6ED90 - C9D66CDB1AB4CA948A39E26D - 246059A6C46C6F40327D9399 - 8E4605DF173DA988811CD0D0 - 0A9F33FAC1AE68D789D1776C - - isa - PBXGroup - name - Products - sourceTree - <group> - - 9F9D9AED8316D779EAEA6CBB - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods.debug.xcconfig - sourceTree - <group> - - A0519A4649CCB73011B039D4 - - fileRef - 8B70E5434E2CB2792BB8CC44 - isa - PBXBuildFile - - A0E7CDD7949470FE40475426 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTTiming.h - path - Modules/RCTTiming.h - sourceTree - <group> - - A23F22A624E7020BCB6E7BA5 - - baseConfigurationReference - 7643C57FD9EC1838B0876BBD - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-prefix.pch - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - - isa - XCBuildConfiguration - name - Debug - - A245979CC966F650E1C70D22 - - fileRef - 45315E8BEBC17056E67EC4FB - isa - PBXBuildFile - - A381C58516139C34B8364CD6 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTConvert.h - path - Base/RCTConvert.h - sourceTree - <group> - - A3895AC4CDB2372877228F14 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTTouchHandler.m - path - Base/RCTTouchHandler.m - sourceTree - <group> - - A55433F81EC7E8C30974067B - - fileRef - 0EAFFB5E66ACE63398007604 - isa - PBXBuildFile - - A70A067FFB2FCBB711D7F5FD - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTTextFieldManager.m - path - Views/RCTTextFieldManager.m - sourceTree - <group> - - A803356E590BE34243DE7EFE - - fileRef - A381C58516139C34B8364CD6 - isa - PBXBuildFile - - A827664554976694F2C33FCC - - fileRef - E6F823FCA4D283EAAAD0D577 - isa - PBXBuildFile - - A8A1B6892A1330983405EBBE - - fileRef - 7050957C06196020470EC5C2 - isa - PBXBuildFile - - AABC0F0E4C257651C752A272 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTNavigatorManager.h - path - Views/RCTNavigatorManager.h - sourceTree - <group> - - AB42C08CAF730F8AF9C8ADAB - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTRedBox.m - path - Base/RCTRedBox.m - sourceTree - <group> - - AC11EC6BAF7ED8F76E48397C - - fileRef - 98AF860C16DE530EE9D5FAD5 - isa - PBXBuildFile - - AC2A48152BD918215CA11AD5 - - fileRef - 9361F6C165FFAD1CE1130BA7 - isa - PBXBuildFile - - AC60249688E27C48CD0E62A1 - - buildConfigurations - - A23F22A624E7020BCB6E7BA5 - 3AF0EA123B1D6D47095D8F69 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - ADAA64389F188489440FF394 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTDataManager.xcconfig - sourceTree - <group> - - AE2F0C5806A4C1B2923B9AA4 - - fileRef - 59186CF0F15087A1C2B440DD - isa - PBXBuildFile - - AE5A12E81280D6C3660A8555 - - fileRef - 9574DCBBFE4EFAB138C43844 - isa - PBXBuildFile - - AF2BC09B042EBB50F1A78EB5 - - fileRef - 3C0A45593BBE3C2A57E72C81 - isa - PBXBuildFile - - B1A56B88049B3F5961BAEF1F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-environment.h - sourceTree - <group> - - B233C279B7F95C416BE7460F - - fileRef - 4B5DA911DA22390C5E95B750 - isa - PBXBuildFile - - B311A068CB02A3CB5731DF3F - - fileRef - 79AC1D0DBC09CA9546BA5DC2 - isa - PBXBuildFile - - B31D0718AFFBEBA633A5AB25 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTLog.h - path - Base/RCTLog.h - sourceTree - <group> - - B6BB65B0F788DFF2F121D4F7 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTShadowView.h - path - Views/RCTShadowView.h - sourceTree - <group> - - B7BF08D30812CE93EE5B73B8 - - fileRef - F101BBCEB615F24C5BA2B161 - isa - PBXBuildFile - - B8EFB7E653F82E82FDEBD4EF - - fileRef - 17C0992A90EEBE80108AEF54 - isa - PBXBuildFile - - B917A72C88A3FFCC8B3A78BF - - fileRef - AB42C08CAF730F8AF9C8ADAB - isa - PBXBuildFile - - B998DFBC2EC7B340775C2514 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTWebViewExecutor.m - path - Executors/RCTWebViewExecutor.m - sourceTree - <group> - - B9F42C9908AD31F4BC1F091D - - fileRef - 793AE1E6D8A0F5D66EC764FC - isa - PBXBuildFile - - BAD9616489752B70E709809C - - isa - PBXTargetDependency - name - Pods-RCTText - target - 607D2E44EB1F20343CE3456B - targetProxy - 5F835835D10C7DFB6A9CF6A3 - - BBE817045F170ECDCB05EF56 - - baseConfigurationReference - 8F5CED50CE2BB3EBC5A0C8B7 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - BC0819432142676ED7CD8D13 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTView.m - path - Views/RCTView.m - sourceTree - <group> - - BCDA3D97529987F3AF6E1E94 - - fileRef - A70A067FFB2FCBB711D7F5FD - isa - PBXBuildFile - - BD4CB1806A00FC955BECE0B1 - - fileRef - E56829432E0DA699D11DF890 - isa - PBXBuildFile - - BD4F6574C5906CCB6FC42D7F - - baseConfigurationReference - 8F5CED50CE2BB3EBC5A0C8B7 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - - isa - XCBuildConfiguration - name - Debug - - BE549016B7D84400A9C21554 - - fileRef - 9D269D2372F1ADF83E59D0E1 - isa - PBXBuildFile - - BF7B4B3789866923E16FA948 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTNetworkImage.xcconfig - sourceTree - <group> - - BF94ECC553449F9486D48453 - - attributes - - LastUpgradeCheck - 0510 - - buildConfigurationList - 41135E6FEF13B7C0629B2504 - compatibilityVersion - Xcode 3.2 - developmentRegion - English - hasScannedForEncodings - 0 - isa - PBXProject - knownRegions - - en - - mainGroup - 075ECFDD9BCF0E8901AE8625 - productRefGroup - 9DD770C9F0909D7B663F79B9 - projectDirPath - - projectReferences - - projectRoot - - targets - - 33E7FC15EBE6599AD3335BD8 - 932A9309F808F533D40582BB - DF58F2F4E6B0B43A57E1D871 - 607D2E44EB1F20343CE3456B - F3743E4364DCD50F66E07E03 - - - C2E82E03DD326AD6B9E61CA8 - - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - CLANG_CXX_LANGUAGE_STANDARD - gnu++0x - CLANG_CXX_LIBRARY - libc++ - CLANG_ENABLE_MODULES - YES - CLANG_ENABLE_OBJC_ARC - YES - CLANG_WARN_BOOL_CONVERSION - YES - CLANG_WARN_CONSTANT_CONVERSION - YES - CLANG_WARN_DIRECT_OBJC_ISA_USAGE - YES - CLANG_WARN_EMPTY_BODY - YES - CLANG_WARN_ENUM_CONVERSION - YES - CLANG_WARN_INT_CONVERSION - YES - CLANG_WARN_OBJC_ROOT_CLASS - YES - COPY_PHASE_STRIP - NO - ENABLE_NS_ASSERTIONS - NO - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_PREPROCESSOR_DEFINITIONS - - RELEASE=1 - - GCC_WARN_64_TO_32_BIT_CONVERSION - YES - GCC_WARN_ABOUT_RETURN_TYPE - YES - GCC_WARN_UNDECLARED_SELECTOR - YES - GCC_WARN_UNINITIALIZED_AUTOS - YES - GCC_WARN_UNUSED_FUNCTION - YES - GCC_WARN_UNUSED_VARIABLE - YES - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - STRIP_INSTALLED_PRODUCT - NO - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - C37AAC16F286B1DB8F7BD60C + FB45A4C5FE56C74F2EA4BD34 includeInIndex 1 @@ -3462,544 +4260,25 @@ sourceTree <group> - C3885B5209E462E315C1A082 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTAssert.m - path - Base/RCTAssert.m - sourceTree - <group> - - C3F3445613B7F46DC6BF3E3B - - fileRef - 52C2F8683752617A087B61F9 - isa - PBXBuildFile - - C6EB359CFF6D72170FEF1C91 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTScrollViewManager.h - path - Views/RCTScrollViewManager.h - sourceTree - <group> - - C830647EE856312FD4703ADA - - fileRef - 85AD0EB6443ECE478262D6C6 - isa - PBXBuildFile - - C8D2916466298AD52317576B - - fileRef - 284A37E0CFFCA95AD5134C06 - isa - PBXBuildFile - - C9D66CDB1AB4CA948A39E26D - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods-RCTDataManager.a - sourceTree - BUILT_PRODUCTS_DIR - - CA8DFA708A0CA7DF5695D590 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTNavigator.m - path - Views/RCTNavigator.m - sourceTree - <group> - - CBE8ADD69617298088FF9ACF - - includeInIndex - 1 - isa - PBXFileReference - name - Layout.c - path - Layout/Layout.c - sourceTree - <group> - - CC953A5B7DFF969670A89AF9 - - fileRef - 9574DCBBFE4EFAB138C43844 - isa - PBXBuildFile - - CCDED8EEB351B73EEC8B9F7E - - fileRef - 80FE5B00B155529379660FC4 - isa - PBXBuildFile - - CD226C6942B1DF7EA0A2D228 - - buildActionMask - 2147483647 - files - - CC953A5B7DFF969670A89AF9 - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - CDB49A44CDED422DC861AC80 - - fileRef - 5F8F95C34626059B26772C85 - isa - PBXBuildFile - - CECB70566BB387FCC3E72F82 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-RCTNetworkImage-dummy.m - sourceTree - <group> - - CEEE4CFBC9BE5736ECAB62E6 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTNavItem.m - path - Views/RCTNavItem.m - sourceTree - <group> - - CEFADE7A58F7E4400EE18E25 - - fileRef - B31D0718AFFBEBA633A5AB25 - isa - PBXBuildFile - - CF563F829B165F3323ABC0A1 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTStaticImageManager.m - path - Views/RCTStaticImageManager.m - sourceTree - <group> - - CF75A4E5C983EFE50EF23864 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTStatusBarManager.h - path - Modules/RCTStatusBarManager.h - sourceTree - <group> - - D01D41AF354CCA45EB9E3F09 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTNetworkImageViewManager.h - sourceTree - <group> - - D324AB785A55E2706E36A274 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTRedBox.h - path - Base/RCTRedBox.h - sourceTree - <group> - - D34FE18B7D368E5AD6584E23 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTCache.m - path - Base/RCTCache.m - sourceTree - <group> - - D41179E6AAD395F25177A5F8 - - fileRef - 5A0B5C72A1AA647B3A4B14F6 - isa - PBXBuildFile - - D606AC45A684300C958D9C0C + FB5BEEF19CFBB7012E80C408 children - 88C9CCC953EB2CBD7D57EED8 - 3C0A45593BBE3C2A57E72C81 - 048B0A5A6D3AE173A67CAE93 + 782532E10015155FB2604DE6 + E84F2418584963830725CDE6 + CD2F169E76E103DA4112FFEC + 7E53CCE7BC2F97B8D7A64AD0 isa PBXGroup name - RCTDataManager + Support Files path - ../../../Libraries/Network + ../Examples/Movies/Pods/Target Support Files/Pods-ReactKit sourceTree <group> - D7A44E0FB5FD0083354541D0 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTNetworkImage-Private.xcconfig - sourceTree - <group> - - D9E56A6CF4CE4A04E95C3014 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTAlertManager.h - path - Modules/RCTAlertManager.h - sourceTree - <group> - - DB81D9FD0801A42A48152E0C - - buildActionMask - 2147483647 - files - - 7196F57776FE75B146C23681 - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - DD25A411976BA72A8CB95128 - - children - - CBE8ADD69617298088FF9ACF - 59BF11297A6B39FFEBBB7861 - D9E56A6CF4CE4A04E95C3014 - 2D208141DE8BC9DD7F5B8235 - 15F0D204E7BD9B1607786736 - 800F02FE328BD54F6A90FD91 - C3885B5209E462E315C1A082 - 2CD30CF1663697474B87D08E - 70C56F45AD4CAD933ACBE2D4 - 3ED59FDCF3B8DE44DD4C1667 - 0EA55D4BFB9E3A24AB05482E - 95C56C7BFE0773470DD423D4 - D34FE18B7D368E5AD6584E23 - E64248B361B8929CFE00FADC - EF98585B892E19B5AE731973 - A381C58516139C34B8364CD6 - 79AC1D0DBC09CA9546BA5DC2 - 56FB9B47588CF0F36FC96390 - 59186CF0F15087A1C2B440DD - 793AE1E6D8A0F5D66EC764FC - 85AD0EB6443ECE478262D6C6 - C37AAC16F286B1DB8F7BD60C - EEE942E8275043E8ADF16BE2 - 1782BB92C0A529BF6AD72DFF - 5A0B5C72A1AA647B3A4B14F6 - 2108DCEFAE6CF37482CF1C0A - B31D0718AFFBEBA633A5AB25 - 1EA900AAF1440F65670A2F9D - 5219B1A509941D57D929D39A - CEEE4CFBC9BE5736ECAB62E6 - E59EC5A1D60FD731E0AA3C44 - 94F63AC21292EE02A10FEC17 - 737BA62A1374F34098A61A3C - CA8DFA708A0CA7DF5695D590 - AABC0F0E4C257651C752A272 - 8B70E5434E2CB2792BB8CC44 - F13F01D5CEF7D509D7FB3A75 - D324AB785A55E2706E36A274 - AB42C08CAF730F8AF9C8ADAB - 1592E2F41A2DC2C927EBBF12 - F101BBCEB615F24C5BA2B161 - E56829432E0DA699D11DF890 - E6F823FCA4D283EAAAD0D577 - C6EB359CFF6D72170FEF1C91 - 7050957C06196020470EC5C2 - 2409A610D6AB34EA92D33BE8 - B6BB65B0F788DFF2F121D4F7 - 8775A8D4E6338D61BF1064C5 - 6AEEF603053FE768ED3E5E4D - 5346BE5B4464865BE370DAE3 - 9361F6C165FFAD1CE1130BA7 - 94FE868251742B4D99E9D44C - 3D1E50AF744E283AA07F6B6A - CF563F829B165F3323ABC0A1 - CF75A4E5C983EFE50EF23864 - 7EFF5F80196820ED0BAC85A2 - DFA3EC5E1764BCB1C6CDEC48 - 84DC232D4E0A3B5F77BD4BC2 - 52C2F8683752617A087B61F9 - A70A067FFB2FCBB711D7F5FD - A0E7CDD7949470FE40475426 - 80FE5B00B155529379660FC4 - FFAA9FB176212ECB441C158B - A3895AC4CDB2372877228F14 - 4C96B8E009C3509E8C4A58F4 - 0EAFFB5E66ACE63398007604 - 4B4D221F3651E112595964E6 - 2BA58703E0C4B2559E28AE42 - 284A37E0CFFCA95AD5134C06 - 45315E8BEBC17056E67EC4FB - 06C6AEB41647779AE72D05D0 - BC0819432142676ED7CD8D13 - 290C5E10241C0B2C924F14E6 - 7440BE86AA8D5D86F9E0972C - 12E89F4AD5820CD9722AD8D0 - 99F944FDFA42E71DFD034D19 - B998DFBC2EC7B340775C2514 - 17C0992A90EEBE80108AEF54 - DD631F9387065E2C8158E9D2 - 46DBB7DDD201455CC7822443 - 5BC09E97F41420AF1394ADCE - 710A1B01FA9E8F0E95876C75 - - isa - PBXGroup - name - ReactKit - path - ../../../ReactKit - sourceTree - <group> - - DD631F9387065E2C8158E9D2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTWrapperViewController.m - path - Views/RCTWrapperViewController.m - sourceTree - <group> - - DDFF4F45838A985D83EB4388 - - fileRef - 9574DCBBFE4EFAB138C43844 - isa - PBXBuildFile - - DF58F2F4E6B0B43A57E1D871 - - buildConfigurationList - 1F99DFDC314091E129914F82 - buildPhases - - 38E413F00F71503B4358BF3A - 9CAACB75648220203821AF2C - 7158773877C1566031B98AA7 - - buildRules - - dependencies - - 19CACF004F780E3053926DAD - - isa - PBXNativeTarget - name - Pods-RCTNetworkImage - productName - Pods-RCTNetworkImage - productReference - 246059A6C46C6F40327D9399 - productType - com.apple.product-type.library.static - - DF8895F638ACA4C5989F506D - - fileRef - 84DC232D4E0A3B5F77BD4BC2 - isa - PBXBuildFile - - DF924C16971D9C2C83A36133 - - fileRef - 737BA62A1374F34098A61A3C - isa - PBXBuildFile - - DFA3EC5E1764BCB1C6CDEC48 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTTextField.h - path - Views/RCTTextField.h - sourceTree - <group> - - DFBDE4922D5AE7807A0676AB - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-RCTText-dummy.m - sourceTree - <group> - - E03E37E50B395F68909D68F1 - - fileRef - 2D208141DE8BC9DD7F5B8235 - isa - PBXBuildFile - - E2DE70C97989E3B70384CE53 - - fileRef - 5346BE5B4464865BE370DAE3 - isa - PBXBuildFile - - E340F8420234B32BB795E0EE - - fileRef - 311B1F10DB6ECD376C2C410D - isa - PBXBuildFile - - E56829432E0DA699D11DF890 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTScrollView.h - path - Views/RCTScrollView.h - sourceTree - <group> - - E59EC5A1D60FD731E0AA3C44 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTNavItemManager.h - path - Views/RCTNavItemManager.h - sourceTree - <group> - - E64248B361B8929CFE00FADC + FCFDA7AB4DB749DFF1E2511E includeInIndex 1 @@ -4014,271 +4293,40 @@ sourceTree <group> - E6F823FCA4D283EAAAD0D577 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTScrollView.m - path - Views/RCTScrollView.m - sourceTree - <group> - - E7825F1E43104ED6A50EDB98 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTText.h - sourceTree - <group> - - EBE596AB2811F489419F35E9 - - children - - 8AAEE8636EA9A9FF644ED344 - 98E2279571F800AAEC885852 - DFBDE4922D5AE7807A0676AB - F59352A24B5D8F8B1FF74ABC - - isa - PBXGroup - name - Support Files - path - ../../Examples/Movies/Pods/Target Support Files/Pods-RCTText - sourceTree - <group> - - ED320F983C718810619BABED - - containerPortal - BF94ECC553449F9486D48453 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - F3743E4364DCD50F66E07E03 - remoteInfo - Pods-ReactKit - - EEE942E8275043E8ADF16BE2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTJSMethodRegistrar.h - path - Base/RCTJSMethodRegistrar.h - sourceTree - <group> - - EF98585B892E19B5AE731973 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTContextExecutor.m - path - Executors/RCTContextExecutor.m - sourceTree - <group> - - EFDFA99290EC74C5612841DA - - containerPortal - BF94ECC553449F9486D48453 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - F3743E4364DCD50F66E07E03 - remoteInfo - Pods-ReactKit - - F0B848BA6E9EB162430D912B + FDAA8DAAE150AAE129BA4846 fileRef - D01D41AF354CCA45EB9E3F09 + 45760E0B6F7A35A5C23C8B46 isa PBXBuildFile - F101BBCEB615F24C5BA2B161 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTRootView.m - path - Base/RCTRootView.m - sourceTree - <group> - - F13F01D5CEF7D509D7FB3A75 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTPointerEvents.h - path - Base/RCTPointerEvents.h - sourceTree - <group> - - F190DBB178201E2AC54C7F70 - - buildActionMask - 2147483647 - files - - AE5A12E81280D6C3660A8555 - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - F26F1444F50B137ED3B72374 + FE2FDD4E39D0988AC7EFFDA9 fileRef - 3D1E50AF744E283AA07F6B6A + 36C25DD43B6139727D23ABDE isa PBXBuildFile - F3743E4364DCD50F66E07E03 + FE9545D71B365894A20387A0 - buildConfigurationList - 5840BACA98667C60F6B3A0C1 - buildPhases - - 5789BD634633A460A15D2CFB - F190DBB178201E2AC54C7F70 - 7253CC6B6B8F6AE678B3B19C - - buildRules - - dependencies - isa - PBXNativeTarget + PBXTargetDependency name Pods-ReactKit - productName - Pods-ReactKit - productReference - 0A9F33FAC1AE68D789D1776C - productType - com.apple.product-type.library.static + target + 13B7E1C57803F05652F30C1F + targetProxy + 114860C3B3984FFBF421B47A - F3DAEC86B758048B5930EF1B + FF564CF868E1285B9045D6EE fileRef - 800F02FE328BD54F6A90FD91 + 1C1136F66431443A895D4575 isa PBXBuildFile - F4AB97BA6A8BC00071F62ED2 - - fileRef - AABC0F0E4C257651C752A272 - isa - PBXBuildFile - - F59352A24B5D8F8B1FF74ABC - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-RCTText-prefix.pch - sourceTree - <group> - - F5B54251AEB97ECA54054310 - - children - - D606AC45A684300C958D9C0C - 7D3032A8B618BED47A896B35 - 65319A04EE7272D8823EC289 - DD25A411976BA72A8CB95128 - - isa - PBXGroup - name - Development Pods - sourceTree - <group> - - F8A906774F36E8CD2451E82E - - fileRef - 7440BE86AA8D5D86F9E0972C - isa - PBXBuildFile - - FCF9FA9A52C6466496834D9B - - fileRef - D34FE18B7D368E5AD6584E23 - isa - PBXBuildFile - - FE86C2EE891C09720566A5D9 - - fileRef - 52B8E3C21D812BBDA6A21D90 - isa - PBXBuildFile - - FFAA9FB176212ECB441C158B - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTTouchHandler.h - path - Base/RCTTouchHandler.h - sourceTree - <group> - rootObject - BF94ECC553449F9486D48453 + AF4E3BAC82C6DDA51BDA9F71 diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h b/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h index c99ed0689..920bf705c 100644 --- a/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h +++ b/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h @@ -6,7 +6,8 @@ @interface RCTNetworkImageView : UIView -- (instancetype)initWithFrame:(CGRect)frame imageDownloader:(RCTImageDownloader *)imageDownloader; +- (instancetype)initWithFrame:(CGRect)frame + imageDownloader:(RCTImageDownloader *)imageDownloader NS_DESIGNATED_INITIALIZER; /** * An image that will appear while the view is loading the image from the network, diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridge.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridge.h index 9a890a07a..4dcaee8e2 100644 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridge.h +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridge.h @@ -6,32 +6,16 @@ @class RCTBridge; @class RCTEventDispatcher; -@class RCTRootView; - -/** - * Utilities for constructing common response objects. When sending a - * systemError back to JS, it's important to describe whether or not it was a - * system error, or API usage error. System errors should never happen and are - * therefore logged using `RCTLogError()`. API usage errors are expected if the - * API is misused and will therefore not be logged using `RCTLogError()`. The JS - * application code is expected to handle them. Regardless of type, each error - * should be logged at most once. - */ -static inline NSDictionary *RCTSystemErrorObject(NSString *msg) -{ - return @{@"systemError": msg ?: @""}; -} - -static inline NSDictionary *RCTAPIErrorObject(NSString *msg) -{ - return @{@"apiError": msg ?: @""}; -} /** * This block can be used to instantiate modules that require additional * init parameters, or additional configuration prior to being used. + * The bridge will call this block to instatiate the modules, and will + * be responsible for invalidating/releasing them when the bridge is destroyed. + * For this reason, the block should always return new module instances, and + * module instances should not be shared between bridges. */ -typedef NSArray *(^RCTBridgeModuleProviderBlock)(RCTBridge *bridge); +typedef NSArray *(^RCTBridgeModuleProviderBlock)(void); /** * Async batched bridge used to communicate with the JavaScript application. @@ -42,12 +26,12 @@ typedef NSArray *(^RCTBridgeModuleProviderBlock)(RCTBridge *bridge); * The designated initializer. This creates a new bridge on top of the specified * executor. The bridge should then be used for all subsequent communication * with the JavaScript code running in the executor. Modules will be automatically - * instantiated using the default contructor, but you can optionally pass in a - * module provider block to manually instantiate modules that require additional - * init parameters or configuration. + * instantiated using the default contructor, but you can optionally pass in an + * array of pre-initialized module instances if they require additional init + * parameters or configuration. */ -- (instancetype)initWithJavaScriptExecutor:(id)javaScriptExecutor - moduleProvider:(RCTBridgeModuleProviderBlock)block NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithExecutor:(id)executor + moduleProvider:(RCTBridgeModuleProviderBlock)block NS_DESIGNATED_INITIALIZER; /** * This method is used to call functions in the JavaScript application context. @@ -81,16 +65,6 @@ typedef NSArray *(^RCTBridgeModuleProviderBlock)(RCTBridge *bridge); */ @property (nonatomic, readonly) dispatch_queue_t shadowQueue; -// For use in implementing delegates, which may need to queue responses. -- (RCTResponseSenderBlock)createResponseSenderBlock:(NSInteger)callbackID; - -/** - * Register a root view with the bridge. Theorectically, a single bridge can - * support multiple root views, however this feature is not currently exposed - * and may eventually be removed. - */ -- (void)registerRootView:(RCTRootView *)rootView; - /** * Global logging function that will print to both xcode and JS debugger consoles. * diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridgeModule.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridgeModule.h index d9df70a22..2627a0b9f 100644 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridgeModule.h +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridgeModule.h @@ -19,10 +19,12 @@ typedef void (^RCTResponseSenderBlock)(NSArray *response); @optional /** - * Optional initializer for modules that require access - * to bridge features, such as sending events or making JS calls + * A reference to the RCTBridge. Useful for modules that require access + * to bridge features, such as sending events or making JS calls. This + * will be set automatically by the bridge when it initializes the module. +* To implement this in your module, just add @synthesize bridge = _bridge; */ -- (instancetype)initWithBridge:(RCTBridge *)bridge; +@property (nonatomic, strong) RCTBridge *bridge; /** * The module name exposed to JS. If omitted, this will be inferred @@ -42,17 +44,11 @@ typedef void (^RCTResponseSenderBlock)(NSArray *response); /** * Injects constants into JS. These constants are made accessible via - * NativeModules.moduleName.X. Note that this method is not inherited when you - * subclass a module, and you should not call [super constantsToExport] when - * implementing it. - */ -+ (NSDictionary *)constantsToExport; - -/** - * Some "constants" are not really constant, and need to be re-generated - * each time the bridge module is created. Support for this feature is - * deprecated and may be going away or changing, but for now you can use - * the -constantsToExport instance method to register these "pseudo-constants". + * NativeModules.ModuleName.X. This method is called when the module is + * registered by the bridge. It is only called once for the lifetime of the + * bridge, so it is not suitable for returning dynamic values, but may be + * used for long-lived values such as session keys, that are regenerated only + * as part of a reload of the entire React application. */ - (NSDictionary *)constantsToExport; diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h index 7062570a4..4d32f1c2f 100644 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h @@ -5,7 +5,7 @@ #import "RCTInvalidating.h" typedef void (^RCTJavaScriptCompleteBlock)(NSError *error); -typedef void (^RCTJavaScriptCallback)(id objcValue, NSError *error); +typedef void (^RCTJavaScriptCallback)(id json, NSError *error); /** * Abstracts away a JavaScript execution context - we may be running code in a diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLocationObserver.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLocationObserver.h new file mode 100644 index 000000000..ad3ba2ce2 --- /dev/null +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLocationObserver.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTBridgeModule.h" + +@interface RCTLocationObserver : NSObject + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLog.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLog.h index a97d13458..ba72bc8ff 100644 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLog.h +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLog.h @@ -20,28 +20,22 @@ // If defined, only log messages that match this regex will fatal #define RCTLOG_FATAL_REGEX nil -#define _RCTLog(__RCTLog__level, ...) do { \ - NSString *__RCTLog__levelStr; \ - switch(__RCTLog__level) { \ - case RCTLOG_INFO: __RCTLog__levelStr = @"info"; break; \ - case RCTLOG_WARN: __RCTLog__levelStr = @"warn"; break; \ - case RCTLOG_ERROR: __RCTLog__levelStr = @"error"; break; \ - case RCTLOG_MUSTFIX: __RCTLog__levelStr = @"mustfix"; break; \ - } \ - NSString *__RCTLog__msg = _RCTLogObjects(RCTLogFormat(__VA_ARGS__), __RCTLog__levelStr); \ - if (__RCTLog__level >= RCTLOG_FATAL_LEVEL) { \ - BOOL __RCTLog__fail = YES; \ - if (RCTLOG_FATAL_REGEX) { \ - NSError *__RCTLog__e; \ - NSRegularExpression *__RCTLog__regex = [NSRegularExpression regularExpressionWithPattern:RCTLOG_FATAL_REGEX options:0 error:&__RCTLog__e]; \ - __RCTLog__fail = [__RCTLog__regex numberOfMatchesInString:__RCTLog__msg options:0 range:NSMakeRange(0, [__RCTLog__msg length])] > 0; \ - } \ - RCTCAssert(!__RCTLog__fail, @"RCTLOG_FATAL_LEVEL %@: %@", __RCTLog__levelStr, __RCTLog__msg); \ - } \ - if (__RCTLog__level >= RCTLOG_REDBOX_LEVEL) { \ - RCTRedBox *__RCTLog__redBox = [RCTRedBox sharedInstance]; \ - [__RCTLog__redBox showErrorMessage:__RCTLog__msg]; \ - } \ +extern __unsafe_unretained NSString *RCTLogLevels[]; + +#define _RCTLog(_level, ...) do { \ + NSString *__RCTLog__levelStr = RCTLogLevels[_level - 1]; \ + NSString *__RCTLog__msg = RCTLogObjects(RCTLogFormat(__FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__), __RCTLog__levelStr); \ + if (_level >= RCTLOG_FATAL_LEVEL) { \ + BOOL __RCTLog__fail = YES; \ + if (RCTLOG_FATAL_REGEX) { \ + NSRegularExpression *__RCTLog__regex = [NSRegularExpression regularExpressionWithPattern:RCTLOG_FATAL_REGEX options:0 error:NULL]; \ + __RCTLog__fail = [__RCTLog__regex numberOfMatchesInString:__RCTLog__msg options:0 range:NSMakeRange(0, [__RCTLog__msg length])] > 0; \ + } \ + RCTCAssert(!__RCTLog__fail, @"RCTLOG_FATAL_LEVEL %@: %@", __RCTLog__levelStr, __RCTLog__msg); \ + } \ + if (_level >= RCTLOG_REDBOX_LEVEL) { \ + [[RCTRedBox sharedInstance] showErrorMessage:__RCTLog__msg]; \ + } \ } while (0) #define RCTLog(...) _RCTLog(RCTLOG_INFO, __VA_ARGS__) @@ -50,20 +44,15 @@ #define RCTLogError(...) _RCTLog(RCTLOG_ERROR, __VA_ARGS__) #define RCTLogMustFix(...) _RCTLog(RCTLOG_MUSTFIX, __VA_ARGS__) -#define RCTLogFormat(...) _RCTLogFormat(__FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__) -#define RCTLogFormatString(...) _RCTLogFormatString(__FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__) - #ifdef __cplusplus extern "C" { #endif -NSString *_RCTLogObjects(NSArray *objects, NSString *level); -NSArray *_RCTLogFormat(const char *file, int lineNumber, const char *funcName, NSString *format, ...) NS_FORMAT_FUNCTION(4,5); -NSString *_RCTLogFormatString(const char *file, int lineNumber, const char *funcName, NSString *format, ...) NS_FORMAT_FUNCTION(4,5); +NSString *RCTLogObjects(NSArray *objects, NSString *level); +NSArray *RCTLogFormat(const char *file, int lineNumber, const char *funcName, NSString *format, ...) NS_FORMAT_FUNCTION(4,5); + +void RCTInjectLogFunction(void (^logFunction)(NSString *msg)); #ifdef __cplusplus } #endif - -typedef void (^RCTLogFunction)(NSString *format, NSString *str); -void RCTInjectLogFunction(RCTLogFunction func); diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigator.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigator.h index 5d928efa7..c9051c753 100644 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigator.h +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigator.h @@ -11,7 +11,7 @@ @property (nonatomic, strong) UIView *reactNavSuperviewLink; @property (nonatomic, assign) NSInteger requestedTopOfStack; -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; /** * Schedules a JavaScript navigation and prevents `UIKit` from navigating until diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollView.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollView.h index 82667b205..204ddf494 100644 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollView.h +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollView.h @@ -12,6 +12,8 @@ @interface RCTScrollView : RCTView +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; + /** * If the `contentSize` is not provided, then the `contentSize` will * automatically be determined by the size of the `RKScrollView` subview. @@ -32,6 +34,4 @@ @property (nonatomic, assign) BOOL centerContent; @property (nonatomic, copy) NSArray *stickyHeaderIndices; -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; - @end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTShadowView.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTShadowView.h index ec2b8c353..9a09bad4f 100644 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTShadowView.h +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTShadowView.h @@ -3,29 +3,15 @@ #import #import "Layout.h" +#import "RCTUIManager.h" #import "RCTViewNodeProtocol.h" @class RCTSparseArray; -// TODO: amalgamate these enums? -typedef NS_ENUM(NSUInteger, RCTLayoutLifecycle) { - RCTLayoutLifecycleUninitialized = 0, - RCTLayoutLifecycleComputed, - RCTLayoutLifecycleDirtied, -}; - -// TODO: is this still needed? -typedef NS_ENUM(NSUInteger, RCTPropagationLifecycle) { - RCTPropagationLifecycleUninitialized = 0, - RCTPropagationLifecycleComputed, - RCTPropagationLifecycleDirtied, -}; - -// TODO: move this to text node? -typedef NS_ENUM(NSUInteger, RCTTextLifecycle) { - RCTTextLifecycleUninitialized = 0, - RCTTextLifecycleComputed, - RCTTextLifecycleDirtied, +typedef NS_ENUM(NSUInteger, RCTUpdateLifecycle) { + RCTUpdateLifecycleUninitialized = 0, + RCTUpdateLifecycleComputed, + RCTUpdateLifecycleDirtied, }; // TODO: is this redundact now? @@ -48,7 +34,7 @@ typedef void (^RCTApplierBlock)(RCTSparseArray *); @property (nonatomic, copy) NSString *moduleName; @property (nonatomic, assign) BOOL isBGColorExplicitlySet; // Used to propogate to children @property (nonatomic, strong) UIColor *backgroundColor; // Used to propogate to children -@property (nonatomic, assign) RCTLayoutLifecycle layoutLifecycle; +@property (nonatomic, assign) RCTUpdateLifecycle layoutLifecycle; /** * isNewView - Used to track the first time the view is introduced into the hierarchy. It is initialized YES, then is @@ -122,11 +108,23 @@ typedef void (^RCTApplierBlock)(RCTSparseArray *); @property (nonatomic, assign) css_wrap_type_t flexWrap; @property (nonatomic, assign) CGFloat flex; -- (void)collectUpdatedProperties:(NSMutableSet *)viewsWithNewProperties parentProperties:(NSDictionary *)parentProperties; -- (void)collectRootUpdatedFrames:(NSMutableSet *)viewsWithNewFrame parentConstraint:(CGSize)parentConstraint; -- (void)fillCSSNode:(css_node_t *)node; +/** + * Calculate property changes that need to be propagated to the view. + * The applierBlocks set contains RCTApplierBlock functions that must be applied + * on the main thread in order to update the view. + */ +- (void)collectUpdatedProperties:(NSMutableSet *)applierBlocks parentProperties:(NSDictionary *)parentProperties; -// The following are implementation details exposed to subclasses. Do not call them directly +/** + * Calculate all views whose frame needs updating after layout has been calculated. + * The viewsWithNewFrame set contains the reactTags of the views that need updating. + */ +- (void)collectRootUpdatedFrames:(NSMutableSet *)viewsWithNewFrame parentConstraint:(CGSize)parentConstraint; + +/** + * The following are implementation details exposed to subclasses. Do not call them directly + */ +- (void)fillCSSNode:(css_node_t *)node; - (void)dirtyLayout; - (BOOL)isLayoutDirty; diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextField.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextField.h index 2a0225f27..1688f8fdc 100644 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextField.h +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextField.h @@ -10,6 +10,6 @@ @property (nonatomic, assign) BOOL autoCorrect; @property (nonatomic, assign) UIEdgeInsets paddingEdgeInsets; // TODO: contentInset -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; @end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTouchHandler.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTouchHandler.h index 53379a78a..46c81b9ef 100644 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTouchHandler.h +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTouchHandler.h @@ -8,7 +8,7 @@ @interface RCTTouchHandler : UIGestureRecognizer -- (instancetype)initWithBridge:(RCTBridge *)bridge; +- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; - (void)startOrResetInteractionTiming; - (NSDictionary *)endAndResetInteractionTiming; diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIManager.h index 87e91118a..701c37f93 100644 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIManager.h +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIManager.h @@ -2,13 +2,18 @@ #import +#import "RCTBridge.h" #import "RCTBridgeModule.h" #import "RCTInvalidating.h" +#import "RCTViewManager.h" @class RCTRootView; @protocol RCTScrollableProtocol; +/** + * The RCTUIManager is the module responsible for updating the view hierarchy. + */ @interface RCTUIManager : NSObject @property (nonatomic, weak) id mainScrollView; @@ -19,8 +24,33 @@ */ @property (nonatomic, readwrite, weak) id nativeMainScrollDelegate; +/** + * Register a root view with the RCTUIManager. Theoretically, a single manager + * can support multiple root views, however this feature is not currently exposed + * and may eventually be removed. + */ - (void)registerRootView:(RCTRootView *)rootView; +/** + * Schedule a block to be executed on the UI thread. Useful if you need to execute + * view logic after all currently queued view updates have completed. + */ +- (void)addUIBlock:(RCTViewManagerUIBlock)block; + +/** + * The view that is currently first responder, according to the JS context. + */ + (UIView *)JSResponder; @end + +/** + * This category makes the current RCTUIManager instance available via the + * RCTBridge, which is useful for RCTBridgeModules or RCTViewManagers that + * need to access the RCTUIManager. + */ +@interface RCTBridge (RCTUIManager) + +@property (nonatomic, readonly) RCTUIManager *uiManager; + +@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUtils.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUtils.h index 3612b1f27..de203e4ae 100644 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUtils.h +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUtils.h @@ -1,17 +1,15 @@ // Copyright 2004-present Facebook. All Rights Reserved. +#import + #import #import -#import #import "RCTAssert.h" -// Macro to indicate when inherited initializer is not to be used -#define RCT_NOT_DESIGNATED_INITIALIZER() \ -do { \ - RCTAssert(NO, @"%@ is not the designated initializer for instances of %@.", NSStringFromSelector(_cmd), [self class]); \ - return nil; \ -} while (0) +#ifdef __cplusplus +extern "C" { +#endif // Utility functions for JSON object <-> string serialization/deserialization NSString *RCTJSONStringify(id jsonObject, NSError **error); @@ -39,3 +37,10 @@ void RCTSwapInstanceMethods(Class cls, SEL original, SEL replacement); // Module subclass support BOOL RCTClassOverridesClassMethod(Class cls, SEL selector); BOOL RCTClassOverridesInstanceMethod(Class cls, SEL selector); + +// Enumerate all classes that conform to NSObject protocol +void RCTEnumerateClasses(void (^block)(Class cls)); + +#ifdef __cplusplus +} +#endif diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTView.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTView.h index 77dee1df8..802336633 100644 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTView.h +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTView.h @@ -11,7 +11,6 @@ @interface RCTView : UIView @property (nonatomic, assign) RCTPointerEvents pointerEvents; -@property (nonatomic, copy) NSString *overrideAccessibilityLabel; + (void)autoAdjustInsetsForView:(UIView *)parentView withScrollView:(UIScrollView *)scrollView diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewManager.h index e77be09c1..d3b7c8a01 100644 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewManager.h +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewManager.h @@ -2,9 +2,11 @@ #import +#import "RCTBridgeModule.h" #import "RCTConvert.h" #import "RCTLog.h" +@class RCTBridge; @class RCTEventDispatcher; @class RCTShadowView; @class RCTSparseArray; @@ -12,19 +14,22 @@ typedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, RCTSparseArray *viewRegistry); -@interface RCTViewManager : NSObject +@interface RCTViewManager : NSObject /** - * Designated initializer for view modules. Override this when subclassing. + * The bridge can be used to access both the RCTUIIManager and the RCTEventDispatcher, + * allowing the manager (or the views that it manages) to manipulate the view + * hierarchy and send events back to the JS context. */ -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; +@property (nonatomic, strong) RCTBridge *bridge; /** * The event dispatcher is used to send events back to the JavaScript application. * It can either be used directly by the module, or passed on to instantiated * view subclasses so that they can handle their own events. */ -@property (nonatomic, readonly, weak) RCTEventDispatcher *eventDispatcher; +// TODO: remove this, as it can be accessed directly from bridge +@property (nonatomic, readonly) RCTEventDispatcher *eventDispatcher; /** * The module name exposed to React JS. If omitted, this will be inferred @@ -88,34 +93,19 @@ typedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, RCTSparseArray *v + (NSDictionary *)customDirectEventTypes; /** - * Injects constants into JS. These constants are made accessible via - * NativeModules.moduleName.X. Note that this method is not inherited when you - * subclass a view module, and you should not call [super constantsToExport] - * when overriding it. + * Called to notify manager that layout has finished, in case any calculated + * properties need to be copied over from shadow view to view. */ -+ (NSDictionary *)constantsToExport; +- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowView *)shadowView; /** - * To deprecate, hopefully + * Called after view hierarchy manipulation has finished, and all shadow props + * have been set, but before layout has been performed. Useful for performing + * custo layout logic or tasks that involve walking the view hierarchy. + * To be deprecated, hopefully. */ - (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(RCTSparseArray *)shadowViewRegistry; -/** - * Informal protocol for setting view and shadowView properties. - * Implement methods matching these patterns to set any properties that - * require special treatment (e.g. where the type or name cannot be inferred). - * - * - (void)set_:(id)property - * forView:(UIView *)view - * withDefaultView:(UIView *)defaultView; - * - * - (void)set_:(id)property - * forShadowView:(RCTShadowView *)view - * withDefaultView:(RCTShadowView *)defaultView; - * - * For simple cases, use the macros below: - */ - /** * This handles the simple case, where JS and native property names match * And the type can be automatically inferred. @@ -131,10 +121,21 @@ RCT_REMAP_VIEW_PROPERTY(name, name) - (void)set_##name:(id)json forView:(id)view withDefaultView:(id)defaultView { \ if ((json && !RCTSetProperty(view, @#keypath, json)) || \ (!json && !RCTCopyProperty(view, defaultView, @#keypath))) { \ - RCTLogMustFix(@"%@ does not have setter for `%s` property", [view class], #name); \ + RCTLogError(@"%@ does not have setter for `%s` property", [view class], #name); \ } \ } +/** + * These macros can be used when you need to provide custom logic for setting + * view properties. The macro should be followed by a method body, which can + * refer to "json", "view" and "defaultView" to implement the required logic. + */ +#define RCT_CUSTOM_VIEW_PROPERTY(name, viewType) \ +- (void)set_##name:(id)json forView:(viewType)view withDefaultView:(viewType)defaultView + +#define RCT_CUSTOM_SHADOW_PROPERTY(name, viewType) \ +- (void)set_##name:(id)json forShadowView:(viewType)view withDefaultView:(viewType)defaultView + /** * These are useful in cases where the module's superclass handles a * property, but you wish to "unhandle" it, so it will be ignored. diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h index 1fa3e252b..b6f59ea10 100644 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h @@ -8,7 +8,7 @@ */ @protocol RCTViewNodeProtocol -@property (nonatomic, strong) NSNumber *reactTag; +@property (nonatomic, copy) NSNumber *reactTag; - (void)insertReactSubview:(id)subview atIndex:(NSInteger)atIndex; - (void)removeReactSubview:(id)subview; @@ -21,6 +21,8 @@ @optional // TODO: Deprecate this +// This method is called after layout has been performed for all views known +// to the RCTViewManager. It is only called on UIViews, not shadow views. - (void)reactBridgeDidFinishTransaction; @end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h index d8f22270a..69075c6a4 100644 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h +++ b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h @@ -15,8 +15,11 @@ didMoveToNavigationController:(UINavigationController *)navigationController; @interface RCTWrapperViewController : UIViewController -- (instancetype)initWithContentView:(UIView *)contentView eventDispatcher:(RCTEventDispatcher *)eventDispatcher; -- (instancetype)initWithNavItem:(RCTNavItem *)navItem eventDispatcher:(RCTEventDispatcher *)eventDispatcher; +- (instancetype)initWithContentView:(UIView *)contentView + eventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithNavItem:(RCTNavItem *)navItem + eventDispatcher:(RCTEventDispatcher *)eventDispatcher; @property (nonatomic, readwrite, weak) id navigationListener; @property (nonatomic, strong, readwrite) RCTNavItem *navItem; diff --git a/Examples/TicTacToe/Pods/Pods.xcodeproj/project.pbxproj b/Examples/TicTacToe/Pods/Pods.xcodeproj/project.pbxproj index 970a5d205..9bc0e18a5 100644 --- a/Examples/TicTacToe/Pods/Pods.xcodeproj/project.pbxproj +++ b/Examples/TicTacToe/Pods/Pods.xcodeproj/project.pbxproj @@ -10,7 +10,240 @@ 46 objects - 005E47CD37DA97006CE65B99 + 025A87130AD86B58E404D3C0 + + isa + PBXTargetDependency + name + Pods-RCTNetworkImage + target + 769A717CAFE5B019B17120C7 + targetProxy + B1AB002CD8EBE409EC364BF4 + + 02CA42753891DE99F0C4A9F1 + + fileRef + 80A2CDBEC4C2EA679BDFD05B + isa + PBXBuildFile + + 034357B4792A8675BA3B962F + + fileRef + 31E92BD37BFCCB143ED614CB + isa + PBXBuildFile + + 05979756D746338C19D9CFE3 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTViewManager.m + path + Views/RCTViewManager.m + sourceTree + <group> + + 062BC4B46046CE4058393650 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-ReactKit-Private.xcconfig + sourceTree + <group> + + 069D2AD44B6410EACB1B2075 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTTextField.m + path + Views/RCTTextField.m + sourceTree + <group> + + 06B66FE3B127D202B1AC9803 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text + path + Pods-acknowledgements.markdown + sourceTree + <group> + + 07576F9F34B4CADE96EDD698 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTContextExecutor.m + path + Executors/RCTContextExecutor.m + sourceTree + <group> + + 07C36347F29DC7BB656AED2E + + fileRef + A3B9259CF020C7A65A92AA0E + isa + PBXBuildFile + + 07F1BC4802790A12CD37323F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTAlertManager.m + path + Modules/RCTAlertManager.m + sourceTree + <group> + + 08A0B2B369BFF8324CBBA029 + + baseConfigurationReference + B753A0617AB77E1E91027A34 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 09135B9EC1FBC85584FC4DBD + + buildActionMask + 2147483647 + files + + 0BCB19DE972D8A076F5C2DAE + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 0970729E477937347C8EBD83 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTAssert.h + path + Base/RCTAssert.h + sourceTree + <group> + + 0B8869CDD72D9A8E218342F0 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTAnimationType.h + path + Base/RCTAnimationType.h + sourceTree + <group> + + 0BCB19DE972D8A076F5C2DAE + + fileRef + B46B327243391CAF6E0717D9 + isa + PBXBuildFile + + 0CB274EC48DFB07B4C8B240E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTCache.h + path + Base/RCTCache.h + sourceTree + <group> + + 1036E6C4C58112D9A8A1D615 includeInIndex 1 @@ -19,11 +252,461 @@ lastKnownFileType sourcecode.c.h path - RCTText.h + RCTNetworkImageViewManager.h sourceTree <group> - 00CA6F6E234DA9FAFC268F4C + 107D57F0208D55DBB0B65853 + + fileRef + 76DB22C9C8B38077354D35A8 + isa + PBXBuildFile + + 110F901C8F65A6EC1D683ED3 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTExceptionsManager.m + path + Modules/RCTExceptionsManager.m + sourceTree + <group> + + 11806B3CDA8E83E6F2FE8D17 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTNavigator.h + path + Views/RCTNavigator.h + sourceTree + <group> + + 1196334A907C76F86D4A63CB + + fileRef + BADCCC41C7913287A31E51C9 + isa + PBXBuildFile + + 12507443D597BE1AFA5013A7 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTText.xcconfig + sourceTree + <group> + + 150C5DBA403D3B23A1EC6CDE + + fileRef + CB9F944208FFD7B3ADC7A00A + isa + PBXBuildFile + + 152C3E496F9D147818CDB260 + + buildActionMask + 2147483647 + files + + 87E418B79822E8736EA41DE8 + 1A1C6BEEBA59CFC9D14FFB67 + A2AF525DC972EB0FDD47D962 + 535AB2CD3AD8C9EAC218E37B + D257C76E43E366FC0EA7A12E + FA29A9F03B11C2074DC5216D + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 1537FF13D7133AA6F8B3A1C9 + + fileRef + CCF7DF071515793DD6C0414D + isa + PBXBuildFile + + 15ADEBC28446EDAC35819C65 + + buildConfigurations + + 43C225961E6BF40B9C819C93 + 08A0B2B369BFF8324CBBA029 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 16955EC616390F52DD46F011 + + children + + 599BC72A5589AE2013BF6900 + + isa + PBXGroup + name + Targets Support Files + sourceTree + <group> + + 19636039A13AE878699E8DBB + + fileRef + E22151F70AA7C88D098C99BB + isa + PBXBuildFile + + 19B74DAEFA40E906DEDEADFA + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-ReactKit-dummy.m + sourceTree + <group> + + 1A1C6BEEBA59CFC9D14FFB67 + + fileRef + A8DBC5BF7CEEEDA937D3BE08 + isa + PBXBuildFile + + 1B18F1E7CA77F1AA1A12D304 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTShadowView.h + path + Views/RCTShadowView.h + sourceTree + <group> + + 1D5C721F04A0D2846039D9B7 + + fileRef + 1B18F1E7CA77F1AA1A12D304 + isa + PBXBuildFile + + 1EA38AB62019C3EC36D2FC6A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTBridgeModule.h + path + Base/RCTBridgeModule.h + sourceTree + <group> + + 218485DF6D2557DEC0F8E74E + + fileRef + FBC74FE67BCC52FD85C1BAD0 + isa + PBXBuildFile + + 2222F067CA369E707A16AEF7 + + buildActionMask + 2147483647 + files + + 33FF0688ED2927D06FFA4C26 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 22C673EC6E5974F93BB91F64 + + baseConfigurationReference + 39463588A39AA3E9757F0520 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + 24081C451F4316B44C32B7CC + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTShadowView.m + path + Views/RCTShadowView.m + sourceTree + <group> + + 25015EE62C53673BAF076DD7 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods.a + sourceTree + BUILT_PRODUCTS_DIR + + 254E0C8ACCD2FF00E6FD2AE6 + + children + + AACE41F371930BDA2BE0D50F + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + 25B6E9DFFAE6A9540CEF75DE + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTTiming.h + path + Modules/RCTTiming.h + sourceTree + <group> + + 261567BAE307BF57D88AC939 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTStatusBarManager.h + path + Modules/RCTStatusBarManager.h + sourceTree + <group> + + 27365C92F7FA6EF9E524A670 + + fileRef + D436BE9918549C192684657C + isa + PBXBuildFile + + 2747CB53DCACFABE26C705AA + + fileRef + 110F901C8F65A6EC1D683ED3 + isa + PBXBuildFile + + 277413A21FD87DA13511099F + + fileRef + 25B6E9DFFAE6A9540CEF75DE + isa + PBXBuildFile + + 2A073BDE36873311DA6A0EF5 + + includeInIndex + 1 + isa + PBXFileReference + name + Layout.c + path + Layout/Layout.c + sourceTree + <group> + + 2A8C42E95666925E6CEE303F + + children + + 48BBE16348C79B57F35F8DBF + 062BC4B46046CE4058393650 + 19B74DAEFA40E906DEDEADFA + F66B15C716DB00AB74903326 + + isa + PBXGroup + name + Support Files + path + ../Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit + sourceTree + <group> + + 2B409A074C5817E5B40428E2 + + fileRef + 4451C03906E44804B163B854 + isa + PBXBuildFile + + 2B475CAFC274FB31E95E5491 + + fileRef + E5B280DE6A446D58C857B3C7 + isa + PBXBuildFile + + 2C552B02AE33C61830745E85 + + buildConfigurations + + D47F88D3F797D8EF95C0BA4D + ED0EAAAC662DFADD30EA5D11 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 2C7ED084B30FD91FBC08C10D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTShadowRawText.m + sourceTree + <group> + + 2E2A8AF7AB8F16F26CE07D8C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTScrollView.m + path + Views/RCTScrollView.m + sourceTree + <group> + + 2F5489066B626F5AA9656150 + + fileRef + 61063E1955F44DB956E55837 + isa + PBXBuildFile + + 2FE386FFB0F3E3A3528409B9 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTTouchHandler.h + path + Base/RCTTouchHandler.h + sourceTree + <group> + + 2FF3BF263DDDD5F909C02622 buildSettings @@ -85,7 +768,7 @@ name Release - 02011DF072CE86BD3AD237F3 + 31815389CBA63C86E173EE9C includeInIndex 1 @@ -94,675 +777,13 @@ lastKnownFileType sourcecode.c.h name - RCTUIManager.h + RCTAutoInsetsProtocol.h path - Modules/RCTUIManager.h + Base/RCTAutoInsetsProtocol.h sourceTree <group> - 03219EE301E4BE34C4E26BF5 - - buildActionMask - 2147483647 - files - - ED09FCD5EBB9DAA998867B1F - 51DA8A2705C963385CCF407E - 244F3E3D12A6582888A3FDAC - 55461293CD520E1A61389C81 - BFEF41FE0A9C6E4BF083A1C4 - - isa - PBXHeadersBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 0446F952AD32FA99CE53021F - - buildActionMask - 2147483647 - files - - 43AA89FA9AC4BA1666D9422F - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 046F50050C1051EB89B1CC2D - - fileRef - 569C3E0B54CE022FD9433B66 - isa - PBXBuildFile - - 0524E24381502D7EB46CCF29 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTBridge.h - path - Base/RCTBridge.h - sourceTree - <group> - - 054AB43B546728B2ACD9DE38 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-dummy.m - sourceTree - <group> - - 0678F15E5799E801FBBB82EE - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTWebViewExecutor.m - path - Executors/RCTWebViewExecutor.m - sourceTree - <group> - - 068A30BD4A2404B5DAEBE221 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTShadowView.h - path - Views/RCTShadowView.h - sourceTree - <group> - - 0966A648227568DA76319358 - - fileRef - 2461A7AF21FB638CED912FE3 - isa - PBXBuildFile - - 097BE8E1E29CD333D067E047 - - buildConfigurations - - DFEDA529E62F398E0E66A864 - CCCA2CC55157BFF72767CEAB - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 0C288D473E48E342E2E09095 - - fileRef - 22669B7FF7DBBF51202945CD - isa - PBXBuildFile - - 0D3A42D393008EEAD192C928 - - fileRef - 12FAC13993C100C3FDBD0DD8 - isa - PBXBuildFile - - 0D4B28DA9FC2C4CB2B2874B3 - - fileRef - 5F3DD45AD214483F15E95111 - isa - PBXBuildFile - - 0D723FDEF5CC9DBD086EAB39 - - fileRef - 7E1B11B9B4C3FFCEFFD1F35D - isa - PBXBuildFile - - 0EC776D336E22CBCEE4678E8 - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods.a - sourceTree - BUILT_PRODUCTS_DIR - - 0F992DA69BD971F9C2BF439E - - fileRef - 78082D94239F5CEB5959B0B2 - isa - PBXBuildFile - - 12FAC13993C100C3FDBD0DD8 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTNavigatorManager.m - path - Views/RCTNavigatorManager.m - sourceTree - <group> - - 132DE36D6DB2D0F70C09CE89 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTAlertManager.m - path - Modules/RCTAlertManager.m - sourceTree - <group> - - 14F2CD18D70F8E4D68AC5B7A - - buildActionMask - 2147483647 - files - - BB0B04F7F63902EED012528E - 8ECFD3E48BD636104455BB71 - 38E3244F957866F7F0C32D86 - 62A59B690CB532CADE33707A - 28C1D5D42E3F1D2B39F0705C - 640DB00247945B46A90D77BB - EA79968832417354B40F6352 - 6817FF9F9174ADBAD78127A3 - 1AED708527053A371CD9B773 - D879CE28A1189AB3CA754538 - A9BAD3EC8ABCA9694CAF96F7 - 2DAADC70BCF143DF7CA581E1 - 9E520B28129AD787FE9C67D8 - 1CEA503C817DE70221AD83F8 - 4F949B8D09B678579C19C66A - FAE203974E438996878047C2 - 5D95EA92C79D8C7588A091E2 - F9ECFBDEC272AF69A54935F9 - B9DEE348987356C83C27DD9E - 4639D2C096C861AE4FEDB1BE - E1C485676C801FFCB46D93D0 - F68991A42B4CF608AF91EBB5 - 83C5FDC3F8BE71F2109194A8 - C07D1DDFE8D93ECEDF0E97C1 - ABFBF65F5D61F7EA440E25A8 - 404B71EC96CEA99711DAE44C - 69E62A75FE90251221950A25 - 7DE6E8E2D2109F67434864E2 - 47ECAF504BAF1A40ECB4755C - 0966A648227568DA76319358 - 4DA996F14A25031E40FF5B20 - 6966836B9D0C1BA7F411C883 - 716937CEA06BA6300F2CFD38 - 7A9E043C29916787D48A9DC3 - 97C2676E499C58904665B945 - 77BFD1192ACD1153CD3B92C2 - 759D943C6812DD195ABE9354 - 4E9FB0C0547065C3A59FF16D - F069246D046DFFE7CF05DE92 - C618E1B2CFF909C6273ABD4D - 529B63BA987480726B6C3FC3 - C77D22DADA6D43EC7CC8478A - 2566A98F79CE35E42FC8FBB8 - 046F50050C1051EB89B1CC2D - D4D507D020AD79183E1DD916 - - isa - PBXHeadersBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 15478769A7025E67403CF8F6 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTText.m - sourceTree - <group> - - 1568A6E0A0EFBABC6271F94D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTUtils.m - path - Base/RCTUtils.m - sourceTree - <group> - - 156E154B035C85C750DA3DE2 - - buildConfigurationList - E484553771DAF5F08178C966 - buildPhases - - C043A8B738F0E880E4E71CF4 - DDEDAE8AD808715BBCF5DC6C - - buildRules - - dependencies - - EDBE5D54C93BC128C25036AD - 3ACDD0E0A9EED6CBCC130B09 - 85336AD28D003EA10FC44AD9 - - isa - PBXNativeTarget - name - Pods - productName - Pods - productReference - 0EC776D336E22CBCEE4678E8 - productType - com.apple.product-type.library.static - - 15D063218D733290ACAF6ECD - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTScrollableProtocol.h - path - Base/RCTScrollableProtocol.h - sourceTree - <group> - - 16B69D05ABC152C41B9129FB - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTLog.h - path - Base/RCTLog.h - sourceTree - <group> - - 16E1299D87C2B7BE1D68024F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTRawTextManager.m - sourceTree - <group> - - 175C559D2A89B7FC27EFD6C5 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTViewNodeProtocol.h - path - Base/RCTViewNodeProtocol.h - sourceTree - <group> - - 198FD8078EB2E34708CAF463 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTNetworkImageViewManager.m - sourceTree - <group> - - 1AED708527053A371CD9B773 - - fileRef - 289322DAF960C6BD7F2FD8E1 - isa - PBXBuildFile - - 1B437510B4F6BE59E0B8B24F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text - path - Pods-acknowledgements.markdown - sourceTree - <group> - - 1CEA503C817DE70221AD83F8 - - fileRef - E5FC33A15846273C981E0322 - isa - PBXBuildFile - - 1E0B27EFE9498593A53775FC - - fileRef - FCAC9AFE3E61C78E93EA7E8C - isa - PBXBuildFile - - 1E8BDC022A45A44FA90E9BF5 - - fileRef - 3CC9DC0433D77149CC4DE5DE - isa - PBXBuildFile - - 20F2231C1AEED2919F583DC7 - - buildConfigurationList - 919FCDB927A3933126B3DCFE - buildPhases - - 7D6A37C994847E772C6CF039 - 0446F952AD32FA99CE53021F - 14F2CD18D70F8E4D68AC5B7A - - buildRules - - dependencies - - isa - PBXNativeTarget - name - Pods-ReactKit - productName - Pods-ReactKit - productReference - C575BB07E7B92FA3EBC10949 - productType - com.apple.product-type.library.static - - 22669B7FF7DBBF51202945CD - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTContextExecutor.m - path - Executors/RCTContextExecutor.m - sourceTree - <group> - - 22CB86FDC9D99844724FDDD3 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTTextFieldManager.m - path - Views/RCTTextFieldManager.m - sourceTree - <group> - - 244F3E3D12A6582888A3FDAC - - fileRef - FF03E617D571F159152581FC - isa - PBXBuildFile - - 245789C2D4A68C88E27641D9 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTScrollView.h - path - Views/RCTScrollView.h - sourceTree - <group> - - 2461A7AF21FB638CED912FE3 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTStaticImage.h - path - Views/RCTStaticImage.h - sourceTree - <group> - - 2566A98F79CE35E42FC8FBB8 - - fileRef - 9FF2D7B800439FD8B4118089 - isa - PBXBuildFile - - 2603E0CD923E37E10EED21A8 - - fileRef - 97138ACEE67BD2BDF8A3DEA0 - isa - PBXBuildFile - - 26C00EEFB778EFB7A6703E20 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTAnimationType.h - path - Base/RCTAnimationType.h - sourceTree - <group> - - 27F37EEF056BA05A9FE6548A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTExceptionsManager.h - path - Modules/RCTExceptionsManager.h - sourceTree - <group> - - 289322DAF960C6BD7F2FD8E1 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTContextExecutor.h - path - Executors/RCTContextExecutor.h - sourceTree - <group> - - 28C1D5D42E3F1D2B39F0705C - - fileRef - CEAD6D174912D6D124A031D9 - isa - PBXBuildFile - - 2A5A7AE725AB3B07B61A40E9 - - baseConfigurationReference - A9E3206FA20E2CAD15028412 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - 2DA5F87EA2CDCEA0ED668578 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTExceptionsManager.m - path - Modules/RCTExceptionsManager.m - sourceTree - <group> - - 2DAADC70BCF143DF7CA581E1 - - fileRef - 27F37EEF056BA05A9FE6548A - isa - PBXBuildFile - - 2E00E46C249C163EBC0418DC - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTUIActivityIndicatorViewManager.h - path - Views/RCTUIActivityIndicatorViewManager.h - sourceTree - <group> - - 2F6BBA653E86409B28911661 + 31CB0CA9F918FFFFCCDB8284 includeInIndex 1 @@ -777,64 +798,7 @@ sourceTree <group> - 320294F910FF631F87E183B5 - - baseConfigurationReference - 504F7E363A7AFC9A64B86154 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - 32FFFCBE06BA47E77A58F52F - - fileRef - 22CB86FDC9D99844724FDDD3 - isa - PBXBuildFile - - 33E69C46AB97309D4EBFA432 + 31E92BD37BFCCB143ED614CB includeInIndex 1 @@ -843,79 +807,48 @@ lastKnownFileType sourcecode.c.objc name - RCTViewManager.m + RCTKeyCommands.m path - Views/RCTViewManager.m + Base/RCTKeyCommands.m sourceTree <group> - 358919F57C8842F2A160F855 + 32451A95EB5079ED6F4F3E5A fileRef - 6AC9ACC04495648FA5060FCD + 46EA953E96B6E60A9EA7253A isa PBXBuildFile - 38E3244F957866F7F0C32D86 + 329AC794493AD159BF606910 fileRef - 26C00EEFB778EFB7A6703E20 + 05979756D746338C19D9CFE3 isa PBXBuildFile - 391E46E8F975CA6362AB5DE5 + 33AC21BAE4072FDD0FC446AC - includeInIndex - 1 + fileRef + 865F2D07C98B4CA4B18F1F78 isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTText.xcconfig - sourceTree - <group> + PBXBuildFile - 39206929A27DEBF5CBACB942 + 33FF0688ED2927D06FFA4C26 - explicitFileType - archive.ar - includeInIndex - 0 + fileRef + B46B327243391CAF6E0717D9 isa - PBXFileReference - path - libPods-RCTText.a - sourceTree - BUILT_PRODUCTS_DIR + PBXBuildFile - 3938293AC4D9C3C8B8DDFDC7 + 341F23664902CBD8947C5DB3 - includeInIndex - 1 + fileRef + B46B327243391CAF6E0717D9 isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTViewManager.h - path - Views/RCTViewManager.h - sourceTree - <group> + PBXBuildFile - 3ACDD0E0A9EED6CBCC130B09 - - isa - PBXTargetDependency - name - Pods-RCTText - target - F5D2C09AFAA6986D234BF953 - targetProxy - E1C5A97B9865CABC567B000A - - 3CC9DC0433D77149CC4DE5DE + 3569D3C1AD09FC147229AF8D includeInIndex 1 @@ -924,28 +857,13 @@ lastKnownFileType sourcecode.c.objc name - RCTCache.m + RCTWebViewExecutor.m path - Base/RCTCache.m + Executors/RCTWebViewExecutor.m sourceTree <group> - 3D3089A4A62A68E4D5BB4562 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTBridge.m - path - Base/RCTBridge.m - sourceTree - <group> - - 3F06663863E59C187B84EAD2 + 35757FFD140D20F790EE2BDD includeInIndex 1 @@ -954,70 +872,54 @@ lastKnownFileType sourcecode.c.h name - RCTStaticImageManager.h + RCTUIManager.h path - Views/RCTStaticImageManager.h + Modules/RCTUIManager.h sourceTree <group> - 3FDDE45F64AE789BEAED2125 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTNavItem.h - path - Views/RCTNavItem.h - sourceTree - <group> - - 404B71EC96CEA99711DAE44C + 36A55CAD129917A8F65E897D fileRef - E991F096165FA74435C7282D + 3569D3C1AD09FC147229AF8D isa PBXBuildFile - 411AACA7B5F606DA03793980 + 3859014F88232018A42BAC04 - fileRef - F6CC16FA65BD5A265088B6B6 - isa - PBXBuildFile - - 427D3517A7FBC3A92AF9E9D4 - - children + buildConfigurationList + 15ADEBC28446EDAC35819C65 + buildPhases - 5D7BCEA99DDC0B36A4C4EB31 + 152C3E496F9D147818CDB260 + EC32BFBA00A39F59EB11C597 + BF6A636E87E3CA2080B277BD + + buildRules + + dependencies + + 971060A5AAD6681C19B92AFC isa - PBXGroup + PBXNativeTarget name - Targets Support Files - sourceTree - <group> + Pods-RCTText + productName + Pods-RCTText + productReference + A8383CD9E89EBD0486A2CFF1 + productType + com.apple.product-type.library.static - 42FCE12743FD1B4702208E0D + 38FFA89C70E4D1645D42E7ED - includeInIndex - 1 + fileRef + 2FE386FFB0F3E3A3528409B9 isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTUtils.h - path - Base/RCTUtils.h - sourceTree - <group> + PBXBuildFile - 430F4C781E2E7EE9F8CB83FD + 39463588A39AA3E9757F0520 includeInIndex 1 @@ -1026,117 +928,18 @@ lastKnownFileType text.xcconfig path - Pods-ReactKit-Private.xcconfig + Pods-RCTNetworkImage-Private.xcconfig sourceTree <group> - 43AA89FA9AC4BA1666D9422F + 39D02CE2F933786AEA335F33 fileRef - 5D5E4CDC94FE8212303F96ED + 1036E6C4C58112D9A8A1D615 isa PBXBuildFile - 44161614652ABCC200708F4A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTShadowRawText.h - sourceTree - <group> - - 45775545A25B55D8FF631FF5 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTShadowView.m - path - Views/RCTShadowView.m - sourceTree - <group> - - 4608EE51074A11B61B7BAB45 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTNetworkImage.xcconfig - sourceTree - <group> - - 4637476226C7CEC79C7DE49E - - fileRef - 1568A6E0A0EFBABC6271F94D - isa - PBXBuildFile - - 4639D2C096C861AE4FEDB1BE - - fileRef - B40A54F9CD6C17782376DE87 - isa - PBXBuildFile - - 4648080B27A50C8D028851B3 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTAssert.m - path - Base/RCTAssert.m - sourceTree - <group> - - 47B228B88421B943C6005B10 - - fileRef - F731109AFE06344ABBC4BBE6 - isa - PBXBuildFile - - 47ECAF504BAF1A40ECB4755C - - fileRef - 6C59A8B8703F0BD79C458591 - isa - PBXBuildFile - - 48039B7A25006CE8F45E9619 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - UIView+ReactKit.h - path - Views/UIView+ReactKit.h - sourceTree - <group> - - 491280116436017C4FEC9FD8 + 3A6DEBCF91BF88EE6FF0C53E includeInIndex 1 @@ -1151,77 +954,14 @@ sourceTree <group> - 49199899EB7E17720A69A6A0 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTNavItemManager.h - path - Views/RCTNavItemManager.h - sourceTree - <group> - - 4DA996F14A25031E40FF5B20 + 3BDB2D0EDA22488B2E6C76B7 fileRef - 3F06663863E59C187B84EAD2 + 8D14C3BB217E003103E52CA1 isa PBXBuildFile - 4E9FB0C0547065C3A59FF16D - - fileRef - 02011DF072CE86BD3AD237F3 - isa - PBXBuildFile - - 4F949B8D09B678579C19C66A - - fileRef - DD1AEBDB914EF5C49CAAEB46 - isa - PBXBuildFile - - 504F7E363A7AFC9A64B86154 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTText-Private.xcconfig - sourceTree - <group> - - 51DA8A2705C963385CCF407E - - fileRef - 44161614652ABCC200708F4A - isa - PBXBuildFile - - 523EDE48CB10BED172EA70AA - - fileRef - DF17E391C45D5B66999F6D99 - isa - PBXBuildFile - - 529B63BA987480726B6C3FC3 - - fileRef - 3938293AC4D9C3C8B8DDFDC7 - isa - PBXBuildFile - - 530A6D73CAFF37DCB5A52103 + 3BF49B8ADD348B664CAA965D includeInIndex 1 @@ -1230,525 +970,35 @@ lastKnownFileType sourcecode.c.objc name - RCTScrollViewManager.m + RCTCache.m path - Views/RCTScrollViewManager.m + Base/RCTCache.m sourceTree <group> - 54481109ECD4CD40F5F746F8 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTPointerEvents.h - path - Base/RCTPointerEvents.h - sourceTree - <group> - - 55461293CD520E1A61389C81 + 3BFAD0347A551F0536E421F4 fileRef - 005E47CD37DA97006CE65B99 + F9EB9D707F5B2AD7C1E442EF isa PBXBuildFile - 5675366766067D60156EEAA1 - - fileRef - A53374892CD6B26138B38ADB - isa - PBXBuildFile - - 569C3E0B54CE022FD9433B66 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTWrapperViewController.h - path - Views/RCTWrapperViewController.h - sourceTree - <group> - - 58A59E47157F3E11F33C044F - - buildActionMask - 2147483647 - files - - 7795BA5CF034328C6FAB5599 - 5C917B8E0FE26AB41B2FD624 - 0F992DA69BD971F9C2BF439E - - isa - PBXHeadersBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 5A541D6A294BA6E01BD0CD3A - - baseConfigurationReference - 430F4C781E2E7EE9F8CB83FD - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - 5A8146BE2B9A4E8B080899C7 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTStatusBarManager.h - path - Modules/RCTStatusBarManager.h - sourceTree - <group> - - 5C917B8E0FE26AB41B2FD624 - - fileRef - 79ED42B49D21E04D9AA9DC7F - isa - PBXBuildFile - - 5D44D4115556BA5F81C67E07 - - fileRef - EA77880FBBE6AA7511841605 - isa - PBXBuildFile - - 5D5E4CDC94FE8212303F96ED - - isa - PBXFileReference - lastKnownFileType - wrapper.framework - name - Foundation.framework - path - Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/Foundation.framework - sourceTree - DEVELOPER_DIR - - 5D7BCEA99DDC0B36A4C4EB31 + 3CC6BB454B8522DB5089F791 children - 1B437510B4F6BE59E0B8B24F - 8F72A8B191D5505279E9254D - 054AB43B546728B2ACD9DE38 - 6B2DF6A0713908E45F8EBE75 - 7DA2E9C4F2BA3289E2668E17 - 6C4193D7074A9FE2AADD31C2 - A9E3206FA20E2CAD15028412 + 5CF875C3818A1F0206603D10 + 7327196C4F5BA97CA4539891 + B00A2CCF46A8FBC54A316DCC isa PBXGroup name - Pods - path - Target Support Files/Pods + Development Pods sourceTree <group> - 5D95EA92C79D8C7588A091E2 - - fileRef - 16B69D05ABC152C41B9129FB - isa - PBXBuildFile - - 5F3DD45AD214483F15E95111 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTShadowRawText.m - sourceTree - <group> - - 5F70F61D02759E49CFA5E3EB - - fileRef - 2DA5F87EA2CDCEA0ED668578 - isa - PBXBuildFile - - 60662361B9CC9A2A8D49F638 - - isa - PBXTargetDependency - name - Pods-ReactKit - target - 20F2231C1AEED2919F583DC7 - targetProxy - 7EDCA4090C484196C36B1977 - - 62A59B690CB532CADE33707A - - fileRef - 6FCFD749EEB3861EB75C0534 - isa - PBXBuildFile - - 640DB00247945B46A90D77BB - - fileRef - 0524E24381502D7EB46CCF29 - isa - PBXBuildFile - - 648F4790538BD82BF2B083EF - - baseConfigurationReference - 430F4C781E2E7EE9F8CB83FD - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - - isa - XCBuildConfiguration - name - Debug - - 6499B8CCEC40B282FFAADFA6 - - containerPortal - E88354D347CCC1EAC2E787C1 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 76D2A8D67E04D111A7938CED - remoteInfo - Pods-RCTNetworkImage - - 6522F5D072C47020817339D9 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTInvalidating.h - path - Base/RCTInvalidating.h - sourceTree - <group> - - 6707B683A72305367066EE6C - - fileRef - 33E69C46AB97309D4EBFA432 - isa - PBXBuildFile - - 6817FF9F9174ADBAD78127A3 - - fileRef - D0F5EC95B7EE03515326948E - isa - PBXBuildFile - - 69220AD94D86BCE4FAE46678 - - children - - 4608EE51074A11B61B7BAB45 - A95BFEC22FBAC588E1B491ED - C9AA6ACBFD421C3D6FAC5329 - C8F7D06CE3D7F4FDED21933F - - isa - PBXGroup - name - Support Files - path - ../../Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage - sourceTree - <group> - - 6966836B9D0C1BA7F411C883 - - fileRef - 5A8146BE2B9A4E8B080899C7 - isa - PBXBuildFile - - 69E62A75FE90251221950A25 - - fileRef - 15D063218D733290ACAF6ECD - isa - PBXBuildFile - - 6AC9ACC04495648FA5060FCD - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTRedBox.m - path - Base/RCTRedBox.m - sourceTree - <group> - - 6B2DF6A0713908E45F8EBE75 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-environment.h - sourceTree - <group> - - 6BC3EB96204A30E4A472DDE4 - - fileRef - 97BAEC30E32259F061CCB7DE - isa - PBXBuildFile - - 6BEE757D0B19EB927C04C0FA - - children - - 0EC776D336E22CBCEE4678E8 - BCDC97F48090DACB87DEC04E - 39206929A27DEBF5CBACB942 - C575BB07E7B92FA3EBC10949 - - isa - PBXGroup - name - Products - sourceTree - <group> - - 6C4193D7074A9FE2AADD31C2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods.debug.xcconfig - sourceTree - <group> - - 6C59A8B8703F0BD79C458591 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTSparseArray.h - path - Base/RCTSparseArray.h - sourceTree - <group> - - 6C5C7F49C76DFD009CE24F54 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTRootView.h - path - Base/RCTRootView.h - sourceTree - <group> - - 6D757E59E707D9B3474721D7 - - buildConfigurations - - CDCB9B4306F2967192C1DAAA - 00CA6F6E234DA9FAFC268F4C - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 6DA156177295C36FC390E8E9 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTShadowText.m - sourceTree - <group> - - 6E38F96F68680D013AD0812A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTWrapperViewController.m - path - Views/RCTWrapperViewController.m - sourceTree - <group> - - 6FCFD749EEB3861EB75C0534 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTAssert.h - path - Base/RCTAssert.h - sourceTree - <group> - - 716937CEA06BA6300F2CFD38 - - fileRef - F6F6566819F8D0B545E28AC4 - isa - PBXBuildFile - - 71B93A65A95640972062EC29 - - fileRef - 45775545A25B55D8FF631FF5 - isa - PBXBuildFile - - 72B306867705C5CA14B74DF2 + 3EA7887D20B6B743DE3C1DF5 includeInIndex 1 @@ -1763,7 +1013,7 @@ sourceTree <group> - 7308A06BDA47FB20E2FC8005 + 3EF20A23049B63D8F1AB34ED includeInIndex 1 @@ -1772,57 +1022,59 @@ lastKnownFileType sourcecode.c.h name - RCTConvert.h + RCTView.h path - Base/RCTConvert.h + Views/RCTView.h sourceTree <group> - 759D943C6812DD195ABE9354 + 3F8AC8D36568DD378B90804B - fileRef - 2E00E46C249C163EBC0418DC + includeInIndex + 1 isa - PBXBuildFile - - 76D2A8D67E04D111A7938CED - - buildConfigurationList - 097BE8E1E29CD333D067E047 - buildPhases - - BD29342538528D6DE4038BD2 - DEA6A4B98EA82BEDE81ED513 - 58A59E47157F3E11F33C044F - - buildRules - - dependencies - - B495C09D4F5093AAB731E194 - - isa - PBXNativeTarget + PBXFileReference + lastKnownFileType + sourcecode.c.objc name - Pods-RCTNetworkImage - productName - Pods-RCTNetworkImage - productReference - BCDC97F48090DACB87DEC04E - productType - com.apple.product-type.library.static + RCTStatusBarManager.m + path + Modules/RCTStatusBarManager.m + sourceTree + <group> - 7701A5C43F0A8424984C6A6A + 41E7BCDB123D639D70221FE4 - fileRef - 6DA156177295C36FC390E8E9 + includeInIndex + 1 isa - PBXBuildFile + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-RCTNetworkImage-dummy.m + sourceTree + <group> - 772EDE81A05CD3EA28A869CC + 42F3BF4E050BB621F3E00E3C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTUIManager.m + path + Modules/RCTUIManager.m + sourceTree + <group> + + 43C225961E6BF40B9C819C93 baseConfigurationReference - 504F7E363A7AFC9A64B86154 + B753A0617AB77E1E91027A34 buildSettings ALWAYS_SEARCH_USER_PATHS @@ -1868,14 +1120,7 @@ name Debug - 7795BA5CF034328C6FAB5599 - - fileRef - 895928D325843E9D8B7285FA - isa - PBXBuildFile - - 77AEC7F8659C91198FFFF673 + 4451C03906E44804B163B854 includeInIndex 1 @@ -1884,351 +1129,18 @@ lastKnownFileType sourcecode.c.h name - RCTNavigatorManager.h + RCTContextExecutor.h path - Views/RCTNavigatorManager.h + Executors/RCTContextExecutor.h sourceTree <group> - 77BFD1192ACD1153CD3B92C2 - - fileRef - B2D7892A9C3245D8D7431C23 - isa - PBXBuildFile - - 78082D94239F5CEB5959B0B2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTNetworkImageViewManager.h - sourceTree - <group> - - 79ED42B49D21E04D9AA9DC7F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTNetworkImageView.h - sourceTree - <group> - - 7A9E043C29916787D48A9DC3 - - fileRef - B32480BC0BA8A8BA551E9D00 - isa - PBXBuildFile - - 7B322FB23DF6316D9D0FAB4F - - fileRef - 8E13E32022B45DA13AFC5404 - isa - PBXBuildFile - - 7D62F170107D856DB97A0F27 - - fileRef - 2F6BBA653E86409B28911661 - isa - PBXBuildFile - - 7D6A37C994847E772C6CF039 - - buildActionMask - 2147483647 - files - - FB19B6A03634D6CC16E8D731 - 8C49B230561E49F529C012B5 - 949E5950C7964E60EE8037C2 - BE52F839238A59D2AB82159E - EC5F81AEBB86DCC1C9ECDE59 - 1E8BDC022A45A44FA90E9BF5 - 0C288D473E48E342E2E09095 - 7B322FB23DF6316D9D0FAB4F - 81A3FE9526EC90CC18E84790 - 5F70F61D02759E49CFA5E3EB - 523EDE48CB10BED172EA70AA - 7D62F170107D856DB97A0F27 - AC1A530CDB55406B05665766 - AF5A50F21A42CD8E0BBDF109 - 7EBF30F9E8C4AD6523928C97 - 0D3A42D393008EEAD192C928 - 358919F57C8842F2A160F855 - 2603E0CD923E37E10EED21A8 - E52753A376176D518B300161 - D65313F8C82EBB8E719F5006 - 71B93A65A95640972062EC29 - 0D723FDEF5CC9DBD086EAB39 - 9A489A5B6D91FD9AA80B1B50 - 47B228B88421B943C6005B10 - 5675366766067D60156EEAA1 - 1E0B27EFE9498593A53775FC - 32FFFCBE06BA47E77A58F52F - B1DC103317576FEAB1449D9F - 6BC3EB96204A30E4A472DDE4 - FADF4B43BFFF2AEF6F4A43B8 - 5D44D4115556BA5F81C67E07 - 4637476226C7CEC79C7DE49E - E5508477224F57D3312AC5B9 - 6707B683A72305367066EE6C - EDBE9B4FBE2888A89C7FAAAE - 8631A36CD036B7126537AE0B - F092F906C8A9E95FD09661CE - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 7DA2E9C4F2BA3289E2668E17 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.script.sh - path - Pods-resources.sh - sourceTree - <group> - - 7DE6E8E2D2109F67434864E2 - - fileRef - 068A30BD4A2404B5DAEBE221 - isa - PBXBuildFile - - 7E1B11B9B4C3FFCEFFD1F35D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTSparseArray.m - path - Base/RCTSparseArray.m - sourceTree - <group> - - 7EBF30F9E8C4AD6523928C97 - - fileRef - B70F784E53C151C33E1130FF - isa - PBXBuildFile - - 7EDCA4090C484196C36B1977 - - containerPortal - E88354D347CCC1EAC2E787C1 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 20F2231C1AEED2919F583DC7 - remoteInfo - Pods-ReactKit - - 80DBEC5108DFE1F49442F2F9 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text - name - Podfile - path - ../Podfile - sourceTree - SOURCE_ROOT - xcLanguageSpecificationIdentifier - xcode.lang.ruby - - 81A3FE9526EC90CC18E84790 - - fileRef - B42844BBEB0C3FCBB4CB7C98 - isa - PBXBuildFile - - 8307F3BCFAD957D08281164A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTTiming.m - path - Modules/RCTTiming.m - sourceTree - <group> - - 8399DB76B770CB32FA2CD5FF - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTKeyCommands.h - path - Base/RCTKeyCommands.h - sourceTree - <group> - - 83C5FDC3F8BE71F2109194A8 - - fileRef - DE4BA2446E5FB9E2F0C98C34 - isa - PBXBuildFile - - 84A6E86621CA19A1F15ECC01 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTRawTextManager.h - sourceTree - <group> - - 85336AD28D003EA10FC44AD9 - - isa - PBXTargetDependency - name - Pods-ReactKit - target - 20F2231C1AEED2919F583DC7 - targetProxy - 89109953D98B8498BE8FE817 - - 8631A36CD036B7126537AE0B - - fileRef - 6E38F96F68680D013AD0812A - isa - PBXBuildFile - - 88F100D7F9D61D558EF80D8A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTView.m - path - Views/RCTView.m - sourceTree - <group> - - 89109953D98B8498BE8FE817 - - containerPortal - E88354D347CCC1EAC2E787C1 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 20F2231C1AEED2919F583DC7 - remoteInfo - Pods-ReactKit - - 895928D325843E9D8B7285FA - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTImageDownloader.h - sourceTree - <group> - - 8C49B230561E49F529C012B5 - - fileRef - A3731A42F61C724D93CD6A2E - isa - PBXBuildFile - - 8E13E32022B45DA13AFC5404 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTConvert.m - path - Base/RCTConvert.m - sourceTree - <group> - - 8ECFD3E48BD636104455BB71 - - fileRef - E7FA1D0590C4CB610C0FECF2 - isa - PBXBuildFile - - 8F72A8B191D5505279E9254D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.plist.xml - path - Pods-acknowledgements.plist - sourceTree - <group> - - 919FCDB927A3933126B3DCFE + 44BDDC5CCC328A8C9B3F8533 buildConfigurations - 648F4790538BD82BF2B083EF - 5A541D6A294BA6E01BD0CD3A + 22C673EC6E5974F93BB91F64 + 5ED038F9CB64DEAC35C0C2CD defaultConfigurationIsVisible 0 @@ -2237,7 +1149,27 @@ isa XCConfigurationList - 932B25E8D26A525CAF6ABCC0 + 457785C4F077FF2E7AA47B49 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTNetworkImageView.m + sourceTree + <group> + + 45EB3392836956C146A52A0C + + fileRef + 6B82C5B8677FA77F9902CA0F + isa + PBXBuildFile + + 46EA953E96B6E60A9EA7253A includeInIndex 1 @@ -2252,363 +1184,7 @@ sourceTree <group> - 943F495152CC9318EB9F83B1 - - fileRef - 5D5E4CDC94FE8212303F96ED - isa - PBXBuildFile - - 949E5950C7964E60EE8037C2 - - fileRef - 132DE36D6DB2D0F70C09CE89 - isa - PBXBuildFile - - 9659D9A2FEA529295FE42173 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTScrollView.m - path - Views/RCTScrollView.m - sourceTree - <group> - - 97138ACEE67BD2BDF8A3DEA0 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTRootView.m - path - Base/RCTRootView.m - sourceTree - <group> - - 97BAEC30E32259F061CCB7DE - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTTouchHandler.m - path - Base/RCTTouchHandler.m - sourceTree - <group> - - 97C2676E499C58904665B945 - - fileRef - 9AAFEB3BA8925E0E14AE9A9E - isa - PBXBuildFile - - 9A489A5B6D91FD9AA80B1B50 - - fileRef - E55746E91186F585B21DFB68 - isa - PBXBuildFile - - 9AAFEB3BA8925E0E14AE9A9E - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTTiming.h - path - Modules/RCTTiming.h - sourceTree - <group> - - 9B18ECDA237344C06A230FB3 - - containerPortal - E88354D347CCC1EAC2E787C1 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 20F2231C1AEED2919F583DC7 - remoteInfo - Pods-ReactKit - - 9C1FE5B0BAC9A97A8309591C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTUIActivityIndicatorViewManager.m - path - Views/RCTUIActivityIndicatorViewManager.m - sourceTree - <group> - - 9C8A29CEE6A594FF4F429DB3 - - children - - 84A6E86621CA19A1F15ECC01 - 16E1299D87C2B7BE1D68024F - 44161614652ABCC200708F4A - 5F3DD45AD214483F15E95111 - FF03E617D571F159152581FC - 6DA156177295C36FC390E8E9 - 005E47CD37DA97006CE65B99 - 15478769A7025E67403CF8F6 - F213CCB9CD13022BCF3B8578 - DA90B4FBB6B34AAFB1C03F28 - DAC7254DBCF13C5C31A7AF31 - - isa - PBXGroup - name - RCTText - path - ../../../Libraries/Text - sourceTree - <group> - - 9E520B28129AD787FE9C67D8 - - fileRef - 6522F5D072C47020817339D9 - isa - PBXBuildFile - - 9FF2D7B800439FD8B4118089 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTWebViewExecutor.h - path - Executors/RCTWebViewExecutor.h - sourceTree - <group> - - A3731A42F61C724D93CD6A2E - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-ReactKit-dummy.m - sourceTree - <group> - - A53374892CD6B26138B38ADB - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTStatusBarManager.m - path - Modules/RCTStatusBarManager.m - sourceTree - <group> - - A551474C8E2F85DBAEF20B96 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTImageDownloader.m - sourceTree - <group> - - A63CEAE583EF5324F7786345 - - fileRef - C9AA6ACBFD421C3D6FAC5329 - isa - PBXBuildFile - - A95BFEC22FBAC588E1B491ED - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTNetworkImage-Private.xcconfig - sourceTree - <group> - - A9BAD3EC8ABCA9694CAF96F7 - - fileRef - ACC753B0E880892739890CD6 - isa - PBXBuildFile - - A9CA493A1D0DBFFAC416CF2B - - buildActionMask - 2147483647 - files - - BE926BD26838E67A959563DD - F69EE0ADB66942B5A2F06409 - 0D4B28DA9FC2C4CB2B2874B3 - 7701A5C43F0A8424984C6A6A - F6129F258DCA7C19228C218D - D1ADF19017FFB8A53F8F0885 - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - A9E3206FA20E2CAD15028412 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods.release.xcconfig - sourceTree - <group> - - AB98ECCECFE588B641E804DD - - children - - 895928D325843E9D8B7285FA - A551474C8E2F85DBAEF20B96 - 79ED42B49D21E04D9AA9DC7F - F6CC16FA65BD5A265088B6B6 - 78082D94239F5CEB5959B0B2 - 198FD8078EB2E34708CAF463 - 69220AD94D86BCE4FAE46678 - - isa - PBXGroup - name - RCTNetworkImage - path - ../../../Libraries/Image - sourceTree - <group> - - ABFBF65F5D61F7EA440E25A8 - - fileRef - 245789C2D4A68C88E27641D9 - isa - PBXBuildFile - - AC1A530CDB55406B05665766 - - fileRef - DD9C58FDC618EFB182668F97 - isa - PBXBuildFile - - ACC753B0E880892739890CD6 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTEventDispatcher.h - path - Base/RCTEventDispatcher.h - sourceTree - <group> - - AF5A50F21A42CD8E0BBDF109 - - fileRef - 72B306867705C5CA14B74DF2 - isa - PBXBuildFile - - B1DC103317576FEAB1449D9F - - fileRef - 8307F3BCFAD957D08281164A - isa - PBXBuildFile - - B2D7892A9C3245D8D7431C23 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTTouchHandler.h - path - Base/RCTTouchHandler.h - sourceTree - <group> - - B32480BC0BA8A8BA551E9D00 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTTextFieldManager.h - path - Views/RCTTextFieldManager.h - sourceTree - <group> - - B32BDD61D5D87B095411A92F + 48BBE16348C79B57F35F8DBF includeInIndex 1 @@ -2621,7 +1197,7 @@ sourceTree <group> - B40A54F9CD6C17782376DE87 + 4B0397BE4FBD9F8FEDEBEAF4 includeInIndex 1 @@ -2630,309 +1206,13 @@ lastKnownFileType sourcecode.c.h name - RCTNavigator.h + RCTNavItem.h path - Views/RCTNavigator.h + Views/RCTNavItem.h sourceTree <group> - B42844BBEB0C3FCBB4CB7C98 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTEventDispatcher.m - path - Base/RCTEventDispatcher.m - sourceTree - <group> - - B495C09D4F5093AAB731E194 - - isa - PBXTargetDependency - name - Pods-ReactKit - target - 20F2231C1AEED2919F583DC7 - targetProxy - 9B18ECDA237344C06A230FB3 - - B70F784E53C151C33E1130FF - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTNavigator.m - path - Views/RCTNavigator.m - sourceTree - <group> - - B9DEE348987356C83C27DD9E - - fileRef - 49199899EB7E17720A69A6A0 - isa - PBXBuildFile - - BB0B04F7F63902EED012528E - - fileRef - 491280116436017C4FEC9FD8 - isa - PBXBuildFile - - BCDC97F48090DACB87DEC04E - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods-RCTNetworkImage.a - sourceTree - BUILT_PRODUCTS_DIR - - BD29342538528D6DE4038BD2 - - buildActionMask - 2147483647 - files - - A63CEAE583EF5324F7786345 - D3EA0626B08FB41301B71BA7 - 411AACA7B5F606DA03793980 - E2BA10A9D9813750516AA99F - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - BD88172D1A926B95F1965628 - - fileRef - 5D5E4CDC94FE8212303F96ED - isa - PBXBuildFile - - BE52F839238A59D2AB82159E - - fileRef - 4648080B27A50C8D028851B3 - isa - PBXBuildFile - - BE926BD26838E67A959563DD - - fileRef - E68B47098BE36BB1B90E7BD6 - isa - PBXBuildFile - - BFEF41FE0A9C6E4BF083A1C4 - - fileRef - F213CCB9CD13022BCF3B8578 - isa - PBXBuildFile - - C043A8B738F0E880E4E71CF4 - - buildActionMask - 2147483647 - files - - F7531B3CBFEDA85A72BF6805 - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - C07D1DDFE8D93ECEDF0E97C1 - - fileRef - 6C5C7F49C76DFD009CE24F54 - isa - PBXBuildFile - - C09FDA6F8073916E1DC7FB77 - - children - - B32BDD61D5D87B095411A92F - 430F4C781E2E7EE9F8CB83FD - A3731A42F61C724D93CD6A2E - FDBD9515B1715137A4E1AD37 - - isa - PBXGroup - name - Support Files - path - ../Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit - sourceTree - <group> - - C23EA0774A0BD0ACB68E5B0F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTView.h - path - Views/RCTView.h - sourceTree - <group> - - C426A0F89138E32710FFDBCD - - children - - 80DBEC5108DFE1F49442F2F9 - FE1E926B5C3C10CA3797023E - C521253141932511E561C093 - 6BEE757D0B19EB927C04C0FA - 427D3517A7FBC3A92AF9E9D4 - - isa - PBXGroup - sourceTree - <group> - - C521253141932511E561C093 - - children - - D503EB0531912E6E58954932 - - isa - PBXGroup - name - Frameworks - sourceTree - <group> - - C575BB07E7B92FA3EBC10949 - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods-ReactKit.a - sourceTree - BUILT_PRODUCTS_DIR - - C618E1B2CFF909C6273ABD4D - - fileRef - C23EA0774A0BD0ACB68E5B0F - isa - PBXBuildFile - - C77D22DADA6D43EC7CC8478A - - fileRef - 175C559D2A89B7FC27EFD6C5 - isa - PBXBuildFile - - C8F7D06CE3D7F4FDED21933F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-RCTNetworkImage-prefix.pch - sourceTree - <group> - - C9AA6ACBFD421C3D6FAC5329 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-RCTNetworkImage-dummy.m - sourceTree - <group> - - CCCA2CC55157BFF72767CEAB - - baseConfigurationReference - A95BFEC22FBAC588E1B491ED - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - CDCB9B4306F2967192C1DAAA + 4B64AFA829DB76F2FE51E920 buildSettings @@ -2999,7 +1279,7 @@ name Debug - CEAD6D174912D6D124A031D9 + 4CAAD0D6BF7C31F9871B5563 includeInIndex 1 @@ -3008,26 +1288,20 @@ lastKnownFileType sourcecode.c.h name - RCTAutoInsetsProtocol.h + RCTWebViewExecutor.h path - Base/RCTAutoInsetsProtocol.h + Executors/RCTWebViewExecutor.h sourceTree <group> - CEDE7930A786744ACDE6592B + 4D0FD9ED093EC8F8163C743A - includeInIndex - 1 + fileRef + C3D3D260900346C1CE93D5CA isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-RCTText-prefix.pch - sourceTree - <group> + PBXBuildFile - D0F5EC95B7EE03515326948E + 4EFC81CD3380F9556D86CC8C includeInIndex 1 @@ -3036,32 +1310,284 @@ lastKnownFileType sourcecode.c.h name - RCTCache.h + RCTUtils.h path - Base/RCTCache.h + Base/RCTUtils.h sourceTree <group> - D1ADF19017FFB8A53F8F0885 + 4FDB96AA2F90818C413120ED + + baseConfigurationReference + D46C615416D298CD2EF32D8B + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_PRECOMPILE_PREFIX_HEADER + YES + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 5007E16F5C7E9EFC0185562F fileRef - DA90B4FBB6B34AAFB1C03F28 + 3A6DEBCF91BF88EE6FF0C53E isa PBXBuildFile - D3EA0626B08FB41301B71BA7 + 51455DB97B6F834E2B3A5AFF fileRef - A551474C8E2F85DBAEF20B96 + 9EBCB645740BB4540527E698 isa PBXBuildFile - D43D7636AEF4C472723FF075 + 51597927537D12ADB1492F73 + + fileRef + 8E36491BC0A73F578A6F8D7F + isa + PBXBuildFile + + 5199984D66E0D4825EAFDE48 + + fileRef + 1EA38AB62019C3EC36D2FC6A + isa + PBXBuildFile + + 51FA8C21CA14626EB0416885 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTShadowRawText.h + sourceTree + <group> + + 5208C78A6225B97814C99D43 + + fileRef + 55A208629844F66520167BA8 + isa + PBXBuildFile + + 5246EC6FB1C3F3B04BC17D19 + + fileRef + 8EA2D7BE822E7CFD12194108 + isa + PBXBuildFile + + 535AB2CD3AD8C9EAC218E37B + + fileRef + 92895F84F87A2CE56D4B3DD8 + isa + PBXBuildFile + + 53906C4FE2269E04A9CBA745 + + fileRef + 261567BAE307BF57D88AC939 + isa + PBXBuildFile + + 549BC0F2811E2649ED299CAD + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-ReactKit.a + sourceTree + BUILT_PRODUCTS_DIR + + 55A208629844F66520167BA8 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTStaticImageManager.m + path + Views/RCTStaticImageManager.m + sourceTree + <group> + + 5650233E3ECB1C612AB3AA71 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTViewManager.h + path + Views/RCTViewManager.h + sourceTree + <group> + + 568AF882FEE1A75F17DF8480 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTTextFieldManager.m + path + Views/RCTTextFieldManager.m + sourceTree + <group> + + 574AFAFE072DE55BFB6F50CB + + fileRef + 41E7BCDB123D639D70221FE4 + isa + PBXBuildFile + + 5897E6B3789429F1760006A5 + + fileRef + CDB3FDE1695B0706CA924FA5 + isa + PBXBuildFile + + 591F3D5FF66858A7F5F2834F + + fileRef + ED51F456809B09F7439C4D93 + isa + PBXBuildFile + + 599BC72A5589AE2013BF6900 + + children + + 06B66FE3B127D202B1AC9803 + B318A41A989E068CB405AD1F + 865F2D07C98B4CA4B18F1F78 + AF2C54E62D7D0120DB4D4DE5 + 625D2DAA384FD2F2F8763CC3 + C8F2F05D94C1A991A87B571E + D46C615416D298CD2EF32D8B + + isa + PBXGroup + name + Pods + path + Target Support Files/Pods + sourceTree + <group> + + 59C8D74DD9C98E16056D5366 + + fileRef + B3F5495EE23A8AB6596EB29A + isa + PBXBuildFile + + 5AAC51BC1BDDD9A9215CFBDD + + fileRef + 91219004BE0A4C162AF041A5 + isa + PBXBuildFile + + 5AECCCA812DA969CD5F83501 + + fileRef + D19D762ABD2DB814D5BA26CA + isa + PBXBuildFile + + 5C6CB7FDCCAA7A2DA6E404FA + + fileRef + 568AF882FEE1A75F17DF8480 + isa + PBXBuildFile + + 5CF875C3818A1F0206603D10 + + children + + BBF638A80E2895BEFE9C4730 + BA6C0E71C8E201475B68A2E3 + E8407ED863C88EC9CA04A11C + 457785C4F077FF2E7AA47B49 + 1036E6C4C58112D9A8A1D615 + 64819624F35D65C3AD434F7D + D41089EF6EAF70DF70BC0D25 + + isa + PBXGroup + name + RCTNetworkImage + path + ../../../Libraries/Image + sourceTree + <group> + + 5E0ADAD263C01B5C07EBAD67 buildConfigurations - 772EDE81A05CD3EA28A869CC - 320294F910FF631F87E183B5 + 4B64AFA829DB76F2FE51E920 + 2FF3BF263DDDD5F909C02622 defaultConfigurationIsVisible 0 @@ -3070,41 +1596,113 @@ isa XCConfigurationList - D4D507D020AD79183E1DD916 + 5ED038F9CB64DEAC35C0C2CD + + baseConfigurationReference + 39463588A39AA3E9757F0520 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 5F698EE693825391F5ADB26A fileRef - 48039B7A25006CE8F45E9619 + B4992F13711EC0E2E61D9B72 isa PBXBuildFile - D503EB0531912E6E58954932 + 5FF5D1DF04BA4E30E6268208 - children - - 5D5E4CDC94FE8212303F96ED - + fileRef + 2E2A8AF7AB8F16F26CE07D8C isa - PBXGroup + PBXBuildFile + + 6058DA074939167562CECB0B + + fileRef + A5A887B5A0FE16862445E7FB + isa + PBXBuildFile + + 61063E1955F44DB956E55837 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc name - iOS + RCTSparseArray.m + path + Base/RCTSparseArray.m sourceTree <group> - D65313F8C82EBB8E719F5006 + 625D2DAA384FD2F2F8763CC3 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.script.sh + path + Pods-resources.sh + sourceTree + <group> + + 6297A72A212404588E6F25E7 fileRef - 530A6D73CAFF37DCB5A52103 + D9D68BDCB56619CE484E1950 isa PBXBuildFile - D879CE28A1189AB3CA754538 - - fileRef - 7308A06BDA47FB20E2FC8005 - isa - PBXBuildFile - - DA90B4FBB6B34AAFB1C03F28 + 64819624F35D65C3AD434F7D includeInIndex 1 @@ -3113,29 +1711,37 @@ lastKnownFileType sourcecode.c.objc path - RCTTextManager.m + RCTNetworkImageViewManager.m sourceTree <group> - DAC7254DBCF13C5C31A7AF31 + 673952613A34ACCA97161AA2 - children - - 391E46E8F975CA6362AB5DE5 - 504F7E363A7AFC9A64B86154 - E68B47098BE36BB1B90E7BD6 - CEDE7930A786744ACDE6592B - isa - PBXGroup + PBXTargetDependency name - Support Files + Pods-ReactKit + target + 973EEBD9F9591953DFB21C06 + targetProxy + 992468CC66C0BCCDEE192DE6 + + 686655033E6D4DF34CC8D72A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTAssert.m path - ../../Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText + Base/RCTAssert.m sourceTree <group> - DD1AEBDB914EF5C49CAAEB46 + 688A6AE7AC080B377719B148 includeInIndex 1 @@ -3144,41 +1750,20 @@ lastKnownFileType sourcecode.c.h name - RCTJavaScriptExecutor.h + RCTBridge.h path - Base/RCTJavaScriptExecutor.h + Base/RCTBridge.h sourceTree <group> - DD9C58FDC618EFB182668F97 + 68A6B7F8A71634C7753A9D2D - includeInIndex - 1 + fileRef + BBF638A80E2895BEFE9C4730 isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTNavItem.m - path - Views/RCTNavItem.m - sourceTree - <group> + PBXBuildFile - DDEDAE8AD808715BBCF5DC6C - - buildActionMask - 2147483647 - files - - BD88172D1A926B95F1965628 - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - DE4BA2446E5FB9E2F0C98C34 + 69903DC41C305CDC985BEA22 includeInIndex 1 @@ -3193,20 +1778,29 @@ sourceTree <group> - DEA6A4B98EA82BEDE81ED513 + 6A93C2F4C1D0F2F9FFEA5116 - buildActionMask - 2147483647 - files - - 943F495152CC9318EB9F83B1 - + fileRef + 07576F9F34B4CADE96EDD698 isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 + PBXBuildFile - DF17E391C45D5B66999F6D99 + 6B82C5B8677FA77F9902CA0F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTUIActivityIndicatorViewManager.h + path + Views/RCTUIActivityIndicatorViewManager.h + sourceTree + <group> + + 6B92A10C94541BEEFE730577 includeInIndex 1 @@ -3215,16 +1809,1590 @@ lastKnownFileType sourcecode.c.objc name - RCTKeyCommands.m + RCTUIActivityIndicatorViewManager.m path - Base/RCTKeyCommands.m + Views/RCTUIActivityIndicatorViewManager.m sourceTree <group> - DFEDA529E62F398E0E66A864 + 6BA39D6B07EFAE9F3D0C6239 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + UIView+ReactKit.h + path + Views/UIView+ReactKit.h + sourceTree + <group> + + 6E025D879E9E4EA39894CCF7 + + fileRef + 79A5515EDEDBB9DA720BFE4A + isa + PBXBuildFile + + 707BF0AC66323E30AB45EDFD + + buildActionMask + 2147483647 + files + + 74877526C735AEA400666D26 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 7175E2D64BC6B577E9C8B508 + + containerPortal + A30671B7FF41C9CC88DDC48D + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 973EEBD9F9591953DFB21C06 + remoteInfo + Pods-ReactKit + + 71C70C27906DAEB68FB0CF59 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTWrapperViewController.h + path + Views/RCTWrapperViewController.h + sourceTree + <group> + + 71EF39441EAF6D8A62C981C5 + + fileRef + 69903DC41C305CDC985BEA22 + isa + PBXBuildFile + + 7327196C4F5BA97CA4539891 + + children + + D9D68BDCB56619CE484E1950 + A8DBC5BF7CEEEDA937D3BE08 + 51FA8C21CA14626EB0416885 + 2C7ED084B30FD91FBC08C10D + CEBFC03689DC0AC9CD1D45F6 + 92895F84F87A2CE56D4B3DD8 + B4992F13711EC0E2E61D9B72 + 7601163D57B34162C4CA1C48 + CB9F944208FFD7B3ADC7A00A + DCD06DFADE2DF0CA7278AB88 + F70F1BFEF9D1587A38666EEB + + isa + PBXGroup + name + RCTText + path + ../../../Libraries/Text + sourceTree + <group> + + 741F9A1822BB7EDBCBA63557 + + children + + E6F1A1F54DDCFD6330C02A56 + 3CC6BB454B8522DB5089F791 + 254E0C8ACCD2FF00E6FD2AE6 + 88771C44C3AA01999607AE8F + 16955EC616390F52DD46F011 + + isa + PBXGroup + sourceTree + <group> + + 74877526C735AEA400666D26 + + fileRef + B46B327243391CAF6E0717D9 + isa + PBXBuildFile + + 75728F9C40185E318ECF195B + + fileRef + 11806B3CDA8E83E6F2FE8D17 + isa + PBXBuildFile + + 7601163D57B34162C4CA1C48 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTText.m + sourceTree + <group> + + 769A717CAFE5B019B17120C7 + + buildConfigurationList + 44BDDC5CCC328A8C9B3F8533 + buildPhases + + 7F1122EB52A6E58596E7B10E + 09135B9EC1FBC85584FC4DBD + 8751FDB8FC4A8FA0014F8438 + + buildRules + + dependencies + + 88177B2CC430A98CD146FC73 + + isa + PBXNativeTarget + name + Pods-RCTNetworkImage + productName + Pods-RCTNetworkImage + productReference + 8671023CE4714E3C2336C9C8 + productType + com.apple.product-type.library.static + + 76DB22C9C8B38077354D35A8 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTRootView.m + path + Base/RCTRootView.m + sourceTree + <group> + + 79237C45AFA01938E517AD06 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTEventDispatcher.m + path + Base/RCTEventDispatcher.m + sourceTree + <group> + + 79A5515EDEDBB9DA720BFE4A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTConvert.h + path + Base/RCTConvert.h + sourceTree + <group> + + 7AFFD53FE48F494D9736FB8D + + fileRef + EA4527C073CDB5189EBADCD7 + isa + PBXBuildFile + + 7F1122EB52A6E58596E7B10E + + buildActionMask + 2147483647 + files + + 574AFAFE072DE55BFB6F50CB + CC1B51AD9B49FFAA1362B23F + 915B0A85BF984349115614CC + 8EBBCBAED11B750107770DB9 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 7FEDFD81C12D696A75133BDA + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTLog.h + path + Base/RCTLog.h + sourceTree + <group> + + 8002A0260F2B1C62C0F465E9 baseConfigurationReference - A95BFEC22FBAC588E1B491ED + C8F2F05D94C1A991A87B571E + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 7.0 + OTHER_LDFLAGS + + OTHER_LIBTOOLFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + 80A2CDBEC4C2EA679BDFD05B + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTTextField.h + path + Views/RCTTextField.h + sourceTree + <group> + + 80E2EA6586C8C5C71DFFA0B2 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTTextFieldManager.h + path + Views/RCTTextFieldManager.h + sourceTree + <group> + + 82A7154EBF9864584C0B6647 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-RCTText-dummy.m + sourceTree + <group> + + 865F2D07C98B4CA4B18F1F78 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-dummy.m + sourceTree + <group> + + 8671023CE4714E3C2336C9C8 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-RCTNetworkImage.a + sourceTree + BUILT_PRODUCTS_DIR + + 8751FDB8FC4A8FA0014F8438 + + buildActionMask + 2147483647 + files + + 68A6B7F8A71634C7753A9D2D + D290C62BBB41818A93C7C1A1 + 39D02CE2F933786AEA335F33 + + isa + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 87E418B79822E8736EA41DE8 + + fileRef + 82A7154EBF9864584C0B6647 + isa + PBXBuildFile + + 8813F909BCAF027B0FC323D0 + + buildActionMask + 2147483647 + files + + D8076A3A8F0FAA3CD5E1FC99 + DAFE568BA68CC1B9A1496B03 + BE75BC76971974B7D4C38A36 + D6CF22628A62FAE5C1C4F751 + 1196334A907C76F86D4A63CB + B88E04B1572FF6FEC2D3B465 + 6A93C2F4C1D0F2F9FFEA5116 + 51455DB97B6F834E2B3A5AFF + F8F9FC945C529FDD56EE046E + 2747CB53DCACFABE26C705AA + 034357B4792A8675BA3B962F + 591F3D5FF66858A7F5F2834F + DE5F1B9081628B9A5A573C5B + A1807A06CB52537883C3B54F + 8ED347D2E41CC3C7CAD08F95 + 8C339544ECA90DD852D2079D + 3BDB2D0EDA22488B2E6C76B7 + 7AFFD53FE48F494D9736FB8D + 107D57F0208D55DBB0B65853 + 5FF5D1DF04BA4E30E6268208 + E514DB237132E2FE887A871F + AEF6909F3ECCE95C6495B070 + 2F5489066B626F5AA9656150 + 5AECCCA812DA969CD5F83501 + 5208C78A6225B97814C99D43 + B6D4979E7A87393AD504C9F8 + A2A969DAE26BC783576D2EDE + 5C6CB7FDCCAA7A2DA6E404FA + CCBD98E709AB05D7FCCA9DD4 + 51597927537D12ADB1492F73 + F8A30B6BAB9EB9CAE3F5EE83 + EACA791D981259D849E9575C + 5246EC6FB1C3F3B04BC17D19 + 27365C92F7FA6EF9E524A670 + 329AC794493AD159BF606910 + 36A55CAD129917A8F65E897D + E3483608408169CD1A186EEA + 32451A95EB5079ED6F4F3E5A + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 88177B2CC430A98CD146FC73 + + isa + PBXTargetDependency + name + Pods-ReactKit + target + 973EEBD9F9591953DFB21C06 + targetProxy + D3650CA7059AEE2BD3BE431F + + 88771C44C3AA01999607AE8F + + children + + 25015EE62C53673BAF076DD7 + 8671023CE4714E3C2336C9C8 + A8383CD9E89EBD0486A2CFF1 + 549BC0F2811E2649ED299CAD + + isa + PBXGroup + name + Products + sourceTree + <group> + + 8A0B35F9B55AB9E9876DF4F4 + + fileRef + CEBFC03689DC0AC9CD1D45F6 + isa + PBXBuildFile + + 8AC6957EC29778E18C201992 + + fileRef + B6F5CFD1D6804D50A8EF31AC + isa + PBXBuildFile + + 8AF331922DC4CDB6CF9DB6A9 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTStaticImageManager.h + path + Views/RCTStaticImageManager.h + sourceTree + <group> + + 8C09DDBC1987BC48B1173A6A + + fileRef + 0CB274EC48DFB07B4C8B240E + isa + PBXBuildFile + + 8C339544ECA90DD852D2079D + + fileRef + A1B258FDC18C71176DA32CFE + isa + PBXBuildFile + + 8D14C3BB217E003103E52CA1 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTNavigatorManager.m + path + Views/RCTNavigatorManager.m + sourceTree + <group> + + 8DE4BE955C41F35E0DE7BF39 + + fileRef + 6BA39D6B07EFAE9F3D0C6239 + isa + PBXBuildFile + + 8E36491BC0A73F578A6F8D7F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTTouchHandler.m + path + Base/RCTTouchHandler.m + sourceTree + <group> + + 8EA2D7BE822E7CFD12194108 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTUtils.m + path + Base/RCTUtils.m + sourceTree + <group> + + 8EBBCBAED11B750107770DB9 + + fileRef + 64819624F35D65C3AD434F7D + isa + PBXBuildFile + + 8ED347D2E41CC3C7CAD08F95 + + fileRef + 3EA7887D20B6B743DE3C1DF5 + isa + PBXBuildFile + + 91219004BE0A4C162AF041A5 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTEventDispatcher.h + path + Base/RCTEventDispatcher.h + sourceTree + <group> + + 915B0A85BF984349115614CC + + fileRef + 457785C4F077FF2E7AA47B49 + isa + PBXBuildFile + + 92895F84F87A2CE56D4B3DD8 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTShadowText.m + sourceTree + <group> + + 936FD7023BD4626A2EBF07A2 + + fileRef + 4CAAD0D6BF7C31F9871B5563 + isa + PBXBuildFile + + 93C181AF29A9C408FC907C4A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTScrollViewManager.h + path + Views/RCTScrollViewManager.h + sourceTree + <group> + + 96611930547604A69128D37A + + fileRef + 51FA8C21CA14626EB0416885 + isa + PBXBuildFile + + 971060A5AAD6681C19B92AFC + + isa + PBXTargetDependency + name + Pods-ReactKit + target + 973EEBD9F9591953DFB21C06 + targetProxy + 7175E2D64BC6B577E9C8B508 + + 973EEBD9F9591953DFB21C06 + + buildConfigurationList + 2C552B02AE33C61830745E85 + buildPhases + + 8813F909BCAF027B0FC323D0 + 2222F067CA369E707A16AEF7 + F55505C4FEE6D4B5BE545B36 + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Pods-ReactKit + productName + Pods-ReactKit + productReference + 549BC0F2811E2649ED299CAD + productType + com.apple.product-type.library.static + + 974AE51E6EEA2E10FA244901 + + buildConfigurations + + 8002A0260F2B1C62C0F465E9 + 4FDB96AA2F90818C413120ED + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 9792679800AFBB1E3AEA6C75 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTInvalidating.h + path + Base/RCTInvalidating.h + sourceTree + <group> + + 983AAB60C663D67F5EC651DF + + fileRef + A4689EAD31C2FA4EA3CC9562 + isa + PBXBuildFile + + 992468CC66C0BCCDEE192DE6 + + containerPortal + A30671B7FF41C9CC88DDC48D + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 973EEBD9F9591953DFB21C06 + remoteInfo + Pods-ReactKit + + 9B331DCABA0319591332829F + + buildActionMask + 2147483647 + files + + 33AC21BAE4072FDD0FC446AC + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 9B65A75546F806AFC5B18A60 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTWrapperViewController.m + path + Views/RCTWrapperViewController.m + sourceTree + <group> + + 9EBCB645740BB4540527E698 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTConvert.m + path + Base/RCTConvert.m + sourceTree + <group> + + 9FAFE9BD1A59BB2AECB2C96F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTLocationObserver.h + path + Modules/RCTLocationObserver.h + sourceTree + <group> + + 9FB67D0E7544E5440575234D + + buildConfigurationList + 974AE51E6EEA2E10FA244901 + buildPhases + + 9B331DCABA0319591332829F + 707BF0AC66323E30AB45EDFD + + buildRules + + dependencies + + 025A87130AD86B58E404D3C0 + B59B3D5BE50E22525A751AF2 + 673952613A34ACCA97161AA2 + + isa + PBXNativeTarget + name + Pods + productName + Pods + productReference + 25015EE62C53673BAF076DD7 + productType + com.apple.product-type.library.static + + A1807A06CB52537883C3B54F + + fileRef + EDA82AB2D40C974A74CA74A9 + isa + PBXBuildFile + + A1B258FDC18C71176DA32CFE + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTNavigator.m + path + Views/RCTNavigator.m + sourceTree + <group> + + A29B3475CEBEAF74694048F7 + + fileRef + 35757FFD140D20F790EE2BDD + isa + PBXBuildFile + + A2A969DAE26BC783576D2EDE + + fileRef + 069D2AD44B6410EACB1B2075 + isa + PBXBuildFile + + A2AF525DC972EB0FDD47D962 + + fileRef + 2C7ED084B30FD91FBC08C10D + isa + PBXBuildFile + + A30671B7FF41C9CC88DDC48D + + attributes + + LastUpgradeCheck + 0510 + + buildConfigurationList + 5E0ADAD263C01B5C07EBAD67 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + + mainGroup + 741F9A1822BB7EDBCBA63557 + productRefGroup + 88771C44C3AA01999607AE8F + projectDirPath + + projectReferences + + projectRoot + + targets + + 9FB67D0E7544E5440575234D + 769A717CAFE5B019B17120C7 + 3859014F88232018A42BAC04 + 973EEBD9F9591953DFB21C06 + + + A3B9259CF020C7A65A92AA0E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTScrollView.h + path + Views/RCTScrollView.h + sourceTree + <group> + + A4689EAD31C2FA4EA3CC9562 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTJSMethodRegistrar.h + path + Base/RCTJSMethodRegistrar.h + sourceTree + <group> + + A5A887B5A0FE16862445E7FB + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTNavigatorManager.h + path + Views/RCTNavigatorManager.h + sourceTree + <group> + + A66BCD8A2FAA1E8DADD7488E + + fileRef + 8AF331922DC4CDB6CF9DB6A9 + isa + PBXBuildFile + + A8383CD9E89EBD0486A2CFF1 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-RCTText.a + sourceTree + BUILT_PRODUCTS_DIR + + A8DBC5BF7CEEEDA937D3BE08 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTRawTextManager.m + sourceTree + <group> + + AACA8FE0E3EC2035615EC0AE + + fileRef + 7FEDFD81C12D696A75133BDA + isa + PBXBuildFile + + AACE41F371930BDA2BE0D50F + + children + + B46B327243391CAF6E0717D9 + + isa + PBXGroup + name + iOS + sourceTree + <group> + + AEF6909F3ECCE95C6495B070 + + fileRef + 24081C451F4316B44C32B7CC + isa + PBXBuildFile + + AF2C54E62D7D0120DB4D4DE5 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-environment.h + sourceTree + <group> + + AF458FAFFB109206A76292E6 + + fileRef + CDB7B6437EABB1154D9772C0 + isa + PBXBuildFile + + B00A2CCF46A8FBC54A316DCC + + children + + 2A073BDE36873311DA6A0EF5 + 3A6DEBCF91BF88EE6FF0C53E + B3F5495EE23A8AB6596EB29A + 07F1BC4802790A12CD37323F + 0B8869CDD72D9A8E218342F0 + 0970729E477937347C8EBD83 + 686655033E6D4DF34CC8D72A + 31815389CBA63C86E173EE9C + 688A6AE7AC080B377719B148 + BADCCC41C7913287A31E51C9 + 1EA38AB62019C3EC36D2FC6A + 0CB274EC48DFB07B4C8B240E + 3BF49B8ADD348B664CAA965D + 4451C03906E44804B163B854 + 07576F9F34B4CADE96EDD698 + 79A5515EDEDBB9DA720BFE4A + 9EBCB645740BB4540527E698 + 91219004BE0A4C162AF041A5 + 79237C45AFA01938E517AD06 + C8023A8F586BE2C6323242D8 + 110F901C8F65A6EC1D683ED3 + 9792679800AFBB1E3AEA6C75 + A4689EAD31C2FA4EA3CC9562 + CCF7DF071515793DD6C0414D + E5B280DE6A446D58C857B3C7 + 31E92BD37BFCCB143ED614CB + 9FAFE9BD1A59BB2AECB2C96F + ED51F456809B09F7439C4D93 + 7FEDFD81C12D696A75133BDA + 31CB0CA9F918FFFFCCDB8284 + 4B0397BE4FBD9F8FEDEBEAF4 + EDA82AB2D40C974A74CA74A9 + CDB3FDE1695B0706CA924FA5 + 3EA7887D20B6B743DE3C1DF5 + 11806B3CDA8E83E6F2FE8D17 + A1B258FDC18C71176DA32CFE + A5A887B5A0FE16862445E7FB + 8D14C3BB217E003103E52CA1 + B6F5CFD1D6804D50A8EF31AC + 69903DC41C305CDC985BEA22 + EA4527C073CDB5189EBADCD7 + FBC74FE67BCC52FD85C1BAD0 + 76DB22C9C8B38077354D35A8 + A3B9259CF020C7A65A92AA0E + 2E2A8AF7AB8F16F26CE07D8C + 93C181AF29A9C408FC907C4A + D76CCDEFB1E46BB0C1532B99 + E22151F70AA7C88D098C99BB + 1B18F1E7CA77F1AA1A12D304 + 24081C451F4316B44C32B7CC + CDB7B6437EABB1154D9772C0 + 61063E1955F44DB956E55837 + C3D3D260900346C1CE93D5CA + D19D762ABD2DB814D5BA26CA + 8AF331922DC4CDB6CF9DB6A9 + 55A208629844F66520167BA8 + 261567BAE307BF57D88AC939 + 3F8AC8D36568DD378B90804B + 80A2CDBEC4C2EA679BDFD05B + 069D2AD44B6410EACB1B2075 + 80E2EA6586C8C5C71DFFA0B2 + 568AF882FEE1A75F17DF8480 + 25B6E9DFFAE6A9540CEF75DE + DC61985AB127017510FF47B0 + 2FE386FFB0F3E3A3528409B9 + 8E36491BC0A73F578A6F8D7F + 6B82C5B8677FA77F9902CA0F + 6B92A10C94541BEEFE730577 + 35757FFD140D20F790EE2BDD + 42F3BF4E050BB621F3E00E3C + 4EFC81CD3380F9556D86CC8C + 8EA2D7BE822E7CFD12194108 + 3EF20A23049B63D8F1AB34ED + D436BE9918549C192684657C + 5650233E3ECB1C612AB3AA71 + 05979756D746338C19D9CFE3 + F9EB9D707F5B2AD7C1E442EF + 4CAAD0D6BF7C31F9871B5563 + 3569D3C1AD09FC147229AF8D + 71C70C27906DAEB68FB0CF59 + 9B65A75546F806AFC5B18A60 + 6BA39D6B07EFAE9F3D0C6239 + 46EA953E96B6E60A9EA7253A + 2A8C42E95666925E6CEE303F + + isa + PBXGroup + name + ReactKit + path + ../../../ReactKit + sourceTree + <group> + + B03DD49B4D0684DD664FA620 + + fileRef + 4B0397BE4FBD9F8FEDEBEAF4 + isa + PBXBuildFile + + B1AB002CD8EBE409EC364BF4 + + containerPortal + A30671B7FF41C9CC88DDC48D + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 769A717CAFE5B019B17120C7 + remoteInfo + Pods-RCTNetworkImage + + B1CE62B16BA49B5F93E0F176 + + fileRef + 9792679800AFBB1E3AEA6C75 + isa + PBXBuildFile + + B318A41A989E068CB405AD1F + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Pods-acknowledgements.plist + sourceTree + <group> + + B3F415717620F1F12B992B0D + + fileRef + 0970729E477937347C8EBD83 + isa + PBXBuildFile + + B3F5495EE23A8AB6596EB29A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTAlertManager.h + path + Modules/RCTAlertManager.h + sourceTree + <group> + + B46B327243391CAF6E0717D9 + + isa + PBXFileReference + lastKnownFileType + wrapper.framework + name + Foundation.framework + path + Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/Foundation.framework + sourceTree + DEVELOPER_DIR + + B4992F13711EC0E2E61D9B72 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTText.h + sourceTree + <group> + + B59B3D5BE50E22525A751AF2 + + isa + PBXTargetDependency + name + Pods-RCTText + target + 3859014F88232018A42BAC04 + targetProxy + C3D2400BD002BB173CDFA171 + + B5FC682792E6A0447D287697 + + fileRef + 0B8869CDD72D9A8E218342F0 + isa + PBXBuildFile + + B6D4979E7A87393AD504C9F8 + + fileRef + 3F8AC8D36568DD378B90804B + isa + PBXBuildFile + + B6F5CFD1D6804D50A8EF31AC + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTPointerEvents.h + path + Base/RCTPointerEvents.h + sourceTree + <group> + + B753A0617AB77E1E91027A34 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTText-Private.xcconfig + sourceTree + <group> + + B88E04B1572FF6FEC2D3B465 + + fileRef + 3BF49B8ADD348B664CAA965D + isa + PBXBuildFile + + BA296894BFD973DE874868B8 + + fileRef + 9FAFE9BD1A59BB2AECB2C96F + isa + PBXBuildFile + + BA6C0E71C8E201475B68A2E3 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTImageDownloader.m + sourceTree + <group> + + BADCCC41C7913287A31E51C9 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTBridge.m + path + Base/RCTBridge.m + sourceTree + <group> + + BBF638A80E2895BEFE9C4730 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTImageDownloader.h + sourceTree + <group> + + BE1D1748A0D0A88E8D9EBDC6 + + fileRef + 31815389CBA63C86E173EE9C + isa + PBXBuildFile + + BE75BC76971974B7D4C38A36 + + fileRef + 07F1BC4802790A12CD37323F + isa + PBXBuildFile + + BF6A636E87E3CA2080B277BD + + buildActionMask + 2147483647 + files + + 6297A72A212404588E6F25E7 + 96611930547604A69128D37A + 8A0B35F9B55AB9E9876DF4F4 + 5F698EE693825391F5ADB26A + 150C5DBA403D3B23A1EC6CDE + + isa + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + C10CEF62C1009D05C2E0E7DF + + fileRef + 80E2EA6586C8C5C71DFFA0B2 + isa + PBXBuildFile + + C3D2400BD002BB173CDFA171 + + containerPortal + A30671B7FF41C9CC88DDC48D + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 3859014F88232018A42BAC04 + remoteInfo + Pods-RCTText + + C3D3D260900346C1CE93D5CA + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTStaticImage.h + path + Views/RCTStaticImage.h + sourceTree + <group> + + C8023A8F586BE2C6323242D8 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTExceptionsManager.h + path + Modules/RCTExceptionsManager.h + sourceTree + <group> + + C8F2F05D94C1A991A87B571E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods.debug.xcconfig + sourceTree + <group> + + CB9F944208FFD7B3ADC7A00A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTTextManager.h + sourceTree + <group> + + CC1B51AD9B49FFAA1362B23F + + fileRef + BA6C0E71C8E201475B68A2E3 + isa + PBXBuildFile + + CCBD98E709AB05D7FCCA9DD4 + + fileRef + DC61985AB127017510FF47B0 + isa + PBXBuildFile + + CCF7DF071515793DD6C0414D + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTJavaScriptExecutor.h + path + Base/RCTJavaScriptExecutor.h + sourceTree + <group> + + CDB3FDE1695B0706CA924FA5 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTNavItemManager.h + path + Views/RCTNavItemManager.h + sourceTree + <group> + + CDB7B6437EABB1154D9772C0 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTSparseArray.h + path + Base/RCTSparseArray.h + sourceTree + <group> + + CEBFC03689DC0AC9CD1D45F6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTShadowText.h + sourceTree + <group> + + D19D762ABD2DB814D5BA26CA + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTStaticImage.m + path + Views/RCTStaticImage.m + sourceTree + <group> + + D257C76E43E366FC0EA7A12E + + fileRef + 7601163D57B34162C4CA1C48 + isa + PBXBuildFile + + D290C62BBB41818A93C7C1A1 + + fileRef + E8407ED863C88EC9CA04A11C + isa + PBXBuildFile + + D3650CA7059AEE2BD3BE431F + + containerPortal + A30671B7FF41C9CC88DDC48D + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 973EEBD9F9591953DFB21C06 + remoteInfo + Pods-ReactKit + + D41089EF6EAF70DF70BC0D25 + + children + + F2A1CE5BD796846DBD308A95 + 39463588A39AA3E9757F0520 + 41E7BCDB123D639D70221FE4 + DC8389FA6FBDA311577B6AD5 + + isa + PBXGroup + name + Support Files + path + ../../Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage + sourceTree + <group> + + D436BE9918549C192684657C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTView.m + path + Views/RCTView.m + sourceTree + <group> + + D46C615416D298CD2EF32D8B + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods.release.xcconfig + sourceTree + <group> + + D47F88D3F797D8EF95C0BA4D + + baseConfigurationReference + 062BC4B46046CE4058393650 buildSettings ALWAYS_SEARCH_USER_PATHS @@ -3240,7 +3408,7 @@ GCC_PRECOMPILE_PREFIX_HEADER YES GCC_PREFIX_HEADER - Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch + Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch GCC_PREPROCESSOR_DEFINITIONS DEBUG=1 @@ -3270,158 +3438,14 @@ name Debug - E00F5EA71F725792D7FE1C0F - - children - - E9A7A3D5EC8AAF878D6A2CBE - 491280116436017C4FEC9FD8 - E7FA1D0590C4CB610C0FECF2 - 132DE36D6DB2D0F70C09CE89 - 26C00EEFB778EFB7A6703E20 - 6FCFD749EEB3861EB75C0534 - 4648080B27A50C8D028851B3 - CEAD6D174912D6D124A031D9 - 0524E24381502D7EB46CCF29 - 3D3089A4A62A68E4D5BB4562 - EE90F905D6EA51C12DA5F4ED - D0F5EC95B7EE03515326948E - 3CC9DC0433D77149CC4DE5DE - 289322DAF960C6BD7F2FD8E1 - 22669B7FF7DBBF51202945CD - 7308A06BDA47FB20E2FC8005 - 8E13E32022B45DA13AFC5404 - ACC753B0E880892739890CD6 - B42844BBEB0C3FCBB4CB7C98 - 27F37EEF056BA05A9FE6548A - 2DA5F87EA2CDCEA0ED668578 - 6522F5D072C47020817339D9 - E5FC33A15846273C981E0322 - DD1AEBDB914EF5C49CAAEB46 - 8399DB76B770CB32FA2CD5FF - DF17E391C45D5B66999F6D99 - 16B69D05ABC152C41B9129FB - 2F6BBA653E86409B28911661 - 3FDDE45F64AE789BEAED2125 - DD9C58FDC618EFB182668F97 - 49199899EB7E17720A69A6A0 - 72B306867705C5CA14B74DF2 - B40A54F9CD6C17782376DE87 - B70F784E53C151C33E1130FF - 77AEC7F8659C91198FFFF673 - 12FAC13993C100C3FDBD0DD8 - 54481109ECD4CD40F5F746F8 - DE4BA2446E5FB9E2F0C98C34 - 6AC9ACC04495648FA5060FCD - 6C5C7F49C76DFD009CE24F54 - 97138ACEE67BD2BDF8A3DEA0 - 245789C2D4A68C88E27641D9 - 9659D9A2FEA529295FE42173 - E991F096165FA74435C7282D - 530A6D73CAFF37DCB5A52103 - 15D063218D733290ACAF6ECD - 068A30BD4A2404B5DAEBE221 - 45775545A25B55D8FF631FF5 - 6C59A8B8703F0BD79C458591 - 7E1B11B9B4C3FFCEFFD1F35D - 2461A7AF21FB638CED912FE3 - E55746E91186F585B21DFB68 - 3F06663863E59C187B84EAD2 - F731109AFE06344ABBC4BBE6 - 5A8146BE2B9A4E8B080899C7 - A53374892CD6B26138B38ADB - F6F6566819F8D0B545E28AC4 - FCAC9AFE3E61C78E93EA7E8C - B32480BC0BA8A8BA551E9D00 - 22CB86FDC9D99844724FDDD3 - 9AAFEB3BA8925E0E14AE9A9E - 8307F3BCFAD957D08281164A - B2D7892A9C3245D8D7431C23 - 97BAEC30E32259F061CCB7DE - 2E00E46C249C163EBC0418DC - 9C1FE5B0BAC9A97A8309591C - 02011DF072CE86BD3AD237F3 - EA77880FBBE6AA7511841605 - 42FCE12743FD1B4702208E0D - 1568A6E0A0EFBABC6271F94D - C23EA0774A0BD0ACB68E5B0F - 88F100D7F9D61D558EF80D8A - 3938293AC4D9C3C8B8DDFDC7 - 33E69C46AB97309D4EBFA432 - 175C559D2A89B7FC27EFD6C5 - 9FF2D7B800439FD8B4118089 - 0678F15E5799E801FBBB82EE - 569C3E0B54CE022FD9433B66 - 6E38F96F68680D013AD0812A - 48039B7A25006CE8F45E9619 - 932B25E8D26A525CAF6ABCC0 - C09FDA6F8073916E1DC7FB77 - - isa - PBXGroup - name - ReactKit - path - ../../../ReactKit - sourceTree - <group> - - E1C485676C801FFCB46D93D0 + D6CF22628A62FAE5C1C4F751 fileRef - 77AEC7F8659C91198FFFF673 + 686655033E6D4DF34CC8D72A isa PBXBuildFile - E1C5A97B9865CABC567B000A - - containerPortal - E88354D347CCC1EAC2E787C1 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - F5D2C09AFAA6986D234BF953 - remoteInfo - Pods-RCTText - - E2BA10A9D9813750516AA99F - - fileRef - 198FD8078EB2E34708CAF463 - isa - PBXBuildFile - - E484553771DAF5F08178C966 - - buildConfigurations - - EF728A6C52298117E9505250 - 2A5A7AE725AB3B07B61A40E9 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - E52753A376176D518B300161 - - fileRef - 9659D9A2FEA529295FE42173 - isa - PBXBuildFile - - E5508477224F57D3312AC5B9 - - fileRef - 88F100D7F9D61D558EF80D8A - isa - PBXBuildFile - - E55746E91186F585B21DFB68 + D76CCDEFB1E46BB0C1532B99 includeInIndex 1 @@ -3430,233 +3454,267 @@ lastKnownFileType sourcecode.c.objc name - RCTStaticImage.m + RCTScrollViewManager.m path - Views/RCTStaticImage.m + Views/RCTScrollViewManager.m sourceTree <group> - E5FC33A15846273C981E0322 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTJSMethodRegistrar.h - path - Base/RCTJSMethodRegistrar.h - sourceTree - <group> - - E68B47098BE36BB1B90E7BD6 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-RCTText-dummy.m - sourceTree - <group> - - E7FA1D0590C4CB610C0FECF2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTAlertManager.h - path - Modules/RCTAlertManager.h - sourceTree - <group> - - E88354D347CCC1EAC2E787C1 - - attributes - - LastUpgradeCheck - 0510 - - buildConfigurationList - 6D757E59E707D9B3474721D7 - compatibilityVersion - Xcode 3.2 - developmentRegion - English - hasScannedForEncodings - 0 - isa - PBXProject - knownRegions - - en - - mainGroup - C426A0F89138E32710FFDBCD - productRefGroup - 6BEE757D0B19EB927C04C0FA - projectDirPath - - projectReferences - - projectRoot - - targets - - 156E154B035C85C750DA3DE2 - 76D2A8D67E04D111A7938CED - F5D2C09AFAA6986D234BF953 - 20F2231C1AEED2919F583DC7 - - - E991F096165FA74435C7282D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTScrollViewManager.h - path - Views/RCTScrollViewManager.h - sourceTree - <group> - - E9A7A3D5EC8AAF878D6A2CBE - - includeInIndex - 1 - isa - PBXFileReference - name - Layout.c - path - Layout/Layout.c - sourceTree - <group> - - EA77880FBBE6AA7511841605 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTUIManager.m - path - Modules/RCTUIManager.m - sourceTree - <group> - - EA79968832417354B40F6352 + D8076A3A8F0FAA3CD5E1FC99 fileRef - EE90F905D6EA51C12DA5F4ED + 2A073BDE36873311DA6A0EF5 isa PBXBuildFile - EA7CC42518555EE2C4B617E3 + D9D68BDCB56619CE484E1950 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTRawTextManager.h + sourceTree + <group> + + DAFE568BA68CC1B9A1496B03 + + fileRef + 19B74DAEFA40E906DEDEADFA + isa + PBXBuildFile + + DC61985AB127017510FF47B0 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTTiming.m + path + Modules/RCTTiming.m + sourceTree + <group> + + DC8389FA6FBDA311577B6AD5 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-RCTNetworkImage-prefix.pch + sourceTree + <group> + + DCD06DFADE2DF0CA7278AB88 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RCTTextManager.m + sourceTree + <group> + + DD8E4C13EE69D6954938439C + + fileRef + 71C70C27906DAEB68FB0CF59 + isa + PBXBuildFile + + DE5F1B9081628B9A5A573C5B + + fileRef + 31CB0CA9F918FFFFCCDB8284 + isa + PBXBuildFile + + E22151F70AA7C88D098C99BB + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTScrollableProtocol.h + path + Base/RCTScrollableProtocol.h + sourceTree + <group> + + E2D61EA3810F0B25C4443657 + + fileRef + C8023A8F586BE2C6323242D8 + isa + PBXBuildFile + + E3483608408169CD1A186EEA + + fileRef + 9B65A75546F806AFC5B18A60 + isa + PBXBuildFile + + E352220A2836A697446EE5ED + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-RCTText-prefix.pch + sourceTree + <group> + + E420F9974821AC873ADE0EB0 + + fileRef + 3EF20A23049B63D8F1AB34ED + isa + PBXBuildFile + + E514DB237132E2FE887A871F + + fileRef + D76CCDEFB1E46BB0C1532B99 + isa + PBXBuildFile + + E5B280DE6A446D58C857B3C7 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTKeyCommands.h + path + Base/RCTKeyCommands.h + sourceTree + <group> + + E6F1A1F54DDCFD6330C02A56 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text + name + Podfile + path + ../Podfile + sourceTree + SOURCE_ROOT + xcLanguageSpecificationIdentifier + xcode.lang.ruby + + E8407ED863C88EC9CA04A11C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RCTNetworkImageView.h + sourceTree + <group> + + EA4527C073CDB5189EBADCD7 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTRedBox.m + path + Base/RCTRedBox.m + sourceTree + <group> + + EACA791D981259D849E9575C + + fileRef + 42F3BF4E050BB621F3E00E3C + isa + PBXBuildFile + + EC011298F3945A65BF256861 + + fileRef + 4EFC81CD3380F9556D86CC8C + isa + PBXBuildFile + + EC32BFBA00A39F59EB11C597 buildActionMask 2147483647 files - FBE4E83A8EF948FF337B2436 + 341F23664902CBD8947C5DB3 isa PBXFrameworksBuildPhase runOnlyForDeploymentPostprocessing 0 - EC5F81AEBB86DCC1C9ECDE59 - - fileRef - 3D3089A4A62A68E4D5BB4562 - isa - PBXBuildFile - - ED09FCD5EBB9DAA998867B1F - - fileRef - 84A6E86621CA19A1F15ECC01 - isa - PBXBuildFile - - EDBE5D54C93BC128C25036AD - - isa - PBXTargetDependency - name - Pods-RCTNetworkImage - target - 76D2A8D67E04D111A7938CED - targetProxy - 6499B8CCEC40B282FFAADFA6 - - EDBE9B4FBE2888A89C7FAAAE - - fileRef - 0678F15E5799E801FBBB82EE - isa - PBXBuildFile - - EE90F905D6EA51C12DA5F4ED - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTBridgeModule.h - path - Base/RCTBridgeModule.h - sourceTree - <group> - - EF728A6C52298117E9505250 + ED0EAAAC662DFADD30EA5D11 baseConfigurationReference - 6C4193D7074A9FE2AADD31C2 + 062BC4B46046CE4058393650 buildSettings ALWAYS_SEARCH_USER_PATHS NO COPY_PHASE_STRIP - NO + YES DSTROOT /tmp/xcodeproj.dst - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 GCC_PRECOMPILE_PREFIX_HEADER YES - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO + GCC_PREFIX_HEADER + Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch INSTALL_PATH $(BUILT_PRODUCTS_DIR) IPHONEOS_DEPLOYMENT_TARGET 7.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + OTHER_LDFLAGS OTHER_LIBTOOLFLAGS @@ -3669,188 +3727,130 @@ iphoneos SKIP_INSTALL YES + VALIDATE_PRODUCT + YES isa XCBuildConfiguration name - Debug + Release - F069246D046DFFE7CF05DE92 - - fileRef - 42FCE12743FD1B4702208E0D - isa - PBXBuildFile - - F092F906C8A9E95FD09661CE - - fileRef - 932B25E8D26A525CAF6ABCC0 - isa - PBXBuildFile - - F213CCB9CD13022BCF3B8578 + ED51F456809B09F7439C4D93 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.h + sourcecode.c.objc + name + RCTLocationObserver.m path - RCTTextManager.h + Modules/RCTLocationObserver.m sourceTree <group> - F5D2C09AFAA6986D234BF953 + EDA82AB2D40C974A74CA74A9 - buildConfigurationList - D43D7636AEF4C472723FF075 - buildPhases + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + RCTNavItem.m + path + Views/RCTNavItem.m + sourceTree + <group> + + EFCED6D21D4BB89711E40665 + + fileRef + 93C181AF29A9C408FC907C4A + isa + PBXBuildFile + + F16F4721492709A369BC5C8D + + fileRef + 5650233E3ECB1C612AB3AA71 + isa + PBXBuildFile + + F2A1CE5BD796846DBD308A95 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-RCTNetworkImage.xcconfig + sourceTree + <group> + + F55505C4FEE6D4B5BE545B36 + + buildActionMask + 2147483647 + files - A9CA493A1D0DBFFAC416CF2B - EA7CC42518555EE2C4B617E3 - 03219EE301E4BE34C4E26BF5 - - buildRules - - dependencies - - 60662361B9CC9A2A8D49F638 + 5007E16F5C7E9EFC0185562F + 59C8D74DD9C98E16056D5366 + B5FC682792E6A0447D287697 + B3F415717620F1F12B992B0D + BE1D1748A0D0A88E8D9EBDC6 + FC94E17D52247017A950BB80 + 5199984D66E0D4825EAFDE48 + 8C09DDBC1987BC48B1173A6A + 2B409A074C5817E5B40428E2 + 6E025D879E9E4EA39894CCF7 + 5AAC51BC1BDDD9A9215CFBDD + E2D61EA3810F0B25C4443657 + B1CE62B16BA49B5F93E0F176 + 983AAB60C663D67F5EC651DF + 1537FF13D7133AA6F8B3A1C9 + 2B475CAFC274FB31E95E5491 + BA296894BFD973DE874868B8 + AACA8FE0E3EC2035615EC0AE + B03DD49B4D0684DD664FA620 + 5897E6B3789429F1760006A5 + 75728F9C40185E318ECF195B + 6058DA074939167562CECB0B + 8AC6957EC29778E18C201992 + 71EF39441EAF6D8A62C981C5 + 218485DF6D2557DEC0F8E74E + 07C36347F29DC7BB656AED2E + EFCED6D21D4BB89711E40665 + 19636039A13AE878699E8DBB + 1D5C721F04A0D2846039D9B7 + AF458FAFFB109206A76292E6 + 4D0FD9ED093EC8F8163C743A + A66BCD8A2FAA1E8DADD7488E + 53906C4FE2269E04A9CBA745 + 02CA42753891DE99F0C4A9F1 + C10CEF62C1009D05C2E0E7DF + 277413A21FD87DA13511099F + 38FFA89C70E4D1645D42E7ED + 45EB3392836956C146A52A0C + A29B3475CEBEAF74694048F7 + EC011298F3945A65BF256861 + E420F9974821AC873ADE0EB0 + F16F4721492709A369BC5C8D + 3BFAD0347A551F0536E421F4 + 936FD7023BD4626A2EBF07A2 + DD8E4C13EE69D6954938439C + 8DE4BE955C41F35E0DE7BF39 isa - PBXNativeTarget - name - Pods-RCTText - productName - Pods-RCTText - productReference - 39206929A27DEBF5CBACB942 - productType - com.apple.product-type.library.static + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 - F6129F258DCA7C19228C218D - - fileRef - 15478769A7025E67403CF8F6 - isa - PBXBuildFile - - F68991A42B4CF608AF91EBB5 - - fileRef - 54481109ECD4CD40F5F746F8 - isa - PBXBuildFile - - F69EE0ADB66942B5A2F06409 - - fileRef - 16E1299D87C2B7BE1D68024F - isa - PBXBuildFile - - F6CC16FA65BD5A265088B6B6 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTNetworkImageView.m - sourceTree - <group> - - F6F6566819F8D0B545E28AC4 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTTextField.h - path - Views/RCTTextField.h - sourceTree - <group> - - F731109AFE06344ABBC4BBE6 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTStaticImageManager.m - path - Views/RCTStaticImageManager.m - sourceTree - <group> - - F7531B3CBFEDA85A72BF6805 - - fileRef - 054AB43B546728B2ACD9DE38 - isa - PBXBuildFile - - F9ECFBDEC272AF69A54935F9 - - fileRef - 3FDDE45F64AE789BEAED2125 - isa - PBXBuildFile - - FADF4B43BFFF2AEF6F4A43B8 - - fileRef - 9C1FE5B0BAC9A97A8309591C - isa - PBXBuildFile - - FAE203974E438996878047C2 - - fileRef - 8399DB76B770CB32FA2CD5FF - isa - PBXBuildFile - - FB19B6A03634D6CC16E8D731 - - fileRef - E9A7A3D5EC8AAF878D6A2CBE - isa - PBXBuildFile - - FBE4E83A8EF948FF337B2436 - - fileRef - 5D5E4CDC94FE8212303F96ED - isa - PBXBuildFile - - FCAC9AFE3E61C78E93EA7E8C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTTextField.m - path - Views/RCTTextField.m - sourceTree - <group> - - FDBD9515B1715137A4E1AD37 + F66B15C716DB00AB74903326 includeInIndex 1 @@ -3863,22 +3863,39 @@ sourceTree <group> - FE1E926B5C3C10CA3797023E + F70F1BFEF9D1587A38666EEB children - AB98ECCECFE588B641E804DD - 9C8A29CEE6A594FF4F429DB3 - E00F5EA71F725792D7FE1C0F + 12507443D597BE1AFA5013A7 + B753A0617AB77E1E91027A34 + 82A7154EBF9864584C0B6647 + E352220A2836A697446EE5ED isa PBXGroup name - Development Pods + Support Files + path + ../../Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText sourceTree <group> - FF03E617D571F159152581FC + F8A30B6BAB9EB9CAE3F5EE83 + + fileRef + 6B92A10C94541BEEFE730577 + isa + PBXBuildFile + + F8F9FC945C529FDD56EE046E + + fileRef + 79237C45AFA01938E517AD06 + isa + PBXBuildFile + + F9EB9D707F5B2AD7C1E442EF includeInIndex 1 @@ -3886,13 +3903,44 @@ PBXFileReference lastKnownFileType sourcecode.c.h + name + RCTViewNodeProtocol.h path - RCTShadowText.h + Base/RCTViewNodeProtocol.h sourceTree <group> + FA29A9F03B11C2074DC5216D + + fileRef + DCD06DFADE2DF0CA7278AB88 + isa + PBXBuildFile + + FBC74FE67BCC52FD85C1BAD0 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + RCTRootView.h + path + Base/RCTRootView.h + sourceTree + <group> + + FC94E17D52247017A950BB80 + + fileRef + 688A6AE7AC080B377719B148 + isa + PBXBuildFile + rootObject - E88354D347CCC1EAC2E787C1 + A30671B7FF41C9CC88DDC48D diff --git a/Examples/UIExplorer/GeoLocationExample.js b/Examples/UIExplorer/GeoLocationExample.js new file mode 100644 index 000000000..1ab5f290c --- /dev/null +++ b/Examples/UIExplorer/GeoLocationExample.js @@ -0,0 +1,72 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule GeoLocationExample + */ +/* eslint no-console: 0 */ +'use strict'; + + +var React = require('react-native'); +var { + StyleSheet, + Text, + View, +} = React; + +exports.framework = 'React'; +exports.title = 'GeoLocation'; +exports.description = 'Examples of using the GeoLocation API.'; + +exports.examples = [ + { + title: 'navigator.geolocation', + render: function() { + return ; + }, + } +]; + +var GeoLocationExample = React.createClass({ + getInitialState: function() { + return { + initialPosition: 'unknown', + lastPosition: 'unknown', + }; + }, + + componentDidMount: function() { + navigator.geolocation.getCurrentPosition( + (initialPosition) => this.setState({initialPosition}), + (error) => console.error(error) + ); + this.watchID = navigator.geolocation.watchPosition((lastPosition) => { + this.setState({lastPosition}); + }); + }, + + componentWillUnmount: function() { + navigator.geolocation.clearWatch(this.watchID); + }, + + render: function() { + return ( + + + Initial position: + {JSON.stringify(this.state.initialPosition)} + + + Current position: + {JSON.stringify(this.state.lastPosition)} + + + ); + } +}); + +var styles = StyleSheet.create({ + title: { + fontWeight: 'bold', + }, +}); diff --git a/Examples/UIExplorer/Info.plist b/Examples/UIExplorer/Info.plist index 9a7ca7e3c..245054621 100644 --- a/Examples/UIExplorer/Info.plist +++ b/Examples/UIExplorer/Info.plist @@ -34,6 +34,8 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + NSLocationWhenInUseUsageDescription + You need to add NSLocationWhenInUseUsageDescription key in Info.plist to enable geolocation, otherwise it is going to *fail silently*! UIViewControllerBasedStatusBarAppearance diff --git a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj index 798c95a21..493310f0c 100644 --- a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj +++ b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj @@ -7,46 +7,46 @@ objects = { /* Begin PBXBuildFile section */ + 1316A21A1AA397CA00C0188E /* libRCTNetworkImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1316A2101AA3871A00C0188E /* libRCTNetworkImage.a */; }; + 1316A21B1AA397CA00C0188E /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1316A2081AA386C700C0188E /* libRCTText.a */; }; + 1316A21C1AA397CA00C0188E /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1316A2171AA3875D00C0188E /* libReactKit.a */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 587651361A9EB175008B8F17 /* libRCTNetworkImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587651281A9EB168008B8F17 /* libRCTNetworkImage.a */; }; - 587651371A9EB175008B8F17 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587651301A9EB168008B8F17 /* libRCTText.a */; }; - 587651381A9EB175008B8F17 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587651351A9EB168008B8F17 /* libReactKit.a */; }; 587651571A9F862F008B8F17 /* libRCTDataManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5876514F1A9F8619008B8F17 /* libRCTDataManager.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 587651271A9EB168008B8F17 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B5115D1A9E6B3D00147676; - remoteInfo = RCTNetworkImage; - }; - 587651291A9EB168008B8F17 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B511681A9E6B3D00147676; - remoteInfo = RCTNetworkImageTests; - }; - 5876512F1A9EB168008B8F17 /* PBXContainerItemProxy */ = { + 1316A2071AA386C700C0188E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */; proxyType = 2; remoteGlobalIDString = 58B5119B1A9E6C1200147676; remoteInfo = RCTText; }; - 587651311A9EB168008B8F17 /* PBXContainerItemProxy */ = { + 1316A2091AA386C700C0188E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */; proxyType = 2; remoteGlobalIDString = 58B511A61A9E6C1300147676; remoteInfo = RCTTextTests; }; - 587651341A9EB168008B8F17 /* PBXContainerItemProxy */ = { + 1316A20F1AA3871A00C0188E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B5115D1A9E6B3D00147676; + remoteInfo = RCTNetworkImage; + }; + 1316A2111AA3871A00C0188E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511681A9E6B3D00147676; + remoteInfo = RCTNetworkImageTests; + }; + 1316A2161AA3875D00C0188E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 587651221A9EB168008B8F17 /* ReactKit.xcodeproj */; proxyType = 2; @@ -77,9 +77,9 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetworkImage.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../Image/RCTNetworkImage.xcodeproj"; sourceTree = ""; }; - 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../Text/RCTText.xcodeproj"; sourceTree = ""; }; - 587651221A9EB168008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../../ReactKit/ReactKit.xcodeproj"; sourceTree = ""; }; + 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetworkImage.xcodeproj; path = ../../Libraries/Image/RCTNetworkImage.xcodeproj; sourceTree = SOURCE_ROOT; }; + 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = SOURCE_ROOT; }; + 587651221A9EB168008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = SOURCE_ROOT; }; 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTDataManager.xcodeproj; path = ../../Libraries/Network/RCTDataManager.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ @@ -88,16 +88,53 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 1316A21A1AA397CA00C0188E /* libRCTNetworkImage.a in Frameworks */, + 1316A21B1AA397CA00C0188E /* libRCTText.a in Frameworks */, + 1316A21C1AA397CA00C0188E /* libReactKit.a in Frameworks */, 587651571A9F862F008B8F17 /* libRCTDataManager.a in Frameworks */, - 587651361A9EB175008B8F17 /* libRCTNetworkImage.a in Frameworks */, - 587651371A9EB175008B8F17 /* libRCTText.a in Frameworks */, - 587651381A9EB175008B8F17 /* libReactKit.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 1316A2031AA386C700C0188E /* Products */ = { + isa = PBXGroup; + children = ( + 1316A2081AA386C700C0188E /* libRCTText.a */, + 1316A20A1AA386C700C0188E /* RCTTextTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 1316A20B1AA3871A00C0188E /* Products */ = { + isa = PBXGroup; + children = ( + 1316A2101AA3871A00C0188E /* libRCTNetworkImage.a */, + 1316A2121AA3871A00C0188E /* RCTNetworkImageTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 1316A2131AA3875D00C0188E /* Products */ = { + isa = PBXGroup; + children = ( + 1316A2171AA3875D00C0188E /* libReactKit.a */, + ); + name = Products; + sourceTree = ""; + }; + 1316A21D1AA397F400C0188E /* Libraries */ = { + isa = PBXGroup; + children = ( + 587651221A9EB168008B8F17 /* ReactKit.xcodeproj */, + 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */, + 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */, + 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */, + ); + name = Libraries; + sourceTree = ""; + }; 13B07FAE1A68108700A75B9A /* UIExplorer */ = { isa = PBXGroup; children = ( @@ -111,32 +148,6 @@ name = UIExplorer; sourceTree = ""; }; - 5876511D1A9EB168008B8F17 /* Products */ = { - isa = PBXGroup; - children = ( - 587651281A9EB168008B8F17 /* libRCTNetworkImage.a */, - 5876512A1A9EB168008B8F17 /* RCTNetworkImageTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 587651201A9EB168008B8F17 /* Products */ = { - isa = PBXGroup; - children = ( - 587651301A9EB168008B8F17 /* libRCTText.a */, - 587651321A9EB168008B8F17 /* RCTTextTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 587651231A9EB168008B8F17 /* Products */ = { - isa = PBXGroup; - children = ( - 587651351A9EB168008B8F17 /* libReactKit.a */, - ); - name = Products; - sourceTree = ""; - }; 5876514A1A9F8619008B8F17 /* Products */ = { isa = PBXGroup; children = ( @@ -150,10 +161,7 @@ isa = PBXGroup; children = ( 13B07FAE1A68108700A75B9A /* UIExplorer */, - 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */, - 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */, - 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */, - 587651221A9EB168008B8F17 /* ReactKit.xcodeproj */, + 1316A21D1AA397F400C0188E /* Libraries */, 83CBBA001A601CBA00E9B192 /* Products */, ); sourceTree = ""; @@ -212,15 +220,15 @@ ProjectRef = 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */; }, { - ProductGroup = 5876511D1A9EB168008B8F17 /* Products */; + ProductGroup = 1316A20B1AA3871A00C0188E /* Products */; ProjectRef = 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */; }, { - ProductGroup = 587651201A9EB168008B8F17 /* Products */; + ProductGroup = 1316A2031AA386C700C0188E /* Products */; ProjectRef = 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */; }, { - ProductGroup = 587651231A9EB168008B8F17 /* Products */; + ProductGroup = 1316A2131AA3875D00C0188E /* Products */; ProjectRef = 587651221A9EB168008B8F17 /* ReactKit.xcodeproj */; }, ); @@ -232,39 +240,39 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 587651281A9EB168008B8F17 /* libRCTNetworkImage.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTNetworkImage.a; - remoteRef = 587651271A9EB168008B8F17 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 5876512A1A9EB168008B8F17 /* RCTNetworkImageTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = RCTNetworkImageTests.xctest; - remoteRef = 587651291A9EB168008B8F17 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 587651301A9EB168008B8F17 /* libRCTText.a */ = { + 1316A2081AA386C700C0188E /* libRCTText.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libRCTText.a; - remoteRef = 5876512F1A9EB168008B8F17 /* PBXContainerItemProxy */; + remoteRef = 1316A2071AA386C700C0188E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 587651321A9EB168008B8F17 /* RCTTextTests.xctest */ = { + 1316A20A1AA386C700C0188E /* RCTTextTests.xctest */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; path = RCTTextTests.xctest; - remoteRef = 587651311A9EB168008B8F17 /* PBXContainerItemProxy */; + remoteRef = 1316A2091AA386C700C0188E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 587651351A9EB168008B8F17 /* libReactKit.a */ = { + 1316A2101AA3871A00C0188E /* libRCTNetworkImage.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTNetworkImage.a; + remoteRef = 1316A20F1AA3871A00C0188E /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1316A2121AA3871A00C0188E /* RCTNetworkImageTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = RCTNetworkImageTests.xctest; + remoteRef = 1316A2111AA3871A00C0188E /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1316A2171AA3875D00C0188E /* libReactKit.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libReactKit.a; - remoteRef = 587651341A9EB168008B8F17 /* PBXContainerItemProxy */; + remoteRef = 1316A2161AA3875D00C0188E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; 5876514F1A9F8619008B8F17 /* libRCTDataManager.a */ = { diff --git a/Examples/UIExplorer/UIExplorerList.js b/Examples/UIExplorer/UIExplorerList.js index 56734c70f..f6d55db36 100644 --- a/Examples/UIExplorer/UIExplorerList.js +++ b/Examples/UIExplorer/UIExplorerList.js @@ -31,6 +31,7 @@ var EXAMPLES = [ require('./TouchableExample'), require('./ActivityIndicatorExample'), require('./ScrollViewExample'), + require('./GeoLocationExample'), ]; var UIExplorerList = React.createClass({ diff --git a/Libraries/Components/Navigation/NavigatorIOS.ios.js b/Libraries/Components/Navigation/NavigatorIOS.ios.js index efd983203..527b10bd2 100644 --- a/Libraries/Components/Navigation/NavigatorIOS.ios.js +++ b/Libraries/Components/Navigation/NavigatorIOS.ios.js @@ -8,7 +8,7 @@ var EventEmitter = require('EventEmitter'); var React = require('React'); var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); -var { RKUIManager } = require('NativeModules'); +var { RKNavigatorManager } = require('NativeModules'); var StyleSheet = require('StyleSheet'); var StaticContainer = require('StaticContainer.react'); var View = require('View'); @@ -127,7 +127,7 @@ var RKNavigatorItem = createReactIOSNativeComponentClass({ var NavigatorTransitionerIOS = React.createClass({ requestSchedulingNavigation: function(cb) { - RKUIManager.requestSchedulingJavaScriptNavigation( + RKNavigatorManager.requestSchedulingJavaScriptNavigation( this.getNodeHandle(), logError, cb diff --git a/Libraries/Components/TextInput/TextInput.ios.js b/Libraries/Components/TextInput/TextInput.ios.js index fef9c16f0..e5980de39 100644 --- a/Libraries/Components/TextInput/TextInput.ios.js +++ b/Libraries/Components/TextInput/TextInput.ios.js @@ -5,7 +5,6 @@ */ 'use strict'; -var DocumentSelectionState = require('DocumentSelectionState'); var EventEmitter = require('EventEmitter'); var NativeMethodsMixin = require('NativeMethodsMixin'); var NativeModulesDeprecated = require('NativeModulesDeprecated'); @@ -181,7 +180,7 @@ var TextInput = React.createClass({ * See DocumentSelectionState.js, some state that is responsible for * maintaining selection information for a document */ - selectionState: PropTypes.instanceOf(DocumentSelectionState), +// selectionState: PropTypes.instanceOf(DocumentSelectionState), /** * The default value for the text input */ diff --git a/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/Libraries/Components/Touchable/TouchableWithoutFeedback.js index 74fbf43a1..ebabdd9cc 100644 --- a/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -9,7 +9,6 @@ var React = require('React'); var Touchable = require('Touchable'); var TouchableFeedbackPropType = require('TouchableFeedbackPropType'); -var copyProperties = require('copyProperties'); var onlyChild = require('onlyChild'); /** @@ -66,7 +65,7 @@ var TouchableWithoutFeedback = React.createClass({ render: function() { // Note(vjeux): use cloneWithProps once React has been upgraded var child = onlyChild(this.props.children); - copyProperties(child.props, { + Object.assign(child.props, { accessible: true, testID: this.props.testID, onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder, diff --git a/Libraries/GeoLocation/GeoLocation.js b/Libraries/GeoLocation/GeoLocation.js new file mode 100644 index 000000000..9a7f792c4 --- /dev/null +++ b/Libraries/GeoLocation/GeoLocation.js @@ -0,0 +1,98 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule GeoLocation + */ +'use strict'; + +var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); +var RCTLocationObserver = require('NativeModules').RKLocationObserver; + +var invariant = require('invariant'); +var logError = require('logError'); +var warning = require('warning'); + +var subscriptions = []; + +var updatesEnabled = false; + +var ensureObserving = function() { + if (!updatesEnabled) { + RCTLocationObserver.startObserving(); + updatesEnabled = true; + } +}; + +/** + * /!\ ATTENTION /!\ + * You need to add NSLocationWhenInUseUsageDescription key + * in Info.plist to enable geolocation, otherwise it's going + * to *fail silently*! + * \!/ \!/ + * + * GeoLocation follows the MDN specification: + * https://developer.mozilla.org/en-US/docs/Web/API/Geolocation + */ +class GeoLocation { + static getCurrentPosition(geo_success, geo_error, geo_options) { + invariant( + typeof geo_success === 'function', + 'Must provide a valid geo_success callback.' + ); + if (geo_options) { + warning('geo_options are not yet supported.'); + } + ensureObserving(); + RCTLocationObserver.getCurrentPosition( + geo_success, + geo_error || logError + ); + } + static watchPosition(callback) { + ensureObserving(); + var watchID = subscriptions.length; + subscriptions.push( + RCTDeviceEventEmitter.addListener( + 'geoLocationDidChange', + callback + ) + ); + return watchID; + } + static clearWatch(watchID) { + var sub = subscriptions[watchID]; + if (!sub) { + // Silently exit when the watchID is invalid or already cleared + // This is consistent with timers + return; + } + sub.remove(); + subscriptions[watchID] = undefined; + var noWatchers = true; + for (var ii = 0; ii < subscriptions.length; ii++) { + if (subscriptions[ii]) { + noWatchers = false; // still valid subscriptions + } + } + if (noWatchers) { + GeoLocation.stopObserving(); + } + } + static stopObserving() { + if (updatesEnabled) { + RCTLocationObserver.stopObserving(); + updatesEnabled = false; + for (var ii = 0; ii < subscriptions.length; ii++) { + if (subscriptions[ii]) { + warning('Called stopObserving with existing subscriptions.'); + subscriptions[ii].remove(); + } + } + subscriptions = []; + } else { + warning('Tried to stop observing when not observing.'); + } + } +} + +module.exports = GeoLocation; diff --git a/Libraries/Image/RCTNetworkImageView.h b/Libraries/Image/RCTNetworkImageView.h index c99ed0689..920bf705c 100644 --- a/Libraries/Image/RCTNetworkImageView.h +++ b/Libraries/Image/RCTNetworkImageView.h @@ -6,7 +6,8 @@ @interface RCTNetworkImageView : UIView -- (instancetype)initWithFrame:(CGRect)frame imageDownloader:(RCTImageDownloader *)imageDownloader; +- (instancetype)initWithFrame:(CGRect)frame + imageDownloader:(RCTImageDownloader *)imageDownloader NS_DESIGNATED_INITIALIZER; /** * An image that will appear while the view is loading the image from the network, diff --git a/Libraries/Image/RCTNetworkImageView.m b/Libraries/Image/RCTNetworkImageView.m index c0c6443cb..027fbf500 100644 --- a/Libraries/Image/RCTNetworkImageView.m +++ b/Libraries/Image/RCTNetworkImageView.m @@ -27,11 +27,6 @@ return self; } -- (instancetype)initWithFrame:(CGRect)frame -{ - RCT_NOT_DESIGNATED_INITIALIZER(); -} - - (NSURL *)imageURL { // We clear our backing layer's imageURL when we are not in a window for a while, diff --git a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js index b529460ee..883a85e03 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js +++ b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js @@ -139,9 +139,15 @@ function setupXHR() { GLOBAL.fetch = require('fetch'); } +function setupGeolocation() { + GLOBAL.navigator = GLOBAL.navigator || {}; + GLOBAL.navigator.geolocation = require('GeoLocation'); +} + setupRedBoxErrorHandler(); setupDocumentShim(); setupTimers(); setupAlert(); setupPromise(); setupXHR(); +setupGeolocation(); diff --git a/Libraries/Network/RCTDataManager.m b/Libraries/Network/RCTDataManager.m index 22872fa91..4ffe5f975 100644 --- a/Libraries/Network/RCTDataManager.m +++ b/Libraries/Network/RCTDataManager.m @@ -65,8 +65,7 @@ } else { - RCTLogMustFix(@"unsupported query type %@", queryType); - return; + RCTLogError(@"unsupported query type %@", queryType); } } diff --git a/Libraries/Network/RCTDataManager.xcodeproj/project.pbxproj b/Libraries/Network/RCTDataManager.xcodeproj/project.pbxproj index b7cfed2a2..328a3d60c 100644 --- a/Libraries/Network/RCTDataManager.xcodeproj/project.pbxproj +++ b/Libraries/Network/RCTDataManager.xcodeproj/project.pbxproj @@ -269,6 +269,10 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../ReactKit/**", ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "/Users/nicklockwood/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/ReactKit/build/Debug-iphoneos", + ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -283,6 +287,10 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../ReactKit/**", ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "/Users/nicklockwood/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/ReactKit/build/Debug-iphoneos", + ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; diff --git a/Libraries/Text/RCTTextManager.m b/Libraries/Text/RCTTextManager.m index fe1ca6820..ffe0d8b1e 100644 --- a/Libraries/Text/RCTTextManager.m +++ b/Libraries/Text/RCTTextManager.m @@ -24,17 +24,7 @@ } RCT_REMAP_VIEW_PROPERTY(containerBackgroundColor, backgroundColor) - -- (void)set_textAlign:(id)json - forShadowView:(RCTShadowText *)shadowView - withDefaultView:(RCTShadowText *)defaultView -{ - shadowView.textAlign = json ? [RCTConvert NSTextAlignment:json] : defaultView.textAlign; -} - -- (void)set_numberOfLines:(id)json - forView:(RCTText *)view - withDefaultView:(RCTText *)defaultView +RCT_CUSTOM_VIEW_PROPERTY(numberOfLines, RCTText *) { NSLineBreakMode truncationMode = NSLineBreakByClipping; view.numberOfLines = json ? [RCTConvert NSInteger:json] : defaultView.numberOfLines; @@ -44,31 +34,33 @@ RCT_REMAP_VIEW_PROPERTY(containerBackgroundColor, backgroundColor) view.lineBreakMode = truncationMode; } -- (void)set_numberOfLines:(id)json - forShadowView:(RCTShadowText *)shadowView - withDefaultView:(RCTShadowText *)defaultView +RCT_CUSTOM_SHADOW_PROPERTY(backgroundColor, RCTShadowText *) +{ + view.textBackgroundColor = json ? [RCTConvert UIColor:json] : defaultView.textBackgroundColor; +} +RCT_CUSTOM_SHADOW_PROPERTY(containerBackgroundColor, RCTShadowText *) +{ + view.backgroundColor = json ? [RCTConvert UIColor:json] : defaultView.backgroundColor; + view.isBGColorExplicitlySet = json ? YES : defaultView.isBGColorExplicitlySet; +} +RCT_CUSTOM_SHADOW_PROPERTY(numberOfLines, RCTShadowText *) { NSLineBreakMode truncationMode = NSLineBreakByClipping; - shadowView.maxNumberOfLines = json ? [RCTConvert NSInteger:json] : defaultView.maxNumberOfLines; - if (shadowView.maxNumberOfLines > 0) { + view.maxNumberOfLines = json ? [RCTConvert NSInteger:json] : defaultView.maxNumberOfLines; + if (view.maxNumberOfLines > 0) { truncationMode = NSLineBreakByTruncatingTail; } - shadowView.truncationMode = truncationMode; + view.truncationMode = truncationMode; +} +RCT_CUSTOM_SHADOW_PROPERTY(textAlign, RCTShadowText *) +{ + view.textAlign = json ? [RCTConvert NSTextAlignment:json] : defaultView.textAlign; } -- (void)set_backgroundColor:(id)json - forShadowView:(RCTShadowText *)shadowView - withDefaultView:(RCTShadowText *)defaultView +- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowText *)shadowView { - shadowView.textBackgroundColor = json ? [RCTConvert UIColor:json] : defaultView.textBackgroundColor; -} - -- (void)set_containerBackgroundColor:(id)json - forShadowView:(RCTShadowText *)shadowView - withDefaultView:(RCTShadowText *)defaultView -{ - shadowView.backgroundColor = json ? [RCTConvert UIColor:json] : defaultView.backgroundColor; - shadowView.isBGColorExplicitlySet = json ? YES : defaultView.isBGColorExplicitlySet; + //TODO: This could be a cleaner replacement for uiBlockToAmendWithShadowViewRegistry + return nil; } // TODO: the purpose of this block is effectively just to copy properties from the shadow views diff --git a/Libraries/Utilities/Dimensions.js b/Libraries/Utilities/Dimensions.js index 81621fd61..97e8d2d01 100644 --- a/Libraries/Utilities/Dimensions.js +++ b/Libraries/Utilities/Dimensions.js @@ -8,7 +8,6 @@ var NativeModules = require('NativeModules'); var invariant = require('invariant'); -var mergeInto = require('mergeInto'); var dimensions = NativeModules.RKUIManager.Dimensions; @@ -19,7 +18,7 @@ class Dimensions { * @param {object} dims Simple string-keyed object of dimensions to set */ static set(dims) { - mergeInto(dimensions, dims); + Object.assign(dimensions, dims); return true; } diff --git a/Libraries/vendor/core/merge.js b/Libraries/vendor/core/merge.js new file mode 100644 index 000000000..800c08c1b --- /dev/null +++ b/Libraries/vendor/core/merge.js @@ -0,0 +1,50 @@ +/** + * @generated SignedSource<<0e3063b19e14ed191102b1dffe45551f>> + * + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * !! This file is a check-in of a static_upstream project! !! + * !! !! + * !! You should not modify this file directly. Instead: !! + * !! 1) Use `fjs use-upstream` to temporarily replace this with !! + * !! the latest version from upstream. !! + * !! 2) Make your changes, test them, etc. !! + * !! 3) Use `fjs push-upstream` to copy your changes back to !! + * !! static_upstream. !! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * + * Copyright 2013-2014 Facebook, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @providesModule merge + */ + +"use strict"; + +var mergeInto = require('mergeInto'); + +/** + * Shallow merges two structures into a return value, without mutating either. + * + * @param {?object} one Optional object with properties to merge from. + * @param {?object} two Optional object with properties to merge from. + * @return {object} The shallow extension of one by two. + */ +var merge = function(one, two) { + var result = {}; + mergeInto(result, one); + mergeInto(result, two); + return result; +}; + +module.exports = merge; diff --git a/Libraries/vendor/core/mergeInto.js b/Libraries/vendor/core/mergeInto.js new file mode 100644 index 000000000..0da86a50c --- /dev/null +++ b/Libraries/vendor/core/mergeInto.js @@ -0,0 +1,59 @@ +/** + * @generated SignedSource<> + * + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * !! This file is a check-in of a static_upstream project! !! + * !! !! + * !! You should not modify this file directly. Instead: !! + * !! 1) Use `fjs use-upstream` to temporarily replace this with !! + * !! the latest version from upstream. !! + * !! 2) Make your changes, test them, etc. !! + * !! 3) Use `fjs push-upstream` to copy your changes back to !! + * !! static_upstream. !! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * + * Copyright 2013-2014 Facebook, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @providesModule mergeInto + * @typechecks static-only + */ + +"use strict"; + +var mergeHelpers = require('mergeHelpers'); + +var checkMergeObjectArg = mergeHelpers.checkMergeObjectArg; +var checkMergeIntoObjectArg = mergeHelpers.checkMergeIntoObjectArg; + +/** + * Shallow merges two structures by mutating the first parameter. + * + * @param {object|function} one Object to be merged into. + * @param {?object} two Optional object with properties to merge from. + */ +function mergeInto(one, two) { + checkMergeIntoObjectArg(one); + if (two != null) { + checkMergeObjectArg(two); + for (var key in two) { + if (!two.hasOwnProperty(key)) { + continue; + } + one[key] = two[key]; + } + } +} + +module.exports = mergeInto; diff --git a/ReactKit/Base/RCTBridge.h b/ReactKit/Base/RCTBridge.h index 9a890a07a..4dcaee8e2 100644 --- a/ReactKit/Base/RCTBridge.h +++ b/ReactKit/Base/RCTBridge.h @@ -6,32 +6,16 @@ @class RCTBridge; @class RCTEventDispatcher; -@class RCTRootView; - -/** - * Utilities for constructing common response objects. When sending a - * systemError back to JS, it's important to describe whether or not it was a - * system error, or API usage error. System errors should never happen and are - * therefore logged using `RCTLogError()`. API usage errors are expected if the - * API is misused and will therefore not be logged using `RCTLogError()`. The JS - * application code is expected to handle them. Regardless of type, each error - * should be logged at most once. - */ -static inline NSDictionary *RCTSystemErrorObject(NSString *msg) -{ - return @{@"systemError": msg ?: @""}; -} - -static inline NSDictionary *RCTAPIErrorObject(NSString *msg) -{ - return @{@"apiError": msg ?: @""}; -} /** * This block can be used to instantiate modules that require additional * init parameters, or additional configuration prior to being used. + * The bridge will call this block to instatiate the modules, and will + * be responsible for invalidating/releasing them when the bridge is destroyed. + * For this reason, the block should always return new module instances, and + * module instances should not be shared between bridges. */ -typedef NSArray *(^RCTBridgeModuleProviderBlock)(RCTBridge *bridge); +typedef NSArray *(^RCTBridgeModuleProviderBlock)(void); /** * Async batched bridge used to communicate with the JavaScript application. @@ -42,12 +26,12 @@ typedef NSArray *(^RCTBridgeModuleProviderBlock)(RCTBridge *bridge); * The designated initializer. This creates a new bridge on top of the specified * executor. The bridge should then be used for all subsequent communication * with the JavaScript code running in the executor. Modules will be automatically - * instantiated using the default contructor, but you can optionally pass in a - * module provider block to manually instantiate modules that require additional - * init parameters or configuration. + * instantiated using the default contructor, but you can optionally pass in an + * array of pre-initialized module instances if they require additional init + * parameters or configuration. */ -- (instancetype)initWithJavaScriptExecutor:(id)javaScriptExecutor - moduleProvider:(RCTBridgeModuleProviderBlock)block NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithExecutor:(id)executor + moduleProvider:(RCTBridgeModuleProviderBlock)block NS_DESIGNATED_INITIALIZER; /** * This method is used to call functions in the JavaScript application context. @@ -81,16 +65,6 @@ typedef NSArray *(^RCTBridgeModuleProviderBlock)(RCTBridge *bridge); */ @property (nonatomic, readonly) dispatch_queue_t shadowQueue; -// For use in implementing delegates, which may need to queue responses. -- (RCTResponseSenderBlock)createResponseSenderBlock:(NSInteger)callbackID; - -/** - * Register a root view with the bridge. Theorectically, a single bridge can - * support multiple root views, however this feature is not currently exposed - * and may eventually be removed. - */ -- (void)registerRootView:(RCTRootView *)rootView; - /** * Global logging function that will print to both xcode and JS debugger consoles. * diff --git a/ReactKit/Base/RCTBridge.m b/ReactKit/Base/RCTBridge.m index 97a5dc12e..5173bc5d2 100644 --- a/ReactKit/Base/RCTBridge.m +++ b/ReactKit/Base/RCTBridge.m @@ -3,11 +3,12 @@ #import "RCTBridge.h" #import -#import -#import #import #import +#import +#import + #import "RCTConvert.h" #import "RCTEventDispatcher.h" #import "RCTLog.h" @@ -26,60 +27,6 @@ typedef NS_ENUM(NSUInteger, RCTBridgeFields) { RCTBridgeFieldFlushDateMillis }; -/** - * This private class is used as a container for exported method info - */ -@interface RCTModuleMethod : NSObject - -@property (readonly, nonatomic, assign) SEL selector; -@property (readonly, nonatomic, copy) NSString *JSMethodName; -@property (readonly, nonatomic, assign) NSUInteger arity; -@property (readonly, nonatomic, copy) NSIndexSet *blockArgumentIndexes; - -@end - -@implementation RCTModuleMethod - -- (instancetype)initWithSelector:(SEL)selector - JSMethodName:(NSString *)JSMethodName - arity:(NSUInteger)arity - blockArgumentIndexes:(NSIndexSet *)blockArgumentIndexes -{ - if ((self = [super init])) { - _selector = selector; - _JSMethodName = [JSMethodName copy]; - _arity = arity; - _blockArgumentIndexes = [blockArgumentIndexes copy]; - } - return self; -} - -- (NSString *)description -{ - NSString *blocks = @"no block args"; - if (self.blockArgumentIndexes.count > 0) { - NSMutableString *indexString = [NSMutableString string]; - [self.blockArgumentIndexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) { - [indexString appendFormat:@", %tu", idx]; - }]; - blocks = [NSString stringWithFormat:@"block args at %@", [indexString substringFromIndex:2]]; - } - - return [NSString stringWithFormat:@"<%@: %p; exports -%@ as %@; %@>", NSStringFromClass(self.class), self, NSStringFromSelector(self.selector), self.JSMethodName, blocks]; -} - -@end - -#ifdef __LP64__ -typedef uint64_t RCTExportValue; -typedef struct section_64 RCTExportSection; -#define RCTGetSectByNameFromHeader getsectbynamefromheader_64 -#else -typedef uint32_t RCTExportValue; -typedef struct section RCTExportSection; -#define RCTGetSectByNameFromHeader getsectbynamefromheader -#endif - /** * This function returns the module name for a given class. */ @@ -88,18 +35,6 @@ static NSString *RCTModuleNameForClass(Class cls) return [cls respondsToSelector:@selector(moduleName)] ? [cls moduleName] : NSStringFromClass(cls); } -/** - * This function instantiates a new module instance. - */ -static id RCTCreateModuleInstance(Class cls, RCTBridge *bridge) -{ - if ([cls instancesRespondToSelector:@selector(initWithBridge:)]) { - return [[cls alloc] initWithBridge:bridge]; - } else { - return [[cls alloc] init]; - } -} - /** * This function scans all classes available at runtime and returns an array * of all JSMethods registered. @@ -111,22 +46,11 @@ static NSArray *RCTJSMethods(void) dispatch_once(&onceToken, ^{ NSMutableSet *uniqueMethods = [NSMutableSet set]; - unsigned int classCount; - Class *classes = objc_copyClassList(&classCount); - for (unsigned int i = 0; i < classCount; i++) { - - Class cls = classes[i]; - - if (!class_getSuperclass(cls)) { - // Class has no superclass - it's probably something weird - continue; - } - + RCTEnumerateClasses(^(__unsafe_unretained Class cls) { if (RCTClassOverridesClassMethod(cls, @selector(JSMethods))) { [uniqueMethods addObjectsFromArray:[cls JSMethods]]; } - } - free(classes); + }); JSMethods = [uniqueMethods allObjects]; }); @@ -147,38 +71,216 @@ static NSArray *RCTBridgeModuleClassesByModuleID(void) modules = [NSMutableArray array]; RCTModuleNamesByID = [NSMutableArray array]; - unsigned int classCount; - Class *classes = objc_copyClassList(&classCount); - for (unsigned int i = 0; i < classCount; i++) { + RCTEnumerateClasses(^(__unsafe_unretained Class cls) { + if ([cls conformsToProtocol:@protocol(RCTBridgeModule)]) { - Class cls = classes[i]; + // Add module + [(NSMutableArray *)modules addObject:cls]; - if (!class_getSuperclass(cls)) { - // Class has no superclass - it's probably something weird - continue; + // Add module name + NSString *moduleName = RCTModuleNameForClass(cls); + [(NSMutableArray *)RCTModuleNamesByID addObject:moduleName]; } - - if (![cls conformsToProtocol:@protocol(RCTBridgeModule)]) { - // Not an RCTBridgeModule - continue; - } - - // Add module - [(NSMutableArray *)modules addObject:cls]; - - // Add module name - NSString *moduleName = RCTModuleNameForClass(cls); - [(NSMutableArray *)RCTModuleNamesByID addObject:moduleName]; - } - free(classes); + }); modules = [modules copy]; RCTModuleNamesByID = [RCTModuleNamesByID copy]; }); - + return modules; } +@interface RCTBridge () + +- (void)_invokeAndProcessModule:(NSString *)module + method:(NSString *)method + arguments:(NSArray *)args; + +@end + +/** + * This private class is used as a container for exported method info + */ +@interface RCTModuleMethod : NSObject + +@property (nonatomic, copy, readonly) NSString *moduleClassName; +@property (nonatomic, copy, readonly) NSString *JSMethodName; + +@end + +@implementation RCTModuleMethod +{ + BOOL _isClassMethod; + Class _moduleClass; + SEL _selector; + NSMethodSignature *_methodSignature; + NSArray *_argumentBlocks; + NSString *_methodName; +} + +- (instancetype)initWithMethodName:(NSString *)methodName + JSMethodName:(NSString *)JSMethodName +{ + if ((self = [super init])) { + + _methodName = methodName; + NSArray *parts = [[methodName substringWithRange:NSMakeRange(2, methodName.length - 3)] componentsSeparatedByString:@" "]; + + // Parse class and method + _moduleClassName = parts[0]; + NSRange categoryRange = [_moduleClassName rangeOfString:@"("]; + if (categoryRange.length) + { + _moduleClassName = [_moduleClassName substringToIndex:categoryRange.location]; + } + + // Extract class and method details + _isClassMethod = [methodName characterAtIndex:0] == '+'; + _moduleClass = NSClassFromString(_moduleClassName); + _selector = NSSelectorFromString(parts[1]); + _JSMethodName = JSMethodName ?: [NSStringFromSelector(_selector) componentsSeparatedByString:@":"][0]; + +#if DEBUG + + // Sanity check + RCTAssert([_moduleClass conformsToProtocol:@protocol(RCTBridgeModule)], + @"You are attempting to export the method %@, but %@ does not \ + conform to the RCTBridgeModule Protocol", methodName, _moduleClassName); +#endif + + // Get method signature + _methodSignature = _isClassMethod ? + [_moduleClass methodSignatureForSelector:_selector] : + [_moduleClass instanceMethodSignatureForSelector:_selector]; + + // Process arguments + NSUInteger numberOfArguments = _methodSignature.numberOfArguments; + NSMutableArray *argumentBlocks = [[NSMutableArray alloc] initWithCapacity:numberOfArguments - 2]; + for (NSUInteger i = 2; i < numberOfArguments; i++) { + const char *argumentType = [_methodSignature getArgumentTypeAtIndex:i]; + switch (argumentType[0]) { + +#define RCT_ARG_BLOCK(_logic) \ + [argumentBlocks addObject:^(RCTBridge *bridge, NSInvocation *invocation, NSUInteger index, id json) { \ + _logic \ + [invocation setArgument:&value atIndex:index]; \ + }]; \ + +#define RCT_CASE(_value, _class, _logic) \ + case _value: { \ + RCT_ARG_BLOCK( \ + if (json && ![json isKindOfClass:[_class class]]) { \ + RCTLogError(@"Argument %tu (%@) of %@.%@ should be of type %@", index, \ + json, RCTModuleNameForClass(_moduleClass), _JSMethodName, [_class class]); \ + return; \ + } \ + _logic \ + ) \ + break; \ + } + + RCT_CASE(':', NSString, SEL value = NSSelectorFromString(json); ); + RCT_CASE('*', NSString, const char *value = [json UTF8String]; ); + +#define RCT_SIMPLE_CASE(_value, _type, _selector) \ + case _value: { \ + RCT_ARG_BLOCK( \ + if (json && ![json respondsToSelector:@selector(_selector)]) { \ + RCTLogError(@"Argument %tu (%@) of %@.%@ does not respond to selector: %@", \ + index, json, RCTModuleNameForClass(_moduleClass), _JSMethodName, @#_selector); \ + return; \ + } \ + _type value = [json _selector]; \ + ) \ + break; \ + } + + RCT_SIMPLE_CASE('c', char, charValue) + RCT_SIMPLE_CASE('C', unsigned char, unsignedCharValue) + RCT_SIMPLE_CASE('s', short, shortValue) + RCT_SIMPLE_CASE('S', unsigned short, unsignedShortValue) + RCT_SIMPLE_CASE('i', int, intValue) + RCT_SIMPLE_CASE('I', unsigned int, unsignedIntValue) + RCT_SIMPLE_CASE('l', long, longValue) + RCT_SIMPLE_CASE('L', unsigned long, unsignedLongValue) + RCT_SIMPLE_CASE('q', long long, longLongValue) + RCT_SIMPLE_CASE('Q', unsigned long long, unsignedLongLongValue) + RCT_SIMPLE_CASE('f', float, floatValue) + RCT_SIMPLE_CASE('d', double, doubleValue) + RCT_SIMPLE_CASE('B', BOOL, boolValue) + + default: { + static const char *blockType = @encode(typeof(^{})); + if (!strcmp(argumentType, blockType)) { + RCT_ARG_BLOCK( + if (json && ![json isKindOfClass:[NSNumber class]]) { + RCTLogError(@"Argument %tu (%@) of %@.%@ should be a number", index, + json, RCTModuleNameForClass(_moduleClass), _JSMethodName); + return; + } + // Marked as autoreleasing, because NSInvocation doesn't retain arguments + __autoreleasing id value = (json ? ^(NSArray *args) { + [bridge _invokeAndProcessModule:@"BatchedBridge" + method:@"invokeCallbackAndReturnFlushedQueue" + arguments:@[json, args]]; + } : ^(NSArray *unused) {}); + ) + } else { + RCT_ARG_BLOCK( id value = json; ) + } + break; + } + } + } + _argumentBlocks = [argumentBlocks copy]; + } + return self; +} + +- (void)invokeWithBridge:(RCTBridge *)bridge + module:(id)module + arguments:(NSArray *)arguments +{ + +#if DEBUG + + // Sanity check + RCTAssert([module class] == _moduleClass, @"Attempted to invoke method \ + %@ on a module of class %@", _methodName, [module class]); +#endif + + // Safety check + if (arguments.count != _argumentBlocks.count) { + RCTLogError(@"%@.%@ was called with %zd arguments, but expects %zd", + RCTModuleNameForClass(_moduleClass), _JSMethodName, + arguments.count, _argumentBlocks.count); + return; + } + + // Create invocation (we can't re-use this as it wouldn't be thread-safe) + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:_methodSignature]; + [invocation setArgument:&_selector atIndex:1]; + + // Set arguments + NSUInteger index = 0; + for (id json in arguments) { + id arg = (json == [NSNull null]) ? nil : json; + void (^block)(RCTBridge *, NSInvocation *, NSUInteger, id) = _argumentBlocks[index]; + block(bridge, invocation, index + 2, arg); + index ++; + } + + // Invoke method + [invocation invokeWithTarget:_isClassMethod ? [module class] : module]; +} + +- (NSString *)description +{ + return [NSString stringWithFormat:@"<%@: %p; exports %@ as %@;>", NSStringFromClass(self.class), self, _methodName, _JSMethodName]; +} + +@end + /** * This function parses the exported methods inside RCTBridgeModules and * generates an array of arrays of RCTModuleMethod objects, keyed @@ -193,6 +295,16 @@ static RCTSparseArray *RCTExportedMethodsByModuleID(void) Dl_info info; dladdr(&RCTExportedMethodsByModuleID, &info); +#ifdef __LP64__ + typedef uint64_t RCTExportValue; + typedef struct section_64 RCTExportSection; +#define RCTGetSectByNameFromHeader getsectbynamefromheader_64 +#else + typedef uint32_t RCTExportValue; + typedef struct section RCTExportSection; +#define RCTGetSectByNameFromHeader getsectbynamefromheader +#endif + const RCTExportValue mach_header = (RCTExportValue)info.dli_fbase; const RCTExportSection *section = RCTGetSectByNameFromHeader((void *)mach_header, "__DATA", "RCTExport"); @@ -202,53 +314,23 @@ static RCTSparseArray *RCTExportedMethodsByModuleID(void) NSArray *classes = RCTBridgeModuleClassesByModuleID(); NSMutableDictionary *methodsByModuleClassName = [NSMutableDictionary dictionaryWithCapacity:[classes count]]; - NSCharacterSet *plusMinusCharacterSet = [NSCharacterSet characterSetWithCharactersInString:@"+-"]; for (RCTExportValue addr = section->offset; addr < section->offset + section->size; - addr += sizeof(id) * 2) { + addr += sizeof(const char **) * 2) { - const char **entry = (const char **)(mach_header + addr); - NSScanner *scanner = [NSScanner scannerWithString:@(entry[0])]; + // Get data entry + const char **entries = (const char **)(mach_header + addr); - NSString *plusMinus; - if (![scanner scanCharactersFromSet:plusMinusCharacterSet intoString:&plusMinus]) continue; - if (![scanner scanString:@"[" intoString:NULL]) continue; - - NSString *className; - if (![scanner scanUpToString:@" " intoString:&className]) continue; - [scanner scanString:@" " intoString:NULL]; - - NSString *selectorName; - if (![scanner scanUpToString:@"]" intoString:&selectorName]) continue; - - Class moduleClass = NSClassFromString(className); - if (moduleClass == Nil) continue; - - SEL selector = NSSelectorFromString(selectorName); - Method method = ([plusMinus characterAtIndex:0] == '+' ? class_getClassMethod : class_getInstanceMethod)(moduleClass, selector); - if (method == nil) continue; - - unsigned int argumentCount = method_getNumberOfArguments(method); - NSMutableIndexSet *blockArgumentIndexes = [NSMutableIndexSet indexSet]; - static const char *blockType = @encode(typeof(^{})); - for (unsigned int i = 2; i < argumentCount; i++) { - char *type = method_copyArgumentType(method, i); - if (!strcmp(type, blockType)) { - [blockArgumentIndexes addIndex:i - 2]; - } - free(type); - } - - NSString *JSMethodName = strlen(entry[1]) ? @(entry[1]) : [NSStringFromSelector(selector) componentsSeparatedByString:@":"][0]; + // Create method RCTModuleMethod *moduleMethod = - [[RCTModuleMethod alloc] initWithSelector:selector - JSMethodName:JSMethodName - arity:method_getNumberOfArguments(method) - 2 - blockArgumentIndexes:blockArgumentIndexes]; + [[RCTModuleMethod alloc] initWithMethodName:@(entries[0]) + JSMethodName:strlen(entries[1]) ? @(entries[1]) : nil]; - NSArray *methods = methodsByModuleClassName[className]; - methodsByModuleClassName[className] = methods ? [methods arrayByAddingObject:moduleMethod] : @[moduleMethod]; + // Cache method + NSArray *methods = methodsByModuleClassName[moduleMethod.moduleClassName]; + methodsByModuleClassName[moduleMethod.moduleClassName] = + methods ? [methods arrayByAddingObject:moduleMethod] : @[moduleMethod]; } methodsByModuleID = [[RCTSparseArray alloc] initWithCapacity:[classes count]]; @@ -256,7 +338,7 @@ static RCTSparseArray *RCTExportedMethodsByModuleID(void) methodsByModuleID[moduleID] = methodsByModuleClassName[NSStringFromClass(moduleClass)]; }]; }); - + return methodsByModuleID; } @@ -303,19 +385,12 @@ static NSDictionary *RCTRemoteModulesConfig(NSDictionary *modulesByName) @"type": @"remote", }; }]; - + NSDictionary *module = @{ @"moduleID": @(moduleID), @"methods": methodsByName }; - // Add static constants - if (RCTClassOverridesClassMethod(moduleClass, @selector(constantsToExport))) { - NSMutableDictionary *mutableModule = [module mutableCopy]; - mutableModule[@"constants"] = [moduleClass constantsToExport] ?: @{}; - module = [mutableModule copy]; - } - remoteModuleConfigByClassName[NSStringFromClass(moduleClass)] = module; }]; }); @@ -324,14 +399,15 @@ static NSDictionary *RCTRemoteModulesConfig(NSDictionary *modulesByName) NSMutableDictionary *moduleConfig = [[NSMutableDictionary alloc] init]; [modulesByName enumerateKeysAndObjectsUsingBlock:^(NSString *moduleName, id module, BOOL *stop) { - // Add "psuedo-constants" + // Add constants NSMutableDictionary *config = remoteModuleConfigByClassName[NSStringFromClass([module class])]; - if (RCTClassOverridesInstanceMethod([module class], @selector(constantsToExport))) { - NSMutableDictionary *mutableConfig = [NSMutableDictionary dictionaryWithDictionary:config]; - NSMutableDictionary *mutableConstants = [NSMutableDictionary dictionaryWithDictionary:config[@"constants"]]; - [mutableConstants addEntriesFromDictionary:[module constantsToExport]]; - mutableConfig[@"constants"] = mutableConstants; // There's no real need to copy this - config = mutableConfig; // Nor this - receiver is unlikely to mutate it + if ([module respondsToSelector:@selector(constantsToExport)]) { + NSDictionary *constants = [module constantsToExport]; + if (constants) { + NSMutableDictionary *mutableConfig = [NSMutableDictionary dictionaryWithDictionary:config]; + mutableConfig[@"constants"] = constants; // There's no real need to copy this + config = mutableConfig; // Nor this - receiver is unlikely to mutate it + } } moduleConfig[moduleName] = config; @@ -340,6 +416,7 @@ static NSDictionary *RCTRemoteModulesConfig(NSDictionary *modulesByName) return moduleConfig; } + /** * As above, but for local modules/methods, which represent JS classes * and methods that will be called by the native code via the bridge. @@ -417,21 +494,19 @@ static NSDictionary *RCTLocalModulesConfig() static id _latestJSExecutor; -- (instancetype)initWithJavaScriptExecutor:(id)javaScriptExecutor - moduleProvider:(RCTBridgeModuleProviderBlock)block +- (instancetype)initWithExecutor:(id)executor + moduleProvider:(RCTBridgeModuleProviderBlock)block { if ((self = [super init])) { - _javaScriptExecutor = javaScriptExecutor; + _javaScriptExecutor = executor; _latestJSExecutor = _javaScriptExecutor; _eventDispatcher = [[RCTEventDispatcher alloc] initWithBridge:self]; _shadowQueue = dispatch_queue_create("com.facebook.ReactKit.ShadowQueue", DISPATCH_QUEUE_SERIAL); // Register passed-in module instances NSMutableDictionary *preregisteredModules = [[NSMutableDictionary alloc] init]; - if (block) { - for (id module in block(self)) { - preregisteredModules[RCTModuleNameForClass([module class])] = module; - } + for (id module in block ? block() : nil) { + preregisteredModules[RCTModuleNameForClass([module class])] = module; } // Instantiate modules @@ -444,14 +519,14 @@ static id _latestJSExecutor; // Preregistered instances takes precedence, no questions asked if (!preregisteredModules[moduleName]) { // It's OK to have a name collision as long as the second instance is nil - RCTAssert(RCTCreateModuleInstance(moduleClass, self) == nil, + RCTAssert([[moduleClass alloc] init] == nil, @"Attempted to register RCTBridgeModule class %@ for the name '%@', \ but name was already registered by class %@", moduleClass, moduleName, [modulesByName[moduleName] class]); } } else { // Module name hasn't been used before, so go ahead and instantiate - id module = RCTCreateModuleInstance(moduleClass, self); + id module = [[moduleClass alloc] init]; if (module) { _modulesByID[moduleID] = modulesByName[moduleName] = module; } @@ -461,6 +536,13 @@ static id _latestJSExecutor; // Store modules _modulesByName = [modulesByName copy]; + // Set bridge + for (id module in _modulesByName.allValues) { + if ([module respondsToSelector:@selector(setBridge:)]) { + module.bridge = self; + } + } + // Inject module data into JS context NSString *configJSON = RCTJSONStringify(@{ @"remoteModuleConfig": RCTRemoteModulesConfig(_modulesByName), @@ -470,12 +552,12 @@ static id _latestJSExecutor; [_javaScriptExecutor injectJSONText:configJSON asGlobalObjectNamed:@"__fbBatchedBridgeConfig" callback:^(id err) { dispatch_semaphore_signal(semaphore); }]; - + if (dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC)) != 0) { RCTLogMustFix(@"JavaScriptExecutor took too long to inject JSON object"); } } - + return self; } @@ -501,23 +583,29 @@ static id _latestJSExecutor; - (void)invalidate { + // Release executor if (_latestJSExecutor == _javaScriptExecutor) { _latestJSExecutor = nil; } [_javaScriptExecutor invalidate]; _javaScriptExecutor = nil; - - dispatch_sync(_shadowQueue, ^{ + + // Wait for queued methods to finish + dispatch_sync(self.shadowQueue, ^{ // Make sure all dispatchers have been executed before continuing // TODO: is this still needed? }); - + + // Invalidate modules for (id target in _modulesByID.allObjects) { if ([target respondsToSelector:@selector(invalidate)]) { [(id)target invalidate]; } } - [_modulesByID removeAllObjects]; + + // Release modules (breaks retain cycle if module has strong bridge reference) + _modulesByID = nil; + _modulesByName = nil; } /** @@ -537,10 +625,10 @@ static id _latestJSExecutor; NSNumber *moduleID = RCTLocalModuleIDs[moduleDotMethod]; RCTAssert(moduleID != nil, @"Module '%@' not registered.", [[moduleDotMethod componentsSeparatedByString:@"."] firstObject]); - + NSNumber *methodID = RCTLocalMethodIDs[moduleDotMethod]; RCTAssert(methodID != nil, @"Method '%@' not registered.", moduleDotMethod); - + [self _invokeAndProcessModule:@"BatchedBridge" method:@"callFunctionReturnFlushedQueue" arguments:@[moduleID, methodID, args ?: @[]]]; @@ -554,12 +642,12 @@ static id _latestJSExecutor; onComplete(scriptLoadError); return; } - + [_javaScriptExecutor executeJSCall:@"BatchedBridge" method:@"flushedQueue" arguments:@[] - callback:^(id objcValue, NSError *error) { - [self _handleBuffer:objcValue]; + callback:^(id json, NSError *error) { + [self _handleBuffer:json]; onComplete(error); }]; }]; @@ -570,35 +658,28 @@ static id _latestJSExecutor; - (void)_invokeAndProcessModule:(NSString *)module method:(NSString *)method arguments:(NSArray *)args { NSTimeInterval startJS = RCTTGetAbsoluteTime(); - - RCTJavaScriptCallback processResponse = ^(id objcValue, NSError *error) { + + RCTJavaScriptCallback processResponse = ^(id json, NSError *error) { NSTimeInterval startNative = RCTTGetAbsoluteTime(); - [self _handleBuffer:objcValue]; - + [self _handleBuffer:json]; + NSTimeInterval end = RCTTGetAbsoluteTime(); NSTimeInterval timeJS = startNative - startJS; NSTimeInterval timeNative = end - startNative; - + // TODO: surface this performance information somewhere - [[NSNotificationCenter defaultCenter] postNotificationName:@"PERF" object:nil userInfo:@{@"JS": @(timeJS * 1000000), @"Native": @(timeNative * 1000000)}]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"PERF" object:nil userInfo:@{ + @"JS": @(timeJS * 1000000), + @"Native": @(timeNative * 1000000) + }]; }; - + [_javaScriptExecutor executeJSCall:module method:method arguments:args callback:processResponse]; } -/** - * TODO (#5906496): Have responses piggy backed on a round trip with ObjC->JS requests. - */ -- (void)_sendResponseToJavaScriptCallbackID:(NSInteger)cbID args:(NSArray *)args -{ - [self _invokeAndProcessModule:@"BatchedBridge" - method:@"invokeCallbackAndReturnFlushedQueue" - arguments:@[@(cbID), args]]; -} - #pragma mark - Payload Processing - (void)_handleBuffer:(id)buffer @@ -606,12 +687,12 @@ static id _latestJSExecutor; if (buffer == nil || buffer == (id)kCFNull) { return; } - + if (![buffer isKindOfClass:[NSArray class]]) { RCTLogError(@"Buffer must be an instance of NSArray, got %@", NSStringFromClass([buffer class])); return; } - + NSArray *requestsArray = (NSArray *)buffer; NSUInteger bufferRowCount = [requestsArray count]; NSUInteger expectedFieldsCount = RCTBridgeFieldResponseReturnValues + 1; @@ -619,7 +700,7 @@ static id _latestJSExecutor; RCTLogError(@"Must pass all fields to buffer - expected %zd, saw %zd", expectedFieldsCount, bufferRowCount); return; } - + for (NSUInteger fieldIndex = RCTBridgeFieldRequestModuleIDs; fieldIndex <= RCTBridgeFieldParamss; fieldIndex++) { id field = [requestsArray objectAtIndex:fieldIndex]; if (![field isKindOfClass:[NSArray class]]) { @@ -627,18 +708,18 @@ static id _latestJSExecutor; return; } } - + NSArray *moduleIDs = requestsArray[RCTBridgeFieldRequestModuleIDs]; NSArray *methodIDs = requestsArray[RCTBridgeFieldMethodIDs]; NSArray *paramsArrays = requestsArray[RCTBridgeFieldParamss]; - + NSUInteger numRequests = [moduleIDs count]; BOOL allSame = numRequests == [methodIDs count] && numRequests == [paramsArrays count]; if (!allSame) { RCTLogError(@"Invalid data message - all must be length: %zd", numRequests); return; } - + for (NSUInteger i = 0; i < numRequests; i++) { @autoreleasepool { [self _handleRequestNumber:i @@ -647,9 +728,9 @@ static id _latestJSExecutor; params:paramsArrays[i]]; } } - + // TODO: only used by RCTUIManager - can we eliminate this special case? - dispatch_async(_shadowQueue, ^{ + dispatch_async(self.shadowQueue, ^{ for (id module in _modulesByID.allObjects) { if ([module respondsToSelector:@selector(batchDidComplete)]) { [module batchDidComplete]; @@ -668,170 +749,42 @@ static id _latestJSExecutor; return NO; } + // Look up method NSArray *methods = RCTExportedMethodsByModuleID()[moduleID]; if (methodID >= methods.count) { RCTLogError(@"Unknown methodID: %zd for module: %zd (%@)", methodID, moduleID, RCTModuleNamesByID[moduleID]); return NO; } - RCTModuleMethod *method = methods[methodID]; - NSUInteger methodArity = method.arity; - if (params.count != methodArity) { - RCTLogError(@"Expected %tu arguments but got %tu invoking %@.%@", - methodArity, - params.count, - RCTModuleNamesByID[moduleID], - method.JSMethodName); - return NO; - } - + __weak RCTBridge *weakSelf = self; - dispatch_async(_shadowQueue, ^{ + dispatch_async(self.shadowQueue, ^{ __strong RCTBridge *strongSelf = weakSelf; - + if (!strongSelf.isValid) { // strongSelf has been invalidated since the dispatch_async call and this // invocation should not continue. return; } - - // TODO: we should just store module instances by index, since that's how we look them up anyway - id target = strongSelf->_modulesByID[moduleID]; - RCTAssert(target != nil, @"No module found for name '%@'", RCTModuleNamesByID[moduleID]); - - SEL selector = method.selector; - NSMethodSignature *methodSignature = [target methodSignatureForSelector:selector]; - NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:methodSignature]; - [invocation setArgument:&target atIndex:0]; - [invocation setArgument:&selector atIndex:1]; - - // Retain used blocks until after invocation completes. - NS_VALID_UNTIL_END_OF_SCOPE NSMutableArray *blocks = [NSMutableArray array]; - - [params enumerateObjectsUsingBlock:^(id param, NSUInteger idx, BOOL *stop) { - if ([param isEqual:[NSNull null]]) { - param = nil; - } else if ([method.blockArgumentIndexes containsIndex:idx]) { - id block = [strongSelf createResponseSenderBlock:[param integerValue]]; - [blocks addObject:block]; - param = block; - } - - NSUInteger argIdx = idx + 2; - - // TODO: can we do this lookup in advance and cache the logic instead of - // recalculating it every time for every parameter? - BOOL shouldSet = YES; - const char *argumentType = [methodSignature getArgumentTypeAtIndex:argIdx]; - switch (argumentType[0]) { - case ':': - if ([param isKindOfClass:[NSString class]]) { - SEL sel = NSSelectorFromString(param); - [invocation setArgument:&sel atIndex:argIdx]; - shouldSet = NO; - } - break; - - case '*': - if ([param isKindOfClass:[NSString class]]) { - const char *string = [param UTF8String]; - [invocation setArgument:&string atIndex:argIdx]; - shouldSet = NO; - } - break; - - // TODO: it seems like an error if the param doesn't respond - // so we should probably surface that error rather than failing silently -#define CASE(_value, _type, _selector) \ - case _value: \ - if ([param respondsToSelector:@selector(_selector)]) { \ - _type value = [param _selector]; \ - [invocation setArgument:&value atIndex:argIdx]; \ - shouldSet = NO; \ - } \ - break; - - CASE('c', char, charValue) - CASE('C', unsigned char, unsignedCharValue) - CASE('s', short, shortValue) - CASE('S', unsigned short, unsignedShortValue) - CASE('i', int, intValue) - CASE('I', unsigned int, unsignedIntValue) - CASE('l', long, longValue) - CASE('L', unsigned long, unsignedLongValue) - CASE('q', long long, longLongValue) - CASE('Q', unsigned long long, unsignedLongLongValue) - CASE('f', float, floatValue) - CASE('d', double, doubleValue) - CASE('B', BOOL, boolValue) - - default: - break; - } - - if (shouldSet) { - [invocation setArgument:¶m atIndex:argIdx]; - } - }]; - + + // Look up module + id module = strongSelf->_modulesByID[moduleID]; + if (!module) { + RCTLogError(@"No module found for name '%@'", RCTModuleNamesByID[moduleID]); + return; + } + @try { - [invocation invoke]; + [method invokeWithBridge:strongSelf module:module arguments:params]; } @catch (NSException *exception) { - RCTLogError(@"Exception thrown while invoking %@ on target %@ with params %@: %@", method.JSMethodName, target, params, exception); + RCTLogError(@"Exception thrown while invoking %@ on target %@ with params %@: %@", method.JSMethodName, module, params, exception); } }); - + return YES; } -/** - * Returns a callback that reports values back to the JS thread. - * TODO (#5906496): These responses should go into their own queue `MessageQueue.m` that - * mirrors the JS queue and protocol. For now, we speak the "language" of the JS - * queue by packing it into an array that matches the wire protocol. - */ -- (RCTResponseSenderBlock)createResponseSenderBlock:(NSInteger)cbID -{ - if (!cbID) { - return nil; - } - - return ^(NSArray *args) { - [self _sendResponseToJavaScriptCallbackID:cbID args:args]; - }; -} - -+ (NSInvocation *)invocationForAdditionalArguments:(NSUInteger)argCount -{ - static NSMutableDictionary *invocations; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - invocations = [NSMutableDictionary dictionary]; - }); - - id key = @(argCount); - NSInvocation *invocation = invocations[key]; - if (invocation == nil) { - NSString *objCTypes = [@"v@:" stringByPaddingToLength:3 + argCount withString:@"@" startingAtIndex:0]; - NSMethodSignature *methodSignature = [NSMethodSignature signatureWithObjCTypes:objCTypes.UTF8String]; - invocation = [NSInvocation invocationWithMethodSignature:methodSignature]; - invocations[key] = invocation; - } - - return invocation; -} - -- (void)registerRootView:(RCTRootView *)rootView -{ - // TODO: only used by RCTUIManager - can we eliminate this special case? - for (id module in _modulesByID.allObjects) { - if ([module respondsToSelector:@selector(registerRootView:)]) { - [module registerRootView:rootView]; - } - } -} - + (BOOL)hasValidJSExecutor { return (_latestJSExecutor != nil && [_latestJSExecutor isValid]); @@ -844,7 +797,7 @@ static id _latestJSExecutor; return; } NSMutableArray *args = [NSMutableArray arrayWithObject:level]; - + // TODO (#5906496): Find out and document why we skip the first object for (id ob in [objects subarrayWithRange:(NSRange){1, [objects count] - 1}]) { if ([NSJSONSerialization isValidJSONObject:@[ob]]) { @@ -853,11 +806,12 @@ static id _latestJSExecutor; [args addObject:[ob description]]; } } - // Note the js executor could get invalidated while we're trying to call this...need to watch out for that. + + // Note: the js executor could get invalidated while we're trying to call this...need to watch out for that. [_latestJSExecutor executeJSCall:@"RCTLog" method:@"logIfNoNativeHook" arguments:args - callback:^(id objcValue, NSError *error) {}]; + callback:^(id json, NSError *error) {}]; } @end diff --git a/ReactKit/Base/RCTBridgeModule.h b/ReactKit/Base/RCTBridgeModule.h index d9df70a22..2627a0b9f 100644 --- a/ReactKit/Base/RCTBridgeModule.h +++ b/ReactKit/Base/RCTBridgeModule.h @@ -19,10 +19,12 @@ typedef void (^RCTResponseSenderBlock)(NSArray *response); @optional /** - * Optional initializer for modules that require access - * to bridge features, such as sending events or making JS calls + * A reference to the RCTBridge. Useful for modules that require access + * to bridge features, such as sending events or making JS calls. This + * will be set automatically by the bridge when it initializes the module. +* To implement this in your module, just add @synthesize bridge = _bridge; */ -- (instancetype)initWithBridge:(RCTBridge *)bridge; +@property (nonatomic, strong) RCTBridge *bridge; /** * The module name exposed to JS. If omitted, this will be inferred @@ -42,17 +44,11 @@ typedef void (^RCTResponseSenderBlock)(NSArray *response); /** * Injects constants into JS. These constants are made accessible via - * NativeModules.moduleName.X. Note that this method is not inherited when you - * subclass a module, and you should not call [super constantsToExport] when - * implementing it. - */ -+ (NSDictionary *)constantsToExport; - -/** - * Some "constants" are not really constant, and need to be re-generated - * each time the bridge module is created. Support for this feature is - * deprecated and may be going away or changing, but for now you can use - * the -constantsToExport instance method to register these "pseudo-constants". + * NativeModules.ModuleName.X. This method is called when the module is + * registered by the bridge. It is only called once for the lifetime of the + * bridge, so it is not suitable for returning dynamic values, but may be + * used for long-lived values such as session keys, that are regenerated only + * as part of a reload of the entire React application. */ - (NSDictionary *)constantsToExport; diff --git a/ReactKit/Base/RCTJavaScriptExecutor.h b/ReactKit/Base/RCTJavaScriptExecutor.h index 7062570a4..4d32f1c2f 100644 --- a/ReactKit/Base/RCTJavaScriptExecutor.h +++ b/ReactKit/Base/RCTJavaScriptExecutor.h @@ -5,7 +5,7 @@ #import "RCTInvalidating.h" typedef void (^RCTJavaScriptCompleteBlock)(NSError *error); -typedef void (^RCTJavaScriptCallback)(id objcValue, NSError *error); +typedef void (^RCTJavaScriptCallback)(id json, NSError *error); /** * Abstracts away a JavaScript execution context - we may be running code in a diff --git a/ReactKit/Base/RCTLog.h b/ReactKit/Base/RCTLog.h index a97d13458..ba72bc8ff 100644 --- a/ReactKit/Base/RCTLog.h +++ b/ReactKit/Base/RCTLog.h @@ -20,28 +20,22 @@ // If defined, only log messages that match this regex will fatal #define RCTLOG_FATAL_REGEX nil -#define _RCTLog(__RCTLog__level, ...) do { \ - NSString *__RCTLog__levelStr; \ - switch(__RCTLog__level) { \ - case RCTLOG_INFO: __RCTLog__levelStr = @"info"; break; \ - case RCTLOG_WARN: __RCTLog__levelStr = @"warn"; break; \ - case RCTLOG_ERROR: __RCTLog__levelStr = @"error"; break; \ - case RCTLOG_MUSTFIX: __RCTLog__levelStr = @"mustfix"; break; \ - } \ - NSString *__RCTLog__msg = _RCTLogObjects(RCTLogFormat(__VA_ARGS__), __RCTLog__levelStr); \ - if (__RCTLog__level >= RCTLOG_FATAL_LEVEL) { \ - BOOL __RCTLog__fail = YES; \ - if (RCTLOG_FATAL_REGEX) { \ - NSError *__RCTLog__e; \ - NSRegularExpression *__RCTLog__regex = [NSRegularExpression regularExpressionWithPattern:RCTLOG_FATAL_REGEX options:0 error:&__RCTLog__e]; \ - __RCTLog__fail = [__RCTLog__regex numberOfMatchesInString:__RCTLog__msg options:0 range:NSMakeRange(0, [__RCTLog__msg length])] > 0; \ - } \ - RCTCAssert(!__RCTLog__fail, @"RCTLOG_FATAL_LEVEL %@: %@", __RCTLog__levelStr, __RCTLog__msg); \ - } \ - if (__RCTLog__level >= RCTLOG_REDBOX_LEVEL) { \ - RCTRedBox *__RCTLog__redBox = [RCTRedBox sharedInstance]; \ - [__RCTLog__redBox showErrorMessage:__RCTLog__msg]; \ - } \ +extern __unsafe_unretained NSString *RCTLogLevels[]; + +#define _RCTLog(_level, ...) do { \ + NSString *__RCTLog__levelStr = RCTLogLevels[_level - 1]; \ + NSString *__RCTLog__msg = RCTLogObjects(RCTLogFormat(__FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__), __RCTLog__levelStr); \ + if (_level >= RCTLOG_FATAL_LEVEL) { \ + BOOL __RCTLog__fail = YES; \ + if (RCTLOG_FATAL_REGEX) { \ + NSRegularExpression *__RCTLog__regex = [NSRegularExpression regularExpressionWithPattern:RCTLOG_FATAL_REGEX options:0 error:NULL]; \ + __RCTLog__fail = [__RCTLog__regex numberOfMatchesInString:__RCTLog__msg options:0 range:NSMakeRange(0, [__RCTLog__msg length])] > 0; \ + } \ + RCTCAssert(!__RCTLog__fail, @"RCTLOG_FATAL_LEVEL %@: %@", __RCTLog__levelStr, __RCTLog__msg); \ + } \ + if (_level >= RCTLOG_REDBOX_LEVEL) { \ + [[RCTRedBox sharedInstance] showErrorMessage:__RCTLog__msg]; \ + } \ } while (0) #define RCTLog(...) _RCTLog(RCTLOG_INFO, __VA_ARGS__) @@ -50,20 +44,15 @@ #define RCTLogError(...) _RCTLog(RCTLOG_ERROR, __VA_ARGS__) #define RCTLogMustFix(...) _RCTLog(RCTLOG_MUSTFIX, __VA_ARGS__) -#define RCTLogFormat(...) _RCTLogFormat(__FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__) -#define RCTLogFormatString(...) _RCTLogFormatString(__FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__) - #ifdef __cplusplus extern "C" { #endif -NSString *_RCTLogObjects(NSArray *objects, NSString *level); -NSArray *_RCTLogFormat(const char *file, int lineNumber, const char *funcName, NSString *format, ...) NS_FORMAT_FUNCTION(4,5); -NSString *_RCTLogFormatString(const char *file, int lineNumber, const char *funcName, NSString *format, ...) NS_FORMAT_FUNCTION(4,5); +NSString *RCTLogObjects(NSArray *objects, NSString *level); +NSArray *RCTLogFormat(const char *file, int lineNumber, const char *funcName, NSString *format, ...) NS_FORMAT_FUNCTION(4,5); + +void RCTInjectLogFunction(void (^logFunction)(NSString *msg)); #ifdef __cplusplus } #endif - -typedef void (^RCTLogFunction)(NSString *format, NSString *str); -void RCTInjectLogFunction(RCTLogFunction func); diff --git a/ReactKit/Base/RCTLog.m b/ReactKit/Base/RCTLog.m index dcf60084e..862eb5a26 100644 --- a/ReactKit/Base/RCTLog.m +++ b/ReactKit/Base/RCTLog.m @@ -4,10 +4,17 @@ #import "RCTBridge.h" -static RCTLogFunction injectedLogFunction; +__unsafe_unretained NSString *RCTLogLevels[] = { + @"info", + @"warn", + @"error", + @"mustfix" +}; -void RCTInjectLogFunction(RCTLogFunction func) { - injectedLogFunction = func; +static void (^RCTInjectedLogFunction)(NSString *msg); + +void RCTInjectLogFunction(void (^logFunction)(NSString *msg)) { + RCTInjectedLogFunction = logFunction; } static inline NSString *_RCTLogPreamble(const char *file, int lineNumber, const char *funcName) @@ -21,7 +28,7 @@ static inline NSString *_RCTLogPreamble(const char *file, int lineNumber, const } // TODO (#5906496): // kinda ugly that this is tied to RCTBridge -NSString *_RCTLogObjects(NSArray *objects, NSString *level) +NSString *RCTLogObjects(NSArray *objects, NSString *level) { NSString *str = objects[0]; #if TARGET_IPHONE_SIMULATOR @@ -33,8 +40,8 @@ NSString *_RCTLogObjects(NSArray *objects, NSString *level) { // Print normal errors with timestamps when not in simulator. // Non errors are already compiled out above, so log as error here. - if (injectedLogFunction) { - injectedLogFunction(@">\n %@", str); + if (RCTInjectedLogFunction) { + RCTInjectedLogFunction(str); } else { NSLog(@">\n %@", str); } @@ -42,14 +49,14 @@ NSString *_RCTLogObjects(NSArray *objects, NSString *level) return str; } -// Returns array of objects. First arg is a simple string to print, remaining args are objects to pass through to the debugger so they are -// inspectable in the console. -NSArray *_RCTLogFormat(const char *file, int lineNumber, const char *funcName, NSString *format, ...) +// Returns array of objects. First arg is a simple string to print, remaining args +// are objects to pass through to the debugger so they are inspectable in the console. +NSArray *RCTLogFormat(const char *file, int lineNumber, const char *funcName, NSString *format, ...) { va_list args; va_start(args, format); NSString *preamble = _RCTLogPreamble(file, lineNumber, funcName); - + // Pull out NSObjects so we can pass them through as inspectable objects to the js debugger NSArray *formatParts = [format componentsSeparatedByString:@"%"]; NSMutableArray *objects = [NSMutableArray arrayWithObject:preamble]; @@ -77,12 +84,3 @@ NSArray *_RCTLogFormat(const char *file, int lineNumber, const char *funcName, N [objectsOut addObjectsFromArray:objects]; return objectsOut; } - -NSString *_RCTLogFormatString(const char *file, int lineNumber, const char *funcName, NSString *format, ...) -{ - va_list args; - va_start (args, format); - NSString *body = [[NSString alloc] initWithFormat:format arguments:args]; - va_end (args); - return [NSString stringWithFormat:@"%@ %@", _RCTLogPreamble(file, lineNumber, funcName), body]; -} diff --git a/ReactKit/Base/RCTRedBox.m b/ReactKit/Base/RCTRedBox.m index 917331f2b..c192598ca 100644 --- a/ReactKit/Base/RCTRedBox.m +++ b/ReactKit/Base/RCTRedBox.m @@ -2,7 +2,6 @@ #import "RCTRedBox.h" -#import "RCTRootView.h" #import "RCTUtils.h" @interface RCTRedBoxWindow : UIWindow @@ -13,31 +12,31 @@ { UIView *_rootView; UITableView *_stackTraceTableView; - + NSString *_lastErrorMessage; NSArray *_lastStackTrace; - + UITableViewCell *_cachedMessageCell; } - (id)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) { - + self.windowLevel = UIWindowLevelStatusBar + 5; self.backgroundColor = [UIColor colorWithRed:0.8 green:0 blue:0 alpha:1]; self.hidden = YES; - + UIViewController *rootController = [[UIViewController alloc] init]; self.rootViewController = rootController; _rootView = rootController.view; _rootView.backgroundColor = [UIColor clearColor]; - + const CGFloat buttonHeight = 60; CGRect detailsFrame = _rootView.bounds; detailsFrame.size.height -= buttonHeight; - + _stackTraceTableView = [[UITableView alloc] initWithFrame:detailsFrame style:UITableViewStylePlain]; _stackTraceTableView.delegate = self; _stackTraceTableView.dataSource = self; @@ -45,21 +44,21 @@ _stackTraceTableView.separatorColor = [[UIColor whiteColor] colorWithAlphaComponent:0.3]; _stackTraceTableView.separatorStyle = UITableViewCellSeparatorStyleNone; [_rootView addSubview:_stackTraceTableView]; - + UIButton *dismissButton = [UIButton buttonWithType:UIButtonTypeCustom]; dismissButton.titleLabel.font = [UIFont systemFontOfSize:14]; [dismissButton setTitle:@"Dismiss (ESC)" forState:UIControlStateNormal]; [dismissButton setTitleColor:[[UIColor whiteColor] colorWithAlphaComponent:0.5] forState:UIControlStateNormal]; [dismissButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted]; [dismissButton addTarget:self action:@selector(dismiss) forControlEvents:UIControlEventTouchUpInside]; - + UIButton *reloadButton = [UIButton buttonWithType:UIButtonTypeCustom]; reloadButton.titleLabel.font = [UIFont systemFontOfSize:14]; [reloadButton setTitle:@"Reload JS (\u2318R)" forState:UIControlStateNormal]; [reloadButton setTitleColor:[[UIColor whiteColor] colorWithAlphaComponent:0.5] forState:UIControlStateNormal]; [reloadButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted]; [reloadButton addTarget:self action:@selector(reload) forControlEvents:UIControlEventTouchUpInside]; - + CGFloat buttonWidth = self.bounds.size.width / 2; dismissButton.frame = CGRectMake(0, self.bounds.size.height - buttonHeight, buttonWidth, buttonHeight); reloadButton.frame = CGRectMake(buttonWidth, self.bounds.size.height - buttonHeight, buttonWidth, buttonHeight); @@ -87,7 +86,7 @@ { _lastStackTrace = stack; _lastErrorMessage = message; - + if (self.hidden && shouldShow) { _cachedMessageCell = [self reuseCell:nil forErrorMessage:message]; @@ -109,7 +108,7 @@ - (void)reload { - [RCTRootView reloadAll]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"RCTReloadNotification" object:nil userInfo:nil]; [self dismiss]; } @@ -149,9 +148,9 @@ cell.backgroundColor = [UIColor clearColor]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } - + cell.textLabel.text = message; - + return cell; } @@ -168,7 +167,7 @@ cell.selectedBackgroundView = [[UIView alloc] init]; cell.selectedBackgroundView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.2]; } - + cell.textLabel.text = stackFrame[@"methodName"]; cell.detailTextLabel.text = cell.detailTextLabel.text = [NSString stringWithFormat:@"%@:%@", [stackFrame[@"file"] lastPathComponent], stackFrame[@"lineNumber"]]; return cell; @@ -179,7 +178,7 @@ if ([indexPath section] == 0) { NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping; - + NSDictionary *attributes = @{NSFontAttributeName: [UIFont boldSystemFontOfSize:16], NSParagraphStyleAttributeName: paragraphStyle}; CGRect boundingRect = [_lastErrorMessage boundingRectWithSize:CGSizeMake(tableView.frame.size.width - 30, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:attributes context:nil]; @@ -206,14 +205,14 @@ // NOTE: We could use RCTKeyCommands for this, but since // we control this window, we can use the standard, non-hacky // mechanism instead - + return @[ - + // Dismiss red box [UIKeyCommand keyCommandWithInput:UIKeyInputEscape modifierFlags:0 action:@selector(dismiss)], - + // Reload [UIKeyCommand keyCommandWithInput:@"r" modifierFlags:UIKeyModifierCommand @@ -269,12 +268,12 @@ - (void)showErrorMessage:(NSString *)message withStack:(NSArray *)stack showIfHidden:(BOOL)shouldShow { - + #if DEBUG - + dispatch_block_t block = ^{ if (!_window) { - _window = [[RCTRedBoxWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + _window = [[RCTRedBoxWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; } [_window showErrorMessage:message withStack:stack showIfHidden:shouldShow]; }; @@ -283,9 +282,9 @@ } else { dispatch_async(dispatch_get_main_queue(), block); } - + #endif - + } - (void)dismiss diff --git a/ReactKit/Base/RCTRootView.m b/ReactKit/Base/RCTRootView.m index 703f86daf..b21e53e25 100644 --- a/ReactKit/Base/RCTRootView.m +++ b/ReactKit/Base/RCTRootView.m @@ -14,13 +14,13 @@ #import "RCTWebViewExecutor.h" #import "UIView+ReactKit.h" -NSString *const RCTRootViewReloadNotification = @"RCTRootViewReloadNotification"; +NSString *const RCTReloadNotification = @"RCTReloadNotification"; @implementation RCTRootView { RCTBridge *_bridge; RCTTouchHandler *_touchHandler; - id _executor; + id _executor; } static Class _globalExecutorClass; @@ -77,7 +77,7 @@ static Class _globalExecutorClass; // Add reload observer [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reload) - name:RCTRootViewReloadNotification + name:RCTReloadNotification object:nil]; } @@ -95,6 +95,10 @@ static Class _globalExecutorClass; [_bridge enqueueJSCall:@"ReactIOS.unmountComponentAtNodeAndRemoveContainer" args:@[self.reactTag]]; + + // TODO: eventually we'll want to be able to share the bridge between + // multiple rootviews, in which case we'll need to move this elsewhere + [_bridge invalidate]; } - (void)bundleFinishedLoading:(NSError *)error @@ -108,7 +112,7 @@ static Class _globalExecutorClass; } } else { - [_bridge registerRootView:self]; + [_bridge.uiManager registerRootView:self]; NSString *moduleName = _moduleName ?: @""; NSDictionary *appParameters = @{ @@ -137,7 +141,7 @@ static Class _globalExecutorClass; // Choose local executor if specified, followed by global, followed by default _executor = [[_executorClass ?: _globalExecutorClass ?: [RCTContextExecutor class] alloc] init]; - _bridge = [[RCTBridge alloc] initWithJavaScriptExecutor:_executor moduleProvider:nil]; + _bridge = [[RCTBridge alloc] initWithExecutor:_executor moduleProvider:nil]; _touchHandler = [[RCTTouchHandler alloc] initWithBridge:_bridge]; [self addGestureRecognizer:_touchHandler]; @@ -229,7 +233,7 @@ static Class _globalExecutorClass; + (void)reloadAll { - [[NSNotificationCenter defaultCenter] postNotificationName:RCTRootViewReloadNotification object:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:RCTReloadNotification object:nil]; } - (void)startOrResetInteractionTiming diff --git a/ReactKit/Base/RCTTouchHandler.h b/ReactKit/Base/RCTTouchHandler.h index 53379a78a..46c81b9ef 100644 --- a/ReactKit/Base/RCTTouchHandler.h +++ b/ReactKit/Base/RCTTouchHandler.h @@ -8,7 +8,7 @@ @interface RCTTouchHandler : UIGestureRecognizer -- (instancetype)initWithBridge:(RCTBridge *)bridge; +- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; - (void)startOrResetInteractionTiming; - (NSDictionary *)endAndResetInteractionTiming; diff --git a/ReactKit/Base/RCTTouchHandler.m b/ReactKit/Base/RCTTouchHandler.m index 36ab411fe..90e1e64c7 100644 --- a/ReactKit/Base/RCTTouchHandler.m +++ b/ReactKit/Base/RCTTouchHandler.m @@ -67,11 +67,6 @@ NSMutableArray *_bridgeInteractionTiming; } -- (instancetype)initWithTarget:(id)target action:(SEL)action -{ - RCT_NOT_DESIGNATED_INITIALIZER(); -} - - (instancetype)initWithBridge:(RCTBridge *)bridge { if ((self = [super initWithTarget:nil action:NULL])) { diff --git a/ReactKit/Base/RCTUtils.h b/ReactKit/Base/RCTUtils.h index 3612b1f27..de203e4ae 100644 --- a/ReactKit/Base/RCTUtils.h +++ b/ReactKit/Base/RCTUtils.h @@ -1,17 +1,15 @@ // Copyright 2004-present Facebook. All Rights Reserved. +#import + #import #import -#import #import "RCTAssert.h" -// Macro to indicate when inherited initializer is not to be used -#define RCT_NOT_DESIGNATED_INITIALIZER() \ -do { \ - RCTAssert(NO, @"%@ is not the designated initializer for instances of %@.", NSStringFromSelector(_cmd), [self class]); \ - return nil; \ -} while (0) +#ifdef __cplusplus +extern "C" { +#endif // Utility functions for JSON object <-> string serialization/deserialization NSString *RCTJSONStringify(id jsonObject, NSError **error); @@ -39,3 +37,10 @@ void RCTSwapInstanceMethods(Class cls, SEL original, SEL replacement); // Module subclass support BOOL RCTClassOverridesClassMethod(Class cls, SEL selector); BOOL RCTClassOverridesInstanceMethod(Class cls, SEL selector); + +// Enumerate all classes that conform to NSObject protocol +void RCTEnumerateClasses(void (^block)(Class cls)); + +#ifdef __cplusplus +} +#endif diff --git a/ReactKit/Base/RCTUtils.m b/ReactKit/Base/RCTUtils.m index 615c5235e..1b686008f 100644 --- a/ReactKit/Base/RCTUtils.m +++ b/ReactKit/Base/RCTUtils.m @@ -155,6 +155,31 @@ BOOL RCTClassOverridesInstanceMethod(Class cls, SEL selector) return YES; } } + free(methods); return NO; } +void RCTEnumerateClasses(void (^block)(Class cls)) +{ + static Class *classes; + static unsigned int classCount; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + classes = objc_copyClassList(&classCount); + }); + + for (unsigned int i = 0; i < classCount; i++) + { + Class cls = classes[i]; + Class superclass = cls; + while (superclass) + { + if (class_conformsToProtocol(superclass, @protocol(NSObject))) + { + block(cls); + break; + } + superclass = class_getSuperclass(superclass); + } + } +} diff --git a/ReactKit/Base/RCTViewNodeProtocol.h b/ReactKit/Base/RCTViewNodeProtocol.h index 1fa3e252b..b6f59ea10 100644 --- a/ReactKit/Base/RCTViewNodeProtocol.h +++ b/ReactKit/Base/RCTViewNodeProtocol.h @@ -8,7 +8,7 @@ */ @protocol RCTViewNodeProtocol -@property (nonatomic, strong) NSNumber *reactTag; +@property (nonatomic, copy) NSNumber *reactTag; - (void)insertReactSubview:(id)subview atIndex:(NSInteger)atIndex; - (void)removeReactSubview:(id)subview; @@ -21,6 +21,8 @@ @optional // TODO: Deprecate this +// This method is called after layout has been performed for all views known +// to the RCTViewManager. It is only called on UIViews, not shadow views. - (void)reactBridgeDidFinishTransaction; @end diff --git a/ReactKit/Executors/RCTContextExecutor.m b/ReactKit/Executors/RCTContextExecutor.m index e3eabc16f..ac27a9065 100644 --- a/ReactKit/Executors/RCTContextExecutor.m +++ b/ReactKit/Executors/RCTContextExecutor.m @@ -45,7 +45,7 @@ static JSValueRef RCTNativeLoggingHook(JSContextRef context, JSObjectRef object, fprintf(stderr, "%s\n", [modifiedString UTF8String]); // don't print timestamps and other junk #else // Print normal errors with timestamps to files when not in simulator. - _RCTLogObjects(@[modifiedString], @"log"); + RCTLogObjects(@[modifiedString], @"log"); #endif JSStringRelease(string); } diff --git a/ReactKit/Modules/RCTAlertManager.m b/ReactKit/Modules/RCTAlertManager.m index ce5cabea6..97ca88f86 100644 --- a/ReactKit/Modules/RCTAlertManager.m +++ b/ReactKit/Modules/RCTAlertManager.m @@ -48,10 +48,10 @@ NSArray *buttons = args[@"buttons"]; if (!title && !message) { - RCTLogMustFix(@"Must specify either an alert title, or message, or both"); + RCTLogError(@"Must specify either an alert title, or message, or both"); return; } else if (buttons.count == 0) { - RCTLogMustFix(@"Must have at least one button."); + RCTLogError(@"Must have at least one button."); return; } @@ -68,7 +68,7 @@ NSInteger index = 0; for (NSDictionary *button in buttons) { if (button.count != 1) { - RCTLogMustFix(@"Button definitions should have exactly one key."); + RCTLogError(@"Button definitions should have exactly one key."); } NSString *buttonKey = [button.allKeys firstObject]; NSString *buttonTitle = [button[buttonKey] description]; diff --git a/ReactKit/Modules/RCTLocationObserver.h b/ReactKit/Modules/RCTLocationObserver.h new file mode 100644 index 000000000..ad3ba2ce2 --- /dev/null +++ b/ReactKit/Modules/RCTLocationObserver.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTBridgeModule.h" + +@interface RCTLocationObserver : NSObject + +@end diff --git a/ReactKit/Modules/RCTLocationObserver.m b/ReactKit/Modules/RCTLocationObserver.m new file mode 100644 index 000000000..6290e1850 --- /dev/null +++ b/ReactKit/Modules/RCTLocationObserver.m @@ -0,0 +1,185 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTLocationObserver.h" + +#import +#import + +#import +#import + +#import "RCTAssert.h" +#import "RCTBridge.h" +#import "RCTEventDispatcher.h" +#import "RCTLog.h" + +// TODO (#5906496): Shouldn't these be configurable? +const CLLocationAccuracy RCTLocationAccuracy = 500.0; // meters + +@interface RCTPendingLocationRequest : NSObject + +@property (nonatomic, copy) RCTResponseSenderBlock successBlock; +@property (nonatomic, copy) RCTResponseSenderBlock errorBlock; + +@end + +@implementation RCTPendingLocationRequest @end + +@interface RCTLocationObserver () + +@end + +@implementation RCTLocationObserver +{ + CLLocationManager *_locationManager; + NSDictionary *_lastLocationEvent; + NSMutableDictionary *_pendingRequests; +} + +@synthesize bridge = _bridge; + +#pragma mark - Lifecycle + +- (instancetype)init +{ + if ((self = [super init])) { + _pendingRequests = [[NSMutableDictionary alloc] init]; + } + return self; +} + +- (void)dealloc +{ + [_locationManager stopUpdatingLocation]; +} + +#pragma mark - Public API + +- (void)startObserving +{ + RCT_EXPORT(); + + dispatch_async(dispatch_get_main_queue(), ^{ + + // Create the location manager if this object does not + // already have one, and it must be created and accessed + // on the main thread + if (nil == _locationManager) { + _locationManager = [[CLLocationManager alloc] init]; + } + + _locationManager.delegate = self; + _locationManager.desiredAccuracy = RCTLocationAccuracy; + + // Set a movement threshold for new events. + _locationManager.distanceFilter = RCTLocationAccuracy; // meters + + if([_locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) { + [_locationManager requestWhenInUseAuthorization]; + } + + [_locationManager startUpdatingLocation]; + + }); +} + +- (void)stopObserving +{ + RCT_EXPORT(); + + dispatch_async(dispatch_get_main_queue(), ^{ + [_locationManager stopUpdatingLocation]; + _lastLocationEvent = nil; + }); +} + +#pragma mark - CLLocationManagerDelegate + +- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations +{ + CLLocation *loc = [locations lastObject]; + NSDictionary *event = @{ + @"coords": @{ + @"latitude": @(loc.coordinate.latitude), + @"longitude": @(loc.coordinate.longitude), + @"altitude": @(loc.altitude), + @"accuracy": @(RCTLocationAccuracy), + @"altitudeAccuracy": @(RCTLocationAccuracy), + @"heading": @(loc.course), + @"speed": @(loc.speed), + }, + @"timestamp": @(CACurrentMediaTime()) + }; + [_bridge.eventDispatcher sendDeviceEventWithName:@"geoLocationDidChange" body:event]; + NSArray *pendingRequestsCopy; + + // TODO (#5906496): is this locking neccessary? If so, use something better than @synchronize + @synchronized(self) { + + pendingRequestsCopy = [_pendingRequests allValues]; + [_pendingRequests removeAllObjects]; + + _lastLocationEvent = event; + } + + for (RCTPendingLocationRequest *request in pendingRequestsCopy) { + if (request.successBlock) { + request.successBlock(@[event]); + } + } +} + +- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error +{ + NSArray *pendingRequestsCopy; + + // TODO (#5906496): is this locking neccessary? If so, use something better than @synchronize + @synchronized(self) { + pendingRequestsCopy = [_pendingRequests allValues]; + [_pendingRequests removeAllObjects]; + } + + NSString *errorMsg = @"User denied location service or location service not available."; + for (RCTPendingLocationRequest *request in pendingRequestsCopy) { + if (request.errorBlock) { + request.errorBlock(@[errorMsg]); + } + } +} + +- (void)getCurrentPosition:(RCTResponseSenderBlock)geoSuccess withErrorCallback:(RCTResponseSenderBlock)geoError +{ + RCT_EXPORT(); + + NSDictionary *lastLocationCopy; + // TODO (#5906496): is this locking neccessary? If so, use something better than @synchronize + @synchronized(self) { + if (![CLLocationManager locationServicesEnabled] || [CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied) { + if (geoError) { + NSString *errorMsg = @"User denied location service or location service not available."; + geoError(@[errorMsg]); + return; + } + } + + // If a request for the current position comes in before the OS has informed us, we wait for the first + // OS event and then call our callbacks. This obviates the need for handling of the otherwise + // common failure case of requesting the geolocation until it succeeds, assuming we would have + // instead returned an error if it wasn't yet available. + if (!_lastLocationEvent) { + NSInteger requestID = [_pendingRequests count]; + RCTPendingLocationRequest *request = [[RCTPendingLocationRequest alloc] init]; + request.successBlock = geoSuccess; + request.errorBlock = geoError; + _pendingRequests[@(requestID)] = request; + return; + } else { + lastLocationCopy = [_lastLocationEvent copy]; + } + } + if (geoSuccess) { + geoSuccess(@[lastLocationCopy]); + } +} + +@end diff --git a/ReactKit/Modules/RCTStatusBarManager.m b/ReactKit/Modules/RCTStatusBarManager.m index 9a49cdd62..b391dc6bd 100644 --- a/ReactKit/Modules/RCTStatusBarManager.m +++ b/ReactKit/Modules/RCTStatusBarManager.m @@ -49,7 +49,7 @@ static BOOL RCTViewControllerBasedStatusBarAppearance() }); } -+ (NSDictionary *)constantsToExport +- (NSDictionary *)constantsToExport { return @{ @"Style": @{ diff --git a/ReactKit/Modules/RCTTiming.m b/ReactKit/Modules/RCTTiming.m index e833f3d5f..d008178b2 100644 --- a/ReactKit/Modules/RCTTiming.m +++ b/ReactKit/Modules/RCTTiming.m @@ -51,35 +51,35 @@ @implementation RCTTiming { RCTSparseArray *_timers; - RCTBridge *_bridge; id _updateTimer; } +@synthesize bridge = _bridge; + + (NSArray *)JSMethods { return @[@"RCTJSTimers.callTimers"]; } -- (instancetype)initWithBridge:(RCTBridge *)bridge +- (instancetype)init { if ((self = [super init])) { - _bridge = bridge; + _timers = [[RCTSparseArray alloc] init]; - [self startTimers]; - + for (NSString *name in @[UIApplicationWillResignActiveNotification, UIApplicationDidEnterBackgroundNotification, UIApplicationWillTerminateNotification]) { - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(stopTimers) name:name object:nil]; } - + for (NSString *name in @[UIApplicationDidBecomeActiveNotification, UIApplicationWillEnterForegroundNotification]) { - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startTimers) name:name @@ -114,14 +114,14 @@ - (void)startTimers { RCTAssertMainThread(); - - if (![self isValid] || _updateTimer != nil) { + + if (![self isValid] || _updateTimer != nil || _timers.count == 0) { return; } _updateTimer = [CADisplayLink displayLinkWithTarget:self selector:@selector(update)]; if (_updateTimer) { - [_updateTimer addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; + [_updateTimer addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; } else { RCTLogWarn(@"Failed to create a display link (probably on buildbot) - using an NSTimer for AppEngine instead."); _updateTimer = [NSTimer scheduledTimerWithTimeInterval:(1.0 / 60) @@ -135,7 +135,7 @@ - (void)update { RCTAssertMainThread(); - + NSMutableArray *timersToCall = [[NSMutableArray alloc] init]; for (RCTTimer *timer in _timers.allObjects) { if ([timer updateFoundNeedsJSUpdate]) { @@ -145,7 +145,7 @@ _timers[timer.callbackID] = nil; } } - + // call timers that need to be called if ([timersToCall count] > 0) { [_bridge enqueueJSCall:@"RCTJSTimers.callTimers" args:@[timersToCall]]; @@ -185,6 +185,7 @@ repeats:repeats]; dispatch_async(dispatch_get_main_queue(), ^{ _timers[callbackID] = timer; + [self startTimers]; }); } @@ -195,6 +196,9 @@ if (timerID) { dispatch_async(dispatch_get_main_queue(), ^{ _timers[timerID] = nil; + if (_timers.count == 0) { + [self stopTimers]; + } }); } else { RCTLogWarn(@"Called deleteTimer: with a nil timerID"); diff --git a/ReactKit/Modules/RCTUIManager.h b/ReactKit/Modules/RCTUIManager.h index 87e91118a..701c37f93 100644 --- a/ReactKit/Modules/RCTUIManager.h +++ b/ReactKit/Modules/RCTUIManager.h @@ -2,13 +2,18 @@ #import +#import "RCTBridge.h" #import "RCTBridgeModule.h" #import "RCTInvalidating.h" +#import "RCTViewManager.h" @class RCTRootView; @protocol RCTScrollableProtocol; +/** + * The RCTUIManager is the module responsible for updating the view hierarchy. + */ @interface RCTUIManager : NSObject @property (nonatomic, weak) id mainScrollView; @@ -19,8 +24,33 @@ */ @property (nonatomic, readwrite, weak) id nativeMainScrollDelegate; +/** + * Register a root view with the RCTUIManager. Theoretically, a single manager + * can support multiple root views, however this feature is not currently exposed + * and may eventually be removed. + */ - (void)registerRootView:(RCTRootView *)rootView; +/** + * Schedule a block to be executed on the UI thread. Useful if you need to execute + * view logic after all currently queued view updates have completed. + */ +- (void)addUIBlock:(RCTViewManagerUIBlock)block; + +/** + * The view that is currently first responder, according to the JS context. + */ + (UIView *)JSResponder; @end + +/** + * This category makes the current RCTUIManager instance available via the + * RCTBridge, which is useful for RCTBridgeModules or RCTViewManagers that + * need to access the RCTUIManager. + */ +@interface RCTBridge (RCTUIManager) + +@property (nonatomic, readonly) RCTUIManager *uiManager; + +@end diff --git a/ReactKit/Modules/RCTUIManager.m b/ReactKit/Modules/RCTUIManager.m index 0b34a820b..951013969 100644 --- a/ReactKit/Modules/RCTUIManager.m +++ b/ReactKit/Modules/RCTUIManager.m @@ -32,47 +32,6 @@ static void RCTTraverseViewNodes(id view, react_view_node_b } } -static NSDictionary *RCTViewModuleClasses(void) -{ - static NSMutableDictionary *modules; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - modules = [NSMutableDictionary dictionary]; - - unsigned int classCount; - Class *classes = objc_copyClassList(&classCount); - for (unsigned int i = 0; i < classCount; i++) { - - Class cls = classes[i]; - - if (!class_getSuperclass(cls)) { - // Class has no superclass - it's probably something weird - continue; - } - - if (![cls isSubclassOfClass:[RCTViewManager class]]) { - // Not a view module - continue; - } - - // Get module name - NSString *moduleName = [cls moduleName]; - - // Check module name is unique - id existingClass = modules[moduleName]; - RCTCAssert(existingClass == Nil, @"Attempted to register view module class %@ " - "for the name '%@', but name was already registered by class %@", cls, moduleName, existingClass); - - // Add to module list - modules[moduleName] = cls; - } - - free(classes); - }); - - return modules; -} - @interface RCTAnimation : NSObject @property (nonatomic, readonly) NSTimeInterval duration; @@ -190,48 +149,70 @@ UIViewAnimationCurve UIViewAnimationCurveFromRCTAnimationType(RCTAnimationType t @implementation RCTUIManager { + dispatch_queue_t _shadowQueue; + // Root views are only mutated on the shadow queue NSMutableSet *_rootViewTags; NSMutableArray *_pendingUIBlocks; NSLock *_pendingUIBlocksLock; - + // Animation RCTLayoutAnimation *_nextLayoutAnimation; // RCT thread only RCTLayoutAnimation *_layoutAnimation; // Main thread only - // Keyed by moduleName + // Keyed by viewName NSMutableDictionary *_defaultShadowViews; // RCT thread only NSMutableDictionary *_defaultViews; // Main thread only NSDictionary *_viewManagers; - + // Keyed by React tag RCTSparseArray *_viewManagerRegistry; // RCT thread only RCTSparseArray *_shadowViewRegistry; // RCT thread only RCTSparseArray *_viewRegistry; // Main thread only - - __weak RCTBridge *_bridge; } -- (instancetype)initWithBridge:(RCTBridge *)bridge +@synthesize bridge =_bridge; + +/** + * This function derives the view name automatically + * from the module name. + */ +static NSString *RCTViewNameForModuleName(NSString *moduleName) +{ + NSString *name = moduleName; + if ([name hasSuffix:@"Manager"]) { + name = [name substringToIndex:name.length - @"Manager".length]; + } + return name; +} + +/** + * This private constructor should only be called when creating + * isolated UIImanager instances for testing. Normal initialization + * is via -init:, which is called automatically by the bridge. + */ +- (instancetype)initWithShadowQueue:(dispatch_queue_t)shadowQueue +{ + if ((self = [self init])) { + _shadowQueue = shadowQueue; + _viewManagers = [[NSMutableDictionary alloc] init]; + } + return self; +} + +- (instancetype)init { if ((self = [super init])) { - - _bridge = bridge; + _pendingUIBlocksLock = [[NSLock alloc] init]; - - // Instantiate view managers - NSMutableDictionary *viewManagers = [[NSMutableDictionary alloc] init]; - [RCTViewModuleClasses() enumerateKeysAndObjectsUsingBlock:^(NSString *moduleName, Class moduleClass, BOOL *stop) { - viewManagers[moduleName] = [[moduleClass alloc] initWithEventDispatcher:_bridge.eventDispatcher]; - }]; - _viewManagers = viewManagers; + _defaultShadowViews = [[NSMutableDictionary alloc] init]; _defaultViews = [[NSMutableDictionary alloc] init]; - + _viewManagerRegistry = [[RCTSparseArray alloc] init]; _shadowViewRegistry = [[RCTSparseArray alloc] init]; _viewRegistry = [[RCTSparseArray alloc] init]; - + // Internal resources _pendingUIBlocks = [[NSMutableArray alloc] init]; _rootViewTags = [[NSMutableSet alloc] init]; @@ -239,16 +220,35 @@ UIViewAnimationCurve UIViewAnimationCurveFromRCTAnimationType(RCTAnimationType t return self; } -- (instancetype)init -{ - RCT_NOT_DESIGNATED_INITIALIZER(); -} - - (void)dealloc { RCTAssert(!self.valid, @"must call -invalidate before -dealloc"); } +- (void)setBridge:(RCTBridge *)bridge +{ + if (_bridge) { + + // Clear previous bridge data + [self invalidate]; + } + if (bridge) { + + _bridge = bridge; + _shadowQueue = _bridge.shadowQueue; + + // Get view managers from bridge + NSMutableDictionary *viewManagers = [[NSMutableDictionary alloc] init]; + [_bridge.modules enumerateKeysAndObjectsUsingBlock:^(NSString *moduleName, RCTViewManager *manager, BOOL *stop) { + if ([manager isKindOfClass:[RCTViewManager class]]) { + viewManagers[RCTViewNameForModuleName(moduleName)] = manager; + } + }]; + + _viewManagers = [viewManagers copy]; + } +} + - (BOOL)isValid { return _viewRegistry != nil; @@ -260,6 +260,7 @@ UIViewAnimationCurve UIViewAnimationCurveFromRCTAnimationType(RCTAnimationType t _viewRegistry = nil; _shadowViewRegistry = nil; + _bridge = nil; [_pendingUIBlocksLock lock]; _pendingUIBlocks = nil; @@ -269,22 +270,22 @@ UIViewAnimationCurve UIViewAnimationCurveFromRCTAnimationType(RCTAnimationType t - (void)registerRootView:(RCTRootView *)rootView; { RCTAssertMainThread(); - + NSNumber *reactTag = rootView.reactTag; UIView *existingView = _viewRegistry[reactTag]; RCTCAssert(existingView == nil || existingView == rootView, @"Expect all root views to have unique tag. Added %@ twice", reactTag); - + // Register view _viewRegistry[reactTag] = rootView; CGRect frame = rootView.frame; - + // Register manager (TODO: should we do this, or leave it nil?) - _viewManagerRegistry[reactTag] = _viewManagers[[RCTViewManager moduleName]]; - + _viewManagerRegistry[reactTag] = _viewManagers[@"View"]; + // Register shadow view - dispatch_async(_bridge.shadowQueue, ^{ - + dispatch_async(_shadowQueue, ^{ + RCTShadowView *shadowView = [[RCTShadowView alloc] init]; shadowView.reactTag = reactTag; shadowView.frame = frame; @@ -315,7 +316,7 @@ UIViewAnimationCurve UIViewAnimationCurveFromRCTAnimationType(RCTAnimationType t - (void)addUIBlock:(RCTViewManagerUIBlock)block { RCTAssert(![NSThread isMainThread], @"This method should only be called on the shadow thread"); - + __weak RCTUIManager *weakViewManager = self; __weak RCTSparseArray *weakViewRegistry = _viewRegistry; dispatch_block_t outerBlock = ^{ @@ -333,6 +334,8 @@ UIViewAnimationCurve UIViewAnimationCurveFromRCTAnimationType(RCTAnimationType t - (RCTViewManagerUIBlock)uiBlockWithLayoutUpdateForRootView:(RCTShadowView *)rootShadowView { + RCTAssert(![NSThread isMainThread], @"This should never be executed on main thread."); + NSMutableSet *viewsWithNewFrames = [NSMutableSet setWithCapacity:1]; // This is nuanced. In the JS thread, we create a new update buffer @@ -340,7 +343,8 @@ UIViewAnimationCurve UIViewAnimationCurveFromRCTAnimationType(RCTAnimationType t // these structures in the UI-thread block. `NSMutableArray` is not thread // safe so we rely on the fact that we never mutate it after it's passed to // the main thread. - [rootShadowView collectRootUpdatedFrames:viewsWithNewFrames parentConstraint:(CGSize){CSS_UNDEFINED, CSS_UNDEFINED}]; + [rootShadowView collectRootUpdatedFrames:viewsWithNewFrames + parentConstraint:(CGSize){CSS_UNDEFINED, CSS_UNDEFINED}]; // Parallel arrays NSMutableArray *frameReactTags = [NSMutableArray arrayWithCapacity:viewsWithNewFrames.count]; @@ -354,12 +358,19 @@ UIViewAnimationCurve UIViewAnimationCurveFromRCTAnimationType(RCTAnimationType t [areNew addObject:@(shadowView.isNewView)]; [parentsAreNew addObject:@(shadowView.superview.isNewView)]; } - + for (RCTShadowView *shadowView in viewsWithNewFrames) { // We have to do this after we build the parentsAreNew array. shadowView.newView = NO; } + NSMutableArray *updateBlocks = [[NSMutableArray alloc] init]; + for (RCTShadowView *shadowView in viewsWithNewFrames) { + RCTViewManager *manager = _viewManagerRegistry[shadowView.reactTag]; + RCTViewManagerUIBlock block = [manager uiBlockToAmendWithShadowView:shadowView]; + if (block) [updateBlocks addObject:block]; + } + // Perform layout (possibly animated) NSNumber *rootViewTag = rootShadowView.reactTag; return ^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) { @@ -373,15 +384,16 @@ UIViewAnimationCurve UIViewAnimationCurveFromRCTAnimationType(RCTAnimationType t // Convert the frame so it works with anchorPoint = center. CGPoint position = {CGRectGetMidX(frame), CGRectGetMidY(frame)}; CGRect bounds = {0, 0, frame.size}; - + // Avoid crashes due to nan coords if (isnan(position.x) || isnan(position.y) || isnan(bounds.origin.x) || isnan(bounds.origin.y) || isnan(bounds.size.width) || isnan(bounds.size.height)) { - RCTLogError(@"Invalid layout for (%zd)%@. position: %@. bounds: %@", [view reactTag], self, NSStringFromCGPoint(position), NSStringFromCGRect(bounds)); + RCTLogError(@"Invalid layout for (%@)%@. position: %@. bounds: %@", + [view reactTag], self, NSStringFromCGPoint(position), NSStringFromCGRect(bounds)); continue; } - + void (^completion)(BOOL finished) = ^(BOOL finished) { if (self->_layoutAnimation.callback) { self->_layoutAnimation.callback(@[@(finished)]); @@ -395,14 +407,20 @@ UIViewAnimationCurve UIViewAnimationCurveFromRCTAnimationType(RCTAnimationType t [updateAnimation performAnimations:^{ view.layer.position = position; view.layer.bounds = bounds; + for (RCTViewManagerUIBlock block in updateBlocks) { + block(self, _viewRegistry); + } } withCompletionBlock:completion]; } else { view.layer.position = position; view.layer.bounds = bounds; + for (RCTViewManagerUIBlock block in updateBlocks) { + block(self, _viewRegistry); + } completion(YES); } - - // Animate view creations + + // Animate view creation BOOL shouldAnimateCreation = isNew && ![parentsAreNew[ii] boolValue]; RCTAnimation *createAnimation = _layoutAnimation.createAnimation; if (shouldAnimateCreation && createAnimation) { @@ -417,12 +435,22 @@ UIViewAnimationCurve UIViewAnimationCurveFromRCTAnimationType(RCTAnimationType t } else if ([createAnimation.property isEqual:@"opacity"]) { view.layer.opacity = 1.0; } else { - RCTLogError(@"Unsupported layout animation createConfig property %@", createAnimation.property); + RCTLogError(@"Unsupported layout animation createConfig property %@", + createAnimation.property); + } + for (RCTViewManagerUIBlock block in updateBlocks) { + block(self, _viewRegistry); } } withCompletionBlock:nil]; } } + /** + * Enumerate all active (attached to a parent) views and call + * reactBridgeDidFinishTransaction on them if they implement it. + * TODO: this is quite inefficient. If this was handled via the + * ViewManager instead, it could be done more efficiently. + */ RCTRootView *rootView = _viewRegistry[rootViewTag]; RCTTraverseViewNodes(rootView, ^(id view) { if ([view respondsToSelector:@selector(reactBridgeDidFinishTransaction)]) { @@ -436,7 +464,7 @@ UIViewAnimationCurve UIViewAnimationCurveFromRCTAnimationType(RCTAnimationType t { NSMutableSet *applierBlocks = [NSMutableSet setWithCapacity:1]; [topView collectUpdatedProperties:applierBlocks parentProperties:@{}]; - + [self addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) { for (RCTApplierBlock block in applierBlocks) { block(viewRegistry); @@ -454,7 +482,7 @@ UIViewAnimationCurve UIViewAnimationCurveFromRCTAnimationType(RCTAnimationType t id container = _viewRegistry[containerID]; RCTAssert(container != nil, @"container view (for ID %@) not found", containerID); - + NSUInteger subviewsCount = [[container reactSubviews] count]; NSMutableArray *indices = [[NSMutableArray alloc] initWithCapacity:subviewsCount]; for (NSInteger childIndex = 0; childIndex < subviewsCount; childIndex++) { @@ -616,11 +644,11 @@ static BOOL RCTCallPropertySetter(SEL setter, id value, id view, id defaultView, { // TODO: cache respondsToSelector tests if ([manager respondsToSelector:setter]) { - + if (value == [NSNull null]) { value = nil; } - + ((void (*)(id, SEL, id, id, id))objc_msgSend)(manager, setter, value, view, defaultView); return YES; } @@ -631,9 +659,9 @@ static void RCTSetViewProps(NSDictionary *props, UIView *view, UIView *defaultView, RCTViewManager *manager) { [props enumerateKeysAndObjectsUsingBlock:^(NSString *key, id obj, BOOL *stop) { - + SEL setter = NSSelectorFromString([NSString stringWithFormat:@"set_%@:forView:withDefaultView:", key]); - + // For regular views we don't attempt to set properties // unless the view property has been explicitly exported. RCTCallPropertySetter(setter, obj, view, defaultView, manager); @@ -644,13 +672,13 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView RCTShadowView *defaultView, RCTViewManager *manager) { [props enumerateKeysAndObjectsUsingBlock:^(NSString *key, id obj, BOOL *stop) { - + SEL setter = NSSelectorFromString([NSString stringWithFormat:@"set_%@:forShadowView:withDefaultView:", key]); - + // For shadow views we call any custom setter methods by default, // but if none is specified, we attempt to set property anyway. if (!RCTCallPropertySetter(setter, obj, shadowView, defaultView, manager)) { - + if (obj == [NSNull null]) { // Copy property from default view to current // Note: not just doing `[defaultView valueForKey:key]`, the @@ -661,20 +689,20 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView } } }]; - + // Update layout [shadowView updateShadowViewLayout]; } - (void)createAndRegisterViewWithReactTag:(NSNumber *)reactTag - moduleName:(NSString *)moduleName + viewName:(NSString *)viewName props:(NSDictionary *)props { RCT_EXPORT(createView); - RCTViewManager *manager = _viewManagers[moduleName]; + RCTViewManager *manager = _viewManagers[viewName]; if (manager == nil) { - RCTLogWarn(@"No manager class found for view with module name \"%@\"", moduleName); + RCTLogWarn(@"No manager class found for view with module name \"%@\"", viewName); manager = [[RCTViewManager alloc] init]; } @@ -682,57 +710,57 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView _viewManagerRegistry[reactTag] = manager; // Generate default view, used for resetting default props - if (!_defaultShadowViews[moduleName]) { - _defaultShadowViews[moduleName] = [manager shadowView]; + if (!_defaultShadowViews[viewName]) { + _defaultShadowViews[viewName] = [manager shadowView]; } - + RCTShadowView *shadowView = [manager shadowView]; - shadowView.moduleName = moduleName; + shadowView.moduleName = viewName; shadowView.reactTag = reactTag; - RCTSetShadowViewProps(props, shadowView, _defaultShadowViews[moduleName], manager); + RCTSetShadowViewProps(props, shadowView, _defaultShadowViews[viewName], manager); _shadowViewRegistry[shadowView.reactTag] = shadowView; - + [self addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry){ RCTCAssertMainThread(); // Generate default view, used for resetting default props - if (!uiManager->_defaultViews[moduleName]) { + if (!uiManager->_defaultViews[viewName]) { // Note the default is setup after the props are read for the first time ever // for this className - this is ok because we only use the default for restoring // defaults, which never happens on first creation. - uiManager->_defaultViews[moduleName] = [manager view]; + uiManager->_defaultViews[viewName] = [manager view]; } - + UIView *view = [manager view]; if (view) { - + // Set required properties view.reactTag = reactTag; view.multipleTouchEnabled = YES; view.userInteractionEnabled = YES; // required for touch handling view.layer.allowsGroupOpacity = YES; // required for touch handling - + // Set custom properties - RCTSetViewProps(props, view, uiManager->_defaultViews[moduleName], manager); + RCTSetViewProps(props, view, uiManager->_defaultViews[viewName], manager); } viewRegistry[view.reactTag] = view; }]; } -// TODO: remove moduleName param as it isn't needed -- (void)updateView:(NSNumber *)reactTag moduleName:(__unused NSString *)_ props:(NSDictionary *)props +// TODO: remove viewName param as it isn't needed +- (void)updateView:(NSNumber *)reactTag viewName:(__unused NSString *)_ props:(NSDictionary *)props { RCT_EXPORT(); RCTViewManager *viewManager = _viewManagerRegistry[reactTag]; - NSString *moduleName = [[viewManager class] moduleName]; - + NSString *viewName = RCTViewNameForModuleName([[viewManager class] moduleName]); + RCTShadowView *shadowView = _shadowViewRegistry[reactTag]; - RCTSetShadowViewProps(props, shadowView, _defaultShadowViews[moduleName], viewManager); - + RCTSetShadowViewProps(props, shadowView, _defaultShadowViews[viewName], viewManager); + [self addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) { UIView *view = uiManager->_viewRegistry[reactTag]; - RCTSetViewProps(props, view, uiManager->_defaultViews[moduleName], viewManager); + RCTSetViewProps(props, view, uiManager->_defaultViews[viewName], viewManager); }]; } @@ -760,16 +788,15 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView - (void)batchDidComplete { - // First copy the previous blocks into a temporary variable, then reset the - // pending blocks to a new array. This guards against mutation while - // processing the pending blocks in another thread. + // Gather blocks to be executed now that all view hierarchy manipulations have + // been completed (note that these may still take place before layout has finished) for (RCTViewManager *manager in _viewManagers.allValues) { RCTViewManagerUIBlock uiBlock = [manager uiBlockToAmendWithShadowViewRegistry:_shadowViewRegistry]; if (uiBlock) { [self addUIBlock:uiBlock]; } } - + // Set up next layout animation if (_nextLayoutAnimation) { RCTLayoutAnimation *layoutAnimation = _nextLayoutAnimation; @@ -777,14 +804,14 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView uiManager->_layoutAnimation = layoutAnimation; }]; } - + // Perform layout for (NSNumber *reactTag in _rootViewTags) { RCTShadowView *rootView = _shadowViewRegistry[reactTag]; [self addUIBlock:[self uiBlockWithLayoutUpdateForRootView:rootView]]; [self _amendPendingUIBlocksWithStylePropagationUpdateForRootView:rootView]; } - + // Clear layout animations if (_nextLayoutAnimation) { [self addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) { @@ -792,12 +819,16 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView }]; _nextLayoutAnimation = nil; } - + + // First copy the previous blocks into a temporary variable, then reset the + // pending blocks to a new array. This guards against mutation while + // processing the pending blocks in another thread. [_pendingUIBlocksLock lock]; NSArray *previousPendingUIBlocks = _pendingUIBlocks; _pendingUIBlocks = [[NSMutableArray alloc] init]; [_pendingUIBlocksLock unlock]; - + + // Execute the previously queued UI blocks dispatch_async(dispatch_get_main_queue(), ^{ for (dispatch_block_t block in previousPendingUIBlocks) { block(); @@ -828,7 +859,7 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView } RCTCAssert([rootView isReactRootView], @"React view not inside RCTRootView"); - + // By convention, all coordinates, whether they be touch coordinates, or // measurement coordinates are with respect to the root view. CGPoint pagePoint = [view.superview convertPoint:frame.origin toView:rootView]; @@ -844,37 +875,6 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView }]; } -- (void)requestSchedulingJavaScriptNavigation:(NSNumber *)reactTag - errorCallback:(RCTResponseSenderBlock)errorCallback - callback:(RCTResponseSenderBlock)callback -{ - RCT_EXPORT(); - - if (!callback || !errorCallback) { - RCTLogError(@"Callback not provided for navigation scheduling."); - return; - } - [self addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry){ - if (reactTag) { - //TODO: This is nasty - why is RCTNavigator hard-coded? - id rkObject = viewRegistry[reactTag]; - if ([rkObject isKindOfClass:[RCTNavigator class]]) { - RCTNavigator *navigator = (RCTNavigator *)rkObject; - BOOL wasAcquired = [navigator requestSchedulingJavaScriptNavigation]; - callback(@[@(wasAcquired)]); - } else { - NSString *msg = - [NSString stringWithFormat: @"Cannot set lock: Tag %@ is not an RCTNavigator", reactTag]; - errorCallback(@[RCTAPIErrorObject(msg)]); - } - } else { - NSString *msg = [NSString stringWithFormat: @"Tag not specified for requestSchedulingJavaScriptNavigation"]; - errorCallback(@[RCTAPIErrorObject(msg)]); - } - }]; -} - - /** * TODO: This could be modified to accept any `RCTViewNodeProtocol`, if * appropriate changes were made to that protocol to support `superview` @@ -884,22 +884,20 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView + (void)measureLayoutOnNodes:(RCTShadowView *)view ancestor:(RCTShadowView *)ancestor errorCallback:(RCTResponseSenderBlock)errorCallback - callback:(RCTResponseSenderBlock)callback + callback:(__unused RCTResponseSenderBlock)callback { if (!view) { - NSString *msg = [NSString stringWithFormat: @"Attempting to measure view that does not exist %@", view]; - errorCallback(@[RCTAPIErrorObject(msg)]); + RCTLogError(@"Attempting to measure view that does not exist"); return; } if (!ancestor) { - NSString *msg = [NSString stringWithFormat: @"Attempting to measure relative to ancestor that does not exist %@", ancestor]; - errorCallback(@[RCTAPIErrorObject(msg)]); + RCTLogError(@"Attempting to measure relative to ancestor that does not exist"); return; } CGRect result = [RCTShadowView measureLayout:view relativeTo:ancestor]; if (CGRectIsNull(result)) { - NSString *msg = [NSString stringWithFormat: @"view %@ is not an decendant of %@", view, ancestor]; - errorCallback(@[RCTAPIErrorObject(msg)]); + RCTLogError(@"view %@ (tag #%@) is not a decendant of %@ (tag #%@)", + view, view.reactTag, ancestor, ancestor.reactTag); return; } CGFloat leftOffset = result.origin.x; @@ -907,7 +905,7 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView CGFloat width = result.size.width; CGFloat height = result.size.height; if (isnan(leftOffset) || isnan(topOffset) || isnan(width) || isnan(height)) { - errorCallback(@[RCTAPIErrorObject(@"Attempted to measure layout but offset or dimensions were NaN")]); + RCTLogError(@"Attempted to measure layout but offset or dimensions were NaN"); return; } callback(@[@(topOffset), @(leftOffset), @(width), @(height)]); @@ -965,8 +963,7 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView RCTShadowView *shadowView = _shadowViewRegistry[reactTag]; if (!shadowView) { - NSString *msg = [NSString stringWithFormat: @"Attempting to measure view that does not exist %@", shadowView]; - errorCallback(@[RCTAPIErrorObject(msg)]); + RCTLogError(@"Attempting to measure view that does not exist (tag #%@)", reactTag); return; } NSArray *childShadowViews = [shadowView reactSubviews]; @@ -977,8 +974,8 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView RCTShadowView *childShadowView = [childShadowViews objectAtIndex:ii]; CGRect childLayout = [RCTShadowView measureLayout:childShadowView relativeTo:shadowView]; if (CGRectIsNull(childLayout)) { - NSString *msg = [NSString stringWithFormat: @"view %@ is not a decendant of %@", childShadowView, shadowView]; - errorCallback(@[RCTAPIErrorObject(msg)]); + RCTLogError(@"View %@ (tag #%@) is not a decendant of %@ (tag #%@)", + childShadowView, childShadowView.reactTag, shadowView, shadowView.reactTag); return; } @@ -1088,7 +1085,7 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView [self addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) { _jsResponder = viewRegistry[reactTag]; if (!_jsResponder) { - RCTLogMustFix(@"Invalid view set to be the JS responder - tag %zd", reactTag); + RCTLogError(@"Invalid view set to be the JS responder - tag %zd", reactTag); } }]; } @@ -1102,7 +1099,11 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView }]; } -+ (NSDictionary *)allBubblingEventTypesConfigs +// TODO: these event types should be distributed among the modules +// that declare them. Also, events should be registerable by any class +// that can call event handlers, not just UIViewManagers. This code +// also seems highly redundant - every event has the same properties. +- (NSDictionary *)customBubblingEventTypes { NSMutableDictionary *customBubblingEventTypesConfigs = [@{ // Bubble dispatched events @@ -1192,11 +1193,12 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView }, } mutableCopy]; - [RCTViewModuleClasses() enumerateKeysAndObjectsUsingBlock:^(NSString *name, Class cls, BOOL *stop) { + [_viewManagers enumerateKeysAndObjectsUsingBlock:^(NSString *name, Class cls, BOOL *stop) { if (RCTClassOverridesClassMethod(cls, @selector(customBubblingEventTypes))) { NSDictionary *eventTypes = [cls customBubblingEventTypes]; for (NSString *eventName in eventTypes) { - RCTCAssert(!customBubblingEventTypesConfigs[eventName], @"Event '%@' registered multiple times.", eventName); + RCTCAssert(!customBubblingEventTypesConfigs[eventName], + @"Event '%@' registered multiple times.", eventName); } [customBubblingEventTypesConfigs addEntriesFromDictionary:eventTypes]; } @@ -1205,7 +1207,7 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView return customBubblingEventTypesConfigs; } -+ (NSDictionary *)allDirectEventTypesConfigs +- (NSDictionary *)customDirectEventTypes { NSMutableDictionary *customDirectEventTypes = [@{ @"topScrollBeginDrag": @{ @@ -1243,7 +1245,7 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView }, } mutableCopy]; - [RCTViewModuleClasses() enumerateKeysAndObjectsUsingBlock:^(NSString *name, Class cls, BOOL *stop) { + [_viewManagers enumerateKeysAndObjectsUsingBlock:^(NSString *name, Class cls, BOOL *stop) { if (RCTClassOverridesClassMethod(cls, @selector(customDirectEventTypes))) { NSDictionary *eventTypes = [cls customDirectEventTypes]; for (NSString *eventName in eventTypes) { @@ -1256,11 +1258,11 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView return customDirectEventTypes; } -+ (NSDictionary *)constantsToExport +- (NSDictionary *)constantsToExport { NSMutableDictionary *allJSConstants = [@{ - @"customBubblingEventTypes": [self allBubblingEventTypesConfigs], - @"customDirectEventTypes": [self allDirectEventTypesConfigs], + @"customBubblingEventTypes": [self customBubblingEventTypes], + @"customDirectEventTypes": [self customDirectEventTypes], @"NSTextAlignment": @{ @"Left": @(NSTextAlignmentLeft), @"Center": @(NSTextAlignmentCenter), @@ -1320,15 +1322,15 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView }, } mutableCopy]; - [RCTViewModuleClasses() enumerateKeysAndObjectsUsingBlock:^(NSString *name, Class cls, BOOL *stop) { + [_viewManagers enumerateKeysAndObjectsUsingBlock:^(NSString *name, Class cls, BOOL *stop) { // TODO: should these be inherited? NSDictionary *constants = RCTClassOverridesClassMethod(cls, @selector(constantsToExport)) ? [cls constantsToExport] : nil; if ([constants count]) { - NSMutableDictionary *namespace = [NSMutableDictionary dictionaryWithDictionary:allJSConstants[name]]; - RCTAssert(namespace[@"Constants"] == nil , @"Cannot redefine Constants in namespace: %@", name); + NSMutableDictionary *constantsNamespace = [NSMutableDictionary dictionaryWithDictionary:allJSConstants[name]]; + RCTAssert(constantsNamespace[@"Constants"] == nil , @"Cannot redefine Constants in namespace: %@", name); // add an additional 'Constants' namespace for each class - namespace[@"Constants"] = constants; - allJSConstants[name] = [namespace copy]; + constantsNamespace[@"Constants"] = constants; + allJSConstants[name] = [constantsNamespace copy]; } }]; @@ -1342,10 +1344,11 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView RCT_EXPORT(); if (_nextLayoutAnimation) { - RCTLogWarn(@"Warning: Overriding previous layout animation with new one before the first began:\n%@ -> %@.", _nextLayoutAnimation, config); + RCTLogWarn(@"Warning: Overriding previous layout animation with new one before the first began:\n%@ -> %@.", + _nextLayoutAnimation, config); } if (config[@"delete"] != nil) { - RCTLogError(@"LayoutAnimation only supports create and update right now. Config: %@", config); + RCTLogError(@"LayoutAnimation only supports create and update right now. Config: %@", config); } _nextLayoutAnimation = [[RCTLayoutAnimation alloc] initWithDictionary:config callback:callback]; } @@ -1389,3 +1392,12 @@ static UIView *_jsResponder; } @end + +@implementation RCTBridge (RCTUIManager) + +- (RCTUIManager *)uiManager +{ + return self.modules[NSStringFromClass([RCTUIManager class])]; +} + +@end diff --git a/ReactKit/ReactKit.xcodeproj/project.pbxproj b/ReactKit/ReactKit.xcodeproj/project.pbxproj index 3067cd8e4..721556306 100644 --- a/ReactKit/ReactKit.xcodeproj/project.pbxproj +++ b/ReactKit/ReactKit.xcodeproj/project.pbxproj @@ -32,6 +32,7 @@ 13E067561A70F44B002CDEE1 /* RCTViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E0674E1A70F44B002CDEE1 /* RCTViewManager.m */; }; 13E067571A70F44B002CDEE1 /* RCTView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067501A70F44B002CDEE1 /* RCTView.m */; }; 13E067591A70F44B002CDEE1 /* UIView+ReactKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067541A70F44B002CDEE1 /* UIView+ReactKit.m */; }; + 5F5F0D991A9E456B001279FA /* RCTLocationObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F5F0D981A9E456B001279FA /* RCTLocationObserver.m */; }; 830A229E1A66C68A008503DA /* RCTRootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 830A229D1A66C68A008503DA /* RCTRootView.m */; }; 830BA4551A8E3BDA00D53203 /* RCTCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 830BA4541A8E3BDA00D53203 /* RCTCache.m */; }; 832348161A77A5AA00B55238 /* Layout.c in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FC71A68125100A75B9A /* Layout.c */; }; @@ -113,6 +114,8 @@ 13E067541A70F44B002CDEE1 /* UIView+ReactKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+ReactKit.m"; sourceTree = ""; }; 13ED13891A80C9D40050A8F9 /* RCTPointerEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPointerEvents.h; sourceTree = ""; }; 13EFFCCF1A98E6FE002607DC /* RCTJSMethodRegistrar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSMethodRegistrar.h; sourceTree = ""; }; + 5F5F0D971A9E456B001279FA /* RCTLocationObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTLocationObserver.h; sourceTree = ""; }; + 5F5F0D981A9E456B001279FA /* RCTLocationObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLocationObserver.m; sourceTree = ""; }; 830213F31A654E0800B993E6 /* RCTBridgeModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTBridgeModule.h; sourceTree = ""; }; 830A229C1A66C68A008503DA /* RCTRootView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootView.h; sourceTree = ""; }; 830A229D1A66C68A008503DA /* RCTRootView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootView.m; sourceTree = ""; }; @@ -177,6 +180,8 @@ 13B07FE01A69315300A75B9A /* Modules */ = { isa = PBXGroup; children = ( + 5F5F0D971A9E456B001279FA /* RCTLocationObserver.h */, + 5F5F0D981A9E456B001279FA /* RCTLocationObserver.m */, 13B07FE71A69327A00A75B9A /* RCTAlertManager.h */, 13B07FE81A69327A00A75B9A /* RCTAlertManager.m */, 13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */, @@ -376,6 +381,7 @@ 13B0801E1A69489C00A75B9A /* RCTTextField.m in Sources */, 13B07FEF1A69327A00A75B9A /* RCTAlertManager.m in Sources */, 83CBBACC1A6023D300E9B192 /* RCTConvert.m in Sources */, + 5F5F0D991A9E456B001279FA /* RCTLocationObserver.m in Sources */, 830A229E1A66C68A008503DA /* RCTRootView.m in Sources */, 1302F0FD1A78550100EBEF02 /* RCTStaticImage.m in Sources */, 13B07FF01A69327A00A75B9A /* RCTExceptionsManager.m in Sources */, diff --git a/ReactKit/Views/RCTNavigator.h b/ReactKit/Views/RCTNavigator.h index 5d928efa7..c9051c753 100644 --- a/ReactKit/Views/RCTNavigator.h +++ b/ReactKit/Views/RCTNavigator.h @@ -11,7 +11,7 @@ @property (nonatomic, strong) UIView *reactNavSuperviewLink; @property (nonatomic, assign) NSInteger requestedTopOfStack; -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; /** * Schedules a JavaScript navigation and prevents `UIKit` from navigating until diff --git a/ReactKit/Views/RCTNavigator.m b/ReactKit/Views/RCTNavigator.m index 74e1621c2..be78fccd6 100644 --- a/ReactKit/Views/RCTNavigator.m +++ b/ReactKit/Views/RCTNavigator.m @@ -126,21 +126,6 @@ NSInteger kNeverProgressed = -10000; */ @implementation RCTNavigationController -- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - RCT_NOT_DESIGNATED_INITIALIZER(); -} - -- (instancetype)initWithNavigationBarClass:(Class)navigationBarClass toolbarClass:(Class)toolbarClass -{ - RCT_NOT_DESIGNATED_INITIALIZER(); -} - -- (instancetype)initWithRootViewController:(UIViewController *)rootViewController -{ - RCT_NOT_DESIGNATED_INITIALIZER(); -} - /** * @param callback Callback that is invoked when a "scroll" interaction begins * so that `RCTNavigator` can notify `JavaScript`. @@ -275,11 +260,6 @@ NSInteger kNeverProgressed = -10000; @implementation RCTNavigator -- (instancetype)initWithFrame:(CGRect)frame -{ - RCT_NOT_DESIGNATED_INITIALIZER(); -} - - (id)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher { if ((self = [super initWithFrame:CGRectZero])) { @@ -308,7 +288,6 @@ NSInteger kNeverProgressed = -10000; [self addSubview:_navigationController.view]; [_navigationController.view addSubview:_dummyView]; } - return self; } @@ -363,8 +342,8 @@ NSInteger kNeverProgressed = -10000; (RCTWrapperViewController *)[context viewControllerForKey:UITransitionContextToViewControllerKey]; NSUInteger indexOfFrom = [_currentViews indexOfObject:fromController.navItem]; NSUInteger indexOfTo = [_currentViews indexOfObject:toController.navItem]; - CGFloat destination = indexOfFrom < indexOfTo ? 1.0f : -1.0f; - _dummyView.frame = CGRectMake(destination, 0.0f, 0.0f, 0.0f); + CGFloat destination = indexOfFrom < indexOfTo ? 1.0 : -1.0; + _dummyView.frame = (CGRect){destination}; _currentlyTransitioningFrom = indexOfFrom; _currentlyTransitioningTo = indexOfTo; if (indexOfFrom != indexOfTo) { @@ -375,7 +354,7 @@ NSInteger kNeverProgressed = -10000; [weakSelf freeLock]; _currentlyTransitioningFrom = 0; _currentlyTransitioningTo = 0; - _dummyView.frame = CGRectMake(0.0f, 0.0f, 0.0f, 0.0f); + _dummyView.frame = CGRectZero; _displayLink.paused = YES; // Reset the parallel position tracker }]; @@ -462,7 +441,7 @@ NSInteger kNeverProgressed = -10000; } /** - * Must be overridden because UIKit destroys the views superview link when used + * Must be overridden because UIKit removes the view's superview when used * as a navigator - it's considered outside the view hierarchy. */ - (UIView *)reactSuperview @@ -490,7 +469,7 @@ NSInteger kNeverProgressed = -10000; // we can't hook up the VC hierarchy in 'init' because the subviews aren't hooked up yet, // so we do it on demand here [self addControllerToClosestParent:_navigationController]; - + NSInteger viewControllerCount = _navigationController.viewControllers.count; // The "react count" is the count of views that are visible on the navigation // stack. There may be more beyond this - that aren't visible, and may be @@ -563,7 +542,6 @@ NSInteger kNeverProgressed = -10000; _previousRequestedTopOfStack = _requestedTopOfStack; } - // TODO: This will likely fail when performing multiple pushes/pops. We must // free the lock only after the *last* push/pop. - (void)wrapperViewController:(RCTWrapperViewController *)wrapperViewController @@ -574,7 +552,7 @@ didMoveToNavigationController:(UINavigationController *)navigationController // while a push/pop is in progress. return; } - + RCTAssert( (navigationController == nil || [_navigationController.viewControllers containsObject:wrapperViewController]), @"if navigation controller is not nil, it should container the wrapper view controller" diff --git a/ReactKit/Views/RCTNavigatorManager.m b/ReactKit/Views/RCTNavigatorManager.m index 973d4958d..578b42bd0 100644 --- a/ReactKit/Views/RCTNavigatorManager.m +++ b/ReactKit/Views/RCTNavigatorManager.m @@ -5,6 +5,8 @@ #import "RCTConvert.h" #import "RCTNavigator.h" #import "RCTShadowView.h" +#import "RCTSparseArray.h" +#import "RCTUIManager.h" @implementation RCTNavigatorManager @@ -24,5 +26,26 @@ RCT_EXPORT_VIEW_PROPERTY(requestedTopOfStack) }; } -@end +// TODO: remove error callbacks +- (void)requestSchedulingJavaScriptNavigation:(NSNumber *)reactTag + errorCallback:(RCTResponseSenderBlock)errorCallback + callback:(__unused RCTResponseSenderBlock)callback +{ + RCT_EXPORT(); + [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry){ + if (reactTag) { + RCTNavigator *navigator = viewRegistry[reactTag]; + if ([navigator isKindOfClass:[RCTNavigator class]]) { + BOOL wasAcquired = [navigator requestSchedulingJavaScriptNavigation]; + callback(@[@(wasAcquired)]); + } else { + RCTLogError(@"Cannot set lock: %@ (tag #%@) is not an RCTNavigator", navigator, reactTag); + } + } else { + RCTLogError(@"Tag not specified for requestSchedulingJavaScriptNavigation"); + } + }]; +} + +@end diff --git a/ReactKit/Views/RCTScrollView.h b/ReactKit/Views/RCTScrollView.h index 82667b205..204ddf494 100644 --- a/ReactKit/Views/RCTScrollView.h +++ b/ReactKit/Views/RCTScrollView.h @@ -12,6 +12,8 @@ @interface RCTScrollView : RCTView +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; + /** * If the `contentSize` is not provided, then the `contentSize` will * automatically be determined by the size of the `RKScrollView` subview. @@ -32,6 +34,4 @@ @property (nonatomic, assign) BOOL centerContent; @property (nonatomic, copy) NSArray *stickyHeaderIndices; -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; - @end diff --git a/ReactKit/Views/RCTScrollView.m b/ReactKit/Views/RCTScrollView.m index d017c7edc..bd03d45de 100644 --- a/ReactKit/Views/RCTScrollView.m +++ b/ReactKit/Views/RCTScrollView.m @@ -31,8 +31,7 @@ CGFloat const ZINDEX_STICKY_HEADER = 50; - (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { + if ((self = [super initWithFrame:frame])) { [self.panGestureRecognizer addTarget:self action:@selector(handleCustomPan:)]; } return self; @@ -257,11 +256,6 @@ CGFloat const ZINDEX_STICKY_HEADER = 50; @synthesize nativeMainScrollDelegate = _nativeMainScrollDelegate; -- (instancetype)initWithFrame:(CGRect)frame -{ - RCT_NOT_DESIGNATED_INITIALIZER(); -} - - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher { if ((self = [super initWithFrame:CGRectZero])) { diff --git a/ReactKit/Views/RCTScrollViewManager.m b/ReactKit/Views/RCTScrollViewManager.m index 5100d1186..afcf6436a 100644 --- a/ReactKit/Views/RCTScrollViewManager.m +++ b/ReactKit/Views/RCTScrollViewManager.m @@ -31,23 +31,22 @@ RCT_EXPORT_VIEW_PROPERTY(showsHorizontalScrollIndicator) RCT_EXPORT_VIEW_PROPERTY(showsVerticalScrollIndicator) RCT_EXPORT_VIEW_PROPERTY(stickyHeaderIndices); RCT_EXPORT_VIEW_PROPERTY(throttleScrollCallbackMS); -RCT_EXPORT_VIEW_PROPERTY(zoomScale); +RCT_EXPORT_VIEW_PROPERTY(zoomScale); // TODO: this needs to be set first because it resets other props like contentOffset RCT_EXPORT_VIEW_PROPERTY(contentInset); RCT_EXPORT_VIEW_PROPERTY(scrollIndicatorInsets); RCT_EXPORT_VIEW_PROPERTY(contentOffset); -+ (NSDictionary *)constantsToExport +- (NSDictionary *)constantsToExport { - return - @{ + return @{ @"DecelerationRate": @{ - @"Normal": @(UIScrollViewDecelerationRateNormal), - @"Fast": @(UIScrollViewDecelerationRateFast), + @"Normal": @(UIScrollViewDecelerationRateNormal), + @"Fast": @(UIScrollViewDecelerationRateFast), }, @"KeyboardDismissMode": @{ - @"None": @(UIScrollViewKeyboardDismissModeNone), - @"Interactive": @(UIScrollViewKeyboardDismissModeInteractive), - @"OnDrag": @(UIScrollViewKeyboardDismissModeOnDrag), + @"None": @(UIScrollViewKeyboardDismissModeNone), + @"Interactive": @(UIScrollViewKeyboardDismissModeInteractive), + @"OnDrag": @(UIScrollViewKeyboardDismissModeOnDrag), }, }; } diff --git a/ReactKit/Views/RCTShadowView.h b/ReactKit/Views/RCTShadowView.h index ec2b8c353..9a09bad4f 100644 --- a/ReactKit/Views/RCTShadowView.h +++ b/ReactKit/Views/RCTShadowView.h @@ -3,29 +3,15 @@ #import #import "Layout.h" +#import "RCTUIManager.h" #import "RCTViewNodeProtocol.h" @class RCTSparseArray; -// TODO: amalgamate these enums? -typedef NS_ENUM(NSUInteger, RCTLayoutLifecycle) { - RCTLayoutLifecycleUninitialized = 0, - RCTLayoutLifecycleComputed, - RCTLayoutLifecycleDirtied, -}; - -// TODO: is this still needed? -typedef NS_ENUM(NSUInteger, RCTPropagationLifecycle) { - RCTPropagationLifecycleUninitialized = 0, - RCTPropagationLifecycleComputed, - RCTPropagationLifecycleDirtied, -}; - -// TODO: move this to text node? -typedef NS_ENUM(NSUInteger, RCTTextLifecycle) { - RCTTextLifecycleUninitialized = 0, - RCTTextLifecycleComputed, - RCTTextLifecycleDirtied, +typedef NS_ENUM(NSUInteger, RCTUpdateLifecycle) { + RCTUpdateLifecycleUninitialized = 0, + RCTUpdateLifecycleComputed, + RCTUpdateLifecycleDirtied, }; // TODO: is this redundact now? @@ -48,7 +34,7 @@ typedef void (^RCTApplierBlock)(RCTSparseArray *); @property (nonatomic, copy) NSString *moduleName; @property (nonatomic, assign) BOOL isBGColorExplicitlySet; // Used to propogate to children @property (nonatomic, strong) UIColor *backgroundColor; // Used to propogate to children -@property (nonatomic, assign) RCTLayoutLifecycle layoutLifecycle; +@property (nonatomic, assign) RCTUpdateLifecycle layoutLifecycle; /** * isNewView - Used to track the first time the view is introduced into the hierarchy. It is initialized YES, then is @@ -122,11 +108,23 @@ typedef void (^RCTApplierBlock)(RCTSparseArray *); @property (nonatomic, assign) css_wrap_type_t flexWrap; @property (nonatomic, assign) CGFloat flex; -- (void)collectUpdatedProperties:(NSMutableSet *)viewsWithNewProperties parentProperties:(NSDictionary *)parentProperties; -- (void)collectRootUpdatedFrames:(NSMutableSet *)viewsWithNewFrame parentConstraint:(CGSize)parentConstraint; -- (void)fillCSSNode:(css_node_t *)node; +/** + * Calculate property changes that need to be propagated to the view. + * The applierBlocks set contains RCTApplierBlock functions that must be applied + * on the main thread in order to update the view. + */ +- (void)collectUpdatedProperties:(NSMutableSet *)applierBlocks parentProperties:(NSDictionary *)parentProperties; -// The following are implementation details exposed to subclasses. Do not call them directly +/** + * Calculate all views whose frame needs updating after layout has been calculated. + * The viewsWithNewFrame set contains the reactTags of the views that need updating. + */ +- (void)collectRootUpdatedFrames:(NSMutableSet *)viewsWithNewFrame parentConstraint:(CGSize)parentConstraint; + +/** + * The following are implementation details exposed to subclasses. Do not call them directly + */ +- (void)fillCSSNode:(css_node_t *)node; - (void)dirtyLayout; - (BOOL)isLayoutDirty; diff --git a/ReactKit/Views/RCTShadowView.m b/ReactKit/Views/RCTShadowView.m index 4877b0d67..f8c32763f 100644 --- a/ReactKit/Views/RCTShadowView.m +++ b/ReactKit/Views/RCTShadowView.m @@ -10,46 +10,6 @@ typedef void (^RCTActionBlock)(RCTShadowView *shadowViewSelf, id value); typedef void (^RCTResetActionBlock)(RCTShadowView *shadowViewSelf); -@interface RCTLayoutAction : NSObject - -@property (nonatomic, readwrite, copy) RCTActionBlock block; -@property (nonatomic, readwrite, copy) RCTResetActionBlock resetBlock; -@property (nonatomic, readwrite, assign) NSInteger precedence; - -@end - -@implementation RCTLayoutAction @end - -#define ACTION_FOR_KEY_DEFAULT(name, default, blockIn) \ -do { \ - RCTLayoutAction *action = [[RCTLayoutAction alloc] init]; \ - action.block = blockIn; \ - action.resetBlock = ^(id idSelf1) { \ - blockIn(idSelf1, default); \ - }; \ - actions[@"" #name ""] = action; \ -} while(0) - -#define ACTION_FOR_KEY(name, blockIn) \ -ACTION_FOR_KEY_DEFAULT(name, @([defaultShadowView name]), (blockIn)) - -#define ACTION_FOR_FLOAT_KEY_DEFAULT(name, default, blockIn) \ -ACTION_FOR_KEY_DEFAULT(name, @(default), ^(id idSelf2, NSNumber *n) { \ - if (isnan([n floatValue])) { \ - RCTLogWarn(@"Got NaN for `"#name"` prop, ignoring"); \ - return; \ - } \ - blockIn(idSelf2, RCTNumberToFloat(n)); \ -}); - -#define ACTION_FOR_FLOAT_KEY(name, blockIn) \ -ACTION_FOR_FLOAT_KEY_DEFAULT(name, [defaultShadowView name], (blockIn)) - -#define ACTION_FOR_DEFAULT_UNDEFINED_KEY(name, blockIn) \ -ACTION_FOR_KEY_DEFAULT(name, nil, ^(id idSelf2, NSNumber *n) { \ - blockIn(idSelf2, n == nil ? CSS_UNDEFINED : [n floatValue]); \ -}); - #define MAX_TREE_DEPTH 30 const NSString *const RCTBackgroundColorProp = @"backgroundColor"; @@ -65,22 +25,16 @@ typedef enum { META_PROP_COUNT, } meta_prop_t; -@interface RCTShadowView() -{ - float _paddingMetaProps[META_PROP_COUNT]; - float _marginMetaProps[META_PROP_COUNT]; -} - -@end - @implementation RCTShadowView { - RCTPropagationLifecycle _propagationLifecycle; - RCTTextLifecycle _textLifecycle; + RCTUpdateLifecycle _propagationLifecycle; + RCTUpdateLifecycle _textLifecycle; NSDictionary *_lastParentProperties; NSMutableArray *_reactSubviews; BOOL _recomputePadding; BOOL _recomputeMargin; + float _paddingMetaProps[META_PROP_COUNT]; + float _marginMetaProps[META_PROP_COUNT]; } @synthesize reactTag = _reactTag; @@ -131,11 +85,6 @@ static void RCTProcessMetaProps(const float metaProps[META_PROP_COUNT], float st node->children_count = (int)_reactSubviews.count; } -- (void)applyLayoutNode:(css_node_t *)node viewsWithNewFrame:(NSMutableSet *)viewsWithNewFrame -{ - [self _applyLayoutNode:node viewsWithNewFrame:viewsWithNewFrame absolutePosition:CGPointZero]; -} - // The absolute stuff is so that we can take into account our absolute position when rounding in order to // snap to the pixel grid. For example, say you have the following structure: // @@ -165,24 +114,24 @@ static void RCTProcessMetaProps(const float metaProps[META_PROP_COUNT], float st // width = 213.5 - 106.5 = 107 // You'll notice that this is the same width we calculated for the parent view because we've taken its position into account. -- (void)_applyLayoutNode:(css_node_t *)node viewsWithNewFrame:(NSMutableSet *)viewsWithNewFrame absolutePosition:(CGPoint)absolutePosition +- (void)applyLayoutNode:(css_node_t *)node viewsWithNewFrame:(NSMutableSet *)viewsWithNewFrame absolutePosition:(CGPoint)absolutePosition { if (!node->layout.should_update) { return; } node->layout.should_update = false; - _layoutLifecycle = RCTLayoutLifecycleComputed; + _layoutLifecycle = RCTUpdateLifecycleComputed; CGPoint absoluteTopLeft = { RCTRoundPixelValue(absolutePosition.x + node->layout.position[CSS_LEFT]), RCTRoundPixelValue(absolutePosition.y + node->layout.position[CSS_TOP]) }; - + CGPoint absoluteBottomRight = { RCTRoundPixelValue(absolutePosition.x + node->layout.position[CSS_LEFT] + node->layout.dimensions[CSS_WIDTH]), RCTRoundPixelValue(absolutePosition.y + node->layout.position[CSS_TOP] + node->layout.dimensions[CSS_HEIGHT]) }; - + CGRect frame = { RCTRoundPixelValue(node->layout.position[CSS_LEFT]), RCTRoundPixelValue(node->layout.position[CSS_TOP]), @@ -205,7 +154,7 @@ static void RCTProcessMetaProps(const float metaProps[META_PROP_COUNT], float st for (int i = 0; i < node->children_count; ++i) { RCTShadowView *child = (RCTShadowView *)_reactSubviews[i]; - [child _applyLayoutNode:node->get_child(node->context, i) viewsWithNewFrame:viewsWithNewFrame absolutePosition:absolutePosition]; + [child applyLayoutNode:node->get_child(node->context, i) viewsWithNewFrame:viewsWithNewFrame absolutePosition:absolutePosition]; } } @@ -238,10 +187,10 @@ static void RCTProcessMetaProps(const float metaProps[META_PROP_COUNT], float st - (void)collectUpdatedProperties:(NSMutableSet *)applierBlocks parentProperties:(NSDictionary *)parentProperties { - if (_propagationLifecycle == RCTPropagationLifecycleComputed && [parentProperties isEqualToDictionary:_lastParentProperties]) { + if (_propagationLifecycle == RCTUpdateLifecycleComputed && [parentProperties isEqualToDictionary:_lastParentProperties]) { return; } - _propagationLifecycle = RCTPropagationLifecycleComputed; + _propagationLifecycle = RCTUpdateLifecycleComputed; _lastParentProperties = parentProperties; NSDictionary *nextProps = [self processBackgroundColor:applierBlocks parentProperties:parentProperties]; for (RCTShadowView *child in _reactSubviews) { @@ -253,7 +202,7 @@ static void RCTProcessMetaProps(const float metaProps[META_PROP_COUNT], float st { [self fillCSSNode:_cssNode]; layoutNode(_cssNode, CSS_UNDEFINED); - [self applyLayoutNode:_cssNode viewsWithNewFrame:viewsWithNewFrame]; + [self applyLayoutNode:_cssNode viewsWithNewFrame:viewsWithNewFrame absolutePosition:CGPointZero]; } + (CGRect)measureLayout:(RCTShadowView *)shadowView relativeTo:(RCTShadowView *)ancestor @@ -277,7 +226,7 @@ static void RCTProcessMetaProps(const float metaProps[META_PROP_COUNT], float st - (instancetype)init { if ((self = [super init])) { - + _frame = CGRectMake(0, 0, CSS_UNDEFINED, CSS_UNDEFINED); for (int ii = 0; ii < META_PROP_COUNT; ii++) { @@ -286,9 +235,9 @@ static void RCTProcessMetaProps(const float metaProps[META_PROP_COUNT], float st } _newView = YES; - _layoutLifecycle = RCTLayoutLifecycleUninitialized; - _propagationLifecycle = RCTPropagationLifecycleUninitialized; - _textLifecycle = RCTTextLifecycleUninitialized; + _layoutLifecycle = RCTUpdateLifecycleUninitialized; + _propagationLifecycle = RCTUpdateLifecycleUninitialized; + _textLifecycle = RCTUpdateLifecycleUninitialized; _reactSubviews = [NSMutableArray array]; @@ -309,46 +258,46 @@ static void RCTProcessMetaProps(const float metaProps[META_PROP_COUNT], float st - (void)dirtyLayout { - if (_layoutLifecycle != RCTLayoutLifecycleDirtied) { - _layoutLifecycle = RCTLayoutLifecycleDirtied; + if (_layoutLifecycle != RCTUpdateLifecycleDirtied) { + _layoutLifecycle = RCTUpdateLifecycleDirtied; [_superview dirtyLayout]; } } - (BOOL)isLayoutDirty { - return _layoutLifecycle != RCTLayoutLifecycleComputed; + return _layoutLifecycle != RCTUpdateLifecycleComputed; } - (void)dirtyPropagation { - if (_propagationLifecycle != RCTPropagationLifecycleDirtied) { - _propagationLifecycle = RCTPropagationLifecycleDirtied; + if (_propagationLifecycle != RCTUpdateLifecycleDirtied) { + _propagationLifecycle = RCTUpdateLifecycleDirtied; [_superview dirtyPropagation]; } } - (BOOL)isPropagationDirty { - return _propagationLifecycle != RCTLayoutLifecycleComputed; + return _propagationLifecycle != RCTUpdateLifecycleComputed; } - (void)dirtyText { - if (_textLifecycle != RCTTextLifecycleDirtied) { - _textLifecycle = RCTTextLifecycleDirtied; + if (_textLifecycle != RCTUpdateLifecycleDirtied) { + _textLifecycle = RCTUpdateLifecycleDirtied; [_superview dirtyText]; } } - (BOOL)isTextDirty { - return _textLifecycle != RCTTextLifecycleComputed; + return _textLifecycle != RCTUpdateLifecycleComputed; } - (void)setTextComputed { - _textLifecycle = RCTTextLifecycleComputed; + _textLifecycle = RCTUpdateLifecycleComputed; } - (void)insertReactSubview:(RCTShadowView *)subview atIndex:(NSInteger)atIndex @@ -387,7 +336,6 @@ static void RCTProcessMetaProps(const float metaProps[META_PROP_COUNT], float st return [shadowView reactTagAtPoint:relativePoint]; } } - return self.reactTag; } diff --git a/ReactKit/Views/RCTStaticImageManager.m b/ReactKit/Views/RCTStaticImageManager.m index 2cd08e1e2..84b782b1d 100644 --- a/ReactKit/Views/RCTStaticImageManager.m +++ b/ReactKit/Views/RCTStaticImageManager.m @@ -16,8 +16,7 @@ RCT_EXPORT_VIEW_PROPERTY(capInsets) RCT_REMAP_VIEW_PROPERTY(resizeMode, contentMode) - -- (void)set_src:(id)json forView:(RCTStaticImage *)view withDefaultView:(RCTStaticImage *)defaultView +RCT_CUSTOM_VIEW_PROPERTY(src, RCTStaticImage *) { if (json) { if ([[[json description] pathExtension] caseInsensitiveCompare:@"gif"] == NSOrderedSame) { @@ -29,8 +28,7 @@ RCT_REMAP_VIEW_PROPERTY(resizeMode, contentMode) view.image = defaultView.image; } } - -- (void)set_tintColor:(id)json forView:(RCTStaticImage *)view withDefaultView:(RCTStaticImage *)defaultView +RCT_CUSTOM_VIEW_PROPERTY(tintColor, RCTStaticImage *) { if (json) { view.renderingMode = UIImageRenderingModeAlwaysTemplate; diff --git a/ReactKit/Views/RCTTextField.h b/ReactKit/Views/RCTTextField.h index 2a0225f27..1688f8fdc 100644 --- a/ReactKit/Views/RCTTextField.h +++ b/ReactKit/Views/RCTTextField.h @@ -10,6 +10,6 @@ @property (nonatomic, assign) BOOL autoCorrect; @property (nonatomic, assign) UIEdgeInsets paddingEdgeInsets; // TODO: contentInset -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; @end diff --git a/ReactKit/Views/RCTTextField.m b/ReactKit/Views/RCTTextField.m index 4a70e0460..b684517b3 100644 --- a/ReactKit/Views/RCTTextField.m +++ b/ReactKit/Views/RCTTextField.m @@ -14,11 +14,6 @@ BOOL _jsRequestingFirstResponder; } -- (instancetype)initWithFrame:(CGRect)frame -{ - RCT_NOT_DESIGNATED_INITIALIZER(); -} - - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher { if ((self = [super initWithFrame:CGRectZero])) { @@ -44,7 +39,7 @@ - (void)removeReactSubview:(UIView *)subview { - // TODO: this is a bit broken - if the TextView inserts any of + // TODO: this is a bit broken - if the TextField inserts any of // it's own views below or between React's, the indices won't match [_reactSubviews removeObject:subview]; [subview removeFromSuperview]; @@ -52,7 +47,7 @@ - (void)insertReactSubview:(UIView *)view atIndex:(NSInteger)atIndex { - // TODO: this is a bit broken - if the TextView inserts any of + // TODO: this is a bit broken - if the TextField inserts any of // it's own views below or between React's, the indices won't match [_reactSubviews insertObject:view atIndex:atIndex]; [super insertSubview:view atIndex:atIndex]; diff --git a/ReactKit/Views/RCTTextFieldManager.m b/ReactKit/Views/RCTTextFieldManager.m index 368bf1d7d..5cdfd43a5 100644 --- a/ReactKit/Views/RCTTextFieldManager.m +++ b/ReactKit/Views/RCTTextFieldManager.m @@ -4,6 +4,7 @@ #import "RCTConvert.h" #import "RCTShadowView.h" +#import "RCTSparseArray.h" #import "RCTTextField.h" @implementation RCTTextFieldManager @@ -15,38 +16,34 @@ RCT_EXPORT_VIEW_PROPERTY(caretHidden) RCT_EXPORT_VIEW_PROPERTY(autoCorrect) +RCT_REMAP_VIEW_PROPERTY(autoCapitalize, autocapitalizationType) RCT_EXPORT_VIEW_PROPERTY(enabled) RCT_EXPORT_VIEW_PROPERTY(placeholder) RCT_EXPORT_VIEW_PROPERTY(text) RCT_EXPORT_VIEW_PROPERTY(font) RCT_EXPORT_VIEW_PROPERTY(clearButtonMode) -RCT_REMAP_VIEW_PROPERTY(autoCapitalize, autocapitalizationType) RCT_EXPORT_VIEW_PROPERTY(keyboardType) RCT_REMAP_VIEW_PROPERTY(color, textColor) - -- (void)set_fontSize:(id)json - forView:(RCTTextField *)view - withDefaultView:(RCTTextField *)defaultView +RCT_CUSTOM_VIEW_PROPERTY(fontSize, RCTTextField *) { view.font = [RCTConvert UIFont:view.font withSize:json ?: @(defaultView.font.pointSize)]; } - -- (void)set_FontWeight:(id)json - forView:(RCTTextField *)view - withDefaultView:(RCTTextField *)defaultView +RCT_CUSTOM_VIEW_PROPERTY(fontWeight, RCTTextField *) { view.font = [RCTConvert UIFont:view.font withWeight:json]; // TODO } - -- (void)set_fontFamily:(id)json - forView:(RCTTextField *)view - withDefaultView:(RCTTextField *)defaultView +RCT_CUSTOM_VIEW_PROPERTY(fontFamily, RCTTextField *) { view.font = [RCTConvert UIFont:view.font withFamily:json ?: defaultView.font.familyName]; } -// TODO: original code set view.paddingEdgeInsets from shadowView.paddingAsInsets -// could it be that this property is calculated asynchrously on shadow thread? +- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowView *)shadowView +{ + NSNumber *reactTag = shadowView.reactTag; + UIEdgeInsets padding = shadowView.paddingAsInsets; + return ^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) { + ((RCTTextField *)viewRegistry[reactTag]).paddingEdgeInsets = padding; + }; +} @end - diff --git a/ReactKit/Views/RCTUIActivityIndicatorViewManager.m b/ReactKit/Views/RCTUIActivityIndicatorViewManager.m index b7e0971e7..e56f01106 100644 --- a/ReactKit/Views/RCTUIActivityIndicatorViewManager.m +++ b/ReactKit/Views/RCTUIActivityIndicatorViewManager.m @@ -13,12 +13,9 @@ RCT_EXPORT_VIEW_PROPERTY(activityIndicatorViewStyle) RCT_EXPORT_VIEW_PROPERTY(color) - -- (void)set_animating:(NSNumber *)value - forView:(UIActivityIndicatorView *)view - withDefaultView:(UIActivityIndicatorView *)defaultView +RCT_CUSTOM_VIEW_PROPERTY(animating, UIActivityIndicatorView *) { - BOOL animating = value ? [value boolValue] : [defaultView isAnimating]; + BOOL animating = json ? [json boolValue] : [defaultView isAnimating]; if (animating != [view isAnimating]) { if (animating) { [view startAnimating]; @@ -28,7 +25,7 @@ RCT_EXPORT_VIEW_PROPERTY(color) } } -+ (NSDictionary *)constantsToExport +- (NSDictionary *)constantsToExport { return @{ diff --git a/ReactKit/Views/RCTView.h b/ReactKit/Views/RCTView.h index 77dee1df8..802336633 100644 --- a/ReactKit/Views/RCTView.h +++ b/ReactKit/Views/RCTView.h @@ -11,7 +11,6 @@ @interface RCTView : UIView @property (nonatomic, assign) RCTPointerEvents pointerEvents; -@property (nonatomic, copy) NSString *overrideAccessibilityLabel; + (void)autoAdjustInsetsForView:(UIView *)parentView withScrollView:(UIScrollView *)scrollView diff --git a/ReactKit/Views/RCTView.m b/ReactKit/Views/RCTView.m index abe6f00d9..dd0144009 100644 --- a/ReactKit/Views/RCTView.m +++ b/ReactKit/Views/RCTView.m @@ -34,8 +34,8 @@ static NSString *RCTRecursiveAccessibilityLabel(UIView *view) - (NSString *)accessibilityLabel { - if (self.overrideAccessibilityLabel) { - return self.overrideAccessibilityLabel; + if (super.accessibilityLabel) { + return super.accessibilityLabel; } return RCTRecursiveAccessibilityLabel(self); } @@ -84,7 +84,7 @@ static NSString *RCTRecursiveAccessibilityLabel(UIView *view) UIEdgeInsets baseInset = parentView.contentInset; CGFloat previousInsetTop = scrollView.contentInset.top; CGPoint contentOffset = scrollView.contentOffset; - + if (parentView.automaticallyAdjustContentInsets) { UIEdgeInsets autoInset = [self contentInsetsForView:parentView]; baseInset.top += autoInset.top; @@ -94,7 +94,7 @@ static NSString *RCTRecursiveAccessibilityLabel(UIView *view) } [scrollView setContentInset:baseInset]; [scrollView setScrollIndicatorInsets:baseInset]; - + if (updateOffset) { // If we're adjusting the top inset, then let's also adjust the contentOffset so that the view // elements above the top guide do not cover the content. diff --git a/ReactKit/Views/RCTViewManager.h b/ReactKit/Views/RCTViewManager.h index e77be09c1..d3b7c8a01 100644 --- a/ReactKit/Views/RCTViewManager.h +++ b/ReactKit/Views/RCTViewManager.h @@ -2,9 +2,11 @@ #import +#import "RCTBridgeModule.h" #import "RCTConvert.h" #import "RCTLog.h" +@class RCTBridge; @class RCTEventDispatcher; @class RCTShadowView; @class RCTSparseArray; @@ -12,19 +14,22 @@ typedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, RCTSparseArray *viewRegistry); -@interface RCTViewManager : NSObject +@interface RCTViewManager : NSObject /** - * Designated initializer for view modules. Override this when subclassing. + * The bridge can be used to access both the RCTUIIManager and the RCTEventDispatcher, + * allowing the manager (or the views that it manages) to manipulate the view + * hierarchy and send events back to the JS context. */ -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; +@property (nonatomic, strong) RCTBridge *bridge; /** * The event dispatcher is used to send events back to the JavaScript application. * It can either be used directly by the module, or passed on to instantiated * view subclasses so that they can handle their own events. */ -@property (nonatomic, readonly, weak) RCTEventDispatcher *eventDispatcher; +// TODO: remove this, as it can be accessed directly from bridge +@property (nonatomic, readonly) RCTEventDispatcher *eventDispatcher; /** * The module name exposed to React JS. If omitted, this will be inferred @@ -88,34 +93,19 @@ typedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, RCTSparseArray *v + (NSDictionary *)customDirectEventTypes; /** - * Injects constants into JS. These constants are made accessible via - * NativeModules.moduleName.X. Note that this method is not inherited when you - * subclass a view module, and you should not call [super constantsToExport] - * when overriding it. + * Called to notify manager that layout has finished, in case any calculated + * properties need to be copied over from shadow view to view. */ -+ (NSDictionary *)constantsToExport; +- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowView *)shadowView; /** - * To deprecate, hopefully + * Called after view hierarchy manipulation has finished, and all shadow props + * have been set, but before layout has been performed. Useful for performing + * custo layout logic or tasks that involve walking the view hierarchy. + * To be deprecated, hopefully. */ - (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(RCTSparseArray *)shadowViewRegistry; -/** - * Informal protocol for setting view and shadowView properties. - * Implement methods matching these patterns to set any properties that - * require special treatment (e.g. where the type or name cannot be inferred). - * - * - (void)set_:(id)property - * forView:(UIView *)view - * withDefaultView:(UIView *)defaultView; - * - * - (void)set_:(id)property - * forShadowView:(RCTShadowView *)view - * withDefaultView:(RCTShadowView *)defaultView; - * - * For simple cases, use the macros below: - */ - /** * This handles the simple case, where JS and native property names match * And the type can be automatically inferred. @@ -131,10 +121,21 @@ RCT_REMAP_VIEW_PROPERTY(name, name) - (void)set_##name:(id)json forView:(id)view withDefaultView:(id)defaultView { \ if ((json && !RCTSetProperty(view, @#keypath, json)) || \ (!json && !RCTCopyProperty(view, defaultView, @#keypath))) { \ - RCTLogMustFix(@"%@ does not have setter for `%s` property", [view class], #name); \ + RCTLogError(@"%@ does not have setter for `%s` property", [view class], #name); \ } \ } +/** + * These macros can be used when you need to provide custom logic for setting + * view properties. The macro should be followed by a method body, which can + * refer to "json", "view" and "defaultView" to implement the required logic. + */ +#define RCT_CUSTOM_VIEW_PROPERTY(name, viewType) \ +- (void)set_##name:(id)json forView:(viewType)view withDefaultView:(viewType)defaultView + +#define RCT_CUSTOM_SHADOW_PROPERTY(name, viewType) \ +- (void)set_##name:(id)json forShadowView:(viewType)view withDefaultView:(viewType)defaultView + /** * These are useful in cases where the module's superclass handles a * property, but you wish to "unhandle" it, so it will be ignored. diff --git a/ReactKit/Views/RCTViewManager.m b/ReactKit/Views/RCTViewManager.m index 05ecc2198..d534e0e8b 100644 --- a/ReactKit/Views/RCTViewManager.m +++ b/ReactKit/Views/RCTViewManager.m @@ -2,32 +2,33 @@ #import "RCTViewManager.h" +#import "RCTBridge.h" #import "RCTConvert.h" #import "RCTEventDispatcher.h" #import "RCTLog.h" #import "RCTShadowView.h" +#import "RCTUtils.h" #import "RCTView.h" @implementation RCTViewManager -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher +@synthesize bridge = _bridge; + +- (RCTEventDispatcher *)eventDispatcher { - if ((self = [super init])) { - _eventDispatcher = eventDispatcher; - } - return self; + return _bridge.eventDispatcher; } + (NSString *)moduleName { // Default implementation, works in most cases NSString *name = NSStringFromClass(self); + if ([name hasPrefix:@"RK"]) { + name = [name stringByReplacingCharactersInRange:(NSRange){0,@"RK".length} withString:@"RCT"]; + } if ([name hasPrefix:@"RCTUI"]) { name = [name substringFromIndex:@"RCT".length]; } - if ([name hasSuffix:@"Manager"]) { - name = [name substringToIndex:name.length - @"Manager".length]; - } return name; } @@ -51,7 +52,12 @@ return nil; } -+ (NSDictionary *)constantsToExport +- (NSDictionary *)constantsToExport +{ + return nil; +} + +- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowView *)shadowView { return nil; } @@ -77,28 +83,22 @@ RCT_REMAP_VIEW_PROPERTY(borderColor, layer.borderColor); RCT_REMAP_VIEW_PROPERTY(borderRadius, layer.cornerRadius) RCT_REMAP_VIEW_PROPERTY(borderWidth, layer.borderWidth) RCT_REMAP_VIEW_PROPERTY(transformMatrix, layer.transform) - -- (void)set_overflow:(id)json - forView:(UIView *)view - withDefaultView:(UIView *)defaultView +RCT_CUSTOM_VIEW_PROPERTY(overflow, UIView *) { view.clipsToBounds = json ? ![RCTConvert css_overflow:json] : defaultView.clipsToBounds; } - -- (void)set_pointerEvents:(id)json - forView:(RCTView *)view - withDefaultView:(RCTView *)defaultView +RCT_CUSTOM_VIEW_PROPERTY(pointerEvents, RCTView *) { if ([view respondsToSelector:@selector(setPointerEvents:)]) { view.pointerEvents = json ? [RCTConvert RCTPointerEvents:json] : defaultView.pointerEvents; return; } - + if (!json) { view.userInteractionEnabled = defaultView.userInteractionEnabled; return; } - + switch ([RCTConvert NSInteger:json]) { case RCTPointerEventsUnspecified: // Pointer events "unspecified" acts as if a stylesheet had not specified, @@ -117,54 +117,34 @@ RCT_REMAP_VIEW_PROPERTY(transformMatrix, layer.transform) // ShadowView properties -- (void)set_backgroundColor:(id)json - forShadowView:(RCTShadowView *)shadowView - withDefaultView:(RCTShadowView *)defaultView +RCT_CUSTOM_SHADOW_PROPERTY(backgroundColor, RCTShadowView *) { - shadowView.backgroundColor = json ? [RCTConvert UIColor:json] : defaultView.backgroundColor; - shadowView.isBGColorExplicitlySet = json ? YES : defaultView.isBGColorExplicitlySet; + view.backgroundColor = json ? [RCTConvert UIColor:json] : defaultView.backgroundColor; + view.isBGColorExplicitlySet = json ? YES : defaultView.isBGColorExplicitlySet; } - -- (void)set_flexDirection:(id)json - forShadowView:(RCTShadowView *)shadowView - withDefaultView:(RCTShadowView *)defaultView +RCT_CUSTOM_SHADOW_PROPERTY(flexDirection, RCTShadowView *) { - shadowView.flexDirection = json? [RCTConvert css_flex_direction_t:json] : defaultView.flexDirection; + view.flexDirection = json? [RCTConvert css_flex_direction_t:json] : defaultView.flexDirection; } - -- (void)set_flexWrap:(id)json - forShadowView:(RCTShadowView *)shadowView - withDefaultView:(RCTShadowView *)defaultView +RCT_CUSTOM_SHADOW_PROPERTY(flexWrap, RCTShadowView *) { - shadowView.flexWrap = json ? [RCTConvert css_wrap_type_t:json] : defaultView.flexWrap; + view.flexWrap = json ? [RCTConvert css_wrap_type_t:json] : defaultView.flexWrap; } - -- (void)set_justifyContent:(id)json - forShadowView:(RCTShadowView *)shadowView - withDefaultView:(RCTShadowView *)defaultView +RCT_CUSTOM_SHADOW_PROPERTY(justifyContent, RCTShadowView *) { - shadowView.justifyContent = json ? [RCTConvert css_justify_t:json] : defaultView.justifyContent; + view.justifyContent = json ? [RCTConvert css_justify_t:json] : defaultView.justifyContent; } - -- (void)set_alignItems:(id)json - forShadowView:(RCTShadowView *)shadowView - withDefaultView:(RCTShadowView *)defaultView +RCT_CUSTOM_SHADOW_PROPERTY(alignItems, RCTShadowView *) { - shadowView.alignItems = json ? [RCTConvert css_align_t:json] : defaultView.alignItems; + view.alignItems = json ? [RCTConvert css_align_t:json] : defaultView.alignItems; } - -- (void)set_alignSelf:(id)json - forShadowView:(RCTShadowView *)shadowView - withDefaultView:(RCTShadowView *)defaultView +RCT_CUSTOM_SHADOW_PROPERTY(alignSelf, RCTShadowView *) { - shadowView.alignSelf = json ? [RCTConvert css_align_t:json] : defaultView.alignSelf; + view.alignSelf = json ? [RCTConvert css_align_t:json] : defaultView.alignSelf; } - -- (void)set_position:(id)json - forShadowView:(RCTShadowView *)shadowView - withDefaultView:(RCTShadowView *)defaultView +RCT_CUSTOM_SHADOW_PROPERTY(position, RCTShadowView *) { - shadowView.positionType = json ? [RCTConvert css_position_type_t:json] : defaultView.positionType; + view.positionType = json ? [RCTConvert css_position_type_t:json] : defaultView.positionType; } @end diff --git a/ReactKit/Views/RCTWrapperViewController.h b/ReactKit/Views/RCTWrapperViewController.h index d8f22270a..69075c6a4 100644 --- a/ReactKit/Views/RCTWrapperViewController.h +++ b/ReactKit/Views/RCTWrapperViewController.h @@ -15,8 +15,11 @@ didMoveToNavigationController:(UINavigationController *)navigationController; @interface RCTWrapperViewController : UIViewController -- (instancetype)initWithContentView:(UIView *)contentView eventDispatcher:(RCTEventDispatcher *)eventDispatcher; -- (instancetype)initWithNavItem:(RCTNavItem *)navItem eventDispatcher:(RCTEventDispatcher *)eventDispatcher; +- (instancetype)initWithContentView:(UIView *)contentView + eventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithNavItem:(RCTNavItem *)navItem + eventDispatcher:(RCTEventDispatcher *)eventDispatcher; @property (nonatomic, readwrite, weak) id navigationListener; @property (nonatomic, strong, readwrite) RCTNavItem *navItem; diff --git a/ReactKit/Views/RCTWrapperViewController.m b/ReactKit/Views/RCTWrapperViewController.m index d027dc2f2..6b58d6631 100644 --- a/ReactKit/Views/RCTWrapperViewController.m +++ b/ReactKit/Views/RCTWrapperViewController.m @@ -15,11 +15,6 @@ CGFloat _previousBottomLayout; } -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - RCT_NOT_DESIGNATED_INITIALIZER(); -} - - (instancetype)initWithContentView:(UIView *)contentView eventDispatcher:(RCTEventDispatcher *)eventDispatcher { if ((self = [super initWithNibName:nil bundle:nil])) { diff --git a/jestSupport/scriptPreprocess.js b/jestSupport/scriptPreprocess.js index 02d3f6341..2764b35bd 100644 --- a/jestSupport/scriptPreprocess.js +++ b/jestSupport/scriptPreprocess.js @@ -2,8 +2,8 @@ var transformer = require('../packager/transformer.js'); -function transformSource(src) { - return transformer.transform(null, src).code; +function transformSource(src, filename) { + return transformer.transform(src, filename).code; } module.exports = { @@ -15,7 +15,7 @@ module.exports = { } try { - return transformSource(src); + return transformSource(src, fileName); } catch(e) { throw new Error('\nError transforming file:\n js/' + (fileName.split('/js/')[1] || fileName) + ':' + e.lineNumber + ': \'' + diff --git a/packager/react-packager/src/Activity/__tests__/Activity-test.js b/packager/react-packager/src/Activity/__tests__/Activity-test.js index bd0265f96..7fe316148 100644 --- a/packager/react-packager/src/Activity/__tests__/Activity-test.js +++ b/packager/react-packager/src/Activity/__tests__/Activity-test.js @@ -10,6 +10,7 @@ describe('Activity', function() { beforeEach(function() { console.log = jest.genMockFn(); Activity = require('../'); + jest.runOnlyPendingTimers(); }); afterEach(function() { @@ -60,12 +61,15 @@ describe('Activity', function() { expect(function() { Activity.endEvent(eid); - }).toThrow('event(1) has already ended!'); + }).toThrow('event(3) has already ended!'); + + jest.runOnlyPendingTimers(); }); }); describe('signal', function() { it('writes a SIGNAL event out to the console', function() { + var EVENT_NAME = 'EVENT_NAME'; var DATA = {someData: 42}; diff --git a/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/__tests__/DependencyGraph-test.js b/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/__tests__/DependencyGraph-test.js index 1c268c6b0..eb839296c 100644 --- a/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/__tests__/DependencyGraph-test.js +++ b/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/__tests__/DependencyGraph-test.js @@ -5,7 +5,6 @@ jest .dontMock('q') .dontMock('path') .dontMock('absolute-path') - .dontMock('../../../../fb-path-utils') .dontMock('../docblock') .setMock('../../../ModuleDescriptor', function(data) {return data;}); diff --git a/packager/react-packager/src/FileWatcher/__mocks__/sane.js b/packager/react-packager/src/FileWatcher/__mocks__/sane.js new file mode 100644 index 000000000..20dda2a2b --- /dev/null +++ b/packager/react-packager/src/FileWatcher/__mocks__/sane.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = { + WatchmanWatcher: jest.genMockFromModule('sane/src/watchman_watcher') +}; diff --git a/packager/react-packager/src/JSTransformer/__mocks__/q.js b/packager/react-packager/src/JSTransformer/__mocks__/q.js new file mode 100644 index 000000000..3d4d21f15 --- /dev/null +++ b/packager/react-packager/src/JSTransformer/__mocks__/q.js @@ -0,0 +1,6 @@ +'use strict'; + +// Bug with Jest because we're going to the node_modules that is a sibling +// of what jest thinks our root (the dir with the package.json) should be. + +module.exports = require.requireActual('q'); diff --git a/packager/react-packager/src/JSTransformer/__mocks__/underscore.js b/packager/react-packager/src/JSTransformer/__mocks__/underscore.js new file mode 100644 index 000000000..a985ab206 --- /dev/null +++ b/packager/react-packager/src/JSTransformer/__mocks__/underscore.js @@ -0,0 +1,5 @@ +'use strict'; + +// Bug with Jest because we're going to the node_modules that is a sibling +// of what jest thinks our root (the dir with the package.json) should be. +module.exports = require.requireActual('underscore'); diff --git a/packager/react-packager/src/JSTransformer/__tests__/Cache-test.js b/packager/react-packager/src/JSTransformer/__tests__/Cache-test.js index 232d6ff44..97a500973 100644 --- a/packager/react-packager/src/JSTransformer/__tests__/Cache-test.js +++ b/packager/react-packager/src/JSTransformer/__tests__/Cache-test.js @@ -3,7 +3,6 @@ jest .dontMock('underscore') .dontMock('path') - .dontMock('q') .dontMock('absolute-path') .dontMock('../Cache'); @@ -194,7 +193,7 @@ describe('JSTransformer Cache', function() { return q('baz value'); }); - jest.runAllTimers(); + jest.runAllTicks(); expect(fs.writeFile).toBeCalled(); }); }); diff --git a/packager/react-packager/src/JSTransformer/__tests__/Transformer-test.js b/packager/react-packager/src/JSTransformer/__tests__/Transformer-test.js index 6c9c66446..36d81d8fa 100644 --- a/packager/react-packager/src/JSTransformer/__tests__/Transformer-test.js +++ b/packager/react-packager/src/JSTransformer/__tests__/Transformer-test.js @@ -2,7 +2,6 @@ jest .dontMock('worker-farm') - .dontMock('q') .dontMock('os') .dontMock('../index'); @@ -36,7 +35,7 @@ describe('Transformer', function() { callback(null, 'content'); }); - return new Transformer(OPTIONS).loadFileAndTransform([], 'file', {}) + return new Transformer(OPTIONS).loadFileAndTransform('file') .then(function(data) { expect(data).toEqual({ code: 'transformed', @@ -59,7 +58,7 @@ describe('Transformer', function() { callback(null, {error: esprimaError}); }); - return new Transformer(OPTIONS).loadFileAndTransform([], 'foo-file.js', {}) + return new Transformer(OPTIONS).loadFileAndTransform('foo-file.js') .catch(function(error) { expect(error.type).toEqual('TransformError'); expect(error.snippet).toEqual([ diff --git a/packager/react-packager/src/JSTransformer/index.js b/packager/react-packager/src/JSTransformer/index.js index e3e713eef..87cb6e1a3 100644 --- a/packager/react-packager/src/JSTransformer/index.js +++ b/packager/react-packager/src/JSTransformer/index.js @@ -78,11 +78,7 @@ Transformer.prototype.invalidateFile = function(filePath) { this._cache.invalidate(filePath); }; -Transformer.prototype.loadFileAndTransform = function( - transformSets, - filePath, - options -) { +Transformer.prototype.loadFileAndTransform = function(filePath) { if (this._failedToStart) { return this._failedToStart; } @@ -92,15 +88,14 @@ Transformer.prototype.loadFileAndTransform = function( return readFile(filePath) .then(function(buffer) { var sourceCode = buffer.toString(); - var opts = _.extend({}, options, {filename: filePath}); + return q.nfbind(workers)({ - transformSets: transformSets, sourceCode: sourceCode, - options: opts, + filename: filePath, }).then( function(res) { if (res.error) { - throw formatEsprimaError(res.error, filePath, sourceCode); + throw formatError(res.error, filePath, sourceCode); } return { @@ -117,11 +112,26 @@ Transformer.prototype.loadFileAndTransform = function( function TransformError() {} util.inherits(TransformError, SyntaxError); -function formatEsprimaError(err, filename, source) { - if (!(err.lineNumber && err.column)) { - return err; +function formatError(err, filename, source) { + if (err.lineNumber && err.column) { + return formatEsprimaError(err, filename, source); + } else { + return formatGenericError(err, filename, source); } +} +function formatGenericError(err, filename) { + var msg = 'TransformError: ' + filename + ': ' + err.message; + var error = new TransformError(); + var stack = err.stack.split('\n').slice(0, -1); + stack.push(msg); + error.stack = stack.join('\n'); + error.message = msg; + error.type = 'TransformError'; + return error; +} + +function formatEsprimaError(err, filename, source) { var stack = err.stack.split('\n'); stack.shift(); diff --git a/packager/react-packager/src/Packager/__tests__/Package-test.js b/packager/react-packager/src/Packager/__tests__/Package-test.js index d269eb577..74a2f4379 100644 --- a/packager/react-packager/src/Packager/__tests__/Package-test.js +++ b/packager/react-packager/src/Packager/__tests__/Package-test.js @@ -1,10 +1,6 @@ 'use strict'; -jest - .dontMock('underscore') - .dontMock('../base64-vlq') - .dontMock('source-map') - .dontMock('../Package'); +jest.autoMockOff(); var SourceMapGenerator = require('source-map').SourceMapGenerator; diff --git a/packager/react-packager/src/Packager/__tests__/Packager-test.js b/packager/react-packager/src/Packager/__tests__/Packager-test.js index 21af12ca8..2e43e91a9 100644 --- a/packager/react-packager/src/Packager/__tests__/Packager-test.js +++ b/packager/react-packager/src/Packager/__tests__/Packager-test.js @@ -49,7 +49,7 @@ describe('Packager', function() { }); require('../../JSTransformer').prototype.loadFileAndTransform - .mockImpl(function(tsets, path) { + .mockImpl(function(path) { return q({ code: 'transformed ' + path, sourceCode: 'source ' + path, diff --git a/packager/react-packager/src/Packager/index.js b/packager/react-packager/src/Packager/index.js index 42295acc8..123a39133 100644 --- a/packager/react-packager/src/Packager/index.js +++ b/packager/react-packager/src/Packager/index.js @@ -126,9 +126,7 @@ Packager.prototype.getDependencies = function(main) { Packager.prototype._transformModule = function(module) { var resolver = this._resolver; return this._transformer.loadFileAndTransform( - ['es6'], - path.resolve(module.path), - this._opts.transformer || {} + path.resolve(module.path) ).then(function(transformed) { return _.extend( {}, diff --git a/packager/react-packager/src/Server/__tests__/Server-test.js b/packager/react-packager/src/Server/__tests__/Server-test.js index a9951f601..e6020c79b 100644 --- a/packager/react-packager/src/Server/__tests__/Server-test.js +++ b/packager/react-packager/src/Server/__tests__/Server-test.js @@ -3,9 +3,13 @@ jest.setMock('worker-farm', function() { return function() {}; }) .dontMock('q') .dontMock('os') - .dontMock('errno/custom') .dontMock('path') .dontMock('url') + .setMock('timers', { + setImmediate: function(fn) { + return setTimeout(fn, 0); + } + }) .dontMock('../'); var q = require('q'); @@ -75,16 +79,16 @@ describe('processRequest', function() { }); pit('returns sourcemap on request of *.map', function() { - makeRequest( + return makeRequest( requestHandler, 'mybundle.includeRequire.runModule.bundle.map' ).then(function(response) { - expect(response).toEqual('this is the source map'); + expect(response).toEqual('"this is the source map"'); }); }); pit('watches all files in projectRoot', function() { - makeRequest( + return makeRequest( requestHandler, 'mybundle.includeRequire.runModule.bundle' ).then(function(response) { @@ -107,7 +111,7 @@ describe('processRequest', function() { }); pit('invalides files in package when file is updated', function() { - makeRequest( + return makeRequest( requestHandler, 'mybundle.includeRequire.runModule.bundle' ).then(function(response) { diff --git a/packager/react-packager/src/Server/index.js b/packager/react-packager/src/Server/index.js index 14b18c965..accce205a 100644 --- a/packager/react-packager/src/Server/index.js +++ b/packager/react-packager/src/Server/index.js @@ -6,6 +6,7 @@ var declareOpts = require('../lib/declareOpts'); var FileWatcher = require('../FileWatcher'); var Packager = require('../Packager'); var Activity = require('../Activity'); +var setImmediate = require('timers').setImmediate; var q = require('q'); module.exports = Server; diff --git a/packager/transformer.js b/packager/transformer.js index ffcb80e2d..acb586d7f 100644 --- a/packager/transformer.js +++ b/packager/transformer.js @@ -16,10 +16,11 @@ var staticTypeSyntax = var visitorList = reactVisitors; -function transform(transformSets, srcTxt) { +function transform(srcTxt, filename) { var options = { es3: true, - sourceType: 'nonStrictModule' + sourceType: 'nonStrictModule', + filename: filename, }; // These tranforms mostly just erase type annotations and static typing @@ -42,8 +43,8 @@ module.exports = function(data, callback) { var result; try { result = transform( - data.transformSets, - data.sourceCode + data.sourceCode, + data.filename ); } catch (e) { return callback(null, { From 7b51a09444a3c35d5a71850f2ce9d56ba07d77f0 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Mon, 2 Mar 2015 12:44:34 -0800 Subject: [PATCH 06/79] Update RCTLocationObserver.m --- ReactKit/Modules/RCTLocationObserver.m | 3 --- 1 file changed, 3 deletions(-) diff --git a/ReactKit/Modules/RCTLocationObserver.m b/ReactKit/Modules/RCTLocationObserver.m index 6290e1850..fd9c7ac07 100644 --- a/ReactKit/Modules/RCTLocationObserver.m +++ b/ReactKit/Modules/RCTLocationObserver.m @@ -5,9 +5,6 @@ #import #import -#import -#import - #import "RCTAssert.h" #import "RCTBridge.h" #import "RCTEventDispatcher.h" From f77d9f8bae5344c5f69de305ccfe14b5a0c8a528 Mon Sep 17 00:00:00 2001 From: Felix Kling Date: Mon, 2 Mar 2015 17:31:26 -0800 Subject: [PATCH 07/79] Update react-docgen --- website/react-docgen/CONTRIBUTING.md | 43 ++ website/react-docgen/README.md | 59 +- website/react-docgen/bin/react-docgen.js | 6 +- website/react-docgen/flow/react-docgen.js | 35 ++ website/react-docgen/flow/recast.js | 5 + website/react-docgen/lib/Documentation.js | 11 - .../lib/__mocks__/Documentation.js | 28 + .../react-docgen/lib/__tests__/main-test.js | 75 +++ .../react-docgen/lib/__tests__/parse-test.js | 52 ++ .../componentDocblockHandler-test.js | 86 ++- .../__tests__/defaultPropsHandler-test.js | 73 +++ .../__tests__/propDocblockHandler-test.js | 136 ++--- .../__tests__/propTypeHandler-test.js | 516 ++++-------------- .../lib/handlers/componentDocblockHandler.js | 19 +- .../lib/handlers/defaultPropsHandler.js | 79 +++ website/react-docgen/lib/handlers/index.js | 16 + .../lib/handlers/propDocBlockHandler.js | 6 +- .../lib/handlers/propTypeHandler.js | 192 +------ website/react-docgen/lib/main.js | 62 ++- website/react-docgen/lib/parse.js | 69 +++ .../findAllReactCreateClassCalls-test.js | 106 ++++ .../findExportedReactCreateClassCall-test.js | 106 ++++ .../resolver/findAllReactCreateClassCalls.js | 47 ++ .../findExportedReactCreateClassCall.js | 78 +++ website/react-docgen/lib/resolver/index.js | 16 + .../lib/utils/__tests__/getMembers-test.js | 51 ++ .../lib/utils/__tests__/getPropType-test.js | 144 +++++ .../__tests__/getPropertyValuePath-test.js | 42 ++ .../isExportsOrModuleAssignment-test.js | 10 + .../lib/utils/__tests__/match-test.js | 41 ++ website/react-docgen/lib/utils/getMembers.js | 62 +++ website/react-docgen/lib/utils/getPropType.js | 153 ++++++ .../lib/utils/getPropertyValuePath.js | 31 ++ website/react-docgen/lib/utils/index.js | 23 + website/react-docgen/lib/utils/match.js | 2 +- website/react-docgen/package.json | 5 +- website/react-docgen/tests/preprocessor.js | 9 + website/react-docgen/tests/utils.js | 49 ++ website/server/extractDocs.js | 16 +- 39 files changed, 1785 insertions(+), 774 deletions(-) create mode 100644 website/react-docgen/CONTRIBUTING.md create mode 100644 website/react-docgen/flow/react-docgen.js create mode 100644 website/react-docgen/lib/__mocks__/Documentation.js create mode 100644 website/react-docgen/lib/__tests__/main-test.js create mode 100644 website/react-docgen/lib/__tests__/parse-test.js create mode 100644 website/react-docgen/lib/handlers/__tests__/defaultPropsHandler-test.js create mode 100644 website/react-docgen/lib/handlers/defaultPropsHandler.js create mode 100644 website/react-docgen/lib/handlers/index.js create mode 100644 website/react-docgen/lib/parse.js create mode 100644 website/react-docgen/lib/resolver/__tests__/findAllReactCreateClassCalls-test.js create mode 100644 website/react-docgen/lib/resolver/__tests__/findExportedReactCreateClassCall-test.js create mode 100644 website/react-docgen/lib/resolver/findAllReactCreateClassCalls.js create mode 100644 website/react-docgen/lib/resolver/findExportedReactCreateClassCall.js create mode 100644 website/react-docgen/lib/resolver/index.js create mode 100644 website/react-docgen/lib/utils/__tests__/getMembers-test.js create mode 100644 website/react-docgen/lib/utils/__tests__/getPropType-test.js create mode 100644 website/react-docgen/lib/utils/__tests__/getPropertyValuePath-test.js create mode 100644 website/react-docgen/lib/utils/__tests__/match-test.js create mode 100644 website/react-docgen/lib/utils/getMembers.js create mode 100644 website/react-docgen/lib/utils/getPropType.js create mode 100644 website/react-docgen/lib/utils/getPropertyValuePath.js create mode 100644 website/react-docgen/lib/utils/index.js create mode 100644 website/react-docgen/tests/preprocessor.js create mode 100644 website/react-docgen/tests/utils.js diff --git a/website/react-docgen/CONTRIBUTING.md b/website/react-docgen/CONTRIBUTING.md new file mode 100644 index 000000000..ffee7fdee --- /dev/null +++ b/website/react-docgen/CONTRIBUTING.md @@ -0,0 +1,43 @@ +# Contributing to react-docgen +We want to make contributing to this project as easy and transparent as +possible. + +## Our Development Process +The majority of development on react-docgen will occur through GitHub. Accordingly, +the process for contributing will follow standard GitHub protocol. + +## Pull Requests +We actively welcome your pull requests. +1. Fork the repo and create your branch from `master`. +2. If you've added code that should be tested, add tests +3. If you've changed APIs, update the documentation. +4. Ensure the test suite passes. +5. Make sure your code lints and typechecks. +6. If you haven't already, complete the Contributor License Agreement ("CLA"). + +## Contributor License Agreement ("CLA") +In order to accept your pull request, we need you to submit a CLA. You only need +to do this once to work on any of Facebook's open source projects. + +Complete your CLA here: + +## Issues +We use GitHub issues to track public bugs. Please ensure your description is +clear and has sufficient instructions to be able to reproduce the issue. + +Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe +disclosure of security bugs. In those cases, please go through the process +outlined on that page and do not file a public issue. + +## Coding Style +* Use semicolons; +* Commas last, +* 2 spaces for indentation (no tabs) +* Prefer `'` over `"` +* `"use strict";` +* 80 character line length +* "Attractive" + +## License +By contributing to react-docgen, you agree that your contributions will be licensed +under its BSD license. diff --git a/website/react-docgen/README.md b/website/react-docgen/README.md index e670a286e..a59645b41 100644 --- a/website/react-docgen/README.md +++ b/website/react-docgen/README.md @@ -1,15 +1,10 @@ # react-docgen -`react-docgen` extracts information from React components with which -you can generate documentation for those components. +`react-docgen` is a CLI and toolbox to help extracting information from React components, and generate documentation from it. -It uses [recast][] to parse the provided files into an AST, looks for React -component definitions, and inspects the `propTypes` and `getDefaultProps` -declarations. The output is a JSON blob with the extracted information. +It uses [recast][] to parse the source into an AST and provides methods to process this AST to extract the desired information. The output / return value is a JSON blob / JavaScript object. -Note that component definitions must follow certain guidelines in order to be -analyzable by this tool. We will work towards less strict guidelines, but there -is a limit to what is statically analyzable. +It provides a default implementation for React components defined via `React.createClass`. These component definitions must follow certain guidelines in order to be analyzable (see below for more info) ## Install @@ -41,22 +36,62 @@ Extract meta information from React components. If a directory is passed, it is recursively traversed. ``` +By default, `react-docgen` will look for the exported component created through `React.createClass` in each file. Have a look below for how to customize this behavior. + ## API -The tool can also be used programmatically to extract component information: +The tool can be used programmatically to extract component information and customize the extraction process: ```js var reactDocs = require('react-docgen'); -var componentInfo reactDocs.parseSource(src); +var componentInfo = reactDocs.parse(src); ``` -## Guidelines +As with the CLI, this will look for the exported component created through `React.createClass` in the provided source. The whole process of analyzing the source code is separated into two parts: + +- Locating/finding the nodes in the AST which define the component +- Extracting information from those nodes + +`parse` accepts more arguments with which this behavior can be customized. + +### parse(source \[, resolver \[, handlers\]\]) + +| Parameter | Type | Description | +| -------------- | ------ | --------------- | +| source | string | The source text | +| resolver | function | A function of the form `(ast: ASTNode, recast: Object) => (NodePath|Array)`. Given an AST and a reference to recast, it returns an (array of) NodePath which represents the component definition. | +| handlers | Array\ | An array of functions of the form `(documentation: Documentation, definition: NodePath) => void`. Each function is called with a `Documentation` object and a reference to the component definition as returned by `resolver`. Handlers extract relevant information from the definition and augment `documentation`. + + +#### resolver + +The resolver's task is to extract those parts from the source code which the handlers can analyze. For example, the `findExportedReactCreateClassCall` resolver inspects the AST to find + +```js +var Component = React.createClass(); +module.exports = Component; +``` + +and returns the ObjectExpression to which `` resolves. + +`findAllReactCreateClassCalls` works similarly, but simply finds all `React.createClass` calls, not only the one that creates the exported component. + + This makes it easy, together with the utility methods created to analyze the AST, to introduce new or custom resolver methods. For example, a resolver could look for plain ObjectExpressions with a `render` method or `class Component extends React.Component` instead (**note:** a default resolver for `class` based react components is planned). + +#### handlers + +Handlers do the actual work and extract the desired information from the result the resolver returned. Like the resolver, they try to delegate as much work as possible to the reusable utility functions. + +For example, while the `propTypesHandler` expects the prop types definition to be an ObjectExpression and be located inside an ObjectExpression under the property name `propTypes`, most of the work is actually performed by the `getPropType` utility function. + +## Guidelines for default resolvers and handlers - Modules have to export a single component, and only that component is analyzed. +- The component definition must be an object literal. - `propTypes` must be an object literal or resolve to an object literal in the same file. -- The `return` statement in `getDefaultProps` must consist of an object literal. +- The `return` statement in `getDefaultProps` must contain an object literal. ## Example diff --git a/website/react-docgen/bin/react-docgen.js b/website/react-docgen/bin/react-docgen.js index 4921f67ad..da5c50764 100755 --- a/website/react-docgen/bin/react-docgen.js +++ b/website/react-docgen/bin/react-docgen.js @@ -96,7 +96,7 @@ if (paths.length === 0) { source += chunk; }); process.stdin.on('end', function () { - exitWithResult(parser.parseSource(source)); + exitWithResult(parser.parse(source)); }); } @@ -112,7 +112,7 @@ function traverseDir(path, result, done) { exitWithError(error); } try { - result[filename] = parser.parseSource(content); + result[filename] = parser.parse(content); } catch(error) { writeError(error, path); } @@ -143,7 +143,7 @@ async.eachSeries(paths, function(path, done) { } else { try { - result[path] = parser.parseSource(fs.readFileSync(path)); + result[path] = parser.parse(fs.readFileSync(path)); } catch(error) { writeError(error, path); } diff --git a/website/react-docgen/flow/react-docgen.js b/website/react-docgen/flow/react-docgen.js new file mode 100644 index 000000000..645bb2a9b --- /dev/null +++ b/website/react-docgen/flow/react-docgen.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +type PropTypeDescriptor = { + name: string; + value?: any; + raw?: string; +}; + +type PropDescriptor = { + type?: PropTypeDescriptor; + required?: boolean; + defaultValue?: any; + description?: string; +}; + +declare class Documentation { + addComposes(moduleName: string): void; + getDescription(): string; + setDescription(description: string): void; + getPropDescriptor(propName: string): PropDescriptor; + toObject(): Object; +} + + +type Handler = (documentation: Documentation, path: NodePath) => void; +type Resolver = + (node: ASTNode, recast: Recast) => (NodePath|Array|void); diff --git a/website/react-docgen/flow/recast.js b/website/react-docgen/flow/recast.js index 8d87bb65c..8e73094ed 100644 --- a/website/react-docgen/flow/recast.js +++ b/website/react-docgen/flow/recast.js @@ -28,3 +28,8 @@ declare class NodePath { each(f: (p: NodePath) => void): void; map(f: (p: NodePath) => T): Array; } + +type Recast = { + parse: (src: string) => ASTNode; + print: (path: NodePath) => {code: string}; +}; diff --git a/website/react-docgen/lib/Documentation.js b/website/react-docgen/lib/Documentation.js index d23d28e40..9f457e73e 100644 --- a/website/react-docgen/lib/Documentation.js +++ b/website/react-docgen/lib/Documentation.js @@ -13,17 +13,6 @@ */ "use strict"; -type PropDescriptor = { - type?: { - name: string; - value?: any; - raw?: string; - }; - required?: boolean; - defaultValue?: any; - description?: string; -}; - class Documentation { _props: Object; _description: string; diff --git a/website/react-docgen/lib/__mocks__/Documentation.js b/website/react-docgen/lib/__mocks__/Documentation.js new file mode 100644 index 000000000..123270280 --- /dev/null +++ b/website/react-docgen/lib/__mocks__/Documentation.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +function Documentation() { + return { + description: '', + composes: [], + descriptors: {}, + getPropDescriptor(name) { + return this.descriptors[name] || (this.descriptors[name] = {}); + }, + addComposes(name) { + this.composes.push(name); + }, + setDescription(descr) { + this.description = descr; + } + }; +} + +module.exports = Documentation; diff --git a/website/react-docgen/lib/__tests__/main-test.js b/website/react-docgen/lib/__tests__/main-test.js new file mode 100644 index 000000000..e115422ee --- /dev/null +++ b/website/react-docgen/lib/__tests__/main-test.js @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +"use strict"; + +jest.autoMockOff(); + +var source = [ + 'var React = require("React");', + 'var PropTypes = React.PropTypes;', + '/**', + ' * Example component description', + ' */', + 'var Component = React.createClass({', + ' propTypes: {', + ' /**', + ' * Example prop description', + ' */', + ' foo: PropTypes.bool', + ' },', + ' getDefaultProps: function() {', + ' return {', + ' foo: true', + ' };', + ' }', + '});', + 'module.exports = Component;' +].join('\n'); + +describe('main', function() { + var utils; + var docgen; + + beforeEach(function() { + utils = require('../../tests/utils'); + docgen = require('../main'); + }); + + it('parses with default resolver/handlers', function() { + var docs = docgen.parse(source); + expect(docs).toEqual({ + description: 'Example component description', + props: { + foo: { + type: { + name: 'bool' + }, + defaultValue: { + computed: false, + value: 'true' + }, + description: 'Example prop description', + required: false + } + } + }); + }); + + it('parses with custom handlers', function() { + var docs = docgen.parse(source, null, [ + docgen.handlers.componentDocblockHandler, + ]); + expect(docs).toEqual({ + description: 'Example component description', + props: {} + }); + }); +}); diff --git a/website/react-docgen/lib/__tests__/parse-test.js b/website/react-docgen/lib/__tests__/parse-test.js new file mode 100644 index 000000000..e332b9a0f --- /dev/null +++ b/website/react-docgen/lib/__tests__/parse-test.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +"use strict"; + +jest.autoMockOff(); + +describe('parse', function() { + var utils; + var parse; + + beforeEach(function() { + utils = require('../../tests/utils'); + parse = require('../parse'); + }); + + function pathFromSource(source) { + return utils.parse(source).get('body', 0, 'expression'); + } + + it('allows custom component definition resolvers', function() { + var path = pathFromSource('({foo: "bar"})'); + var resolver = jest.genMockFunction().mockReturnValue(path); + var handler = jest.genMockFunction(); + parse('', resolver, [handler]); + + expect(resolver).toBeCalled(); + expect(handler.mock.calls[0][1]).toBe(path); + }); + + it('errors if component definition is not found', function() { + var resolver = jest.genMockFunction(); + expect(function() { + parse('', resolver); + }).toThrow(parse.ERROR_MISSING_DEFINITION); + expect(resolver).toBeCalled(); + + handler = jest.genMockFunction().mockReturnValue([]); + expect(function() { + parse('', resolver); + }).toThrow(parse.ERROR_MISSING_DEFINITION); + expect(resolver).toBeCalled(); + }); + +}); diff --git a/website/react-docgen/lib/handlers/__tests__/componentDocblockHandler-test.js b/website/react-docgen/lib/handlers/__tests__/componentDocblockHandler-test.js index fd0dfd1d6..6e9c53e18 100644 --- a/website/react-docgen/lib/handlers/__tests__/componentDocblockHandler-test.js +++ b/website/react-docgen/lib/handlers/__tests__/componentDocblockHandler-test.js @@ -11,86 +11,74 @@ "use strict"; jest.autoMockOff(); +jest.mock('../../Documentation'); -describe('React documentation parser', function() { - var parser; +describe('componentDocblockHandler', function() { + var utils; + var documentation; + var componentDocblockHandler; + + function parse(src) { + var programPath = utils.parse(src); + return programPath.get( + 'body', + programPath.node.body.length - 1, + 'declarations', + 0, + 'init', + 'arguments', + 0 + ); + } beforeEach(function() { - parser = new (require('../../ReactDocumentationParser')); - parser.addHandler(require('../componentDocblockHandler')); + utils = require('../../../tests/utils'); + documentation = new (require('../../Documentation')); + componentDocblockHandler = require('../componentDocblockHandler'); }); it('finds docblocks for component definitions', function() { - var source = [ - 'var React = require("React");', + var definition = parse([ '/**', ' * Component description', ' */', 'var Component = React.createClass({});', - 'module.exports = Component;' - ].join('\n'); + ].join('\n')); - var expectedResult = { - props: {}, - description: 'Component description' - }; - - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); + componentDocblockHandler(documentation, definition); + expect(documentation.description).toBe('Component description'); }); it('ignores other types of comments', function() { - var source = [ - 'var React = require("React");', + var definition = parse([ '/*', ' * This is not a docblock', ' */', 'var Component = React.createClass({});', - 'module.exports = Component;' - ].join('\n'); + ].join('\n')); - var expectedResult = { - props: {}, - description: '' - }; + componentDocblockHandler(documentation, definition); + expect(documentation.description).toBe(''); - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); - - - source = [ - 'var React = require("React");', + definition = parse([ '// Inline comment', 'var Component = React.createClass({});', - 'module.exports = Component;' - ].join('\n'); + ].join('\n')); - expectedResult = { - props: {}, - description: '' - }; - - result = parser.parseSource(source); - expect(result).toEqual(expectedResult); + componentDocblockHandler(documentation, definition); + expect(documentation.description).toBe(''); }); it('only considers the docblock directly above the definition', function() { - var source = [ - 'var React = require("React");', + var definition = parse([ '/**', ' * This is the wrong docblock', ' */', 'var something_else = "foo";', 'var Component = React.createClass({});', - 'module.exports = Component;' - ].join('\n'); + ].join('\n')); - var expectedResult = { - props: {}, - description: '' - }; - - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); + componentDocblockHandler(documentation, definition); + expect(documentation.description).toBe(''); }); }); diff --git a/website/react-docgen/lib/handlers/__tests__/defaultPropsHandler-test.js b/website/react-docgen/lib/handlers/__tests__/defaultPropsHandler-test.js new file mode 100644 index 000000000..dd83dfd5f --- /dev/null +++ b/website/react-docgen/lib/handlers/__tests__/defaultPropsHandler-test.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +"use strict"; + +jest.autoMockOff(); +jest.mock('../../Documentation'); + +describe('defaultPropsHandler', function() { + var utils; + var documentation; + var defaultValueHandler; + + function parse(src) { + return utils.parse(src).get('body', 0, 'expression'); + } + + beforeEach(function() { + utils = require('../../../tests/utils'); + documentation = new (require('../../Documentation')); + defaultPropsHandler = require('../defaultPropsHandler'); + }); + + it ('should find prop default values that are literals', function() { + var definition = parse([ + '({', + ' getDefaultProps: function() {', + ' return {', + ' foo: "bar",', + ' bar: 42,', + ' baz: ["foo", "bar"],', + ' abc: {xyz: abc.def, 123: 42}', + ' };', + ' }', + '});' + ].join('\n')); + + defaultPropsHandler(documentation, definition); + expect(documentation.descriptors).toEqual({ + foo: { + defaultValue: { + value: '"bar"', + computed: false + } + }, + bar: { + defaultValue: { + value: '42', + computed: false + } + }, + baz: { + defaultValue: { + value: '["foo", "bar"]', + computed: false + } + }, + abc: { + defaultValue: { + value: '{xyz: abc.def, 123: 42}', + computed: false + } + } + }); + }); +}); diff --git a/website/react-docgen/lib/handlers/__tests__/propDocblockHandler-test.js b/website/react-docgen/lib/handlers/__tests__/propDocblockHandler-test.js index 90f035b53..285e12a18 100644 --- a/website/react-docgen/lib/handlers/__tests__/propDocblockHandler-test.js +++ b/website/react-docgen/lib/handlers/__tests__/propDocblockHandler-test.js @@ -11,28 +11,25 @@ "use strict"; jest.autoMockOff(); +jest.mock('../../Documentation'); -var module_template = [ - 'var React = require("React");', - 'var PropTypes = React.PropTypes;', - 'var Component = React.createClass(%s);', - 'module.exports = Component;' -].join('\n'); - -function getSource(definition) { - return module_template.replace('%s', definition); -} - -describe('React documentation parser', function() { - var parser; +describe('propDocblockHandler', function() { + var utils; + var documentation; + var propDocblockHandler; beforeEach(function() { - parser = new (require('../../ReactDocumentationParser')); - parser.addHandler(require('../propDocblockHandler'), 'propTypes'); + utils = require('../../../tests/utils'); + documentation = new (require('../../Documentation')); + propDocblockHandler = require('../propDocblockHandler'); }); + function parse(definition) { + return utils.parse('(' + definition + ')').get('body', 0, 'expression'); + } + it('finds docblocks for prop types', function() { - var source = getSource([ + var definition = parse([ '{', ' propTypes: {', ' /**', @@ -48,24 +45,19 @@ describe('React documentation parser', function() { '}' ].join('\n')); - var expectedResult = { - description: '', - props: { - foo: { - description: 'Foo comment' - }, - bar: { - description: 'Bar comment' - } + propDocblockHandler(documentation, definition); + expect(documentation.descriptors).toEqual({ + foo: { + description: 'Foo comment' + }, + bar: { + description: 'Bar comment' } - }; - - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); + }); }); it('can handle multline comments', function() { - var source = getSource([ + var definition = parse([ '{', ' propTypes: {', ' /**', @@ -79,22 +71,17 @@ describe('React documentation parser', function() { '}' ].join('\n')); - var expectedResult = { - description: '', - props: { - foo: { - description: + propDocblockHandler(documentation, definition); + expect(documentation.descriptors).toEqual({ + foo: { + description: 'Foo comment with\nmany lines!\n\neven with empty lines in between' - } - } - }; - - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); + }, + }); }); it('ignores non-docblock comments', function() { - var source = getSource([ + var definition = parse([ '{', ' propTypes: {', ' /**', @@ -112,24 +99,19 @@ describe('React documentation parser', function() { '}' ].join('\n')); - var expectedResult = { - description: '', - props: { - foo: { - description: 'Foo comment' - }, - bar: { - description: 'Bar comment' - } + propDocblockHandler(documentation, definition); + expect(documentation.descriptors).toEqual({ + foo: { + description: 'Foo comment' + }, + bar: { + description: 'Bar comment' } - }; - - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); + }); }); it('only considers the comment with the property below it', function() { - var source = getSource([ + var definition = parse([ '{', ' propTypes: {', ' /**', @@ -141,24 +123,19 @@ describe('React documentation parser', function() { '}' ].join('\n')); - var expectedResult = { - description: '', - props: { - foo: { - description: 'Foo comment' - }, - bar: { - description: '' - } + propDocblockHandler(documentation, definition); + expect(documentation.descriptors).toEqual({ + foo: { + description: 'Foo comment' + }, + bar: { + description: '' } - }; - - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); + }); }); it('understands and ignores the spread operator', function() { - var source = getSource([ + var definition = parse([ '{', ' propTypes: {', ' ...Foo.propTypes,', @@ -166,24 +143,15 @@ describe('React documentation parser', function() { ' * Foo comment', ' */', ' foo: Prop.bool,', - ' bar: Prop.bool,', ' }', '}' ].join('\n')); - var expectedResult = { - description: '', - props: { - foo: { - description: 'Foo comment' - }, - bar: { - description: '' - } + propDocblockHandler(documentation, definition); + expect(documentation.descriptors).toEqual({ + foo: { + description: 'Foo comment' } - }; - - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); + }); }); }); diff --git a/website/react-docgen/lib/handlers/__tests__/propTypeHandler-test.js b/website/react-docgen/lib/handlers/__tests__/propTypeHandler-test.js index 7555ab0e6..d8e41adff 100644 --- a/website/react-docgen/lib/handlers/__tests__/propTypeHandler-test.js +++ b/website/react-docgen/lib/handlers/__tests__/propTypeHandler-test.js @@ -11,464 +11,164 @@ "use strict"; jest.autoMockOff(); +jest.mock('../../Documentation'); -var module_template = [ - 'var React = require("React");', - 'var PropTypes = React.PropTypes;', - 'var Component = React.createClass(%s);', - 'module.exports = Component;' -].join('\n'); - -function getSource(definition) { - return module_template.replace('%s', definition); -} - -describe('React documentation parser', function() { - var parser; +describe('propTypeHandler', function() { + var utils; + var getPropTypeMock; + var documentation; + var propTypeHandler; beforeEach(function() { - parser = new (require('../../ReactDocumentationParser')); - parser.addHandler(require('../propTypeHandler'), 'propTypes'); + utils = require('../../../tests/utils'); + getPropTypeMock = jest.genMockFunction().mockImplementation(() => ({})); + jest.setMock('../../utils/getPropType', getPropTypeMock); + jest.mock('../../utils/getPropType'); + + documentation = new (require('../../Documentation')); + propTypeHandler = require('../propTypeHandler'); + }); + + function parse(definition) { + var programPath = utils.parseWithTemplate(definition, utils.REACT_TEMPLATE); + return programPath.get( + 'body', + programPath.node.body.length - 1, + 'expression' + ); + } + + it('passes the correct argument to getPropType', function() { + var definition = parse( + '({propTypes: {foo: PropTypes.bool, abc: PropTypes.xyz}})' + ); + var propertyPath = definition.get('properties', 0, 'value'); + var fooPath = propertyPath.get('properties', 0, 'value'); + var xyzPath = propertyPath.get('properties', 1, 'value'); + + propTypeHandler(documentation, definition); + + expect(getPropTypeMock).toBeCalledWith(fooPath); + expect(getPropTypeMock).toBeCalledWith(xyzPath); }); it('finds definitions via React.PropTypes', function() { - var source = [ - 'var React = require("React");', - 'var Prop = React.PropTypes;', - 'var Prop1 = require("React").PropTypes;', - 'var Component = React.createClass({', + var definition = parse([ + '({', ' propTypes: {', - ' foo: Prop.bool,', - ' bar: Prop1.bool,', + ' foo: PropTypes.bool,', + ' bar: require("react").PropTypes.bool,', ' }', - '});', - 'module.exports = Component;' - ].join('\n'); + '})', + ].join('\n')); - var expectedResult = { - description: '', - props: { - foo: { - type: {name: 'bool'}, - required: false - }, - bar: { - type: {name: 'bool'}, - required: false - } + + propTypeHandler(documentation, definition); + expect(documentation.descriptors).toEqual({ + foo: { + type: {}, + required: false + }, + bar: { + type: {}, + required: false } - }; - - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); + }); }); it('finds definitions via the ReactPropTypes module', function() { - var source = [ - 'var React = require("React");', - 'var Prop = require("ReactPropTypes");', - 'var Component = React.createClass({', + var definition = parse([ + '({', ' propTypes: {', - ' foo: Prop.bool,', + ' foo: require("ReactPropTypes").bool,', ' }', - '});', - 'module.exports = Component;' - ].join('\n'); - - var expectedResult = { - description: '', - props: { - foo: { - type: {name: 'bool'}, - required: false - } - } - }; - - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); - }); - - it('detects simple prop types', function() { - var source = getSource([ - '{', - ' propTypes: {', - ' array_prop: PropTypes.array,', - ' bool_prop: PropTypes.bool,', - ' func_prop: PropTypes.func,', - ' number_prop: PropTypes.number,', - ' object_prop: PropTypes.object,', - ' string_prop: PropTypes.string,', - ' element_prop: PropTypes.element,', - ' any_prop: PropTypes.any,', - ' node_prop: PropTypes.node', - ' }', - '}' + '})', ].join('\n')); - var expectedResult = { - description: '', - props:{ - array_prop: { - type: {name: 'array'}, - required: false - }, - bool_prop: { - type: {name: 'bool'}, - required: false - }, - func_prop: { - type: {name: 'func'}, - required: false - }, - number_prop: { - type: {name: 'number'}, - required: false - }, - object_prop: { - type: {name: 'object'}, - required: false - }, - string_prop: { - type: {name: 'string'}, - required: false - }, - element_prop: { - type: {name: 'element'}, - required: false - }, - any_prop: { - type: {name: 'any'}, - required: false - }, - node_prop: { - type: {name: 'node'}, - required: false - } - } - }; - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); - }); - - it('detects complex prop types', function() { - var source = getSource([ - '{', - ' propTypes: {', - ' oneOf_prop: PropTypes.oneOf(["foo", "bar"]),', - ' oneOfType_prop:', - ' PropTypes.oneOfType([PropTypes.number, PropTypes.bool]),', - ' oneOfType_custom_prop:', - ' PropTypes.oneOfType([xyz]),', - ' instanceOf_prop: PropTypes.instanceOf(Foo),', - ' arrayOf_prop: PropTypes.arrayOf(PropTypes.string),', - ' shape_prop:', - ' PropTypes.shape({foo: PropTypes.string, bar: PropTypes.bool}),', - ' shape_custom_prop:', - ' PropTypes.shape({foo: xyz})', - ' }', - '}' - ].join('\n')); - - var expectedResult = { - description: '', - props:{ - oneOf_prop: { - type: { - name: 'enum', - value: [ - {value: '"foo"', computed: false}, - {value: '"bar"', computed: false} - ] - }, - required: false - }, - oneOfType_prop: { - type: { - name:'union', - value: [ - {name: 'number'}, - {name: 'bool'} - ] - }, - required: false - }, - oneOfType_custom_prop: { - type: { - name:'union', - value: [{ - name: 'custom', - raw: 'xyz' - }] - }, - required: false - }, - instanceOf_prop: { - type: { - name: 'instance', - value: 'Foo' - }, - required: false - }, - arrayOf_prop: { - type: { - name: 'arrayof', - value: {name: 'string'} - }, - required: false - }, - shape_prop: { - type: { - name: 'shape', - value: { - foo: {name: 'string'}, - bar: {name: 'bool'} - } - }, - required: false - }, - shape_custom_prop: { - type: { - name: 'shape', - value: { - foo: { - name: 'custom', - raw: 'xyz' - }, - } - }, - required: false - } - } - }; - - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); - }); - - it('resolves variables to their values', function() { - var source = [ - 'var React = require("React");', - 'var PropTypes = React.PropTypes;', - 'var shape = {bar: PropTypes.string};', - 'var Component = React.createClass({', - ' propTypes: {', - ' foo: PropTypes.shape(shape)', - ' }', - '});', - 'module.exports = Component;' - ].join('\n'); - - var expectedResult = { - description: '', - props: { - foo: { - type: { - name: 'shape', - value: { - bar: {name: 'string'} - } - }, - required: false - } - } - }; - - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); + propTypeHandler(documentation, definition); + expect(documentation.descriptors).toEqual({ + foo: { + type: {}, + required: false + }, + }); }); it('detects whether a prop is required', function() { - var source = getSource([ - '{', + var definition = parse([ + '({', ' propTypes: {', - ' array_prop: PropTypes.array.isRequired,', - ' bool_prop: PropTypes.bool.isRequired,', - ' func_prop: PropTypes.func.isRequired,', - ' number_prop: PropTypes.number.isRequired,', - ' object_prop: PropTypes.object.isRequired,', - ' string_prop: PropTypes.string.isRequired,', - ' element_prop: PropTypes.element.isRequired,', - ' any_prop: PropTypes.any.isRequired,', - ' oneOf_prop: PropTypes.oneOf(["foo", "bar"]).isRequired,', - ' oneOfType_prop: ', + ' simple_prop: PropTypes.array.isRequired,', + ' complex_prop: ', ' PropTypes.oneOfType([PropTypes.number, PropTypes.bool]).isRequired,', - ' instanceOf_prop: PropTypes.instanceOf(Foo).isRequired', ' }', - '}' + '})' ].join('\n')); - var expectedResult = { - description: '', - props:{ - array_prop: { - type: {name: 'array'}, + propTypeHandler(documentation, definition); + expect(documentation.descriptors).toEqual({ + simple_prop: { + type: {}, required: true }, - bool_prop: { - type: {name: 'bool'}, - required: true - }, - func_prop: { - type: {name: 'func'}, - required: true - }, - number_prop: { - type: {name: 'number'}, - required: true - }, - object_prop: { - type: {name: 'object'}, - required: true - }, - string_prop: { - type: {name: 'string'}, - required: true - }, - element_prop: { - type: {name: 'element'}, - required: true - }, - any_prop: { - type: {name: 'any'}, - required: true - }, - oneOf_prop: { - type: { - name: 'enum', - value: [ - {value: '"foo"', computed: false}, - {value: '"bar"', computed: false} - ] - }, - required: true - }, - oneOfType_prop: { - type: { - name: 'union', - value: [ - {name: 'number'}, - {name: 'bool'} - ] - }, - required: true - }, - instanceOf_prop: { - type: { - name: 'instance', - value: 'Foo' - }, + complex_prop: { + type: {}, required: true } - } - }; - - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); - }); - - it('detects custom validation functions', function() { - var source = getSource([ - '{', - ' propTypes: {', - ' custom_prop: function() {},', - ' custom_prop2: () => {}', - ' }', - '}' - ].join('\n')); - - var expectedResult = { - description: '', - props: { - custom_prop: { - type: { - name: 'custom', - raw: 'function() {}' - }, - required: false - }, - custom_prop2: { - type: { - name: 'custom', - raw: '() => {}' - }, - required: false - } - } - }; - - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); + }); }); it('only considers definitions from React or ReactPropTypes', function() { - var source = [ - 'var React = require("React");', - 'var PropTypes = React.PropTypes;', - 'var Prop = require("Foo");', - 'var Component = React.createClass({', + var definition = parse([ + '({', ' propTypes: {', ' custom_propA: PropTypes.bool,', ' custom_propB: Prop.bool.isRequired', ' }', - '});', - 'module.exports = Component;' - ].join('\n'); + '})', + ].join('\n')); - var expectedResult = { - description: '', - props: { - custom_propA: { - type: {name: 'bool'}, - required: false + propTypeHandler(documentation, definition); + expect(documentation.descriptors).toEqual({ + custom_propA: { + type: {}, + required: false + }, + custom_propB: { + type: { + name: 'custom', + raw: 'Prop.bool.isRequired' }, - custom_propB: { - type: { - name: 'custom', - raw: 'Prop.bool.isRequired' - }, - required: false - } + required: false } - }; - - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); + }); }); it('understands the spread operator', function() { - var source = [ - 'var React = require("React");', - 'var PropTypes = React.PropTypes;', + var definition = parse([ 'var Foo = require("Foo.react");', 'var props = {bar: PropTypes.bool};', - 'var Component = React.createClass({', + '({', ' propTypes: {', ' ...Foo.propTypes,', ' ...props,', ' foo: PropTypes.number', ' }', - '});', - 'module.exports = Component;' - ].join('\n'); + '})', + ].join('\n')); - var expectedResult = { - description: '', - composes: ['Foo.react'], - props:{ - foo: { - type: {name: 'number'}, - required: false - }, - bar: { - type: {name: 'bool'}, - required: false - }, - } - }; - - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); + propTypeHandler(documentation, definition); + expect(documentation.composes).toEqual(['Foo.react']); + expect(documentation.descriptors).toEqual({ + foo: { + type: {}, + required: false + }, + bar: { + type: {}, + required: false + }, + }); }); }); diff --git a/website/react-docgen/lib/handlers/componentDocblockHandler.js b/website/react-docgen/lib/handlers/componentDocblockHandler.js index 8cb876a06..17009fab0 100644 --- a/website/react-docgen/lib/handlers/componentDocblockHandler.js +++ b/website/react-docgen/lib/handlers/componentDocblockHandler.js @@ -25,15 +25,26 @@ function componentDocblockHandler( documentation: Documentation, path: NodePath ) { - var description = ''; - // Find parent statement (e.g. var Component = React.createClass(path);) + var description = null; + // Find parent statement (e.g. var Component = React.createClass();) while (path && !n.Statement.check(path.node)) { path = path.parent; } if (path) { - description = getDocblock(path) || ''; + description = getDocblock(path); } - documentation.setDescription(description); + if (description == null) { + // If this is the first statement in the module body, the comment is attached + // to the program node + var programPath = path; + while (programPath && !n.Program.check(programPath.node)) { + programPath = programPath.parent; + } + if (programPath.get('body', 0) === path) { + description = getDocblock(programPath); + } + } + documentation.setDescription(description || ''); } module.exports = componentDocblockHandler; diff --git a/website/react-docgen/lib/handlers/defaultPropsHandler.js b/website/react-docgen/lib/handlers/defaultPropsHandler.js new file mode 100644 index 000000000..e6f607580 --- /dev/null +++ b/website/react-docgen/lib/handlers/defaultPropsHandler.js @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +/** + * @flow + */ +"use strict"; + +var Documentation = require('../Documentation'); + +var getPropertyName = require('../utils/getPropertyName'); +var getPropertyValuePath = require('../utils/getPropertyValuePath'); +var recast = require('recast'); +var resolveToValue = require('../utils/resolveToValue'); +var types = recast.types.namedTypes; +var visit = recast.types.visit; + +function getDefaultValue(path) { + var node = path.node; + var defaultValue; + if (types.Literal.check(node)) { + defaultValue = node.raw; + } else { + path = resolveToValue(path); + node = path.node; + defaultValue = recast.print(path).code; + } + if (typeof defaultValue !== 'undefined') { + return { + value: defaultValue, + computed: types.CallExpression.check(node) || + types.MemberExpression.check(node) || + types.Identifier.check(node) + }; + } +} + +function defaultPropsHandler(documentation: Documentation, path: NodePath) { + var getDefaultPropsPath = getPropertyValuePath(path, 'getDefaultProps'); + if (!getDefaultPropsPath || + !types.FunctionExpression.check(getDefaultPropsPath.node)) { + return; + } + + // Find the value that is returned from the function and process it if it is + // an object literal. + var objectExpressionPath; + visit(getDefaultPropsPath.get('body'), { + visitFunction: () => false, + visitReturnStatement: function(path) { + var resolvedPath = resolveToValue(path.get('argument')); + if (types.ObjectExpression.check(resolvedPath.node)) { + objectExpressionPath = resolvedPath; + } + return false; + } + }); + + if (objectExpressionPath) { + objectExpressionPath.get('properties').each(function(propertyPath) { + var propDescriptor = documentation.getPropDescriptor( + getPropertyName(propertyPath) + ); + var defaultValue = getDefaultValue(propertyPath.get('value')); + if (defaultValue) { + propDescriptor.defaultValue = defaultValue; + } + }); + } +} + +module.exports = defaultPropsHandler; diff --git a/website/react-docgen/lib/handlers/index.js b/website/react-docgen/lib/handlers/index.js new file mode 100644 index 000000000..ab27a9328 --- /dev/null +++ b/website/react-docgen/lib/handlers/index.js @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +"use strict"; + +exports.componentDocblockHandler = require('./componentDocblockHandler'); +exports.defaultPropsHandler = require('./defaultPropsHandler'); +exports.propTypeHandler = require('./propTypeHandler'); +exports.propDocBlockHandler = require('./propDocBlockHandler'); diff --git a/website/react-docgen/lib/handlers/propDocBlockHandler.js b/website/react-docgen/lib/handlers/propDocBlockHandler.js index d1642e975..eda9c8beb 100644 --- a/website/react-docgen/lib/handlers/propDocBlockHandler.js +++ b/website/react-docgen/lib/handlers/propDocBlockHandler.js @@ -18,13 +18,15 @@ var Documentation = require('../Documentation'); var types = require('recast').types.namedTypes; var getDocblock = require('../utils/docblock').getDocblock; var getPropertyName = require('../utils/getPropertyName'); +var getPropertyValuePath = require('../utils/getPropertyValuePath'); function propDocBlockHandler(documentation: Documentation, path: NodePath) { - if (!types.ObjectExpression.check(path.node)) { + var propTypesPath = getPropertyValuePath(path, 'propTypes'); + if (!propTypesPath || !types.ObjectExpression.check(propTypesPath.node)) { return; } - path.get('properties').each(function(propertyPath) { + propTypesPath.get('properties').each(function(propertyPath) { // we only support documentation of actual properties, not spread if (types.Property.check(propertyPath.node)) { var propDescriptor = documentation.getPropDescriptor( diff --git a/website/react-docgen/lib/handlers/propTypeHandler.js b/website/react-docgen/lib/handlers/propTypeHandler.js index bd28a415a..37c00c937 100644 --- a/website/react-docgen/lib/handlers/propTypeHandler.js +++ b/website/react-docgen/lib/handlers/propTypeHandler.js @@ -15,27 +15,17 @@ var Documentation = require('../Documentation'); -var expressionTo = require('../utils/expressionTo'); +var getMembers = require('../utils/getMembers'); var getNameOrValue = require('../utils/getNameOrValue'); +var getPropType = require('../utils/getPropType'); var getPropertyName = require('../utils/getPropertyName'); +var getPropertyValuePath = require('../utils/getPropertyValuePath'); var isReactModuleName = require('../utils/isReactModuleName'); var recast = require('recast'); var resolveToModule = require('../utils/resolveToModule'); var resolveToValue = require('../utils/resolveToValue'); var types = recast.types.namedTypes; -var simplePropTypes = { - array: 1, - bool: 1, - func: 1, - number: 1, - object: 1, - string: 1, - any: 1, - element: 1, - node: 1 -}; - function isPropTypesExpression(path) { var moduleName = resolveToModule(path); if (moduleName) { @@ -44,154 +34,14 @@ function isPropTypesExpression(path) { return false; } -function getEnumValues(path) { - return path.get('elements').map(function(elementPath) { - return { - value: expressionTo.String(elementPath), - computed: !types.Literal.check(elementPath.node) - }; - }); -} - -function getPropTypeOneOf(path) { - types.CallExpression.assert(path.node); - - var argumentPath = path.get('arguments', 0); - var type = {name: 'enum'}; - if (!types.ArrayExpression.check(argumentPath.node)) { - type.computed = true; - type.value = expressionTo.String(argumentPath); - } else { - type.value = getEnumValues(argumentPath); - } - return type; -} - -function getPropTypeOneOfType(path) { - types.CallExpression.assert(path.node); - - var argumentPath = path.get('arguments', 0); - var type = {name: 'union'}; - if (!types.ArrayExpression.check(argumentPath.node)) { - type.computed = true; - type.value = expressionTo.String(argumentPath); - } else { - type.value = argumentPath.get('elements').map(getPropType); - } - return type; -} - -function getPropTypeArrayOf(path) { - types.CallExpression.assert(path.node); - - var argumentPath = path.get('arguments', 0); - var type = {name: 'arrayof'}; - var subType = getPropType(argumentPath); - - if (subType.name === 'unknown') { - type.value = expressionTo.String(argumentPath); - type.computed = true; - } else { - type.value = subType; - } - return type; -} - -function getPropTypeShape(path) { - types.CallExpression.assert(path.node); - - var valuePath = path.get('arguments', 0); - var type: {name: string; value: any;} = {name: 'shape', value: 'unkown'}; - if (!types.ObjectExpression.check(valuePath.node)) { - valuePath = resolveToValue(valuePath); - } - - if (types.ObjectExpression.check(valuePath.node)) { - type.value = {}; - valuePath.get('properties').each(function(propertyPath) { - type.value[getPropertyName(propertyPath)] = - getPropType(propertyPath.get('value')); - }); - } - - return type; -} - -function getPropTypeInstanceOf(path) { - types.CallExpression.assert(path.node); - - return { - name: 'instance', - value: expressionTo.String(path.get('arguments', 0)) - }; -} - -var propTypes = { - oneOf: getPropTypeOneOf, - oneOfType: getPropTypeOneOfType, - instanceOf: getPropTypeInstanceOf, - arrayOf: getPropTypeArrayOf, - shape: getPropTypeShape -}; - -/** - * Tries to identify the prop type by the following rules: - * - * Member expressions which resolve to the `React` or `ReactPropTypes` module - * are inspected to see whether their properties are prop types. Strictly - * speaking we'd have to test whether the Member expression resolves to - * require('React').PropTypes, but we are not doing this right now for - * simplicity. - * - * Everything else is treated as custom validator - */ -function getPropType(path) { - var node = path.node; - if (types.Function.check(node) || !isPropTypesExpression(path)) { - return { - name: 'custom', - raw: recast.print(path).code - }; - } - - var expressionParts = []; - - if (types.MemberExpression.check(node)) { - // React.PropTypes.something.isRequired - if (isRequired(path)) { - path = path.get('object'); - node = path.node; - } - // React.PropTypes.something - expressionParts = expressionTo.Array(path); - } - if (types.CallExpression.check(node)) { - // React.PropTypes.something() - expressionParts = expressionTo.Array(path.get('callee')); - } - - // React.PropTypes.something -> something - var propType = expressionParts.pop(); - var type; - if (propType in propTypes) { - type = propTypes[propType](path); - } else { - type = {name: (propType in simplePropTypes) ? propType : 'unknown'}; - } - return type; -} - /** * Returns true of the prop is required, according to its type defintion */ function isRequired(path) { - if (types.MemberExpression.check(path.node)) { - var expressionParts = expressionTo.Array(path); - if (expressionParts[expressionParts.length - 1] === 'isRequired') { - return true; - } - } - return false; + return getMembers(path).some( + member => !member.computed && member.path.node.name === 'isRequired' || + member.computed && member.path.node.value === 'isRequired' + ); } /** @@ -220,14 +70,18 @@ function amendPropTypes(documentation, path) { path.get('properties').each(function(propertyPath) { switch (propertyPath.node.type) { case types.Property.name: - var type = getPropType(propertyPath.get('value')); + var propDescriptor = documentation.getPropDescriptor( + getPropertyName(propertyPath) + ); + var valuePath = propertyPath.get('value'); + var type = isPropTypesExpression(valuePath) ? + getPropType(valuePath) : + {name: 'custom', raw: recast.print(valuePath).code}; + if (type) { - var propDescriptor = documentation.getPropDescriptor( - getPropertyName(propertyPath) - ); propDescriptor.type = type; - propDescriptor.required = type.name !== 'custom' && - isRequired(propertyPath.get('value')); + propDescriptor.required = + type.name !== 'custom' && isRequired(valuePath); } break; case types.SpreadProperty.name: @@ -246,13 +100,17 @@ function amendPropTypes(documentation, path) { } function propTypeHandler(documentation: Documentation, path: NodePath) { - path = resolveToValue(path); - switch (path.node.type) { + var propTypesPath = getPropertyValuePath(resolveToValue(path), 'propTypes'); + if (!propTypesPath || !types.ObjectExpression.check(propTypesPath.node)) { + return; + } + + switch (propTypesPath.node.type) { case types.ObjectExpression.name: - amendPropTypes(documentation, path); + amendPropTypes(documentation, propTypesPath); break; case types.MemberExpression.name: - amendComposes(documentation, path); + amendComposes(documentation, propTypesPath); } } diff --git a/website/react-docgen/lib/main.js b/website/react-docgen/lib/main.js index d2b184c8b..99fea25e7 100644 --- a/website/react-docgen/lib/main.js +++ b/website/react-docgen/lib/main.js @@ -13,27 +13,49 @@ */ "use strict"; +var handlers = require('./handlers'); +var parse = require('./parse'); +var resolver = require('./resolver'); +var utils = require('./utils'); + +var defaultResolver = resolver.findExportedReactCreateClassCall; +var defaultHandlers = [ + handlers.propTypeHandler, + handlers.propDocBlockHandler, + handlers.defaultPropsHandler, + handlers.componentDocblockHandler, +]; + /** - * Extractor for React documentation in JavaScript. + * See `lib/parse.js` for more information about the arguments. This function + * simply sets default values for convenience. + * + * The default resolver looks for *exported* `React.createClass(def)` calls + * and expected `def` to resolve to an object expression. + * + * The default `handlers` look for `propTypes` and `getDefaultProps` in the + * provided object expression, and extract prop type information, prop + * documentation (from docblocks), default prop values and component + * documentation (from a docblock). */ -var ReactDocumentationParser = require('./ReactDocumentationParser'); -var parser = new ReactDocumentationParser(); +function defaultParse( + src: string, + resolver?: ?Resolver, + handlers?: ?Array +): (Array|Object) { + if (!resolver) { + resolver = defaultResolver; + } + if (!handlers) { + handlers = defaultHandlers; + } -parser.addHandler( - require('./handlers/propTypeHandler'), - 'propTypes' -); -parser.addHandler( - require('./handlers/propDocBlockHandler'), - 'propTypes' -); -parser.addHandler( - require('./handlers/defaultValueHandler'), - 'getDefaultProps' -); + return parse(src, resolver, handlers); +} -parser.addHandler( - require('./handlers/componentDocblockHandler') -); - -module.exports = parser; +module.exports = { + parse: defaultParse, + handlers, + resolver, + utils +}; diff --git a/website/react-docgen/lib/parse.js b/website/react-docgen/lib/parse.js new file mode 100644 index 000000000..58b4f36d5 --- /dev/null +++ b/website/react-docgen/lib/parse.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +/** + * @flow + */ +"use strict"; + +var Documentation = require('./Documentation'); + +var recast = require('recast'); + +var ERROR_MISSING_DEFINITION = 'No suitable component definition found.'; + +function executeHandlers(handlers, componentDefinitions) { + return componentDefinitions.map(componentDefinition => { + var documentation = new Documentation(); + handlers.forEach(handler => handler(documentation, componentDefinition)); + return documentation.toObject(); + }); +} + +/** + * Takes JavaScript source code and returns an object with the information + * extract from it. + * + * `resolver` is a strategy to find the AST node(s) of the component + * definition(s) inside `src`. + * It is a function that gets passed the program AST node of + * the source as first argument, and a reference to recast as second argument. + * + * This allows you define your own strategy for finding component definitions. + * + * `handlers` is an array of functions which are passed a reference to the + * component definitions (extracted by `resolver`) so that they can extract + * information from it. They get also passed a reference to a `Documentation` + * object to attach the information to. + * + * If `resolver` returns an array of component definitions, `parse` will return + * an array of documentation objects. If `resolver` returns a single node + * instead, `parse` will return a documentation object. + */ +function parse( + src: string, + resolver: Resolver, + handlers: Array +): (Array|Object) { + var ast = recast.parse(src); + var componentDefinitions = resolver(ast.program, recast); + var isArray = Array.isArray(componentDefinitions); + + if (!componentDefinitions || (isArray && componentDefinitions.length === 0)) { + throw new Error(ERROR_MISSING_DEFINITION); + } + + return isArray ? + executeHandlers(handlers, componentDefinitions) : + executeHandlers(handlers, [componentDefinitions])[0]; +} + +module.exports = parse; +exports.ERROR_MISSING_DEFINITION = ERROR_MISSING_DEFINITION; diff --git a/website/react-docgen/lib/resolver/__tests__/findAllReactCreateClassCalls-test.js b/website/react-docgen/lib/resolver/__tests__/findAllReactCreateClassCalls-test.js new file mode 100644 index 000000000..a78e6a77d --- /dev/null +++ b/website/react-docgen/lib/resolver/__tests__/findAllReactCreateClassCalls-test.js @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +"use strict"; + +jest.autoMockOff(); + +describe('React documentation parser', function() { + var findAllReactCreateClassCalls; + var recast; + + function parse(source) { + return findAllReactCreateClassCalls( + recast.parse(source).program, + recast + ); + } + + beforeEach(function() { + findAllReactCreateClassCalls = require('../findAllReactCreateClassCalls'); + recast = require('recast'); + }); + + + it('finds React.createClass', function() { + var source = [ + 'var React = require("React");', + 'var Component = React.createClass({});', + 'module.exports = Component;' + ].join('\n'); + + var result = parse(source); + expect(Array.isArray(result)).toBe(true); + expect(result.length).toBe(1); + expect(result[0] instanceof recast.types.NodePath).toBe(true); + expect(result[0].node.type).toBe('ObjectExpression'); + }); + + it('finds React.createClass, independent of the var name', function() { + var source = [ + 'var R = require("React");', + 'var Component = R.createClass({});', + 'module.exports = Component;' + ].join('\n'); + + var result = parse(source); + expect(Array.isArray(result)).toBe(true); + expect(result.length).toBe(1); + }); + + it('does not process X.createClass of other modules', function() { + var source = [ + 'var R = require("NoReact");', + 'var Component = R.createClass({});', + 'module.exports = Component;' + ].join('\n'); + + var result = parse(source); + expect(Array.isArray(result)).toBe(true); + expect(result.length).toBe(0); + }); + + it('finds assignments to exports', function() { + var source = [ + 'var R = require("React");', + 'var Component = R.createClass({});', + 'exports.foo = 42;', + 'exports.Component = Component;' + ].join('\n'); + + var result = parse(source); + expect(Array.isArray(result)).toBe(true); + expect(result.length).toBe(1); + }); + + it('accepts multiple definitions', function() { + var source = [ + 'var R = require("React");', + 'var ComponentA = R.createClass({});', + 'var ComponentB = R.createClass({});', + 'exports.ComponentB = ComponentB;' + ].join('\n'); + + var result = parse(source); + expect(Array.isArray(result)).toBe(true); + expect(result.length).toBe(2); + + source = [ + 'var R = require("React");', + 'var ComponentA = R.createClass({});', + 'var ComponentB = R.createClass({});', + 'module.exports = ComponentB;' + ].join('\n'); + + result = parse(source); + expect(Array.isArray(result)).toBe(true); + expect(result.length).toBe(2); + }); +}); diff --git a/website/react-docgen/lib/resolver/__tests__/findExportedReactCreateClassCall-test.js b/website/react-docgen/lib/resolver/__tests__/findExportedReactCreateClassCall-test.js new file mode 100644 index 000000000..b0e4cba92 --- /dev/null +++ b/website/react-docgen/lib/resolver/__tests__/findExportedReactCreateClassCall-test.js @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +"use strict"; + +jest.autoMockOff(); + +describe('React documentation parser', function() { + var findExportedReactCreateClass; + var recast; + + function parse(source) { + return findExportedReactCreateClass( + recast.parse(source).program, + recast + ); + } + + beforeEach(function() { + findExportedReactCreateClass = + require('../findExportedReactCreateClassCall'); + recast = require('recast'); + }); + + it('finds React.createClass', function() { + var source = [ + 'var React = require("React");', + 'var Component = React.createClass({});', + 'module.exports = Component;' + ].join('\n'); + + expect(parse(source)).toBeDefined(); + }); + + it('finds React.createClass, independent of the var name', function() { + var source = [ + 'var R = require("React");', + 'var Component = R.createClass({});', + 'module.exports = Component;' + ].join('\n'); + + expect(parse(source)).toBeDefined(); + }); + + it('does not process X.createClass of other modules', function() { + var source = [ + 'var R = require("NoReact");', + 'var Component = R.createClass({});', + 'module.exports = Component;' + ].join('\n'); + + expect(parse(source)).toBeUndefined(); + }); + + it('finds assignments to exports', function() { + var source = [ + 'var R = require("React");', + 'var Component = R.createClass({});', + 'exports.foo = 42;', + 'exports.Component = Component;' + ].join('\n'); + + expect(parse(source)).toBeDefined(); + }); + + it('errors if multiple components are exported', function() { + var source = [ + 'var R = require("React");', + 'var ComponentA = R.createClass({});', + 'var ComponentB = R.createClass({});', + 'exports.ComponentA = ComponentA;', + 'exports.ComponentB = ComponentB;' + ].join('\n'); + + expect(function() { + parse(source) + }).toThrow(); + }); + + it('accepts multiple definitions if only one is exported', function() { + var source = [ + 'var R = require("React");', + 'var ComponentA = R.createClass({});', + 'var ComponentB = R.createClass({});', + 'exports.ComponentB = ComponentB;' + ].join('\n'); + + expect(parse(source)).toBeDefined(); + + source = [ + 'var R = require("React");', + 'var ComponentA = R.createClass({});', + 'var ComponentB = R.createClass({});', + 'module.exports = ComponentB;' + ].join('\n'); + + expect(parse(source)).toBeDefined(); + }); +}); diff --git a/website/react-docgen/lib/resolver/findAllReactCreateClassCalls.js b/website/react-docgen/lib/resolver/findAllReactCreateClassCalls.js new file mode 100644 index 000000000..7971a1d26 --- /dev/null +++ b/website/react-docgen/lib/resolver/findAllReactCreateClassCalls.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +/** + * @flow + */ +"use strict"; + +var isReactCreateClassCall = require('../utils/isReactCreateClassCall'); +var resolveToValue = require('../utils/resolveToValue'); + +/** + * Given an AST, this function tries to find all object expressions that are + * passed to `React.createClass` calls, by resolving all references properly. + */ +function findAllReactCreateClassCalls( + ast: ASTNode, + recast: Object +): Array { + var types = recast.types.namedTypes; + var definitions = []; + + recast.visit(ast, { + visitCallExpression: function(path) { + if (!isReactCreateClassCall(path)) { + return false; + } + // We found React.createClass. Lets get cracking! + var resolvedPath = resolveToValue(path.get('arguments', 0)); + if (types.ObjectExpression.check(resolvedPath.node)) { + definitions.push(resolvedPath); + } + return false; + } + }); + + return definitions; +} + +module.exports = findAllReactCreateClassCalls; diff --git a/website/react-docgen/lib/resolver/findExportedReactCreateClassCall.js b/website/react-docgen/lib/resolver/findExportedReactCreateClassCall.js new file mode 100644 index 000000000..ccb8a3907 --- /dev/null +++ b/website/react-docgen/lib/resolver/findExportedReactCreateClassCall.js @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +/** + * @flow + */ +"use strict"; + +var isExportsOrModuleAssignment = + require('../utils/isExportsOrModuleAssignment'); +var isReactCreateClassCall = require('../utils/isReactCreateClassCall'); +var resolveToValue = require('../utils/resolveToValue'); + +var ERROR_MULTIPLE_DEFINITIONS = + 'Multiple exported component definitions found.'; + +function ignore() { + return false; +} + +/** + * Given an AST, this function tries to find the object expression that is + * passed to `React.createClass`, by resolving all references properly. + */ +function findExportedReactCreateClass( + ast: ASTNode, + recast: Object +): ?NodePath { + var types = recast.types.namedTypes; + var definition; + + recast.visit(ast, { + visitFunctionDeclaration: ignore, + visitFunctionExpression: ignore, + visitIfStatement: ignore, + visitWithStatement: ignore, + visitSwitchStatement: ignore, + visitCatchCause: ignore, + visitWhileStatement: ignore, + visitDoWhileStatement: ignore, + visitForStatement: ignore, + visitForInStatement: ignore, + visitAssignmentExpression: function(path) { + // Ignore anything that is not `exports.X = ...;` or + // `module.exports = ...;` + if (!isExportsOrModuleAssignment(path)) { + return false; + } + // Resolve the value of the right hand side. It should resolve to a call + // expression, something like React.createClass + path = resolveToValue(path.get('right')); + if (!isReactCreateClassCall(path)) { + return false; + } + if (definition) { + // If a file exports multiple components, ... complain! + throw new Error(ERROR_MULTIPLE_DEFINITIONS); + } + // We found React.createClass. Lets get cracking! + var resolvedPath = resolveToValue(path.get('arguments', 0)); + if (types.ObjectExpression.check(resolvedPath.node)) { + definition = resolvedPath; + } + return false; + } + }); + + return definition; +} + +module.exports = findExportedReactCreateClass; diff --git a/website/react-docgen/lib/resolver/index.js b/website/react-docgen/lib/resolver/index.js new file mode 100644 index 000000000..dd3b92cc7 --- /dev/null +++ b/website/react-docgen/lib/resolver/index.js @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +"use strict"; + +exports.findAllReactCreateClassCalls = + require('./findAllReactCreateClassCalls'); +exports.findExportedReactCreateClassCall = + require('./findExportedReactCreateClassCall'); diff --git a/website/react-docgen/lib/utils/__tests__/getMembers-test.js b/website/react-docgen/lib/utils/__tests__/getMembers-test.js new file mode 100644 index 000000000..486c5dac8 --- /dev/null +++ b/website/react-docgen/lib/utils/__tests__/getMembers-test.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +"use strict"; + +jest.autoMockOff(); + +describe('getMembers', function() { + var recast; + var getMembers; + var memberExpressionPath; + + function parse(src) { + return new recast.types.NodePath( + recast.parse(src).program.body[0].expression + ); + } + + beforeEach(function() { + getMembers = require('../getMembers'); + recast = require('recast'); + memberExpressionPath = parse('foo.bar(123)(456)[baz][42]'); + }); + + + it('finds all "members" "inside" a MemberExpression', function() { + var b = recast.types.builders; + var members = getMembers(memberExpressionPath); + + //bar(123) + expect(members[0].path.node.name).toEqual('bar'); + expect(members[0].computed).toBe(false); + expect(members[0].argumentsPath.get(0).node.value).toEqual(123); + //[baz] + expect(members[1].path.node.name).toEqual('baz'); + expect(members[1].computed).toBe(true); + expect(members[1].argumentsPath).toBe(null); + //[42] + expect(members[2].path.node.value).toEqual(42); + expect(members[2].computed).toBe(true); + expect(members[2].argumentsPath).toBe(null); + }); + +}); diff --git a/website/react-docgen/lib/utils/__tests__/getPropType-test.js b/website/react-docgen/lib/utils/__tests__/getPropType-test.js new file mode 100644 index 000000000..e94208c70 --- /dev/null +++ b/website/react-docgen/lib/utils/__tests__/getPropType-test.js @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +"use strict"; + +jest.autoMockOff(); + +describe('getPropType', function() { + var utils; + var getPropType; + + function parse(src) { + return utils.parse(src).get('body', 0, 'expression'); + } + + beforeEach(function() { + getPropType = require('../getPropType'); + utils = require('../../../tests/utils'); + }); + + it('detects simple prop types', function() { + var simplePropTypes = [ + 'array', + 'bool', + 'func', + 'number', + 'object', + 'string', + 'any', + 'element', + 'node', + ]; + + simplePropTypes.forEach( + type => expect(getPropType(parse('React.PropTypes.' + type))) + .toEqual({name: type}) + ); + + // It doesn't actually matter what the MemberExpression is + simplePropTypes.forEach( + type => expect(getPropType(parse('Foo.' + type + '.bar'))) + .toEqual({name: type}) + ); + + // Doesn't even have to be a MemberExpression + simplePropTypes.forEach( + type => expect(getPropType(parse(type))) + .toEqual({name: type}) + ); + }); + + it('detects complex prop types', function() { + expect(getPropType(parse('oneOf(["foo", "bar"])'))).toEqual({ + name: 'enum', + value: [ + {value: '"foo"', computed: false}, + {value: '"bar"', computed: false} + ] + }); + + expect(getPropType(parse('oneOfType([number, bool])'))).toEqual({ + name: 'union', + value: [ + {name: 'number'}, + {name: 'bool'} + ] + }); + + // custom type + expect(getPropType(parse('oneOfType([foo])'))).toEqual({ + name: 'union', + value: [{name: 'custom', raw: 'foo'}] + }); + + // custom type + expect(getPropType(parse('instanceOf(Foo)'))).toEqual({ + name: 'instanceOf', + value: 'Foo' + }); + + expect(getPropType(parse('arrayOf(string)'))).toEqual({ + name: 'arrayOf', + value: {name: 'string'} + }); + + expect(getPropType(parse('shape({foo: string, bar: bool})'))).toEqual({ + name: 'shape', + value: { + foo: { + name: 'string' + }, + bar: { + name: 'bool' + } + } + }); + + // custom + expect(getPropType(parse('shape({foo: xyz})'))).toEqual({ + name: 'shape', + value: { + foo: { + name: 'custom', + raw: 'xyz' + } + } + }); + }); + + it('resolves variables to their values', function() { + var src = [ + 'var shape = {bar: PropTypes.string};', + 'PropTypes.shape(shape);', + ].join('\n'); + var propTypeExpression = utils.parse(src).get('body', 1, 'expression'); + + expect(getPropType(propTypeExpression)).toEqual({ + name: 'shape', + value: { + bar: {name: 'string'} + } + }); + }); + + it('detects custom validation functions', function() { + expect(getPropType(parse('(function() {})'))).toEqual({ + name: 'custom', + raw: '(function() {})' + }); + + expect(getPropType(parse('() => {}'))).toEqual({ + name: 'custom', + raw: '() => {}' + }); + }); + +}); diff --git a/website/react-docgen/lib/utils/__tests__/getPropertyValuePath-test.js b/website/react-docgen/lib/utils/__tests__/getPropertyValuePath-test.js new file mode 100644 index 000000000..5b88a86f3 --- /dev/null +++ b/website/react-docgen/lib/utils/__tests__/getPropertyValuePath-test.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +"use strict"; + +jest.autoMockOff(); + +describe('getPropertyValuePath', function() { + var recast; + var getPropertyValuePath; + + function parse(src) { + return new recast.types.NodePath( + recast.parse(src).program.body[0] + ); + } + + beforeEach(function() { + getPropertyValuePath = require('../getPropertyValuePath'); + recast = require('recast'); + }); + + it('returns the value path if the property exists', function() { + var objectExpressionPath = parse('({foo: 21, bar: 42})').get('expression'); + expect(getPropertyValuePath(objectExpressionPath, 'bar')) + .toBe(objectExpressionPath.get('properties', 1).get('value')); + }); + + it('returns undefined if the property does not exist', function() { + var objectExpressionPath = parse('({foo: 21, bar: 42})').get('expression'); + expect(getPropertyValuePath(objectExpressionPath, 'baz')) + .toBeUndefined(); + }); + +}); diff --git a/website/react-docgen/lib/utils/__tests__/isExportsOrModuleAssignment-test.js b/website/react-docgen/lib/utils/__tests__/isExportsOrModuleAssignment-test.js index 11c049c38..ecf5b5bb9 100644 --- a/website/react-docgen/lib/utils/__tests__/isExportsOrModuleAssignment-test.js +++ b/website/react-docgen/lib/utils/__tests__/isExportsOrModuleAssignment-test.js @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + "use strict"; jest.autoMockOff(); diff --git a/website/react-docgen/lib/utils/__tests__/match-test.js b/website/react-docgen/lib/utils/__tests__/match-test.js new file mode 100644 index 000000000..ae41dac52 --- /dev/null +++ b/website/react-docgen/lib/utils/__tests__/match-test.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +"use strict"; + +jest.autoMockOff(); + +describe('match', function() { + var match; + + beforeEach(function() { + match = require('../match'); + }); + + it('matches with exact properties', function() { + expect(match({foo: {bar: 42}}, {foo: {bar: 42}})).toBe(true); + }); + + it('matches a subset of properties in the target', function() { + expect(match({foo: {bar: 42, baz: "xyz"}}, {foo: {bar: 42}})).toBe(true); + }); + + it('does not match if properties are different/missing', function() { + expect(match( + {foo: {bar: 42, baz: "xyz"}}, + {foo: {bar: 21, baz: "xyz"}} + )).toBe(false); + + expect(match( + {foo: {baz: "xyz"}}, + {foo: {bar: 21, baz: "xyz"}} + )).toBe(false); + }); +}); diff --git a/website/react-docgen/lib/utils/getMembers.js b/website/react-docgen/lib/utils/getMembers.js new file mode 100644 index 000000000..e4ffce3f7 --- /dev/null +++ b/website/react-docgen/lib/utils/getMembers.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +/** + * Helper methods for dealing with MemberExpressions (and CallExpressions). + * @flow + */ +"use strict"; + +type MemberDescriptor = { + path: NodePath; + computed: boolean; + argumentsPath?: ?NodePath; +} + +var types = require('recast').types.namedTypes; + +/** + * Given a "nested" Member/CallExpression, e.g. + * + * foo.bar()[baz][42] + * + * this returns a list of "members". In this example it would be something like + * [ + * {path: NodePath, arguments: NodePath, computed: false}, + * {path: NodePath, arguments: null, computed: true}, + * {path: NodePath<42>, arguments: null, computed: false} + * ] + */ +function getMembers(path: NodePath): Array { + var result = []; + var argumentsPath = null; + loop: while(true) { + switch (true) { + case types.MemberExpression.check(path.node): + result.push({ + path: path.get('property'), + computed: path.node.computed, + argumentsPath: argumentsPath, + }); + argumentsPath = null; + path = path.get('object'); + break; + case types.CallExpression.check(path.node): + argumentsPath = path.get('arguments'); + path = path.get('callee'); + break; + default: + break loop; + } + } + return result.reverse(); +} + +module.exports = getMembers; diff --git a/website/react-docgen/lib/utils/getPropType.js b/website/react-docgen/lib/utils/getPropType.js new file mode 100644 index 000000000..6a4c291a0 --- /dev/null +++ b/website/react-docgen/lib/utils/getPropType.js @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +/** + * @flow + */ +"use strict"; + +var getMembers = require('./getMembers'); +var getPropertyName = require('./getPropertyName'); +var recast = require('recast'); +var resolveToValue = require('./resolveToValue'); + +var types = recast.types.namedTypes; + +function getEnumValues(path) { + return path.get('elements').map(function(elementPath) { + return { + value: recast.print(elementPath).code, + computed: !types.Literal.check(elementPath.node) + }; + }); +} + +function getPropTypeOneOf(argumentPath) { + var type = {name: 'enum'}; + if (!types.ArrayExpression.check(argumentPath.node)) { + type.computed = true; + type.value = recast.print(argumentPath).code; + } else { + type.value = getEnumValues(argumentPath); + } + return type; +} + +function getPropTypeOneOfType(argumentPath) { + var type = {name: 'union'}; + if (!types.ArrayExpression.check(argumentPath.node)) { + type.computed = true; + type.value = recast.print(argumentPath).code; + } else { + type.value = argumentPath.get('elements').map(getPropType); + } + return type; +} + +function getPropTypeArrayOf(argumentPath) { + var type = {name: 'arrayOf'}; + var subType = getPropType(argumentPath); + + if (subType.name === 'unknown') { + type.value = recast.print(argumentPath).code; + type.computed = true; + } else { + type.value = subType; + } + return type; +} + +function getPropTypeShape(argumentPath) { + var type: {name: string; value: any;} = {name: 'shape', value: 'unkown'}; + if (!types.ObjectExpression.check(argumentPath.node)) { + argumentPath = resolveToValue(argumentPath); + } + + if (types.ObjectExpression.check(argumentPath.node)) { + type.value = {}; + argumentPath.get('properties').each(function(propertyPath) { + type.value[getPropertyName(propertyPath)] = + getPropType(propertyPath.get('value')); + }); + } + + return type; +} + +function getPropTypeInstanceOf(argumentPath) { + return { + name: 'instanceOf', + value: recast.print(argumentPath).code + }; +} + +var simplePropTypes = { + array: 1, + bool: 1, + func: 1, + number: 1, + object: 1, + string: 1, + any: 1, + element: 1, + node: 1 +}; + +var propTypes = { + oneOf: getPropTypeOneOf, + oneOfType: getPropTypeOneOfType, + instanceOf: getPropTypeInstanceOf, + arrayOf: getPropTypeArrayOf, + shape: getPropTypeShape +}; + +/** + * Tries to identify the prop type by inspecting the path for known + * prop type names. This method doesn't check whether the found type is actually + * from React.PropTypes. It simply assumes that a match has the same meaning + * as the React.PropTypes one. + * + * If there is no match, "custom" is returned. + */ +function getPropType(path: NodePath): PropTypeDescriptor { + var node = path.node; + var descriptor; + getMembers(path).some(member => { + var node = member.path.node; + var name; + if (types.Literal.check(node)) { + name = node.value; + } else if (types.Identifier.check(node) && !member.computed) { + name = node.name; + } + if (simplePropTypes.hasOwnProperty(name)) { + descriptor = {name}; + return true; + } else if (propTypes.hasOwnProperty(name) && member.argumentsPath) { + descriptor = propTypes[name](member.argumentsPath.get(0)); + return true; + } + }); + if (!descriptor) { + if (types.Identifier.check(node) && + simplePropTypes.hasOwnProperty(node.name)) { + descriptor = {name: node.name}; + } else if (types.CallExpression.check(node) && + types.Identifier.check(node.callee) && + propTypes.hasOwnProperty(node.callee.name)) { + descriptor = propTypes[node.callee.name](path.get('arguments', 0)); + } else { + descriptor = {name: 'custom', raw: recast.print(path).code}; + } + } + return descriptor; +} + +module.exports = getPropType; diff --git a/website/react-docgen/lib/utils/getPropertyValuePath.js b/website/react-docgen/lib/utils/getPropertyValuePath.js new file mode 100644 index 000000000..40451366e --- /dev/null +++ b/website/react-docgen/lib/utils/getPropertyValuePath.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +/** + * @flow + */ +"use strict"; + +var types = require('recast').types.namedTypes; +var getPropertyName = require('./getPropertyName'); + +/** + * Given an ObjectExpression, this function returns the path of the value of + * the property with name `propertyName`. + */ +function getPropertyValuePath(path: NodePath, propertyName: string): ?NodePath { + types.ObjectExpression.assert(path.node); + + return path.get('properties') + .filter(propertyPath => getPropertyName(propertyPath) === propertyName) + .map(propertyPath => propertyPath.get('value'))[0]; +} + +module.exports = getPropertyValuePath; diff --git a/website/react-docgen/lib/utils/index.js b/website/react-docgen/lib/utils/index.js new file mode 100644 index 000000000..7db01a585 --- /dev/null +++ b/website/react-docgen/lib/utils/index.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +"use strict"; + +exports.docblock = require('./docblock'); +exports.getMembers = require('./getMembers'); +exports.getPropType = require('./getPropType'); +exports.getPropertyName = require('./getPropertyName'); +exports.getPropertyValuePath = require('./getPropertyValuePath'); +exports.isExportsOrModuleAssignment = require('./isExportsOrModuleAssignment'); +exports.isReactCreateClassCall = require('./isReactCreateClassCall'); +exports.isReactModuleName = require('./isReactModuleName'); +exports.match = require('./match'); +exports.resolveToModule = require('./resolveToModule'); +exports.resolveToValue = require('./resolveToValue'); diff --git a/website/react-docgen/lib/utils/match.js b/website/react-docgen/lib/utils/match.js index 9365d0ff8..6caeac9ca 100644 --- a/website/react-docgen/lib/utils/match.js +++ b/website/react-docgen/lib/utils/match.js @@ -30,7 +30,7 @@ function match(node: ASTNOde, pattern: Object): boolean { if (!match(node[prop], pattern[prop])) { return false; } - } else if (pattern[prop] !== pattern[prop]) { + } else if (node[prop] !== pattern[prop]) { return false; } } diff --git a/website/react-docgen/package.json b/website/react-docgen/package.json index c0f85e0f7..45a16b5e1 100644 --- a/website/react-docgen/package.json +++ b/website/react-docgen/package.json @@ -29,7 +29,8 @@ "react-tools": "^0.12.2" }, "jest": { - "scriptPreprocessor": "./preprocessor", - "testPathDirs": ["lib"] + "scriptPreprocessor": "./tests/preprocessor", + "testPathDirs": ["lib"], + "unmockedModulePathPatterns": ["tests/utils"] } } diff --git a/website/react-docgen/tests/preprocessor.js b/website/react-docgen/tests/preprocessor.js new file mode 100644 index 000000000..f827426d4 --- /dev/null +++ b/website/react-docgen/tests/preprocessor.js @@ -0,0 +1,9 @@ +"use strict"; + +var reactTools = require('react-tools'); + +function process(source) { + return reactTools.transform(source, {harmony: true, stripTypes: true}); +} + +exports.process = process; diff --git a/website/react-docgen/tests/utils.js b/website/react-docgen/tests/utils.js new file mode 100644 index 000000000..c48770427 --- /dev/null +++ b/website/react-docgen/tests/utils.js @@ -0,0 +1,49 @@ +"use strict"; + +/** + * Helper methods for tests. + */ + +var recast = require.requireActual('recast'); + +function stringify(value) { + if (Array.isArray(value)) { + return value.join('\n'); + } + return value; +} + +/** + * Returns a NodePath to the program node of the passed node + */ +function parse(src) { + return new recast.types.NodePath(recast.parse(stringify(src)).program); +} + +/** + * Injects src into template by replacing the occurrence of %s. + */ +function parseWithTemplate(src, template) { + return parse(template.replace('%s', stringify(src))); +} + +/** + * Default template that simply defines React and PropTypes. + */ +var REACT_TEMPLATE = [ + 'var React = require("React");', + 'var PropTypes = React.PropTypes;', + '%s;', +].join('\n'); + +var MODULE_TEMPLATE = [ + 'var React = require("React");', + 'var PropTypes = React.PropTypes;', + 'var Component = React.createClass(%s);', + 'module.exports = Component' +].join('\n'); + +exports.parse = parse; +exports.parseWithTemplate = parseWithTemplate; +exports.REACT_TEMPLATE = REACT_TEMPLATE; +exports.MODULE_TEMPLATE = MODULE_TEMPLATE; diff --git a/website/server/extractDocs.js b/website/server/extractDocs.js index d07395a39..b59e2b483 100644 --- a/website/server/extractDocs.js +++ b/website/server/extractDocs.js @@ -1,10 +1,4 @@ var docs = require('../react-docgen'); -var findExportedReactCreateClassCall = require( - '../react-docgen/dist/strategies/findExportedReactCreateClassCall' -); -var findAllReactCreateClassCalls = require( - '../react-docgen/dist/strategies/findAllReactCreateClassCalls' -); var fs = require('fs'); var path = require('path'); var slugify = require('../core/slugify'); @@ -18,11 +12,11 @@ function getNameFromPath(filepath) { } function docsToMarkdown(filepath, i) { - var json = docs.parseSource( + var json = docs.parse( fs.readFileSync(filepath), function(node, recast) { - return findExportedReactCreateClassCall(node, recast) || - findAllReactCreateClassCalls(node, recast)[0]; + return docs.resolver.findExportedReactCreateClassCall(node, recast) || + docs.resolver.findAllReactCreateClassCalls(node, recast)[0]; } ) @@ -50,11 +44,11 @@ function docsToMarkdown(filepath, i) { var components = [ '../Libraries/Components/Navigation/NavigatorIOS.ios.js', - '../Libraries/Components/Image/Image.ios.js', + '../Libraries/Image/Image.ios.js', '../Libraries/Components/ListView/ListView.js', '../Libraries/Components/Navigation/NavigatorIOS.ios.js', '../Libraries/Components/ScrollView/ScrollView.ios.js', - '../Libraries/Components/Text/Text.js', + '../Libraries/Text/Text.js', '../Libraries/Components/TextInput/TextInput.ios.js', '../Libraries/Components/Touchable/TouchableHighlight.js', '../Libraries/Components/Touchable/TouchableWithoutFeedback.js', From caf21ae50dd34cc4618201349c8aecd15ac5e604 Mon Sep 17 00:00:00 2001 From: Spencer Ahrens Date: Tue, 3 Mar 2015 08:38:50 -0800 Subject: [PATCH 08/79] Updates from Tuesday, March 3rd - [ReactNative] Fix OSS Projects | Spencer Ahrens - [react-packager] check-in node_modules and update tests | Amjad Masad - [react-packager] Cleanup package.json | Amjad Masad - [react-packager] Implement bundle minification | Amjad Masad - [react-packager] Add dev option to CLI | James Ide | Amjad Masad - [react-packager] Add uglify-js library | Amjad Masad - [f8] Make map zoomable on double-tap | Alex Kotliarskyi --- Examples/Movies/AppDelegate.m | 2 +- .../Movies/Movies.xcodeproj/project.pbxproj | 272 +- .../contents.xcworkspacedata | 7 + .../contents.xcworkspacedata | 10 - Examples/Movies/Podfile | 6 - Examples/Movies/Podfile.lock | 32 - .../Public/RCTDataManager/RCTDataManager.h | 10 - .../RCTNetworkImage/RCTImageDownloader.h | 22 - .../RCTNetworkImage/RCTNetworkImageView.h | 33 - .../RCTNetworkImageViewManager.h | 8 - .../Public/RCTText/RCTRawTextManager.h | 7 - .../Headers/Public/RCTText/RCTShadowRawText.h | 9 - .../Headers/Public/RCTText/RCTShadowText.h | 26 - .../Pods/Headers/Public/RCTText/RCTText.h | 13 - .../Headers/Public/RCTText/RCTTextManager.h | 8 - .../Pods/Headers/Public/ReactKit/Layout.h | 148 - .../Headers/Public/ReactKit/RCTAlertManager.h | 9 - .../Public/ReactKit/RCTAnimationType.h | 11 - .../Pods/Headers/Public/ReactKit/RCTAssert.h | 36 - .../Public/ReactKit/RCTAutoInsetsProtocol.h | 13 - .../Pods/Headers/Public/ReactKit/RCTBridge.h | 81 - .../Headers/Public/ReactKit/RCTBridgeModule.h | 60 - .../Pods/Headers/Public/ReactKit/RCTCache.h | 22 - .../Public/ReactKit/RCTContextExecutor.h | 21 - .../Pods/Headers/Public/ReactKit/RCTConvert.h | 85 - .../Public/ReactKit/RCTEventDispatcher.h | 66 - .../Public/ReactKit/RCTExceptionsManager.h | 9 - .../Headers/Public/ReactKit/RCTInvalidating.h | 16 - .../Public/ReactKit/RCTJSMethodRegistrar.h | 24 - .../Public/ReactKit/RCTJavaScriptExecutor.h | 35 - .../Headers/Public/ReactKit/RCTKeyCommands.h | 28 - .../Public/ReactKit/RCTLocationObserver.h | 7 - .../Pods/Headers/Public/ReactKit/RCTLog.h | 58 - .../Pods/Headers/Public/ReactKit/RCTNavItem.h | 14 - .../Public/ReactKit/RCTNavItemManager.h | 8 - .../Headers/Public/ReactKit/RCTNavigator.h | 26 - .../Public/ReactKit/RCTNavigatorManager.h | 8 - .../Public/ReactKit/RCTPointerEvents.h | 10 - .../Pods/Headers/Public/ReactKit/RCTRedBox.h | 16 - .../Headers/Public/ReactKit/RCTRootView.h | 44 - .../Headers/Public/ReactKit/RCTScrollView.h | 37 - .../Public/ReactKit/RCTScrollViewManager.h | 8 - .../Public/ReactKit/RCTScrollableProtocol.h | 18 - .../Headers/Public/ReactKit/RCTShadowView.h | 157 - .../Headers/Public/ReactKit/RCTSparseArray.h | 31 - .../Headers/Public/ReactKit/RCTStaticImage.h | 10 - .../Public/ReactKit/RCTStaticImageManager.h | 7 - .../Public/ReactKit/RCTStatusBarManager.h | 9 - .../Headers/Public/ReactKit/RCTTextField.h | 15 - .../Public/ReactKit/RCTTextFieldManager.h | 8 - .../Pods/Headers/Public/ReactKit/RCTTiming.h | 10 - .../Headers/Public/ReactKit/RCTTouchHandler.h | 15 - .../RCTUIActivityIndicatorViewManager.h | 7 - .../Headers/Public/ReactKit/RCTUIManager.h | 56 - .../Pods/Headers/Public/ReactKit/RCTUtils.h | 46 - .../Pods/Headers/Public/ReactKit/RCTView.h | 23 - .../Headers/Public/ReactKit/RCTViewManager.h | 149 - .../Public/ReactKit/RCTViewNodeProtocol.h | 28 - .../Public/ReactKit/RCTWebViewExecutor.h | 35 - .../ReactKit/RCTWrapperViewController.h | 27 - .../Headers/Public/ReactKit/UIView+ReactKit.h | 11 - .../Local Podspecs/RCTDataManager.podspec | 28 - .../Local Podspecs/RCTNetworkImage.podspec | 28 - .../Pods/Local Podspecs/RCTText.podspec | 28 - .../Pods/Local Podspecs/ReactKit.podspec | 16 - Examples/Movies/Pods/Manifest.lock | 32 - .../Pods/Pods.xcodeproj/project.pbxproj | 4332 ----------------- .../Pods-RCTDataManager-Private.xcconfig | 5 - .../Pods-RCTDataManager-dummy.m | 5 - .../Pods-RCTDataManager-prefix.pch | 5 - .../Pods-RCTDataManager.xcconfig | 0 .../Pods-RCTNetworkImage-Private.xcconfig | 5 - .../Pods-RCTNetworkImage-dummy.m | 5 - .../Pods-RCTNetworkImage-prefix.pch | 5 - .../Pods-RCTNetworkImage.xcconfig | 0 .../Pods-RCTText-Private.xcconfig | 5 - .../Pods-RCTText/Pods-RCTText-dummy.m | 5 - .../Pods-RCTText/Pods-RCTText-prefix.pch | 5 - .../Pods-RCTText/Pods-RCTText.xcconfig | 0 .../Pods-ReactKit-Private.xcconfig | 5 - .../Pods-ReactKit/Pods-ReactKit-dummy.m | 5 - .../Pods-ReactKit/Pods-ReactKit-prefix.pch | 5 - .../Pods-ReactKit/Pods-ReactKit.xcconfig | 0 .../Pods/Pods-acknowledgements.markdown | 3 - .../Pods/Pods-acknowledgements.plist | 29 - .../Target Support Files/Pods/Pods-dummy.m | 5 - .../Pods/Pods-environment.h | 32 - .../Pods/Pods-resources.sh | 74 - .../Pods/Pods.debug.xcconfig | 6 - .../Pods/Pods.release.xcconfig | 6 - Examples/Movies/SearchScreen.js | 5 +- Examples/TicTacToe/AppDelegate.m | 2 +- Examples/TicTacToe/AppDelegate.m.orig | 44 + Examples/TicTacToe/Podfile | 5 - Examples/TicTacToe/Podfile.lock | 26 - .../RCTNetworkImage/RCTImageDownloader.h | 22 - .../RCTNetworkImage/RCTNetworkImageView.h | 33 - .../RCTNetworkImageViewManager.h | 8 - .../Public/RCTText/RCTRawTextManager.h | 7 - .../Headers/Public/RCTText/RCTShadowRawText.h | 9 - .../Headers/Public/RCTText/RCTShadowText.h | 26 - .../Pods/Headers/Public/RCTText/RCTText.h | 13 - .../Headers/Public/RCTText/RCTTextManager.h | 8 - .../Pods/Headers/Public/ReactKit/Layout.h | 148 - .../Headers/Public/ReactKit/RCTAlertManager.h | 9 - .../Public/ReactKit/RCTAnimationType.h | 11 - .../Pods/Headers/Public/ReactKit/RCTAssert.h | 36 - .../Public/ReactKit/RCTAutoInsetsProtocol.h | 13 - .../Pods/Headers/Public/ReactKit/RCTBridge.h | 81 - .../Headers/Public/ReactKit/RCTBridgeModule.h | 60 - .../Pods/Headers/Public/ReactKit/RCTCache.h | 22 - .../Public/ReactKit/RCTContextExecutor.h | 21 - .../Pods/Headers/Public/ReactKit/RCTConvert.h | 85 - .../Public/ReactKit/RCTEventDispatcher.h | 66 - .../Public/ReactKit/RCTExceptionsManager.h | 9 - .../Headers/Public/ReactKit/RCTInvalidating.h | 16 - .../Public/ReactKit/RCTJSMethodRegistrar.h | 24 - .../Public/ReactKit/RCTJavaScriptExecutor.h | 35 - .../Headers/Public/ReactKit/RCTKeyCommands.h | 28 - .../Public/ReactKit/RCTLocationObserver.h | 7 - .../Pods/Headers/Public/ReactKit/RCTLog.h | 58 - .../Pods/Headers/Public/ReactKit/RCTNavItem.h | 14 - .../Public/ReactKit/RCTNavItemManager.h | 8 - .../Headers/Public/ReactKit/RCTNavigator.h | 26 - .../Public/ReactKit/RCTNavigatorManager.h | 8 - .../Public/ReactKit/RCTPointerEvents.h | 10 - .../Pods/Headers/Public/ReactKit/RCTRedBox.h | 16 - .../Headers/Public/ReactKit/RCTRootView.h | 44 - .../Headers/Public/ReactKit/RCTScrollView.h | 37 - .../Public/ReactKit/RCTScrollViewManager.h | 8 - .../Public/ReactKit/RCTScrollableProtocol.h | 18 - .../Headers/Public/ReactKit/RCTShadowView.h | 157 - .../Headers/Public/ReactKit/RCTSparseArray.h | 31 - .../Headers/Public/ReactKit/RCTStaticImage.h | 10 - .../Public/ReactKit/RCTStaticImageManager.h | 7 - .../Public/ReactKit/RCTStatusBarManager.h | 9 - .../Headers/Public/ReactKit/RCTTextField.h | 15 - .../Public/ReactKit/RCTTextFieldManager.h | 8 - .../Pods/Headers/Public/ReactKit/RCTTiming.h | 10 - .../Headers/Public/ReactKit/RCTTouchHandler.h | 15 - .../RCTUIActivityIndicatorViewManager.h | 7 - .../Headers/Public/ReactKit/RCTUIManager.h | 56 - .../Pods/Headers/Public/ReactKit/RCTUtils.h | 46 - .../Pods/Headers/Public/ReactKit/RCTView.h | 23 - .../Headers/Public/ReactKit/RCTViewManager.h | 149 - .../Public/ReactKit/RCTViewNodeProtocol.h | 28 - .../Public/ReactKit/RCTWebViewExecutor.h | 35 - .../ReactKit/RCTWrapperViewController.h | 27 - .../Headers/Public/ReactKit/UIView+ReactKit.h | 11 - .../Local Podspecs/RCTNetworkImage.podspec | 28 - .../Pods/Local Podspecs/RCTText.podspec | 28 - .../Pods/Local Podspecs/ReactKit.podspec | 16 - Examples/TicTacToe/Pods/Manifest.lock | 26 - .../Pods/Pods.xcodeproj/project.pbxproj | 3946 --------------- .../Pods-RCTNetworkImage-Private.xcconfig | 5 - .../Pods-RCTNetworkImage-dummy.m | 5 - .../Pods-RCTNetworkImage-prefix.pch | 5 - .../Pods-RCTNetworkImage.xcconfig | 0 .../Pods-RCTText-Private.xcconfig | 5 - .../Pods-RCTText/Pods-RCTText-dummy.m | 5 - .../Pods-RCTText/Pods-RCTText-prefix.pch | 5 - .../Pods-RCTText/Pods-RCTText.xcconfig | 0 .../Pods-ReactKit-Private.xcconfig | 5 - .../Pods-ReactKit/Pods-ReactKit-dummy.m | 5 - .../Pods-ReactKit/Pods-ReactKit-prefix.pch | 5 - .../Pods-ReactKit/Pods-ReactKit.xcconfig | 0 .../Pods/Pods-acknowledgements.markdown | 3 - .../Pods/Pods-acknowledgements.plist | 29 - .../Target Support Files/Pods/Pods-dummy.m | 5 - .../Pods/Pods-environment.h | 26 - .../Pods/Pods-resources.sh | 74 - .../Pods/Pods.debug.xcconfig | 6 - .../Pods/Pods.release.xcconfig | 6 - .../TicTacToe.xcodeproj/project.pbxproj | 189 +- .../TicTacToe.xcodeproj/project.pbxproj.orig | 407 ++ .../contents.xcworkspacedata | 7 + .../contents.xcworkspacedata | 10 - Examples/UIExplorer/ListViewPagingExample.js | 3 +- Examples/UIExplorer/ListViewSimpleExample.js | 3 +- Libraries/Components/ListView/ListView.js | 4 + Libraries/Components/ScrollViewPropTypes.js | 2 +- .../Components/TextInput/TextInput.ios.js | 3 +- lint/linterTransform.js | 76 + linter.js | 77 +- package.json | 15 +- packager/packager.js | 6 +- .../react-packager/src/Packager/Package.js | 51 +- .../src/Packager/__tests__/Package-test.js | 19 +- .../src/Packager/__tests__/Packager-test.js | 1 + .../src/Server/__tests__/Server-test.js | 1 + packager/react-packager/src/Server/index.js | 7 +- 191 files changed, 948 insertions(+), 12647 deletions(-) create mode 100644 Examples/Movies/Movies.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 Examples/Movies/Movies.xcworkspace/contents.xcworkspacedata delete mode 100644 Examples/Movies/Podfile delete mode 100644 Examples/Movies/Podfile.lock delete mode 100644 Examples/Movies/Pods/Headers/Public/RCTDataManager/RCTDataManager.h delete mode 100644 Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTImageDownloader.h delete mode 100644 Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h delete mode 100644 Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageViewManager.h delete mode 100644 Examples/Movies/Pods/Headers/Public/RCTText/RCTRawTextManager.h delete mode 100644 Examples/Movies/Pods/Headers/Public/RCTText/RCTShadowRawText.h delete mode 100644 Examples/Movies/Pods/Headers/Public/RCTText/RCTShadowText.h delete mode 100644 Examples/Movies/Pods/Headers/Public/RCTText/RCTText.h delete mode 100644 Examples/Movies/Pods/Headers/Public/RCTText/RCTTextManager.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/Layout.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTAlertManager.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTAnimationType.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTAssert.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTAutoInsetsProtocol.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridge.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridgeModule.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTCache.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTContextExecutor.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTConvert.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTEventDispatcher.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTExceptionsManager.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTInvalidating.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTJSMethodRegistrar.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTKeyCommands.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTLocationObserver.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTLog.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavItem.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavItemManager.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigator.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigatorManager.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTPointerEvents.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTRedBox.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTRootView.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollView.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollViewManager.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollableProtocol.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTShadowView.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTSparseArray.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTStaticImage.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTStaticImageManager.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTStatusBarManager.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextField.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextFieldManager.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTTiming.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTTouchHandler.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIActivityIndicatorViewManager.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIManager.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTUtils.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTView.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewManager.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTWebViewExecutor.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h delete mode 100644 Examples/Movies/Pods/Headers/Public/ReactKit/UIView+ReactKit.h delete mode 100644 Examples/Movies/Pods/Local Podspecs/RCTDataManager.podspec delete mode 100644 Examples/Movies/Pods/Local Podspecs/RCTNetworkImage.podspec delete mode 100644 Examples/Movies/Pods/Local Podspecs/RCTText.podspec delete mode 100644 Examples/Movies/Pods/Local Podspecs/ReactKit.podspec delete mode 100644 Examples/Movies/Pods/Manifest.lock delete mode 100644 Examples/Movies/Pods/Pods.xcodeproj/project.pbxproj delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-Private.xcconfig delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-dummy.m delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-prefix.pch delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager.xcconfig delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-Private.xcconfig delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-dummy.m delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage.xcconfig delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-Private.xcconfig delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-dummy.m delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText.xcconfig delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-Private.xcconfig delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-dummy.m delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit.xcconfig delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods/Pods-acknowledgements.plist delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods/Pods-dummy.m delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods/Pods-environment.h delete mode 100755 Examples/Movies/Pods/Target Support Files/Pods/Pods-resources.sh delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods/Pods.debug.xcconfig delete mode 100644 Examples/Movies/Pods/Target Support Files/Pods/Pods.release.xcconfig create mode 100644 Examples/TicTacToe/AppDelegate.m.orig delete mode 100644 Examples/TicTacToe/Podfile delete mode 100644 Examples/TicTacToe/Podfile.lock delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTImageDownloader.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageViewManager.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTRawTextManager.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTShadowRawText.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTShadowText.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTText.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTTextManager.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/Layout.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAlertManager.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAnimationType.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAssert.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAutoInsetsProtocol.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridge.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridgeModule.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTCache.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTContextExecutor.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTConvert.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTEventDispatcher.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTExceptionsManager.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTInvalidating.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJSMethodRegistrar.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTKeyCommands.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLocationObserver.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLog.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavItem.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavItemManager.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigator.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigatorManager.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTPointerEvents.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTRedBox.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTRootView.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollView.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollViewManager.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollableProtocol.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTShadowView.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTSparseArray.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStaticImage.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStaticImageManager.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStatusBarManager.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextField.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextFieldManager.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTiming.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTouchHandler.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIActivityIndicatorViewManager.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIManager.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUtils.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTView.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewManager.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWebViewExecutor.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h delete mode 100644 Examples/TicTacToe/Pods/Headers/Public/ReactKit/UIView+ReactKit.h delete mode 100644 Examples/TicTacToe/Pods/Local Podspecs/RCTNetworkImage.podspec delete mode 100644 Examples/TicTacToe/Pods/Local Podspecs/RCTText.podspec delete mode 100644 Examples/TicTacToe/Pods/Local Podspecs/ReactKit.podspec delete mode 100644 Examples/TicTacToe/Pods/Manifest.lock delete mode 100644 Examples/TicTacToe/Pods/Pods.xcodeproj/project.pbxproj delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-Private.xcconfig delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-dummy.m delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage.xcconfig delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-Private.xcconfig delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-dummy.m delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText.xcconfig delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-Private.xcconfig delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-dummy.m delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit.xcconfig delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-acknowledgements.plist delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-dummy.m delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-environment.h delete mode 100755 Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-resources.sh delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods/Pods.debug.xcconfig delete mode 100644 Examples/TicTacToe/Pods/Target Support Files/Pods/Pods.release.xcconfig create mode 100644 Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj.orig create mode 100644 Examples/TicTacToe/TicTacToe.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 Examples/TicTacToe/TicTacToe.xcworkspace/contents.xcworkspacedata create mode 100644 lint/linterTransform.js diff --git a/Examples/Movies/AppDelegate.m b/Examples/Movies/AppDelegate.m index a402c7901..c01fc2ca9 100644 --- a/Examples/Movies/AppDelegate.m +++ b/Examples/Movies/AppDelegate.m @@ -2,7 +2,7 @@ #import "AppDelegate.h" -#import +#import "RCTRootView.h" @implementation AppDelegate diff --git a/Examples/Movies/Movies.xcodeproj/project.pbxproj b/Examples/Movies/Movies.xcodeproj/project.pbxproj index 6e3846623..05e45f8f6 100644 --- a/Examples/Movies/Movies.xcodeproj/project.pbxproj +++ b/Examples/Movies/Movies.xcodeproj/project.pbxproj @@ -11,9 +11,64 @@ 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 8A63AAB95DEC603F81CC9914 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C80E9DAC4721961D27A5C59 /* libPods.a */; }; + 587651131A9EB12E008B8F17 /* libRCTDataManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587650FF1A9EB120008B8F17 /* libRCTDataManager.a */; }; + 587651141A9EB12E008B8F17 /* libRCTNetworkImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587651051A9EB120008B8F17 /* libRCTNetworkImage.a */; }; + 587651151A9EB12E008B8F17 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5876510D1A9EB120008B8F17 /* libRCTText.a */; }; + 587651161A9EB12E008B8F17 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587651121A9EB120008B8F17 /* libReactKit.a */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 587650FE1A9EB120008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587650F01A9EB120008B8F17 /* RCTDataManager.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511DB1A9E6C8500147676; + remoteInfo = RCTDataManager; + }; + 587651001A9EB120008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587650F01A9EB120008B8F17 /* RCTDataManager.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511E61A9E6C8500147676; + remoteInfo = RCTDataManagerTests; + }; + 587651041A9EB120008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587650F31A9EB120008B8F17 /* RCTNetworkImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B5115D1A9E6B3D00147676; + remoteInfo = RCTNetworkImage; + }; + 587651061A9EB120008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587650F31A9EB120008B8F17 /* RCTNetworkImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511681A9E6B3D00147676; + remoteInfo = RCTNetworkImageTests; + }; + 5876510C1A9EB120008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587650F61A9EB120008B8F17 /* RCTText.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B5119B1A9E6C1200147676; + remoteInfo = RCTText; + }; + 5876510E1A9EB120008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587650F61A9EB120008B8F17 /* RCTText.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511A61A9E6C1300147676; + remoteInfo = RCTTextTests; + }; + 587651111A9EB120008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587650F91A9EB120008B8F17 /* ReactKit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; + remoteInfo = ReactKit; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXFileReference section */ 13B07F961A680F5B00A75B9A /* Movies.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Movies.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; @@ -22,17 +77,10 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 1C80E9DAC4721961D27A5C59 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 484633F6AF8FF4B8EB89512A /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - 5845B59FBF51C4AAA4222097 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; - 587650991A9EA0C6008B8F17 /* libPods-RCTDataManager.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-RCTDataManager.a"; path = "Pods/build/Debug-iphoneos/libPods-RCTDataManager.a"; sourceTree = ""; }; - 5876509A1A9EA0C6008B8F17 /* libPods-RCTNetworkImage.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-RCTNetworkImage.a"; path = "Pods/build/Debug-iphoneos/libPods-RCTNetworkImage.a"; sourceTree = ""; }; - 5876509B1A9EA0C6008B8F17 /* libPods-RCTText.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-RCTText.a"; path = "Pods/build/Debug-iphoneos/libPods-RCTText.a"; sourceTree = ""; }; - 5876509C1A9EA0C6008B8F17 /* libPods-ReactKit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-ReactKit.a"; path = "Pods/build/Debug-iphoneos/libPods-ReactKit.a"; sourceTree = ""; }; - 587650A11A9EA235008B8F17 /* libPods-RCTDataManager.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-RCTDataManager.a"; path = "Pods/build/Debug-iphoneos/libPods-RCTDataManager.a"; sourceTree = ""; }; - 587650A21A9EA235008B8F17 /* libPods-RCTNetworkImage.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-RCTNetworkImage.a"; path = "Pods/build/Debug-iphoneos/libPods-RCTNetworkImage.a"; sourceTree = ""; }; - 587650A31A9EA235008B8F17 /* libPods-RCTText.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-RCTText.a"; path = "Pods/build/Debug-iphoneos/libPods-RCTText.a"; sourceTree = ""; }; - 587650A41A9EA235008B8F17 /* libPods-ReactKit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-ReactKit.a"; path = "Pods/build/Debug-iphoneos/libPods-ReactKit.a"; sourceTree = ""; }; + 587650F01A9EB120008B8F17 /* RCTDataManager.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTDataManager.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../Network/RCTDataManager.xcodeproj"; sourceTree = ""; }; + 587650F31A9EB120008B8F17 /* RCTNetworkImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetworkImage.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../Image/RCTNetworkImage.xcodeproj"; sourceTree = ""; }; + 587650F61A9EB120008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../Text/RCTText.xcodeproj"; sourceTree = ""; }; + 587650F91A9EB120008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../../ReactKit/ReactKit.xcodeproj"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -40,22 +88,16 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 8A63AAB95DEC603F81CC9914 /* libPods.a in Frameworks */, + 587651131A9EB12E008B8F17 /* libRCTDataManager.a in Frameworks */, + 587651141A9EB12E008B8F17 /* libRCTNetworkImage.a in Frameworks */, + 587651151A9EB12E008B8F17 /* libRCTText.a in Frameworks */, + 587651161A9EB12E008B8F17 /* libReactKit.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 0D1AC39A16823DF8332A23B7 /* Pods */ = { - isa = PBXGroup; - children = ( - 5845B59FBF51C4AAA4222097 /* Pods.debug.xcconfig */, - 484633F6AF8FF4B8EB89512A /* Pods.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; 13B07FAE1A68108700A75B9A /* Movies */ = { isa = PBXGroup; children = ( @@ -69,13 +111,58 @@ name = Movies; sourceTree = ""; }; + 587650F11A9EB120008B8F17 /* Products */ = { + isa = PBXGroup; + children = ( + 587650FF1A9EB120008B8F17 /* libRCTDataManager.a */, + 587651011A9EB120008B8F17 /* RCTDataManagerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 587650F41A9EB120008B8F17 /* Products */ = { + isa = PBXGroup; + children = ( + 587651051A9EB120008B8F17 /* libRCTNetworkImage.a */, + 587651071A9EB120008B8F17 /* RCTNetworkImageTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 587650F71A9EB120008B8F17 /* Products */ = { + isa = PBXGroup; + children = ( + 5876510D1A9EB120008B8F17 /* libRCTText.a */, + 5876510F1A9EB120008B8F17 /* RCTTextTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 587650FA1A9EB120008B8F17 /* Products */ = { + isa = PBXGroup; + children = ( + 587651121A9EB120008B8F17 /* libReactKit.a */, + ); + name = Products; + sourceTree = ""; + }; + 58C571FC1AA6124500CDF9C8 /* Libraries */ = { + isa = PBXGroup; + children = ( + 587650F01A9EB120008B8F17 /* RCTDataManager.xcodeproj */, + 587650F31A9EB120008B8F17 /* RCTNetworkImage.xcodeproj */, + 587650F61A9EB120008B8F17 /* RCTText.xcodeproj */, + 587650F91A9EB120008B8F17 /* ReactKit.xcodeproj */, + ); + name = Libraries; + sourceTree = ""; + }; 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( 13B07FAE1A68108700A75B9A /* Movies */, + 58C571FC1AA6124500CDF9C8 /* Libraries */, 83CBBA001A601CBA00E9B192 /* Products */, - 0D1AC39A16823DF8332A23B7 /* Pods */, - B748CE19D7EAD496E0205240 /* Frameworks */, ); sourceTree = ""; }; @@ -87,22 +174,6 @@ name = Products; sourceTree = ""; }; - B748CE19D7EAD496E0205240 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 587650A11A9EA235008B8F17 /* libPods-RCTDataManager.a */, - 587650A21A9EA235008B8F17 /* libPods-RCTNetworkImage.a */, - 587650A31A9EA235008B8F17 /* libPods-RCTText.a */, - 587650A41A9EA235008B8F17 /* libPods-ReactKit.a */, - 587650991A9EA0C6008B8F17 /* libPods-RCTDataManager.a */, - 5876509A1A9EA0C6008B8F17 /* libPods-RCTNetworkImage.a */, - 5876509B1A9EA0C6008B8F17 /* libPods-RCTText.a */, - 5876509C1A9EA0C6008B8F17 /* libPods-ReactKit.a */, - 1C80E9DAC4721961D27A5C59 /* libPods.a */, - ); - name = Frameworks; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -110,11 +181,9 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Movies" */; buildPhases = ( - 480757813B188E9D7AD89A37 /* Check Pods Manifest.lock */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, - 602457BB761A1DB37CEBD865 /* Copy Pods Resources */, ); buildRules = ( ); @@ -145,6 +214,24 @@ mainGroup = 83CBB9F61A601CBA00E9B192; productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 587650F11A9EB120008B8F17 /* Products */; + ProjectRef = 587650F01A9EB120008B8F17 /* RCTDataManager.xcodeproj */; + }, + { + ProductGroup = 587650F41A9EB120008B8F17 /* Products */; + ProjectRef = 587650F31A9EB120008B8F17 /* RCTNetworkImage.xcodeproj */; + }, + { + ProductGroup = 587650F71A9EB120008B8F17 /* Products */; + ProjectRef = 587650F61A9EB120008B8F17 /* RCTText.xcodeproj */; + }, + { + ProductGroup = 587650FA1A9EB120008B8F17 /* Products */; + ProjectRef = 587650F91A9EB120008B8F17 /* ReactKit.xcodeproj */; + }, + ); projectRoot = ""; targets = ( 13B07F861A680F5B00A75B9A /* Movies */, @@ -152,6 +239,58 @@ }; /* End PBXProject section */ +/* Begin PBXReferenceProxy section */ + 587650FF1A9EB120008B8F17 /* libRCTDataManager.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTDataManager.a; + remoteRef = 587650FE1A9EB120008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 587651011A9EB120008B8F17 /* RCTDataManagerTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = RCTDataManagerTests.xctest; + remoteRef = 587651001A9EB120008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 587651051A9EB120008B8F17 /* libRCTNetworkImage.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTNetworkImage.a; + remoteRef = 587651041A9EB120008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 587651071A9EB120008B8F17 /* RCTNetworkImageTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = RCTNetworkImageTests.xctest; + remoteRef = 587651061A9EB120008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5876510D1A9EB120008B8F17 /* libRCTText.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTText.a; + remoteRef = 5876510C1A9EB120008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5876510F1A9EB120008B8F17 /* RCTTextTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = RCTTextTests.xctest; + remoteRef = 5876510E1A9EB120008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 587651121A9EB120008B8F17 /* libReactKit.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libReactKit.a; + remoteRef = 587651111A9EB120008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + /* Begin PBXResourcesBuildPhase section */ 13B07F8E1A680F5B00A75B9A /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -164,39 +303,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 480757813B188E9D7AD89A37 /* Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 602457BB761A1DB37CEBD865 /* Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 13B07F871A680F5B00A75B9A /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -223,7 +329,6 @@ /* Begin XCBuildConfiguration section */ 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5845B59FBF51C4AAA4222097 /* Pods.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; HEADER_SEARCH_PATHS = ( @@ -233,19 +338,13 @@ ); INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Pods/build/Debug-iphoneos", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "$(inherited)"; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = Movies; }; name = Debug; }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 484633F6AF8FF4B8EB89512A /* Pods.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; HEADER_SEARCH_PATHS = ( @@ -255,12 +354,7 @@ ); INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Pods/build/Debug-iphoneos", - ); - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "$(inherited)"; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = Movies; }; name = Release; diff --git a/Examples/Movies/Movies.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/Movies/Movies.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..3071f8f00 --- /dev/null +++ b/Examples/Movies/Movies.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Examples/Movies/Movies.xcworkspace/contents.xcworkspacedata b/Examples/Movies/Movies.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index c4885a713..000000000 --- a/Examples/Movies/Movies.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/Examples/Movies/Podfile b/Examples/Movies/Podfile deleted file mode 100644 index c8e32868d..000000000 --- a/Examples/Movies/Podfile +++ /dev/null @@ -1,6 +0,0 @@ -source 'https://github.com/CocoaPods/Specs.git' - -pod 'RCTDataManager', :path => '../../Libraries/Network' -pod 'RCTNetworkImage', :path => '../../Libraries/Image' -pod 'RCTText', :path => '../../Libraries/Text' -pod 'ReactKit', :path => '../../ReactKit' diff --git a/Examples/Movies/Podfile.lock b/Examples/Movies/Podfile.lock deleted file mode 100644 index cc2a8f981..000000000 --- a/Examples/Movies/Podfile.lock +++ /dev/null @@ -1,32 +0,0 @@ -PODS: - - RCTDataManager (0.0.1): - - ReactKit (~> 0.0.1) - - RCTNetworkImage (0.0.1): - - ReactKit (~> 0.0.1) - - RCTText (0.0.1): - - ReactKit (~> 0.0.1) - - ReactKit (0.0.1) - -DEPENDENCIES: - - RCTDataManager (from `../../Libraries/Network`) - - RCTNetworkImage (from `../../Libraries/Image`) - - RCTText (from `../../Libraries/Text`) - - ReactKit (from `../../ReactKit`) - -EXTERNAL SOURCES: - RCTDataManager: - :path: ../../Libraries/Network - RCTNetworkImage: - :path: ../../Libraries/Image - RCTText: - :path: ../../Libraries/Text - ReactKit: - :path: ../../ReactKit - -SPEC CHECKSUMS: - RCTDataManager: d38d2a6555886d68e8de623c4b97e2acdf01ed3e - RCTNetworkImage: 6d99735875916e098a65c68a54a72e67e24a402a - RCTText: 5c0cf4635241e8c02e8933853df03809d2dc8327 - ReactKit: 65c02c1e95951c198e491d2a4c1972675d4af254 - -COCOAPODS: 0.35.0 diff --git a/Examples/Movies/Pods/Headers/Public/RCTDataManager/RCTDataManager.h b/Examples/Movies/Pods/Headers/Public/RCTDataManager/RCTDataManager.h deleted file mode 100644 index 47f80ba1c..000000000 --- a/Examples/Movies/Pods/Headers/Public/RCTDataManager/RCTDataManager.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTBridgeModule.h" - -@interface RCTDataManager : NSObject - -@end - diff --git a/Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTImageDownloader.h b/Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTImageDownloader.h deleted file mode 100644 index b525ea1a7..000000000 --- a/Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTImageDownloader.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -typedef void (^RCTDataDownloadBlock)(NSData *data, NSError *error); -typedef void (^RCTImageDownloadBlock)(UIImage *image, NSError *error); - -@interface RCTImageDownloader : NSObject - -+ (instancetype)sharedInstance; - -- (id)downloadDataForURL:(NSURL *)url - block:(RCTDataDownloadBlock)block; - -- (id)downloadImageForURL:(NSURL *)url - size:(CGSize)size - scale:(CGFloat)scale - block:(RCTImageDownloadBlock)block; - -- (void)cancelDownload:(id)downloadToken; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h b/Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h deleted file mode 100644 index 920bf705c..000000000 --- a/Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@class RCTImageDownloader; - -@interface RCTNetworkImageView : UIView - -- (instancetype)initWithFrame:(CGRect)frame - imageDownloader:(RCTImageDownloader *)imageDownloader NS_DESIGNATED_INITIALIZER; - -/** - * An image that will appear while the view is loading the image from the network, - * or when imageURL is nil. Defaults to nil. - */ -@property (nonatomic, strong) UIImage *defaultImage; - -/** - * Specify a URL for an image. The image will be asynchronously loaded and displayed. - */ -@property (nonatomic, strong) NSURL *imageURL; - -/** - * By default, changing imageURL will reset whatever existing image was present - * and revert to defaultImage while the new image loads. In certain obscure cases you - * may want to disable this behavior and instead keep displaying the previous image - * while the new one loads. In this case, pass NO for resetToDefaultImageWhileLoading. - * (If you set imageURL to nil, however, resetToDefaultImageWhileLoading is ignored; - * that will always reset to the default image.) - */ -- (void)setImageURL:(NSURL *)imageURL resetToDefaultImageWhileLoading:(BOOL)reset; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageViewManager.h b/Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageViewManager.h deleted file mode 100644 index 5b34e6060..000000000 --- a/Examples/Movies/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageViewManager.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTNetworkImageViewManager : RCTViewManager - -@end - diff --git a/Examples/Movies/Pods/Headers/Public/RCTText/RCTRawTextManager.h b/Examples/Movies/Pods/Headers/Public/RCTText/RCTRawTextManager.h deleted file mode 100644 index 4c67fd328..000000000 --- a/Examples/Movies/Pods/Headers/Public/RCTText/RCTRawTextManager.h +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTRawTextManager : RCTViewManager - -@end diff --git a/Examples/Movies/Pods/Headers/Public/RCTText/RCTShadowRawText.h b/Examples/Movies/Pods/Headers/Public/RCTText/RCTShadowRawText.h deleted file mode 100644 index d1bdc7d72..000000000 --- a/Examples/Movies/Pods/Headers/Public/RCTText/RCTShadowRawText.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTShadowView.h" - -@interface RCTShadowRawText : RCTShadowView - -@property (nonatomic, copy) NSString *text; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/RCTText/RCTShadowText.h b/Examples/Movies/Pods/Headers/Public/RCTText/RCTShadowText.h deleted file mode 100644 index ddaf2ebe7..000000000 --- a/Examples/Movies/Pods/Headers/Public/RCTText/RCTShadowText.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTShadowView.h" - -extern NSString *const RCTIsHighlightedAttributeName; -extern NSString *const RCTReactTagAttributeName; - -@interface RCTShadowText : RCTShadowView - -@property (nonatomic, assign) NSWritingDirection writingDirection; -@property (nonatomic, strong) UIColor *textBackgroundColor; -@property (nonatomic, strong) UIColor *color; -@property (nonatomic, strong) UIFont *font; -@property (nonatomic, copy) NSString *fontFamily; -@property (nonatomic, assign) CGFloat fontSize; -@property (nonatomic, copy) NSString *fontWeight; -@property (nonatomic, assign) BOOL isHighlighted; -@property (nonatomic, assign) CGFloat lineHeight; -@property (nonatomic, assign) NSInteger maxNumberOfLines; -@property (nonatomic, assign) CGSize shadowOffset; -@property (nonatomic, assign) NSTextAlignment textAlign; -@property (nonatomic, assign) NSLineBreakMode truncationMode; - -- (NSAttributedString *)attributedString; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/RCTText/RCTText.h b/Examples/Movies/Pods/Headers/Public/RCTText/RCTText.h deleted file mode 100644 index 80ba3f234..000000000 --- a/Examples/Movies/Pods/Headers/Public/RCTText/RCTText.h +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@interface RCTText : UIView - -@property (nonatomic, copy) NSAttributedString *attributedText; -@property (nonatomic, assign) NSLineBreakMode lineBreakMode; -@property (nonatomic, assign) NSUInteger numberOfLines; - -- (NSNumber *)reactTagAtPoint:(CGPoint)point; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/RCTText/RCTTextManager.h b/Examples/Movies/Pods/Headers/Public/RCTText/RCTTextManager.h deleted file mode 100644 index 0359cce40..000000000 --- a/Examples/Movies/Pods/Headers/Public/RCTText/RCTTextManager.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTTextManager : RCTViewManager - -@end - diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/Layout.h b/Examples/Movies/Pods/Headers/Public/ReactKit/Layout.h deleted file mode 100644 index 51f72493b..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/Layout.h +++ /dev/null @@ -1,148 +0,0 @@ -/** - * @generated SignedSource<<58298c7a8815a8675e970b0347dedfed>> - * - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !! This file is a check-in from github! !! - * !! !! - * !! You should not modify this file directly. Instead: !! - * !! 1) Go to https://github.com/facebook/css-layout !! - * !! 2) Make a pull request and get it merged !! - * !! 3) Execute ./import.sh to pull in the latest version !! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#ifndef __LAYOUT_H -#define __LAYOUT_H - -#include -#include -#define CSS_UNDEFINED NAN - -typedef enum { - CSS_FLEX_DIRECTION_COLUMN = 0, - CSS_FLEX_DIRECTION_ROW -} css_flex_direction_t; - -typedef enum { - CSS_JUSTIFY_FLEX_START = 0, - CSS_JUSTIFY_CENTER, - CSS_JUSTIFY_FLEX_END, - CSS_JUSTIFY_SPACE_BETWEEN, - CSS_JUSTIFY_SPACE_AROUND -} css_justify_t; - -// Note: auto is only a valid value for alignSelf. It is NOT a valid value for -// alignItems. -typedef enum { - CSS_ALIGN_AUTO = 0, - CSS_ALIGN_FLEX_START, - CSS_ALIGN_CENTER, - CSS_ALIGN_FLEX_END, - CSS_ALIGN_STRETCH -} css_align_t; - -typedef enum { - CSS_POSITION_RELATIVE = 0, - CSS_POSITION_ABSOLUTE -} css_position_type_t; - -typedef enum { - CSS_NOWRAP = 0, - CSS_WRAP -} css_wrap_type_t; - -// Note: left and top are shared between position[2] and position[4], so -// they have to be before right and bottom. -typedef enum { - CSS_LEFT = 0, - CSS_TOP, - CSS_RIGHT, - CSS_BOTTOM, - CSS_POSITION_COUNT -} css_position_t; - -typedef enum { - CSS_WIDTH = 0, - CSS_HEIGHT -} css_dimension_t; - -typedef struct { - float position[2]; - float dimensions[2]; - - // Instead of recomputing the entire layout every single time, we - // cache some information to break early when nothing changed - bool should_update; - float last_requested_dimensions[2]; - float last_parent_max_width; - float last_dimensions[2]; - float last_position[2]; -} css_layout_t; - -typedef struct { - float dimensions[2]; -} css_dim_t; - -typedef struct { - css_flex_direction_t flex_direction; - css_justify_t justify_content; - css_align_t align_items; - css_align_t align_self; - css_position_type_t position_type; - css_wrap_type_t flex_wrap; - float flex; - float margin[4]; - float position[4]; - /** - * You should skip all the rules that contain negative values for the - * following attributes. For example: - * {padding: 10, paddingLeft: -5} - * should output: - * {left: 10 ...} - * the following two are incorrect: - * {left: -5 ...} - * {left: 0 ...} - */ - float padding[4]; - float border[4]; - float dimensions[2]; -} css_style_t; - -typedef struct css_node { - css_style_t style; - css_layout_t layout; - int children_count; - - css_dim_t (*measure)(void *context, float width); - void (*print)(void *context); - struct css_node* (*get_child)(void *context, int i); - bool (*is_dirty)(void *context); - void *context; -} css_node_t; - - -// Lifecycle of nodes and children -css_node_t *new_css_node(void); -void init_css_node(css_node_t *node); -void free_css_node(css_node_t *node); - -// Print utilities -typedef enum { - CSS_PRINT_LAYOUT = 1, - CSS_PRINT_STYLE = 2, - CSS_PRINT_CHILDREN = 4, -} css_print_options_t; -void print_css_node(css_node_t *node, css_print_options_t options); - -// Function that computes the layout! -void layoutNode(css_node_t *node, float maxWidth); -bool isUndefined(float value); - -#endif diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAlertManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAlertManager.h deleted file mode 100644 index e24e0bc95..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAlertManager.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTBridgeModule.h" - -@interface RCTAlertManager : NSObject - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAnimationType.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAnimationType.h deleted file mode 100644 index dae90b845..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAnimationType.h +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -typedef NS_ENUM(NSInteger, RCTAnimationType) { - RCTAnimationTypeSpring = 0, - RCTAnimationTypeLinear, - RCTAnimationTypeEaseIn, - RCTAnimationTypeEaseOut, - RCTAnimationTypeEaseInEaseOut, -}; diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAssert.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAssert.h deleted file mode 100644 index 66f670430..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAssert.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#define RCTErrorDomain @"RCTErrorDomain" - -#define RCTAssert(condition, message, ...) _RCTAssert(condition, message, ##__VA_ARGS__) -#define RCTCAssert(condition, message, ...) _RCTCAssert(condition, message, ##__VA_ARGS__) - -typedef void (^RCTAssertFunction)(BOOL condition, NSString *message, ...); - -extern RCTAssertFunction RCTInjectedAssertFunction; -extern RCTAssertFunction RCTInjectedCAssertFunction; - -void RCTInjectAssertFunctions(RCTAssertFunction assertFunction, RCTAssertFunction cAssertFunction); - -#define _RCTAssert(condition, message, ...) \ -do { \ - if (RCTInjectedAssertFunction) { \ - RCTInjectedAssertFunction(condition, message, ##__VA_ARGS__); \ - } else { \ - NSAssert(condition, message, ##__VA_ARGS__); \ - } \ -} while (false) - -#define _RCTCAssert(condition, message, ...) \ -do { \ - if (RCTInjectedCAssertFunction) { \ - RCTInjectedCAssertFunction(condition, message, ##__VA_ARGS__); \ - } else { \ - NSCAssert(condition, message, ##__VA_ARGS__); \ - } \ -} while (false) - -#define RCTAssertMainThread() RCTAssert([NSThread isMainThread], @"This method must be called on the main thread"); -#define RCTCAssertMainThread() RCTCAssert([NSThread isMainThread], @"This function must be called on the main thread"); diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAutoInsetsProtocol.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAutoInsetsProtocol.h deleted file mode 100644 index 4f1cd4ba2..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTAutoInsetsProtocol.h +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -/** - * Defines a View that wants to support auto insets adjustment - */ -@protocol RCTAutoInsetsProtocol - -@property (nonatomic, assign, readwrite) UIEdgeInsets contentInset; -@property (nonatomic, assign, readwrite) BOOL automaticallyAdjustContentInsets; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridge.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridge.h deleted file mode 100644 index 4dcaee8e2..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridge.h +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTBridgeModule.h" -#import "RCTInvalidating.h" -#import "RCTJavaScriptExecutor.h" - -@class RCTBridge; -@class RCTEventDispatcher; - -/** - * This block can be used to instantiate modules that require additional - * init parameters, or additional configuration prior to being used. - * The bridge will call this block to instatiate the modules, and will - * be responsible for invalidating/releasing them when the bridge is destroyed. - * For this reason, the block should always return new module instances, and - * module instances should not be shared between bridges. - */ -typedef NSArray *(^RCTBridgeModuleProviderBlock)(void); - -/** - * Async batched bridge used to communicate with the JavaScript application. - */ -@interface RCTBridge : NSObject - -/** - * The designated initializer. This creates a new bridge on top of the specified - * executor. The bridge should then be used for all subsequent communication - * with the JavaScript code running in the executor. Modules will be automatically - * instantiated using the default contructor, but you can optionally pass in an - * array of pre-initialized module instances if they require additional init - * parameters or configuration. - */ -- (instancetype)initWithExecutor:(id)executor - moduleProvider:(RCTBridgeModuleProviderBlock)block NS_DESIGNATED_INITIALIZER; - -/** - * This method is used to call functions in the JavaScript application context. - * It is primarily intended for use by modules that require two-way communication - * with the JavaScript code. - */ -- (void)enqueueJSCall:(NSString *)moduleDotMethod args:(NSArray *)args; - -/** - * This method is used to execute a new application script. It is called - * internally whenever a JS application bundle is loaded/reloaded, but should - * probably not be used at any other time. - */ -- (void)enqueueApplicationScript:(NSString *)script url:(NSURL *)url onComplete:(RCTJavaScriptCompleteBlock)onComplete; - -/** - * The event dispatcher is a wrapper around -enqueueJSCall:args: that provides a - * higher-level interface for sending UI events such as touches and text input. - */ -@property (nonatomic, readonly) RCTEventDispatcher *eventDispatcher; - -/** - * A dictionary of all registered RCTBridgeModule instances, keyed by moduleName. - */ -@property (nonatomic, copy, readonly) NSDictionary *modules; - -/** - * The shadow queue is used to execute callbacks from the JavaScript code. All - * native hooks (e.g. exported module methods) will be executed on the shadow - * queue. - */ -@property (nonatomic, readonly) dispatch_queue_t shadowQueue; - -/** - * Global logging function that will print to both xcode and JS debugger consoles. - * - * NOTE: Use via RCTLog* macros defined in RCTLog.h - * TODO (#5906496): should log function be exposed here, or could it be a module? - */ -+ (void)log:(NSArray *)objects level:(NSString *)level; - -/** - * Method to check that a valid executor exists with which to log - */ -+ (BOOL)hasValidJSExecutor; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridgeModule.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridgeModule.h deleted file mode 100644 index 2627a0b9f..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTBridgeModule.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTJSMethodRegistrar.h" - -@class RCTBridge; - -/** - * The type of a block that is capable of sending a response to a bridged - * operation. Use this for returning callback methods to JS. - */ -typedef void (^RCTResponseSenderBlock)(NSArray *response); - -/** - * Provides the interface needed to register a bridge module. - */ -@protocol RCTBridgeModule -@optional - -/** - * A reference to the RCTBridge. Useful for modules that require access - * to bridge features, such as sending events or making JS calls. This - * will be set automatically by the bridge when it initializes the module. -* To implement this in your module, just add @synthesize bridge = _bridge; - */ -@property (nonatomic, strong) RCTBridge *bridge; - -/** - * The module name exposed to JS. If omitted, this will be inferred - * automatically by using the native module's class name. - */ -+ (NSString *)moduleName; - -/** - * Place this macro inside the method body of any method you want to expose - * to JS. The optional js_name argument will be used as the JS method name - * (the method will be namespaced to the module name, as specified above). - * If omitted, the JS method name will match the first part of the Objective-C - * method selector name (up to the first colon). - */ -#define RCT_EXPORT(js_name) __attribute__((used, section("__DATA,RCTExport" \ -))) static const char *__rct_export_entry__[] = { __func__, #js_name } - -/** - * Injects constants into JS. These constants are made accessible via - * NativeModules.ModuleName.X. This method is called when the module is - * registered by the bridge. It is only called once for the lifetime of the - * bridge, so it is not suitable for returning dynamic values, but may be - * used for long-lived values such as session keys, that are regenerated only - * as part of a reload of the entire React application. - */ -- (NSDictionary *)constantsToExport; - -/** - * Notifies the module that a batch of JS method invocations has just completed. - */ -- (void)batchDidComplete; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTCache.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTCache.h deleted file mode 100644 index 75943ae4f..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTCache.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@interface RCTCache : NSObject - -- (instancetype)init; // name = @"default" -- (instancetype)initWithName:(NSString *)name; - -@property (nonatomic, assign) NSUInteger maximumDiskSize; // in bytes - -#pragma mark - Retrieval - -- (BOOL)hasDataForKey:(NSString *)key; -- (void)fetchDataForKey:(NSString *)key completionHandler:(void (^)(NSData *data))completionHandler; - -#pragma mark - Insertion - -- (void)setData:(NSData *)data forKey:(NSString *)key; -- (void)removeAllData; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTContextExecutor.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTContextExecutor.h deleted file mode 100644 index 638ad8ba6..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTContextExecutor.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTJavaScriptExecutor.h" - -// TODO (#5906496): Might RCTJSCoreExecutor be a better name for this? - -/** - * Uses a JavaScriptCore context as the execution engine. - */ -@interface RCTContextExecutor : NSObject - -/** - * Configures the executor to run JavaScript on a custom performer. - * You probably don't want to use this; use -init instead. - */ -- (instancetype)initWithJavaScriptThread:(NSThread *)javaScriptThread - globalContextRef:(JSGlobalContextRef)context; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTConvert.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTConvert.h deleted file mode 100644 index 51a6b76ce..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTConvert.h +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import -#import - -#import "Layout.h" -#import "RCTPointerEvents.h" -#import "RCTAnimationType.h" - -/** - * This class provides a collection of conversion functions for mapping - * JSON objects to native types and classes. These are useful when writing - * custom RCTViewManager setter methods. - */ -@interface RCTConvert : NSObject - -+ (BOOL)BOOL:(id)json; -+ (double)double:(id)json; -+ (float)float:(id)json; -+ (int)int:(id)json; - -+ (NSString *)NSString:(id)json; -+ (NSNumber *)NSNumber:(id)json; -+ (NSInteger)NSInteger:(id)json; -+ (NSUInteger)NSUInteger:(id)json; - -+ (NSURL *)NSURL:(id)json; -+ (NSURLRequest *)NSURLRequest:(id)json; - -+ (NSDate *)NSDate:(id)json; -+ (NSTimeZone *)NSTimeZone:(id)json; -+ (NSTimeInterval)NSTimeInterval:(id)json; - -+ (NSTextAlignment)NSTextAlignment:(id)json; -+ (NSWritingDirection)NSWritingDirection:(id)json; -+ (UITextAutocapitalizationType)UITextAutocapitalizationType:(id)json; -+ (UIKeyboardType)UIKeyboardType:(id)json; - -+ (CGFloat)CGFloat:(id)json; -+ (CGPoint)CGPoint:(id)json; -+ (CGSize)CGSize:(id)json; -+ (CGRect)CGRect:(id)json; -+ (UIEdgeInsets)UIEdgeInsets:(id)json; - -+ (CATransform3D)CATransform3D:(id)json; -+ (CGAffineTransform)CGAffineTransform:(id)json; - -+ (UIColor *)UIColor:(id)json; -+ (CGColorRef)CGColor:(id)json; - -+ (CAKeyframeAnimation *)GIF:(id)json; -+ (UIImage *)UIImage:(id)json; -+ (CGImageRef)CGImage:(id)json; - -+ (UIFont *)UIFont:(UIFont *)font withSize:(id)json; -+ (UIFont *)UIFont:(UIFont *)font withWeight:(id)json; -+ (UIFont *)UIFont:(UIFont *)font withFamily:(id)json; -+ (UIFont *)UIFont:(UIFont *)font withFamily:(id)json size:(id)json weight:(id)json; - -+ (BOOL)css_overflow:(id)json; -+ (css_flex_direction_t)css_flex_direction_t:(id)json; -+ (css_justify_t)css_justify_t:(id)json; -+ (css_align_t)css_align_t:(id)json; -+ (css_position_type_t)css_position_type_t:(id)json; -+ (css_wrap_type_t)css_wrap_type_t:(id)json; - -+ (RCTPointerEvents)RCTPointerEvents:(id)json; -+ (RCTAnimationType)RCTAnimationType:(id)json; - -@end - -/** - * This function will attempt to set a property using a json value by first - * inferring the correct type from all available information, and then - * applying an appropriate conversion method. If the property does not - * exist, or the type cannot be inferred, the function will return NO. - */ -BOOL RCTSetProperty(id target, NSString *keypath, id json); - -/** - * This function attempts to copy a property from the source object to the - * destination object using KVC. If the property does not exist, or cannot - * be set, it will do nothing and return NO. - */ -BOOL RCTCopyProperty(id target, id source, NSString *keypath); diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTEventDispatcher.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTEventDispatcher.h deleted file mode 100644 index 5c97c8de6..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTEventDispatcher.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@class RCTBridge; - -typedef NS_ENUM(NSInteger, RCTTextEventType) { - RCTTextEventTypeFocus, - RCTTextEventTypeBlur, - RCTTextEventTypeChange, - RCTTextEventTypeSubmit, - RCTTextEventTypeEnd -}; - -typedef NS_ENUM(NSInteger, RCTScrollEventType) { - RCTScrollEventTypeStart, - RCTScrollEventTypeMove, - RCTScrollEventTypeEnd, - RCTScrollEventTypeStartDeceleration, - RCTScrollEventTypeEndDeceleration, - RCTScrollEventTypeEndAnimation, -}; - -/** - * This class wraps the -[RCTBridge enqueueJSCall:args:] method, and - * provides some convenience methods for generating event calls. - */ -@interface RCTEventDispatcher : NSObject - -- (instancetype)initWithBridge:(RCTBridge *)bridge; - -/** - * Send an application-specific event that does not relate to a specific - * view, e.g. a navigation or data update notification. - */ -- (void)sendAppEventWithName:(NSString *)name body:(id)body; - -/** - * Send a device or iOS event that does not relate to a specific view, - * e.g.rotation, location, keyboard show/hide, background/awake, etc. - */ -- (void)sendDeviceEventWithName:(NSString *)name body:(id)body; - -/** - * Send a user input event. The body dictionary must contain a "target" - * parameter, representing the react tag of the view sending the event - */ -- (void)sendInputEventWithName:(NSString *)name body:(NSDictionary *)body; - -/** - * Send a text input/focus event. - */ -- (void)sendTextEventWithType:(RCTTextEventType)type - reactTag:(NSNumber *)reactTag - text:(NSString *)text; - -/** - * Send a scroll event. - * (You can send a fake scroll event by passing nil for scrollView). - */ -- (void)sendScrollEventWithType:(RCTScrollEventType)type - reactTag:(NSNumber *)reactTag - scrollView:(UIScrollView *)scrollView - userData:(NSDictionary *)userData; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTExceptionsManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTExceptionsManager.h deleted file mode 100644 index 02ea33202..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTExceptionsManager.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTBridgeModule.h" - -@interface RCTExceptionsManager : NSObject - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTInvalidating.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTInvalidating.h deleted file mode 100644 index e810519fd..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTInvalidating.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -// TODO (#5906496): is there a reason for this protocol? It seems to be -// used in a number of places where it isn't really required - only the -// RCTBridge actually ever calls casts to it - in all other -// cases it is simply a way of adding some method definitions to classes - -@protocol RCTInvalidating - -@property (nonatomic, assign, readonly, getter = isValid) BOOL valid; - -- (void)invalidate; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTJSMethodRegistrar.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTJSMethodRegistrar.h deleted file mode 100644 index 20a35a96b..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTJSMethodRegistrar.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@class RCTBridge; - -/** - * Provides an interface to register JS methods to be called via the bridge. - */ -@protocol RCTJSMethodRegistrar -@optional - -/** - * An array of JavaScript methods that the class will call via the - * -[RCTBridge enqueueJSCall:args:] method. Each method should be specified - * as a string of the form "JSModuleName.jsMethodName". Attempting to call a - * method that has not been registered will result in an error. If a method - * has already been registered by another class, it is not necessary to - * register it again, but it is good practice. Registering the same method - * more than once is silently ignored and will not result in an error. - */ -+ (NSArray *)JSMethods; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h deleted file mode 100644 index 4d32f1c2f..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTInvalidating.h" - -typedef void (^RCTJavaScriptCompleteBlock)(NSError *error); -typedef void (^RCTJavaScriptCallback)(id json, NSError *error); - -/** - * Abstracts away a JavaScript execution context - we may be running code in a - * web view (for debugging purposes), or may be running code in a `JSContext`. - */ -@protocol RCTJavaScriptExecutor - -/** - * Executes given method with arguments on JS thread and calls the given callback - * with JSValue and JSContext as a result of the JS module call. - */ -- (void)executeJSCall:(NSString *)name - method:(NSString *)method - arguments:(NSArray *)arguments - callback:(RCTJavaScriptCallback)onComplete; - -/** - * Runs an application script, and notifies of the script load being complete via `onComplete`. - */ -- (void)executeApplicationScript:(NSString *)script - sourceURL:(NSURL *)url - onComplete:(RCTJavaScriptCompleteBlock)onComplete; - -- (void)injectJSONText:(NSString *)script - asGlobalObjectNamed:(NSString *)objectName - callback:(RCTJavaScriptCompleteBlock)onComplete; -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTKeyCommands.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTKeyCommands.h deleted file mode 100644 index f6748826e..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTKeyCommands.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@interface RCTKeyCommands : NSObject - -+ (instancetype)sharedInstance; - -/** - * Register a keyboard command. - */ -- (void)registerKeyCommandWithInput:(NSString *)input - modifierFlags:(UIKeyModifierFlags)flags - action:(void (^)(UIKeyCommand *command))block; - -/** - * Unregister a keyboard command. - */ -- (void)unregisterKeyCommandWithInput:(NSString *)input - modifierFlags:(UIKeyModifierFlags)flags; - -/** - * Check if a command is registered. - */ -- (BOOL)isKeyCommandRegisteredForInput:(NSString *)input - modifierFlags:(UIKeyModifierFlags)flags; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTLocationObserver.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTLocationObserver.h deleted file mode 100644 index ad3ba2ce2..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTLocationObserver.h +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTBridgeModule.h" - -@interface RCTLocationObserver : NSObject - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTLog.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTLog.h deleted file mode 100644 index ba72bc8ff..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTLog.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTAssert.h" -#import "RCTRedBox.h" - -#define RCTLOG_INFO 1 -#define RCTLOG_WARN 2 -#define RCTLOG_ERROR 3 -#define RCTLOG_MUSTFIX 4 - -// If set to e.g. `RCTLOG_ERROR`, will assert after logging the first error. -#if DEBUG -#define RCTLOG_FATAL_LEVEL RCTLOG_MUSTFIX -#define RCTLOG_REDBOX_LEVEL RCTLOG_ERROR -#else -#define RCTLOG_FATAL_LEVEL (RCTLOG_MUSTFIX + 1) -#define RCTLOG_REDBOX_LEVEL (RCTLOG_MUSTFIX + 1) -#endif - -// If defined, only log messages that match this regex will fatal -#define RCTLOG_FATAL_REGEX nil - -extern __unsafe_unretained NSString *RCTLogLevels[]; - -#define _RCTLog(_level, ...) do { \ - NSString *__RCTLog__levelStr = RCTLogLevels[_level - 1]; \ - NSString *__RCTLog__msg = RCTLogObjects(RCTLogFormat(__FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__), __RCTLog__levelStr); \ - if (_level >= RCTLOG_FATAL_LEVEL) { \ - BOOL __RCTLog__fail = YES; \ - if (RCTLOG_FATAL_REGEX) { \ - NSRegularExpression *__RCTLog__regex = [NSRegularExpression regularExpressionWithPattern:RCTLOG_FATAL_REGEX options:0 error:NULL]; \ - __RCTLog__fail = [__RCTLog__regex numberOfMatchesInString:__RCTLog__msg options:0 range:NSMakeRange(0, [__RCTLog__msg length])] > 0; \ - } \ - RCTCAssert(!__RCTLog__fail, @"RCTLOG_FATAL_LEVEL %@: %@", __RCTLog__levelStr, __RCTLog__msg); \ - } \ - if (_level >= RCTLOG_REDBOX_LEVEL) { \ - [[RCTRedBox sharedInstance] showErrorMessage:__RCTLog__msg]; \ - } \ -} while (0) - -#define RCTLog(...) _RCTLog(RCTLOG_INFO, __VA_ARGS__) -#define RCTLogInfo(...) _RCTLog(RCTLOG_INFO, __VA_ARGS__) -#define RCTLogWarn(...) _RCTLog(RCTLOG_WARN, __VA_ARGS__) -#define RCTLogError(...) _RCTLog(RCTLOG_ERROR, __VA_ARGS__) -#define RCTLogMustFix(...) _RCTLog(RCTLOG_MUSTFIX, __VA_ARGS__) - -#ifdef __cplusplus -extern "C" { -#endif - -NSString *RCTLogObjects(NSArray *objects, NSString *level); -NSArray *RCTLogFormat(const char *file, int lineNumber, const char *funcName, NSString *format, ...) NS_FORMAT_FUNCTION(4,5); - -void RCTInjectLogFunction(void (^logFunction)(NSString *msg)); - -#ifdef __cplusplus -} -#endif diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavItem.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavItem.h deleted file mode 100644 index 68f12fd45..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavItem.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@interface RCTNavItem : UIView - -@property (nonatomic, copy) NSString *title; -@property (nonatomic, copy) NSString *rightButtonTitle; -@property (nonatomic, copy) NSString *backButtonTitle; -@property (nonatomic, copy) UIColor *tintColor; -@property (nonatomic, copy) UIColor *barTintColor; -@property (nonatomic, copy) UIColor *titleTextColor; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavItemManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavItemManager.h deleted file mode 100644 index 3c2a32105..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavItemManager.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTNavItemManager : RCTViewManager - -@end - diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigator.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigator.h deleted file mode 100644 index c9051c753..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigator.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTInvalidating.h" - -@class RCTEventDispatcher; - -@interface RCTNavigator : UIView - -@property (nonatomic, strong) UIView *reactNavSuperviewLink; -@property (nonatomic, assign) NSInteger requestedTopOfStack; - -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; - -/** - * Schedules a JavaScript navigation and prevents `UIKit` from navigating until - * JavaScript has sent its scheduled navigation. - * - * @returns Whether or not a JavaScript driven navigation could be - * scheduled/reserved. If returning `NO`, JavaScript should usually just do - * nothing at all. - */ -- (BOOL)requestSchedulingJavaScriptNavigation; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigatorManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigatorManager.h deleted file mode 100644 index d32d21096..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTNavigatorManager.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTNavigatorManager : RCTViewManager - -@end - diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTPointerEvents.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTPointerEvents.h deleted file mode 100644 index 522bcce4c..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTPointerEvents.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -typedef NS_ENUM(NSInteger, RCTPointerEvents) { - RCTPointerEventsUnspecified = 0, // Default - RCTPointerEventsNone, - RCTPointerEventsBoxNone, - RCTPointerEventsBoxOnly, -}; diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTRedBox.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTRedBox.h deleted file mode 100644 index 82137eb06..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTRedBox.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@interface RCTRedBox : NSObject - -+ (instancetype)sharedInstance; - -- (void)showErrorMessage:(NSString *)message; -- (void)showErrorMessage:(NSString *)message withDetails:(NSString *)details; -- (void)showErrorMessage:(NSString *)message withStack:(NSArray *)stack; -- (void)updateErrorMessage:(NSString *)message withStack:(NSArray *)stack; - -- (void)dismiss; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTRootView.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTRootView.h deleted file mode 100644 index 240c000c3..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTRootView.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@interface RCTRootView : UIView - -/** - * The URL of the bundled application script (required). - * Setting this will clear the view contents, and trigger - * an asynchronous load/download and execution of the script. - */ -@property (nonatomic, strong) NSURL *scriptURL; - -/** - * The name of the JavaScript module to execute within the - * specified scriptURL (required). Setting this will not have - * any immediate effect, but it must be done prior to loading - * the script. - */ -@property (nonatomic, copy) NSString *moduleName; - -/** - * The default properties to apply to the view when the script bundle - * is first loaded. Defaults to nil/empty. - */ -@property (nonatomic, copy) NSDictionary *initialProperties; - -/** - * The class of the RCTJavaScriptExecutor to use with this view. - * If not specified, it will default to using RCTContextExecutor. - * Changes will take effect next time the bundle is reloaded. - */ -@property (nonatomic, strong) Class executorClass; - -/** - * Reload this root view, or all root views, respectively. - */ -- (void)reload; -+ (void)reloadAll; - -- (void)startOrResetInteractionTiming; -- (NSDictionary *)endAndResetInteractionTiming; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollView.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollView.h deleted file mode 100644 index 204ddf494..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollView.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTAutoInsetsProtocol.h" -#import "RCTScrollableProtocol.h" -#import "RCTView.h" - -@protocol UIScrollViewDelegate; - -@class RCTEventDispatcher; - -@interface RCTScrollView : RCTView - -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; - -/** - * If the `contentSize` is not provided, then the `contentSize` will - * automatically be determined by the size of the `RKScrollView` subview. - * - * The `RCTScrollView` may have at most one single subview. This will ensure - * that the scroll view's `contentSize` will be efficiently set to the size of - * the single subview's frame. That frame size will be determined somewhat - * efficiently since it will have already been computed by the off-main-thread - * layout system. - */ -@property (nonatomic, readonly) UIScrollView *scrollView; -@property (nonatomic, readonly) UIView *contentView; - -@property (nonatomic, assign) CGSize contentSize; -@property (nonatomic, assign) UIEdgeInsets contentInset; -@property (nonatomic, assign) BOOL automaticallyAdjustContentInsets; -@property (nonatomic, assign) NSUInteger throttleScrollCallbackMS; -@property (nonatomic, assign) BOOL centerContent; -@property (nonatomic, copy) NSArray *stickyHeaderIndices; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollViewManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollViewManager.h deleted file mode 100644 index 835e1c322..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollViewManager.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTScrollViewManager : RCTViewManager - -@end - diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollableProtocol.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollableProtocol.h deleted file mode 100644 index a0ae7b611..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTScrollableProtocol.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -/** - * Contains any methods related to scrolling. Any `RCTView` that has scrolling - * features should implement these methods. - */ -@protocol RCTScrollableProtocol - -@property (nonatomic, readwrite, weak) NSObject *nativeMainScrollDelegate; -@property (nonatomic, readonly) CGSize contentSize; - -- (void)scrollToOffset:(CGPoint)offset; -- (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated; -- (void)zoomToRect:(CGRect)rect animated:(BOOL)animated; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTShadowView.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTShadowView.h deleted file mode 100644 index 9a09bad4f..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTShadowView.h +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "Layout.h" -#import "RCTUIManager.h" -#import "RCTViewNodeProtocol.h" - -@class RCTSparseArray; - -typedef NS_ENUM(NSUInteger, RCTUpdateLifecycle) { - RCTUpdateLifecycleUninitialized = 0, - RCTUpdateLifecycleComputed, - RCTUpdateLifecycleDirtied, -}; - -// TODO: is this redundact now? -typedef void (^RCTApplierBlock)(RCTSparseArray *); - -/** - * ShadowView tree mirrors RCT view tree. Every node is highly stateful. - * 1. A node is in one of three lifecycles: uninitialized, computed, dirtied. - * 1. RCTBridge may call any of the padding/margin/width/height/top/left setters. A setter would dirty - * the node and all of its ancestors. - * 2. At the end of each Bridge transaction, we call collectUpdatedFrames:widthConstraint:heightConstraint - * at the root node to recursively lay out the entire hierarchy. - * 3. If a node is "computed" and the constraint passed from above is identical to the constraint used to - * perform the last computation, we skip laying out the subtree entirely. - */ -@interface RCTShadowView : NSObject - -@property (nonatomic, weak, readonly) RCTShadowView *superview; -@property (nonatomic, assign, readonly) css_node_t *cssNode; -@property (nonatomic, copy) NSString *moduleName; -@property (nonatomic, assign) BOOL isBGColorExplicitlySet; // Used to propogate to children -@property (nonatomic, strong) UIColor *backgroundColor; // Used to propogate to children -@property (nonatomic, assign) RCTUpdateLifecycle layoutLifecycle; - -/** - * isNewView - Used to track the first time the view is introduced into the hierarchy. It is initialized YES, then is - * set to NO in RCTUIManager after the layout pass is done and all frames have been extracted to be applied to the - * corresponding UIViews. - */ -@property (nonatomic, assign, getter=isNewView) BOOL newView; - -/** - * Is this the shadowView for an RCTRootView - */ -@property (nonatomic, assign, getter=isReactRootView) BOOL reactRootView; - -/** - * Position and dimensions. - * Defaults to { 0, 0, NAN, NAN }. - */ -@property (nonatomic, assign) CGFloat top; -@property (nonatomic, assign) CGFloat left; -@property (nonatomic, assign) CGFloat width; -@property (nonatomic, assign) CGFloat height; -@property (nonatomic, assign) CGRect frame; - -- (void)setTopLeft:(CGPoint)topLeft; -- (void)setSize:(CGSize)size; - -/** - * Border. Defaults to { 0, 0, 0, 0 }. - */ -@property (nonatomic, assign) CGFloat borderTop; -@property (nonatomic, assign) CGFloat borderLeft; -@property (nonatomic, assign) CGFloat borderWidth; -@property (nonatomic, assign) CGFloat borderHeight; - -- (void)setBorderWidth:(CGFloat)value; - -/** - * Margin. Defaults to { 0, 0, 0, 0 }. - */ -@property (nonatomic, assign) CGFloat marginTop; -@property (nonatomic, assign) CGFloat marginLeft; -@property (nonatomic, assign) CGFloat marginBottom; -@property (nonatomic, assign) CGFloat marginRight; - -- (void)setMargin:(CGFloat)margin; -- (void)setMarginVertical:(CGFloat)margin; -- (void)setMarginHorizontal:(CGFloat)margin; - -/** - * Padding. Defaults to { 0, 0, 0, 0 }. - */ -@property (nonatomic, assign) CGFloat paddingTop; -@property (nonatomic, assign) CGFloat paddingLeft; -@property (nonatomic, assign) CGFloat paddingBottom; -@property (nonatomic, assign) CGFloat paddingRight; - -- (void)setPadding:(CGFloat)padding; -- (void)setPaddingVertical:(CGFloat)padding; -- (void)setPaddingHorizontal:(CGFloat)padding; - -- (UIEdgeInsets)paddingAsInsets; - -/** - * Flexbox properties. All zero/disabled by default - */ -@property (nonatomic, assign) css_flex_direction_t flexDirection; -@property (nonatomic, assign) css_justify_t justifyContent; -@property (nonatomic, assign) css_align_t alignSelf; -@property (nonatomic, assign) css_align_t alignItems; -@property (nonatomic, assign) css_position_type_t positionType; -@property (nonatomic, assign) css_wrap_type_t flexWrap; -@property (nonatomic, assign) CGFloat flex; - -/** - * Calculate property changes that need to be propagated to the view. - * The applierBlocks set contains RCTApplierBlock functions that must be applied - * on the main thread in order to update the view. - */ -- (void)collectUpdatedProperties:(NSMutableSet *)applierBlocks parentProperties:(NSDictionary *)parentProperties; - -/** - * Calculate all views whose frame needs updating after layout has been calculated. - * The viewsWithNewFrame set contains the reactTags of the views that need updating. - */ -- (void)collectRootUpdatedFrames:(NSMutableSet *)viewsWithNewFrame parentConstraint:(CGSize)parentConstraint; - -/** - * The following are implementation details exposed to subclasses. Do not call them directly - */ -- (void)fillCSSNode:(css_node_t *)node; -- (void)dirtyLayout; -- (BOOL)isLayoutDirty; - -// TODO: is this still needed? -- (void)dirtyPropagation; -- (BOOL)isPropagationDirty; - -// TODO: move this to text node? -- (void)dirtyText; -- (BOOL)isTextDirty; -- (void)setTextComputed; - -/** - * Triggers a recalculation of the shadow view's layout. - */ -- (void)updateShadowViewLayout; - -/** - * Computes the recursive offset, meaning the sum of all descendant offsets - - * this is the sum of all positions inset from parents. This is not merely the - * sum of `top`/`left`s, as this function uses the *actual* positions of - * children, not the style specified positions - it computes this based on the - * resulting layout. It does not yet compensate for native scroll view insets or - * transforms or anchor points. Returns an array containing the `x, y, width, - * height` of the shadow view relative to the ancestor, or `nil` if the `view` - * is not a descendent of `ancestor`. - */ -+ (CGRect)measureLayout:(RCTShadowView *)view relativeTo:(RCTShadowView *)ancestor; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTSparseArray.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTSparseArray.h deleted file mode 100644 index 47ad346f1..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTSparseArray.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@interface RCTSparseArray : NSObject - -- (instancetype)initWithCapacity:(NSUInteger)capacity NS_DESIGNATED_INITIALIZER; -- (instancetype)initWithSparseArray:(RCTSparseArray *)sparseArray NS_DESIGNATED_INITIALIZER; - -+ (instancetype)sparseArray; -+ (instancetype)sparseArrayWithCapacity:(NSUInteger)capacity; -+ (instancetype)sparseArrayWithSparseArray:(RCTSparseArray *)sparseArray; - -// Use nil object to remove at idx. -- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx; -- (id)objectAtIndexedSubscript:(NSUInteger)idx; - -// Use nil obj to remove at key. -- (void)setObject:(id)obj forKeyedSubscript:(NSNumber *)key; -- (id)objectForKeyedSubscript:(NSNumber *)key; - -@property (readonly, nonatomic) NSUInteger count; -@property (readonly, nonatomic, copy) NSArray *allIndexes; -@property (readonly, nonatomic, copy) NSArray *allObjects; - -- (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSNumber *idx, BOOL *stop))block; -- (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (^)(id obj, NSNumber *idx, BOOL *stop))block; - -- (void)removeAllObjects; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStaticImage.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStaticImage.h deleted file mode 100644 index 75906be39..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStaticImage.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@interface RCTStaticImage : UIImageView - -@property (nonatomic, assign) UIEdgeInsets capInsets; -@property (nonatomic, assign) UIImageRenderingMode renderingMode; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStaticImageManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStaticImageManager.h deleted file mode 100644 index ab89cb96b..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStaticImageManager.h +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTStaticImageManager : RCTViewManager - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStatusBarManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStatusBarManager.h deleted file mode 100644 index 830393521..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTStatusBarManager.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTBridgeModule.h" - -@interface RCTStatusBarManager : NSObject - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextField.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextField.h deleted file mode 100644 index 1688f8fdc..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextField.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@class RCTEventDispatcher; - -@interface RCTTextField : UITextField - -@property (nonatomic, assign) BOOL caretHidden; -@property (nonatomic, assign) BOOL autoCorrect; -@property (nonatomic, assign) UIEdgeInsets paddingEdgeInsets; // TODO: contentInset - -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextFieldManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextFieldManager.h deleted file mode 100644 index 1f83a47d8..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTextFieldManager.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTTextFieldManager : RCTViewManager - -@end - diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTiming.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTiming.h deleted file mode 100644 index aa55c2521..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTiming.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTBridgeModule.h" -#import "RCTInvalidating.h" - -@interface RCTTiming : NSObject - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTouchHandler.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTouchHandler.h deleted file mode 100644 index 46c81b9ef..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTTouchHandler.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTInvalidating.h" - -@class RCTBridge; - -@interface RCTTouchHandler : UIGestureRecognizer - -- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; -- (void)startOrResetInteractionTiming; -- (NSDictionary *)endAndResetInteractionTiming; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIActivityIndicatorViewManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIActivityIndicatorViewManager.h deleted file mode 100644 index d67661359..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIActivityIndicatorViewManager.h +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTUIActivityIndicatorViewManager : RCTViewManager - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIManager.h deleted file mode 100644 index 701c37f93..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUIManager.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTBridge.h" -#import "RCTBridgeModule.h" -#import "RCTInvalidating.h" -#import "RCTViewManager.h" - -@class RCTRootView; - -@protocol RCTScrollableProtocol; - -/** - * The RCTUIManager is the module responsible for updating the view hierarchy. - */ -@interface RCTUIManager : NSObject - -@property (nonatomic, weak) id mainScrollView; - -/** - * Allows native environment code to respond to "the main scroll view" events. - * see `RCTUIManager`'s `setMainScrollViewTag`. - */ -@property (nonatomic, readwrite, weak) id nativeMainScrollDelegate; - -/** - * Register a root view with the RCTUIManager. Theoretically, a single manager - * can support multiple root views, however this feature is not currently exposed - * and may eventually be removed. - */ -- (void)registerRootView:(RCTRootView *)rootView; - -/** - * Schedule a block to be executed on the UI thread. Useful if you need to execute - * view logic after all currently queued view updates have completed. - */ -- (void)addUIBlock:(RCTViewManagerUIBlock)block; - -/** - * The view that is currently first responder, according to the JS context. - */ -+ (UIView *)JSResponder; - -@end - -/** - * This category makes the current RCTUIManager instance available via the - * RCTBridge, which is useful for RCTBridgeModules or RCTViewManagers that - * need to access the RCTUIManager. - */ -@interface RCTBridge (RCTUIManager) - -@property (nonatomic, readonly) RCTUIManager *uiManager; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUtils.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUtils.h deleted file mode 100644 index de203e4ae..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTUtils.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import -#import - -#import "RCTAssert.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// Utility functions for JSON object <-> string serialization/deserialization -NSString *RCTJSONStringify(id jsonObject, NSError **error); -id RCTJSONParse(NSString *jsonString, NSError **error); - -// Get MD5 hash of a string (TODO: currently unused. Remove?) -NSString *RCTMD5Hash(NSString *string); - -// Get screen metrics in a thread-safe way -CGFloat RCTScreenScale(void); -CGSize RCTScreenSize(void); - -// Round float coordinates to nearest whole screen pixel (not point) -CGFloat RCTRoundPixelValue(CGFloat value); -CGFloat RCTCeilPixelValue(CGFloat value); -CGFloat RCTFloorPixelValue(CGFloat value); - -// Get current time, for precise performance metrics -NSTimeInterval RCTTGetAbsoluteTime(void); - -// Method swizzling -void RCTSwapClassMethods(Class cls, SEL original, SEL replacement); -void RCTSwapInstanceMethods(Class cls, SEL original, SEL replacement); - -// Module subclass support -BOOL RCTClassOverridesClassMethod(Class cls, SEL selector); -BOOL RCTClassOverridesInstanceMethod(Class cls, SEL selector); - -// Enumerate all classes that conform to NSObject protocol -void RCTEnumerateClasses(void (^block)(Class cls)); - -#ifdef __cplusplus -} -#endif diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTView.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTView.h deleted file mode 100644 index 802336633..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTView.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTView.h" - -#import - -#import "RCTPointerEvents.h" - -@protocol RCTAutoInsetsProtocol; - -@interface RCTView : UIView - -@property (nonatomic, assign) RCTPointerEvents pointerEvents; - -+ (void)autoAdjustInsetsForView:(UIView *)parentView - withScrollView:(UIScrollView *)scrollView - updateOffset:(BOOL)updateOffset; - -+ (UIViewController *)backingViewControllerForView:(UIView *)view; - -+ (UIEdgeInsets)contentInsetsForView:(UIView *)curView; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewManager.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewManager.h deleted file mode 100644 index d3b7c8a01..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewManager.h +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTBridgeModule.h" -#import "RCTConvert.h" -#import "RCTLog.h" - -@class RCTBridge; -@class RCTEventDispatcher; -@class RCTShadowView; -@class RCTSparseArray; -@class RCTUIManager; - -typedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, RCTSparseArray *viewRegistry); - -@interface RCTViewManager : NSObject - -/** - * The bridge can be used to access both the RCTUIIManager and the RCTEventDispatcher, - * allowing the manager (or the views that it manages) to manipulate the view - * hierarchy and send events back to the JS context. - */ -@property (nonatomic, strong) RCTBridge *bridge; - -/** - * The event dispatcher is used to send events back to the JavaScript application. - * It can either be used directly by the module, or passed on to instantiated - * view subclasses so that they can handle their own events. - */ -// TODO: remove this, as it can be accessed directly from bridge -@property (nonatomic, readonly) RCTEventDispatcher *eventDispatcher; - -/** - * The module name exposed to React JS. If omitted, this will be inferred - * automatically by using the view module's class name. It is better to not - * override this, and just follow standard naming conventions for your view - * module subclasses. - */ -+ (NSString *)moduleName; - -/** - * This method instantiates a native view to be managed by the module. Override - * this to return a custom view instance, which may be preconfigured with default - * properties, subviews, etc. This method will be called many times, and should - * return a fresh instance each time. The view module MUST NOT cache the returned - * view and return the same instance for subsequent calls. - */ -- (UIView *)view; - -/** - * This method instantiates a shadow view to be managed by the module. If omitted, - * an ordinary RCTShadowView instance will be created, which is typically fine for - * most view types. As with the -view method, the -shadowView method should return - * a fresh instance each time it is called. - */ -- (RCTShadowView *)shadowView; - -/** - * Returns a dictionary of config data passed to JS that defines eligible events - * that can be placed on native views. This should return bubbling - * directly-dispatched event types and specify what names should be used to - * subscribe to either form (bubbling/capturing). - * - * Returned dictionary should be of the form: @{ - * @"onTwirl": { - * @"phasedRegistrationNames": @{ - * @"bubbled": @"onTwirl", - * @"captured": @"onTwirlCaptured" - * } - * } - * } - * - * Note that this method is not inherited when you subclass a view module, and - * you should not call [super customBubblingEventTypes] when overriding it. - */ -+ (NSDictionary *)customBubblingEventTypes; - -/** - * Returns a dictionary of config data passed to JS that defines eligible events - * that can be placed on native views. This should return non-bubbling - * directly-dispatched event types. - * - * Returned dictionary should be of the form: @{ - * @"onTwirl": { - * @"registrationName": @"onTwirl" - * } - * } - * - * Note that this method is not inherited when you subclass a view module, and - * you should not call [super customDirectEventTypes] when overriding it. - */ -+ (NSDictionary *)customDirectEventTypes; - -/** - * Called to notify manager that layout has finished, in case any calculated - * properties need to be copied over from shadow view to view. - */ -- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowView *)shadowView; - -/** - * Called after view hierarchy manipulation has finished, and all shadow props - * have been set, but before layout has been performed. Useful for performing - * custo layout logic or tasks that involve walking the view hierarchy. - * To be deprecated, hopefully. - */ -- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(RCTSparseArray *)shadowViewRegistry; - -/** - * This handles the simple case, where JS and native property names match - * And the type can be automatically inferred. - */ -#define RCT_EXPORT_VIEW_PROPERTY(name) \ -RCT_REMAP_VIEW_PROPERTY(name, name) - -/** - * This macro maps a named property on the module to an arbitrary key path - * within the view. - */ -#define RCT_REMAP_VIEW_PROPERTY(name, keypath) \ -- (void)set_##name:(id)json forView:(id)view withDefaultView:(id)defaultView { \ - if ((json && !RCTSetProperty(view, @#keypath, json)) || \ - (!json && !RCTCopyProperty(view, defaultView, @#keypath))) { \ - RCTLogError(@"%@ does not have setter for `%s` property", [view class], #name); \ - } \ -} - -/** - * These macros can be used when you need to provide custom logic for setting - * view properties. The macro should be followed by a method body, which can - * refer to "json", "view" and "defaultView" to implement the required logic. - */ -#define RCT_CUSTOM_VIEW_PROPERTY(name, viewType) \ -- (void)set_##name:(id)json forView:(viewType)view withDefaultView:(viewType)defaultView - -#define RCT_CUSTOM_SHADOW_PROPERTY(name, viewType) \ -- (void)set_##name:(id)json forShadowView:(viewType)view withDefaultView:(viewType)defaultView - -/** - * These are useful in cases where the module's superclass handles a - * property, but you wish to "unhandle" it, so it will be ignored. - */ -#define RCT_IGNORE_VIEW_PROPERTY(name) \ -- (void)set_##name:(id)value forView:(id)view withDefaultView:(id)defaultView {} - -#define RCT_IGNORE_SHADOW_PROPERTY(name) \ -- (void)set_##name:(id)value forShadowView:(id)view withDefaultView:(id)defaultView {} - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h deleted file mode 100644 index b6f59ea10..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -/** - - * Logical node in a tree of application components. Both `ShadowView`s and - * `UIView+ReactKit`s conform to this. Allows us to write utilities that - * reason about trees generally. - */ -@protocol RCTViewNodeProtocol - -@property (nonatomic, copy) NSNumber *reactTag; - -- (void)insertReactSubview:(id)subview atIndex:(NSInteger)atIndex; -- (void)removeReactSubview:(id)subview; -- (NSMutableArray *)reactSubviews; -- (NSNumber *)reactTagAtPoint:(CGPoint)point; - -// View is an RCTRootView -- (BOOL)isReactRootView; - -@optional - -// TODO: Deprecate this -// This method is called after layout has been performed for all views known -// to the RCTViewManager. It is only called on UIViews, not shadow views. -- (void)reactBridgeDidFinishTransaction; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTWebViewExecutor.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTWebViewExecutor.h deleted file mode 100644 index 7f695f3f3..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTWebViewExecutor.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTJavaScriptExecutor.h" - -/** - * Uses an embedded web view merely for the purpose of being able to reuse the - * existing webkit debugging tools. Fulfills the role of a very constrained - * `JSContext`, which we call `RCTJavaScriptExecutor`. - * - * TODO: To ensure production-identical execution, scrub the window - * environment. And ensure main thread operations are actually added to a queue - * instead of being executed immediately if already on the main thread. - */ -@interface RCTWebViewExecutor : NSObject - -// Only one callback stored - will only be invoked for the latest issued -// application script request. -@property (nonatomic, copy) RCTJavaScriptCompleteBlock onApplicationScriptLoaded; - -/** - * Instantiate with a specific webview instance - */ -- (instancetype)initWithWebView:(UIWebView *)webView NS_DESIGNATED_INITIALIZER; - -/** - * Invoke this to reclaim the web view for reuse. This is necessary in order to - * allow debuggers to remain open, when creating a new `RCTWebViewExecutor`. - * This guards against the web view being invalidated, and makes sure the - * `delegate` is cleared first. - */ -- (UIWebView *)invalidateAndReclaimWebView; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h b/Examples/Movies/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h deleted file mode 100644 index 69075c6a4..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@class RCTEventDispatcher; -@class RCTNavItem; -@class RCTWrapperViewController; - -@protocol RCTWrapperViewControllerNavigationListener - -- (void)wrapperViewController:(RCTWrapperViewController *)wrapperViewController -didMoveToNavigationController:(UINavigationController *)navigationController; - -@end - -@interface RCTWrapperViewController : UIViewController - -- (instancetype)initWithContentView:(UIView *)contentView - eventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; - -- (instancetype)initWithNavItem:(RCTNavItem *)navItem - eventDispatcher:(RCTEventDispatcher *)eventDispatcher; - -@property (nonatomic, readwrite, weak) id navigationListener; -@property (nonatomic, strong, readwrite) RCTNavItem *navItem; - -@end diff --git a/Examples/Movies/Pods/Headers/Public/ReactKit/UIView+ReactKit.h b/Examples/Movies/Pods/Headers/Public/ReactKit/UIView+ReactKit.h deleted file mode 100644 index 3e45da8e7..000000000 --- a/Examples/Movies/Pods/Headers/Public/ReactKit/UIView+ReactKit.h +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTViewNodeProtocol.h" - -//TODO: let's try to eliminate this category if possible - -@interface UIView (ReactKit) - -@end diff --git a/Examples/Movies/Pods/Local Podspecs/RCTDataManager.podspec b/Examples/Movies/Pods/Local Podspecs/RCTDataManager.podspec deleted file mode 100644 index 84df787b8..000000000 --- a/Examples/Movies/Pods/Local Podspecs/RCTDataManager.podspec +++ /dev/null @@ -1,28 +0,0 @@ -Pod::Spec.new do |spec| - spec.name = 'RCTDataManager' - spec.version = '0.0.1' - spec.summary = 'Provides basic networking capabilities in ReactNative apps.' - spec.description = <<-DESC - Use XMLHttpRequest to fetch data over the network. - DESC - spec.homepage = 'https://facebook.github.io/react-native/' - spec.license = { :type => 'BSD' } - spec.author = 'Facebook' - spec.platform = :ios, '7.0' - spec.requires_arc = true - spec.source_files = '**/*.{h,m,c}' - spec.dependency "ReactKit", "~> 0.0.1" - - # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # Link your library with frameworks, or libraries. Libraries do not include - # the lib prefix of their name. - # - - # s.framework = "SomeFramework" - # s.frameworks = "SomeFramework", "AnotherFramework" - - # s.library = "iconv" - #spec.libraries = "RCTDataManager", "ReactKit" - -end diff --git a/Examples/Movies/Pods/Local Podspecs/RCTNetworkImage.podspec b/Examples/Movies/Pods/Local Podspecs/RCTNetworkImage.podspec deleted file mode 100644 index 47eb0e5f6..000000000 --- a/Examples/Movies/Pods/Local Podspecs/RCTNetworkImage.podspec +++ /dev/null @@ -1,28 +0,0 @@ -Pod::Spec.new do |spec| - spec.name = 'RCTNetworkImage' - spec.version = '0.0.1' - spec.summary = 'Provides basic Text capabilities in ReactNative apps.' - spec.description = <<-DESC - Text can be rendered in ReactNative apps with the component using this module. - DESC - spec.homepage = 'https://facebook.github.io/react-native/' - spec.license = { :type => 'BSD' } - spec.author = 'Facebook' - spec.platform = :ios, '7.0' - spec.requires_arc = true - spec.source_files = '**/*.{h,m,c}' - spec.dependency "ReactKit", "~> 0.0.1" - - # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # Link your library with frameworks, or libraries. Libraries do not include - # the lib prefix of their name. - # - - # s.framework = "SomeFramework" - # s.frameworks = "SomeFramework", "AnotherFramework" - - # s.library = "iconv" - #spec.libraries = "RCTNetworkImage", "ReactKit" - -end diff --git a/Examples/Movies/Pods/Local Podspecs/RCTText.podspec b/Examples/Movies/Pods/Local Podspecs/RCTText.podspec deleted file mode 100644 index 656e0ee74..000000000 --- a/Examples/Movies/Pods/Local Podspecs/RCTText.podspec +++ /dev/null @@ -1,28 +0,0 @@ -Pod::Spec.new do |spec| - spec.name = 'RCTText' - spec.version = '0.0.1' - spec.summary = 'Provides basic Text capabilities in ReactNative apps.' - spec.description = <<-DESC - Text can be rendered in ReactNative apps with the component using this module. - DESC - spec.homepage = 'https://facebook.github.io/react-native/' - spec.license = { :type => 'BSD' } - spec.author = 'Facebook' - spec.platform = :ios, '7.0' - spec.requires_arc = true - spec.source_files = '**/*.{h,m,c}' - spec.dependency "ReactKit", "~> 0.0.1" - - # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # Link your library with frameworks, or libraries. Libraries do not include - # the lib prefix of their name. - # - - # s.framework = "SomeFramework" - # s.frameworks = "SomeFramework", "AnotherFramework" - - # s.library = "iconv" - #spec.libraries = "RCTText", "ReactKit" - -end diff --git a/Examples/Movies/Pods/Local Podspecs/ReactKit.podspec b/Examples/Movies/Pods/Local Podspecs/ReactKit.podspec deleted file mode 100644 index 3e1a8a6e2..000000000 --- a/Examples/Movies/Pods/Local Podspecs/ReactKit.podspec +++ /dev/null @@ -1,16 +0,0 @@ -Pod::Spec.new do |spec| - spec.name = 'ReactKit' - spec.version = '0.0.1' - spec.summary = 'An implementation of React that targets UIKit for iOS' - spec.description = <<-DESC - Our first React Native implementation is ReactKit, targeting iOS. We are also working on an Android implementation which we will release later. ReactKit apps are built using the React JS framework, and render directly to native UIKit elements using a fully asynchronous architecture. There is no browser and no HTML. We have picked what we think is the best set of features from these and other technologies to build what we hope to become the best product development framework available, with an emphasis on iteration speed, developer delight, continuity of technology, and absolutely beautiful and fast products with no compromises in quality or capability. - DESC - spec.homepage = 'https://facebook.github.io/react-native/' - spec.license = { :type => 'BSD' } - spec.author = 'Facebook' - spec.platform = :ios, '7.0' - spec.requires_arc = true - spec.source_files = '**/*.{h,m,c}' - spec.public_header_files = "**/*.h" - #spec.library = "ReactKit" -end diff --git a/Examples/Movies/Pods/Manifest.lock b/Examples/Movies/Pods/Manifest.lock deleted file mode 100644 index cc2a8f981..000000000 --- a/Examples/Movies/Pods/Manifest.lock +++ /dev/null @@ -1,32 +0,0 @@ -PODS: - - RCTDataManager (0.0.1): - - ReactKit (~> 0.0.1) - - RCTNetworkImage (0.0.1): - - ReactKit (~> 0.0.1) - - RCTText (0.0.1): - - ReactKit (~> 0.0.1) - - ReactKit (0.0.1) - -DEPENDENCIES: - - RCTDataManager (from `../../Libraries/Network`) - - RCTNetworkImage (from `../../Libraries/Image`) - - RCTText (from `../../Libraries/Text`) - - ReactKit (from `../../ReactKit`) - -EXTERNAL SOURCES: - RCTDataManager: - :path: ../../Libraries/Network - RCTNetworkImage: - :path: ../../Libraries/Image - RCTText: - :path: ../../Libraries/Text - ReactKit: - :path: ../../ReactKit - -SPEC CHECKSUMS: - RCTDataManager: d38d2a6555886d68e8de623c4b97e2acdf01ed3e - RCTNetworkImage: 6d99735875916e098a65c68a54a72e67e24a402a - RCTText: 5c0cf4635241e8c02e8933853df03809d2dc8327 - ReactKit: 65c02c1e95951c198e491d2a4c1972675d4af254 - -COCOAPODS: 0.35.0 diff --git a/Examples/Movies/Pods/Pods.xcodeproj/project.pbxproj b/Examples/Movies/Pods/Pods.xcodeproj/project.pbxproj deleted file mode 100644 index 78abb2853..000000000 --- a/Examples/Movies/Pods/Pods.xcodeproj/project.pbxproj +++ /dev/null @@ -1,4332 +0,0 @@ - - - - - archiveVersion - 1 - classes - - objectVersion - 46 - objects - - 0173994FBD7222C1B4B85D39 - - buildConfigurations - - F68B2AE07F4085B87FF52821 - C2BDC288A96EC2C204FACAE4 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 01B6DA188F10AE9FFA70E61D - - fileRef - F2ABD2CA1B8437A717A8B02E - isa - PBXBuildFile - - 01D7CE13EF89CFA0018C19A0 - - fileRef - 8A82870BBCE2FA926206ED2D - isa - PBXBuildFile - - 02C832411CE32F64BDD67CC1 - - fileRef - 96F2CE3DEDD063F8FA50FC85 - isa - PBXBuildFile - - 03530ADCDC580A57166AA806 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTWebViewExecutor.h - path - Executors/RCTWebViewExecutor.h - sourceTree - <group> - - 03FD3C8DB550D1282CBB9C3E - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTViewNodeProtocol.h - path - Base/RCTViewNodeProtocol.h - sourceTree - <group> - - 044BBEB63131E9FE2F872148 - - buildActionMask - 2147483647 - files - - 4E6A93805B58D09C4600FF05 - C282F1B7233E10C31D165549 - D75EAAB4BC589DDF11232D56 - A8C61C98F7AD6EECE46F23A1 - 33916283B42A90EB2B8F2140 - 01B6DA188F10AE9FFA70E61D - 633B6147455573AD11D33B17 - D76CEC171F408A47616D2702 - 5D9B90F9719D985B55F7C18C - 5ECB6108E445CF5DE8A722E1 - 062503FBD206E26790A623AD - 5B6F23C6AAC6BB99EE21DB9C - DC18D421A4941275A1E7BAD4 - BB31A06505EACAC92D4D0A0B - EFF3190D434856C25227FE84 - 41AF61FF5047AC2A90E63243 - 4EE692971713B878D06E68BF - E7374582F5A63129724C8E68 - 88B72F3A6A40EC4748301F91 - 29BBF9FA713A5AB704D306E9 - F8081DBFD37093C1EEE34411 - BCB593A7E334E01470803D73 - E3096E2B995B282B80B5EB43 - 35A397022DF088C1172B1838 - 8DCC86B6F4E41374D0531909 - 7DB6785802A84DD169F83470 - BF614E05BE9314CB6B03CFF4 - FE2FDD4E39D0988AC7EFFDA9 - 4D889E6AAD0CCC67149429C8 - E334AB4D0391D82A0DE38C55 - 02C832411CE32F64BDD67CC1 - 837C1CE5C1C60B6A6F190B9C - 6F52D92057414C873A177506 - 1679781612747FFA6AAE8C09 - CBD46C255D226CC91750FF6E - 1B7076F6FD3566344815F47D - 3AD6AA2C3BC5D95361491E47 - 24598A9A8938EC9559EC5124 - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 05D4613D8454536A0C582506 - - baseConfigurationReference - 4C90FAF8FBD658990410C082 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - - isa - XCBuildConfiguration - name - Debug - - 062503FBD206E26790A623AD - - fileRef - 7ED6FCDD892431F7AC6D6C5A - isa - PBXBuildFile - - 0685D213EE86B64A622AFE5D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTTextField.m - path - Views/RCTTextField.m - sourceTree - <group> - - 06AAAC565037D8EF25720E03 - - fileRef - 7D2FB16662B96BDA8D478530 - isa - PBXBuildFile - - 093628ECA081B518E7705B0B - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTUIManager.h - path - Modules/RCTUIManager.h - sourceTree - <group> - - 0974827BD5B31C816AC72CAC - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods-ReactKit.a - sourceTree - BUILT_PRODUCTS_DIR - - 09DD900CDB912629197918C6 - - baseConfigurationReference - EACA5CCAD77673E65C1833FF - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-prefix.pch - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - - isa - XCBuildConfiguration - name - Debug - - 0AA8E7CAAA1EB4DFFBF6912C - - fileRef - 2EA25D395FD517EFB3A63CE0 - isa - PBXBuildFile - - 0B4C1F8311751A431A9E43EB - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTNavItem.h - path - Views/RCTNavItem.h - sourceTree - <group> - - 0D86E23D02587E54BDB5A0D7 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTShadowRawText.h - sourceTree - <group> - - 0D97C6D9FE8F0AF312C3ADBD - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text - name - Podfile - path - ../Podfile - sourceTree - SOURCE_ROOT - xcLanguageSpecificationIdentifier - xcode.lang.ruby - - 10C5E9DA9022285D577594CC - - buildConfigurations - - 6375425963FF6C21603732B4 - C3421858755177699D9E6345 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 10D002B7A1565F524A1F72C4 - - fileRef - C7DAA61CA1B9FB9112DC5983 - isa - PBXBuildFile - - 114860C3B3984FFBF421B47A - - containerPortal - AF4E3BAC82C6DDA51BDA9F71 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 13B7E1C57803F05652F30C1F - remoteInfo - Pods-ReactKit - - 11B7060CF244E44DEEF1FCD2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTNavigator.m - path - Views/RCTNavigator.m - sourceTree - <group> - - 13031656FE090AFA478A0C2E - - children - - 87B7D30CEC087A04E202DDF9 - EFC27C70A2E94665DCBD987F - 2E8B8AAB1186EB8F52D6EFC0 - - isa - PBXGroup - name - RCTDataManager - path - ../../../Libraries/Network - sourceTree - <group> - - 13B7E1C57803F05652F30C1F - - buildConfigurationList - 89592EB56DDBF7B54A3F915E - buildPhases - - 044BBEB63131E9FE2F872148 - 4F32A425781BE2418E5CD092 - EAAA2A06300750F7AF266715 - - buildRules - - dependencies - - isa - PBXNativeTarget - name - Pods-ReactKit - productName - Pods-ReactKit - productReference - 0974827BD5B31C816AC72CAC - productType - com.apple.product-type.library.static - - 1475284FDEE790E29FEF888A - - fileRef - 7C11EEBC74FF8F6EFB8BD6E5 - isa - PBXBuildFile - - 1679781612747FFA6AAE8C09 - - fileRef - 3390C2E3EC519AA76A894A7D - isa - PBXBuildFile - - 17E61BB696CF0023E490D3CA - - fileRef - 2DA988B3C7927462F6BB59D3 - isa - PBXBuildFile - - 1ACF8F46B5AD479EC0466814 - - fileRef - 38F25FBF3DBBC640787DE1CA - isa - PBXBuildFile - - 1B7076F6FD3566344815F47D - - fileRef - E6E580D9802C99CB05F48910 - isa - PBXBuildFile - - 1C1136F66431443A895D4575 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTStaticImageManager.h - path - Views/RCTStaticImageManager.h - sourceTree - <group> - - 1D5C968D81BECC8D8DEDC3A7 - - isa - PBXTargetDependency - name - Pods-RCTDataManager - target - 3FF676DAA336F8ABDEA584D9 - targetProxy - 3D469FC246B36C81E1EA93D2 - - 1EDA6F4B89391190F7502F3D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTRootView.m - path - Base/RCTRootView.m - sourceTree - <group> - - 212CF767A11B52D3DC51414C - - children - - 0D97C6D9FE8F0AF312C3ADBD - D8261275342CB017F0469C64 - 9048736F9B1A3F0F27F9756B - D9BE4CF160D48568F7B2FACB - 638F2CE8FA7884834B7EAC77 - - isa - PBXGroup - sourceTree - <group> - - 22E5124B31E3B321E794DC94 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - Layout.h - path - Layout/Layout.h - sourceTree - <group> - - 22E9B6EECA586FBF58E275F4 - - fileRef - F1AF16AE6F3215C601C8BF2A - isa - PBXBuildFile - - 23395DE50939F65252BF47BB - - fileRef - 3AC91EE176996201C149C349 - isa - PBXBuildFile - - 2361BD02D0DF3561CD7AEF1B - - isa - PBXTargetDependency - name - Pods-RCTText - target - 7E2C54A003A5BC8A330804F4 - targetProxy - DACF3CCEA461A0EFF3A35E2F - - 24598A9A8938EC9559EC5124 - - fileRef - A8023D6299F24D6877BEF258 - isa - PBXBuildFile - - 25489EEC4989DEA64FAE8023 - - fileRef - 4D5D8632A9C98162B3121441 - isa - PBXBuildFile - - 257F1B1261EF6B02C93E5D38 - - buildConfigurations - - 5F0D2152E1F3FFF4904B8AD1 - 9A3A4BADEAD95DF2CD29E9FF - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 2642D314F24DD3D6748B767E - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTShadowView.h - path - Views/RCTShadowView.h - sourceTree - <group> - - 26A204DC9AB5C60041E26549 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTNetworkImage-Private.xcconfig - sourceTree - <group> - - 26B3254CC05AAA7C7F9BAA92 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-RCTDataManager-prefix.pch - sourceTree - <group> - - 2857546735111E15C0AA45AC - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTExceptionsManager.h - path - Modules/RCTExceptionsManager.h - sourceTree - <group> - - 2873C87E10A36AE0FCBCC365 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTUtils.m - path - Base/RCTUtils.m - sourceTree - <group> - - 2909FAB5B87A982551EDB4EB - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTNetworkImageViewManager.m - sourceTree - <group> - - 293F7285A686B031D78DF112 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTTiming.m - path - Modules/RCTTiming.m - sourceTree - <group> - - 29BBF9FA713A5AB704D306E9 - - fileRef - 882FB9B260693792E2AFDABC - isa - PBXBuildFile - - 2DA988B3C7927462F6BB59D3 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTScrollableProtocol.h - path - Base/RCTScrollableProtocol.h - sourceTree - <group> - - 2E8B8AAB1186EB8F52D6EFC0 - - children - - F360C8A48A0EF89F49435FCC - EACA5CCAD77673E65C1833FF - B894B8E147E4FB2BB7ACA437 - 26B3254CC05AAA7C7F9BAA92 - - isa - PBXGroup - name - Support Files - path - ../../Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager - sourceTree - <group> - - 2EA25D395FD517EFB3A63CE0 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTImageDownloader.m - sourceTree - <group> - - 307038CC5432B6825D99CCBE - - fileRef - F70008E1D19432CFDECE123B - isa - PBXBuildFile - - 30DF4E19DFA1C80A5362DF26 - - buildActionMask - 2147483647 - files - - CD51637ED2FE910623A957AB - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 33092F9AC97DCFFCA7A6BEA5 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTSparseArray.m - path - Base/RCTSparseArray.m - sourceTree - <group> - - 3390C2E3EC519AA76A894A7D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTView.m - path - Views/RCTView.m - sourceTree - <group> - - 33916283B42A90EB2B8F2140 - - fileRef - 686E67C6B83BF51888A3313F - isa - PBXBuildFile - - 346B439D0B302F06A3944961 - - fileRef - C1273C2B1A34EE7896A3D5FA - isa - PBXBuildFile - - 354EDECEBDF81C85B10548DE - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTRawTextManager.h - sourceTree - <group> - - 355261A12E64B026B300EB1C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTNavigatorManager.m - path - Views/RCTNavigatorManager.m - sourceTree - <group> - - 35A397022DF088C1172B1838 - - fileRef - D394735C135D36533551DF37 - isa - PBXBuildFile - - 35FADD2E366746654FDF0073 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTUtils.h - path - Base/RCTUtils.h - sourceTree - <group> - - 36C25DD43B6139727D23ABDE - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTTextFieldManager.m - path - Views/RCTTextFieldManager.m - sourceTree - <group> - - 37701A8B9A2FBF4FBAA01F9C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTEventDispatcher.m - path - Base/RCTEventDispatcher.m - sourceTree - <group> - - 38F25FBF3DBBC640787DE1CA - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTJavaScriptExecutor.h - path - Base/RCTJavaScriptExecutor.h - sourceTree - <group> - - 3AC91EE176996201C149C349 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTText.h - sourceTree - <group> - - 3AD6AA2C3BC5D95361491E47 - - fileRef - 953CEE4B6D3D941453109D23 - isa - PBXBuildFile - - 3B1C86DC544A391311D0F119 - - fileRef - 43BB352AA7823226332FE80B - isa - PBXBuildFile - - 3B2EF60D760BB2D99E79CE51 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTUIActivityIndicatorViewManager.h - path - Views/RCTUIActivityIndicatorViewManager.h - sourceTree - <group> - - 3BDF7BEBB78C16E879E444E2 - - containerPortal - AF4E3BAC82C6DDA51BDA9F71 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 13B7E1C57803F05652F30C1F - remoteInfo - Pods-ReactKit - - 3C9A4805273F33EF92D439A4 - - fileRef - 35FADD2E366746654FDF0073 - isa - PBXBuildFile - - 3CD60F36DF6CEECFF4758BEE - - children - - 354EDECEBDF81C85B10548DE - 63887528ABF88595D89EDA8E - 0D86E23D02587E54BDB5A0D7 - 7D2FB16662B96BDA8D478530 - 4BC269B918F30C81607B1FEA - 4E4EF91447A42AE99235BDF8 - 3AC91EE176996201C149C349 - D2906EE46F872A418B6B33AB - B406BF0BF6506637A35D5167 - 45BE4B1D1F55EE3D947EB961 - 87E9F10D0A968F86A2D3E064 - - isa - PBXGroup - name - RCTText - path - ../../../Libraries/Text - sourceTree - <group> - - 3D469FC246B36C81E1EA93D2 - - containerPortal - AF4E3BAC82C6DDA51BDA9F71 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 3FF676DAA336F8ABDEA584D9 - remoteInfo - Pods-RCTDataManager - - 3DE934F8F76F207BD55AB677 - - fileRef - EE584546150D3E55E6515F2E - isa - PBXBuildFile - - 3E20F8895633E084956AFB54 - - fileRef - D0FD74048B7D3439EDC0DDCF - isa - PBXBuildFile - - 3F92F6DE3C2C780DD4346C6D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTStaticImage.h - path - Views/RCTStaticImage.h - sourceTree - <group> - - 3FF676DAA336F8ABDEA584D9 - - buildConfigurationList - 7E77223E8EF39DF16D41D603 - buildPhases - - 63359DD37C363E5C5515E6DE - 30DF4E19DFA1C80A5362DF26 - E4450895EB5C944681A11604 - - buildRules - - dependencies - - FE9545D71B365894A20387A0 - - isa - PBXNativeTarget - name - Pods-RCTDataManager - productName - Pods-RCTDataManager - productReference - 89664286C51C7DFFF1F672C7 - productType - com.apple.product-type.library.static - - 409B932149D89EC4BF4440F9 - - fileRef - 354EDECEBDF81C85B10548DE - isa - PBXBuildFile - - 4103A439B8CB9FEE139E77F9 - - containerPortal - AF4E3BAC82C6DDA51BDA9F71 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 13B7E1C57803F05652F30C1F - remoteInfo - Pods-ReactKit - - 41AF61FF5047AC2A90E63243 - - fileRef - 11B7060CF244E44DEEF1FCD2 - isa - PBXBuildFile - - 41D8E6FE5E575AF2F24ED506 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-environment.h - sourceTree - <group> - - 42E74C2012329B8DC0CDD8C0 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTAnimationType.h - path - Base/RCTAnimationType.h - sourceTree - <group> - - 43BB352AA7823226332FE80B - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTTiming.h - path - Modules/RCTTiming.h - sourceTree - <group> - - 44A3273EA768EAD9FB3033B0 - - fileRef - B5A92E4318F13DCE45C534F2 - isa - PBXBuildFile - - 45760E0B6F7A35A5C23C8B46 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTTouchHandler.h - path - Base/RCTTouchHandler.h - sourceTree - <group> - - 45BE4B1D1F55EE3D947EB961 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTTextManager.m - sourceTree - <group> - - 45D22F90E12DC985BE508454 - - fileRef - 03530ADCDC580A57166AA806 - isa - PBXBuildFile - - 472F97575D9645EDA8B23D43 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTRedBox.h - path - Base/RCTRedBox.h - sourceTree - <group> - - 48B2F9A5EEA775E9BDF2360D - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods.a - sourceTree - BUILT_PRODUCTS_DIR - - 496F484960908F7F255D665C - - fileRef - 8D0822A18641950E39DF6E85 - isa - PBXBuildFile - - 4B893B55D3B47F56554BCEEB - - fileRef - CC7A4C8E06F6C0B809F1ADF6 - isa - PBXBuildFile - - 4BC269B918F30C81607B1FEA - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTShadowText.h - sourceTree - <group> - - 4C90FAF8FBD658990410C082 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods.debug.xcconfig - sourceTree - <group> - - 4D5D8632A9C98162B3121441 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTNetworkImageView.m - sourceTree - <group> - - 4D889E6AAD0CCC67149429C8 - - fileRef - 293F7285A686B031D78DF112 - isa - PBXBuildFile - - 4E4EF91447A42AE99235BDF8 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTShadowText.m - sourceTree - <group> - - 4E58EBB9F3E15EDD045ABDA5 - - buildConfigurationList - 10C5E9DA9022285D577594CC - buildPhases - - 9B86394A814DD0363FFDB8E4 - AE10B2159AD52275F05F8AC9 - F6713859D76D7A17020FF1D7 - - buildRules - - dependencies - - 9E55FC1AF8AFBA8E3DA00D8E - - isa - PBXNativeTarget - name - Pods-RCTNetworkImage - productName - Pods-RCTNetworkImage - productReference - 5571F59D7888CF59E6621A86 - productType - com.apple.product-type.library.static - - 4E6A93805B58D09C4600FF05 - - fileRef - 55B5D865F1152367A8FBFA15 - isa - PBXBuildFile - - 4EE692971713B878D06E68BF - - fileRef - 355261A12E64B026B300EB1C - isa - PBXBuildFile - - 4F32A425781BE2418E5CD092 - - buildActionMask - 2147483647 - files - - 10D002B7A1565F524A1F72C4 - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 4F4B2DFFE6DB1F3F056D7A88 - - fileRef - 958F3D9CD59D82649DC4BBD0 - isa - PBXBuildFile - - 516150EA2C83F095456330AE - - children - - 55B5D865F1152367A8FBFA15 - 22E5124B31E3B321E794DC94 - EA5B9962C9C69FF5B105130C - B9F1F805E855F9FFAAEE736B - 42E74C2012329B8DC0CDD8C0 - 89108038536B016307C54316 - F3FA21714693F02F20D877A2 - 7331993774BA4B5BCBE7AF55 - C18BF11BD79C83BBFB1BD210 - 686E67C6B83BF51888A3313F - 958F3D9CD59D82649DC4BBD0 - 8A82870BBCE2FA926206ED2D - F2ABD2CA1B8437A717A8B02E - FCFDA7AB4DB749DFF1E2511E - C1B075D45591A6568ECCD18C - 726EFD60805D922BEDE76C15 - 8A3990D8C3642C990B243791 - F1AF16AE6F3215C601C8BF2A - 37701A8B9A2FBF4FBAA01F9C - 2857546735111E15C0AA45AC - 74AA991D11A77BC7C2AC8B39 - FB45A4C5FE56C74F2EA4BD34 - 55CC7DF41E9AAAB8B442F56B - 38F25FBF3DBBC640787DE1CA - 8CA5B2C0AF0A2725E53213B8 - 7ED6FCDD892431F7AC6D6C5A - EE584546150D3E55E6515F2E - C7DB5E0D273A12A263E3DF66 - E646155312572FA2F9C110A7 - A019FBFA9536047BFD4E8566 - 0B4C1F8311751A431A9E43EB - E90505537034D18BAC56279F - CC7A4C8E06F6C0B809F1ADF6 - F603040661CEDD4C306E6127 - 8C22AEF2E3B1B90ABF364B0F - 11B7060CF244E44DEEF1FCD2 - B8787968B4F54434A7E1511D - 355261A12E64B026B300EB1C - 7CAEE77776D2737B9F4302B2 - 472F97575D9645EDA8B23D43 - C076C6CC906607E83876CCC2 - 8D0822A18641950E39DF6E85 - 1EDA6F4B89391190F7502F3D - 697FA9A4B81DC1D336772B85 - 882FB9B260693792E2AFDABC - 9A52282291CFFDE6377AD032 - B758DF7D0F574FFF532D9764 - 2DA988B3C7927462F6BB59D3 - 2642D314F24DD3D6748B767E - 8B41BD0CA63A64FE32256CE7 - C564A2FC0A0C23D983F6A99B - 33092F9AC97DCFFCA7A6BEA5 - 3F92F6DE3C2C780DD4346C6D - D394735C135D36533551DF37 - 1C1136F66431443A895D4575 - C5B608C0F41A84743C23F253 - 7C11EEBC74FF8F6EFB8BD6E5 - 79A57B4BA9D5AF486080B4FF - B5A92E4318F13DCE45C534F2 - 0685D213EE86B64A622AFE5D - D0FD74048B7D3439EDC0DDCF - 36C25DD43B6139727D23ABDE - 43BB352AA7823226332FE80B - 293F7285A686B031D78DF112 - 45760E0B6F7A35A5C23C8B46 - AD89D20777D9EE94627336E2 - 3B2EF60D760BB2D99E79CE51 - 96F2CE3DEDD063F8FA50FC85 - 093628ECA081B518E7705B0B - 86A99FB3CFC16EAE185D6C86 - 35FADD2E366746654FDF0073 - 2873C87E10A36AE0FCBCC365 - 5D4352EBC14E9D6839CC937E - 3390C2E3EC519AA76A894A7D - C816B4169D2425B6E0DCBF6F - 63310B6F2F3EBE6CC8C9A58A - 03FD3C8DB550D1282CBB9C3E - 03530ADCDC580A57166AA806 - E6E580D9802C99CB05F48910 - 60D9D364FBF1236491FDE4DD - 953CEE4B6D3D941453109D23 - B888803D97B219E6B4E00A03 - A8023D6299F24D6877BEF258 - FB5BEEF19CFBB7012E80C408 - - isa - PBXGroup - name - ReactKit - path - ../../../ReactKit - sourceTree - <group> - - 527AA636955F4145805B828C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods.release.xcconfig - sourceTree - <group> - - 5445A5107FDF059DA476582F - - fileRef - 3F92F6DE3C2C780DD4346C6D - isa - PBXBuildFile - - 556D48417573C2CCC7132F1A - - fileRef - 60D9D364FBF1236491FDE4DD - isa - PBXBuildFile - - 5571F59D7888CF59E6621A86 - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods-RCTNetworkImage.a - sourceTree - BUILT_PRODUCTS_DIR - - 55B5D865F1152367A8FBFA15 - - includeInIndex - 1 - isa - PBXFileReference - name - Layout.c - path - Layout/Layout.c - sourceTree - <group> - - 55CC7DF41E9AAAB8B442F56B - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTJSMethodRegistrar.h - path - Base/RCTJSMethodRegistrar.h - sourceTree - <group> - - 58B5D9EFD4CDD5F7431E1416 - - fileRef - 03FD3C8DB550D1282CBB9C3E - isa - PBXBuildFile - - 5B6F23C6AAC6BB99EE21DB9C - - fileRef - C7DB5E0D273A12A263E3DF66 - isa - PBXBuildFile - - 5D4352EBC14E9D6839CC937E - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTView.h - path - Views/RCTView.h - sourceTree - <group> - - 5D9B90F9719D985B55F7C18C - - fileRef - 37701A8B9A2FBF4FBAA01F9C - isa - PBXBuildFile - - 5E978F1482C798C60C70F510 - - fileRef - C7DAA61CA1B9FB9112DC5983 - isa - PBXBuildFile - - 5ECB6108E445CF5DE8A722E1 - - fileRef - 74AA991D11A77BC7C2AC8B39 - isa - PBXBuildFile - - 5ED39030F4CF73704BE6DCB1 - - fileRef - EFC27C70A2E94665DCBD987F - isa - PBXBuildFile - - 5F0D2152E1F3FFF4904B8AD1 - - baseConfigurationReference - 9E440049436804CE51BB0FC0 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - - isa - XCBuildConfiguration - name - Debug - - 606C88223FB67B48CDAC1C52 - - buildActionMask - 2147483647 - files - - 7901388968A3D19E9512DA4B - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 60D9D364FBF1236491FDE4DD - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTWrapperViewController.h - path - Views/RCTWrapperViewController.h - sourceTree - <group> - - 6157197253F577A6D0DB0372 - - fileRef - 0D86E23D02587E54BDB5A0D7 - isa - PBXBuildFile - - 61A02A7F08FC7D80DFBA7084 - - fileRef - D2906EE46F872A418B6B33AB - isa - PBXBuildFile - - 63310B6F2F3EBE6CC8C9A58A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTViewManager.m - path - Views/RCTViewManager.m - sourceTree - <group> - - 63359DD37C363E5C5515E6DE - - buildActionMask - 2147483647 - files - - C8CCB40239E2009CC5655B6B - 5ED39030F4CF73704BE6DCB1 - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 633B6147455573AD11D33B17 - - fileRef - C1B075D45591A6568ECCD18C - isa - PBXBuildFile - - 6375425963FF6C21603732B4 - - baseConfigurationReference - 26A204DC9AB5C60041E26549 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - - isa - XCBuildConfiguration - name - Debug - - 63887528ABF88595D89EDA8E - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTRawTextManager.m - sourceTree - <group> - - 638F2CE8FA7884834B7EAC77 - - children - - C3908657E1A50F7F808796C1 - - isa - PBXGroup - name - Targets Support Files - sourceTree - <group> - - 645997F70491670B86F2BA96 - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods-RCTText.a - sourceTree - BUILT_PRODUCTS_DIR - - 64CFDB05AE3A6A9975FFBCEA - - fileRef - 2642D314F24DD3D6748B767E - isa - PBXBuildFile - - 6664ADDDE2CD563193D50725 - - fileRef - FCFDA7AB4DB749DFF1E2511E - isa - PBXBuildFile - - 673ACA8D38F46D1E3F6C7B36 - - fileRef - B8787968B4F54434A7E1511D - isa - PBXBuildFile - - 686E67C6B83BF51888A3313F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTBridge.m - path - Base/RCTBridge.m - sourceTree - <group> - - 697FA9A4B81DC1D336772B85 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTScrollView.h - path - Views/RCTScrollView.h - sourceTree - <group> - - 6A34E09DEECEAFFE61EE78A4 - - containerPortal - AF4E3BAC82C6DDA51BDA9F71 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 4E58EBB9F3E15EDD045ABDA5 - remoteInfo - Pods-RCTNetworkImage - - 6C14CDB69262D0CF9F277492 - - fileRef - 5D4352EBC14E9D6839CC937E - isa - PBXBuildFile - - 6F14A0EF8B554164C0913DD8 - - fileRef - 697FA9A4B81DC1D336772B85 - isa - PBXBuildFile - - 6F52D92057414C873A177506 - - fileRef - 2873C87E10A36AE0FCBCC365 - isa - PBXBuildFile - - 7055E300F1E69B7B2328046D - - fileRef - D7DCC1BDDF6B30BCCF621E17 - isa - PBXBuildFile - - 706802052B608499FD490789 - - fileRef - B406BF0BF6506637A35D5167 - isa - PBXBuildFile - - 726EFD60805D922BEDE76C15 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTConvert.h - path - Base/RCTConvert.h - sourceTree - <group> - - 7331993774BA4B5BCBE7AF55 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTAutoInsetsProtocol.h - path - Base/RCTAutoInsetsProtocol.h - sourceTree - <group> - - 74640D1CD100B3C90CF9387E - - buildActionMask - 2147483647 - files - - 7055E300F1E69B7B2328046D - E9778064D3F51028ADAE1A34 - 06AAAC565037D8EF25720E03 - 800F0AE9DD1C771B302C5840 - 61A02A7F08FC7D80DFBA7084 - 83BB290765484ABEA89B8CCA - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 74AA991D11A77BC7C2AC8B39 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTExceptionsManager.m - path - Modules/RCTExceptionsManager.m - sourceTree - <group> - - 7614DE0CECD1B9FF0338EB3F - - isa - PBXTargetDependency - name - Pods-ReactKit - target - 13B7E1C57803F05652F30C1F - targetProxy - 3BDF7BEBB78C16E879E444E2 - - 782532E10015155FB2604DE6 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-ReactKit.xcconfig - sourceTree - <group> - - 7830A204AA05E610158D3092 - - containerPortal - AF4E3BAC82C6DDA51BDA9F71 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 13B7E1C57803F05652F30C1F - remoteInfo - Pods-ReactKit - - 78C6E228F82F244A224CDAAC - - fileRef - 8C22AEF2E3B1B90ABF364B0F - isa - PBXBuildFile - - 7901388968A3D19E9512DA4B - - fileRef - C7DAA61CA1B9FB9112DC5983 - isa - PBXBuildFile - - 79A57B4BA9D5AF486080B4FF - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTStatusBarManager.m - path - Modules/RCTStatusBarManager.m - sourceTree - <group> - - 7B3E398E836D3D5B284BE497 - - fileRef - 42E74C2012329B8DC0CDD8C0 - isa - PBXBuildFile - - 7C11EEBC74FF8F6EFB8BD6E5 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTStatusBarManager.h - path - Modules/RCTStatusBarManager.h - sourceTree - <group> - - 7CAEE77776D2737B9F4302B2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTPointerEvents.h - path - Base/RCTPointerEvents.h - sourceTree - <group> - - 7D2FB16662B96BDA8D478530 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTShadowRawText.m - sourceTree - <group> - - 7DB6785802A84DD169F83470 - - fileRef - 79A57B4BA9D5AF486080B4FF - isa - PBXBuildFile - - 7E2C54A003A5BC8A330804F4 - - buildConfigurationList - 257F1B1261EF6B02C93E5D38 - buildPhases - - 74640D1CD100B3C90CF9387E - 606C88223FB67B48CDAC1C52 - A90788D6B35021C956CEFB59 - - buildRules - - dependencies - - 7614DE0CECD1B9FF0338EB3F - - isa - PBXNativeTarget - name - Pods-RCTText - productName - Pods-RCTText - productReference - 645997F70491670B86F2BA96 - productType - com.apple.product-type.library.static - - 7E4612BAA564E326F5CE9D8E - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTNetworkImageViewManager.h - sourceTree - <group> - - 7E53CCE7BC2F97B8D7A64AD0 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-ReactKit-prefix.pch - sourceTree - <group> - - 7E77223E8EF39DF16D41D603 - - buildConfigurations - - 09DD900CDB912629197918C6 - 963B62DCD1695389691DAA05 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 7ED6FCDD892431F7AC6D6C5A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTKeyCommands.m - path - Base/RCTKeyCommands.m - sourceTree - <group> - - 7EF8DB527F9619E040F0C6AE - - children - - C7DAA61CA1B9FB9112DC5983 - - isa - PBXGroup - name - iOS - sourceTree - <group> - - 800F0AE9DD1C771B302C5840 - - fileRef - 4E4EF91447A42AE99235BDF8 - isa - PBXBuildFile - - 8074519FA3432A12365C723C - - fileRef - E646155312572FA2F9C110A7 - isa - PBXBuildFile - - 81BC72A103E1C577C1B19212 - - baseConfigurationReference - 527AA636955F4145805B828C - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - 837C1CE5C1C60B6A6F190B9C - - fileRef - 86A99FB3CFC16EAE185D6C86 - isa - PBXBuildFile - - 8389891D3F795245EEC47D4B - - fileRef - 093628ECA081B518E7705B0B - isa - PBXBuildFile - - 83BB290765484ABEA89B8CCA - - fileRef - 45BE4B1D1F55EE3D947EB961 - isa - PBXBuildFile - - 83F79A097E2909089E3FC524 - - children - - D3875E94710A862C72C9D02D - 26A204DC9AB5C60041E26549 - F70008E1D19432CFDECE123B - 9A4B507CFD331E8018748CF1 - - isa - PBXGroup - name - Support Files - path - ../../Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage - sourceTree - <group> - - 86A99FB3CFC16EAE185D6C86 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTUIManager.m - path - Modules/RCTUIManager.m - sourceTree - <group> - - 87B7D30CEC087A04E202DDF9 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTDataManager.h - sourceTree - <group> - - 87E9F10D0A968F86A2D3E064 - - children - - 8FC0E1EC00909042A664442B - 9E440049436804CE51BB0FC0 - D7DCC1BDDF6B30BCCF621E17 - F398EE4EDB2C9867D5FF4E79 - - isa - PBXGroup - name - Support Files - path - ../../Examples/Movies/Pods/Target Support Files/Pods-RCTText - sourceTree - <group> - - 882FB9B260693792E2AFDABC - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTScrollView.m - path - Views/RCTScrollView.m - sourceTree - <group> - - 88B72F3A6A40EC4748301F91 - - fileRef - 1EDA6F4B89391190F7502F3D - isa - PBXBuildFile - - 89108038536B016307C54316 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTAssert.h - path - Base/RCTAssert.h - sourceTree - <group> - - 89592EB56DDBF7B54A3F915E - - buildConfigurations - - CDE95CDA8C87779EFE778F9A - D50240220E277743B098DBAD - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 89664286C51C7DFFF1F672C7 - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods-RCTDataManager.a - sourceTree - BUILT_PRODUCTS_DIR - - 8989408E16B49A592CECE05E - - fileRef - 55CC7DF41E9AAAB8B442F56B - isa - PBXBuildFile - - 8A3990D8C3642C990B243791 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTConvert.m - path - Base/RCTConvert.m - sourceTree - <group> - - 8A82870BBCE2FA926206ED2D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTCache.h - path - Base/RCTCache.h - sourceTree - <group> - - 8B41BD0CA63A64FE32256CE7 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTShadowView.m - path - Views/RCTShadowView.m - sourceTree - <group> - - 8BFDB4E6A534A18777DD9413 - - fileRef - 7E4612BAA564E326F5CE9D8E - isa - PBXBuildFile - - 8C22AEF2E3B1B90ABF364B0F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTNavigator.h - path - Views/RCTNavigator.h - sourceTree - <group> - - 8CA5B2C0AF0A2725E53213B8 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTKeyCommands.h - path - Base/RCTKeyCommands.h - sourceTree - <group> - - 8D0822A18641950E39DF6E85 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTRootView.h - path - Base/RCTRootView.h - sourceTree - <group> - - 8D89762D01606FF08D2D0415 - - fileRef - 9A52282291CFFDE6377AD032 - isa - PBXBuildFile - - 8DCC86B6F4E41374D0531909 - - fileRef - C5B608C0F41A84743C23F253 - isa - PBXBuildFile - - 8F2CA114699B27A7CF43562C - - buildConfigurationList - ECA2414C9D669EE25B29026B - buildPhases - - E79C749F7C18402B8FAC543A - F81FAD337D3D121CA8A5A4CA - - buildRules - - dependencies - - 1D5C968D81BECC8D8DEDC3A7 - D73FE49574ED6F2E1BE3AF20 - 2361BD02D0DF3561CD7AEF1B - DFFD02DED71CBF8CF075A273 - - isa - PBXNativeTarget - name - Pods - productName - Pods - productReference - 48B2F9A5EEA775E9BDF2360D - productType - com.apple.product-type.library.static - - 8FC0E1EC00909042A664442B - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTText.xcconfig - sourceTree - <group> - - 9048736F9B1A3F0F27F9756B - - children - - 7EF8DB527F9619E040F0C6AE - - isa - PBXGroup - name - Frameworks - sourceTree - <group> - - 90B9883EFAE5BB4CA68AA7ED - - fileRef - C564A2FC0A0C23D983F6A99B - isa - PBXBuildFile - - 953CEE4B6D3D941453109D23 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTWrapperViewController.m - path - Views/RCTWrapperViewController.m - sourceTree - <group> - - 958F3D9CD59D82649DC4BBD0 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTBridgeModule.h - path - Base/RCTBridgeModule.h - sourceTree - <group> - - 95F60EF688D3DC27638042A2 - - fileRef - 89108038536B016307C54316 - isa - PBXBuildFile - - 963B62DCD1695389691DAA05 - - baseConfigurationReference - EACA5CCAD77673E65C1833FF - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-prefix.pch - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - 965D54B6354201E9C547F888 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTNetworkImageView.h - sourceTree - <group> - - 96F2CE3DEDD063F8FA50FC85 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTUIActivityIndicatorViewManager.m - path - Views/RCTUIActivityIndicatorViewManager.m - sourceTree - <group> - - 9725F8B362AF089826F00A64 - - fileRef - 8CA5B2C0AF0A2725E53213B8 - isa - PBXBuildFile - - 99294162E5C2E03148EBF05C - - fileRef - 726EFD60805D922BEDE76C15 - isa - PBXBuildFile - - 9A3A4BADEAD95DF2CD29E9FF - - baseConfigurationReference - 9E440049436804CE51BB0FC0 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - 9A4B507CFD331E8018748CF1 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-RCTNetworkImage-prefix.pch - sourceTree - <group> - - 9A52282291CFFDE6377AD032 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTScrollViewManager.h - path - Views/RCTScrollViewManager.h - sourceTree - <group> - - 9B86394A814DD0363FFDB8E4 - - buildActionMask - 2147483647 - files - - 307038CC5432B6825D99CCBE - 0AA8E7CAAA1EB4DFFBF6912C - 25489EEC4989DEA64FAE8023 - B1BD47DA44AC279A3EDA0440 - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 9E440049436804CE51BB0FC0 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTText-Private.xcconfig - sourceTree - <group> - - 9E55FC1AF8AFBA8E3DA00D8E - - isa - PBXTargetDependency - name - Pods-ReactKit - target - 13B7E1C57803F05652F30C1F - targetProxy - 4103A439B8CB9FEE139E77F9 - - A019FBFA9536047BFD4E8566 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTLog.m - path - Base/RCTLog.m - sourceTree - <group> - - A1DCC56E57BB6053E663E32D - - fileRef - 7331993774BA4B5BCBE7AF55 - isa - PBXBuildFile - - A2CDF46CB581C9C678ECAC7C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text - path - Pods-acknowledgements.markdown - sourceTree - <group> - - A8023D6299F24D6877BEF258 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - UIView+ReactKit.m - path - Views/UIView+ReactKit.m - sourceTree - <group> - - A8C61C98F7AD6EECE46F23A1 - - fileRef - F3FA21714693F02F20D877A2 - isa - PBXBuildFile - - A8F2BA66EAD7DCC7C47897EC - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.script.sh - path - Pods-resources.sh - sourceTree - <group> - - A90788D6B35021C956CEFB59 - - buildActionMask - 2147483647 - files - - 409B932149D89EC4BF4440F9 - 6157197253F577A6D0DB0372 - DFF568166262DEA96AFD5450 - 23395DE50939F65252BF47BB - 706802052B608499FD490789 - - isa - PBXHeadersBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - AD2B1C2233FF46325D39E241 - - fileRef - F00FE630E41F44E6FFD45A71 - isa - PBXBuildFile - - AD89D20777D9EE94627336E2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTTouchHandler.m - path - Base/RCTTouchHandler.m - sourceTree - <group> - - AE10B2159AD52275F05F8AC9 - - buildActionMask - 2147483647 - files - - B58CA75AF8AD019B55CD1E32 - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - AF4E3BAC82C6DDA51BDA9F71 - - attributes - - LastUpgradeCheck - 0510 - - buildConfigurationList - 0173994FBD7222C1B4B85D39 - compatibilityVersion - Xcode 3.2 - developmentRegion - English - hasScannedForEncodings - 0 - isa - PBXProject - knownRegions - - en - - mainGroup - 212CF767A11B52D3DC51414C - productRefGroup - D9BE4CF160D48568F7B2FACB - projectDirPath - - projectReferences - - projectRoot - - targets - - 8F2CA114699B27A7CF43562C - 3FF676DAA336F8ABDEA584D9 - 4E58EBB9F3E15EDD045ABDA5 - 7E2C54A003A5BC8A330804F4 - 13B7E1C57803F05652F30C1F - - - B1BD47DA44AC279A3EDA0440 - - fileRef - 2909FAB5B87A982551EDB4EB - isa - PBXBuildFile - - B406BF0BF6506637A35D5167 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTTextManager.h - sourceTree - <group> - - B58CA75AF8AD019B55CD1E32 - - fileRef - C7DAA61CA1B9FB9112DC5983 - isa - PBXBuildFile - - B5A92E4318F13DCE45C534F2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTTextField.h - path - Views/RCTTextField.h - sourceTree - <group> - - B758DF7D0F574FFF532D9764 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTScrollViewManager.m - path - Views/RCTScrollViewManager.m - sourceTree - <group> - - B8121D544B10403943F18595 - - fileRef - 87B7D30CEC087A04E202DDF9 - isa - PBXBuildFile - - B8787968B4F54434A7E1511D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTNavigatorManager.h - path - Views/RCTNavigatorManager.h - sourceTree - <group> - - B888803D97B219E6B4E00A03 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - UIView+ReactKit.h - path - Views/UIView+ReactKit.h - sourceTree - <group> - - B894B8E147E4FB2BB7ACA437 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-RCTDataManager-dummy.m - sourceTree - <group> - - B9160C07A1D8C010D44E96BB - - fileRef - FB45A4C5FE56C74F2EA4BD34 - isa - PBXBuildFile - - B9F1F805E855F9FFAAEE736B - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTAlertManager.m - path - Modules/RCTAlertManager.m - sourceTree - <group> - - BB31A06505EACAC92D4D0A0B - - fileRef - E90505537034D18BAC56279F - isa - PBXBuildFile - - BCB593A7E334E01470803D73 - - fileRef - 8B41BD0CA63A64FE32256CE7 - isa - PBXBuildFile - - BE5C6A85BE08DB53D14CE20A - - fileRef - 7CAEE77776D2737B9F4302B2 - isa - PBXBuildFile - - BF614E05BE9314CB6B03CFF4 - - fileRef - 0685D213EE86B64A622AFE5D - isa - PBXBuildFile - - C004F0768C26A0FC14249BB2 - - fileRef - 0B4C1F8311751A431A9E43EB - isa - PBXBuildFile - - C076C6CC906607E83876CCC2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTRedBox.m - path - Base/RCTRedBox.m - sourceTree - <group> - - C0BCC72ACD29F6AAC357B59C - - fileRef - 472F97575D9645EDA8B23D43 - isa - PBXBuildFile - - C1273C2B1A34EE7896A3D5FA - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTImageDownloader.h - sourceTree - <group> - - C18BF11BD79C83BBFB1BD210 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTBridge.h - path - Base/RCTBridge.h - sourceTree - <group> - - C1B075D45591A6568ECCD18C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTContextExecutor.m - path - Executors/RCTContextExecutor.m - sourceTree - <group> - - C282F1B7233E10C31D165549 - - fileRef - CD2F169E76E103DA4112FFEC - isa - PBXBuildFile - - C2BDC288A96EC2C204FACAE4 - - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - CLANG_CXX_LANGUAGE_STANDARD - gnu++0x - CLANG_CXX_LIBRARY - libc++ - CLANG_ENABLE_MODULES - YES - CLANG_ENABLE_OBJC_ARC - YES - CLANG_WARN_BOOL_CONVERSION - YES - CLANG_WARN_CONSTANT_CONVERSION - YES - CLANG_WARN_DIRECT_OBJC_ISA_USAGE - YES - CLANG_WARN_EMPTY_BODY - YES - CLANG_WARN_ENUM_CONVERSION - YES - CLANG_WARN_INT_CONVERSION - YES - CLANG_WARN_OBJC_ROOT_CLASS - YES - COPY_PHASE_STRIP - NO - ENABLE_NS_ASSERTIONS - NO - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_PREPROCESSOR_DEFINITIONS - - RELEASE=1 - - GCC_WARN_64_TO_32_BIT_CONVERSION - YES - GCC_WARN_ABOUT_RETURN_TYPE - YES - GCC_WARN_UNDECLARED_SELECTOR - YES - GCC_WARN_UNINITIALIZED_AUTOS - YES - GCC_WARN_UNUSED_FUNCTION - YES - GCC_WARN_UNUSED_VARIABLE - YES - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - STRIP_INSTALLED_PRODUCT - NO - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - C3421858755177699D9E6345 - - baseConfigurationReference - 26A204DC9AB5C60041E26549 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - C3908657E1A50F7F808796C1 - - children - - A2CDF46CB581C9C678ECAC7C - E1F996C0BFA1F4C1D6EFC235 - F00FE630E41F44E6FFD45A71 - 41D8E6FE5E575AF2F24ED506 - A8F2BA66EAD7DCC7C47897EC - 4C90FAF8FBD658990410C082 - 527AA636955F4145805B828C - - isa - PBXGroup - name - Pods - path - Target Support Files/Pods - sourceTree - <group> - - C564A2FC0A0C23D983F6A99B - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTSparseArray.h - path - Base/RCTSparseArray.h - sourceTree - <group> - - C5B608C0F41A84743C23F253 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTStaticImageManager.m - path - Views/RCTStaticImageManager.m - sourceTree - <group> - - C7DAA61CA1B9FB9112DC5983 - - isa - PBXFileReference - lastKnownFileType - wrapper.framework - name - Foundation.framework - path - Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/Foundation.framework - sourceTree - DEVELOPER_DIR - - C7DB5E0D273A12A263E3DF66 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTLocationObserver.m - path - Modules/RCTLocationObserver.m - sourceTree - <group> - - C816B4169D2425B6E0DCBF6F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTViewManager.h - path - Views/RCTViewManager.h - sourceTree - <group> - - C8CCB40239E2009CC5655B6B - - fileRef - B894B8E147E4FB2BB7ACA437 - isa - PBXBuildFile - - CBD46C255D226CC91750FF6E - - fileRef - 63310B6F2F3EBE6CC8C9A58A - isa - PBXBuildFile - - CC7A4C8E06F6C0B809F1ADF6 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTNavItemManager.h - path - Views/RCTNavItemManager.h - sourceTree - <group> - - CD2F169E76E103DA4112FFEC - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-ReactKit-dummy.m - sourceTree - <group> - - CD51637ED2FE910623A957AB - - fileRef - C7DAA61CA1B9FB9112DC5983 - isa - PBXBuildFile - - CDE95CDA8C87779EFE778F9A - - baseConfigurationReference - E84F2418584963830725CDE6 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - - isa - XCBuildConfiguration - name - Debug - - D04E5DBEFDC4B2FA70ECBB57 - - fileRef - B888803D97B219E6B4E00A03 - isa - PBXBuildFile - - D0FD74048B7D3439EDC0DDCF - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTTextFieldManager.h - path - Views/RCTTextFieldManager.h - sourceTree - <group> - - D2906EE46F872A418B6B33AB - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTText.m - sourceTree - <group> - - D3875E94710A862C72C9D02D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTNetworkImage.xcconfig - sourceTree - <group> - - D394735C135D36533551DF37 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTStaticImage.m - path - Views/RCTStaticImage.m - sourceTree - <group> - - D50240220E277743B098DBAD - - baseConfigurationReference - E84F2418584963830725CDE6 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - D68FD95702012038D081A30C - - fileRef - C18BF11BD79C83BBFB1BD210 - isa - PBXBuildFile - - D73FE49574ED6F2E1BE3AF20 - - isa - PBXTargetDependency - name - Pods-RCTNetworkImage - target - 4E58EBB9F3E15EDD045ABDA5 - targetProxy - 6A34E09DEECEAFFE61EE78A4 - - D75EAAB4BC589DDF11232D56 - - fileRef - B9F1F805E855F9FFAAEE736B - isa - PBXBuildFile - - D76CEC171F408A47616D2702 - - fileRef - 8A3990D8C3642C990B243791 - isa - PBXBuildFile - - D7DCC1BDDF6B30BCCF621E17 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-RCTText-dummy.m - sourceTree - <group> - - D8261275342CB017F0469C64 - - children - - 13031656FE090AFA478A0C2E - EC0EF94CE6675DE213C63C55 - 3CD60F36DF6CEECFF4758BEE - 516150EA2C83F095456330AE - - isa - PBXGroup - name - Development Pods - sourceTree - <group> - - D8AC4BDDE87A9A5AEAFFE958 - - fileRef - 965D54B6354201E9C547F888 - isa - PBXBuildFile - - D9BE4CF160D48568F7B2FACB - - children - - 48B2F9A5EEA775E9BDF2360D - 89664286C51C7DFFF1F672C7 - 5571F59D7888CF59E6621A86 - 645997F70491670B86F2BA96 - 0974827BD5B31C816AC72CAC - - isa - PBXGroup - name - Products - sourceTree - <group> - - DACF3CCEA461A0EFF3A35E2F - - containerPortal - AF4E3BAC82C6DDA51BDA9F71 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 7E2C54A003A5BC8A330804F4 - remoteInfo - Pods-RCTText - - DC18D421A4941275A1E7BAD4 - - fileRef - A019FBFA9536047BFD4E8566 - isa - PBXBuildFile - - DFF568166262DEA96AFD5450 - - fileRef - 4BC269B918F30C81607B1FEA - isa - PBXBuildFile - - DFFD02DED71CBF8CF075A273 - - isa - PBXTargetDependency - name - Pods-ReactKit - target - 13B7E1C57803F05652F30C1F - targetProxy - 7830A204AA05E610158D3092 - - E1F996C0BFA1F4C1D6EFC235 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.plist.xml - path - Pods-acknowledgements.plist - sourceTree - <group> - - E2FC6E20D98E105B4DE2C724 - - fileRef - 22E5124B31E3B321E794DC94 - isa - PBXBuildFile - - E3096E2B995B282B80B5EB43 - - fileRef - 33092F9AC97DCFFCA7A6BEA5 - isa - PBXBuildFile - - E334AB4D0391D82A0DE38C55 - - fileRef - AD89D20777D9EE94627336E2 - isa - PBXBuildFile - - E4450895EB5C944681A11604 - - buildActionMask - 2147483647 - files - - B8121D544B10403943F18595 - - isa - PBXHeadersBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - E5BB88DE7333103EDD6BFEFA - - fileRef - EA5B9962C9C69FF5B105130C - isa - PBXBuildFile - - E646155312572FA2F9C110A7 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTLog.h - path - Base/RCTLog.h - sourceTree - <group> - - E6E580D9802C99CB05F48910 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTWebViewExecutor.m - path - Executors/RCTWebViewExecutor.m - sourceTree - <group> - - E7374582F5A63129724C8E68 - - fileRef - C076C6CC906607E83876CCC2 - isa - PBXBuildFile - - E73A41337A1AF48B8A39A088 - - fileRef - 2857546735111E15C0AA45AC - isa - PBXBuildFile - - E79C749F7C18402B8FAC543A - - buildActionMask - 2147483647 - files - - AD2B1C2233FF46325D39E241 - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - E84F2418584963830725CDE6 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-ReactKit-Private.xcconfig - sourceTree - <group> - - E90505537034D18BAC56279F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTNavItem.m - path - Views/RCTNavItem.m - sourceTree - <group> - - E9778064D3F51028ADAE1A34 - - fileRef - 63887528ABF88595D89EDA8E - isa - PBXBuildFile - - EA5B9962C9C69FF5B105130C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTAlertManager.h - path - Modules/RCTAlertManager.h - sourceTree - <group> - - EAAA2A06300750F7AF266715 - - buildActionMask - 2147483647 - files - - E2FC6E20D98E105B4DE2C724 - E5BB88DE7333103EDD6BFEFA - 7B3E398E836D3D5B284BE497 - 95F60EF688D3DC27638042A2 - A1DCC56E57BB6053E663E32D - D68FD95702012038D081A30C - 4F4B2DFFE6DB1F3F056D7A88 - 01D7CE13EF89CFA0018C19A0 - 6664ADDDE2CD563193D50725 - 99294162E5C2E03148EBF05C - 22E9B6EECA586FBF58E275F4 - E73A41337A1AF48B8A39A088 - B9160C07A1D8C010D44E96BB - 8989408E16B49A592CECE05E - 1ACF8F46B5AD479EC0466814 - 9725F8B362AF089826F00A64 - 3DE934F8F76F207BD55AB677 - 8074519FA3432A12365C723C - C004F0768C26A0FC14249BB2 - 4B893B55D3B47F56554BCEEB - 78C6E228F82F244A224CDAAC - 673ACA8D38F46D1E3F6C7B36 - BE5C6A85BE08DB53D14CE20A - C0BCC72ACD29F6AAC357B59C - 496F484960908F7F255D665C - 6F14A0EF8B554164C0913DD8 - 8D89762D01606FF08D2D0415 - 17E61BB696CF0023E490D3CA - 64CFDB05AE3A6A9975FFBCEA - 90B9883EFAE5BB4CA68AA7ED - 5445A5107FDF059DA476582F - FF564CF868E1285B9045D6EE - 1475284FDEE790E29FEF888A - 44A3273EA768EAD9FB3033B0 - 3E20F8895633E084956AFB54 - 3B1C86DC544A391311D0F119 - FDAA8DAAE150AAE129BA4846 - FB31D58A343DF9884B38F1FC - 8389891D3F795245EEC47D4B - 3C9A4805273F33EF92D439A4 - 6C14CDB69262D0CF9F277492 - F45F64B628ABB38034419973 - 58B5D9EFD4CDD5F7431E1416 - 45D22F90E12DC985BE508454 - 556D48417573C2CCC7132F1A - D04E5DBEFDC4B2FA70ECBB57 - - isa - PBXHeadersBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - EACA5CCAD77673E65C1833FF - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTDataManager-Private.xcconfig - sourceTree - <group> - - EC0EF94CE6675DE213C63C55 - - children - - C1273C2B1A34EE7896A3D5FA - 2EA25D395FD517EFB3A63CE0 - 965D54B6354201E9C547F888 - 4D5D8632A9C98162B3121441 - 7E4612BAA564E326F5CE9D8E - 2909FAB5B87A982551EDB4EB - 83F79A097E2909089E3FC524 - - isa - PBXGroup - name - RCTNetworkImage - path - ../../../Libraries/Image - sourceTree - <group> - - ECA2414C9D669EE25B29026B - - buildConfigurations - - 05D4613D8454536A0C582506 - 81BC72A103E1C577C1B19212 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - EE584546150D3E55E6515F2E - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTLocationObserver.h - path - Modules/RCTLocationObserver.h - sourceTree - <group> - - EFC27C70A2E94665DCBD987F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTDataManager.m - sourceTree - <group> - - EFF3190D434856C25227FE84 - - fileRef - F603040661CEDD4C306E6127 - isa - PBXBuildFile - - F00FE630E41F44E6FFD45A71 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-dummy.m - sourceTree - <group> - - F1AF16AE6F3215C601C8BF2A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTEventDispatcher.h - path - Base/RCTEventDispatcher.h - sourceTree - <group> - - F2ABD2CA1B8437A717A8B02E - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTCache.m - path - Base/RCTCache.m - sourceTree - <group> - - F360C8A48A0EF89F49435FCC - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTDataManager.xcconfig - sourceTree - <group> - - F398EE4EDB2C9867D5FF4E79 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-RCTText-prefix.pch - sourceTree - <group> - - F3FA21714693F02F20D877A2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTAssert.m - path - Base/RCTAssert.m - sourceTree - <group> - - F45F64B628ABB38034419973 - - fileRef - C816B4169D2425B6E0DCBF6F - isa - PBXBuildFile - - F603040661CEDD4C306E6127 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTNavItemManager.m - path - Views/RCTNavItemManager.m - sourceTree - <group> - - F6713859D76D7A17020FF1D7 - - buildActionMask - 2147483647 - files - - 346B439D0B302F06A3944961 - D8AC4BDDE87A9A5AEAFFE958 - 8BFDB4E6A534A18777DD9413 - - isa - PBXHeadersBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - F68B2AE07F4085B87FF52821 - - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - CLANG_CXX_LANGUAGE_STANDARD - gnu++0x - CLANG_CXX_LIBRARY - libc++ - CLANG_ENABLE_MODULES - YES - CLANG_ENABLE_OBJC_ARC - YES - CLANG_WARN_BOOL_CONVERSION - YES - CLANG_WARN_CONSTANT_CONVERSION - YES - CLANG_WARN_DIRECT_OBJC_ISA_USAGE - YES - CLANG_WARN_EMPTY_BODY - YES - CLANG_WARN_ENUM_CONVERSION - YES - CLANG_WARN_INT_CONVERSION - YES - CLANG_WARN_OBJC_ROOT_CLASS - YES - COPY_PHASE_STRIP - YES - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - GCC_WARN_64_TO_32_BIT_CONVERSION - YES - GCC_WARN_ABOUT_RETURN_TYPE - YES - GCC_WARN_UNDECLARED_SELECTOR - YES - GCC_WARN_UNINITIALIZED_AUTOS - YES - GCC_WARN_UNUSED_FUNCTION - YES - GCC_WARN_UNUSED_VARIABLE - YES - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - ONLY_ACTIVE_ARCH - YES - STRIP_INSTALLED_PRODUCT - NO - - isa - XCBuildConfiguration - name - Debug - - F70008E1D19432CFDECE123B - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-RCTNetworkImage-dummy.m - sourceTree - <group> - - F8081DBFD37093C1EEE34411 - - fileRef - B758DF7D0F574FFF532D9764 - isa - PBXBuildFile - - F81FAD337D3D121CA8A5A4CA - - buildActionMask - 2147483647 - files - - 5E978F1482C798C60C70F510 - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - FB31D58A343DF9884B38F1FC - - fileRef - 3B2EF60D760BB2D99E79CE51 - isa - PBXBuildFile - - FB45A4C5FE56C74F2EA4BD34 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTInvalidating.h - path - Base/RCTInvalidating.h - sourceTree - <group> - - FB5BEEF19CFBB7012E80C408 - - children - - 782532E10015155FB2604DE6 - E84F2418584963830725CDE6 - CD2F169E76E103DA4112FFEC - 7E53CCE7BC2F97B8D7A64AD0 - - isa - PBXGroup - name - Support Files - path - ../Examples/Movies/Pods/Target Support Files/Pods-ReactKit - sourceTree - <group> - - FCFDA7AB4DB749DFF1E2511E - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTContextExecutor.h - path - Executors/RCTContextExecutor.h - sourceTree - <group> - - FDAA8DAAE150AAE129BA4846 - - fileRef - 45760E0B6F7A35A5C23C8B46 - isa - PBXBuildFile - - FE2FDD4E39D0988AC7EFFDA9 - - fileRef - 36C25DD43B6139727D23ABDE - isa - PBXBuildFile - - FE9545D71B365894A20387A0 - - isa - PBXTargetDependency - name - Pods-ReactKit - target - 13B7E1C57803F05652F30C1F - targetProxy - 114860C3B3984FFBF421B47A - - FF564CF868E1285B9045D6EE - - fileRef - 1C1136F66431443A895D4575 - isa - PBXBuildFile - - - rootObject - AF4E3BAC82C6DDA51BDA9F71 - - diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-Private.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-Private.xcconfig deleted file mode 100644 index 218750234..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-Private.xcconfig +++ /dev/null @@ -1,5 +0,0 @@ -#include "Pods-RCTDataManager.xcconfig" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/RCTDataManager" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTDataManager" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" -OTHER_LDFLAGS = -ObjC -PODS_ROOT = ${SRCROOT} \ No newline at end of file diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-dummy.m b/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-dummy.m deleted file mode 100644 index d24331906..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_RCTDataManager : NSObject -@end -@implementation PodsDummy_Pods_RCTDataManager -@end diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-prefix.pch b/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-prefix.pch deleted file mode 100644 index 95cf11d9f..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager-prefix.pch +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - -#import "Pods-environment.h" diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods-RCTDataManager/Pods-RCTDataManager.xcconfig deleted file mode 100644 index e69de29bb..000000000 diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-Private.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-Private.xcconfig deleted file mode 100644 index a6d8b3f6b..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-Private.xcconfig +++ /dev/null @@ -1,5 +0,0 @@ -#include "Pods-RCTNetworkImage.xcconfig" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/RCTNetworkImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTDataManager" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" -OTHER_LDFLAGS = -ObjC -PODS_ROOT = ${SRCROOT} \ No newline at end of file diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-dummy.m b/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-dummy.m deleted file mode 100644 index 04c9099fa..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_RCTNetworkImage : NSObject -@end -@implementation PodsDummy_Pods_RCTNetworkImage -@end diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch b/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch deleted file mode 100644 index 95cf11d9f..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - -#import "Pods-environment.h" diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage.xcconfig deleted file mode 100644 index e69de29bb..000000000 diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-Private.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-Private.xcconfig deleted file mode 100644 index bad687207..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-Private.xcconfig +++ /dev/null @@ -1,5 +0,0 @@ -#include "Pods-RCTText.xcconfig" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/RCTText" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTDataManager" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" -OTHER_LDFLAGS = -ObjC -PODS_ROOT = ${SRCROOT} \ No newline at end of file diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-dummy.m b/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-dummy.m deleted file mode 100644 index 0ee407269..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_RCTText : NSObject -@end -@implementation PodsDummy_Pods_RCTText -@end diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch b/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch deleted file mode 100644 index 95cf11d9f..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - -#import "Pods-environment.h" diff --git a/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods-RCTText/Pods-RCTText.xcconfig deleted file mode 100644 index e69de29bb..000000000 diff --git a/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-Private.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-Private.xcconfig deleted file mode 100644 index 0cbb59168..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-Private.xcconfig +++ /dev/null @@ -1,5 +0,0 @@ -#include "Pods-ReactKit.xcconfig" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/ReactKit" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTDataManager" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" -OTHER_LDFLAGS = -ObjC -PODS_ROOT = ${SRCROOT} \ No newline at end of file diff --git a/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-dummy.m b/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-dummy.m deleted file mode 100644 index ab3f82b8c..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_ReactKit : NSObject -@end -@implementation PodsDummy_Pods_ReactKit -@end diff --git a/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch b/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch deleted file mode 100644 index 95cf11d9f..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - -#import "Pods-environment.h" diff --git a/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit.xcconfig deleted file mode 100644 index e69de29bb..000000000 diff --git a/Examples/Movies/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown b/Examples/Movies/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown deleted file mode 100644 index 255149a82..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown +++ /dev/null @@ -1,3 +0,0 @@ -# Acknowledgements -This application makes use of the following third party libraries: -Generated by CocoaPods - http://cocoapods.org diff --git a/Examples/Movies/Pods/Target Support Files/Pods/Pods-acknowledgements.plist b/Examples/Movies/Pods/Target Support Files/Pods/Pods-acknowledgements.plist deleted file mode 100644 index e4edebe92..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods/Pods-acknowledgements.plist +++ /dev/null @@ -1,29 +0,0 @@ - - - - - PreferenceSpecifiers - - - FooterText - This application makes use of the following third party libraries: - Title - Acknowledgements - Type - PSGroupSpecifier - - - FooterText - Generated by CocoaPods - http://cocoapods.org - Title - - Type - PSGroupSpecifier - - - StringsTable - Acknowledgements - Title - Acknowledgements - - diff --git a/Examples/Movies/Pods/Target Support Files/Pods/Pods-dummy.m b/Examples/Movies/Pods/Target Support Files/Pods/Pods-dummy.m deleted file mode 100644 index ade64bd1a..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods/Pods-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods : NSObject -@end -@implementation PodsDummy_Pods -@end diff --git a/Examples/Movies/Pods/Target Support Files/Pods/Pods-environment.h b/Examples/Movies/Pods/Target Support Files/Pods/Pods-environment.h deleted file mode 100644 index 67012b5ac..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods/Pods-environment.h +++ /dev/null @@ -1,32 +0,0 @@ - -// To check if a library is compiled with CocoaPods you -// can use the `COCOAPODS` macro definition which is -// defined in the xcconfigs so it is available in -// headers also when they are imported in the client -// project. - - -// RCTDataManager -#define COCOAPODS_POD_AVAILABLE_RCTDataManager -#define COCOAPODS_VERSION_MAJOR_RCTDataManager 0 -#define COCOAPODS_VERSION_MINOR_RCTDataManager 0 -#define COCOAPODS_VERSION_PATCH_RCTDataManager 1 - -// RCTNetworkImage -#define COCOAPODS_POD_AVAILABLE_RCTNetworkImage -#define COCOAPODS_VERSION_MAJOR_RCTNetworkImage 0 -#define COCOAPODS_VERSION_MINOR_RCTNetworkImage 0 -#define COCOAPODS_VERSION_PATCH_RCTNetworkImage 1 - -// RCTText -#define COCOAPODS_POD_AVAILABLE_RCTText -#define COCOAPODS_VERSION_MAJOR_RCTText 0 -#define COCOAPODS_VERSION_MINOR_RCTText 0 -#define COCOAPODS_VERSION_PATCH_RCTText 1 - -// ReactKit -#define COCOAPODS_POD_AVAILABLE_ReactKit -#define COCOAPODS_VERSION_MAJOR_ReactKit 0 -#define COCOAPODS_VERSION_MINOR_ReactKit 0 -#define COCOAPODS_VERSION_PATCH_ReactKit 1 - diff --git a/Examples/Movies/Pods/Target Support Files/Pods/Pods-resources.sh b/Examples/Movies/Pods/Target Support Files/Pods/Pods-resources.sh deleted file mode 100755 index e149064a0..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods/Pods-resources.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh -set -e - -mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - -RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt -> "$RESOURCES_TO_COPY" - -install_resource() -{ - case $1 in - *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" - ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" - ;; - *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" - ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" - ;; - *.framework) - echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - ;; - *.xcdatamodel) - echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" - xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" - ;; - *.xcdatamodeld) - echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" - xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" - ;; - *.xcmappingmodel) - echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" - xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" - ;; - *.xcassets) - ;; - /*) - echo "$1" - echo "$1" >> "$RESOURCES_TO_COPY" - ;; - *) - echo "${PODS_ROOT}/$1" - echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" - ;; - esac -} - -rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -if [[ "${ACTION}" == "install" ]]; then - rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi -rm -f "$RESOURCES_TO_COPY" - -if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ `find . -name '*.xcassets' | wc -l` -ne 0 ] -then - case "${TARGETED_DEVICE_FAMILY}" in - 1,2) - TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" - ;; - 1) - TARGET_DEVICE_ARGS="--target-device iphone" - ;; - 2) - TARGET_DEVICE_ARGS="--target-device ipad" - ;; - *) - TARGET_DEVICE_ARGS="--target-device mac" - ;; - esac - find "${PWD}" -name "*.xcassets" -print0 | xargs -0 actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi diff --git a/Examples/Movies/Pods/Target Support Files/Pods/Pods.debug.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods/Pods.debug.xcconfig deleted file mode 100644 index 2f6368289..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods/Pods.debug.xcconfig +++ /dev/null @@ -1,6 +0,0 @@ -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTDataManager" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" -OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/RCTDataManager" -isystem "${PODS_ROOT}/Headers/Public/RCTNetworkImage" -isystem "${PODS_ROOT}/Headers/Public/RCTText" -isystem "${PODS_ROOT}/Headers/Public/ReactKit" -OTHER_LDFLAGS = -ObjC -l"Pods-RCTDataManager" -l"Pods-RCTNetworkImage" -l"Pods-RCTText" -l"Pods-ReactKit" -OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) -PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Examples/Movies/Pods/Target Support Files/Pods/Pods.release.xcconfig b/Examples/Movies/Pods/Target Support Files/Pods/Pods.release.xcconfig deleted file mode 100644 index 2f6368289..000000000 --- a/Examples/Movies/Pods/Target Support Files/Pods/Pods.release.xcconfig +++ /dev/null @@ -1,6 +0,0 @@ -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTDataManager" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" -OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/RCTDataManager" -isystem "${PODS_ROOT}/Headers/Public/RCTNetworkImage" -isystem "${PODS_ROOT}/Headers/Public/RCTText" -isystem "${PODS_ROOT}/Headers/Public/ReactKit" -OTHER_LDFLAGS = -ObjC -l"Pods-RCTDataManager" -l"Pods-RCTNetworkImage" -l"Pods-RCTText" -l"Pods-ReactKit" -OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) -PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Examples/Movies/SearchScreen.js b/Examples/Movies/SearchScreen.js index 2cd67aa19..2aa3f1ea8 100644 --- a/Examples/Movies/SearchScreen.js +++ b/Examples/Movies/SearchScreen.js @@ -7,7 +7,6 @@ var React = require('react-native'); var { ListView, - ListViewDataSource, ScrollView, ActivityIndicatorIOS, StyleSheet, @@ -44,7 +43,7 @@ var SearchScreen = React.createClass({ return { isLoading: false, isLoadingTail: false, - dataSource: new ListViewDataSource({ + dataSource: new ListView.DataSource({ rowHasChanged: (row1, row2) => row1 !== row2, }), filter: '', @@ -192,7 +191,7 @@ var SearchScreen = React.createClass({ }); }, - getDataSource: function(movies: Array): ListViewDataSource { + getDataSource: function(movies: Array): ListView.DataSource { return this.state.dataSource.cloneWithRows(movies); }, diff --git a/Examples/TicTacToe/AppDelegate.m b/Examples/TicTacToe/AppDelegate.m index 245bf2bd2..52e682752 100644 --- a/Examples/TicTacToe/AppDelegate.m +++ b/Examples/TicTacToe/AppDelegate.m @@ -2,7 +2,7 @@ #import "AppDelegate.h" -#import +#import "RCTRootView.h" @implementation AppDelegate diff --git a/Examples/TicTacToe/AppDelegate.m.orig b/Examples/TicTacToe/AppDelegate.m.orig new file mode 100644 index 000000000..52e682752 --- /dev/null +++ b/Examples/TicTacToe/AppDelegate.m.orig @@ -0,0 +1,44 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "AppDelegate.h" + +#import "RCTRootView.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + NSURL *jsCodeLocation; + RCTRootView *rootView = [[RCTRootView alloc] init]; + + // Loading JavaScript code - uncomment the one you want. + + // OPTION 1 + // Load from development server. Start the server from the repository root: + // + // $ npm start + // + // To run on device, change `localhost` to the IP address of your computer, and make sure your computer and + // iOS device are on the same Wi-Fi network. + jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/TicTacToe/TicTacToeApp.includeRequire.runModule.bundle"]; + + // OPTION 2 + // Load from pre-bundled file on disk. To re-generate the static bundle, run + // + // $ curl http://localhost:8081/Examples/TicTacToe/TicTacToeApp.includeRequire.runModule.bundle -o main.jsbundle + // + // and uncomment the next following line + // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; + + rootView.scriptURL = jsCodeLocation; + rootView.moduleName = @"TicTacToeApp"; + + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + UIViewController *rootViewController = [[UIViewController alloc] init]; + rootViewController.view = rootView; + self.window.rootViewController = rootViewController; + [self.window makeKeyAndVisible]; + return YES; +} + +@end diff --git a/Examples/TicTacToe/Podfile b/Examples/TicTacToe/Podfile deleted file mode 100644 index 61aedac11..000000000 --- a/Examples/TicTacToe/Podfile +++ /dev/null @@ -1,5 +0,0 @@ -source 'https://github.com/CocoaPods/Specs.git' - -pod 'RCTText', :path => '../../Libraries/Text' -pod 'RCTNetworkImage', :path => '../../Libraries/Image' -pod 'ReactKit', :path => '../../ReactKit' diff --git a/Examples/TicTacToe/Podfile.lock b/Examples/TicTacToe/Podfile.lock deleted file mode 100644 index 79377f7f5..000000000 --- a/Examples/TicTacToe/Podfile.lock +++ /dev/null @@ -1,26 +0,0 @@ -PODS: - - RCTNetworkImage (0.0.1): - - ReactKit (~> 0.0.1) - - RCTText (0.0.1): - - ReactKit (~> 0.0.1) - - ReactKit (0.0.1) - -DEPENDENCIES: - - RCTNetworkImage (from `../../Libraries/Image`) - - RCTText (from `../../Libraries/Text`) - - ReactKit (from `../../ReactKit`) - -EXTERNAL SOURCES: - RCTNetworkImage: - :path: ../../Libraries/Image - RCTText: - :path: ../../Libraries/Text - ReactKit: - :path: ../../ReactKit - -SPEC CHECKSUMS: - RCTNetworkImage: 6d99735875916e098a65c68a54a72e67e24a402a - RCTText: 5c0cf4635241e8c02e8933853df03809d2dc8327 - ReactKit: 65c02c1e95951c198e491d2a4c1972675d4af254 - -COCOAPODS: 0.35.0 diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTImageDownloader.h b/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTImageDownloader.h deleted file mode 100644 index b525ea1a7..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTImageDownloader.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -typedef void (^RCTDataDownloadBlock)(NSData *data, NSError *error); -typedef void (^RCTImageDownloadBlock)(UIImage *image, NSError *error); - -@interface RCTImageDownloader : NSObject - -+ (instancetype)sharedInstance; - -- (id)downloadDataForURL:(NSURL *)url - block:(RCTDataDownloadBlock)block; - -- (id)downloadImageForURL:(NSURL *)url - size:(CGSize)size - scale:(CGFloat)scale - block:(RCTImageDownloadBlock)block; - -- (void)cancelDownload:(id)downloadToken; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h b/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h deleted file mode 100644 index 920bf705c..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageView.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@class RCTImageDownloader; - -@interface RCTNetworkImageView : UIView - -- (instancetype)initWithFrame:(CGRect)frame - imageDownloader:(RCTImageDownloader *)imageDownloader NS_DESIGNATED_INITIALIZER; - -/** - * An image that will appear while the view is loading the image from the network, - * or when imageURL is nil. Defaults to nil. - */ -@property (nonatomic, strong) UIImage *defaultImage; - -/** - * Specify a URL for an image. The image will be asynchronously loaded and displayed. - */ -@property (nonatomic, strong) NSURL *imageURL; - -/** - * By default, changing imageURL will reset whatever existing image was present - * and revert to defaultImage while the new image loads. In certain obscure cases you - * may want to disable this behavior and instead keep displaying the previous image - * while the new one loads. In this case, pass NO for resetToDefaultImageWhileLoading. - * (If you set imageURL to nil, however, resetToDefaultImageWhileLoading is ignored; - * that will always reset to the default image.) - */ -- (void)setImageURL:(NSURL *)imageURL resetToDefaultImageWhileLoading:(BOOL)reset; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageViewManager.h b/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageViewManager.h deleted file mode 100644 index 5b34e6060..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/RCTNetworkImage/RCTNetworkImageViewManager.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTNetworkImageViewManager : RCTViewManager - -@end - diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTRawTextManager.h b/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTRawTextManager.h deleted file mode 100644 index 4c67fd328..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTRawTextManager.h +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTRawTextManager : RCTViewManager - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTShadowRawText.h b/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTShadowRawText.h deleted file mode 100644 index d1bdc7d72..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTShadowRawText.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTShadowView.h" - -@interface RCTShadowRawText : RCTShadowView - -@property (nonatomic, copy) NSString *text; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTShadowText.h b/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTShadowText.h deleted file mode 100644 index ddaf2ebe7..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTShadowText.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTShadowView.h" - -extern NSString *const RCTIsHighlightedAttributeName; -extern NSString *const RCTReactTagAttributeName; - -@interface RCTShadowText : RCTShadowView - -@property (nonatomic, assign) NSWritingDirection writingDirection; -@property (nonatomic, strong) UIColor *textBackgroundColor; -@property (nonatomic, strong) UIColor *color; -@property (nonatomic, strong) UIFont *font; -@property (nonatomic, copy) NSString *fontFamily; -@property (nonatomic, assign) CGFloat fontSize; -@property (nonatomic, copy) NSString *fontWeight; -@property (nonatomic, assign) BOOL isHighlighted; -@property (nonatomic, assign) CGFloat lineHeight; -@property (nonatomic, assign) NSInteger maxNumberOfLines; -@property (nonatomic, assign) CGSize shadowOffset; -@property (nonatomic, assign) NSTextAlignment textAlign; -@property (nonatomic, assign) NSLineBreakMode truncationMode; - -- (NSAttributedString *)attributedString; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTText.h b/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTText.h deleted file mode 100644 index 80ba3f234..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTText.h +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@interface RCTText : UIView - -@property (nonatomic, copy) NSAttributedString *attributedText; -@property (nonatomic, assign) NSLineBreakMode lineBreakMode; -@property (nonatomic, assign) NSUInteger numberOfLines; - -- (NSNumber *)reactTagAtPoint:(CGPoint)point; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTTextManager.h b/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTTextManager.h deleted file mode 100644 index 0359cce40..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/RCTText/RCTTextManager.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTTextManager : RCTViewManager - -@end - diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/Layout.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/Layout.h deleted file mode 100644 index 51f72493b..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/Layout.h +++ /dev/null @@ -1,148 +0,0 @@ -/** - * @generated SignedSource<<58298c7a8815a8675e970b0347dedfed>> - * - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !! This file is a check-in from github! !! - * !! !! - * !! You should not modify this file directly. Instead: !! - * !! 1) Go to https://github.com/facebook/css-layout !! - * !! 2) Make a pull request and get it merged !! - * !! 3) Execute ./import.sh to pull in the latest version !! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#ifndef __LAYOUT_H -#define __LAYOUT_H - -#include -#include -#define CSS_UNDEFINED NAN - -typedef enum { - CSS_FLEX_DIRECTION_COLUMN = 0, - CSS_FLEX_DIRECTION_ROW -} css_flex_direction_t; - -typedef enum { - CSS_JUSTIFY_FLEX_START = 0, - CSS_JUSTIFY_CENTER, - CSS_JUSTIFY_FLEX_END, - CSS_JUSTIFY_SPACE_BETWEEN, - CSS_JUSTIFY_SPACE_AROUND -} css_justify_t; - -// Note: auto is only a valid value for alignSelf. It is NOT a valid value for -// alignItems. -typedef enum { - CSS_ALIGN_AUTO = 0, - CSS_ALIGN_FLEX_START, - CSS_ALIGN_CENTER, - CSS_ALIGN_FLEX_END, - CSS_ALIGN_STRETCH -} css_align_t; - -typedef enum { - CSS_POSITION_RELATIVE = 0, - CSS_POSITION_ABSOLUTE -} css_position_type_t; - -typedef enum { - CSS_NOWRAP = 0, - CSS_WRAP -} css_wrap_type_t; - -// Note: left and top are shared between position[2] and position[4], so -// they have to be before right and bottom. -typedef enum { - CSS_LEFT = 0, - CSS_TOP, - CSS_RIGHT, - CSS_BOTTOM, - CSS_POSITION_COUNT -} css_position_t; - -typedef enum { - CSS_WIDTH = 0, - CSS_HEIGHT -} css_dimension_t; - -typedef struct { - float position[2]; - float dimensions[2]; - - // Instead of recomputing the entire layout every single time, we - // cache some information to break early when nothing changed - bool should_update; - float last_requested_dimensions[2]; - float last_parent_max_width; - float last_dimensions[2]; - float last_position[2]; -} css_layout_t; - -typedef struct { - float dimensions[2]; -} css_dim_t; - -typedef struct { - css_flex_direction_t flex_direction; - css_justify_t justify_content; - css_align_t align_items; - css_align_t align_self; - css_position_type_t position_type; - css_wrap_type_t flex_wrap; - float flex; - float margin[4]; - float position[4]; - /** - * You should skip all the rules that contain negative values for the - * following attributes. For example: - * {padding: 10, paddingLeft: -5} - * should output: - * {left: 10 ...} - * the following two are incorrect: - * {left: -5 ...} - * {left: 0 ...} - */ - float padding[4]; - float border[4]; - float dimensions[2]; -} css_style_t; - -typedef struct css_node { - css_style_t style; - css_layout_t layout; - int children_count; - - css_dim_t (*measure)(void *context, float width); - void (*print)(void *context); - struct css_node* (*get_child)(void *context, int i); - bool (*is_dirty)(void *context); - void *context; -} css_node_t; - - -// Lifecycle of nodes and children -css_node_t *new_css_node(void); -void init_css_node(css_node_t *node); -void free_css_node(css_node_t *node); - -// Print utilities -typedef enum { - CSS_PRINT_LAYOUT = 1, - CSS_PRINT_STYLE = 2, - CSS_PRINT_CHILDREN = 4, -} css_print_options_t; -void print_css_node(css_node_t *node, css_print_options_t options); - -// Function that computes the layout! -void layoutNode(css_node_t *node, float maxWidth); -bool isUndefined(float value); - -#endif diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAlertManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAlertManager.h deleted file mode 100644 index e24e0bc95..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAlertManager.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTBridgeModule.h" - -@interface RCTAlertManager : NSObject - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAnimationType.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAnimationType.h deleted file mode 100644 index dae90b845..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAnimationType.h +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -typedef NS_ENUM(NSInteger, RCTAnimationType) { - RCTAnimationTypeSpring = 0, - RCTAnimationTypeLinear, - RCTAnimationTypeEaseIn, - RCTAnimationTypeEaseOut, - RCTAnimationTypeEaseInEaseOut, -}; diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAssert.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAssert.h deleted file mode 100644 index 66f670430..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAssert.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#define RCTErrorDomain @"RCTErrorDomain" - -#define RCTAssert(condition, message, ...) _RCTAssert(condition, message, ##__VA_ARGS__) -#define RCTCAssert(condition, message, ...) _RCTCAssert(condition, message, ##__VA_ARGS__) - -typedef void (^RCTAssertFunction)(BOOL condition, NSString *message, ...); - -extern RCTAssertFunction RCTInjectedAssertFunction; -extern RCTAssertFunction RCTInjectedCAssertFunction; - -void RCTInjectAssertFunctions(RCTAssertFunction assertFunction, RCTAssertFunction cAssertFunction); - -#define _RCTAssert(condition, message, ...) \ -do { \ - if (RCTInjectedAssertFunction) { \ - RCTInjectedAssertFunction(condition, message, ##__VA_ARGS__); \ - } else { \ - NSAssert(condition, message, ##__VA_ARGS__); \ - } \ -} while (false) - -#define _RCTCAssert(condition, message, ...) \ -do { \ - if (RCTInjectedCAssertFunction) { \ - RCTInjectedCAssertFunction(condition, message, ##__VA_ARGS__); \ - } else { \ - NSCAssert(condition, message, ##__VA_ARGS__); \ - } \ -} while (false) - -#define RCTAssertMainThread() RCTAssert([NSThread isMainThread], @"This method must be called on the main thread"); -#define RCTCAssertMainThread() RCTCAssert([NSThread isMainThread], @"This function must be called on the main thread"); diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAutoInsetsProtocol.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAutoInsetsProtocol.h deleted file mode 100644 index 4f1cd4ba2..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTAutoInsetsProtocol.h +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -/** - * Defines a View that wants to support auto insets adjustment - */ -@protocol RCTAutoInsetsProtocol - -@property (nonatomic, assign, readwrite) UIEdgeInsets contentInset; -@property (nonatomic, assign, readwrite) BOOL automaticallyAdjustContentInsets; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridge.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridge.h deleted file mode 100644 index 4dcaee8e2..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridge.h +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTBridgeModule.h" -#import "RCTInvalidating.h" -#import "RCTJavaScriptExecutor.h" - -@class RCTBridge; -@class RCTEventDispatcher; - -/** - * This block can be used to instantiate modules that require additional - * init parameters, or additional configuration prior to being used. - * The bridge will call this block to instatiate the modules, and will - * be responsible for invalidating/releasing them when the bridge is destroyed. - * For this reason, the block should always return new module instances, and - * module instances should not be shared between bridges. - */ -typedef NSArray *(^RCTBridgeModuleProviderBlock)(void); - -/** - * Async batched bridge used to communicate with the JavaScript application. - */ -@interface RCTBridge : NSObject - -/** - * The designated initializer. This creates a new bridge on top of the specified - * executor. The bridge should then be used for all subsequent communication - * with the JavaScript code running in the executor. Modules will be automatically - * instantiated using the default contructor, but you can optionally pass in an - * array of pre-initialized module instances if they require additional init - * parameters or configuration. - */ -- (instancetype)initWithExecutor:(id)executor - moduleProvider:(RCTBridgeModuleProviderBlock)block NS_DESIGNATED_INITIALIZER; - -/** - * This method is used to call functions in the JavaScript application context. - * It is primarily intended for use by modules that require two-way communication - * with the JavaScript code. - */ -- (void)enqueueJSCall:(NSString *)moduleDotMethod args:(NSArray *)args; - -/** - * This method is used to execute a new application script. It is called - * internally whenever a JS application bundle is loaded/reloaded, but should - * probably not be used at any other time. - */ -- (void)enqueueApplicationScript:(NSString *)script url:(NSURL *)url onComplete:(RCTJavaScriptCompleteBlock)onComplete; - -/** - * The event dispatcher is a wrapper around -enqueueJSCall:args: that provides a - * higher-level interface for sending UI events such as touches and text input. - */ -@property (nonatomic, readonly) RCTEventDispatcher *eventDispatcher; - -/** - * A dictionary of all registered RCTBridgeModule instances, keyed by moduleName. - */ -@property (nonatomic, copy, readonly) NSDictionary *modules; - -/** - * The shadow queue is used to execute callbacks from the JavaScript code. All - * native hooks (e.g. exported module methods) will be executed on the shadow - * queue. - */ -@property (nonatomic, readonly) dispatch_queue_t shadowQueue; - -/** - * Global logging function that will print to both xcode and JS debugger consoles. - * - * NOTE: Use via RCTLog* macros defined in RCTLog.h - * TODO (#5906496): should log function be exposed here, or could it be a module? - */ -+ (void)log:(NSArray *)objects level:(NSString *)level; - -/** - * Method to check that a valid executor exists with which to log - */ -+ (BOOL)hasValidJSExecutor; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridgeModule.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridgeModule.h deleted file mode 100644 index 2627a0b9f..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTBridgeModule.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTJSMethodRegistrar.h" - -@class RCTBridge; - -/** - * The type of a block that is capable of sending a response to a bridged - * operation. Use this for returning callback methods to JS. - */ -typedef void (^RCTResponseSenderBlock)(NSArray *response); - -/** - * Provides the interface needed to register a bridge module. - */ -@protocol RCTBridgeModule -@optional - -/** - * A reference to the RCTBridge. Useful for modules that require access - * to bridge features, such as sending events or making JS calls. This - * will be set automatically by the bridge when it initializes the module. -* To implement this in your module, just add @synthesize bridge = _bridge; - */ -@property (nonatomic, strong) RCTBridge *bridge; - -/** - * The module name exposed to JS. If omitted, this will be inferred - * automatically by using the native module's class name. - */ -+ (NSString *)moduleName; - -/** - * Place this macro inside the method body of any method you want to expose - * to JS. The optional js_name argument will be used as the JS method name - * (the method will be namespaced to the module name, as specified above). - * If omitted, the JS method name will match the first part of the Objective-C - * method selector name (up to the first colon). - */ -#define RCT_EXPORT(js_name) __attribute__((used, section("__DATA,RCTExport" \ -))) static const char *__rct_export_entry__[] = { __func__, #js_name } - -/** - * Injects constants into JS. These constants are made accessible via - * NativeModules.ModuleName.X. This method is called when the module is - * registered by the bridge. It is only called once for the lifetime of the - * bridge, so it is not suitable for returning dynamic values, but may be - * used for long-lived values such as session keys, that are regenerated only - * as part of a reload of the entire React application. - */ -- (NSDictionary *)constantsToExport; - -/** - * Notifies the module that a batch of JS method invocations has just completed. - */ -- (void)batchDidComplete; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTCache.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTCache.h deleted file mode 100644 index 75943ae4f..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTCache.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@interface RCTCache : NSObject - -- (instancetype)init; // name = @"default" -- (instancetype)initWithName:(NSString *)name; - -@property (nonatomic, assign) NSUInteger maximumDiskSize; // in bytes - -#pragma mark - Retrieval - -- (BOOL)hasDataForKey:(NSString *)key; -- (void)fetchDataForKey:(NSString *)key completionHandler:(void (^)(NSData *data))completionHandler; - -#pragma mark - Insertion - -- (void)setData:(NSData *)data forKey:(NSString *)key; -- (void)removeAllData; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTContextExecutor.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTContextExecutor.h deleted file mode 100644 index 638ad8ba6..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTContextExecutor.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTJavaScriptExecutor.h" - -// TODO (#5906496): Might RCTJSCoreExecutor be a better name for this? - -/** - * Uses a JavaScriptCore context as the execution engine. - */ -@interface RCTContextExecutor : NSObject - -/** - * Configures the executor to run JavaScript on a custom performer. - * You probably don't want to use this; use -init instead. - */ -- (instancetype)initWithJavaScriptThread:(NSThread *)javaScriptThread - globalContextRef:(JSGlobalContextRef)context; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTConvert.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTConvert.h deleted file mode 100644 index 51a6b76ce..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTConvert.h +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import -#import - -#import "Layout.h" -#import "RCTPointerEvents.h" -#import "RCTAnimationType.h" - -/** - * This class provides a collection of conversion functions for mapping - * JSON objects to native types and classes. These are useful when writing - * custom RCTViewManager setter methods. - */ -@interface RCTConvert : NSObject - -+ (BOOL)BOOL:(id)json; -+ (double)double:(id)json; -+ (float)float:(id)json; -+ (int)int:(id)json; - -+ (NSString *)NSString:(id)json; -+ (NSNumber *)NSNumber:(id)json; -+ (NSInteger)NSInteger:(id)json; -+ (NSUInteger)NSUInteger:(id)json; - -+ (NSURL *)NSURL:(id)json; -+ (NSURLRequest *)NSURLRequest:(id)json; - -+ (NSDate *)NSDate:(id)json; -+ (NSTimeZone *)NSTimeZone:(id)json; -+ (NSTimeInterval)NSTimeInterval:(id)json; - -+ (NSTextAlignment)NSTextAlignment:(id)json; -+ (NSWritingDirection)NSWritingDirection:(id)json; -+ (UITextAutocapitalizationType)UITextAutocapitalizationType:(id)json; -+ (UIKeyboardType)UIKeyboardType:(id)json; - -+ (CGFloat)CGFloat:(id)json; -+ (CGPoint)CGPoint:(id)json; -+ (CGSize)CGSize:(id)json; -+ (CGRect)CGRect:(id)json; -+ (UIEdgeInsets)UIEdgeInsets:(id)json; - -+ (CATransform3D)CATransform3D:(id)json; -+ (CGAffineTransform)CGAffineTransform:(id)json; - -+ (UIColor *)UIColor:(id)json; -+ (CGColorRef)CGColor:(id)json; - -+ (CAKeyframeAnimation *)GIF:(id)json; -+ (UIImage *)UIImage:(id)json; -+ (CGImageRef)CGImage:(id)json; - -+ (UIFont *)UIFont:(UIFont *)font withSize:(id)json; -+ (UIFont *)UIFont:(UIFont *)font withWeight:(id)json; -+ (UIFont *)UIFont:(UIFont *)font withFamily:(id)json; -+ (UIFont *)UIFont:(UIFont *)font withFamily:(id)json size:(id)json weight:(id)json; - -+ (BOOL)css_overflow:(id)json; -+ (css_flex_direction_t)css_flex_direction_t:(id)json; -+ (css_justify_t)css_justify_t:(id)json; -+ (css_align_t)css_align_t:(id)json; -+ (css_position_type_t)css_position_type_t:(id)json; -+ (css_wrap_type_t)css_wrap_type_t:(id)json; - -+ (RCTPointerEvents)RCTPointerEvents:(id)json; -+ (RCTAnimationType)RCTAnimationType:(id)json; - -@end - -/** - * This function will attempt to set a property using a json value by first - * inferring the correct type from all available information, and then - * applying an appropriate conversion method. If the property does not - * exist, or the type cannot be inferred, the function will return NO. - */ -BOOL RCTSetProperty(id target, NSString *keypath, id json); - -/** - * This function attempts to copy a property from the source object to the - * destination object using KVC. If the property does not exist, or cannot - * be set, it will do nothing and return NO. - */ -BOOL RCTCopyProperty(id target, id source, NSString *keypath); diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTEventDispatcher.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTEventDispatcher.h deleted file mode 100644 index 5c97c8de6..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTEventDispatcher.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@class RCTBridge; - -typedef NS_ENUM(NSInteger, RCTTextEventType) { - RCTTextEventTypeFocus, - RCTTextEventTypeBlur, - RCTTextEventTypeChange, - RCTTextEventTypeSubmit, - RCTTextEventTypeEnd -}; - -typedef NS_ENUM(NSInteger, RCTScrollEventType) { - RCTScrollEventTypeStart, - RCTScrollEventTypeMove, - RCTScrollEventTypeEnd, - RCTScrollEventTypeStartDeceleration, - RCTScrollEventTypeEndDeceleration, - RCTScrollEventTypeEndAnimation, -}; - -/** - * This class wraps the -[RCTBridge enqueueJSCall:args:] method, and - * provides some convenience methods for generating event calls. - */ -@interface RCTEventDispatcher : NSObject - -- (instancetype)initWithBridge:(RCTBridge *)bridge; - -/** - * Send an application-specific event that does not relate to a specific - * view, e.g. a navigation or data update notification. - */ -- (void)sendAppEventWithName:(NSString *)name body:(id)body; - -/** - * Send a device or iOS event that does not relate to a specific view, - * e.g.rotation, location, keyboard show/hide, background/awake, etc. - */ -- (void)sendDeviceEventWithName:(NSString *)name body:(id)body; - -/** - * Send a user input event. The body dictionary must contain a "target" - * parameter, representing the react tag of the view sending the event - */ -- (void)sendInputEventWithName:(NSString *)name body:(NSDictionary *)body; - -/** - * Send a text input/focus event. - */ -- (void)sendTextEventWithType:(RCTTextEventType)type - reactTag:(NSNumber *)reactTag - text:(NSString *)text; - -/** - * Send a scroll event. - * (You can send a fake scroll event by passing nil for scrollView). - */ -- (void)sendScrollEventWithType:(RCTScrollEventType)type - reactTag:(NSNumber *)reactTag - scrollView:(UIScrollView *)scrollView - userData:(NSDictionary *)userData; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTExceptionsManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTExceptionsManager.h deleted file mode 100644 index 02ea33202..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTExceptionsManager.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTBridgeModule.h" - -@interface RCTExceptionsManager : NSObject - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTInvalidating.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTInvalidating.h deleted file mode 100644 index e810519fd..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTInvalidating.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -// TODO (#5906496): is there a reason for this protocol? It seems to be -// used in a number of places where it isn't really required - only the -// RCTBridge actually ever calls casts to it - in all other -// cases it is simply a way of adding some method definitions to classes - -@protocol RCTInvalidating - -@property (nonatomic, assign, readonly, getter = isValid) BOOL valid; - -- (void)invalidate; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJSMethodRegistrar.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJSMethodRegistrar.h deleted file mode 100644 index 20a35a96b..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJSMethodRegistrar.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@class RCTBridge; - -/** - * Provides an interface to register JS methods to be called via the bridge. - */ -@protocol RCTJSMethodRegistrar -@optional - -/** - * An array of JavaScript methods that the class will call via the - * -[RCTBridge enqueueJSCall:args:] method. Each method should be specified - * as a string of the form "JSModuleName.jsMethodName". Attempting to call a - * method that has not been registered will result in an error. If a method - * has already been registered by another class, it is not necessary to - * register it again, but it is good practice. Registering the same method - * more than once is silently ignored and will not result in an error. - */ -+ (NSArray *)JSMethods; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h deleted file mode 100644 index 4d32f1c2f..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTJavaScriptExecutor.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTInvalidating.h" - -typedef void (^RCTJavaScriptCompleteBlock)(NSError *error); -typedef void (^RCTJavaScriptCallback)(id json, NSError *error); - -/** - * Abstracts away a JavaScript execution context - we may be running code in a - * web view (for debugging purposes), or may be running code in a `JSContext`. - */ -@protocol RCTJavaScriptExecutor - -/** - * Executes given method with arguments on JS thread and calls the given callback - * with JSValue and JSContext as a result of the JS module call. - */ -- (void)executeJSCall:(NSString *)name - method:(NSString *)method - arguments:(NSArray *)arguments - callback:(RCTJavaScriptCallback)onComplete; - -/** - * Runs an application script, and notifies of the script load being complete via `onComplete`. - */ -- (void)executeApplicationScript:(NSString *)script - sourceURL:(NSURL *)url - onComplete:(RCTJavaScriptCompleteBlock)onComplete; - -- (void)injectJSONText:(NSString *)script - asGlobalObjectNamed:(NSString *)objectName - callback:(RCTJavaScriptCompleteBlock)onComplete; -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTKeyCommands.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTKeyCommands.h deleted file mode 100644 index f6748826e..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTKeyCommands.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@interface RCTKeyCommands : NSObject - -+ (instancetype)sharedInstance; - -/** - * Register a keyboard command. - */ -- (void)registerKeyCommandWithInput:(NSString *)input - modifierFlags:(UIKeyModifierFlags)flags - action:(void (^)(UIKeyCommand *command))block; - -/** - * Unregister a keyboard command. - */ -- (void)unregisterKeyCommandWithInput:(NSString *)input - modifierFlags:(UIKeyModifierFlags)flags; - -/** - * Check if a command is registered. - */ -- (BOOL)isKeyCommandRegisteredForInput:(NSString *)input - modifierFlags:(UIKeyModifierFlags)flags; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLocationObserver.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLocationObserver.h deleted file mode 100644 index ad3ba2ce2..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLocationObserver.h +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTBridgeModule.h" - -@interface RCTLocationObserver : NSObject - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLog.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLog.h deleted file mode 100644 index ba72bc8ff..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTLog.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTAssert.h" -#import "RCTRedBox.h" - -#define RCTLOG_INFO 1 -#define RCTLOG_WARN 2 -#define RCTLOG_ERROR 3 -#define RCTLOG_MUSTFIX 4 - -// If set to e.g. `RCTLOG_ERROR`, will assert after logging the first error. -#if DEBUG -#define RCTLOG_FATAL_LEVEL RCTLOG_MUSTFIX -#define RCTLOG_REDBOX_LEVEL RCTLOG_ERROR -#else -#define RCTLOG_FATAL_LEVEL (RCTLOG_MUSTFIX + 1) -#define RCTLOG_REDBOX_LEVEL (RCTLOG_MUSTFIX + 1) -#endif - -// If defined, only log messages that match this regex will fatal -#define RCTLOG_FATAL_REGEX nil - -extern __unsafe_unretained NSString *RCTLogLevels[]; - -#define _RCTLog(_level, ...) do { \ - NSString *__RCTLog__levelStr = RCTLogLevels[_level - 1]; \ - NSString *__RCTLog__msg = RCTLogObjects(RCTLogFormat(__FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__), __RCTLog__levelStr); \ - if (_level >= RCTLOG_FATAL_LEVEL) { \ - BOOL __RCTLog__fail = YES; \ - if (RCTLOG_FATAL_REGEX) { \ - NSRegularExpression *__RCTLog__regex = [NSRegularExpression regularExpressionWithPattern:RCTLOG_FATAL_REGEX options:0 error:NULL]; \ - __RCTLog__fail = [__RCTLog__regex numberOfMatchesInString:__RCTLog__msg options:0 range:NSMakeRange(0, [__RCTLog__msg length])] > 0; \ - } \ - RCTCAssert(!__RCTLog__fail, @"RCTLOG_FATAL_LEVEL %@: %@", __RCTLog__levelStr, __RCTLog__msg); \ - } \ - if (_level >= RCTLOG_REDBOX_LEVEL) { \ - [[RCTRedBox sharedInstance] showErrorMessage:__RCTLog__msg]; \ - } \ -} while (0) - -#define RCTLog(...) _RCTLog(RCTLOG_INFO, __VA_ARGS__) -#define RCTLogInfo(...) _RCTLog(RCTLOG_INFO, __VA_ARGS__) -#define RCTLogWarn(...) _RCTLog(RCTLOG_WARN, __VA_ARGS__) -#define RCTLogError(...) _RCTLog(RCTLOG_ERROR, __VA_ARGS__) -#define RCTLogMustFix(...) _RCTLog(RCTLOG_MUSTFIX, __VA_ARGS__) - -#ifdef __cplusplus -extern "C" { -#endif - -NSString *RCTLogObjects(NSArray *objects, NSString *level); -NSArray *RCTLogFormat(const char *file, int lineNumber, const char *funcName, NSString *format, ...) NS_FORMAT_FUNCTION(4,5); - -void RCTInjectLogFunction(void (^logFunction)(NSString *msg)); - -#ifdef __cplusplus -} -#endif diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavItem.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavItem.h deleted file mode 100644 index 68f12fd45..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavItem.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@interface RCTNavItem : UIView - -@property (nonatomic, copy) NSString *title; -@property (nonatomic, copy) NSString *rightButtonTitle; -@property (nonatomic, copy) NSString *backButtonTitle; -@property (nonatomic, copy) UIColor *tintColor; -@property (nonatomic, copy) UIColor *barTintColor; -@property (nonatomic, copy) UIColor *titleTextColor; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavItemManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavItemManager.h deleted file mode 100644 index 3c2a32105..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavItemManager.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTNavItemManager : RCTViewManager - -@end - diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigator.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigator.h deleted file mode 100644 index c9051c753..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigator.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTInvalidating.h" - -@class RCTEventDispatcher; - -@interface RCTNavigator : UIView - -@property (nonatomic, strong) UIView *reactNavSuperviewLink; -@property (nonatomic, assign) NSInteger requestedTopOfStack; - -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; - -/** - * Schedules a JavaScript navigation and prevents `UIKit` from navigating until - * JavaScript has sent its scheduled navigation. - * - * @returns Whether or not a JavaScript driven navigation could be - * scheduled/reserved. If returning `NO`, JavaScript should usually just do - * nothing at all. - */ -- (BOOL)requestSchedulingJavaScriptNavigation; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigatorManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigatorManager.h deleted file mode 100644 index d32d21096..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTNavigatorManager.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTNavigatorManager : RCTViewManager - -@end - diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTPointerEvents.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTPointerEvents.h deleted file mode 100644 index 522bcce4c..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTPointerEvents.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -typedef NS_ENUM(NSInteger, RCTPointerEvents) { - RCTPointerEventsUnspecified = 0, // Default - RCTPointerEventsNone, - RCTPointerEventsBoxNone, - RCTPointerEventsBoxOnly, -}; diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTRedBox.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTRedBox.h deleted file mode 100644 index 82137eb06..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTRedBox.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@interface RCTRedBox : NSObject - -+ (instancetype)sharedInstance; - -- (void)showErrorMessage:(NSString *)message; -- (void)showErrorMessage:(NSString *)message withDetails:(NSString *)details; -- (void)showErrorMessage:(NSString *)message withStack:(NSArray *)stack; -- (void)updateErrorMessage:(NSString *)message withStack:(NSArray *)stack; - -- (void)dismiss; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTRootView.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTRootView.h deleted file mode 100644 index 240c000c3..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTRootView.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@interface RCTRootView : UIView - -/** - * The URL of the bundled application script (required). - * Setting this will clear the view contents, and trigger - * an asynchronous load/download and execution of the script. - */ -@property (nonatomic, strong) NSURL *scriptURL; - -/** - * The name of the JavaScript module to execute within the - * specified scriptURL (required). Setting this will not have - * any immediate effect, but it must be done prior to loading - * the script. - */ -@property (nonatomic, copy) NSString *moduleName; - -/** - * The default properties to apply to the view when the script bundle - * is first loaded. Defaults to nil/empty. - */ -@property (nonatomic, copy) NSDictionary *initialProperties; - -/** - * The class of the RCTJavaScriptExecutor to use with this view. - * If not specified, it will default to using RCTContextExecutor. - * Changes will take effect next time the bundle is reloaded. - */ -@property (nonatomic, strong) Class executorClass; - -/** - * Reload this root view, or all root views, respectively. - */ -- (void)reload; -+ (void)reloadAll; - -- (void)startOrResetInteractionTiming; -- (NSDictionary *)endAndResetInteractionTiming; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollView.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollView.h deleted file mode 100644 index 204ddf494..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollView.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTAutoInsetsProtocol.h" -#import "RCTScrollableProtocol.h" -#import "RCTView.h" - -@protocol UIScrollViewDelegate; - -@class RCTEventDispatcher; - -@interface RCTScrollView : RCTView - -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; - -/** - * If the `contentSize` is not provided, then the `contentSize` will - * automatically be determined by the size of the `RKScrollView` subview. - * - * The `RCTScrollView` may have at most one single subview. This will ensure - * that the scroll view's `contentSize` will be efficiently set to the size of - * the single subview's frame. That frame size will be determined somewhat - * efficiently since it will have already been computed by the off-main-thread - * layout system. - */ -@property (nonatomic, readonly) UIScrollView *scrollView; -@property (nonatomic, readonly) UIView *contentView; - -@property (nonatomic, assign) CGSize contentSize; -@property (nonatomic, assign) UIEdgeInsets contentInset; -@property (nonatomic, assign) BOOL automaticallyAdjustContentInsets; -@property (nonatomic, assign) NSUInteger throttleScrollCallbackMS; -@property (nonatomic, assign) BOOL centerContent; -@property (nonatomic, copy) NSArray *stickyHeaderIndices; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollViewManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollViewManager.h deleted file mode 100644 index 835e1c322..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollViewManager.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTScrollViewManager : RCTViewManager - -@end - diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollableProtocol.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollableProtocol.h deleted file mode 100644 index a0ae7b611..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTScrollableProtocol.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -/** - * Contains any methods related to scrolling. Any `RCTView` that has scrolling - * features should implement these methods. - */ -@protocol RCTScrollableProtocol - -@property (nonatomic, readwrite, weak) NSObject *nativeMainScrollDelegate; -@property (nonatomic, readonly) CGSize contentSize; - -- (void)scrollToOffset:(CGPoint)offset; -- (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated; -- (void)zoomToRect:(CGRect)rect animated:(BOOL)animated; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTShadowView.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTShadowView.h deleted file mode 100644 index 9a09bad4f..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTShadowView.h +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "Layout.h" -#import "RCTUIManager.h" -#import "RCTViewNodeProtocol.h" - -@class RCTSparseArray; - -typedef NS_ENUM(NSUInteger, RCTUpdateLifecycle) { - RCTUpdateLifecycleUninitialized = 0, - RCTUpdateLifecycleComputed, - RCTUpdateLifecycleDirtied, -}; - -// TODO: is this redundact now? -typedef void (^RCTApplierBlock)(RCTSparseArray *); - -/** - * ShadowView tree mirrors RCT view tree. Every node is highly stateful. - * 1. A node is in one of three lifecycles: uninitialized, computed, dirtied. - * 1. RCTBridge may call any of the padding/margin/width/height/top/left setters. A setter would dirty - * the node and all of its ancestors. - * 2. At the end of each Bridge transaction, we call collectUpdatedFrames:widthConstraint:heightConstraint - * at the root node to recursively lay out the entire hierarchy. - * 3. If a node is "computed" and the constraint passed from above is identical to the constraint used to - * perform the last computation, we skip laying out the subtree entirely. - */ -@interface RCTShadowView : NSObject - -@property (nonatomic, weak, readonly) RCTShadowView *superview; -@property (nonatomic, assign, readonly) css_node_t *cssNode; -@property (nonatomic, copy) NSString *moduleName; -@property (nonatomic, assign) BOOL isBGColorExplicitlySet; // Used to propogate to children -@property (nonatomic, strong) UIColor *backgroundColor; // Used to propogate to children -@property (nonatomic, assign) RCTUpdateLifecycle layoutLifecycle; - -/** - * isNewView - Used to track the first time the view is introduced into the hierarchy. It is initialized YES, then is - * set to NO in RCTUIManager after the layout pass is done and all frames have been extracted to be applied to the - * corresponding UIViews. - */ -@property (nonatomic, assign, getter=isNewView) BOOL newView; - -/** - * Is this the shadowView for an RCTRootView - */ -@property (nonatomic, assign, getter=isReactRootView) BOOL reactRootView; - -/** - * Position and dimensions. - * Defaults to { 0, 0, NAN, NAN }. - */ -@property (nonatomic, assign) CGFloat top; -@property (nonatomic, assign) CGFloat left; -@property (nonatomic, assign) CGFloat width; -@property (nonatomic, assign) CGFloat height; -@property (nonatomic, assign) CGRect frame; - -- (void)setTopLeft:(CGPoint)topLeft; -- (void)setSize:(CGSize)size; - -/** - * Border. Defaults to { 0, 0, 0, 0 }. - */ -@property (nonatomic, assign) CGFloat borderTop; -@property (nonatomic, assign) CGFloat borderLeft; -@property (nonatomic, assign) CGFloat borderWidth; -@property (nonatomic, assign) CGFloat borderHeight; - -- (void)setBorderWidth:(CGFloat)value; - -/** - * Margin. Defaults to { 0, 0, 0, 0 }. - */ -@property (nonatomic, assign) CGFloat marginTop; -@property (nonatomic, assign) CGFloat marginLeft; -@property (nonatomic, assign) CGFloat marginBottom; -@property (nonatomic, assign) CGFloat marginRight; - -- (void)setMargin:(CGFloat)margin; -- (void)setMarginVertical:(CGFloat)margin; -- (void)setMarginHorizontal:(CGFloat)margin; - -/** - * Padding. Defaults to { 0, 0, 0, 0 }. - */ -@property (nonatomic, assign) CGFloat paddingTop; -@property (nonatomic, assign) CGFloat paddingLeft; -@property (nonatomic, assign) CGFloat paddingBottom; -@property (nonatomic, assign) CGFloat paddingRight; - -- (void)setPadding:(CGFloat)padding; -- (void)setPaddingVertical:(CGFloat)padding; -- (void)setPaddingHorizontal:(CGFloat)padding; - -- (UIEdgeInsets)paddingAsInsets; - -/** - * Flexbox properties. All zero/disabled by default - */ -@property (nonatomic, assign) css_flex_direction_t flexDirection; -@property (nonatomic, assign) css_justify_t justifyContent; -@property (nonatomic, assign) css_align_t alignSelf; -@property (nonatomic, assign) css_align_t alignItems; -@property (nonatomic, assign) css_position_type_t positionType; -@property (nonatomic, assign) css_wrap_type_t flexWrap; -@property (nonatomic, assign) CGFloat flex; - -/** - * Calculate property changes that need to be propagated to the view. - * The applierBlocks set contains RCTApplierBlock functions that must be applied - * on the main thread in order to update the view. - */ -- (void)collectUpdatedProperties:(NSMutableSet *)applierBlocks parentProperties:(NSDictionary *)parentProperties; - -/** - * Calculate all views whose frame needs updating after layout has been calculated. - * The viewsWithNewFrame set contains the reactTags of the views that need updating. - */ -- (void)collectRootUpdatedFrames:(NSMutableSet *)viewsWithNewFrame parentConstraint:(CGSize)parentConstraint; - -/** - * The following are implementation details exposed to subclasses. Do not call them directly - */ -- (void)fillCSSNode:(css_node_t *)node; -- (void)dirtyLayout; -- (BOOL)isLayoutDirty; - -// TODO: is this still needed? -- (void)dirtyPropagation; -- (BOOL)isPropagationDirty; - -// TODO: move this to text node? -- (void)dirtyText; -- (BOOL)isTextDirty; -- (void)setTextComputed; - -/** - * Triggers a recalculation of the shadow view's layout. - */ -- (void)updateShadowViewLayout; - -/** - * Computes the recursive offset, meaning the sum of all descendant offsets - - * this is the sum of all positions inset from parents. This is not merely the - * sum of `top`/`left`s, as this function uses the *actual* positions of - * children, not the style specified positions - it computes this based on the - * resulting layout. It does not yet compensate for native scroll view insets or - * transforms or anchor points. Returns an array containing the `x, y, width, - * height` of the shadow view relative to the ancestor, or `nil` if the `view` - * is not a descendent of `ancestor`. - */ -+ (CGRect)measureLayout:(RCTShadowView *)view relativeTo:(RCTShadowView *)ancestor; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTSparseArray.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTSparseArray.h deleted file mode 100644 index 47ad346f1..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTSparseArray.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@interface RCTSparseArray : NSObject - -- (instancetype)initWithCapacity:(NSUInteger)capacity NS_DESIGNATED_INITIALIZER; -- (instancetype)initWithSparseArray:(RCTSparseArray *)sparseArray NS_DESIGNATED_INITIALIZER; - -+ (instancetype)sparseArray; -+ (instancetype)sparseArrayWithCapacity:(NSUInteger)capacity; -+ (instancetype)sparseArrayWithSparseArray:(RCTSparseArray *)sparseArray; - -// Use nil object to remove at idx. -- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx; -- (id)objectAtIndexedSubscript:(NSUInteger)idx; - -// Use nil obj to remove at key. -- (void)setObject:(id)obj forKeyedSubscript:(NSNumber *)key; -- (id)objectForKeyedSubscript:(NSNumber *)key; - -@property (readonly, nonatomic) NSUInteger count; -@property (readonly, nonatomic, copy) NSArray *allIndexes; -@property (readonly, nonatomic, copy) NSArray *allObjects; - -- (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSNumber *idx, BOOL *stop))block; -- (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (^)(id obj, NSNumber *idx, BOOL *stop))block; - -- (void)removeAllObjects; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStaticImage.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStaticImage.h deleted file mode 100644 index 75906be39..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStaticImage.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@interface RCTStaticImage : UIImageView - -@property (nonatomic, assign) UIEdgeInsets capInsets; -@property (nonatomic, assign) UIImageRenderingMode renderingMode; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStaticImageManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStaticImageManager.h deleted file mode 100644 index ab89cb96b..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStaticImageManager.h +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTStaticImageManager : RCTViewManager - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStatusBarManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStatusBarManager.h deleted file mode 100644 index 830393521..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTStatusBarManager.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTBridgeModule.h" - -@interface RCTStatusBarManager : NSObject - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextField.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextField.h deleted file mode 100644 index 1688f8fdc..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextField.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@class RCTEventDispatcher; - -@interface RCTTextField : UITextField - -@property (nonatomic, assign) BOOL caretHidden; -@property (nonatomic, assign) BOOL autoCorrect; -@property (nonatomic, assign) UIEdgeInsets paddingEdgeInsets; // TODO: contentInset - -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextFieldManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextFieldManager.h deleted file mode 100644 index 1f83a47d8..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTextFieldManager.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTTextFieldManager : RCTViewManager - -@end - diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTiming.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTiming.h deleted file mode 100644 index aa55c2521..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTiming.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTBridgeModule.h" -#import "RCTInvalidating.h" - -@interface RCTTiming : NSObject - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTouchHandler.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTouchHandler.h deleted file mode 100644 index 46c81b9ef..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTTouchHandler.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTInvalidating.h" - -@class RCTBridge; - -@interface RCTTouchHandler : UIGestureRecognizer - -- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; -- (void)startOrResetInteractionTiming; -- (NSDictionary *)endAndResetInteractionTiming; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIActivityIndicatorViewManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIActivityIndicatorViewManager.h deleted file mode 100644 index d67661359..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIActivityIndicatorViewManager.h +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTViewManager.h" - -@interface RCTUIActivityIndicatorViewManager : RCTViewManager - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIManager.h deleted file mode 100644 index 701c37f93..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUIManager.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTBridge.h" -#import "RCTBridgeModule.h" -#import "RCTInvalidating.h" -#import "RCTViewManager.h" - -@class RCTRootView; - -@protocol RCTScrollableProtocol; - -/** - * The RCTUIManager is the module responsible for updating the view hierarchy. - */ -@interface RCTUIManager : NSObject - -@property (nonatomic, weak) id mainScrollView; - -/** - * Allows native environment code to respond to "the main scroll view" events. - * see `RCTUIManager`'s `setMainScrollViewTag`. - */ -@property (nonatomic, readwrite, weak) id nativeMainScrollDelegate; - -/** - * Register a root view with the RCTUIManager. Theoretically, a single manager - * can support multiple root views, however this feature is not currently exposed - * and may eventually be removed. - */ -- (void)registerRootView:(RCTRootView *)rootView; - -/** - * Schedule a block to be executed on the UI thread. Useful if you need to execute - * view logic after all currently queued view updates have completed. - */ -- (void)addUIBlock:(RCTViewManagerUIBlock)block; - -/** - * The view that is currently first responder, according to the JS context. - */ -+ (UIView *)JSResponder; - -@end - -/** - * This category makes the current RCTUIManager instance available via the - * RCTBridge, which is useful for RCTBridgeModules or RCTViewManagers that - * need to access the RCTUIManager. - */ -@interface RCTBridge (RCTUIManager) - -@property (nonatomic, readonly) RCTUIManager *uiManager; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUtils.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUtils.h deleted file mode 100644 index de203e4ae..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTUtils.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import -#import - -#import "RCTAssert.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// Utility functions for JSON object <-> string serialization/deserialization -NSString *RCTJSONStringify(id jsonObject, NSError **error); -id RCTJSONParse(NSString *jsonString, NSError **error); - -// Get MD5 hash of a string (TODO: currently unused. Remove?) -NSString *RCTMD5Hash(NSString *string); - -// Get screen metrics in a thread-safe way -CGFloat RCTScreenScale(void); -CGSize RCTScreenSize(void); - -// Round float coordinates to nearest whole screen pixel (not point) -CGFloat RCTRoundPixelValue(CGFloat value); -CGFloat RCTCeilPixelValue(CGFloat value); -CGFloat RCTFloorPixelValue(CGFloat value); - -// Get current time, for precise performance metrics -NSTimeInterval RCTTGetAbsoluteTime(void); - -// Method swizzling -void RCTSwapClassMethods(Class cls, SEL original, SEL replacement); -void RCTSwapInstanceMethods(Class cls, SEL original, SEL replacement); - -// Module subclass support -BOOL RCTClassOverridesClassMethod(Class cls, SEL selector); -BOOL RCTClassOverridesInstanceMethod(Class cls, SEL selector); - -// Enumerate all classes that conform to NSObject protocol -void RCTEnumerateClasses(void (^block)(Class cls)); - -#ifdef __cplusplus -} -#endif diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTView.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTView.h deleted file mode 100644 index 802336633..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTView.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTView.h" - -#import - -#import "RCTPointerEvents.h" - -@protocol RCTAutoInsetsProtocol; - -@interface RCTView : UIView - -@property (nonatomic, assign) RCTPointerEvents pointerEvents; - -+ (void)autoAdjustInsetsForView:(UIView *)parentView - withScrollView:(UIScrollView *)scrollView - updateOffset:(BOOL)updateOffset; - -+ (UIViewController *)backingViewControllerForView:(UIView *)view; - -+ (UIEdgeInsets)contentInsetsForView:(UIView *)curView; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewManager.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewManager.h deleted file mode 100644 index d3b7c8a01..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewManager.h +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTBridgeModule.h" -#import "RCTConvert.h" -#import "RCTLog.h" - -@class RCTBridge; -@class RCTEventDispatcher; -@class RCTShadowView; -@class RCTSparseArray; -@class RCTUIManager; - -typedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, RCTSparseArray *viewRegistry); - -@interface RCTViewManager : NSObject - -/** - * The bridge can be used to access both the RCTUIIManager and the RCTEventDispatcher, - * allowing the manager (or the views that it manages) to manipulate the view - * hierarchy and send events back to the JS context. - */ -@property (nonatomic, strong) RCTBridge *bridge; - -/** - * The event dispatcher is used to send events back to the JavaScript application. - * It can either be used directly by the module, or passed on to instantiated - * view subclasses so that they can handle their own events. - */ -// TODO: remove this, as it can be accessed directly from bridge -@property (nonatomic, readonly) RCTEventDispatcher *eventDispatcher; - -/** - * The module name exposed to React JS. If omitted, this will be inferred - * automatically by using the view module's class name. It is better to not - * override this, and just follow standard naming conventions for your view - * module subclasses. - */ -+ (NSString *)moduleName; - -/** - * This method instantiates a native view to be managed by the module. Override - * this to return a custom view instance, which may be preconfigured with default - * properties, subviews, etc. This method will be called many times, and should - * return a fresh instance each time. The view module MUST NOT cache the returned - * view and return the same instance for subsequent calls. - */ -- (UIView *)view; - -/** - * This method instantiates a shadow view to be managed by the module. If omitted, - * an ordinary RCTShadowView instance will be created, which is typically fine for - * most view types. As with the -view method, the -shadowView method should return - * a fresh instance each time it is called. - */ -- (RCTShadowView *)shadowView; - -/** - * Returns a dictionary of config data passed to JS that defines eligible events - * that can be placed on native views. This should return bubbling - * directly-dispatched event types and specify what names should be used to - * subscribe to either form (bubbling/capturing). - * - * Returned dictionary should be of the form: @{ - * @"onTwirl": { - * @"phasedRegistrationNames": @{ - * @"bubbled": @"onTwirl", - * @"captured": @"onTwirlCaptured" - * } - * } - * } - * - * Note that this method is not inherited when you subclass a view module, and - * you should not call [super customBubblingEventTypes] when overriding it. - */ -+ (NSDictionary *)customBubblingEventTypes; - -/** - * Returns a dictionary of config data passed to JS that defines eligible events - * that can be placed on native views. This should return non-bubbling - * directly-dispatched event types. - * - * Returned dictionary should be of the form: @{ - * @"onTwirl": { - * @"registrationName": @"onTwirl" - * } - * } - * - * Note that this method is not inherited when you subclass a view module, and - * you should not call [super customDirectEventTypes] when overriding it. - */ -+ (NSDictionary *)customDirectEventTypes; - -/** - * Called to notify manager that layout has finished, in case any calculated - * properties need to be copied over from shadow view to view. - */ -- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowView *)shadowView; - -/** - * Called after view hierarchy manipulation has finished, and all shadow props - * have been set, but before layout has been performed. Useful for performing - * custo layout logic or tasks that involve walking the view hierarchy. - * To be deprecated, hopefully. - */ -- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(RCTSparseArray *)shadowViewRegistry; - -/** - * This handles the simple case, where JS and native property names match - * And the type can be automatically inferred. - */ -#define RCT_EXPORT_VIEW_PROPERTY(name) \ -RCT_REMAP_VIEW_PROPERTY(name, name) - -/** - * This macro maps a named property on the module to an arbitrary key path - * within the view. - */ -#define RCT_REMAP_VIEW_PROPERTY(name, keypath) \ -- (void)set_##name:(id)json forView:(id)view withDefaultView:(id)defaultView { \ - if ((json && !RCTSetProperty(view, @#keypath, json)) || \ - (!json && !RCTCopyProperty(view, defaultView, @#keypath))) { \ - RCTLogError(@"%@ does not have setter for `%s` property", [view class], #name); \ - } \ -} - -/** - * These macros can be used when you need to provide custom logic for setting - * view properties. The macro should be followed by a method body, which can - * refer to "json", "view" and "defaultView" to implement the required logic. - */ -#define RCT_CUSTOM_VIEW_PROPERTY(name, viewType) \ -- (void)set_##name:(id)json forView:(viewType)view withDefaultView:(viewType)defaultView - -#define RCT_CUSTOM_SHADOW_PROPERTY(name, viewType) \ -- (void)set_##name:(id)json forShadowView:(viewType)view withDefaultView:(viewType)defaultView - -/** - * These are useful in cases where the module's superclass handles a - * property, but you wish to "unhandle" it, so it will be ignored. - */ -#define RCT_IGNORE_VIEW_PROPERTY(name) \ -- (void)set_##name:(id)value forView:(id)view withDefaultView:(id)defaultView {} - -#define RCT_IGNORE_SHADOW_PROPERTY(name) \ -- (void)set_##name:(id)value forShadowView:(id)view withDefaultView:(id)defaultView {} - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h deleted file mode 100644 index b6f59ea10..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTViewNodeProtocol.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -/** - - * Logical node in a tree of application components. Both `ShadowView`s and - * `UIView+ReactKit`s conform to this. Allows us to write utilities that - * reason about trees generally. - */ -@protocol RCTViewNodeProtocol - -@property (nonatomic, copy) NSNumber *reactTag; - -- (void)insertReactSubview:(id)subview atIndex:(NSInteger)atIndex; -- (void)removeReactSubview:(id)subview; -- (NSMutableArray *)reactSubviews; -- (NSNumber *)reactTagAtPoint:(CGPoint)point; - -// View is an RCTRootView -- (BOOL)isReactRootView; - -@optional - -// TODO: Deprecate this -// This method is called after layout has been performed for all views known -// to the RCTViewManager. It is only called on UIViews, not shadow views. -- (void)reactBridgeDidFinishTransaction; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWebViewExecutor.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWebViewExecutor.h deleted file mode 100644 index 7f695f3f3..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWebViewExecutor.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTJavaScriptExecutor.h" - -/** - * Uses an embedded web view merely for the purpose of being able to reuse the - * existing webkit debugging tools. Fulfills the role of a very constrained - * `JSContext`, which we call `RCTJavaScriptExecutor`. - * - * TODO: To ensure production-identical execution, scrub the window - * environment. And ensure main thread operations are actually added to a queue - * instead of being executed immediately if already on the main thread. - */ -@interface RCTWebViewExecutor : NSObject - -// Only one callback stored - will only be invoked for the latest issued -// application script request. -@property (nonatomic, copy) RCTJavaScriptCompleteBlock onApplicationScriptLoaded; - -/** - * Instantiate with a specific webview instance - */ -- (instancetype)initWithWebView:(UIWebView *)webView NS_DESIGNATED_INITIALIZER; - -/** - * Invoke this to reclaim the web view for reuse. This is necessary in order to - * allow debuggers to remain open, when creating a new `RCTWebViewExecutor`. - * This guards against the web view being invalidated, and makes sure the - * `delegate` is cleared first. - */ -- (UIWebView *)invalidateAndReclaimWebView; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h deleted file mode 100644 index 69075c6a4..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/RCTWrapperViewController.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -@class RCTEventDispatcher; -@class RCTNavItem; -@class RCTWrapperViewController; - -@protocol RCTWrapperViewControllerNavigationListener - -- (void)wrapperViewController:(RCTWrapperViewController *)wrapperViewController -didMoveToNavigationController:(UINavigationController *)navigationController; - -@end - -@interface RCTWrapperViewController : UIViewController - -- (instancetype)initWithContentView:(UIView *)contentView - eventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; - -- (instancetype)initWithNavItem:(RCTNavItem *)navItem - eventDispatcher:(RCTEventDispatcher *)eventDispatcher; - -@property (nonatomic, readwrite, weak) id navigationListener; -@property (nonatomic, strong, readwrite) RCTNavItem *navItem; - -@end diff --git a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/UIView+ReactKit.h b/Examples/TicTacToe/Pods/Headers/Public/ReactKit/UIView+ReactKit.h deleted file mode 100644 index 3e45da8e7..000000000 --- a/Examples/TicTacToe/Pods/Headers/Public/ReactKit/UIView+ReactKit.h +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import - -#import "RCTViewNodeProtocol.h" - -//TODO: let's try to eliminate this category if possible - -@interface UIView (ReactKit) - -@end diff --git a/Examples/TicTacToe/Pods/Local Podspecs/RCTNetworkImage.podspec b/Examples/TicTacToe/Pods/Local Podspecs/RCTNetworkImage.podspec deleted file mode 100644 index 47eb0e5f6..000000000 --- a/Examples/TicTacToe/Pods/Local Podspecs/RCTNetworkImage.podspec +++ /dev/null @@ -1,28 +0,0 @@ -Pod::Spec.new do |spec| - spec.name = 'RCTNetworkImage' - spec.version = '0.0.1' - spec.summary = 'Provides basic Text capabilities in ReactNative apps.' - spec.description = <<-DESC - Text can be rendered in ReactNative apps with the component using this module. - DESC - spec.homepage = 'https://facebook.github.io/react-native/' - spec.license = { :type => 'BSD' } - spec.author = 'Facebook' - spec.platform = :ios, '7.0' - spec.requires_arc = true - spec.source_files = '**/*.{h,m,c}' - spec.dependency "ReactKit", "~> 0.0.1" - - # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # Link your library with frameworks, or libraries. Libraries do not include - # the lib prefix of their name. - # - - # s.framework = "SomeFramework" - # s.frameworks = "SomeFramework", "AnotherFramework" - - # s.library = "iconv" - #spec.libraries = "RCTNetworkImage", "ReactKit" - -end diff --git a/Examples/TicTacToe/Pods/Local Podspecs/RCTText.podspec b/Examples/TicTacToe/Pods/Local Podspecs/RCTText.podspec deleted file mode 100644 index 656e0ee74..000000000 --- a/Examples/TicTacToe/Pods/Local Podspecs/RCTText.podspec +++ /dev/null @@ -1,28 +0,0 @@ -Pod::Spec.new do |spec| - spec.name = 'RCTText' - spec.version = '0.0.1' - spec.summary = 'Provides basic Text capabilities in ReactNative apps.' - spec.description = <<-DESC - Text can be rendered in ReactNative apps with the component using this module. - DESC - spec.homepage = 'https://facebook.github.io/react-native/' - spec.license = { :type => 'BSD' } - spec.author = 'Facebook' - spec.platform = :ios, '7.0' - spec.requires_arc = true - spec.source_files = '**/*.{h,m,c}' - spec.dependency "ReactKit", "~> 0.0.1" - - # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # Link your library with frameworks, or libraries. Libraries do not include - # the lib prefix of their name. - # - - # s.framework = "SomeFramework" - # s.frameworks = "SomeFramework", "AnotherFramework" - - # s.library = "iconv" - #spec.libraries = "RCTText", "ReactKit" - -end diff --git a/Examples/TicTacToe/Pods/Local Podspecs/ReactKit.podspec b/Examples/TicTacToe/Pods/Local Podspecs/ReactKit.podspec deleted file mode 100644 index 3e1a8a6e2..000000000 --- a/Examples/TicTacToe/Pods/Local Podspecs/ReactKit.podspec +++ /dev/null @@ -1,16 +0,0 @@ -Pod::Spec.new do |spec| - spec.name = 'ReactKit' - spec.version = '0.0.1' - spec.summary = 'An implementation of React that targets UIKit for iOS' - spec.description = <<-DESC - Our first React Native implementation is ReactKit, targeting iOS. We are also working on an Android implementation which we will release later. ReactKit apps are built using the React JS framework, and render directly to native UIKit elements using a fully asynchronous architecture. There is no browser and no HTML. We have picked what we think is the best set of features from these and other technologies to build what we hope to become the best product development framework available, with an emphasis on iteration speed, developer delight, continuity of technology, and absolutely beautiful and fast products with no compromises in quality or capability. - DESC - spec.homepage = 'https://facebook.github.io/react-native/' - spec.license = { :type => 'BSD' } - spec.author = 'Facebook' - spec.platform = :ios, '7.0' - spec.requires_arc = true - spec.source_files = '**/*.{h,m,c}' - spec.public_header_files = "**/*.h" - #spec.library = "ReactKit" -end diff --git a/Examples/TicTacToe/Pods/Manifest.lock b/Examples/TicTacToe/Pods/Manifest.lock deleted file mode 100644 index 79377f7f5..000000000 --- a/Examples/TicTacToe/Pods/Manifest.lock +++ /dev/null @@ -1,26 +0,0 @@ -PODS: - - RCTNetworkImage (0.0.1): - - ReactKit (~> 0.0.1) - - RCTText (0.0.1): - - ReactKit (~> 0.0.1) - - ReactKit (0.0.1) - -DEPENDENCIES: - - RCTNetworkImage (from `../../Libraries/Image`) - - RCTText (from `../../Libraries/Text`) - - ReactKit (from `../../ReactKit`) - -EXTERNAL SOURCES: - RCTNetworkImage: - :path: ../../Libraries/Image - RCTText: - :path: ../../Libraries/Text - ReactKit: - :path: ../../ReactKit - -SPEC CHECKSUMS: - RCTNetworkImage: 6d99735875916e098a65c68a54a72e67e24a402a - RCTText: 5c0cf4635241e8c02e8933853df03809d2dc8327 - ReactKit: 65c02c1e95951c198e491d2a4c1972675d4af254 - -COCOAPODS: 0.35.0 diff --git a/Examples/TicTacToe/Pods/Pods.xcodeproj/project.pbxproj b/Examples/TicTacToe/Pods/Pods.xcodeproj/project.pbxproj deleted file mode 100644 index 9bc0e18a5..000000000 --- a/Examples/TicTacToe/Pods/Pods.xcodeproj/project.pbxproj +++ /dev/null @@ -1,3946 +0,0 @@ - - - - - archiveVersion - 1 - classes - - objectVersion - 46 - objects - - 025A87130AD86B58E404D3C0 - - isa - PBXTargetDependency - name - Pods-RCTNetworkImage - target - 769A717CAFE5B019B17120C7 - targetProxy - B1AB002CD8EBE409EC364BF4 - - 02CA42753891DE99F0C4A9F1 - - fileRef - 80A2CDBEC4C2EA679BDFD05B - isa - PBXBuildFile - - 034357B4792A8675BA3B962F - - fileRef - 31E92BD37BFCCB143ED614CB - isa - PBXBuildFile - - 05979756D746338C19D9CFE3 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTViewManager.m - path - Views/RCTViewManager.m - sourceTree - <group> - - 062BC4B46046CE4058393650 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-ReactKit-Private.xcconfig - sourceTree - <group> - - 069D2AD44B6410EACB1B2075 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTTextField.m - path - Views/RCTTextField.m - sourceTree - <group> - - 06B66FE3B127D202B1AC9803 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text - path - Pods-acknowledgements.markdown - sourceTree - <group> - - 07576F9F34B4CADE96EDD698 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTContextExecutor.m - path - Executors/RCTContextExecutor.m - sourceTree - <group> - - 07C36347F29DC7BB656AED2E - - fileRef - A3B9259CF020C7A65A92AA0E - isa - PBXBuildFile - - 07F1BC4802790A12CD37323F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTAlertManager.m - path - Modules/RCTAlertManager.m - sourceTree - <group> - - 08A0B2B369BFF8324CBBA029 - - baseConfigurationReference - B753A0617AB77E1E91027A34 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - 09135B9EC1FBC85584FC4DBD - - buildActionMask - 2147483647 - files - - 0BCB19DE972D8A076F5C2DAE - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 0970729E477937347C8EBD83 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTAssert.h - path - Base/RCTAssert.h - sourceTree - <group> - - 0B8869CDD72D9A8E218342F0 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTAnimationType.h - path - Base/RCTAnimationType.h - sourceTree - <group> - - 0BCB19DE972D8A076F5C2DAE - - fileRef - B46B327243391CAF6E0717D9 - isa - PBXBuildFile - - 0CB274EC48DFB07B4C8B240E - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTCache.h - path - Base/RCTCache.h - sourceTree - <group> - - 1036E6C4C58112D9A8A1D615 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTNetworkImageViewManager.h - sourceTree - <group> - - 107D57F0208D55DBB0B65853 - - fileRef - 76DB22C9C8B38077354D35A8 - isa - PBXBuildFile - - 110F901C8F65A6EC1D683ED3 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTExceptionsManager.m - path - Modules/RCTExceptionsManager.m - sourceTree - <group> - - 11806B3CDA8E83E6F2FE8D17 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTNavigator.h - path - Views/RCTNavigator.h - sourceTree - <group> - - 1196334A907C76F86D4A63CB - - fileRef - BADCCC41C7913287A31E51C9 - isa - PBXBuildFile - - 12507443D597BE1AFA5013A7 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTText.xcconfig - sourceTree - <group> - - 150C5DBA403D3B23A1EC6CDE - - fileRef - CB9F944208FFD7B3ADC7A00A - isa - PBXBuildFile - - 152C3E496F9D147818CDB260 - - buildActionMask - 2147483647 - files - - 87E418B79822E8736EA41DE8 - 1A1C6BEEBA59CFC9D14FFB67 - A2AF525DC972EB0FDD47D962 - 535AB2CD3AD8C9EAC218E37B - D257C76E43E366FC0EA7A12E - FA29A9F03B11C2074DC5216D - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 1537FF13D7133AA6F8B3A1C9 - - fileRef - CCF7DF071515793DD6C0414D - isa - PBXBuildFile - - 15ADEBC28446EDAC35819C65 - - buildConfigurations - - 43C225961E6BF40B9C819C93 - 08A0B2B369BFF8324CBBA029 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 16955EC616390F52DD46F011 - - children - - 599BC72A5589AE2013BF6900 - - isa - PBXGroup - name - Targets Support Files - sourceTree - <group> - - 19636039A13AE878699E8DBB - - fileRef - E22151F70AA7C88D098C99BB - isa - PBXBuildFile - - 19B74DAEFA40E906DEDEADFA - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-ReactKit-dummy.m - sourceTree - <group> - - 1A1C6BEEBA59CFC9D14FFB67 - - fileRef - A8DBC5BF7CEEEDA937D3BE08 - isa - PBXBuildFile - - 1B18F1E7CA77F1AA1A12D304 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTShadowView.h - path - Views/RCTShadowView.h - sourceTree - <group> - - 1D5C721F04A0D2846039D9B7 - - fileRef - 1B18F1E7CA77F1AA1A12D304 - isa - PBXBuildFile - - 1EA38AB62019C3EC36D2FC6A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTBridgeModule.h - path - Base/RCTBridgeModule.h - sourceTree - <group> - - 218485DF6D2557DEC0F8E74E - - fileRef - FBC74FE67BCC52FD85C1BAD0 - isa - PBXBuildFile - - 2222F067CA369E707A16AEF7 - - buildActionMask - 2147483647 - files - - 33FF0688ED2927D06FFA4C26 - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 22C673EC6E5974F93BB91F64 - - baseConfigurationReference - 39463588A39AA3E9757F0520 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - - isa - XCBuildConfiguration - name - Debug - - 24081C451F4316B44C32B7CC - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTShadowView.m - path - Views/RCTShadowView.m - sourceTree - <group> - - 25015EE62C53673BAF076DD7 - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods.a - sourceTree - BUILT_PRODUCTS_DIR - - 254E0C8ACCD2FF00E6FD2AE6 - - children - - AACE41F371930BDA2BE0D50F - - isa - PBXGroup - name - Frameworks - sourceTree - <group> - - 25B6E9DFFAE6A9540CEF75DE - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTTiming.h - path - Modules/RCTTiming.h - sourceTree - <group> - - 261567BAE307BF57D88AC939 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTStatusBarManager.h - path - Modules/RCTStatusBarManager.h - sourceTree - <group> - - 27365C92F7FA6EF9E524A670 - - fileRef - D436BE9918549C192684657C - isa - PBXBuildFile - - 2747CB53DCACFABE26C705AA - - fileRef - 110F901C8F65A6EC1D683ED3 - isa - PBXBuildFile - - 277413A21FD87DA13511099F - - fileRef - 25B6E9DFFAE6A9540CEF75DE - isa - PBXBuildFile - - 2A073BDE36873311DA6A0EF5 - - includeInIndex - 1 - isa - PBXFileReference - name - Layout.c - path - Layout/Layout.c - sourceTree - <group> - - 2A8C42E95666925E6CEE303F - - children - - 48BBE16348C79B57F35F8DBF - 062BC4B46046CE4058393650 - 19B74DAEFA40E906DEDEADFA - F66B15C716DB00AB74903326 - - isa - PBXGroup - name - Support Files - path - ../Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit - sourceTree - <group> - - 2B409A074C5817E5B40428E2 - - fileRef - 4451C03906E44804B163B854 - isa - PBXBuildFile - - 2B475CAFC274FB31E95E5491 - - fileRef - E5B280DE6A446D58C857B3C7 - isa - PBXBuildFile - - 2C552B02AE33C61830745E85 - - buildConfigurations - - D47F88D3F797D8EF95C0BA4D - ED0EAAAC662DFADD30EA5D11 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 2C7ED084B30FD91FBC08C10D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTShadowRawText.m - sourceTree - <group> - - 2E2A8AF7AB8F16F26CE07D8C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTScrollView.m - path - Views/RCTScrollView.m - sourceTree - <group> - - 2F5489066B626F5AA9656150 - - fileRef - 61063E1955F44DB956E55837 - isa - PBXBuildFile - - 2FE386FFB0F3E3A3528409B9 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTTouchHandler.h - path - Base/RCTTouchHandler.h - sourceTree - <group> - - 2FF3BF263DDDD5F909C02622 - - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - CLANG_CXX_LANGUAGE_STANDARD - gnu++0x - CLANG_CXX_LIBRARY - libc++ - CLANG_ENABLE_MODULES - YES - CLANG_ENABLE_OBJC_ARC - YES - CLANG_WARN_BOOL_CONVERSION - YES - CLANG_WARN_CONSTANT_CONVERSION - YES - CLANG_WARN_DIRECT_OBJC_ISA_USAGE - YES - CLANG_WARN_EMPTY_BODY - YES - CLANG_WARN_ENUM_CONVERSION - YES - CLANG_WARN_INT_CONVERSION - YES - CLANG_WARN_OBJC_ROOT_CLASS - YES - COPY_PHASE_STRIP - NO - ENABLE_NS_ASSERTIONS - NO - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_PREPROCESSOR_DEFINITIONS - - RELEASE=1 - - GCC_WARN_64_TO_32_BIT_CONVERSION - YES - GCC_WARN_ABOUT_RETURN_TYPE - YES - GCC_WARN_UNDECLARED_SELECTOR - YES - GCC_WARN_UNINITIALIZED_AUTOS - YES - GCC_WARN_UNUSED_FUNCTION - YES - GCC_WARN_UNUSED_VARIABLE - YES - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - STRIP_INSTALLED_PRODUCT - NO - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - 31815389CBA63C86E173EE9C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTAutoInsetsProtocol.h - path - Base/RCTAutoInsetsProtocol.h - sourceTree - <group> - - 31CB0CA9F918FFFFCCDB8284 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTLog.m - path - Base/RCTLog.m - sourceTree - <group> - - 31E92BD37BFCCB143ED614CB - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTKeyCommands.m - path - Base/RCTKeyCommands.m - sourceTree - <group> - - 32451A95EB5079ED6F4F3E5A - - fileRef - 46EA953E96B6E60A9EA7253A - isa - PBXBuildFile - - 329AC794493AD159BF606910 - - fileRef - 05979756D746338C19D9CFE3 - isa - PBXBuildFile - - 33AC21BAE4072FDD0FC446AC - - fileRef - 865F2D07C98B4CA4B18F1F78 - isa - PBXBuildFile - - 33FF0688ED2927D06FFA4C26 - - fileRef - B46B327243391CAF6E0717D9 - isa - PBXBuildFile - - 341F23664902CBD8947C5DB3 - - fileRef - B46B327243391CAF6E0717D9 - isa - PBXBuildFile - - 3569D3C1AD09FC147229AF8D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTWebViewExecutor.m - path - Executors/RCTWebViewExecutor.m - sourceTree - <group> - - 35757FFD140D20F790EE2BDD - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTUIManager.h - path - Modules/RCTUIManager.h - sourceTree - <group> - - 36A55CAD129917A8F65E897D - - fileRef - 3569D3C1AD09FC147229AF8D - isa - PBXBuildFile - - 3859014F88232018A42BAC04 - - buildConfigurationList - 15ADEBC28446EDAC35819C65 - buildPhases - - 152C3E496F9D147818CDB260 - EC32BFBA00A39F59EB11C597 - BF6A636E87E3CA2080B277BD - - buildRules - - dependencies - - 971060A5AAD6681C19B92AFC - - isa - PBXNativeTarget - name - Pods-RCTText - productName - Pods-RCTText - productReference - A8383CD9E89EBD0486A2CFF1 - productType - com.apple.product-type.library.static - - 38FFA89C70E4D1645D42E7ED - - fileRef - 2FE386FFB0F3E3A3528409B9 - isa - PBXBuildFile - - 39463588A39AA3E9757F0520 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTNetworkImage-Private.xcconfig - sourceTree - <group> - - 39D02CE2F933786AEA335F33 - - fileRef - 1036E6C4C58112D9A8A1D615 - isa - PBXBuildFile - - 3A6DEBCF91BF88EE6FF0C53E - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - Layout.h - path - Layout/Layout.h - sourceTree - <group> - - 3BDB2D0EDA22488B2E6C76B7 - - fileRef - 8D14C3BB217E003103E52CA1 - isa - PBXBuildFile - - 3BF49B8ADD348B664CAA965D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTCache.m - path - Base/RCTCache.m - sourceTree - <group> - - 3BFAD0347A551F0536E421F4 - - fileRef - F9EB9D707F5B2AD7C1E442EF - isa - PBXBuildFile - - 3CC6BB454B8522DB5089F791 - - children - - 5CF875C3818A1F0206603D10 - 7327196C4F5BA97CA4539891 - B00A2CCF46A8FBC54A316DCC - - isa - PBXGroup - name - Development Pods - sourceTree - <group> - - 3EA7887D20B6B743DE3C1DF5 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTNavItemManager.m - path - Views/RCTNavItemManager.m - sourceTree - <group> - - 3EF20A23049B63D8F1AB34ED - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTView.h - path - Views/RCTView.h - sourceTree - <group> - - 3F8AC8D36568DD378B90804B - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTStatusBarManager.m - path - Modules/RCTStatusBarManager.m - sourceTree - <group> - - 41E7BCDB123D639D70221FE4 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-RCTNetworkImage-dummy.m - sourceTree - <group> - - 42F3BF4E050BB621F3E00E3C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTUIManager.m - path - Modules/RCTUIManager.m - sourceTree - <group> - - 43C225961E6BF40B9C819C93 - - baseConfigurationReference - B753A0617AB77E1E91027A34 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - - isa - XCBuildConfiguration - name - Debug - - 4451C03906E44804B163B854 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTContextExecutor.h - path - Executors/RCTContextExecutor.h - sourceTree - <group> - - 44BDDC5CCC328A8C9B3F8533 - - buildConfigurations - - 22C673EC6E5974F93BB91F64 - 5ED038F9CB64DEAC35C0C2CD - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 457785C4F077FF2E7AA47B49 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTNetworkImageView.m - sourceTree - <group> - - 45EB3392836956C146A52A0C - - fileRef - 6B82C5B8677FA77F9902CA0F - isa - PBXBuildFile - - 46EA953E96B6E60A9EA7253A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - UIView+ReactKit.m - path - Views/UIView+ReactKit.m - sourceTree - <group> - - 48BBE16348C79B57F35F8DBF - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-ReactKit.xcconfig - sourceTree - <group> - - 4B0397BE4FBD9F8FEDEBEAF4 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTNavItem.h - path - Views/RCTNavItem.h - sourceTree - <group> - - 4B64AFA829DB76F2FE51E920 - - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - CLANG_CXX_LANGUAGE_STANDARD - gnu++0x - CLANG_CXX_LIBRARY - libc++ - CLANG_ENABLE_MODULES - YES - CLANG_ENABLE_OBJC_ARC - YES - CLANG_WARN_BOOL_CONVERSION - YES - CLANG_WARN_CONSTANT_CONVERSION - YES - CLANG_WARN_DIRECT_OBJC_ISA_USAGE - YES - CLANG_WARN_EMPTY_BODY - YES - CLANG_WARN_ENUM_CONVERSION - YES - CLANG_WARN_INT_CONVERSION - YES - CLANG_WARN_OBJC_ROOT_CLASS - YES - COPY_PHASE_STRIP - YES - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - GCC_WARN_64_TO_32_BIT_CONVERSION - YES - GCC_WARN_ABOUT_RETURN_TYPE - YES - GCC_WARN_UNDECLARED_SELECTOR - YES - GCC_WARN_UNINITIALIZED_AUTOS - YES - GCC_WARN_UNUSED_FUNCTION - YES - GCC_WARN_UNUSED_VARIABLE - YES - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - ONLY_ACTIVE_ARCH - YES - STRIP_INSTALLED_PRODUCT - NO - - isa - XCBuildConfiguration - name - Debug - - 4CAAD0D6BF7C31F9871B5563 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTWebViewExecutor.h - path - Executors/RCTWebViewExecutor.h - sourceTree - <group> - - 4D0FD9ED093EC8F8163C743A - - fileRef - C3D3D260900346C1CE93D5CA - isa - PBXBuildFile - - 4EFC81CD3380F9556D86CC8C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTUtils.h - path - Base/RCTUtils.h - sourceTree - <group> - - 4FDB96AA2F90818C413120ED - - baseConfigurationReference - D46C615416D298CD2EF32D8B - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - 5007E16F5C7E9EFC0185562F - - fileRef - 3A6DEBCF91BF88EE6FF0C53E - isa - PBXBuildFile - - 51455DB97B6F834E2B3A5AFF - - fileRef - 9EBCB645740BB4540527E698 - isa - PBXBuildFile - - 51597927537D12ADB1492F73 - - fileRef - 8E36491BC0A73F578A6F8D7F - isa - PBXBuildFile - - 5199984D66E0D4825EAFDE48 - - fileRef - 1EA38AB62019C3EC36D2FC6A - isa - PBXBuildFile - - 51FA8C21CA14626EB0416885 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTShadowRawText.h - sourceTree - <group> - - 5208C78A6225B97814C99D43 - - fileRef - 55A208629844F66520167BA8 - isa - PBXBuildFile - - 5246EC6FB1C3F3B04BC17D19 - - fileRef - 8EA2D7BE822E7CFD12194108 - isa - PBXBuildFile - - 535AB2CD3AD8C9EAC218E37B - - fileRef - 92895F84F87A2CE56D4B3DD8 - isa - PBXBuildFile - - 53906C4FE2269E04A9CBA745 - - fileRef - 261567BAE307BF57D88AC939 - isa - PBXBuildFile - - 549BC0F2811E2649ED299CAD - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods-ReactKit.a - sourceTree - BUILT_PRODUCTS_DIR - - 55A208629844F66520167BA8 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTStaticImageManager.m - path - Views/RCTStaticImageManager.m - sourceTree - <group> - - 5650233E3ECB1C612AB3AA71 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTViewManager.h - path - Views/RCTViewManager.h - sourceTree - <group> - - 568AF882FEE1A75F17DF8480 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTTextFieldManager.m - path - Views/RCTTextFieldManager.m - sourceTree - <group> - - 574AFAFE072DE55BFB6F50CB - - fileRef - 41E7BCDB123D639D70221FE4 - isa - PBXBuildFile - - 5897E6B3789429F1760006A5 - - fileRef - CDB3FDE1695B0706CA924FA5 - isa - PBXBuildFile - - 591F3D5FF66858A7F5F2834F - - fileRef - ED51F456809B09F7439C4D93 - isa - PBXBuildFile - - 599BC72A5589AE2013BF6900 - - children - - 06B66FE3B127D202B1AC9803 - B318A41A989E068CB405AD1F - 865F2D07C98B4CA4B18F1F78 - AF2C54E62D7D0120DB4D4DE5 - 625D2DAA384FD2F2F8763CC3 - C8F2F05D94C1A991A87B571E - D46C615416D298CD2EF32D8B - - isa - PBXGroup - name - Pods - path - Target Support Files/Pods - sourceTree - <group> - - 59C8D74DD9C98E16056D5366 - - fileRef - B3F5495EE23A8AB6596EB29A - isa - PBXBuildFile - - 5AAC51BC1BDDD9A9215CFBDD - - fileRef - 91219004BE0A4C162AF041A5 - isa - PBXBuildFile - - 5AECCCA812DA969CD5F83501 - - fileRef - D19D762ABD2DB814D5BA26CA - isa - PBXBuildFile - - 5C6CB7FDCCAA7A2DA6E404FA - - fileRef - 568AF882FEE1A75F17DF8480 - isa - PBXBuildFile - - 5CF875C3818A1F0206603D10 - - children - - BBF638A80E2895BEFE9C4730 - BA6C0E71C8E201475B68A2E3 - E8407ED863C88EC9CA04A11C - 457785C4F077FF2E7AA47B49 - 1036E6C4C58112D9A8A1D615 - 64819624F35D65C3AD434F7D - D41089EF6EAF70DF70BC0D25 - - isa - PBXGroup - name - RCTNetworkImage - path - ../../../Libraries/Image - sourceTree - <group> - - 5E0ADAD263C01B5C07EBAD67 - - buildConfigurations - - 4B64AFA829DB76F2FE51E920 - 2FF3BF263DDDD5F909C02622 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 5ED038F9CB64DEAC35C0C2CD - - baseConfigurationReference - 39463588A39AA3E9757F0520 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - 5F698EE693825391F5ADB26A - - fileRef - B4992F13711EC0E2E61D9B72 - isa - PBXBuildFile - - 5FF5D1DF04BA4E30E6268208 - - fileRef - 2E2A8AF7AB8F16F26CE07D8C - isa - PBXBuildFile - - 6058DA074939167562CECB0B - - fileRef - A5A887B5A0FE16862445E7FB - isa - PBXBuildFile - - 61063E1955F44DB956E55837 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTSparseArray.m - path - Base/RCTSparseArray.m - sourceTree - <group> - - 625D2DAA384FD2F2F8763CC3 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.script.sh - path - Pods-resources.sh - sourceTree - <group> - - 6297A72A212404588E6F25E7 - - fileRef - D9D68BDCB56619CE484E1950 - isa - PBXBuildFile - - 64819624F35D65C3AD434F7D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTNetworkImageViewManager.m - sourceTree - <group> - - 673952613A34ACCA97161AA2 - - isa - PBXTargetDependency - name - Pods-ReactKit - target - 973EEBD9F9591953DFB21C06 - targetProxy - 992468CC66C0BCCDEE192DE6 - - 686655033E6D4DF34CC8D72A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTAssert.m - path - Base/RCTAssert.m - sourceTree - <group> - - 688A6AE7AC080B377719B148 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTBridge.h - path - Base/RCTBridge.h - sourceTree - <group> - - 68A6B7F8A71634C7753A9D2D - - fileRef - BBF638A80E2895BEFE9C4730 - isa - PBXBuildFile - - 69903DC41C305CDC985BEA22 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTRedBox.h - path - Base/RCTRedBox.h - sourceTree - <group> - - 6A93C2F4C1D0F2F9FFEA5116 - - fileRef - 07576F9F34B4CADE96EDD698 - isa - PBXBuildFile - - 6B82C5B8677FA77F9902CA0F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTUIActivityIndicatorViewManager.h - path - Views/RCTUIActivityIndicatorViewManager.h - sourceTree - <group> - - 6B92A10C94541BEEFE730577 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTUIActivityIndicatorViewManager.m - path - Views/RCTUIActivityIndicatorViewManager.m - sourceTree - <group> - - 6BA39D6B07EFAE9F3D0C6239 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - UIView+ReactKit.h - path - Views/UIView+ReactKit.h - sourceTree - <group> - - 6E025D879E9E4EA39894CCF7 - - fileRef - 79A5515EDEDBB9DA720BFE4A - isa - PBXBuildFile - - 707BF0AC66323E30AB45EDFD - - buildActionMask - 2147483647 - files - - 74877526C735AEA400666D26 - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 7175E2D64BC6B577E9C8B508 - - containerPortal - A30671B7FF41C9CC88DDC48D - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 973EEBD9F9591953DFB21C06 - remoteInfo - Pods-ReactKit - - 71C70C27906DAEB68FB0CF59 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTWrapperViewController.h - path - Views/RCTWrapperViewController.h - sourceTree - <group> - - 71EF39441EAF6D8A62C981C5 - - fileRef - 69903DC41C305CDC985BEA22 - isa - PBXBuildFile - - 7327196C4F5BA97CA4539891 - - children - - D9D68BDCB56619CE484E1950 - A8DBC5BF7CEEEDA937D3BE08 - 51FA8C21CA14626EB0416885 - 2C7ED084B30FD91FBC08C10D - CEBFC03689DC0AC9CD1D45F6 - 92895F84F87A2CE56D4B3DD8 - B4992F13711EC0E2E61D9B72 - 7601163D57B34162C4CA1C48 - CB9F944208FFD7B3ADC7A00A - DCD06DFADE2DF0CA7278AB88 - F70F1BFEF9D1587A38666EEB - - isa - PBXGroup - name - RCTText - path - ../../../Libraries/Text - sourceTree - <group> - - 741F9A1822BB7EDBCBA63557 - - children - - E6F1A1F54DDCFD6330C02A56 - 3CC6BB454B8522DB5089F791 - 254E0C8ACCD2FF00E6FD2AE6 - 88771C44C3AA01999607AE8F - 16955EC616390F52DD46F011 - - isa - PBXGroup - sourceTree - <group> - - 74877526C735AEA400666D26 - - fileRef - B46B327243391CAF6E0717D9 - isa - PBXBuildFile - - 75728F9C40185E318ECF195B - - fileRef - 11806B3CDA8E83E6F2FE8D17 - isa - PBXBuildFile - - 7601163D57B34162C4CA1C48 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTText.m - sourceTree - <group> - - 769A717CAFE5B019B17120C7 - - buildConfigurationList - 44BDDC5CCC328A8C9B3F8533 - buildPhases - - 7F1122EB52A6E58596E7B10E - 09135B9EC1FBC85584FC4DBD - 8751FDB8FC4A8FA0014F8438 - - buildRules - - dependencies - - 88177B2CC430A98CD146FC73 - - isa - PBXNativeTarget - name - Pods-RCTNetworkImage - productName - Pods-RCTNetworkImage - productReference - 8671023CE4714E3C2336C9C8 - productType - com.apple.product-type.library.static - - 76DB22C9C8B38077354D35A8 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTRootView.m - path - Base/RCTRootView.m - sourceTree - <group> - - 79237C45AFA01938E517AD06 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTEventDispatcher.m - path - Base/RCTEventDispatcher.m - sourceTree - <group> - - 79A5515EDEDBB9DA720BFE4A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTConvert.h - path - Base/RCTConvert.h - sourceTree - <group> - - 7AFFD53FE48F494D9736FB8D - - fileRef - EA4527C073CDB5189EBADCD7 - isa - PBXBuildFile - - 7F1122EB52A6E58596E7B10E - - buildActionMask - 2147483647 - files - - 574AFAFE072DE55BFB6F50CB - CC1B51AD9B49FFAA1362B23F - 915B0A85BF984349115614CC - 8EBBCBAED11B750107770DB9 - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 7FEDFD81C12D696A75133BDA - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTLog.h - path - Base/RCTLog.h - sourceTree - <group> - - 8002A0260F2B1C62C0F465E9 - - baseConfigurationReference - C8F2F05D94C1A991A87B571E - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - - isa - XCBuildConfiguration - name - Debug - - 80A2CDBEC4C2EA679BDFD05B - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTTextField.h - path - Views/RCTTextField.h - sourceTree - <group> - - 80E2EA6586C8C5C71DFFA0B2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTTextFieldManager.h - path - Views/RCTTextFieldManager.h - sourceTree - <group> - - 82A7154EBF9864584C0B6647 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-RCTText-dummy.m - sourceTree - <group> - - 865F2D07C98B4CA4B18F1F78 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-dummy.m - sourceTree - <group> - - 8671023CE4714E3C2336C9C8 - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods-RCTNetworkImage.a - sourceTree - BUILT_PRODUCTS_DIR - - 8751FDB8FC4A8FA0014F8438 - - buildActionMask - 2147483647 - files - - 68A6B7F8A71634C7753A9D2D - D290C62BBB41818A93C7C1A1 - 39D02CE2F933786AEA335F33 - - isa - PBXHeadersBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 87E418B79822E8736EA41DE8 - - fileRef - 82A7154EBF9864584C0B6647 - isa - PBXBuildFile - - 8813F909BCAF027B0FC323D0 - - buildActionMask - 2147483647 - files - - D8076A3A8F0FAA3CD5E1FC99 - DAFE568BA68CC1B9A1496B03 - BE75BC76971974B7D4C38A36 - D6CF22628A62FAE5C1C4F751 - 1196334A907C76F86D4A63CB - B88E04B1572FF6FEC2D3B465 - 6A93C2F4C1D0F2F9FFEA5116 - 51455DB97B6F834E2B3A5AFF - F8F9FC945C529FDD56EE046E - 2747CB53DCACFABE26C705AA - 034357B4792A8675BA3B962F - 591F3D5FF66858A7F5F2834F - DE5F1B9081628B9A5A573C5B - A1807A06CB52537883C3B54F - 8ED347D2E41CC3C7CAD08F95 - 8C339544ECA90DD852D2079D - 3BDB2D0EDA22488B2E6C76B7 - 7AFFD53FE48F494D9736FB8D - 107D57F0208D55DBB0B65853 - 5FF5D1DF04BA4E30E6268208 - E514DB237132E2FE887A871F - AEF6909F3ECCE95C6495B070 - 2F5489066B626F5AA9656150 - 5AECCCA812DA969CD5F83501 - 5208C78A6225B97814C99D43 - B6D4979E7A87393AD504C9F8 - A2A969DAE26BC783576D2EDE - 5C6CB7FDCCAA7A2DA6E404FA - CCBD98E709AB05D7FCCA9DD4 - 51597927537D12ADB1492F73 - F8A30B6BAB9EB9CAE3F5EE83 - EACA791D981259D849E9575C - 5246EC6FB1C3F3B04BC17D19 - 27365C92F7FA6EF9E524A670 - 329AC794493AD159BF606910 - 36A55CAD129917A8F65E897D - E3483608408169CD1A186EEA - 32451A95EB5079ED6F4F3E5A - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 88177B2CC430A98CD146FC73 - - isa - PBXTargetDependency - name - Pods-ReactKit - target - 973EEBD9F9591953DFB21C06 - targetProxy - D3650CA7059AEE2BD3BE431F - - 88771C44C3AA01999607AE8F - - children - - 25015EE62C53673BAF076DD7 - 8671023CE4714E3C2336C9C8 - A8383CD9E89EBD0486A2CFF1 - 549BC0F2811E2649ED299CAD - - isa - PBXGroup - name - Products - sourceTree - <group> - - 8A0B35F9B55AB9E9876DF4F4 - - fileRef - CEBFC03689DC0AC9CD1D45F6 - isa - PBXBuildFile - - 8AC6957EC29778E18C201992 - - fileRef - B6F5CFD1D6804D50A8EF31AC - isa - PBXBuildFile - - 8AF331922DC4CDB6CF9DB6A9 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTStaticImageManager.h - path - Views/RCTStaticImageManager.h - sourceTree - <group> - - 8C09DDBC1987BC48B1173A6A - - fileRef - 0CB274EC48DFB07B4C8B240E - isa - PBXBuildFile - - 8C339544ECA90DD852D2079D - - fileRef - A1B258FDC18C71176DA32CFE - isa - PBXBuildFile - - 8D14C3BB217E003103E52CA1 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTNavigatorManager.m - path - Views/RCTNavigatorManager.m - sourceTree - <group> - - 8DE4BE955C41F35E0DE7BF39 - - fileRef - 6BA39D6B07EFAE9F3D0C6239 - isa - PBXBuildFile - - 8E36491BC0A73F578A6F8D7F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTTouchHandler.m - path - Base/RCTTouchHandler.m - sourceTree - <group> - - 8EA2D7BE822E7CFD12194108 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTUtils.m - path - Base/RCTUtils.m - sourceTree - <group> - - 8EBBCBAED11B750107770DB9 - - fileRef - 64819624F35D65C3AD434F7D - isa - PBXBuildFile - - 8ED347D2E41CC3C7CAD08F95 - - fileRef - 3EA7887D20B6B743DE3C1DF5 - isa - PBXBuildFile - - 91219004BE0A4C162AF041A5 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTEventDispatcher.h - path - Base/RCTEventDispatcher.h - sourceTree - <group> - - 915B0A85BF984349115614CC - - fileRef - 457785C4F077FF2E7AA47B49 - isa - PBXBuildFile - - 92895F84F87A2CE56D4B3DD8 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTShadowText.m - sourceTree - <group> - - 936FD7023BD4626A2EBF07A2 - - fileRef - 4CAAD0D6BF7C31F9871B5563 - isa - PBXBuildFile - - 93C181AF29A9C408FC907C4A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTScrollViewManager.h - path - Views/RCTScrollViewManager.h - sourceTree - <group> - - 96611930547604A69128D37A - - fileRef - 51FA8C21CA14626EB0416885 - isa - PBXBuildFile - - 971060A5AAD6681C19B92AFC - - isa - PBXTargetDependency - name - Pods-ReactKit - target - 973EEBD9F9591953DFB21C06 - targetProxy - 7175E2D64BC6B577E9C8B508 - - 973EEBD9F9591953DFB21C06 - - buildConfigurationList - 2C552B02AE33C61830745E85 - buildPhases - - 8813F909BCAF027B0FC323D0 - 2222F067CA369E707A16AEF7 - F55505C4FEE6D4B5BE545B36 - - buildRules - - dependencies - - isa - PBXNativeTarget - name - Pods-ReactKit - productName - Pods-ReactKit - productReference - 549BC0F2811E2649ED299CAD - productType - com.apple.product-type.library.static - - 974AE51E6EEA2E10FA244901 - - buildConfigurations - - 8002A0260F2B1C62C0F465E9 - 4FDB96AA2F90818C413120ED - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 9792679800AFBB1E3AEA6C75 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTInvalidating.h - path - Base/RCTInvalidating.h - sourceTree - <group> - - 983AAB60C663D67F5EC651DF - - fileRef - A4689EAD31C2FA4EA3CC9562 - isa - PBXBuildFile - - 992468CC66C0BCCDEE192DE6 - - containerPortal - A30671B7FF41C9CC88DDC48D - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 973EEBD9F9591953DFB21C06 - remoteInfo - Pods-ReactKit - - 9B331DCABA0319591332829F - - buildActionMask - 2147483647 - files - - 33AC21BAE4072FDD0FC446AC - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 9B65A75546F806AFC5B18A60 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTWrapperViewController.m - path - Views/RCTWrapperViewController.m - sourceTree - <group> - - 9EBCB645740BB4540527E698 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTConvert.m - path - Base/RCTConvert.m - sourceTree - <group> - - 9FAFE9BD1A59BB2AECB2C96F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTLocationObserver.h - path - Modules/RCTLocationObserver.h - sourceTree - <group> - - 9FB67D0E7544E5440575234D - - buildConfigurationList - 974AE51E6EEA2E10FA244901 - buildPhases - - 9B331DCABA0319591332829F - 707BF0AC66323E30AB45EDFD - - buildRules - - dependencies - - 025A87130AD86B58E404D3C0 - B59B3D5BE50E22525A751AF2 - 673952613A34ACCA97161AA2 - - isa - PBXNativeTarget - name - Pods - productName - Pods - productReference - 25015EE62C53673BAF076DD7 - productType - com.apple.product-type.library.static - - A1807A06CB52537883C3B54F - - fileRef - EDA82AB2D40C974A74CA74A9 - isa - PBXBuildFile - - A1B258FDC18C71176DA32CFE - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTNavigator.m - path - Views/RCTNavigator.m - sourceTree - <group> - - A29B3475CEBEAF74694048F7 - - fileRef - 35757FFD140D20F790EE2BDD - isa - PBXBuildFile - - A2A969DAE26BC783576D2EDE - - fileRef - 069D2AD44B6410EACB1B2075 - isa - PBXBuildFile - - A2AF525DC972EB0FDD47D962 - - fileRef - 2C7ED084B30FD91FBC08C10D - isa - PBXBuildFile - - A30671B7FF41C9CC88DDC48D - - attributes - - LastUpgradeCheck - 0510 - - buildConfigurationList - 5E0ADAD263C01B5C07EBAD67 - compatibilityVersion - Xcode 3.2 - developmentRegion - English - hasScannedForEncodings - 0 - isa - PBXProject - knownRegions - - en - - mainGroup - 741F9A1822BB7EDBCBA63557 - productRefGroup - 88771C44C3AA01999607AE8F - projectDirPath - - projectReferences - - projectRoot - - targets - - 9FB67D0E7544E5440575234D - 769A717CAFE5B019B17120C7 - 3859014F88232018A42BAC04 - 973EEBD9F9591953DFB21C06 - - - A3B9259CF020C7A65A92AA0E - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTScrollView.h - path - Views/RCTScrollView.h - sourceTree - <group> - - A4689EAD31C2FA4EA3CC9562 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTJSMethodRegistrar.h - path - Base/RCTJSMethodRegistrar.h - sourceTree - <group> - - A5A887B5A0FE16862445E7FB - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTNavigatorManager.h - path - Views/RCTNavigatorManager.h - sourceTree - <group> - - A66BCD8A2FAA1E8DADD7488E - - fileRef - 8AF331922DC4CDB6CF9DB6A9 - isa - PBXBuildFile - - A8383CD9E89EBD0486A2CFF1 - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods-RCTText.a - sourceTree - BUILT_PRODUCTS_DIR - - A8DBC5BF7CEEEDA937D3BE08 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTRawTextManager.m - sourceTree - <group> - - AACA8FE0E3EC2035615EC0AE - - fileRef - 7FEDFD81C12D696A75133BDA - isa - PBXBuildFile - - AACE41F371930BDA2BE0D50F - - children - - B46B327243391CAF6E0717D9 - - isa - PBXGroup - name - iOS - sourceTree - <group> - - AEF6909F3ECCE95C6495B070 - - fileRef - 24081C451F4316B44C32B7CC - isa - PBXBuildFile - - AF2C54E62D7D0120DB4D4DE5 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-environment.h - sourceTree - <group> - - AF458FAFFB109206A76292E6 - - fileRef - CDB7B6437EABB1154D9772C0 - isa - PBXBuildFile - - B00A2CCF46A8FBC54A316DCC - - children - - 2A073BDE36873311DA6A0EF5 - 3A6DEBCF91BF88EE6FF0C53E - B3F5495EE23A8AB6596EB29A - 07F1BC4802790A12CD37323F - 0B8869CDD72D9A8E218342F0 - 0970729E477937347C8EBD83 - 686655033E6D4DF34CC8D72A - 31815389CBA63C86E173EE9C - 688A6AE7AC080B377719B148 - BADCCC41C7913287A31E51C9 - 1EA38AB62019C3EC36D2FC6A - 0CB274EC48DFB07B4C8B240E - 3BF49B8ADD348B664CAA965D - 4451C03906E44804B163B854 - 07576F9F34B4CADE96EDD698 - 79A5515EDEDBB9DA720BFE4A - 9EBCB645740BB4540527E698 - 91219004BE0A4C162AF041A5 - 79237C45AFA01938E517AD06 - C8023A8F586BE2C6323242D8 - 110F901C8F65A6EC1D683ED3 - 9792679800AFBB1E3AEA6C75 - A4689EAD31C2FA4EA3CC9562 - CCF7DF071515793DD6C0414D - E5B280DE6A446D58C857B3C7 - 31E92BD37BFCCB143ED614CB - 9FAFE9BD1A59BB2AECB2C96F - ED51F456809B09F7439C4D93 - 7FEDFD81C12D696A75133BDA - 31CB0CA9F918FFFFCCDB8284 - 4B0397BE4FBD9F8FEDEBEAF4 - EDA82AB2D40C974A74CA74A9 - CDB3FDE1695B0706CA924FA5 - 3EA7887D20B6B743DE3C1DF5 - 11806B3CDA8E83E6F2FE8D17 - A1B258FDC18C71176DA32CFE - A5A887B5A0FE16862445E7FB - 8D14C3BB217E003103E52CA1 - B6F5CFD1D6804D50A8EF31AC - 69903DC41C305CDC985BEA22 - EA4527C073CDB5189EBADCD7 - FBC74FE67BCC52FD85C1BAD0 - 76DB22C9C8B38077354D35A8 - A3B9259CF020C7A65A92AA0E - 2E2A8AF7AB8F16F26CE07D8C - 93C181AF29A9C408FC907C4A - D76CCDEFB1E46BB0C1532B99 - E22151F70AA7C88D098C99BB - 1B18F1E7CA77F1AA1A12D304 - 24081C451F4316B44C32B7CC - CDB7B6437EABB1154D9772C0 - 61063E1955F44DB956E55837 - C3D3D260900346C1CE93D5CA - D19D762ABD2DB814D5BA26CA - 8AF331922DC4CDB6CF9DB6A9 - 55A208629844F66520167BA8 - 261567BAE307BF57D88AC939 - 3F8AC8D36568DD378B90804B - 80A2CDBEC4C2EA679BDFD05B - 069D2AD44B6410EACB1B2075 - 80E2EA6586C8C5C71DFFA0B2 - 568AF882FEE1A75F17DF8480 - 25B6E9DFFAE6A9540CEF75DE - DC61985AB127017510FF47B0 - 2FE386FFB0F3E3A3528409B9 - 8E36491BC0A73F578A6F8D7F - 6B82C5B8677FA77F9902CA0F - 6B92A10C94541BEEFE730577 - 35757FFD140D20F790EE2BDD - 42F3BF4E050BB621F3E00E3C - 4EFC81CD3380F9556D86CC8C - 8EA2D7BE822E7CFD12194108 - 3EF20A23049B63D8F1AB34ED - D436BE9918549C192684657C - 5650233E3ECB1C612AB3AA71 - 05979756D746338C19D9CFE3 - F9EB9D707F5B2AD7C1E442EF - 4CAAD0D6BF7C31F9871B5563 - 3569D3C1AD09FC147229AF8D - 71C70C27906DAEB68FB0CF59 - 9B65A75546F806AFC5B18A60 - 6BA39D6B07EFAE9F3D0C6239 - 46EA953E96B6E60A9EA7253A - 2A8C42E95666925E6CEE303F - - isa - PBXGroup - name - ReactKit - path - ../../../ReactKit - sourceTree - <group> - - B03DD49B4D0684DD664FA620 - - fileRef - 4B0397BE4FBD9F8FEDEBEAF4 - isa - PBXBuildFile - - B1AB002CD8EBE409EC364BF4 - - containerPortal - A30671B7FF41C9CC88DDC48D - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 769A717CAFE5B019B17120C7 - remoteInfo - Pods-RCTNetworkImage - - B1CE62B16BA49B5F93E0F176 - - fileRef - 9792679800AFBB1E3AEA6C75 - isa - PBXBuildFile - - B318A41A989E068CB405AD1F - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.plist.xml - path - Pods-acknowledgements.plist - sourceTree - <group> - - B3F415717620F1F12B992B0D - - fileRef - 0970729E477937347C8EBD83 - isa - PBXBuildFile - - B3F5495EE23A8AB6596EB29A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTAlertManager.h - path - Modules/RCTAlertManager.h - sourceTree - <group> - - B46B327243391CAF6E0717D9 - - isa - PBXFileReference - lastKnownFileType - wrapper.framework - name - Foundation.framework - path - Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/Foundation.framework - sourceTree - DEVELOPER_DIR - - B4992F13711EC0E2E61D9B72 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTText.h - sourceTree - <group> - - B59B3D5BE50E22525A751AF2 - - isa - PBXTargetDependency - name - Pods-RCTText - target - 3859014F88232018A42BAC04 - targetProxy - C3D2400BD002BB173CDFA171 - - B5FC682792E6A0447D287697 - - fileRef - 0B8869CDD72D9A8E218342F0 - isa - PBXBuildFile - - B6D4979E7A87393AD504C9F8 - - fileRef - 3F8AC8D36568DD378B90804B - isa - PBXBuildFile - - B6F5CFD1D6804D50A8EF31AC - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTPointerEvents.h - path - Base/RCTPointerEvents.h - sourceTree - <group> - - B753A0617AB77E1E91027A34 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTText-Private.xcconfig - sourceTree - <group> - - B88E04B1572FF6FEC2D3B465 - - fileRef - 3BF49B8ADD348B664CAA965D - isa - PBXBuildFile - - BA296894BFD973DE874868B8 - - fileRef - 9FAFE9BD1A59BB2AECB2C96F - isa - PBXBuildFile - - BA6C0E71C8E201475B68A2E3 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTImageDownloader.m - sourceTree - <group> - - BADCCC41C7913287A31E51C9 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTBridge.m - path - Base/RCTBridge.m - sourceTree - <group> - - BBF638A80E2895BEFE9C4730 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTImageDownloader.h - sourceTree - <group> - - BE1D1748A0D0A88E8D9EBDC6 - - fileRef - 31815389CBA63C86E173EE9C - isa - PBXBuildFile - - BE75BC76971974B7D4C38A36 - - fileRef - 07F1BC4802790A12CD37323F - isa - PBXBuildFile - - BF6A636E87E3CA2080B277BD - - buildActionMask - 2147483647 - files - - 6297A72A212404588E6F25E7 - 96611930547604A69128D37A - 8A0B35F9B55AB9E9876DF4F4 - 5F698EE693825391F5ADB26A - 150C5DBA403D3B23A1EC6CDE - - isa - PBXHeadersBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - C10CEF62C1009D05C2E0E7DF - - fileRef - 80E2EA6586C8C5C71DFFA0B2 - isa - PBXBuildFile - - C3D2400BD002BB173CDFA171 - - containerPortal - A30671B7FF41C9CC88DDC48D - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 3859014F88232018A42BAC04 - remoteInfo - Pods-RCTText - - C3D3D260900346C1CE93D5CA - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTStaticImage.h - path - Views/RCTStaticImage.h - sourceTree - <group> - - C8023A8F586BE2C6323242D8 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTExceptionsManager.h - path - Modules/RCTExceptionsManager.h - sourceTree - <group> - - C8F2F05D94C1A991A87B571E - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods.debug.xcconfig - sourceTree - <group> - - CB9F944208FFD7B3ADC7A00A - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTTextManager.h - sourceTree - <group> - - CC1B51AD9B49FFAA1362B23F - - fileRef - BA6C0E71C8E201475B68A2E3 - isa - PBXBuildFile - - CCBD98E709AB05D7FCCA9DD4 - - fileRef - DC61985AB127017510FF47B0 - isa - PBXBuildFile - - CCF7DF071515793DD6C0414D - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTJavaScriptExecutor.h - path - Base/RCTJavaScriptExecutor.h - sourceTree - <group> - - CDB3FDE1695B0706CA924FA5 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTNavItemManager.h - path - Views/RCTNavItemManager.h - sourceTree - <group> - - CDB7B6437EABB1154D9772C0 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTSparseArray.h - path - Base/RCTSparseArray.h - sourceTree - <group> - - CEBFC03689DC0AC9CD1D45F6 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTShadowText.h - sourceTree - <group> - - D19D762ABD2DB814D5BA26CA - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTStaticImage.m - path - Views/RCTStaticImage.m - sourceTree - <group> - - D257C76E43E366FC0EA7A12E - - fileRef - 7601163D57B34162C4CA1C48 - isa - PBXBuildFile - - D290C62BBB41818A93C7C1A1 - - fileRef - E8407ED863C88EC9CA04A11C - isa - PBXBuildFile - - D3650CA7059AEE2BD3BE431F - - containerPortal - A30671B7FF41C9CC88DDC48D - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 973EEBD9F9591953DFB21C06 - remoteInfo - Pods-ReactKit - - D41089EF6EAF70DF70BC0D25 - - children - - F2A1CE5BD796846DBD308A95 - 39463588A39AA3E9757F0520 - 41E7BCDB123D639D70221FE4 - DC8389FA6FBDA311577B6AD5 - - isa - PBXGroup - name - Support Files - path - ../../Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage - sourceTree - <group> - - D436BE9918549C192684657C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTView.m - path - Views/RCTView.m - sourceTree - <group> - - D46C615416D298CD2EF32D8B - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods.release.xcconfig - sourceTree - <group> - - D47F88D3F797D8EF95C0BA4D - - baseConfigurationReference - 062BC4B46046CE4058393650 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - - isa - XCBuildConfiguration - name - Debug - - D6CF22628A62FAE5C1C4F751 - - fileRef - 686655033E6D4DF34CC8D72A - isa - PBXBuildFile - - D76CCDEFB1E46BB0C1532B99 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTScrollViewManager.m - path - Views/RCTScrollViewManager.m - sourceTree - <group> - - D8076A3A8F0FAA3CD5E1FC99 - - fileRef - 2A073BDE36873311DA6A0EF5 - isa - PBXBuildFile - - D9D68BDCB56619CE484E1950 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTRawTextManager.h - sourceTree - <group> - - DAFE568BA68CC1B9A1496B03 - - fileRef - 19B74DAEFA40E906DEDEADFA - isa - PBXBuildFile - - DC61985AB127017510FF47B0 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTTiming.m - path - Modules/RCTTiming.m - sourceTree - <group> - - DC8389FA6FBDA311577B6AD5 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-RCTNetworkImage-prefix.pch - sourceTree - <group> - - DCD06DFADE2DF0CA7278AB88 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - RCTTextManager.m - sourceTree - <group> - - DD8E4C13EE69D6954938439C - - fileRef - 71C70C27906DAEB68FB0CF59 - isa - PBXBuildFile - - DE5F1B9081628B9A5A573C5B - - fileRef - 31CB0CA9F918FFFFCCDB8284 - isa - PBXBuildFile - - E22151F70AA7C88D098C99BB - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTScrollableProtocol.h - path - Base/RCTScrollableProtocol.h - sourceTree - <group> - - E2D61EA3810F0B25C4443657 - - fileRef - C8023A8F586BE2C6323242D8 - isa - PBXBuildFile - - E3483608408169CD1A186EEA - - fileRef - 9B65A75546F806AFC5B18A60 - isa - PBXBuildFile - - E352220A2836A697446EE5ED - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-RCTText-prefix.pch - sourceTree - <group> - - E420F9974821AC873ADE0EB0 - - fileRef - 3EF20A23049B63D8F1AB34ED - isa - PBXBuildFile - - E514DB237132E2FE887A871F - - fileRef - D76CCDEFB1E46BB0C1532B99 - isa - PBXBuildFile - - E5B280DE6A446D58C857B3C7 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTKeyCommands.h - path - Base/RCTKeyCommands.h - sourceTree - <group> - - E6F1A1F54DDCFD6330C02A56 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text - name - Podfile - path - ../Podfile - sourceTree - SOURCE_ROOT - xcLanguageSpecificationIdentifier - xcode.lang.ruby - - E8407ED863C88EC9CA04A11C - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - RCTNetworkImageView.h - sourceTree - <group> - - EA4527C073CDB5189EBADCD7 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTRedBox.m - path - Base/RCTRedBox.m - sourceTree - <group> - - EACA791D981259D849E9575C - - fileRef - 42F3BF4E050BB621F3E00E3C - isa - PBXBuildFile - - EC011298F3945A65BF256861 - - fileRef - 4EFC81CD3380F9556D86CC8C - isa - PBXBuildFile - - EC32BFBA00A39F59EB11C597 - - buildActionMask - 2147483647 - files - - 341F23664902CBD8947C5DB3 - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - ED0EAAAC662DFADD30EA5D11 - - baseConfigurationReference - 062BC4B46046CE4058393650 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - OTHER_LIBTOOLFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - ED51F456809B09F7439C4D93 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTLocationObserver.m - path - Modules/RCTLocationObserver.m - sourceTree - <group> - - EDA82AB2D40C974A74CA74A9 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - RCTNavItem.m - path - Views/RCTNavItem.m - sourceTree - <group> - - EFCED6D21D4BB89711E40665 - - fileRef - 93C181AF29A9C408FC907C4A - isa - PBXBuildFile - - F16F4721492709A369BC5C8D - - fileRef - 5650233E3ECB1C612AB3AA71 - isa - PBXBuildFile - - F2A1CE5BD796846DBD308A95 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-RCTNetworkImage.xcconfig - sourceTree - <group> - - F55505C4FEE6D4B5BE545B36 - - buildActionMask - 2147483647 - files - - 5007E16F5C7E9EFC0185562F - 59C8D74DD9C98E16056D5366 - B5FC682792E6A0447D287697 - B3F415717620F1F12B992B0D - BE1D1748A0D0A88E8D9EBDC6 - FC94E17D52247017A950BB80 - 5199984D66E0D4825EAFDE48 - 8C09DDBC1987BC48B1173A6A - 2B409A074C5817E5B40428E2 - 6E025D879E9E4EA39894CCF7 - 5AAC51BC1BDDD9A9215CFBDD - E2D61EA3810F0B25C4443657 - B1CE62B16BA49B5F93E0F176 - 983AAB60C663D67F5EC651DF - 1537FF13D7133AA6F8B3A1C9 - 2B475CAFC274FB31E95E5491 - BA296894BFD973DE874868B8 - AACA8FE0E3EC2035615EC0AE - B03DD49B4D0684DD664FA620 - 5897E6B3789429F1760006A5 - 75728F9C40185E318ECF195B - 6058DA074939167562CECB0B - 8AC6957EC29778E18C201992 - 71EF39441EAF6D8A62C981C5 - 218485DF6D2557DEC0F8E74E - 07C36347F29DC7BB656AED2E - EFCED6D21D4BB89711E40665 - 19636039A13AE878699E8DBB - 1D5C721F04A0D2846039D9B7 - AF458FAFFB109206A76292E6 - 4D0FD9ED093EC8F8163C743A - A66BCD8A2FAA1E8DADD7488E - 53906C4FE2269E04A9CBA745 - 02CA42753891DE99F0C4A9F1 - C10CEF62C1009D05C2E0E7DF - 277413A21FD87DA13511099F - 38FFA89C70E4D1645D42E7ED - 45EB3392836956C146A52A0C - A29B3475CEBEAF74694048F7 - EC011298F3945A65BF256861 - E420F9974821AC873ADE0EB0 - F16F4721492709A369BC5C8D - 3BFAD0347A551F0536E421F4 - 936FD7023BD4626A2EBF07A2 - DD8E4C13EE69D6954938439C - 8DE4BE955C41F35E0DE7BF39 - - isa - PBXHeadersBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - F66B15C716DB00AB74903326 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-ReactKit-prefix.pch - sourceTree - <group> - - F70F1BFEF9D1587A38666EEB - - children - - 12507443D597BE1AFA5013A7 - B753A0617AB77E1E91027A34 - 82A7154EBF9864584C0B6647 - E352220A2836A697446EE5ED - - isa - PBXGroup - name - Support Files - path - ../../Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText - sourceTree - <group> - - F8A30B6BAB9EB9CAE3F5EE83 - - fileRef - 6B92A10C94541BEEFE730577 - isa - PBXBuildFile - - F8F9FC945C529FDD56EE046E - - fileRef - 79237C45AFA01938E517AD06 - isa - PBXBuildFile - - F9EB9D707F5B2AD7C1E442EF - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTViewNodeProtocol.h - path - Base/RCTViewNodeProtocol.h - sourceTree - <group> - - FA29A9F03B11C2074DC5216D - - fileRef - DCD06DFADE2DF0CA7278AB88 - isa - PBXBuildFile - - FBC74FE67BCC52FD85C1BAD0 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - RCTRootView.h - path - Base/RCTRootView.h - sourceTree - <group> - - FC94E17D52247017A950BB80 - - fileRef - 688A6AE7AC080B377719B148 - isa - PBXBuildFile - - - rootObject - A30671B7FF41C9CC88DDC48D - - diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-Private.xcconfig b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-Private.xcconfig deleted file mode 100644 index 77326a26a..000000000 --- a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-Private.xcconfig +++ /dev/null @@ -1,5 +0,0 @@ -#include "Pods-RCTNetworkImage.xcconfig" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/RCTNetworkImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" -OTHER_LDFLAGS = -ObjC -PODS_ROOT = ${SRCROOT} \ No newline at end of file diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-dummy.m b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-dummy.m deleted file mode 100644 index 04c9099fa..000000000 --- a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_RCTNetworkImage : NSObject -@end -@implementation PodsDummy_Pods_RCTNetworkImage -@end diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch deleted file mode 100644 index 95cf11d9f..000000000 --- a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage-prefix.pch +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - -#import "Pods-environment.h" diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage.xcconfig b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTNetworkImage/Pods-RCTNetworkImage.xcconfig deleted file mode 100644 index e69de29bb..000000000 diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-Private.xcconfig b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-Private.xcconfig deleted file mode 100644 index 5e8e883ba..000000000 --- a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-Private.xcconfig +++ /dev/null @@ -1,5 +0,0 @@ -#include "Pods-RCTText.xcconfig" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/RCTText" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" -OTHER_LDFLAGS = -ObjC -PODS_ROOT = ${SRCROOT} \ No newline at end of file diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-dummy.m b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-dummy.m deleted file mode 100644 index 0ee407269..000000000 --- a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_RCTText : NSObject -@end -@implementation PodsDummy_Pods_RCTText -@end diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch deleted file mode 100644 index 95cf11d9f..000000000 --- a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText-prefix.pch +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - -#import "Pods-environment.h" diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText.xcconfig b/Examples/TicTacToe/Pods/Target Support Files/Pods-RCTText/Pods-RCTText.xcconfig deleted file mode 100644 index e69de29bb..000000000 diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-Private.xcconfig b/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-Private.xcconfig deleted file mode 100644 index 5ad122e34..000000000 --- a/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-Private.xcconfig +++ /dev/null @@ -1,5 +0,0 @@ -#include "Pods-ReactKit.xcconfig" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Build" "${PODS_ROOT}/Headers/Build/ReactKit" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" -OTHER_LDFLAGS = -ObjC -PODS_ROOT = ${SRCROOT} \ No newline at end of file diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-dummy.m b/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-dummy.m deleted file mode 100644 index ab3f82b8c..000000000 --- a/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_ReactKit : NSObject -@end -@implementation PodsDummy_Pods_ReactKit -@end diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch b/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch deleted file mode 100644 index 95cf11d9f..000000000 --- a/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit-prefix.pch +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - -#import "Pods-environment.h" diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit.xcconfig b/Examples/TicTacToe/Pods/Target Support Files/Pods-ReactKit/Pods-ReactKit.xcconfig deleted file mode 100644 index e69de29bb..000000000 diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown deleted file mode 100644 index 255149a82..000000000 --- a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown +++ /dev/null @@ -1,3 +0,0 @@ -# Acknowledgements -This application makes use of the following third party libraries: -Generated by CocoaPods - http://cocoapods.org diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-acknowledgements.plist b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-acknowledgements.plist deleted file mode 100644 index e4edebe92..000000000 --- a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-acknowledgements.plist +++ /dev/null @@ -1,29 +0,0 @@ - - - - - PreferenceSpecifiers - - - FooterText - This application makes use of the following third party libraries: - Title - Acknowledgements - Type - PSGroupSpecifier - - - FooterText - Generated by CocoaPods - http://cocoapods.org - Title - - Type - PSGroupSpecifier - - - StringsTable - Acknowledgements - Title - Acknowledgements - - diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-dummy.m b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-dummy.m deleted file mode 100644 index ade64bd1a..000000000 --- a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods : NSObject -@end -@implementation PodsDummy_Pods -@end diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-environment.h b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-environment.h deleted file mode 100644 index ef6a41b65..000000000 --- a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-environment.h +++ /dev/null @@ -1,26 +0,0 @@ - -// To check if a library is compiled with CocoaPods you -// can use the `COCOAPODS` macro definition which is -// defined in the xcconfigs so it is available in -// headers also when they are imported in the client -// project. - - -// RCTNetworkImage -#define COCOAPODS_POD_AVAILABLE_RCTNetworkImage -#define COCOAPODS_VERSION_MAJOR_RCTNetworkImage 0 -#define COCOAPODS_VERSION_MINOR_RCTNetworkImage 0 -#define COCOAPODS_VERSION_PATCH_RCTNetworkImage 1 - -// RCTText -#define COCOAPODS_POD_AVAILABLE_RCTText -#define COCOAPODS_VERSION_MAJOR_RCTText 0 -#define COCOAPODS_VERSION_MINOR_RCTText 0 -#define COCOAPODS_VERSION_PATCH_RCTText 1 - -// ReactKit -#define COCOAPODS_POD_AVAILABLE_ReactKit -#define COCOAPODS_VERSION_MAJOR_ReactKit 0 -#define COCOAPODS_VERSION_MINOR_ReactKit 0 -#define COCOAPODS_VERSION_PATCH_ReactKit 1 - diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-resources.sh b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-resources.sh deleted file mode 100755 index e149064a0..000000000 --- a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods-resources.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh -set -e - -mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - -RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt -> "$RESOURCES_TO_COPY" - -install_resource() -{ - case $1 in - *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" - ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" - ;; - *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" - ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" - ;; - *.framework) - echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - ;; - *.xcdatamodel) - echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" - xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" - ;; - *.xcdatamodeld) - echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" - xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" - ;; - *.xcmappingmodel) - echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" - xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" - ;; - *.xcassets) - ;; - /*) - echo "$1" - echo "$1" >> "$RESOURCES_TO_COPY" - ;; - *) - echo "${PODS_ROOT}/$1" - echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" - ;; - esac -} - -rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -if [[ "${ACTION}" == "install" ]]; then - rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi -rm -f "$RESOURCES_TO_COPY" - -if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ `find . -name '*.xcassets' | wc -l` -ne 0 ] -then - case "${TARGETED_DEVICE_FAMILY}" in - 1,2) - TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" - ;; - 1) - TARGET_DEVICE_ARGS="--target-device iphone" - ;; - 2) - TARGET_DEVICE_ARGS="--target-device ipad" - ;; - *) - TARGET_DEVICE_ARGS="--target-device mac" - ;; - esac - find "${PWD}" -name "*.xcassets" -print0 | xargs -0 actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods.debug.xcconfig b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods.debug.xcconfig deleted file mode 100644 index 7e075cbab..000000000 --- a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods.debug.xcconfig +++ /dev/null @@ -1,6 +0,0 @@ -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" -OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/RCTNetworkImage" -isystem "${PODS_ROOT}/Headers/Public/RCTText" -isystem "${PODS_ROOT}/Headers/Public/ReactKit" -OTHER_LDFLAGS = -ObjC -l"Pods-RCTNetworkImage" -l"Pods-RCTText" -l"Pods-ReactKit" -OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) -PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods.release.xcconfig b/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods.release.xcconfig deleted file mode 100644 index 7e075cbab..000000000 --- a/Examples/TicTacToe/Pods/Target Support Files/Pods/Pods.release.xcconfig +++ /dev/null @@ -1,6 +0,0 @@ -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/RCTNetworkImage" "${PODS_ROOT}/Headers/Public/RCTText" "${PODS_ROOT}/Headers/Public/ReactKit" -OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/RCTNetworkImage" -isystem "${PODS_ROOT}/Headers/Public/RCTText" -isystem "${PODS_ROOT}/Headers/Public/ReactKit" -OTHER_LDFLAGS = -ObjC -l"Pods-RCTNetworkImage" -l"Pods-RCTText" -l"Pods-ReactKit" -OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) -PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj b/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj index aed93cd37..22d1b4e04 100644 --- a/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj +++ b/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj @@ -11,9 +11,49 @@ 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 94A5470E6B9ACC86C8946DD4 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 57D137B3557DA44DA129DF68 /* libPods.a */; }; + 587650E91A9EB103008B8F17 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587650E01A9EB0DB008B8F17 /* libRCTText.a */; }; + 587650EA1A9EB103008B8F17 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587650E81A9EB0E0008B8F17 /* libReactKit.a */; }; + 58C571F31AA611C900CDF9C8 /* libRCTNetworkImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C571ED1AA611BA00CDF9C8 /* libRCTNetworkImage.a */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 587650DF1A9EB0DB008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B5119B1A9E6C1200147676; + remoteInfo = RCTText; + }; + 587650E11A9EB0DB008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511A61A9E6C1300147676; + remoteInfo = RCTTextTests; + }; + 587650E71A9EB0E0008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; + remoteInfo = ReactKit; + }; + 58C571EC1AA611BA00CDF9C8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 58C571E71AA611BA00CDF9C8 /* RCTNetworkImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B5115D1A9E6B3D00147676; + remoteInfo = RCTNetworkImage; + }; + 58C571EE1AA611BA00CDF9C8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 58C571E71AA611BA00CDF9C8 /* RCTNetworkImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511681A9E6B3D00147676; + remoteInfo = RCTNetworkImageTests; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXFileReference section */ 13B07F961A680F5B00A75B9A /* TicTacToe.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TicTacToe.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; @@ -22,9 +62,9 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 57D137B3557DA44DA129DF68 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; - AE37E9319424945F93F61AC9 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; - BE166B25F931D53146DC44FD /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; + 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../Text/RCTText.xcodeproj"; sourceTree = ""; }; + 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../../ReactKit/ReactKit.xcodeproj"; sourceTree = ""; }; + 58C571E71AA611BA00CDF9C8 /* RCTNetworkImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetworkImage.xcodeproj; path = ../../Libraries/Image/RCTNetworkImage.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -32,7 +72,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 94A5470E6B9ACC86C8946DD4 /* libPods.a in Frameworks */, + 58C571F31AA611C900CDF9C8 /* libRCTNetworkImage.a in Frameworks */, + 587650E91A9EB103008B8F17 /* libRCTText.a in Frameworks */, + 587650EA1A9EB103008B8F17 /* libReactKit.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -52,21 +94,48 @@ name = TicTacToe; sourceTree = ""; }; - 626AAA547F04E200EB1B13D5 /* Frameworks */ = { + 587650DB1A9EB0DB008B8F17 /* Products */ = { isa = PBXGroup; children = ( - 57D137B3557DA44DA129DF68 /* libPods.a */, + 587650E01A9EB0DB008B8F17 /* libRCTText.a */, + 587650E21A9EB0DB008B8F17 /* RCTTextTests.xctest */, ); - name = Frameworks; + name = Products; + sourceTree = ""; + }; + 587650E41A9EB0DF008B8F17 /* Products */ = { + isa = PBXGroup; + children = ( + 587650E81A9EB0E0008B8F17 /* libReactKit.a */, + ); + name = Products; + sourceTree = ""; + }; + 58C571E81AA611BA00CDF9C8 /* Products */ = { + isa = PBXGroup; + children = ( + 58C571ED1AA611BA00CDF9C8 /* libRCTNetworkImage.a */, + 58C571EF1AA611BA00CDF9C8 /* RCTNetworkImageTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 58C572071AA6126D00CDF9C8 /* Libraries */ = { + isa = PBXGroup; + children = ( + 58C571E71AA611BA00CDF9C8 /* RCTNetworkImage.xcodeproj */, + 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */, + 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */, + ); + name = Libraries; sourceTree = ""; }; 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( 13B07FAE1A68108700A75B9A /* TicTacToe */, + 58C572071AA6126D00CDF9C8 /* Libraries */, 83CBBA001A601CBA00E9B192 /* Products */, - C661FA21FC43E8C4E3D76705 /* Pods */, - 626AAA547F04E200EB1B13D5 /* Frameworks */, ); sourceTree = ""; }; @@ -78,15 +147,6 @@ name = Products; sourceTree = ""; }; - C661FA21FC43E8C4E3D76705 /* Pods */ = { - isa = PBXGroup; - children = ( - AE37E9319424945F93F61AC9 /* Pods.debug.xcconfig */, - BE166B25F931D53146DC44FD /* Pods.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -94,11 +154,9 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "TicTacToe" */; buildPhases = ( - 1604B0DABE720C58B4BD7B85 /* Check Pods Manifest.lock */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, - 90FB29DB1D5DDA0C9E91F4D0 /* Copy Pods Resources */, ); buildRules = ( ); @@ -129,6 +187,20 @@ mainGroup = 83CBB9F61A601CBA00E9B192; productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 58C571E81AA611BA00CDF9C8 /* Products */; + ProjectRef = 58C571E71AA611BA00CDF9C8 /* RCTNetworkImage.xcodeproj */; + }, + { + ProductGroup = 587650DB1A9EB0DB008B8F17 /* Products */; + ProjectRef = 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */; + }, + { + ProductGroup = 587650E41A9EB0DF008B8F17 /* Products */; + ProjectRef = 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */; + }, + ); projectRoot = ""; targets = ( 13B07F861A680F5B00A75B9A /* TicTacToe */, @@ -136,6 +208,44 @@ }; /* End PBXProject section */ +/* Begin PBXReferenceProxy section */ + 587650E01A9EB0DB008B8F17 /* libRCTText.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTText.a; + remoteRef = 587650DF1A9EB0DB008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 587650E21A9EB0DB008B8F17 /* RCTTextTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = RCTTextTests.xctest; + remoteRef = 587650E11A9EB0DB008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 587650E81A9EB0E0008B8F17 /* libReactKit.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libReactKit.a; + remoteRef = 587650E71A9EB0E0008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 58C571ED1AA611BA00CDF9C8 /* libRCTNetworkImage.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTNetworkImage.a; + remoteRef = 58C571EC1AA611BA00CDF9C8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 58C571EF1AA611BA00CDF9C8 /* RCTNetworkImageTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = RCTNetworkImageTests.xctest; + remoteRef = 58C571EE1AA611BA00CDF9C8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + /* Begin PBXResourcesBuildPhase section */ 13B07F8E1A680F5B00A75B9A /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -148,39 +258,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 1604B0DABE720C58B4BD7B85 /* Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 90FB29DB1D5DDA0C9E91F4D0 /* Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 13B07F871A680F5B00A75B9A /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -207,22 +284,22 @@ /* Begin XCBuildConfiguration section */ 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AE37E9319424945F93F61AC9 /* Pods.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = TicTacToe; }; name = Debug; }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = BE166B25F931D53146DC44FD /* Pods.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = TicTacToe; }; name = Release; diff --git a/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj.orig b/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj.orig new file mode 100644 index 000000000..7389d492a --- /dev/null +++ b/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj.orig @@ -0,0 +1,407 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; + 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; + 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; + 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 587650E91A9EB103008B8F17 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587650E01A9EB0DB008B8F17 /* libRCTText.a */; }; + 587650EA1A9EB103008B8F17 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587650E81A9EB0E0008B8F17 /* libReactKit.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 587650DF1A9EB0DB008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B5119B1A9E6C1200147676; + remoteInfo = RCTText; + }; + 587650E11A9EB0DB008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511A61A9E6C1300147676; + remoteInfo = RCTTextTests; + }; + 587650E71A9EB0E0008B8F17 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; + remoteInfo = ReactKit; + }; + 58C571DE1AA6119300CDF9C8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 58C571D91AA6119300CDF9C8 /* RCTNetworkImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B5115D1A9E6B3D00147676; + remoteInfo = RCTNetworkImage; + }; + 58C571E01AA6119300CDF9C8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 58C571D91AA6119300CDF9C8 /* RCTNetworkImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511681A9E6B3D00147676; + remoteInfo = RCTNetworkImageTests; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 13B07F961A680F5B00A75B9A /* TicTacToe.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TicTacToe.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; + 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../Text/RCTText.xcodeproj"; sourceTree = ""; }; + 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../../ReactKit/ReactKit.xcodeproj"; sourceTree = ""; }; + 58C571D91AA6119300CDF9C8 /* RCTNetworkImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetworkImage.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/Text/../Image/RCTNetworkImage.xcodeproj"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 587650E91A9EB103008B8F17 /* libRCTText.a in Frameworks */, + 587650EA1A9EB103008B8F17 /* libReactKit.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 13B07FAE1A68108700A75B9A /* TicTacToe */ = { + isa = PBXGroup; + children = ( + 13B07FAF1A68108700A75B9A /* AppDelegate.h */, + 13B07FB01A68108700A75B9A /* AppDelegate.m */, + 13B07FB51A68108700A75B9A /* Images.xcassets */, + 13B07FB61A68108700A75B9A /* Info.plist */, + 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, + 13B07FB71A68108700A75B9A /* main.m */, + ); + name = TicTacToe; + sourceTree = ""; + }; + 587650DB1A9EB0DB008B8F17 /* Products */ = { + isa = PBXGroup; + children = ( + 587650E01A9EB0DB008B8F17 /* libRCTText.a */, + 587650E21A9EB0DB008B8F17 /* RCTTextTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 587650E41A9EB0DF008B8F17 /* Products */ = { + isa = PBXGroup; + children = ( + 587650E81A9EB0E0008B8F17 /* libReactKit.a */, + ); + name = Products; + sourceTree = ""; + }; + 58C571DA1AA6119300CDF9C8 /* Products */ = { + isa = PBXGroup; + children = ( + 58C571DF1AA6119300CDF9C8 /* libRCTNetworkImage.a */, + 58C571E11AA6119300CDF9C8 /* RCTNetworkImageTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 83CBB9F61A601CBA00E9B192 = { + isa = PBXGroup; + children = ( + 13B07FAE1A68108700A75B9A /* TicTacToe */, + 58C571D91AA6119300CDF9C8 /* RCTNetworkImage.xcodeproj */, + 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */, + 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */, + 83CBBA001A601CBA00E9B192 /* Products */, + ); + sourceTree = ""; + }; + 83CBBA001A601CBA00E9B192 /* Products */ = { + isa = PBXGroup; + children = ( + 13B07F961A680F5B00A75B9A /* TicTacToe.app */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 13B07F861A680F5B00A75B9A /* TicTacToe */ = { + isa = PBXNativeTarget; + buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "TicTacToe" */; + buildPhases = ( + 13B07F871A680F5B00A75B9A /* Sources */, + 13B07F8C1A680F5B00A75B9A /* Frameworks */, + 13B07F8E1A680F5B00A75B9A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TicTacToe; + productName = "Hello World"; + productReference = 13B07F961A680F5B00A75B9A /* TicTacToe.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 83CBB9F71A601CBA00E9B192 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = Facebook; + }; + buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "TicTacToe" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 83CBB9F61A601CBA00E9B192; + productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 58C571DA1AA6119300CDF9C8 /* Products */; + ProjectRef = 58C571D91AA6119300CDF9C8 /* RCTNetworkImage.xcodeproj */; + }, + { + ProductGroup = 587650DB1A9EB0DB008B8F17 /* Products */; + ProjectRef = 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */; + }, + { + ProductGroup = 587650E41A9EB0DF008B8F17 /* Products */; + ProjectRef = 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 13B07F861A680F5B00A75B9A /* TicTacToe */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 587650E01A9EB0DB008B8F17 /* libRCTText.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTText.a; + remoteRef = 587650DF1A9EB0DB008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 587650E21A9EB0DB008B8F17 /* RCTTextTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = RCTTextTests.xctest; + remoteRef = 587650E11A9EB0DB008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 587650E81A9EB0E0008B8F17 /* libReactKit.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libReactKit.a; + remoteRef = 587650E71A9EB0E0008B8F17 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 58C571DF1AA6119300CDF9C8 /* libRCTNetworkImage.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTNetworkImage.a; + remoteRef = 58C571DE1AA6119300CDF9C8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 58C571E11AA6119300CDF9C8 /* RCTNetworkImageTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = RCTNetworkImageTests.xctest; + remoteRef = 58C571E01AA6119300CDF9C8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 13B07F8E1A680F5B00A75B9A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, + 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 13B07F871A680F5B00A75B9A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, + 13B07FC11A68108700A75B9A /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + 13B07FB21A68108700A75B9A /* Base */, + ); + name = LaunchScreen.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 13B07F941A680F5B00A75B9A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = TicTacToe; + }; + name = Debug; + }; + 13B07F951A680F5B00A75B9A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = TicTacToe; + }; + name = Release; + }; + 83CBBA201A601CBA00E9B192 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 83CBBA211A601CBA00E9B192 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "TicTacToe" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 13B07F941A680F5B00A75B9A /* Debug */, + 13B07F951A680F5B00A75B9A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "TicTacToe" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 83CBBA201A601CBA00E9B192 /* Debug */, + 83CBBA211A601CBA00E9B192 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; +} diff --git a/Examples/TicTacToe/TicTacToe.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/TicTacToe/TicTacToe.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..e5f301dcc --- /dev/null +++ b/Examples/TicTacToe/TicTacToe.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Examples/TicTacToe/TicTacToe.xcworkspace/contents.xcworkspacedata b/Examples/TicTacToe/TicTacToe.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index ff1c005b3..000000000 --- a/Examples/TicTacToe/TicTacToe.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/Examples/UIExplorer/ListViewPagingExample.js b/Examples/UIExplorer/ListViewPagingExample.js index 4818da998..c74795eb5 100644 --- a/Examples/UIExplorer/ListViewPagingExample.js +++ b/Examples/UIExplorer/ListViewPagingExample.js @@ -11,7 +11,6 @@ var { Image, LayoutAnimation, ListView, - ListViewDataSource, StyleSheet, Text, TouchableOpacity, @@ -72,7 +71,7 @@ var ListViewPagingExample = React.createClass({ return dataBlob[rowID]; }; - var dataSource = new ListViewDataSource({ + var dataSource = new ListView.DataSource({ getRowData: getRowData, getSectionHeaderData: getSectionData, rowHasChanged: (row1, row2) => row1 !== row2, diff --git a/Examples/UIExplorer/ListViewSimpleExample.js b/Examples/UIExplorer/ListViewSimpleExample.js index db6130843..c6b158f03 100644 --- a/Examples/UIExplorer/ListViewSimpleExample.js +++ b/Examples/UIExplorer/ListViewSimpleExample.js @@ -9,7 +9,6 @@ var React = require('react-native'); var { Image, ListView, - ListViewDataSource, TouchableHighlight, StyleSheet, Text, @@ -25,7 +24,7 @@ var ListViewSimpleExample = React.createClass({ }, getInitialState: function() { - var ds = new ListViewDataSource({rowHasChanged: (r1, r2) => r1 !== r2}); + var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); return { dataSource: ds.cloneWithRows(this._genRows({})), }; diff --git a/Libraries/Components/ListView/ListView.js b/Libraries/Components/ListView/ListView.js index 45539586b..086112724 100644 --- a/Libraries/Components/ListView/ListView.js +++ b/Libraries/Components/ListView/ListView.js @@ -77,6 +77,10 @@ var SCROLLVIEW_REF = 'listviewscroll'; var ListView = React.createClass({ mixins: [ScrollResponder.Mixin, TimerMixin], + statics: { + DataSource: ListViewDataSource, + }, + /** * You must provide a renderRow function. If you omit any of the other render * functions, ListView will simply skip rendering them. diff --git a/Libraries/Components/ScrollViewPropTypes.js b/Libraries/Components/ScrollViewPropTypes.js index 12af36528..f72dc9f05 100644 --- a/Libraries/Components/ScrollViewPropTypes.js +++ b/Libraries/Components/ScrollViewPropTypes.js @@ -24,7 +24,7 @@ var ScrollViewPropTypes = { showsHorizontalScrollIndicator: nativePropType(PropTypes.bool), showsVerticalScrollIndicator: nativePropType(PropTypes.bool), style: StyleSheetPropType(ViewStylePropTypes), - throttleScrollCallbackMS: nativePropType(PropTypes.number), // 200ms + throttleScrollCallbackMS: nativePropType(PropTypes.number), // null }; module.exports = ScrollViewPropTypes; diff --git a/Libraries/Components/TextInput/TextInput.ios.js b/Libraries/Components/TextInput/TextInput.ios.js index e5980de39..fef9c16f0 100644 --- a/Libraries/Components/TextInput/TextInput.ios.js +++ b/Libraries/Components/TextInput/TextInput.ios.js @@ -5,6 +5,7 @@ */ 'use strict'; +var DocumentSelectionState = require('DocumentSelectionState'); var EventEmitter = require('EventEmitter'); var NativeMethodsMixin = require('NativeMethodsMixin'); var NativeModulesDeprecated = require('NativeModulesDeprecated'); @@ -180,7 +181,7 @@ var TextInput = React.createClass({ * See DocumentSelectionState.js, some state that is responsible for * maintaining selection information for a document */ -// selectionState: PropTypes.instanceOf(DocumentSelectionState), + selectionState: PropTypes.instanceOf(DocumentSelectionState), /** * The default value for the text input */ diff --git a/lint/linterTransform.js b/lint/linterTransform.js new file mode 100644 index 000000000..a61fa89a3 --- /dev/null +++ b/lint/linterTransform.js @@ -0,0 +1,76 @@ +'use strict'; + +var eslint = require('eslint'); + +var ignoredStylisticRules = { + 'key-spacing': false, + 'comma-spacing': true, + 'no-multi-spaces': true, + 'brace-style': true, + 'camelcase': true, + 'consistent-this': true, + 'eol-last': true, + 'func-names': true, + 'func-style': true, + 'new-cap': true, + 'new-parens': true, + 'no-nested-ternary': true, + 'no-array-constructor': true, + 'no-lonely-if': true, + 'no-new-object': true, + 'no-spaced-func': true, + 'no-space-before-semi': true, + 'no-ternary': true, + 'no-trailing-spaces': true, + 'no-underscore-dangle': true, + 'no-wrap-func': true, + 'no-mixed-spaces-and-tabs': true, + 'quotes': true, + 'quote-props': true, + 'semi': true, + 'sort-vars': true, + 'space-after-keywords': true, + 'space-in-brackets': true, + 'space-in-parens': true, + 'space-infix-ops': true, + 'space-return-throw-case': true, + 'space-unary-word-ops': true, + 'max-nested-callbacks': true, + 'one-var': true, + 'wrap-regex': true, + 'curly': true, + 'no-mixed-requires': true, +}; + +function setLinterTransform(transformSource) { + var originalVerify = eslint.linter.verify; + eslint.linter.verify = function(text, config, filename, saveState) { + var transformedText; + try { + transformedText = transformSource(text); + } catch (e) { + return [{ + severity: 2, + line: e.lineNumber, + message: e.message, + source: text + }]; + } + var originalLines = text.split('\n'); + var transformedLines = transformedText.split('\n'); + var warnings = originalVerify.call(eslint.linter, transformedText, config, filename, saveState); + + // JSX and ES6 transforms usually generate pretty ugly code. Let's skip lint warnings + // about code style for lines that have been changed by transform step. + // Note that more important issues, like use of undefined vars, will still be reported. + return warnings.filter(function(error) { + var lineHasBeenTransformed = originalLines[error.line - 1] !== transformedLines[error.line - 1]; + var shouldIgnore = ignoredStylisticRules[error.ruleId] && lineHasBeenTransformed; + return !shouldIgnore; + }); + }; +} + +module.exports = { + setLinterTransform: setLinterTransform, +}; diff --git a/linter.js b/linter.js index ec7aa7c7a..205e757c1 100644 --- a/linter.js +++ b/linter.js @@ -1,83 +1,10 @@ // Copyright 2012-present Facebook. All Rights Reserved. 'use strict'; -var eslint = require('eslint'); var transformSource = require('./jestSupport/scriptPreprocess.js').transformSource; +var linterTransform = require('./lint/linterTransform'); -var ignoredStylisticRules = { - 'key-spacing': false, - 'comma-spacing': true, - 'no-multi-spaces': true, - 'brace-style': true, - 'camelcase': true, - 'consistent-this': true, - 'eol-last': true, - 'func-names': true, - 'func-style': true, - 'new-cap': true, - 'new-parens': true, - 'no-nested-ternary': true, - 'no-array-constructor': true, - 'no-lonely-if': true, - 'no-new-object': true, - 'no-spaced-func': true, - 'no-space-before-semi': true, - 'no-ternary': true, - 'no-trailing-spaces': true, - 'no-underscore-dangle': true, - 'no-wrap-func': true, - 'no-mixed-spaces-and-tabs': true, - 'quotes': true, - 'quote-props': true, - 'semi': true, - 'sort-vars': true, - 'space-after-keywords': true, - 'space-in-brackets': true, - 'space-in-parens': true, - 'space-infix-ops': true, - 'space-return-throw-case': true, - 'space-unary-word-ops': true, - 'max-nested-callbacks': true, - 'one-var': true, - 'wrap-regex': true, - 'curly': true, - 'no-mixed-requires': true, -}; - -/* - * Currently ESLint does not understand ES6+React-flavoured syntax. - * To make it work on our codebase, we monkey-patch `verify` function - * to do a transform before running lint rules. - * - * If future, as ESLint's support for ES6 expands, we can get rid of this - * hack - */ -var originalVerify = eslint.linter.verify; -eslint.linter.verify = function(text, config, filename, saveState) { - var transformedText; - try { - transformedText = transformSource(text); - } catch (e) { - return [{ - severity: 2, - line: e.lineNumber, - message: e.message, - source: text - }]; - } - var originalLines = text.split('\n'); - var transformedLines = transformedText.split('\n'); - var warnings = originalVerify.call(eslint.linter, transformedText, config, filename, saveState); - - // JSX and ES6 transforms usually generate pretty ugly code. Let's skip lint warnings - // about code style for lines that have been changed by transform step. - // Note that more important issues, like use of undefined vars, will still be reported. - return warnings.filter(function(error) { - var lineHasBeenTransformed = originalLines[error.line - 1] !== transformedLines[error.line - 1]; - var shouldIgnore = ignoredStylisticRules[error.ruleId] && lineHasBeenTransformed; - return !shouldIgnore; - }); -}; +linterTransform.setLinterTransform(transformSource); // Run the original CLI require('eslint/bin/eslint'); diff --git a/package.json b/package.json index 322716b45..18516ccbc 100644 --- a/package.json +++ b/package.json @@ -26,32 +26,21 @@ }, "dependencies": { "absolute-path": "0.0.0", - "base62": "0.1.1", "connect": "2.8.3", "debug": "~2.1.0", - "esprima-fb": "7001.0001.0000-dev-harmony-fb", - "fs-extra": "0.15.0", "jstransform": "8.2.0", - "mime": "1.2.11", "module-deps": "3.5.6", - "node-haste": "1.2.6", - "node-static": "0.7.6", "optimist": "0.6.1", - "path-is-inside": "1.0.1", - "punycode": "1.2.4", "q": "1.0.1", - "qs": "0.6.5", "react-tools": "0.12.2", - "rebound": "0.0.10", "sane": "1.0.1", "source-map": "0.1.31", "stacktrace-parser": "0.1.1", - "through": "2.3.6", "underscore": "1.7.0", - "wordwrap": "0.0.2", "worker-farm": "1.1.0", "yargs": "1.3.2", - "joi": "~5.1.0" + "joi": "~5.1.0", + "uglify-js": "~2.4.16" }, "devDependencies": { "jest-cli": "0.2.1", diff --git a/packager/packager.js b/packager/packager.js index 6d5336ef4..08bab38b0 100644 --- a/packager/packager.js +++ b/packager/packager.js @@ -29,6 +29,10 @@ var options = parseCommandLine([{ }, { command: 'root', description: 'add another root(s) to be used by the packager in this project', +}, { + command: 'dev', + default: true, + description: 'produce development packages with extra warnings enabled', }]); if (!options.projectRoots) { @@ -93,7 +97,7 @@ function openStackFrameInEditor(req, res, next) { function getAppMiddleware(options) { return ReactPackager.middleware({ - dev: true, + dev: options.dev, projectRoots: options.projectRoots, blacklistRE: blacklist(false), cacheVersion: '2', diff --git a/packager/react-packager/src/Packager/Package.js b/packager/react-packager/src/Packager/Package.js index a4080d3b3..3ef9c528f 100644 --- a/packager/react-packager/src/Packager/Package.js +++ b/packager/react-packager/src/Packager/Package.js @@ -2,6 +2,7 @@ var _ = require('underscore'); var base64VLQ = require('./base64-vlq'); +var UglifyJS = require('uglify-js'); module.exports = Package; @@ -27,6 +28,7 @@ Package.prototype.addModule = function( }; Package.prototype.finalize = function(options) { + options = options || {}; if (options.runMainModule) { var runCode = ';require("' + this._mainModuleId + '");'; this.addModule( @@ -40,12 +42,49 @@ Package.prototype.finalize = function(options) { Object.seal(this._modules); }; -Package.prototype.getSource = function() { - return this._source || ( - this._source = _.pluck(this._modules, 'transformedCode').join('\n') + '\n' + - 'RAW_SOURCE_MAP = ' + JSON.stringify(this.getSourceMap({excludeSource: true})) + - ';\n' + '\/\/@ sourceMappingURL=' + this._sourceMapUrl - ); +Package.prototype.getSource = function(options) { + if (!this._source) { + options = options || {}; + this._source = _.pluck(this._modules, 'transformedCode').join('\n'); + if (options.inlineSourceMap) { + var sourceMap = this.getSourceMap({excludeSource: true}); + this._source += '\nRAW_SOURCE_MAP = ' + JSON.stringify(sourceMap) + ';'; + } + this._source += '\n\/\/@ sourceMappingURL=' + this._sourceMapUrl; + } + return this._source; +}; + +Package.prototype.getMinifiedSourceAndMap = function() { + var source = this.getSource({inlineSourceMap: false}); + try { + return UglifyJS.minify(source, { + fromString: true, + outSourceMap: 'bundle.js', + inSourceMap: this.getSourceMap(), + }); + } catch(e) { + // Sometimes, when somebody is using a new syntax feature that we + // don't yet have transform for, the untransformed line is sent to + // uglify, and it chokes on it. This code tries to print the line + // and the module for easier debugging + var errorMessage = 'Error while minifying JS\n'; + if (e.line) { + errorMessage += 'Transformed code line: "' + + source.split('\n')[e.line - 1] + '"\n'; + } + if (e.pos) { + var fromIndex = source.lastIndexOf('__d(\'', e.pos); + if (fromIndex > -1) { + fromIndex += '__d(\''.length; + var toIndex = source.indexOf('\'', fromIndex); + errorMessage += 'Module name (best guess): ' + + source.substring(fromIndex, toIndex) + '\n'; + } + } + errorMessage += e.toString(); + throw new Error(errorMessage); + } }; Package.prototype.getSourceMap = function(options) { diff --git a/packager/react-packager/src/Packager/__tests__/Package-test.js b/packager/react-packager/src/Packager/__tests__/Package-test.js index 74a2f4379..41630fc47 100644 --- a/packager/react-packager/src/Packager/__tests__/Package-test.js +++ b/packager/react-packager/src/Packager/__tests__/Package-test.js @@ -21,7 +21,7 @@ describe('Package', function() { ppackage.addModule('transformed foo;', 'source foo', 'foo path'); ppackage.addModule('transformed bar;', 'source bar', 'bar path'); ppackage.finalize({}); - expect(ppackage.getSource()).toBe([ + expect(ppackage.getSource({inlineSourceMap: true})).toBe([ 'transformed foo;', 'transformed bar;', 'RAW_SOURCE_MAP = "test-source-map";', @@ -34,7 +34,7 @@ describe('Package', function() { ppackage.addModule('transformed bar;', 'source bar', 'bar path'); ppackage.setMainModuleId('foo'); ppackage.finalize({runMainModule: true}); - expect(ppackage.getSource()).toBe([ + expect(ppackage.getSource({inlineSourceMap: true})).toBe([ 'transformed foo;', 'transformed bar;', ';require("foo");', @@ -42,6 +42,21 @@ describe('Package', function() { '\/\/@ sourceMappingURL=test_url', ].join('\n')); }); + + it('should get minified source', function() { + var minified = { + code: 'minified', + map: 'map', + }; + + require('uglify-js').minify = function() { + return minified; + }; + + ppackage.addModule('transformed foo;', 'source foo', 'foo path'); + ppackage.finalize(); + expect(ppackage.getMinifiedSourceAndMap()).toBe(minified); + }); }); describe('sourcemap package', function() { diff --git a/packager/react-packager/src/Packager/__tests__/Packager-test.js b/packager/react-packager/src/Packager/__tests__/Packager-test.js index 2e43e91a9..d8348be8f 100644 --- a/packager/react-packager/src/Packager/__tests__/Packager-test.js +++ b/packager/react-packager/src/Packager/__tests__/Packager-test.js @@ -6,6 +6,7 @@ jest .dontMock('q') .dontMock('os') .dontMock('underscore') + .setMock('uglify-js') .dontMock('../'); var q = require('q'); diff --git a/packager/react-packager/src/Server/__tests__/Server-test.js b/packager/react-packager/src/Server/__tests__/Server-test.js index e6020c79b..5a5d62b02 100644 --- a/packager/react-packager/src/Server/__tests__/Server-test.js +++ b/packager/react-packager/src/Server/__tests__/Server-test.js @@ -10,6 +10,7 @@ jest.setMock('worker-farm', function() { return function() {}; }) return setTimeout(fn, 0); } }) + .setMock('uglify-js') .dontMock('../'); var q = require('q'); diff --git a/packager/react-packager/src/Server/index.js b/packager/react-packager/src/Server/index.js index accce205a..83592fea9 100644 --- a/packager/react-packager/src/Server/index.js +++ b/packager/react-packager/src/Server/index.js @@ -51,6 +51,7 @@ var validateOpts = declareOpts({ function Server(options) { var opts = validateOpts(options); + this._dev = opts.dev; this._projectRoots = opts.projectRoots; this._packages = Object.create(null); this._packager = new Packager(opts); @@ -72,13 +73,14 @@ Server.prototype._onFileChange = function(type, filepath, root) { }; Server.prototype._rebuildPackages = function() { + var dev = this._dev; var buildPackage = this._buildPackage.bind(this); var packages = this._packages; Object.keys(packages).forEach(function(key) { var options = getOptionsFromPath(url.parse(key).pathname); packages[key] = buildPackage(options).then(function(p) { // Make a throwaway call to getSource to cache the source string. - p.getSource(); + p.getSource({inlineSourceMap: dev}); return p; }); }); @@ -159,10 +161,11 @@ Server.prototype.processRequest = function(req, res, next) { var options = getOptionsFromPath(url.parse(req.url).pathname); var building = this._packages[req.url] || this._buildPackage(options); this._packages[req.url] = building; + var dev = this._dev; building.then( function(p) { if (requestType === 'bundle') { - res.end(p.getSource()); + res.end(p.getSource({inlineSourceMap: dev})); Activity.endEvent(startReqEventId); } else if (requestType === 'map') { res.end(JSON.stringify(p.getSourceMap())); From 86aa5f80dcee86b62f1d8043d5c2fdfa95786dfc Mon Sep 17 00:00:00 2001 From: Spencer Ahrens Date: Tue, 3 Mar 2015 09:28:59 -0800 Subject: [PATCH 09/79] Updates from Tue March 3 - [ReactNative] Clean up libraries and include paths | Spencer Ahrens --- .../Movies/Movies.xcodeproj/project.pbxproj | 181 +++++++----------- .../TicTacToe.xcodeproj/project.pbxproj | 140 +++++++------- .../UIExplorer.xcodeproj/project.pbxproj | 71 ++----- .../RCTNetworkImage.xcodeproj/project.pbxproj | 107 ----------- .../RCTDataManager.xcodeproj/project.pbxproj | 107 ----------- .../Text/RCTText.xcodeproj/project.pbxproj | 107 ----------- 6 files changed, 159 insertions(+), 554 deletions(-) diff --git a/Examples/Movies/Movies.xcodeproj/project.pbxproj b/Examples/Movies/Movies.xcodeproj/project.pbxproj index 05e45f8f6..00dd93007 100644 --- a/Examples/Movies/Movies.xcodeproj/project.pbxproj +++ b/Examples/Movies/Movies.xcodeproj/project.pbxproj @@ -11,56 +11,35 @@ 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 587651131A9EB12E008B8F17 /* libRCTDataManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587650FF1A9EB120008B8F17 /* libRCTDataManager.a */; }; - 587651141A9EB12E008B8F17 /* libRCTNetworkImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587651051A9EB120008B8F17 /* libRCTNetworkImage.a */; }; - 587651151A9EB12E008B8F17 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5876510D1A9EB120008B8F17 /* libRCTText.a */; }; - 587651161A9EB12E008B8F17 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587651121A9EB120008B8F17 /* libReactKit.a */; }; + 58C572691AA6239800CDF9C8 /* libRCTDataManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C572631AA6236600CDF9C8 /* libRCTDataManager.a */; }; + 58C5726A1AA6239B00CDF9C8 /* libRCTNetworkImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C572561AA6236500CDF9C8 /* libRCTNetworkImage.a */; }; + 58C5726B1AA6239E00CDF9C8 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C5725B1AA6236500CDF9C8 /* libRCTText.a */; }; + 58C5726C1AA623A200CDF9C8 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C572681AA6236600CDF9C8 /* libReactKit.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 587650FE1A9EB120008B8F17 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 587650F01A9EB120008B8F17 /* RCTDataManager.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B511DB1A9E6C8500147676; - remoteInfo = RCTDataManager; - }; - 587651001A9EB120008B8F17 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 587650F01A9EB120008B8F17 /* RCTDataManager.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B511E61A9E6C8500147676; - remoteInfo = RCTDataManagerTests; - }; - 587651041A9EB120008B8F17 /* PBXContainerItemProxy */ = { + 58C572551AA6236500CDF9C8 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 587650F31A9EB120008B8F17 /* RCTNetworkImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = 58B5115D1A9E6B3D00147676; remoteInfo = RCTNetworkImage; }; - 587651061A9EB120008B8F17 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 587650F31A9EB120008B8F17 /* RCTNetworkImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B511681A9E6B3D00147676; - remoteInfo = RCTNetworkImageTests; - }; - 5876510C1A9EB120008B8F17 /* PBXContainerItemProxy */ = { + 58C5725A1AA6236500CDF9C8 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 587650F61A9EB120008B8F17 /* RCTText.xcodeproj */; proxyType = 2; remoteGlobalIDString = 58B5119B1A9E6C1200147676; remoteInfo = RCTText; }; - 5876510E1A9EB120008B8F17 /* PBXContainerItemProxy */ = { + 58C572621AA6236600CDF9C8 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 587650F61A9EB120008B8F17 /* RCTText.xcodeproj */; + containerPortal = 587650F01A9EB120008B8F17 /* RCTDataManager.xcodeproj */; proxyType = 2; - remoteGlobalIDString = 58B511A61A9E6C1300147676; - remoteInfo = RCTTextTests; + remoteGlobalIDString = 58B511DB1A9E6C8500147676; + remoteInfo = RCTDataManager; }; - 587651111A9EB120008B8F17 /* PBXContainerItemProxy */ = { + 58C572671AA6236600CDF9C8 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 587650F91A9EB120008B8F17 /* ReactKit.xcodeproj */; proxyType = 2; @@ -77,10 +56,10 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 587650F01A9EB120008B8F17 /* RCTDataManager.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTDataManager.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../Network/RCTDataManager.xcodeproj"; sourceTree = ""; }; - 587650F31A9EB120008B8F17 /* RCTNetworkImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetworkImage.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../Image/RCTNetworkImage.xcodeproj"; sourceTree = ""; }; - 587650F61A9EB120008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../Text/RCTText.xcodeproj"; sourceTree = ""; }; - 587650F91A9EB120008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../../ReactKit/ReactKit.xcodeproj"; sourceTree = ""; }; + 587650F01A9EB120008B8F17 /* RCTDataManager.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTDataManager.xcodeproj; path = ../../Libraries/Network/RCTDataManager.xcodeproj; sourceTree = SOURCE_ROOT; }; + 587650F31A9EB120008B8F17 /* RCTNetworkImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetworkImage.xcodeproj; path = ../../Libraries/Image/RCTNetworkImage.xcodeproj; sourceTree = SOURCE_ROOT; }; + 587650F61A9EB120008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = SOURCE_ROOT; }; + 587650F91A9EB120008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -88,10 +67,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 587651131A9EB12E008B8F17 /* libRCTDataManager.a in Frameworks */, - 587651141A9EB12E008B8F17 /* libRCTNetworkImage.a in Frameworks */, - 587651151A9EB12E008B8F17 /* libRCTText.a in Frameworks */, - 587651161A9EB12E008B8F17 /* libReactKit.a in Frameworks */, + 58C572691AA6239800CDF9C8 /* libRCTDataManager.a in Frameworks */, + 58C5726A1AA6239B00CDF9C8 /* libRCTNetworkImage.a in Frameworks */, + 58C5726B1AA6239E00CDF9C8 /* libRCTText.a in Frameworks */, + 58C5726C1AA623A200CDF9C8 /* libReactKit.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -111,41 +90,6 @@ name = Movies; sourceTree = ""; }; - 587650F11A9EB120008B8F17 /* Products */ = { - isa = PBXGroup; - children = ( - 587650FF1A9EB120008B8F17 /* libRCTDataManager.a */, - 587651011A9EB120008B8F17 /* RCTDataManagerTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 587650F41A9EB120008B8F17 /* Products */ = { - isa = PBXGroup; - children = ( - 587651051A9EB120008B8F17 /* libRCTNetworkImage.a */, - 587651071A9EB120008B8F17 /* RCTNetworkImageTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 587650F71A9EB120008B8F17 /* Products */ = { - isa = PBXGroup; - children = ( - 5876510D1A9EB120008B8F17 /* libRCTText.a */, - 5876510F1A9EB120008B8F17 /* RCTTextTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 587650FA1A9EB120008B8F17 /* Products */ = { - isa = PBXGroup; - children = ( - 587651121A9EB120008B8F17 /* libReactKit.a */, - ); - name = Products; - sourceTree = ""; - }; 58C571FC1AA6124500CDF9C8 /* Libraries */ = { isa = PBXGroup; children = ( @@ -157,6 +101,38 @@ name = Libraries; sourceTree = ""; }; + 58C572521AA6236500CDF9C8 /* Products */ = { + isa = PBXGroup; + children = ( + 58C572561AA6236500CDF9C8 /* libRCTNetworkImage.a */, + ); + name = Products; + sourceTree = ""; + }; + 58C572571AA6236500CDF9C8 /* Products */ = { + isa = PBXGroup; + children = ( + 58C5725B1AA6236500CDF9C8 /* libRCTText.a */, + ); + name = Products; + sourceTree = ""; + }; + 58C5725C1AA6236500CDF9C8 /* Products */ = { + isa = PBXGroup; + children = ( + 58C572681AA6236600CDF9C8 /* libReactKit.a */, + ); + name = Products; + sourceTree = ""; + }; + 58C5725E1AA6236500CDF9C8 /* Products */ = { + isa = PBXGroup; + children = ( + 58C572631AA6236600CDF9C8 /* libRCTDataManager.a */, + ); + name = Products; + sourceTree = ""; + }; 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( @@ -216,19 +192,19 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 587650F11A9EB120008B8F17 /* Products */; + ProductGroup = 58C5725E1AA6236500CDF9C8 /* Products */; ProjectRef = 587650F01A9EB120008B8F17 /* RCTDataManager.xcodeproj */; }, { - ProductGroup = 587650F41A9EB120008B8F17 /* Products */; + ProductGroup = 58C572521AA6236500CDF9C8 /* Products */; ProjectRef = 587650F31A9EB120008B8F17 /* RCTNetworkImage.xcodeproj */; }, { - ProductGroup = 587650F71A9EB120008B8F17 /* Products */; + ProductGroup = 58C572571AA6236500CDF9C8 /* Products */; ProjectRef = 587650F61A9EB120008B8F17 /* RCTText.xcodeproj */; }, { - ProductGroup = 587650FA1A9EB120008B8F17 /* Products */; + ProductGroup = 58C5725C1AA6236500CDF9C8 /* Products */; ProjectRef = 587650F91A9EB120008B8F17 /* ReactKit.xcodeproj */; }, ); @@ -240,53 +216,32 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 587650FF1A9EB120008B8F17 /* libRCTDataManager.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTDataManager.a; - remoteRef = 587650FE1A9EB120008B8F17 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 587651011A9EB120008B8F17 /* RCTDataManagerTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = RCTDataManagerTests.xctest; - remoteRef = 587651001A9EB120008B8F17 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 587651051A9EB120008B8F17 /* libRCTNetworkImage.a */ = { + 58C572561AA6236500CDF9C8 /* libRCTNetworkImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libRCTNetworkImage.a; - remoteRef = 587651041A9EB120008B8F17 /* PBXContainerItemProxy */; + remoteRef = 58C572551AA6236500CDF9C8 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 587651071A9EB120008B8F17 /* RCTNetworkImageTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = RCTNetworkImageTests.xctest; - remoteRef = 587651061A9EB120008B8F17 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 5876510D1A9EB120008B8F17 /* libRCTText.a */ = { + 58C5725B1AA6236500CDF9C8 /* libRCTText.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libRCTText.a; - remoteRef = 5876510C1A9EB120008B8F17 /* PBXContainerItemProxy */; + remoteRef = 58C5725A1AA6236500CDF9C8 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 5876510F1A9EB120008B8F17 /* RCTTextTests.xctest */ = { + 58C572631AA6236600CDF9C8 /* libRCTDataManager.a */ = { isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = RCTTextTests.xctest; - remoteRef = 5876510E1A9EB120008B8F17 /* PBXContainerItemProxy */; + fileType = archive.ar; + path = libRCTDataManager.a; + remoteRef = 58C572621AA6236600CDF9C8 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 587651121A9EB120008B8F17 /* libReactKit.a */ = { + 58C572681AA6236600CDF9C8 /* libReactKit.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libReactKit.a; - remoteRef = 587651111A9EB120008B8F17 /* PBXContainerItemProxy */; + remoteRef = 58C572671AA6236600CDF9C8 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -338,6 +293,9 @@ ); INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = Movies; }; @@ -354,6 +312,9 @@ ); INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = Movies; }; diff --git a/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj b/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj index 22d1b4e04..4d0d681de 100644 --- a/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj +++ b/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj @@ -11,33 +11,12 @@ 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 587650E91A9EB103008B8F17 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587650E01A9EB0DB008B8F17 /* libRCTText.a */; }; - 587650EA1A9EB103008B8F17 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587650E81A9EB0E0008B8F17 /* libReactKit.a */; }; 58C571F31AA611C900CDF9C8 /* libRCTNetworkImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C571ED1AA611BA00CDF9C8 /* libRCTNetworkImage.a */; }; + 58C572501AA6229900CDF9C8 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C572471AA6224300CDF9C8 /* libReactKit.a */; }; + 58C572511AA6229D00CDF9C8 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C5724D1AA6224400CDF9C8 /* libRCTText.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 587650DF1A9EB0DB008B8F17 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B5119B1A9E6C1200147676; - remoteInfo = RCTText; - }; - 587650E11A9EB0DB008B8F17 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B511A61A9E6C1300147676; - remoteInfo = RCTTextTests; - }; - 587650E71A9EB0E0008B8F17 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; - remoteInfo = ReactKit; - }; 58C571EC1AA611BA00CDF9C8 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 58C571E71AA611BA00CDF9C8 /* RCTNetworkImage.xcodeproj */; @@ -52,6 +31,27 @@ remoteGlobalIDString = 58B511681A9E6B3D00147676; remoteInfo = RCTNetworkImageTests; }; + 58C572461AA6224300CDF9C8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; + remoteInfo = ReactKit; + }; + 58C5724C1AA6224400CDF9C8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B5119B1A9E6C1200147676; + remoteInfo = RCTText; + }; + 58C5724E1AA6224400CDF9C8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511A61A9E6C1300147676; + remoteInfo = RCTTextTests; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -62,8 +62,8 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../Text/RCTText.xcodeproj"; sourceTree = ""; }; - 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../../ReactKit/ReactKit.xcodeproj"; sourceTree = ""; }; + 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; + 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = ""; }; 58C571E71AA611BA00CDF9C8 /* RCTNetworkImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetworkImage.xcodeproj; path = ../../Libraries/Image/RCTNetworkImage.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ @@ -73,8 +73,8 @@ buildActionMask = 2147483647; files = ( 58C571F31AA611C900CDF9C8 /* libRCTNetworkImage.a in Frameworks */, - 587650E91A9EB103008B8F17 /* libRCTText.a in Frameworks */, - 587650EA1A9EB103008B8F17 /* libReactKit.a in Frameworks */, + 58C572501AA6229900CDF9C8 /* libReactKit.a in Frameworks */, + 58C572511AA6229D00CDF9C8 /* libRCTText.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -94,23 +94,6 @@ name = TicTacToe; sourceTree = ""; }; - 587650DB1A9EB0DB008B8F17 /* Products */ = { - isa = PBXGroup; - children = ( - 587650E01A9EB0DB008B8F17 /* libRCTText.a */, - 587650E21A9EB0DB008B8F17 /* RCTTextTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 587650E41A9EB0DF008B8F17 /* Products */ = { - isa = PBXGroup; - children = ( - 587650E81A9EB0E0008B8F17 /* libReactKit.a */, - ); - name = Products; - sourceTree = ""; - }; 58C571E81AA611BA00CDF9C8 /* Products */ = { isa = PBXGroup; children = ( @@ -130,6 +113,23 @@ name = Libraries; sourceTree = ""; }; + 58C572411AA6224300CDF9C8 /* Products */ = { + isa = PBXGroup; + children = ( + 58C572471AA6224300CDF9C8 /* libReactKit.a */, + ); + name = Products; + sourceTree = ""; + }; + 58C572481AA6224300CDF9C8 /* Products */ = { + isa = PBXGroup; + children = ( + 58C5724D1AA6224400CDF9C8 /* libRCTText.a */, + 58C5724F1AA6224400CDF9C8 /* RCTTextTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( @@ -193,11 +193,11 @@ ProjectRef = 58C571E71AA611BA00CDF9C8 /* RCTNetworkImage.xcodeproj */; }, { - ProductGroup = 587650DB1A9EB0DB008B8F17 /* Products */; + ProductGroup = 58C572481AA6224300CDF9C8 /* Products */; ProjectRef = 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */; }, { - ProductGroup = 587650E41A9EB0DF008B8F17 /* Products */; + ProductGroup = 58C572411AA6224300CDF9C8 /* Products */; ProjectRef = 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */; }, ); @@ -209,27 +209,6 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 587650E01A9EB0DB008B8F17 /* libRCTText.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTText.a; - remoteRef = 587650DF1A9EB0DB008B8F17 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 587650E21A9EB0DB008B8F17 /* RCTTextTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = RCTTextTests.xctest; - remoteRef = 587650E11A9EB0DB008B8F17 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 587650E81A9EB0E0008B8F17 /* libReactKit.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libReactKit.a; - remoteRef = 587650E71A9EB0E0008B8F17 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 58C571ED1AA611BA00CDF9C8 /* libRCTNetworkImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -244,6 +223,27 @@ remoteRef = 58C571EE1AA611BA00CDF9C8 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 58C572471AA6224300CDF9C8 /* libReactKit.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libReactKit.a; + remoteRef = 58C572461AA6224300CDF9C8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 58C5724D1AA6224400CDF9C8 /* libRCTText.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTText.a; + remoteRef = 58C5724C1AA6224400CDF9C8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 58C5724F1AA6224400CDF9C8 /* RCTTextTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = RCTTextTests.xctest; + remoteRef = 58C5724E1AA6224400CDF9C8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -288,6 +288,9 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = TicTacToe; }; @@ -299,6 +302,9 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = TicTacToe; }; diff --git a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj index 493310f0c..daa467234 100644 --- a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj +++ b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj @@ -14,7 +14,7 @@ 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 587651571A9F862F008B8F17 /* libRCTDataManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5876514F1A9F8619008B8F17 /* libRCTDataManager.a */; }; + 58C572891AA624A900CDF9C8 /* libRCTDataManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C572851AA6249E00CDF9C8 /* libRCTDataManager.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -25,13 +25,6 @@ remoteGlobalIDString = 58B5119B1A9E6C1200147676; remoteInfo = RCTText; }; - 1316A2091AA386C700C0188E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B511A61A9E6C1300147676; - remoteInfo = RCTTextTests; - }; 1316A20F1AA3871A00C0188E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */; @@ -39,13 +32,6 @@ remoteGlobalIDString = 58B5115D1A9E6B3D00147676; remoteInfo = RCTNetworkImage; }; - 1316A2111AA3871A00C0188E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B511681A9E6B3D00147676; - remoteInfo = RCTNetworkImageTests; - }; 1316A2161AA3875D00C0188E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 587651221A9EB168008B8F17 /* ReactKit.xcodeproj */; @@ -53,20 +39,13 @@ remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; remoteInfo = ReactKit; }; - 5876514E1A9F8619008B8F17 /* PBXContainerItemProxy */ = { + 58C572841AA6249E00CDF9C8 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */; proxyType = 2; remoteGlobalIDString = 58B511DB1A9E6C8500147676; remoteInfo = RCTDataManager; }; - 587651501A9F8619008B8F17 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B511E61A9E6C8500147676; - remoteInfo = RCTDataManagerTests; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -80,7 +59,7 @@ 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetworkImage.xcodeproj; path = ../../Libraries/Image/RCTNetworkImage.xcodeproj; sourceTree = SOURCE_ROOT; }; 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = SOURCE_ROOT; }; 587651221A9EB168008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = SOURCE_ROOT; }; - 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTDataManager.xcodeproj; path = ../../Libraries/Network/RCTDataManager.xcodeproj; sourceTree = ""; }; + 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTDataManager.xcodeproj; path = ../../Libraries/Network/RCTDataManager.xcodeproj; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -90,8 +69,8 @@ files = ( 1316A21A1AA397CA00C0188E /* libRCTNetworkImage.a in Frameworks */, 1316A21B1AA397CA00C0188E /* libRCTText.a in Frameworks */, + 58C572891AA624A900CDF9C8 /* libRCTDataManager.a in Frameworks */, 1316A21C1AA397CA00C0188E /* libReactKit.a in Frameworks */, - 587651571A9F862F008B8F17 /* libRCTDataManager.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -102,7 +81,6 @@ isa = PBXGroup; children = ( 1316A2081AA386C700C0188E /* libRCTText.a */, - 1316A20A1AA386C700C0188E /* RCTTextTests.xctest */, ); name = Products; sourceTree = ""; @@ -111,7 +89,6 @@ isa = PBXGroup; children = ( 1316A2101AA3871A00C0188E /* libRCTNetworkImage.a */, - 1316A2121AA3871A00C0188E /* RCTNetworkImageTests.xctest */, ); name = Products; sourceTree = ""; @@ -148,11 +125,10 @@ name = UIExplorer; sourceTree = ""; }; - 5876514A1A9F8619008B8F17 /* Products */ = { + 58C572811AA6249E00CDF9C8 /* Products */ = { isa = PBXGroup; children = ( - 5876514F1A9F8619008B8F17 /* libRCTDataManager.a */, - 587651511A9F8619008B8F17 /* RCTDataManagerTests.xctest */, + 58C572851AA6249E00CDF9C8 /* libRCTDataManager.a */, ); name = Products; sourceTree = ""; @@ -216,7 +192,7 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 5876514A1A9F8619008B8F17 /* Products */; + ProductGroup = 58C572811AA6249E00CDF9C8 /* Products */; ProjectRef = 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */; }, { @@ -247,13 +223,6 @@ remoteRef = 1316A2071AA386C700C0188E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1316A20A1AA386C700C0188E /* RCTTextTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = RCTTextTests.xctest; - remoteRef = 1316A2091AA386C700C0188E /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 1316A2101AA3871A00C0188E /* libRCTNetworkImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -261,13 +230,6 @@ remoteRef = 1316A20F1AA3871A00C0188E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1316A2121AA3871A00C0188E /* RCTNetworkImageTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = RCTNetworkImageTests.xctest; - remoteRef = 1316A2111AA3871A00C0188E /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 1316A2171AA3875D00C0188E /* libReactKit.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -275,18 +237,11 @@ remoteRef = 1316A2161AA3875D00C0188E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 5876514F1A9F8619008B8F17 /* libRCTDataManager.a */ = { + 58C572851AA6249E00CDF9C8 /* libRCTDataManager.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libRCTDataManager.a; - remoteRef = 5876514E1A9F8619008B8F17 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 587651511A9F8619008B8F17 /* RCTDataManagerTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = RCTDataManagerTests.xctest; - remoteRef = 587651501A9F8619008B8F17 /* PBXContainerItemProxy */; + remoteRef = 58C572841AA6249E00CDF9C8 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -335,10 +290,12 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../ReactKit/**", - "$(SRCROOT)/../../ReactKitModules/**", ); INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = UIExplorer; }; @@ -352,10 +309,12 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../ReactKit/**", - "$(SRCROOT)/../../ReactKitModules/**", ); INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = UIExplorer; }; diff --git a/Libraries/Image/RCTNetworkImage.xcodeproj/project.pbxproj b/Libraries/Image/RCTNetworkImage.xcodeproj/project.pbxproj index 0dc8304fa..57b27a3c1 100644 --- a/Libraries/Image/RCTNetworkImage.xcodeproj/project.pbxproj +++ b/Libraries/Image/RCTNetworkImage.xcodeproj/project.pbxproj @@ -7,22 +7,11 @@ objects = { /* Begin PBXBuildFile section */ - 58B511691A9E6B3D00147676 /* libRCTNetworkImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58B5115D1A9E6B3D00147676 /* libRCTNetworkImage.a */; }; 58B5118F1A9E6BD600147676 /* RCTImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B5118A1A9E6BD600147676 /* RCTImageDownloader.m */; }; 58B511901A9E6BD600147676 /* RCTNetworkImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B5118C1A9E6BD600147676 /* RCTNetworkImageView.m */; }; 58B511911A9E6BD600147676 /* RCTNetworkImageViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B5118E1A9E6BD600147676 /* RCTNetworkImageViewManager.m */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 58B5116A1A9E6B3D00147676 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 58B511551A9E6B3D00147676 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 58B5115C1A9E6B3D00147676; - remoteInfo = RCTNetworkImage; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXCopyFilesBuildPhase section */ 58B5115B1A9E6B3D00147676 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; @@ -37,7 +26,6 @@ /* Begin PBXFileReference section */ 58B5115D1A9E6B3D00147676 /* libRCTNetworkImage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTNetworkImage.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 58B511681A9E6B3D00147676 /* RCTNetworkImageTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RCTNetworkImageTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 58B511891A9E6BD600147676 /* RCTImageDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageDownloader.h; sourceTree = ""; }; 58B5118A1A9E6BD600147676 /* RCTImageDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageDownloader.m; sourceTree = ""; }; 58B5118B1A9E6BD600147676 /* RCTNetworkImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNetworkImageView.h; sourceTree = ""; }; @@ -54,14 +42,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 58B511651A9E6B3D00147676 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 58B511691A9E6B3D00147676 /* libRCTNetworkImage.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -82,7 +62,6 @@ isa = PBXGroup; children = ( 58B5115D1A9E6B3D00147676 /* libRCTNetworkImage.a */, - 58B511681A9E6B3D00147676 /* RCTNetworkImageTests.xctest */, ); name = Products; sourceTree = ""; @@ -107,24 +86,6 @@ productReference = 58B5115D1A9E6B3D00147676 /* libRCTNetworkImage.a */; productType = "com.apple.product-type.library.static"; }; - 58B511671A9E6B3D00147676 /* RCTNetworkImageTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 58B511741A9E6B3D00147676 /* Build configuration list for PBXNativeTarget "RCTNetworkImageTests" */; - buildPhases = ( - 58B511641A9E6B3D00147676 /* Sources */, - 58B511651A9E6B3D00147676 /* Frameworks */, - 58B511661A9E6B3D00147676 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 58B5116B1A9E6B3D00147676 /* PBXTargetDependency */, - ); - name = RCTNetworkImageTests; - productName = RCTNetworkImageTests; - productReference = 58B511681A9E6B3D00147676 /* RCTNetworkImageTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -137,9 +98,6 @@ 58B5115C1A9E6B3D00147676 = { CreatedOnToolsVersion = 6.1.1; }; - 58B511671A9E6B3D00147676 = { - CreatedOnToolsVersion = 6.1.1; - }; }; }; buildConfigurationList = 58B511581A9E6B3D00147676 /* Build configuration list for PBXProject "RCTNetworkImage" */; @@ -155,21 +113,10 @@ projectRoot = ""; targets = ( 58B5115C1A9E6B3D00147676 /* RCTNetworkImage */, - 58B511671A9E6B3D00147676 /* RCTNetworkImageTests */, ); }; /* End PBXProject section */ -/* Begin PBXResourcesBuildPhase section */ - 58B511661A9E6B3D00147676 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 58B511591A9E6B3D00147676 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -181,23 +128,8 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 58B511641A9E6B3D00147676 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 58B5116B1A9E6B3D00147676 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 58B5115C1A9E6B3D00147676 /* RCTNetworkImage */; - targetProxy = 58B5116A1A9E6B3D00147676 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin XCBuildConfiguration section */ 58B5116F1A9E6B3D00147676 /* Debug */ = { isa = XCBuildConfiguration; @@ -301,36 +233,6 @@ }; name = Release; }; - 58B511751A9E6B3D00147676 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = RCTNetworkImageTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 58B511761A9E6B3D00147676 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - INFOPLIST_FILE = RCTNetworkImageTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -352,15 +254,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 58B511741A9E6B3D00147676 /* Build configuration list for PBXNativeTarget "RCTNetworkImageTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 58B511751A9E6B3D00147676 /* Debug */, - 58B511761A9E6B3D00147676 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ }; rootObject = 58B511551A9E6B3D00147676 /* Project object */; diff --git a/Libraries/Network/RCTDataManager.xcodeproj/project.pbxproj b/Libraries/Network/RCTDataManager.xcodeproj/project.pbxproj index 328a3d60c..81b90312a 100644 --- a/Libraries/Network/RCTDataManager.xcodeproj/project.pbxproj +++ b/Libraries/Network/RCTDataManager.xcodeproj/project.pbxproj @@ -7,20 +7,9 @@ objects = { /* Begin PBXBuildFile section */ - 58B511E71A9E6C8500147676 /* libRCTDataManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58B511DB1A9E6C8500147676 /* libRCTDataManager.a */; }; 58B512081A9E6CE300147676 /* RCTDataManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B512071A9E6CE300147676 /* RCTDataManager.m */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 58B511E81A9E6C8500147676 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 58B511D31A9E6C8500147676 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 58B511DA1A9E6C8500147676; - remoteInfo = RCTDataManager; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXCopyFilesBuildPhase section */ 58B511D91A9E6C8500147676 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; @@ -35,7 +24,6 @@ /* Begin PBXFileReference section */ 58B511DB1A9E6C8500147676 /* libRCTDataManager.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTDataManager.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 58B511E61A9E6C8500147676 /* RCTDataManagerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RCTDataManagerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 58B512061A9E6CE300147676 /* RCTDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDataManager.h; sourceTree = ""; }; 58B512071A9E6CE300147676 /* RCTDataManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDataManager.m; sourceTree = ""; }; /* End PBXFileReference section */ @@ -48,14 +36,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 58B511E31A9E6C8500147676 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 58B511E71A9E6C8500147676 /* libRCTDataManager.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -72,7 +52,6 @@ isa = PBXGroup; children = ( 58B511DB1A9E6C8500147676 /* libRCTDataManager.a */, - 58B511E61A9E6C8500147676 /* RCTDataManagerTests.xctest */, ); name = Products; sourceTree = ""; @@ -97,24 +76,6 @@ productReference = 58B511DB1A9E6C8500147676 /* libRCTDataManager.a */; productType = "com.apple.product-type.library.static"; }; - 58B511E51A9E6C8500147676 /* RCTDataManagerTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 58B511F21A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTDataManagerTests" */; - buildPhases = ( - 58B511E21A9E6C8500147676 /* Sources */, - 58B511E31A9E6C8500147676 /* Frameworks */, - 58B511E41A9E6C8500147676 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 58B511E91A9E6C8500147676 /* PBXTargetDependency */, - ); - name = RCTDataManagerTests; - productName = RCTDataManagerTests; - productReference = 58B511E61A9E6C8500147676 /* RCTDataManagerTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -127,9 +88,6 @@ 58B511DA1A9E6C8500147676 = { CreatedOnToolsVersion = 6.1.1; }; - 58B511E51A9E6C8500147676 = { - CreatedOnToolsVersion = 6.1.1; - }; }; }; buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTDataManager" */; @@ -145,21 +103,10 @@ projectRoot = ""; targets = ( 58B511DA1A9E6C8500147676 /* RCTDataManager */, - 58B511E51A9E6C8500147676 /* RCTDataManagerTests */, ); }; /* End PBXProject section */ -/* Begin PBXResourcesBuildPhase section */ - 58B511E41A9E6C8500147676 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 58B511D71A9E6C8500147676 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -169,23 +116,8 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 58B511E21A9E6C8500147676 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 58B511E91A9E6C8500147676 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 58B511DA1A9E6C8500147676 /* RCTDataManager */; - targetProxy = 58B511E81A9E6C8500147676 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin XCBuildConfiguration section */ 58B511ED1A9E6C8500147676 /* Debug */ = { isa = XCBuildConfiguration; @@ -297,36 +229,6 @@ }; name = Release; }; - 58B511F31A9E6C8500147676 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = RCTDataManagerTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 58B511F41A9E6C8500147676 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - INFOPLIST_FILE = RCTDataManagerTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -348,15 +250,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 58B511F21A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTDataManagerTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 58B511F31A9E6C8500147676 /* Debug */, - 58B511F41A9E6C8500147676 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ }; rootObject = 58B511D31A9E6C8500147676 /* Project object */; diff --git a/Libraries/Text/RCTText.xcodeproj/project.pbxproj b/Libraries/Text/RCTText.xcodeproj/project.pbxproj index e6e7b4aad..240d7c51b 100644 --- a/Libraries/Text/RCTText.xcodeproj/project.pbxproj +++ b/Libraries/Text/RCTText.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 58B511A71A9E6C1300147676 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58B5119B1A9E6C1200147676 /* libRCTText.a */; }; 58B511CE1A9E6C5C00147676 /* RCTRawTextManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B511C71A9E6C5C00147676 /* RCTRawTextManager.m */; }; 58B511CF1A9E6C5C00147676 /* RCTShadowRawText.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B511C91A9E6C5C00147676 /* RCTShadowRawText.m */; }; 58B511D01A9E6C5C00147676 /* RCTShadowText.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B511CB1A9E6C5C00147676 /* RCTShadowText.m */; }; @@ -15,16 +14,6 @@ 58B512161A9E6EFF00147676 /* RCTText.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B512141A9E6EFF00147676 /* RCTText.m */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 58B511A81A9E6C1300147676 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 58B511931A9E6C1200147676 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 58B5119A1A9E6C1200147676; - remoteInfo = RCTText; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXCopyFilesBuildPhase section */ 58B511991A9E6C1200147676 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; @@ -39,7 +28,6 @@ /* Begin PBXFileReference section */ 58B5119B1A9E6C1200147676 /* libRCTText.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTText.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 58B511A61A9E6C1300147676 /* RCTTextTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RCTTextTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 58B511C61A9E6C5C00147676 /* RCTRawTextManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRawTextManager.h; sourceTree = ""; }; 58B511C71A9E6C5C00147676 /* RCTRawTextManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRawTextManager.m; sourceTree = ""; }; 58B511C81A9E6C5C00147676 /* RCTShadowRawText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTShadowRawText.h; sourceTree = ""; }; @@ -60,14 +48,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 58B511A31A9E6C1300147676 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 58B511A71A9E6C1300147676 /* libRCTText.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -92,7 +72,6 @@ isa = PBXGroup; children = ( 58B5119B1A9E6C1200147676 /* libRCTText.a */, - 58B511A61A9E6C1300147676 /* RCTTextTests.xctest */, ); name = Products; sourceTree = ""; @@ -117,24 +96,6 @@ productReference = 58B5119B1A9E6C1200147676 /* libRCTText.a */; productType = "com.apple.product-type.library.static"; }; - 58B511A51A9E6C1300147676 /* RCTTextTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 58B511B21A9E6C1300147676 /* Build configuration list for PBXNativeTarget "RCTTextTests" */; - buildPhases = ( - 58B511A21A9E6C1300147676 /* Sources */, - 58B511A31A9E6C1300147676 /* Frameworks */, - 58B511A41A9E6C1300147676 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 58B511A91A9E6C1300147676 /* PBXTargetDependency */, - ); - name = RCTTextTests; - productName = RCTTextTests; - productReference = 58B511A61A9E6C1300147676 /* RCTTextTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -147,9 +108,6 @@ 58B5119A1A9E6C1200147676 = { CreatedOnToolsVersion = 6.1.1; }; - 58B511A51A9E6C1300147676 = { - CreatedOnToolsVersion = 6.1.1; - }; }; }; buildConfigurationList = 58B511961A9E6C1200147676 /* Build configuration list for PBXProject "RCTText" */; @@ -165,21 +123,10 @@ projectRoot = ""; targets = ( 58B5119A1A9E6C1200147676 /* RCTText */, - 58B511A51A9E6C1300147676 /* RCTTextTests */, ); }; /* End PBXProject section */ -/* Begin PBXResourcesBuildPhase section */ - 58B511A41A9E6C1300147676 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 58B511971A9E6C1200147676 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -193,23 +140,8 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 58B511A21A9E6C1300147676 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 58B511A91A9E6C1300147676 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 58B5119A1A9E6C1200147676 /* RCTText */; - targetProxy = 58B511A81A9E6C1300147676 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin XCBuildConfiguration section */ 58B511AD1A9E6C1300147676 /* Debug */ = { isa = XCBuildConfiguration; @@ -313,36 +245,6 @@ }; name = Release; }; - 58B511B31A9E6C1300147676 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = RCTTextTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 58B511B41A9E6C1300147676 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - INFOPLIST_FILE = RCTTextTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -364,15 +266,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 58B511B21A9E6C1300147676 /* Build configuration list for PBXNativeTarget "RCTTextTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 58B511B31A9E6C1300147676 /* Debug */, - 58B511B41A9E6C1300147676 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ }; rootObject = 58B511931A9E6C1200147676 /* Project object */; From 7b0cd86759587860e6206020fe50bed9faf803af Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Wed, 4 Mar 2015 08:05:38 -0800 Subject: [PATCH 10/79] Updates from Wed Mar 4 - [ReactNative] modernize DatePicker | Spencer Ahrens - React Native: Force !ExecutionEnvironment.canUseDOM | Tim Yung - [react-packager] Recover and warn from corrupted cache file | Amjad Masad - [ReactNative] Github repo's gitignore is written at export | Amjad Masad - [ReactNative] Use strings instead of constants for keyboardDismissMode | Christopher Chedeau --- .../contents.xcworkspacedata | 7 - Examples/Movies/SearchScreen.js | 2 +- Examples/TicTacToe/AppDelegate.m.orig | 44 -- .../TicTacToe.xcodeproj/project.pbxproj.orig | 407 ------------------ .../contents.xcworkspacedata | 7 - Examples/UIExplorer/UIExplorerPage.js | 3 +- .../Components/ScrollView/ScrollView.ios.js | 35 +- .../InitializeJavaScriptAppEngine.js | 80 ++-- ReactKit/Base/RCTConvert.m | 9 +- .../react-packager/src/JSTransformer/Cache.js | 16 +- 10 files changed, 83 insertions(+), 527 deletions(-) delete mode 100644 Examples/Movies/Movies.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 Examples/TicTacToe/AppDelegate.m.orig delete mode 100644 Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj.orig delete mode 100644 Examples/TicTacToe/TicTacToe.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Examples/Movies/Movies.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/Movies/Movies.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 3071f8f00..000000000 --- a/Examples/Movies/Movies.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Examples/Movies/SearchScreen.js b/Examples/Movies/SearchScreen.js index 2aa3f1ea8..ea58deefb 100644 --- a/Examples/Movies/SearchScreen.js +++ b/Examples/Movies/SearchScreen.js @@ -239,7 +239,7 @@ var SearchScreen = React.createClass({ renderRow={this.renderRow} onEndReached={this.onEndReached} automaticallyAdjustContentInsets={false} - keyboardDismissMode={ScrollView.keyboardDismissMode.OnDrag} + keyboardDismissMode="onDrag" keyboardShouldPersistTaps={true} showsVerticalScrollIndicator={false} />; diff --git a/Examples/TicTacToe/AppDelegate.m.orig b/Examples/TicTacToe/AppDelegate.m.orig deleted file mode 100644 index 52e682752..000000000 --- a/Examples/TicTacToe/AppDelegate.m.orig +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "AppDelegate.h" - -#import "RCTRootView.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - NSURL *jsCodeLocation; - RCTRootView *rootView = [[RCTRootView alloc] init]; - - // Loading JavaScript code - uncomment the one you want. - - // OPTION 1 - // Load from development server. Start the server from the repository root: - // - // $ npm start - // - // To run on device, change `localhost` to the IP address of your computer, and make sure your computer and - // iOS device are on the same Wi-Fi network. - jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/TicTacToe/TicTacToeApp.includeRequire.runModule.bundle"]; - - // OPTION 2 - // Load from pre-bundled file on disk. To re-generate the static bundle, run - // - // $ curl http://localhost:8081/Examples/TicTacToe/TicTacToeApp.includeRequire.runModule.bundle -o main.jsbundle - // - // and uncomment the next following line - // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; - - rootView.scriptURL = jsCodeLocation; - rootView.moduleName = @"TicTacToeApp"; - - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - UIViewController *rootViewController = [[UIViewController alloc] init]; - rootViewController.view = rootView; - self.window.rootViewController = rootViewController; - [self.window makeKeyAndVisible]; - return YES; -} - -@end diff --git a/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj.orig b/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj.orig deleted file mode 100644 index 7389d492a..000000000 --- a/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj.orig +++ /dev/null @@ -1,407 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; - 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; - 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; - 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 587650E91A9EB103008B8F17 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587650E01A9EB0DB008B8F17 /* libRCTText.a */; }; - 587650EA1A9EB103008B8F17 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 587650E81A9EB0E0008B8F17 /* libReactKit.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 587650DF1A9EB0DB008B8F17 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B5119B1A9E6C1200147676; - remoteInfo = RCTText; - }; - 587650E11A9EB0DB008B8F17 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B511A61A9E6C1300147676; - remoteInfo = RCTTextTests; - }; - 587650E71A9EB0E0008B8F17 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; - remoteInfo = ReactKit; - }; - 58C571DE1AA6119300CDF9C8 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 58C571D91AA6119300CDF9C8 /* RCTNetworkImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B5115D1A9E6B3D00147676; - remoteInfo = RCTNetworkImage; - }; - 58C571E01AA6119300CDF9C8 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 58C571D91AA6119300CDF9C8 /* RCTNetworkImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B511681A9E6B3D00147676; - remoteInfo = RCTNetworkImageTests; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 13B07F961A680F5B00A75B9A /* TicTacToe.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TicTacToe.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../Text/RCTText.xcodeproj"; sourceTree = ""; }; - 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/RCTStandardLibrary/../../ReactKit/ReactKit.xcodeproj"; sourceTree = ""; }; - 58C571D91AA6119300CDF9C8 /* RCTNetworkImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetworkImage.xcodeproj; path = "/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/Text/../Image/RCTNetworkImage.xcodeproj"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 587650E91A9EB103008B8F17 /* libRCTText.a in Frameworks */, - 587650EA1A9EB103008B8F17 /* libReactKit.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 13B07FAE1A68108700A75B9A /* TicTacToe */ = { - isa = PBXGroup; - children = ( - 13B07FAF1A68108700A75B9A /* AppDelegate.h */, - 13B07FB01A68108700A75B9A /* AppDelegate.m */, - 13B07FB51A68108700A75B9A /* Images.xcassets */, - 13B07FB61A68108700A75B9A /* Info.plist */, - 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, - 13B07FB71A68108700A75B9A /* main.m */, - ); - name = TicTacToe; - sourceTree = ""; - }; - 587650DB1A9EB0DB008B8F17 /* Products */ = { - isa = PBXGroup; - children = ( - 587650E01A9EB0DB008B8F17 /* libRCTText.a */, - 587650E21A9EB0DB008B8F17 /* RCTTextTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 587650E41A9EB0DF008B8F17 /* Products */ = { - isa = PBXGroup; - children = ( - 587650E81A9EB0E0008B8F17 /* libReactKit.a */, - ); - name = Products; - sourceTree = ""; - }; - 58C571DA1AA6119300CDF9C8 /* Products */ = { - isa = PBXGroup; - children = ( - 58C571DF1AA6119300CDF9C8 /* libRCTNetworkImage.a */, - 58C571E11AA6119300CDF9C8 /* RCTNetworkImageTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 83CBB9F61A601CBA00E9B192 = { - isa = PBXGroup; - children = ( - 13B07FAE1A68108700A75B9A /* TicTacToe */, - 58C571D91AA6119300CDF9C8 /* RCTNetworkImage.xcodeproj */, - 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */, - 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */, - 83CBBA001A601CBA00E9B192 /* Products */, - ); - sourceTree = ""; - }; - 83CBBA001A601CBA00E9B192 /* Products */ = { - isa = PBXGroup; - children = ( - 13B07F961A680F5B00A75B9A /* TicTacToe.app */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 13B07F861A680F5B00A75B9A /* TicTacToe */ = { - isa = PBXNativeTarget; - buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "TicTacToe" */; - buildPhases = ( - 13B07F871A680F5B00A75B9A /* Sources */, - 13B07F8C1A680F5B00A75B9A /* Frameworks */, - 13B07F8E1A680F5B00A75B9A /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = TicTacToe; - productName = "Hello World"; - productReference = 13B07F961A680F5B00A75B9A /* TicTacToe.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 83CBB9F71A601CBA00E9B192 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0610; - ORGANIZATIONNAME = Facebook; - }; - buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "TicTacToe" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 83CBB9F61A601CBA00E9B192; - productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 58C571DA1AA6119300CDF9C8 /* Products */; - ProjectRef = 58C571D91AA6119300CDF9C8 /* RCTNetworkImage.xcodeproj */; - }, - { - ProductGroup = 587650DB1A9EB0DB008B8F17 /* Products */; - ProjectRef = 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */; - }, - { - ProductGroup = 587650E41A9EB0DF008B8F17 /* Products */; - ProjectRef = 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 13B07F861A680F5B00A75B9A /* TicTacToe */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 587650E01A9EB0DB008B8F17 /* libRCTText.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTText.a; - remoteRef = 587650DF1A9EB0DB008B8F17 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 587650E21A9EB0DB008B8F17 /* RCTTextTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = RCTTextTests.xctest; - remoteRef = 587650E11A9EB0DB008B8F17 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 587650E81A9EB0E0008B8F17 /* libReactKit.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libReactKit.a; - remoteRef = 587650E71A9EB0E0008B8F17 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 58C571DF1AA6119300CDF9C8 /* libRCTNetworkImage.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTNetworkImage.a; - remoteRef = 58C571DE1AA6119300CDF9C8 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 58C571E11AA6119300CDF9C8 /* RCTNetworkImageTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = RCTNetworkImageTests.xctest; - remoteRef = 58C571E01AA6119300CDF9C8 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 13B07F8E1A680F5B00A75B9A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, - 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 13B07F871A680F5B00A75B9A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, - 13B07FC11A68108700A75B9A /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { - isa = PBXVariantGroup; - children = ( - 13B07FB21A68108700A75B9A /* Base */, - ); - name = LaunchScreen.xib; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 13B07F941A680F5B00A75B9A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = TicTacToe; - }; - name = Debug; - }; - 13B07F951A680F5B00A75B9A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = TicTacToe; - }; - name = Release; - }; - 83CBBA201A601CBA00E9B192 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(SRCROOT)/../../ReactKit/**", - ); - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 83CBBA211A601CBA00E9B192 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(SRCROOT)/../../ReactKit/**", - ); - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "TicTacToe" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 13B07F941A680F5B00A75B9A /* Debug */, - 13B07F951A680F5B00A75B9A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "TicTacToe" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 83CBBA201A601CBA00E9B192 /* Debug */, - 83CBBA211A601CBA00E9B192 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; -} diff --git a/Examples/TicTacToe/TicTacToe.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/TicTacToe/TicTacToe.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index e5f301dcc..000000000 --- a/Examples/TicTacToe/TicTacToe.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Examples/UIExplorer/UIExplorerPage.js b/Examples/UIExplorer/UIExplorerPage.js index 2d72f62c7..5d619dcec 100644 --- a/Examples/UIExplorer/UIExplorerPage.js +++ b/Examples/UIExplorer/UIExplorerPage.js @@ -30,8 +30,7 @@ var UIExplorerPage = React.createClass({ } else { ContentWrapper = ScrollView; wrapperProps.keyboardShouldPeristTaps = true; - wrapperProps.keyboardDismissMode = - ScrollView.keyboardDismissMode.Interactive; + wrapperProps.keyboardDismissMode = 'interactive'; } var title = this.props.title ? : diff --git a/Libraries/Components/ScrollView/ScrollView.ios.js b/Libraries/Components/ScrollView/ScrollView.ios.js index 3e425162a..317b98686 100644 --- a/Libraries/Components/ScrollView/ScrollView.ios.js +++ b/Libraries/Components/ScrollView/ScrollView.ios.js @@ -31,6 +31,12 @@ var PropTypes = React.PropTypes; var SCROLLVIEW = 'ScrollView'; var INNERVIEW = 'InnerScrollView'; +var keyboardDismissModeConstants = { + 'none': RKScrollViewConsts.KeyboardDismissMode.None, // default + 'interactive': RKScrollViewConsts.KeyboardDismissMode.Interactive, + 'onDrag': RKScrollViewConsts.KeyboardDismissMode.OnDrag, +}; + /** * `React` component that wraps platform `RKScrollView` while providing * integration with touch locking "responder" system. @@ -80,8 +86,8 @@ var INNERVIEW = 'InnerScrollView'; /** * A floating-point number that determines how quickly the scroll view * decelerates after the user lifts their finger. Reasonable choices include - * `RKScrollView.Constants.DecelerationRate.Normal` (the default) and - * `RKScrollView.Constants.DecelerationRate.Fast`. + * - Normal: 0.998 (the default) + * - Fast: 0.9 */ decelerationRate: nativePropType(PropTypes.number), /** @@ -91,18 +97,17 @@ var INNERVIEW = 'InnerScrollView'; horizontal: PropTypes.bool, /** * Determines whether the keyboard gets dismissed in response to a drag. - * When `ScrollView.keyboardDismissMode.None` (the default), drags do not - * dismiss the keyboard. When `ScrollView.keyboardDismissMode.OnDrag`, the - * keyboard is dismissed when a drag begins. When - * `ScrollView.keyboardDismissMode.Interactive`, the keyboard is dismissed - * interactively with the drag and moves in synchrony with the touch; - * dragging upwards cancels the dismissal. + * - 'none' (the default), drags do not dismiss the keyboard. + * - 'onDrag', the keyboard is dismissed when a drag begins. + * - 'interactive', the keyboard is dismissed interactively with the drag + * and moves in synchrony with the touch; dragging upwards cancels the + * dismissal. */ - keyboardDismissMode: nativePropType(PropTypes.oneOf([ - RKScrollViewConsts.KeyboardDismissMode.None, // default - RKScrollViewConsts.KeyboardDismissMode.Interactive, - RKScrollViewConsts.KeyboardDismissMode.OnDrag, - ])), + keyboardDismissMode: PropTypes.oneOf([ + 'none', // default + 'interactive', + 'onDrag', + ]), /** * When false, tapping outside of the focused text input when the keyboard * is up dismisses the keyboard. When true, the scroll view will not catch @@ -154,7 +159,6 @@ var INNERVIEW = 'InnerScrollView'; var ScrollView = React.createClass({ statics: { PropTypes: RKScrollViewPropTypes, - keyboardDismissMode: RKScrollViewConsts.KeyboardDismissMode, }, propTypes: RKScrollViewPropTypes, @@ -230,6 +234,9 @@ var ScrollView = React.createClass({ this.props, { alwaysBounceHorizontal, alwaysBounceVertical, + keyboardDismissMode: this.props.keyboardDismissMode ? + keyboardDismissModeConstants[this.props.keyboardDismissMode] : + undefined, style: [styles.base, this.props.style], onTouchStart: this.scrollResponderHandleTouchStart, onTouchMove: this.scrollResponderHandleTouchMove, diff --git a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js index 883a85e03..d3d863785 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js +++ b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js @@ -17,16 +17,8 @@ /* eslint global-strict: 0 */ /* globals GLOBAL: true, window: true */ -var JSTimers = require('JSTimers'); - -// Just to make sure the JS gets packaged up +// Just to make sure the JS gets packaged up. require('RCTDeviceEventEmitter'); -var ErrorUtils = require('ErrorUtils'); -var RKAlertManager = require('RKAlertManager'); -var RKExceptionsManager = require('NativeModules').RKExceptionsManager; - -var errorToString = require('errorToString'); -var loadSourceMap = require('loadSourceMap'); if (typeof GLOBAL === 'undefined') { GLOBAL = this; @@ -36,7 +28,43 @@ if (typeof window === 'undefined') { window = GLOBAL; } +/** + * The document must be shimmed before anything else that might define the + * `ExecutionEnvironment` module (which checks for `document.createElement`). + */ +function setupDocumentShim() { + // The browser defines Text and Image globals by default. If you forget to + // require them, then the error message is very confusing. + function getInvalidGlobalUseError(name) { + return new Error( + 'You are trying to render the global ' + name + ' variable as a ' + + 'React element. You probably forgot to require ' + name + '.' + ); + } + GLOBAL.Text = { + get defaultProps() { + throw getInvalidGlobalUseError('Text'); + } + }; + GLOBAL.Image = { + get defaultProps() { + throw getInvalidGlobalUseError('Image'); + } + }; + if (!GLOBAL.document) { + // This shouldn't be needed but scroller library fails without it. If + // we fixed the scroller, we wouldn't need this. + GLOBAL.document = {body: {}}; + } + // Force `ExecutionEnvironment.canUseDOM` to be false. + GLOBAL.document.createElement = null; +} + function handleErrorWithRedBox(e) { + var RKExceptionsManager = require('NativeModules').RKExceptionsManager; + var errorToString = require('errorToString'); + var loadSourceMap = require('loadSourceMap'); + GLOBAL.console.error( 'Error: ' + '\n stack: \n' + e.stack + @@ -60,38 +88,10 @@ function handleErrorWithRedBox(e) { } function setupRedBoxErrorHandler() { + var ErrorUtils = require('ErrorUtils'); ErrorUtils.setGlobalHandler(handleErrorWithRedBox); } -function setupDocumentShim() { - // The browser defines Text and Image globals by default. If you forget to - // require them, then the error message is very confusing. - function getInvalidGlobalUseError(name) { - return new Error( - 'You are trying to render the global ' + name + ' variable as a ' + - 'React element. You probably forgot to require ' + name + '.' - ); - } - GLOBAL.Text = { - get defaultProps() { - throw getInvalidGlobalUseError('Text'); - } - }; - GLOBAL.Image = { - get defaultProps() { - throw getInvalidGlobalUseError('Image'); - } - }; - - GLOBAL.document = { - // This shouldn't be needed but scroller library fails without it. If - // we fixed the scroller, we wouldn't need this. - body: {}, - // Workaround for setImmediate - createElement: function() {return {};} - }; -} - /** * Sets up a set of window environment wrappers that ensure that the * BatchedBridge is flushed after each tick. In both the case of the @@ -100,6 +100,7 @@ function setupDocumentShim() { * unexplainably dropped timing signals. */ function setupTimers() { + var JSTimers = require('JSTimers'); GLOBAL.setTimeout = JSTimers.setTimeout; GLOBAL.setInterval = JSTimers.setInterval; GLOBAL.setImmediate = JSTimers.setImmediate; @@ -114,6 +115,7 @@ function setupTimers() { } function setupAlert() { + var RKAlertManager = require('RKAlertManager'); if (!GLOBAL.alert) { GLOBAL.alert = function(text) { var alertOpts = { @@ -144,8 +146,8 @@ function setupGeolocation() { GLOBAL.navigator.geolocation = require('GeoLocation'); } -setupRedBoxErrorHandler(); setupDocumentShim(); +setupRedBoxErrorHandler(); setupTimers(); setupAlert(); setupPromise(); diff --git a/ReactKit/Base/RCTConvert.m b/ReactKit/Base/RCTConvert.m index ab79cd861..4f3e8b05c 100644 --- a/ReactKit/Base/RCTConvert.m +++ b/ReactKit/Base/RCTConvert.m @@ -131,9 +131,12 @@ RCT_CONVERTER_CUSTOM(NSUInteger, NSUInteger, [json unsignedIntegerValue]) return [NSURLRequest requestWithURL:[self NSURL:json]]; } -RCT_CONVERTER_CUSTOM(NSDate *, NSDate, [NSDate dateWithTimeIntervalSince1970:[json doubleValue]]) -RCT_CONVERTER_CUSTOM(NSTimeZone *, NSTimeZone, [NSTimeZone timeZoneForSecondsFromGMT:[json doubleValue]]) -RCT_CONVERTER(NSTimeInterval, NSTimeInterval, doubleValue) +// JS Standard for time is milliseconds +RCT_CONVERTER_CUSTOM(NSDate *, NSDate, [NSDate dateWithTimeIntervalSince1970:[json doubleValue] / 1000.0]) +RCT_CONVERTER_CUSTOM(NSTimeInterval, NSTimeInterval, [json doubleValue] / 1000.0) + +// JS standard for time zones is minutes. +RCT_CONVERTER_CUSTOM(NSTimeZone *, NSTimeZone, [NSTimeZone timeZoneForSecondsFromGMT:[json doubleValue] * 60.0]) /** * NOTE: We don't deliberately don't support NSTextAlignmentJustified in the diff --git a/packager/react-packager/src/JSTransformer/Cache.js b/packager/react-packager/src/JSTransformer/Cache.js index f43418e30..b9c5b8c14 100644 --- a/packager/react-packager/src/JSTransformer/Cache.js +++ b/packager/react-packager/src/JSTransformer/Cache.js @@ -112,13 +112,23 @@ Cache.prototype._persistCache = function() { return this._persisting; }; -function loadCacheSync(cacheFilepath) { +function loadCacheSync(cachePath) { var ret = Object.create(null); - if (!fs.existsSync(cacheFilepath)) { + if (!fs.existsSync(cachePath)) { return ret; } - var cacheOnDisk = JSON.parse(fs.readFileSync(cacheFilepath)); + var cacheOnDisk; + try { + cacheOnDisk = JSON.parse(fs.readFileSync(cachePath)); + } catch (e) { + if (e instanceof SyntaxError) { + console.warn('Unable to parse cache file. Will clear and continue.'); + fs.unlinkSync(cachePath); + return ret; + } + throw e; + } // Filter outdated cache and convert to promises. Object.keys(cacheOnDisk).forEach(function(key) { From 74824cb96e7afdb15d863e31191d5205c0018adb Mon Sep 17 00:00:00 2001 From: Felix Kling Date: Wed, 4 Mar 2015 13:37:05 -0800 Subject: [PATCH 11/79] Update react-docgen --- website/react-docgen/README.md | 11 +- website/react-docgen/example/buildDocs.sh | 42 ++++++ .../example/components/Component.js | 27 ++++ .../example/components/NoComponent.js | 4 + .../react-docgen/example/generateMarkdown.js | 80 +++++++++++ .../lib/ReactDocumentationParser.js | 124 ------------------ .../ReactDocumentationParser-test.js | 61 --------- .../__tests__/defaultValueHandler-test.js | 81 ------------ .../__tests__/propDocblockHandler-test.js | 48 +++++-- .../__tests__/propTypeHandler-test.js | 17 +++ .../lib/handlers/defaultValueHandler.js | 77 ----------- .../lib/handlers/propDocBlockHandler.js | 5 +- .../lib/handlers/propTypeHandler.js | 2 +- .../findAllReactCreateClassCalls-test.js | 106 --------------- .../findExportedReactCreateClassCall-test.js | 106 --------------- .../findAllReactCreateClassCalls.js | 47 ------- .../findExportedReactCreateClassCall.js | 78 ----------- website/react-docgen/package.json | 9 +- 18 files changed, 228 insertions(+), 697 deletions(-) create mode 100755 website/react-docgen/example/buildDocs.sh create mode 100644 website/react-docgen/example/components/Component.js create mode 100644 website/react-docgen/example/components/NoComponent.js create mode 100644 website/react-docgen/example/generateMarkdown.js delete mode 100644 website/react-docgen/lib/ReactDocumentationParser.js delete mode 100644 website/react-docgen/lib/__tests__/ReactDocumentationParser-test.js delete mode 100644 website/react-docgen/lib/handlers/__tests__/defaultValueHandler-test.js delete mode 100644 website/react-docgen/lib/handlers/defaultValueHandler.js delete mode 100644 website/react-docgen/lib/strategies/__tests__/findAllReactCreateClassCalls-test.js delete mode 100644 website/react-docgen/lib/strategies/__tests__/findExportedReactCreateClassCall-test.js delete mode 100644 website/react-docgen/lib/strategies/findAllReactCreateClassCalls.js delete mode 100644 website/react-docgen/lib/strategies/findExportedReactCreateClassCall.js diff --git a/website/react-docgen/README.md b/website/react-docgen/README.md index a59645b41..db9835fe9 100644 --- a/website/react-docgen/README.md +++ b/website/react-docgen/README.md @@ -4,7 +4,7 @@ It uses [recast][] to parse the source into an AST and provides methods to process this AST to extract the desired information. The output / return value is a JSON blob / JavaScript object. -It provides a default implementation for React components defined via `React.createClass`. These component definitions must follow certain guidelines in order to be analyzable (see below for more info) +It provides a default implementation for React components defined via `React.createClass`. These component definitions must follow certain guidelines in order to be analyzable (see below for more info). ## Install @@ -38,6 +38,9 @@ If a directory is passed, it is recursively traversed. By default, `react-docgen` will look for the exported component created through `React.createClass` in each file. Have a look below for how to customize this behavior. +Have a look at `example/` for an example of how to use the result to generate +a markdown version of the documentation. + ## API The tool can be used programmatically to extract component information and customize the extraction process: @@ -209,5 +212,11 @@ The structure of the JSON blob / JavaScript object is as follows: ["composes": ] } ``` +(`[...]` means the property may not exist if such information was not found in the component definition) + +- ``: For each prop that was found, there will be an entry in `props` under the same name. +- ``: The name of the type, which is usually corresponds to the function name in `React.PropTypes`. However, for types define with `oneOf`, we use `"enum"` and for `oneOfType` we use `"union"`. If a custom function is provided or the type cannot be resolved to anything of `React.PropTypes`, we use `"custom"`. +- ``: Some types accept parameters which define the type in more detail (such as `arrayOf`, `instanceOf`, `oneOf`, etc). Those are stored in ``. The data type of `` depends on the type definition. + [recast]: https://github.com/benjamn/recast diff --git a/website/react-docgen/example/buildDocs.sh b/website/react-docgen/example/buildDocs.sh new file mode 100755 index 000000000..6230fe3fb --- /dev/null +++ b/website/react-docgen/example/buildDocs.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env node + +/** + * This example script expects a JSON blob generated by react-docgen as input, + * e.g. react-docgen components/* | buildDocs.sh + */ + +var fs = require('fs'); +var generateMarkdown = require('./generateMarkdown'); +var path = require('path'); + +var json = ''; +process.stdin.setEncoding('utf8'); +process.stdin.on('readable', function() { + var chunk = process.stdin.read(); + if (chunk !== null) { + json += chunk; + } +}); + +process.stdin.on('end', function() { + buildDocs(JSON.parse(json)); +}); + +function buildDocs(api) { + // api is an object keyed by filepath. We use the file name as component name. + for (var filepath in api) { + var name = getComponentName(filepath); + var markdown = generateMarkdown(name, api[filepath]); + fs.writeFileSync(name + '.md', markdown); + process.stdout.write(filepath + ' -> ' + name + '.md\n'); + } +} + +function getComponentName(filepath) { + var name = path.basename(filepath); + var ext; + while ((ext = path.extname(name))) { + name = name.substring(0, name.length - ext.length); + } + return name; +} diff --git a/website/react-docgen/example/components/Component.js b/website/react-docgen/example/components/Component.js new file mode 100644 index 000000000..e62f85af6 --- /dev/null +++ b/website/react-docgen/example/components/Component.js @@ -0,0 +1,27 @@ +var React = require('react'); +var Foo = require('Foo'); + +/** + * General component description. + */ +var Component = React.createClass({ + propTypes: { + ...Foo.propTypes, + /** + * Prop description + */ + bar: React.PropTypes.number + }, + + getDefaultProps: function() { + return { + bar: 21 + }; + }, + + render: function() { + // ... + } +}); + +module.exports = Component; diff --git a/website/react-docgen/example/components/NoComponent.js b/website/react-docgen/example/components/NoComponent.js new file mode 100644 index 000000000..96cf951e3 --- /dev/null +++ b/website/react-docgen/example/components/NoComponent.js @@ -0,0 +1,4 @@ +/** + * An example for a module that is not a component. + */ +module.exports = "abc"; diff --git a/website/react-docgen/example/generateMarkdown.js b/website/react-docgen/example/generateMarkdown.js new file mode 100644 index 000000000..b4018c052 --- /dev/null +++ b/website/react-docgen/example/generateMarkdown.js @@ -0,0 +1,80 @@ +/** + * Copyright (c) 2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ +"use strict"; + +function stringOfLength(string, length) { + var newString = ''; + for (var i = 0; i < length; i++) { + newString += string; + } + return newString; +} + +function generateTitle(name) { + var title = '`' + name + '` (component)'; + return title + '\n' + stringOfLength('=', title.length) + '\n'; +} + +function generateDesciption(description) { + return description + '\n'; +} + +function generatePropType(type) { + var values; + if (Array.isArray(type.value)) { + values = '(' + + type.value.map(function(typeValue) { + return typeValue.name || typeValue.value; + }).join('|') + + ')'; + } else { + values = type.value; + } + + return 'type: `' + type.name + (values ? values: '') + '`\n'; +} + +function generatePropDefaultValue(value) { + return 'defaultValue: `' + value.value + '`\n'; +} + +function generateProp(propName, prop) { + return ( + '### `' + propName + '`' + (prop.required ? ' (required)' : '') + '\n' + + '\n' + + (prop.description ? prop.description + '\n\n' : '') + + (prop.type ? generatePropType(prop.type) : '') + + (prop.defaultValue ? generatePropDefaultValue(prop.defaultValue) : '') + + '\n' + ); +} + +function generateProps(props) { + var title = 'Props'; + + return ( + title + '\n' + + stringOfLength('-', title.length) + '\n' + + '\n' + + Object.keys(props).sort().map(function(propName) { + return generateProp(propName, props[propName]); + }).join('\n') + ); +} + +function generateMarkdown(name, reactAPI) { + var markdownString = + generateTitle(name) + '\n' + + generateDesciption(reactAPI.description) + '\n' + + generateProps(reactAPI.props); + + return markdownString; +} + +module.exports = generateMarkdown; diff --git a/website/react-docgen/lib/ReactDocumentationParser.js b/website/react-docgen/lib/ReactDocumentationParser.js deleted file mode 100644 index 49914d60f..000000000 --- a/website/react-docgen/lib/ReactDocumentationParser.js +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -type Handler = (documentation: Documentation, path: NodePath) => void; - -var Documentation = require('./Documentation'); - -var findExportedReactCreateClass = - require('./strategies/findExportedReactCreateClassCall'); -var getPropertyName = require('./utils/getPropertyName'); -var recast = require('recast'); -var resolveToValue = require('./utils/resolveToValue'); -var n = recast.types.namedTypes; - -class ReactDocumentationParser { - _componentHandlers: Array; - _apiHandlers: Object; - - constructor() { - this._componentHandlers = []; - this._apiHandlers = Object.create(null); - } - - /** - * Handlers to extract information from the component definition. - * - * If "property" is not provided, the handler is passed the whole component - * definition. - * - * NOTE: The component definition is currently expected to be represented as - * an ObjectExpression (an object literal). This will likely change in the - * future. - */ - addHandler(handler: Handler, property?: string): void { - if (!property) { - this._componentHandlers.push(handler); - } else { - if (!this._apiHandlers[property]) { - this._apiHandlers[property] = []; - } - this._apiHandlers[property].push(handler); - } - } - - /** - * Takes JavaScript source code and returns an object with the information - * extract from it. - * - * The second argument is strategy to find the AST node(s) of the component - * definition(s) inside `source`. - * It is a function that gets passed the program AST node of - * the source as first argument, and a reference to recast as second argument. - * - * This allows you define your own strategy for finding component definitions. - * By default it will look for the exported component created by - * React.createClass. An error is thrown if multiple components are exported. - * - * NOTE: The component definition is currently expected to be represented as - * an ObjectExpression (an object literal), no matter which strategy is - * chosen. This will likely change in the future. - */ - parseSource( - source: string, - componentDefinitionStrategy?: - (program: ASTNode, recast: Object) => (Array|NodePath) - ): (Array|Object) { - if (!componentDefinitionStrategy) { - componentDefinitionStrategy = findExportedReactCreateClass; - } - var ast = recast.parse(source); - // Find the component definitions first. The return value should be - // an ObjectExpression. - var componentDefinition = componentDefinitionStrategy(ast.program, recast); - var isArray = Array.isArray(componentDefinition); - if (!componentDefinition || (isArray && componentDefinition.length === 0)) { - throw new Error(ReactDocumentationParser.ERROR_MISSING_DEFINITION); - } - - return isArray ? - this._executeHandlers(componentDefinition).map( - documentation => documentation.toObject() - ) : - this._executeHandlers([componentDefinition])[0].toObject(); - } - - _executeHandlers(componentDefinitions: Array): Array { - return componentDefinitions.map(componentDefinition => { - var documentation = new Documentation(); - componentDefinition.get('properties').each(propertyPath => { - var name = getPropertyName(propertyPath); - if (!this._apiHandlers[name]) { - return; - } - var propertyValuePath = propertyPath.get('value'); - this._apiHandlers[name].forEach( - handler => handler(documentation, propertyValuePath) - ); - }); - - this._componentHandlers.forEach( - handler => handler(documentation, componentDefinition) - ); - return documentation; - }); - } - -} - -ReactDocumentationParser.ERROR_MISSING_DEFINITION = - 'No suitable component definition found.'; - -module.exports = ReactDocumentationParser; diff --git a/website/react-docgen/lib/__tests__/ReactDocumentationParser-test.js b/website/react-docgen/lib/__tests__/ReactDocumentationParser-test.js deleted file mode 100644 index f0a865d1c..000000000 --- a/website/react-docgen/lib/__tests__/ReactDocumentationParser-test.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); - -describe('React documentation parser', function() { - var ReactDocumentationParser; - var parser; - var recast; - - beforeEach(function() { - recast = require('recast'); - ReactDocumentationParser = require('../ReactDocumentationParser'); - parser = new ReactDocumentationParser(); - }); - - function pathFromSource(source) { - return new recast.types.NodePath( - recast.parse(source).program.body[0].expression - ); - } - - describe('parseSource', function() { - - it('allows custom component definition resolvers', function() { - var path = pathFromSource('({foo: "bar"})'); - var resolver = jest.genMockFunction().mockReturnValue(path); - var handler = jest.genMockFunction(); - parser.addHandler(handler); - parser.parseSource('', resolver); - - expect(resolver).toBeCalled(); - expect(handler.mock.calls[0][1]).toBe(path); - }); - - it('errors if component definition is not found', function() { - var handler = jest.genMockFunction(); - expect(function() { - parser.parseSource('', handler); - }).toThrow(ReactDocumentationParser.ERROR_MISSING_DEFINITION); - expect(handler).toBeCalled(); - - handler = jest.genMockFunction().mockReturnValue([]); - expect(function() { - parser.parseSource('', handler); - }).toThrow(ReactDocumentationParser.ERROR_MISSING_DEFINITION); - expect(handler).toBeCalled(); - }); - - }); - -}); diff --git a/website/react-docgen/lib/handlers/__tests__/defaultValueHandler-test.js b/website/react-docgen/lib/handlers/__tests__/defaultValueHandler-test.js deleted file mode 100644 index 7902d3ee7..000000000 --- a/website/react-docgen/lib/handlers/__tests__/defaultValueHandler-test.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); - -var module_template = [ - 'var React = require("React");', - 'var PropTypes = React.PropTypes;', - 'var Component = React.createClass(%s);', - 'module.exports = Component;' -].join('\n'); - -function getSource(definition) { - return module_template.replace('%s', definition); -} - -describe('React documentation parser', function() { - var parser; - - beforeEach(function() { - parser = new (require('../../ReactDocumentationParser')); - parser.addHandler(require('../defaultValueHandler'), 'getDefaultProps'); - }); - - it ('should find prop default values that are literals', function() { - var source = getSource([ - '{', - ' getDefaultProps: function() {', - ' return {', - ' foo: "bar",', - ' bar: 42,', - ' baz: ["foo", "bar"],', - ' abc: {xyz: abc.def, 123: 42}', - ' };', - ' }', - '}' - ].join('\n')); - - var expectedResult = { - description: '', - props: { - foo: { - defaultValue: { - value: '"bar"', - computed: false - } - }, - bar: { - defaultValue: { - value: '42', - computed: false - } - }, - baz: { - defaultValue: { - value: '["foo", "bar"]', - computed: false - } - }, - abc: { - defaultValue: { - value: '{xyz: abc.def, 123: 42}', - computed: false - } - } - } - }; - - var result = parser.parseSource(source); - expect(result).toEqual(expectedResult); - }); -}); diff --git a/website/react-docgen/lib/handlers/__tests__/propDocblockHandler-test.js b/website/react-docgen/lib/handlers/__tests__/propDocblockHandler-test.js index 285e12a18..0fe18d228 100644 --- a/website/react-docgen/lib/handlers/__tests__/propDocblockHandler-test.js +++ b/website/react-docgen/lib/handlers/__tests__/propDocblockHandler-test.js @@ -25,12 +25,17 @@ describe('propDocblockHandler', function() { }); function parse(definition) { - return utils.parse('(' + definition + ')').get('body', 0, 'expression'); + var programPath = utils.parse(definition); + return programPath.get( + 'body', + programPath.node.body.length - 1, + 'expression' + ); } it('finds docblocks for prop types', function() { var definition = parse([ - '{', + '({', ' propTypes: {', ' /**', ' * Foo comment', @@ -42,7 +47,7 @@ describe('propDocblockHandler', function() { ' */', ' bar: Prop.bool,', ' }', - '}' + '})' ].join('\n')); propDocblockHandler(documentation, definition); @@ -58,7 +63,7 @@ describe('propDocblockHandler', function() { it('can handle multline comments', function() { var definition = parse([ - '{', + '({', ' propTypes: {', ' /**', ' * Foo comment with', @@ -68,7 +73,7 @@ describe('propDocblockHandler', function() { ' */', ' foo: Prop.bool', ' }', - '}' + '})' ].join('\n')); propDocblockHandler(documentation, definition); @@ -82,7 +87,7 @@ describe('propDocblockHandler', function() { it('ignores non-docblock comments', function() { var definition = parse([ - '{', + '({', ' propTypes: {', ' /**', ' * Foo comment', @@ -96,7 +101,7 @@ describe('propDocblockHandler', function() { ' /* This is not a doc comment */', ' bar: Prop.bool,', ' }', - '}' + '})' ].join('\n')); propDocblockHandler(documentation, definition); @@ -112,7 +117,7 @@ describe('propDocblockHandler', function() { it('only considers the comment with the property below it', function() { var definition = parse([ - '{', + '({', ' propTypes: {', ' /**', ' * Foo comment', @@ -120,7 +125,7 @@ describe('propDocblockHandler', function() { ' foo: Prop.bool,', ' bar: Prop.bool,', ' }', - '}' + '})' ].join('\n')); propDocblockHandler(documentation, definition); @@ -136,7 +141,7 @@ describe('propDocblockHandler', function() { it('understands and ignores the spread operator', function() { var definition = parse([ - '{', + '({', ' propTypes: {', ' ...Foo.propTypes,', ' /**', @@ -144,7 +149,28 @@ describe('propDocblockHandler', function() { ' */', ' foo: Prop.bool,', ' }', - '}' + '})' + ].join('\n')); + + propDocblockHandler(documentation, definition); + expect(documentation.descriptors).toEqual({ + foo: { + description: 'Foo comment' + } + }); + }); + + it('resolves variables', function() { + var definition = parse([ + 'var Props = {', + ' /**', + ' * Foo comment', + ' */', + ' foo: Prop.bool,', + '};', + '({', + ' propTypes: Props', + '})' ].join('\n')); propDocblockHandler(documentation, definition); diff --git a/website/react-docgen/lib/handlers/__tests__/propTypeHandler-test.js b/website/react-docgen/lib/handlers/__tests__/propTypeHandler-test.js index d8e41adff..79b06bc96 100644 --- a/website/react-docgen/lib/handlers/__tests__/propTypeHandler-test.js +++ b/website/react-docgen/lib/handlers/__tests__/propTypeHandler-test.js @@ -171,4 +171,21 @@ describe('propTypeHandler', function() { }, }); }); + + it('resolves variables', function() { + var definition = parse([ + 'var props = {bar: PropTypes.bool};', + '({', + ' propTypes: props', + '})', + ].join('\n')); + + propTypeHandler(documentation, definition); + expect(documentation.descriptors).toEqual({ + bar: { + type: {}, + required: false + }, + }); + }); }); diff --git a/website/react-docgen/lib/handlers/defaultValueHandler.js b/website/react-docgen/lib/handlers/defaultValueHandler.js deleted file mode 100644 index dd51d58d7..000000000 --- a/website/react-docgen/lib/handlers/defaultValueHandler.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var Documentation = require('../Documentation'); - -var expressionTo = require('../utils/expressionTo'); -var getPropertyName = require('../utils/getPropertyName'); -var recast = require('recast'); -var resolveToValue = require('../utils/resolveToValue'); -var types = recast.types.namedTypes; -var visit = recast.types.visit; - -function getDefaultValue(path) { - var node = path.node; - var defaultValue; - if (types.Literal.check(node)) { - defaultValue = node.raw; - } else { - path = resolveToValue(path); - node = path.node; - defaultValue = recast.print(path).code; - } - if (typeof defaultValue !== 'undefined') { - return { - value: defaultValue, - computed: types.CallExpression.check(node) || - types.MemberExpression.check(node) || - types.Identifier.check(node) - }; - } -} - -function defaultValueHandler(documentation: Documentation, path: NodePath) { - if (!types.FunctionExpression.check(path.node)) { - return; - } - - // Find the value that is returned from the function and process it if it is - // an object literal. - var objectExpressionPath; - visit(path.get('body'), { - visitFunction: () => false, - visitReturnStatement: function(path) { - var resolvedPath = resolveToValue(path.get('argument')); - if (types.ObjectExpression.check(resolvedPath.node)) { - objectExpressionPath = resolvedPath; - } - return false; - } - }); - - if (objectExpressionPath) { - objectExpressionPath.get('properties').each(function(propertyPath) { - var propDescriptor = documentation.getPropDescriptor( - getPropertyName(propertyPath) - ); - var defaultValue = getDefaultValue(propertyPath.get('value')); - if (defaultValue) { - propDescriptor.defaultValue = defaultValue; - } - }); - } -} - -module.exports = defaultValueHandler; diff --git a/website/react-docgen/lib/handlers/propDocBlockHandler.js b/website/react-docgen/lib/handlers/propDocBlockHandler.js index eda9c8beb..940c66fa4 100644 --- a/website/react-docgen/lib/handlers/propDocBlockHandler.js +++ b/website/react-docgen/lib/handlers/propDocBlockHandler.js @@ -15,13 +15,14 @@ var Documentation = require('../Documentation'); -var types = require('recast').types.namedTypes; var getDocblock = require('../utils/docblock').getDocblock; var getPropertyName = require('../utils/getPropertyName'); var getPropertyValuePath = require('../utils/getPropertyValuePath'); +var types = require('recast').types.namedTypes; +var resolveToValue = require('../utils/resolveToValue'); function propDocBlockHandler(documentation: Documentation, path: NodePath) { - var propTypesPath = getPropertyValuePath(path, 'propTypes'); + var propTypesPath = resolveToValue(getPropertyValuePath(path, 'propTypes')); if (!propTypesPath || !types.ObjectExpression.check(propTypesPath.node)) { return; } diff --git a/website/react-docgen/lib/handlers/propTypeHandler.js b/website/react-docgen/lib/handlers/propTypeHandler.js index 37c00c937..ec1abe86a 100644 --- a/website/react-docgen/lib/handlers/propTypeHandler.js +++ b/website/react-docgen/lib/handlers/propTypeHandler.js @@ -100,7 +100,7 @@ function amendPropTypes(documentation, path) { } function propTypeHandler(documentation: Documentation, path: NodePath) { - var propTypesPath = getPropertyValuePath(resolveToValue(path), 'propTypes'); + var propTypesPath = resolveToValue(getPropertyValuePath(path, 'propTypes')); if (!propTypesPath || !types.ObjectExpression.check(propTypesPath.node)) { return; } diff --git a/website/react-docgen/lib/strategies/__tests__/findAllReactCreateClassCalls-test.js b/website/react-docgen/lib/strategies/__tests__/findAllReactCreateClassCalls-test.js deleted file mode 100644 index a78e6a77d..000000000 --- a/website/react-docgen/lib/strategies/__tests__/findAllReactCreateClassCalls-test.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); - -describe('React documentation parser', function() { - var findAllReactCreateClassCalls; - var recast; - - function parse(source) { - return findAllReactCreateClassCalls( - recast.parse(source).program, - recast - ); - } - - beforeEach(function() { - findAllReactCreateClassCalls = require('../findAllReactCreateClassCalls'); - recast = require('recast'); - }); - - - it('finds React.createClass', function() { - var source = [ - 'var React = require("React");', - 'var Component = React.createClass({});', - 'module.exports = Component;' - ].join('\n'); - - var result = parse(source); - expect(Array.isArray(result)).toBe(true); - expect(result.length).toBe(1); - expect(result[0] instanceof recast.types.NodePath).toBe(true); - expect(result[0].node.type).toBe('ObjectExpression'); - }); - - it('finds React.createClass, independent of the var name', function() { - var source = [ - 'var R = require("React");', - 'var Component = R.createClass({});', - 'module.exports = Component;' - ].join('\n'); - - var result = parse(source); - expect(Array.isArray(result)).toBe(true); - expect(result.length).toBe(1); - }); - - it('does not process X.createClass of other modules', function() { - var source = [ - 'var R = require("NoReact");', - 'var Component = R.createClass({});', - 'module.exports = Component;' - ].join('\n'); - - var result = parse(source); - expect(Array.isArray(result)).toBe(true); - expect(result.length).toBe(0); - }); - - it('finds assignments to exports', function() { - var source = [ - 'var R = require("React");', - 'var Component = R.createClass({});', - 'exports.foo = 42;', - 'exports.Component = Component;' - ].join('\n'); - - var result = parse(source); - expect(Array.isArray(result)).toBe(true); - expect(result.length).toBe(1); - }); - - it('accepts multiple definitions', function() { - var source = [ - 'var R = require("React");', - 'var ComponentA = R.createClass({});', - 'var ComponentB = R.createClass({});', - 'exports.ComponentB = ComponentB;' - ].join('\n'); - - var result = parse(source); - expect(Array.isArray(result)).toBe(true); - expect(result.length).toBe(2); - - source = [ - 'var R = require("React");', - 'var ComponentA = R.createClass({});', - 'var ComponentB = R.createClass({});', - 'module.exports = ComponentB;' - ].join('\n'); - - result = parse(source); - expect(Array.isArray(result)).toBe(true); - expect(result.length).toBe(2); - }); -}); diff --git a/website/react-docgen/lib/strategies/__tests__/findExportedReactCreateClassCall-test.js b/website/react-docgen/lib/strategies/__tests__/findExportedReactCreateClassCall-test.js deleted file mode 100644 index b0e4cba92..000000000 --- a/website/react-docgen/lib/strategies/__tests__/findExportedReactCreateClassCall-test.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); - -describe('React documentation parser', function() { - var findExportedReactCreateClass; - var recast; - - function parse(source) { - return findExportedReactCreateClass( - recast.parse(source).program, - recast - ); - } - - beforeEach(function() { - findExportedReactCreateClass = - require('../findExportedReactCreateClassCall'); - recast = require('recast'); - }); - - it('finds React.createClass', function() { - var source = [ - 'var React = require("React");', - 'var Component = React.createClass({});', - 'module.exports = Component;' - ].join('\n'); - - expect(parse(source)).toBeDefined(); - }); - - it('finds React.createClass, independent of the var name', function() { - var source = [ - 'var R = require("React");', - 'var Component = R.createClass({});', - 'module.exports = Component;' - ].join('\n'); - - expect(parse(source)).toBeDefined(); - }); - - it('does not process X.createClass of other modules', function() { - var source = [ - 'var R = require("NoReact");', - 'var Component = R.createClass({});', - 'module.exports = Component;' - ].join('\n'); - - expect(parse(source)).toBeUndefined(); - }); - - it('finds assignments to exports', function() { - var source = [ - 'var R = require("React");', - 'var Component = R.createClass({});', - 'exports.foo = 42;', - 'exports.Component = Component;' - ].join('\n'); - - expect(parse(source)).toBeDefined(); - }); - - it('errors if multiple components are exported', function() { - var source = [ - 'var R = require("React");', - 'var ComponentA = R.createClass({});', - 'var ComponentB = R.createClass({});', - 'exports.ComponentA = ComponentA;', - 'exports.ComponentB = ComponentB;' - ].join('\n'); - - expect(function() { - parse(source) - }).toThrow(); - }); - - it('accepts multiple definitions if only one is exported', function() { - var source = [ - 'var R = require("React");', - 'var ComponentA = R.createClass({});', - 'var ComponentB = R.createClass({});', - 'exports.ComponentB = ComponentB;' - ].join('\n'); - - expect(parse(source)).toBeDefined(); - - source = [ - 'var R = require("React");', - 'var ComponentA = R.createClass({});', - 'var ComponentB = R.createClass({});', - 'module.exports = ComponentB;' - ].join('\n'); - - expect(parse(source)).toBeDefined(); - }); -}); diff --git a/website/react-docgen/lib/strategies/findAllReactCreateClassCalls.js b/website/react-docgen/lib/strategies/findAllReactCreateClassCalls.js deleted file mode 100644 index 7971a1d26..000000000 --- a/website/react-docgen/lib/strategies/findAllReactCreateClassCalls.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var isReactCreateClassCall = require('../utils/isReactCreateClassCall'); -var resolveToValue = require('../utils/resolveToValue'); - -/** - * Given an AST, this function tries to find all object expressions that are - * passed to `React.createClass` calls, by resolving all references properly. - */ -function findAllReactCreateClassCalls( - ast: ASTNode, - recast: Object -): Array { - var types = recast.types.namedTypes; - var definitions = []; - - recast.visit(ast, { - visitCallExpression: function(path) { - if (!isReactCreateClassCall(path)) { - return false; - } - // We found React.createClass. Lets get cracking! - var resolvedPath = resolveToValue(path.get('arguments', 0)); - if (types.ObjectExpression.check(resolvedPath.node)) { - definitions.push(resolvedPath); - } - return false; - } - }); - - return definitions; -} - -module.exports = findAllReactCreateClassCalls; diff --git a/website/react-docgen/lib/strategies/findExportedReactCreateClassCall.js b/website/react-docgen/lib/strategies/findExportedReactCreateClassCall.js deleted file mode 100644 index ccb8a3907..000000000 --- a/website/react-docgen/lib/strategies/findExportedReactCreateClassCall.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var isExportsOrModuleAssignment = - require('../utils/isExportsOrModuleAssignment'); -var isReactCreateClassCall = require('../utils/isReactCreateClassCall'); -var resolveToValue = require('../utils/resolveToValue'); - -var ERROR_MULTIPLE_DEFINITIONS = - 'Multiple exported component definitions found.'; - -function ignore() { - return false; -} - -/** - * Given an AST, this function tries to find the object expression that is - * passed to `React.createClass`, by resolving all references properly. - */ -function findExportedReactCreateClass( - ast: ASTNode, - recast: Object -): ?NodePath { - var types = recast.types.namedTypes; - var definition; - - recast.visit(ast, { - visitFunctionDeclaration: ignore, - visitFunctionExpression: ignore, - visitIfStatement: ignore, - visitWithStatement: ignore, - visitSwitchStatement: ignore, - visitCatchCause: ignore, - visitWhileStatement: ignore, - visitDoWhileStatement: ignore, - visitForStatement: ignore, - visitForInStatement: ignore, - visitAssignmentExpression: function(path) { - // Ignore anything that is not `exports.X = ...;` or - // `module.exports = ...;` - if (!isExportsOrModuleAssignment(path)) { - return false; - } - // Resolve the value of the right hand side. It should resolve to a call - // expression, something like React.createClass - path = resolveToValue(path.get('right')); - if (!isReactCreateClassCall(path)) { - return false; - } - if (definition) { - // If a file exports multiple components, ... complain! - throw new Error(ERROR_MULTIPLE_DEFINITIONS); - } - // We found React.createClass. Lets get cracking! - var resolvedPath = resolveToValue(path.get('arguments', 0)); - if (types.ObjectExpression.check(resolvedPath.node)) { - definition = resolvedPath; - } - return false; - } - }); - - return definition; -} - -module.exports = findExportedReactCreateClass; diff --git a/website/react-docgen/package.json b/website/react-docgen/package.json index 45a16b5e1..b84e7cfb6 100644 --- a/website/react-docgen/package.json +++ b/website/react-docgen/package.json @@ -1,7 +1,12 @@ { "name": "react-docgen", "version": "1.0.0", - "description": "Extract information from React components for documentation generation", + "description": "A CLI and toolkit to extract information from React components for documentation generation.", + "repository": { + "type": "git", + "url": "https://github.com/reactjs/react-docgen.git" + }, + "bugs": "https://github.com/reactjs/react-docgen/issues", "bin": { "react-docgen": "bin/react-docgen.js" }, @@ -14,7 +19,7 @@ }, "keywords": [ "react", - "documentation" + "documentation-generation" ], "author": "Felix Kling", "license": "BSD-3-Clause", From d935f4554b83cef5a144dbdd33eb9e978d0266c0 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Wed, 4 Mar 2015 18:10:12 -0800 Subject: [PATCH 12/79] Improvements in the docs generation --- website/core/DocsSidebar.js | 2 +- website/layout/AutodocsLayout.js | 57 +++++++++++++++++++ website/server/convert.js | 2 +- website/server/extractDocs.js | 13 ++--- website/src/react-native/css/react-native.css | 24 ++++++++ 5 files changed, 87 insertions(+), 11 deletions(-) create mode 100644 website/layout/AutodocsLayout.js diff --git a/website/core/DocsSidebar.js b/website/core/DocsSidebar.js index b730acb0d..7b8cbb98b 100644 --- a/website/core/DocsSidebar.js +++ b/website/core/DocsSidebar.js @@ -9,7 +9,7 @@ var Metadata = require('Metadata'); var DocsSidebar = React.createClass({ getCategories: function() { var metadatas = Metadata.files.filter(function(metadata) { - return metadata.layout === 'docs'; + return metadata.layout === 'docs' || metadata.layout === 'autodocs'; }); // Build a hashmap of article_id -> metadata diff --git a/website/layout/AutodocsLayout.js b/website/layout/AutodocsLayout.js new file mode 100644 index 000000000..7ec0846d7 --- /dev/null +++ b/website/layout/AutodocsLayout.js @@ -0,0 +1,57 @@ +/** + * @providesModule AutodocsLayout + * @jsx React.DOM + */ + +var DocsSidebar = require('DocsSidebar'); +var Header = require('Header'); +var Marked = require('Marked'); +var React = require('React'); +var Site = require('Site'); + + +var Autodocs = React.createClass({ + renderProp: function(name, prop) { + return ( +
+
+ {name} + {' '} + {prop.type.name}
+ {prop.description} +
+ ); + }, + renderProps: function(props) { + var result = Object.keys(props).sort().map((name) => + this.renderProp(name, props[name]) + ); + + return
{result}
; + }, + render: function() { + var metadata = this.props.metadata; + var content = JSON.parse(this.props.children); + return ( + +
+ + +
+
+ ); + } +}); + +module.exports = Autodocs; diff --git a/website/server/convert.js b/website/server/convert.js index 1a02efca7..7d239313d 100644 --- a/website/server/convert.js +++ b/website/server/convert.js @@ -30,7 +30,7 @@ function backtickify(str) { function execute() { var MD_DIR = '../docs/'; - var files = glob.sync('src/react-native/docs/*.*') + var files = glob.sync('src/react-native/docs/*.*'); files.forEach(function(file) { try { fs.unlinkSync(file); diff --git a/website/server/extractDocs.js b/website/server/extractDocs.js index b59e2b483..db59a25e1 100644 --- a/website/server/extractDocs.js +++ b/website/server/extractDocs.js @@ -18,7 +18,7 @@ function docsToMarkdown(filepath, i) { return docs.resolver.findExportedReactCreateClassCall(node, recast) || docs.resolver.findAllReactCreateClassCalls(node, recast)[0]; } - ) + ); var componentName = getNameFromPath(filepath); @@ -26,18 +26,12 @@ function docsToMarkdown(filepath, i) { '---', 'id: ' + slugify(componentName), 'title: ' + componentName, - 'layout: docs', + 'layout: autodocs', 'category: Components', 'permalink: docs/' + slugify(componentName) + '.html', components[i + 1] && ('next: ' + slugify(getNameFromPath(components[i + 1]))), '---', - ' ', - json.description, - ' ', - '# Props', - '```', - JSON.stringify(json.props, null, 2), - '```', + JSON.stringify(json, null, 2), ].filter(function(line) { return line; }).join('\n'); return res; } @@ -49,6 +43,7 @@ var components = [ '../Libraries/Components/Navigation/NavigatorIOS.ios.js', '../Libraries/Components/ScrollView/ScrollView.ios.js', '../Libraries/Text/Text.js', + '../Libraries/Image/Image.ios.js', '../Libraries/Components/TextInput/TextInput.ios.js', '../Libraries/Components/Touchable/TouchableHighlight.js', '../Libraries/Components/Touchable/TouchableWithoutFeedback.js', diff --git a/website/src/react-native/css/react-native.css b/website/src/react-native/css/react-native.css index ace8010f0..b7bb73ada 100644 --- a/website/src/react-native/css/react-native.css +++ b/website/src/react-native/css/react-native.css @@ -895,6 +895,29 @@ div[data-twttr-id] iframe { text-align: center; } + +.props { + background-color: hsl(198, 100%, 96%); +} + +.prop:nth-child(2n) { + background-color: hsl(198, 100%, 94%); +} + +.propTitle { + font-weight: bold; +} + +.prop { + padding: 5px 10px; +} + +.propType { + font-weight: normal; + font-size: 15px; +} + + #content { display: none; } @@ -965,3 +988,4 @@ div[data-twttr-id] iframe { margin: 0; } } + From b9ab60719767bda61ca55e0f8e86a60bdebc9ec3 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Wed, 4 Mar 2015 21:03:24 -0800 Subject: [PATCH 13/79] Use docs/ComponentName.md at the end of the component docs --- website/core/Marked.js | 4 +++- website/layout/AutodocsLayout.js | 8 ++++++-- website/server/extractDocs.js | 11 ++++++++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/website/core/Marked.js b/website/core/Marked.js index f9baeaf49..f7f6c5007 100644 --- a/website/core/Marked.js +++ b/website/core/Marked.js @@ -1085,7 +1085,9 @@ marked.parse = marked; var Marked = React.createClass({ render: function() { - return React.DOM.div(null, marked(this.props.children, this.props)); + return this.props.children ? + React.DOM.div(null, marked(this.props.children, this.props)) : + null; } }); diff --git a/website/layout/AutodocsLayout.js b/website/layout/AutodocsLayout.js index 7ec0846d7..9ff344199 100644 --- a/website/layout/AutodocsLayout.js +++ b/website/layout/AutodocsLayout.js @@ -17,8 +17,9 @@ var Autodocs = React.createClass({
{name} {' '} - {prop.type.name}
- {prop.description} + {prop.type && {prop.type.name}} + + {prop.description && {prop.description}} ); }, @@ -43,6 +44,9 @@ var Autodocs = React.createClass({ {content.description} {this.renderProps(content.props)} + + {content.fullDescription} +
{metadata.previous && ← Prev} {metadata.next && Next →} diff --git a/website/server/extractDocs.js b/website/server/extractDocs.js index db59a25e1..095a9ac1a 100644 --- a/website/server/extractDocs.js +++ b/website/server/extractDocs.js @@ -19,9 +19,13 @@ function docsToMarkdown(filepath, i) { docs.resolver.findAllReactCreateClassCalls(node, recast)[0]; } ); - var componentName = getNameFromPath(filepath); + var docFilePath = '../docs/' + componentName + '.md'; + if (fs.existsSync(docFilePath)) { + json.fullDescription = fs.readFileSync(docFilePath).toString(); + } + var res = [ '---', 'id: ' + slugify(componentName), @@ -37,15 +41,16 @@ function docsToMarkdown(filepath, i) { } var components = [ - '../Libraries/Components/Navigation/NavigatorIOS.ios.js', + '../Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js', + '../Libraries/Text/ExpandingText.js', '../Libraries/Image/Image.ios.js', '../Libraries/Components/ListView/ListView.js', '../Libraries/Components/Navigation/NavigatorIOS.ios.js', '../Libraries/Components/ScrollView/ScrollView.ios.js', '../Libraries/Text/Text.js', - '../Libraries/Image/Image.ios.js', '../Libraries/Components/TextInput/TextInput.ios.js', '../Libraries/Components/Touchable/TouchableHighlight.js', + '../Libraries/Components/Touchable/TouchableOpacity.js', '../Libraries/Components/Touchable/TouchableWithoutFeedback.js', '../Libraries/Components/View/View.js', ]; From b87ba87e476f46d87e319b6b7429930406364df7 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Wed, 4 Mar 2015 21:06:49 -0800 Subject: [PATCH 14/79] Updates from Wed Mar 4 - [react-packager] Start converting options to query params | Amjad Masad - [ReactNative] Replace js long constants with strings | Tadeu Zagallo - React Native: Remove Unnecessary `document.body` Shim | Tim Yung - [ReactNative] Use spread operator and .propTypes for ScrollView/ListView | Christopher Chedeau --- Examples/Movies/SearchScreen.js | 2 +- .../UIExplorer/ActivityIndicatorExample.js | 12 +- Examples/UIExplorer/PointerEventsExample.js | 28 ++-- Examples/UIExplorer/TextInputExample.js | 18 +-- .../ActivityIndicatorIOS.ios.js | 21 +-- Libraries/Components/ListView/ListView.js | 148 +++++++++--------- .../Components/ScrollView/ScrollView.ios.js | 15 +- .../Components/TextInput/TextInput.ios.js | 66 ++++---- Libraries/Components/View/View.js | 15 +- .../InitializeJavaScriptAppEngine.js | 9 +- ReactKit/Base/RCTConvert.h | 1 - ReactKit/Base/RCTConvert.m | 7 +- ReactKit/Modules/RCTUIManager.m | 22 +-- .../src/Server/__tests__/Server-test.js | 25 ++- packager/react-packager/src/Server/index.js | 44 ++++-- 15 files changed, 212 insertions(+), 221 deletions(-) diff --git a/Examples/Movies/SearchScreen.js b/Examples/Movies/SearchScreen.js index ea58deefb..3c451fd67 100644 --- a/Examples/Movies/SearchScreen.js +++ b/Examples/Movies/SearchScreen.js @@ -282,7 +282,7 @@ var SearchBar = React.createClass({ return ( ); } @@ -98,7 +98,7 @@ exports.examples = [ ); } @@ -109,19 +109,19 @@ exports.examples = [ return ( diff --git a/Examples/UIExplorer/PointerEventsExample.js b/Examples/UIExplorer/PointerEventsExample.js index 0bc6c2b13..10600d54d 100644 --- a/Examples/UIExplorer/PointerEventsExample.js +++ b/Examples/UIExplorer/PointerEventsExample.js @@ -61,7 +61,7 @@ var NoneExample = React.createClass({ A: unspecified this.props.onLog('B none touched')} style={[styles.box, styles.boxPassedThrough]}> @@ -87,7 +87,7 @@ var NoneExample = React.createClass({ var DemoText = React.createClass({ render: function() { return ( - + {this.props.children} @@ -107,11 +107,11 @@ var BoxNoneExample = React.createClass({ A: unspecified this.props.onLog('B boxNone touched')} + pointerEvents="box-none" + onTouchStart={() => this.props.onLog('B box-none touched')} style={[styles.box, styles.boxPassedThrough]}> - B: boxNone + B: box-none this.props.onLog('C unspecified touched')} @@ -121,7 +121,7 @@ var BoxNoneExample = React.createClass({ this.props.onLog('C explicitly unspecified touched')} style={[styles.box]}> @@ -144,11 +144,11 @@ var BoxOnlyExample = React.createClass({ A: unspecified this.props.onLog('B boxOnly touched')} + pointerEvents="box-only" + onTouchStart={() => this.props.onLog('B box-only touched')} style={styles.box}> - B: boxOnly + B: box-only this.props.onLog('C unspecified touched')} @@ -158,7 +158,7 @@ var BoxOnlyExample = React.createClass({ this.props.onLog('C explicitly unspecified touched')} style={[styles.box, styles.boxPassedThrough]}> @@ -179,13 +179,13 @@ var exampleClasses = [ }, { Component: BoxNoneExample, - title: '`boxNone`', - description: '`boxNone` causes touch events on the container to pass through and will only detect touch events on its child components.', + title: '`box-none`', + description: '`box-none` causes touch events on the container to pass through and will only detect touch events on its child components.', }, { Component: BoxOnlyExample, - title: '`boxOnly`', - description: '`boxOnly` causes touch events on the container\'s child components to pass through and will only detect touch events on the container itself.', + title: '`box-only`', + description: '`box-only` causes touch events on the container\'s child components to pass through and will only detect touch events on the container itself.', } ]; diff --git a/Examples/UIExplorer/TextInputExample.js b/Examples/UIExplorer/TextInputExample.js index e10dbc0f1..e1f28895b 100644 --- a/Examples/UIExplorer/TextInputExample.js +++ b/Examples/UIExplorer/TextInputExample.js @@ -45,7 +45,7 @@ var TextEventsExample = React.createClass({ return ( this.updateText('onFocus')} @@ -123,25 +123,25 @@ exports.examples = [ @@ -193,25 +193,25 @@ exports.examples = [ diff --git a/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js b/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js index a281cf97a..5bba89830 100644 --- a/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js +++ b/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js @@ -6,7 +6,7 @@ 'use strict'; var NativeMethodsMixin = require('NativeMethodsMixin'); -var NativeModulesDeprecated = require('NativeModulesDeprecated'); +var NativeModules = require('NativeModules'); var PropTypes = require('ReactPropTypes'); var React = require('React'); var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); @@ -37,12 +37,11 @@ var ActivityIndicatorIOS = React.createClass({ * The foreground color of the spinner (default is gray). */ color: PropTypes.string, - /** - * The size of the spinner, must be one of: - * - ActivityIndicatorIOS.size.large - * - ActivityIndicatorIOS.size.small (default) - */ - size: PropTypes.oneOf([SpinnerSize.large, SpinnerSize.small]), + + size: PropTypes.oneOf([ + 'small', // default + 'large', + ]), }, getDefaultProps: function() { @@ -53,15 +52,11 @@ var ActivityIndicatorIOS = React.createClass({ }; }, - statics: { - size: SpinnerSize, - }, - render: function() { var style = styles.sizeSmall; - var NativeConstants = NativeModulesDeprecated.RKUIManager.UIActivityIndicatorView.Constants; + var NativeConstants = NativeModules.RKUIManager.UIActivityIndicatorView.Constants; var activityIndicatorViewStyle = NativeConstants.StyleWhite; - if (this.props.size == SpinnerSize.large) { + if (this.props.size === 'large') { style = styles.sizeLarge; activityIndicatorViewStyle = NativeConstants.StyleWhiteLarge; } diff --git a/Libraries/Components/ListView/ListView.js b/Libraries/Components/ListView/ListView.js index 086112724..aa2f82e28 100644 --- a/Libraries/Components/ListView/ListView.js +++ b/Libraries/Components/ListView/ListView.js @@ -88,80 +88,80 @@ var ListView = React.createClass({ * - renderRow(rowData, sectionID, rowID); * - renderSectionHeader(sectionData, sectionID); */ - propTypes: - merge( - ScrollView.PropTypes, { - dataSource: PropTypes.instanceOf(ListViewDataSource).isRequired, - /** - * (rowData, sectionID, rowID) => renderable - * Takes a data entry from the data source and its ids and should return - * a renderable component to be rendered as the row. By default the data - * is exactly what was put into the data source, but it's also possible to - * provide custom extractors. - */ - renderRow: PropTypes.func.isRequired, - /** - * How many rows to render on initial component mount. Use this to make - * it so that the first screen worth of data apears at one time instead of - * over the course of multiple frames. - */ - initialListSize: PropTypes.number, - /** - * Called when all rows have been rendered and the list has been scrolled - * to within onEndReachedThreshold of the bottom. The native scroll - * event is provided. - */ - onEndReached: PropTypes.func, - /** - * Threshold in pixels for onEndReached. - */ - onEndReachedThreshold: PropTypes.number, - /** - * Number of rows to render per event loop. - */ - pageSize: PropTypes.number, - /** - * () => renderable - * - * The header and footer are always rendered (if these props are provided) - * on every render pass. If they are expensive to re-render, wrap them - * in StaticContainer or other mechanism as appropriate. Footer is always - * at the bottom of the list, and header at the top, on every render pass. - */ - renderFooter: PropTypes.func, - renderHeader: PropTypes.func, - /** - * (sectionData, sectionID) => renderable - * - * If provided, a sticky header is rendered for this section. The sticky - * behavior means that it will scroll with the content at the top of the - * section until it reaches the top of the screen, at which point it will - * stick to the top until it is pushed off the screen by the next section - * header. - */ - renderSectionHeader: PropTypes.func, - /** - * How early to start rendering rows before they come on screen, in - * pixels. - */ - scrollRenderAheadDistance: React.PropTypes.number, - /** - * (visibleRows, changedRows) => void - * - * Called when the set of visible rows changes. `visibleRows` maps - * { sectionID: { rowID: true }} for all the visible rows, and - * `changedRows` maps { sectionID: { rowID: true | false }} for the rows - * that have changed their visibility, with true indicating visible, and - * false indicating the view has moved out of view. - */ - onChangeVisibleRows: React.PropTypes.func, - /** - * An experimental performance optimization for improving scroll perf of - * large lists, used in conjunction with overflow: 'hidden' on the row - * containers. Use at your own risk. - */ - removeClippedSubviews: React.PropTypes.bool, - }), + propTypes: { + ...ScrollView.propTypes, + + dataSource: PropTypes.instanceOf(ListViewDataSource).isRequired, + /** + * (rowData, sectionID, rowID) => renderable + * Takes a data entry from the data source and its ids and should return + * a renderable component to be rendered as the row. By default the data + * is exactly what was put into the data source, but it's also possible to + * provide custom extractors. + */ + renderRow: PropTypes.func.isRequired, + /** + * How many rows to render on initial component mount. Use this to make + * it so that the first screen worth of data apears at one time instead of + * over the course of multiple frames. + */ + initialListSize: PropTypes.number, + /** + * Called when all rows have been rendered and the list has been scrolled + * to within onEndReachedThreshold of the bottom. The native scroll + * event is provided. + */ + onEndReached: PropTypes.func, + /** + * Threshold in pixels for onEndReached. + */ + onEndReachedThreshold: PropTypes.number, + /** + * Number of rows to render per event loop. + */ + pageSize: PropTypes.number, + /** + * () => renderable + * + * The header and footer are always rendered (if these props are provided) + * on every render pass. If they are expensive to re-render, wrap them + * in StaticContainer or other mechanism as appropriate. Footer is always + * at the bottom of the list, and header at the top, on every render pass. + */ + renderFooter: PropTypes.func, + renderHeader: PropTypes.func, + /** + * (sectionData, sectionID) => renderable + * + * If provided, a sticky header is rendered for this section. The sticky + * behavior means that it will scroll with the content at the top of the + * section until it reaches the top of the screen, at which point it will + * stick to the top until it is pushed off the screen by the next section + * header. + */ + renderSectionHeader: PropTypes.func, + /** + * How early to start rendering rows before they come on screen, in + * pixels. + */ + scrollRenderAheadDistance: React.PropTypes.number, + /** + * (visibleRows, changedRows) => void + * + * Called when the set of visible rows changes. `visibleRows` maps + * { sectionID: { rowID: true }} for all the visible rows, and + * `changedRows` maps { sectionID: { rowID: true | false }} for the rows + * that have changed their visibility, with true indicating visible, and + * false indicating the view has moved out of view. + */ + onChangeVisibleRows: React.PropTypes.func, + /** + * An experimental performance optimization for improving scroll perf of + * large lists, used in conjunction with overflow: 'hidden' on the row + * containers. Use at your own risk. + */ + removeClippedSubviews: React.PropTypes.bool, + }, /** * Exports some data, e.g. for perf investigations or analytics. diff --git a/Libraries/Components/ScrollView/ScrollView.ios.js b/Libraries/Components/ScrollView/ScrollView.ios.js index 317b98686..08202f445 100644 --- a/Libraries/Components/ScrollView/ScrollView.ios.js +++ b/Libraries/Components/ScrollView/ScrollView.ios.js @@ -45,9 +45,10 @@ var keyboardDismissModeConstants = { * view from becoming the responder. */ - var RKScrollViewPropTypes = merge( - ScrollViewPropTypes, - { +var ScrollView = React.createClass({ + propTypes: { + ...ScrollViewPropTypes, + /** * When true, the scroll view bounces horizontally when it reaches the end * even if the content is smaller than the scroll view itself. The default @@ -153,16 +154,8 @@ var keyboardDismissModeConstants = { * The current scale of the scroll view content. The default value is 1.0. */ zoomScale: nativePropType(PropTypes.number), - } -); - -var ScrollView = React.createClass({ - statics: { - PropTypes: RKScrollViewPropTypes, }, - propTypes: RKScrollViewPropTypes, - mixins: [ScrollResponder.Mixin], getInitialState: function() { diff --git a/Libraries/Components/TextInput/TextInput.ios.js b/Libraries/Components/TextInput/TextInput.ios.js index fef9c16f0..aadd6c94a 100644 --- a/Libraries/Components/TextInput/TextInput.ios.js +++ b/Libraries/Components/TextInput/TextInput.ios.js @@ -8,7 +8,7 @@ var DocumentSelectionState = require('DocumentSelectionState'); var EventEmitter = require('EventEmitter'); var NativeMethodsMixin = require('NativeMethodsMixin'); -var NativeModulesDeprecated = require('NativeModulesDeprecated'); +var RKUIManager = require('NativeModules').RKUIManager; var PropTypes = require('ReactPropTypes'); var React = require('React'); var ReactChildren = require('ReactChildren'); @@ -59,28 +59,8 @@ var merge = require('merge'); * More example code in `TextInputExample.js`. */ -var nativeConstants = NativeModulesDeprecated.RKUIManager.UIText.AutocapitalizationType; - -var autoCapitalizeMode = { - none: nativeConstants.None, - sentences: nativeConstants.Sentences, - words: nativeConstants.Words, - characters: nativeConstants.AllCharacters -}; - -var clearButtonModeConstants = NativeModulesDeprecated.RKUIManager.UITextField.clearButtonMode; - -var clearButtonModeTypes = { - never: clearButtonModeConstants.Never, - whileEditing: clearButtonModeConstants.WhileEditing, - unlessEditing: clearButtonModeConstants.UnlessEditing, - always: clearButtonModeConstants.Always, -}; - -var keyboardType = { - default: 'default', - numeric: 'numeric', -}; +var autoCapitalizeConsts = RKUIManager.UIText.AutocapitalizationType; +var clearButtonModeConsts = RKUIManager.UITextField.clearButtonMode; var RKTextViewAttributes = merge(ReactIOSViewAttributes.UIView, { autoCorrect: true, @@ -113,12 +93,6 @@ var notMultiline = { }; var TextInput = React.createClass({ - statics: { - autoCapitalizeMode: autoCapitalizeMode, - clearButtonModeTypes: clearButtonModeTypes, - keyboardType: keyboardType, - }, - propTypes: { /** * Can tell TextInput to automatically capitalize certain characters. @@ -127,11 +101,13 @@ var TextInput = React.createClass({ * - words: first letter of each word * - sentences: first letter of each sentence (default) * - none: don't auto capitalize anything - * - * example: - * autoCapitalize={TextInput.autoCapitalizeMode.words} */ - autoCapitalize: PropTypes.oneOf(getObjectValues(autoCapitalizeMode)), + autoCapitalize: PropTypes.oneOf([ + 'none', + 'sentences', + 'words', + 'characters', + ]), /** * If false, disables auto-correct. Default value is true. */ @@ -145,9 +121,12 @@ var TextInput = React.createClass({ */ editable: PropTypes.bool, /** - * Determines which keyboard to open, e.g.`TextInput.keyboardType.numeric`. + * Determines which keyboard to open, e.g.`numeric`. */ - keyboardType: PropTypes.oneOf(getObjectValues(keyboardType)), + keyboardType: PropTypes.oneOf([ + 'default', + 'numeric', + ]), /** * If true, the text input can be multiple lines. Default value is false. */ @@ -202,7 +181,12 @@ var TextInput = React.createClass({ /** * When the clear button should appear on the right side of the text view */ - clearButtonMode: PropTypes.oneOf(getObjectValues(clearButtonModeTypes)), + clearButtonMode: PropTypes.oneOf([ + 'never', + 'while-editing', + 'unless-editing', + 'always', + ]), style: Text.stylePropType, }, @@ -307,6 +291,9 @@ var TextInput = React.createClass({ render: function() { var textContainer; + var autoCapitalize = autoCapitalizeConsts[this.props.autoCapitalize]; + var clearButtonMode = clearButtonModeConsts[this.props.clearButtonMode]; + if (!this.props.multiline) { for (var propKey in onlyMultiline) { if (this.props[propKey]) { @@ -329,9 +316,9 @@ var TextInput = React.createClass({ onSelectionChangeShouldSetResponder={() => true} placeholder={this.props.placeholder} text={this.state.bufferedValue} - autoCapitalize={this.props.autoCapitalize} + autoCapitalize={autoCapitalize} autoCorrect={this.props.autoCorrect} - clearButtonMode={this.props.clearButtonMode} + clearButtonMode={clearButtonMode} />; } else { for (var propKey in notMultiline) { @@ -372,8 +359,9 @@ var TextInput = React.createClass({ placeholder={this.props.placeholder} placeholderTextColor={this.props.placeholderTextColor} text={this.state.bufferedValue} - autoCapitalize={this.props.autoCapitalize} + autoCapitalize={autoCapitalize} autoCorrect={this.props.autoCorrect} + clearButtonMode={clearButtonMode} />; } diff --git a/Libraries/Components/View/View.js b/Libraries/Components/View/View.js index 643eef68a..060125ea7 100644 --- a/Libraries/Components/View/View.js +++ b/Libraries/Components/View/View.js @@ -6,7 +6,6 @@ 'use strict'; var NativeMethodsMixin = require('NativeMethodsMixin'); -var NativeModules = require('NativeModules'); var PropTypes = require('ReactPropTypes'); var React = require('React'); var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); @@ -45,15 +44,12 @@ var ViewStylePropTypes = require('ViewStylePropTypes'); * examples. */ -var StyleConstants = NativeModules.RKUIManager.StyleConstants; - var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass'); var stylePropType = StyleSheetPropType(ViewStylePropTypes); var View = React.createClass({ statics: { - pointerEvents: StyleConstants.PointerEventsValues, stylePropType, }, @@ -96,7 +92,7 @@ var View = React.createClass({ /** * In the absence of `auto` property, `none` is much like `CSS`'s `none` - * value. `boxNone` is as if you had applied the `CSS` class: + * value. `box-none` is as if you had applied the `CSS` class: * * .cantTouchThis * { * pointer-events: auto; @@ -112,10 +108,10 @@ var View = React.createClass({ * implementation detail of the platform. */ pointerEvents: PropTypes.oneOf([ - StyleConstants.PointerEventsValues.boxNone, - StyleConstants.PointerEventsValues.none, - StyleConstants.PointerEventsValues.boxOnly, - StyleConstants.PointerEventsValues.unspecified + 'box-none', + 'none', + 'box-only', + 'auto', ]), /** @@ -151,7 +147,6 @@ if (__DEV__) { ViewToExport = View; } -ViewToExport.pointerEvents = View.pointerEvents; ViewToExport.stylePropType = stylePropType; module.exports = ViewToExport; diff --git a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js index d3d863785..3c507129b 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js +++ b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js @@ -51,13 +51,10 @@ function setupDocumentShim() { throw getInvalidGlobalUseError('Image'); } }; - if (!GLOBAL.document) { - // This shouldn't be needed but scroller library fails without it. If - // we fixed the scroller, we wouldn't need this. - GLOBAL.document = {body: {}}; - } // Force `ExecutionEnvironment.canUseDOM` to be false. - GLOBAL.document.createElement = null; + if (GLOBAL.document) { + GLOBAL.document.createElement = null; + } } function handleErrorWithRedBox(e) { diff --git a/ReactKit/Base/RCTConvert.h b/ReactKit/Base/RCTConvert.h index 51a6b76ce..25b8cecc2 100644 --- a/ReactKit/Base/RCTConvert.h +++ b/ReactKit/Base/RCTConvert.h @@ -33,7 +33,6 @@ + (NSTextAlignment)NSTextAlignment:(id)json; + (NSWritingDirection)NSWritingDirection:(id)json; -+ (UITextAutocapitalizationType)UITextAutocapitalizationType:(id)json; + (UIKeyboardType)UIKeyboardType:(id)json; + (CGFloat)CGFloat:(id)json; diff --git a/ReactKit/Base/RCTConvert.m b/ReactKit/Base/RCTConvert.m index 4f3e8b05c..39b0c6874 100644 --- a/ReactKit/Base/RCTConvert.m +++ b/ReactKit/Base/RCTConvert.m @@ -161,7 +161,7 @@ RCT_ENUM_CONVERTER(UITextAutocapitalizationType, (@{ @"none": @(UITextAutocapitalizationTypeNone), @"words": @(UITextAutocapitalizationTypeWords), @"sentences": @(UITextAutocapitalizationTypeSentences), - @"all": @(UITextAutocapitalizationTypeAllCharacters) + @"characters": @(UITextAutocapitalizationTypeAllCharacters) }), UITextAutocapitalizationTypeSentences, integerValue) RCT_ENUM_CONVERTER(UIKeyboardType, (@{ @@ -658,8 +658,9 @@ RCT_ENUM_CONVERTER(css_wrap_type_t, (@{ RCT_ENUM_CONVERTER(RCTPointerEvents, (@{ @"none": @(RCTPointerEventsNone), - @"boxonly": @(RCTPointerEventsBoxOnly), - @"boxnone": @(RCTPointerEventsBoxNone) + @"box-only": @(RCTPointerEventsBoxOnly), + @"box-none": @(RCTPointerEventsBoxNone), + @"auto": @(RCTPointerEventsUnspecified) }), RCTPointerEventsUnspecified, integerValue) RCT_ENUM_CONVERTER(RCTAnimationType, (@{ diff --git a/ReactKit/Modules/RCTUIManager.m b/ReactKit/Modules/RCTUIManager.m index 951013969..5a65669cd 100644 --- a/ReactKit/Modules/RCTUIManager.m +++ b/ReactKit/Modules/RCTUIManager.m @@ -1282,25 +1282,25 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView @"StyleConstants": @{ @"PointerEventsValues": @{ @"none": @(RCTPointerEventsNone), - @"boxNone": @(RCTPointerEventsBoxNone), - @"boxOnly": @(RCTPointerEventsBoxOnly), - @"unspecified": @(RCTPointerEventsUnspecified), + @"box-none": @(RCTPointerEventsBoxNone), + @"box-only": @(RCTPointerEventsBoxOnly), + @"auto": @(RCTPointerEventsUnspecified), }, }, @"UIText": @{ @"AutocapitalizationType": @{ - @"AllCharacters": @(UITextAutocapitalizationTypeAllCharacters), - @"Sentences": @(UITextAutocapitalizationTypeSentences), - @"Words": @(UITextAutocapitalizationTypeWords), - @"None": @(UITextAutocapitalizationTypeNone), + @"characters": @(UITextAutocapitalizationTypeAllCharacters), + @"sentences": @(UITextAutocapitalizationTypeSentences), + @"words": @(UITextAutocapitalizationTypeWords), + @"none": @(UITextAutocapitalizationTypeNone), }, }, @"UITextField": @{ @"clearButtonMode": @{ - @"Never": @(UITextFieldViewModeNever), - @"WhileEditing": @(UITextFieldViewModeWhileEditing), - @"UnlessEditing": @(UITextFieldViewModeUnlessEditing), - @"Always": @(UITextFieldViewModeAlways), + @"never": @(UITextFieldViewModeNever), + @"while-editing": @(UITextFieldViewModeWhileEditing), + @"unless-editing": @(UITextFieldViewModeUnlessEditing), + @"always": @(UITextFieldViewModeAlways), }, }, @"UIView": @{ diff --git a/packager/react-packager/src/Server/__tests__/Server-test.js b/packager/react-packager/src/Server/__tests__/Server-test.js index 5a5d62b02..f55df7c28 100644 --- a/packager/react-packager/src/Server/__tests__/Server-test.js +++ b/packager/react-packager/src/Server/__tests__/Server-test.js @@ -73,7 +73,16 @@ describe('processRequest', function() { pit('returns JS bundle source on request of *.bundle',function() { return makeRequest( requestHandler, - 'mybundle.includeRequire.runModule.bundle' + 'mybundle.bundle?runModule=true' + ).then(function(response) { + expect(response).toEqual('this is the source'); + }); + }); + + pit('returns JS bundle source on request of *.bundle (compat)',function() { + return makeRequest( + requestHandler, + 'mybundle.runModule.bundle' ).then(function(response) { expect(response).toEqual('this is the source'); }); @@ -82,7 +91,7 @@ describe('processRequest', function() { pit('returns sourcemap on request of *.map', function() { return makeRequest( requestHandler, - 'mybundle.includeRequire.runModule.bundle.map' + 'mybundle.map?runModule=true' ).then(function(response) { expect(response).toEqual('"this is the source map"'); }); @@ -91,8 +100,8 @@ describe('processRequest', function() { pit('watches all files in projectRoot', function() { return makeRequest( requestHandler, - 'mybundle.includeRequire.runModule.bundle' - ).then(function(response) { + 'mybundle.bundle?runModule=true' + ).then(function() { expect(watcherFunc.mock.calls[0][0]).toEqual('all'); expect(watcherFunc.mock.calls[0][1]).not.toBe(null); }); @@ -114,8 +123,8 @@ describe('processRequest', function() { pit('invalides files in package when file is updated', function() { return makeRequest( requestHandler, - 'mybundle.includeRequire.runModule.bundle' - ).then(function(response) { + 'mybundle.bundle?runModule=true' + ).then(function() { var onFileChange = watcherFunc.mock.calls[0][1]; onFileChange('all','path/file.js', options.projectRoots[0]); expect(invalidatorFunc.mock.calls[0][0]).toEqual('root/path/file.js'); @@ -150,7 +159,7 @@ describe('processRequest', function() { requestHandler = server.processRequest.bind(server); - return makeRequest(requestHandler,'mybundle.includeRequire.runModule.bundle') + return makeRequest(requestHandler, 'mybundle.bundle?runModule=true') .then(function(response) { expect(response).toEqual('this is the first source'); expect(packageFunc.mock.calls.length).toBe(1); @@ -159,7 +168,7 @@ describe('processRequest', function() { }) .then(function() { expect(packageFunc.mock.calls.length).toBe(2); - return makeRequest(requestHandler,'mybundle.includeRequire.runModule.bundle') + return makeRequest(requestHandler, 'mybundle.bundle?runModule=true') .then(function(response) { expect(response).toEqual('this is the rebuilt source'); }); diff --git a/packager/react-packager/src/Server/index.js b/packager/react-packager/src/Server/index.js index 83592fea9..406357217 100644 --- a/packager/react-packager/src/Server/index.js +++ b/packager/react-packager/src/Server/index.js @@ -77,7 +77,7 @@ Server.prototype._rebuildPackages = function() { var buildPackage = this._buildPackage.bind(this); var packages = this._packages; Object.keys(packages).forEach(function(key) { - var options = getOptionsFromPath(url.parse(key).pathname); + var options = getOptionsFromUrl(key); packages[key] = buildPackage(options).then(function(p) { // Make a throwaway call to getSource to cache the source string. p.getSource({inlineSourceMap: dev}); @@ -102,7 +102,7 @@ Server.prototype._buildPackage = function(options) { }; Server.prototype.buildPackageFromUrl = function(reqUrl) { - var options = getOptionsFromPath(url.parse(reqUrl).pathname); + var options = getOptionsFromUrl(reqUrl); return this._buildPackage(options); }; @@ -145,21 +145,26 @@ Server.prototype._processDebugRequest = function(reqUrl, res) { }; Server.prototype.processRequest = function(req, res, next) { + var urlObj = url.parse(req.url, true); + var pathname = urlObj.pathname; + var requestType; - if (req.url.match(/\.bundle$/)) { + if (pathname.match(/\.bundle$/)) { requestType = 'bundle'; - } else if (req.url.match(/\.map$/)) { + } else if (pathname.match(/\.map$/)) { requestType = 'map'; - } else if (req.url.match(/^\/debug/)) { + } else if (pathname.match(/^\/debug/)) { this._processDebugRequest(req.url, res); return; } else { - return next(); + next(); + return; } var startReqEventId = Activity.startEvent('request:' + req.url); - var options = getOptionsFromPath(url.parse(req.url).pathname); + var options = getOptionsFromUrl(req.url); var building = this._packages[req.url] || this._buildPackage(options); + this._packages[req.url] = building; var dev = this._dev; building.then( @@ -178,16 +183,25 @@ Server.prototype.processRequest = function(req, res, next) { ).done(); }; -function getOptionsFromPath(pathname) { - var parts = pathname.split('.'); - // Remove the leading slash. - var main = parts[0].slice(1) + '.js'; +function getOptionsFromUrl(reqUrl) { + // `true` to parse the query param as an object. + var urlObj = url.parse(reqUrl, true); + + var match = urlObj.pathname.match(/^\/?([^\.]+)\..*(bundle|map)$/); + if (!(match && match[1])) { + throw new Error('Invalid url format, expected "/path/to/file.bundle"'); + } + var main = match[1] + '.js'; + return { - runModule: parts.slice(1).some(function(part) { - return part === 'runModule'; - }), + sourceMapUrl: urlObj.pathname.replace(/\.bundle$/, '.map'), main: main, - sourceMapUrl: parts.slice(0, -1).join('.') + '.map' + runModule: urlObj.query.runModule === 'true' || + urlObj.query.runModule === '1' || + // Backwards compatibility. + urlObj.pathname.split('.').some(function(part) { + return part === 'runModule'; + }), }; } From b05ca6e604613cdacdfcbe7019f699e8fa9f465f Mon Sep 17 00:00:00 2001 From: "Kenny Dits @kenny_dee" Date: Thu, 5 Mar 2015 09:26:32 +0100 Subject: [PATCH 15/79] Add the temporary react-docgen instruction --- website/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/website/README.md b/website/README.md index f581dd5b7..37a326df2 100644 --- a/website/README.md +++ b/website/README.md @@ -6,6 +6,14 @@ The first time, get all the dependencies loaded via npm install ``` +You also have to run `npm install` inside the `react-docgen` folder. This is only temporary until `react-docgen` is available as npm module. + +``` +cd react-docgen +npm install +cd .. +``` + Then, run the server via ``` From c0b0111e3a9df2461242e97338dba7b1a61042b3 Mon Sep 17 00:00:00 2001 From: Felix Kling Date: Thu, 5 Mar 2015 00:37:02 -0800 Subject: [PATCH 16/79] Update react-docgen --- .../handlers/__tests__/propDocblockHandler-test.js | 12 ++++++++++++ .../lib/handlers/__tests__/propTypeHandler-test.js | 12 ++++++++++++ .../react-docgen/lib/handlers/propDocBlockHandler.js | 6 +++++- website/react-docgen/lib/handlers/propTypeHandler.js | 6 +++++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/website/react-docgen/lib/handlers/__tests__/propDocblockHandler-test.js b/website/react-docgen/lib/handlers/__tests__/propDocblockHandler-test.js index 0fe18d228..74eb03fb5 100644 --- a/website/react-docgen/lib/handlers/__tests__/propDocblockHandler-test.js +++ b/website/react-docgen/lib/handlers/__tests__/propDocblockHandler-test.js @@ -180,4 +180,16 @@ describe('propDocblockHandler', function() { } }); }); + + it('does not error if propTypes cannot be found', function() { + var definition = parse([ + '({', + ' fooBar: 42', + '})', + ].join('\n')); + + expect(function() { + propDocblockHandler(documentation, definition); + }).not.toThrow(); + }); }); diff --git a/website/react-docgen/lib/handlers/__tests__/propTypeHandler-test.js b/website/react-docgen/lib/handlers/__tests__/propTypeHandler-test.js index 79b06bc96..529f73cf2 100644 --- a/website/react-docgen/lib/handlers/__tests__/propTypeHandler-test.js +++ b/website/react-docgen/lib/handlers/__tests__/propTypeHandler-test.js @@ -188,4 +188,16 @@ describe('propTypeHandler', function() { }, }); }); + + it('does not error if propTypes cannot be found', function() { + var definition = parse([ + '({', + ' fooBar: 42', + '})', + ].join('\n')); + + expect(function() { + propTypeHandler(documentation, definition); + }).not.toThrow(); + }); }); diff --git a/website/react-docgen/lib/handlers/propDocBlockHandler.js b/website/react-docgen/lib/handlers/propDocBlockHandler.js index 940c66fa4..0a2d04c8f 100644 --- a/website/react-docgen/lib/handlers/propDocBlockHandler.js +++ b/website/react-docgen/lib/handlers/propDocBlockHandler.js @@ -22,7 +22,11 @@ var types = require('recast').types.namedTypes; var resolveToValue = require('../utils/resolveToValue'); function propDocBlockHandler(documentation: Documentation, path: NodePath) { - var propTypesPath = resolveToValue(getPropertyValuePath(path, 'propTypes')); + var propTypesPath = getPropertyValuePath(path, 'propTypes'); + if (!propTypesPath) { + return; + } + propTypesPath = resolveToValue(propTypesPath); if (!propTypesPath || !types.ObjectExpression.check(propTypesPath.node)) { return; } diff --git a/website/react-docgen/lib/handlers/propTypeHandler.js b/website/react-docgen/lib/handlers/propTypeHandler.js index ec1abe86a..e1fe72838 100644 --- a/website/react-docgen/lib/handlers/propTypeHandler.js +++ b/website/react-docgen/lib/handlers/propTypeHandler.js @@ -100,7 +100,11 @@ function amendPropTypes(documentation, path) { } function propTypeHandler(documentation: Documentation, path: NodePath) { - var propTypesPath = resolveToValue(getPropertyValuePath(path, 'propTypes')); + var propTypesPath = getPropertyValuePath(path, 'propTypes'); + if (!propTypesPath) { + return; + } + propTypesPath = resolveToValue(propTypesPath); if (!propTypesPath || !types.ObjectExpression.check(propTypesPath.node)) { return; } From 61b8c61903c95dbd38281f45fc16a4fd67fa32ca Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Fri, 6 Mar 2015 09:54:10 -0800 Subject: [PATCH 17/79] Updates from Thu Mar 5 - [react_native] JS files for D1885531 | Martin Konicek - Ported TabBarIOS to OSS and unified implementation | Nick Lockwood - [react-packager] Add minify option as query param | Amjad Masad - [ReactNative] Fix ExpandingText prop types | Christopher Chedeau - [react-packager] Make dev a query param option | Amjad Masad --- .../Movies/Movies.xcodeproj/project.pbxproj | 98 +++++----- .../TicTacToe.xcodeproj/project.pbxproj | 78 +++----- Examples/UIExplorer/TabBarExample.js | 101 ++++++++++ .../UIExplorer.xcodeproj/project.pbxproj | 176 +++++++++--------- Examples/UIExplorer/UIExplorerList.js | 1 + .../Components/TabBarIOS/TabBarIOS.android.js | 29 +++ .../Components/TabBarIOS/TabBarIOS.ios.js | 36 ++++ .../TabBarIOS/TabBarItemIOS.android.js | 38 ++++ .../Components/TabBarIOS/TabBarItemIOS.ios.js | 94 ++++++++++ Libraries/Components/View/View.js | 2 +- Libraries/Image/RCTGIFImage.h | 8 + Libraries/Image/RCTGIFImage.m | 91 +++++++++ .../project.pbxproj | 50 +++-- Libraries/Image/RCTImageDownloader.m | 28 ++- Libraries/Image/RCTNetworkImageView.m | 5 +- Libraries/Image/RCTNetworkImageViewManager.m | 1 - .../Image}/RCTStaticImage.h | 0 .../Image}/RCTStaticImage.m | 0 .../Image}/RCTStaticImageManager.h | 0 .../Image}/RCTStaticImageManager.m | 6 +- .../project.pbxproj | 24 +-- Libraries/Text/ExpandingText.js | 46 +++-- Libraries/Text/Text.js | 4 + ReactKit/Base/RCTConvert.h | 15 +- ReactKit/Base/RCTConvert.m | 91 +-------- ReactKit/Modules/RCTUIManager.m | 4 +- ReactKit/ReactKit.xcodeproj/project.pbxproj | 58 +++--- ReactKit/{Base => Views}/RCTAnimationType.h | 0 .../{Base => Views}/RCTAutoInsetsProtocol.h | 0 ReactKit/Views/RCTNavigator.m | 27 +-- ReactKit/Views/RCTNavigatorManager.m | 18 +- ReactKit/{Base => Views}/RCTPointerEvents.h | 0 ReactKit/Views/RCTScrollViewManager.m | 3 +- .../{Base => Views}/RCTScrollableProtocol.h | 0 ReactKit/Views/RCTShadowView.m | 5 + ReactKit/Views/RCTTabBar.h | 11 ++ ReactKit/Views/RCTTabBar.m | 139 ++++++++++++++ ReactKit/Views/RCTTabBarItem.h | 11 ++ ReactKit/Views/RCTTabBarItem.m | 83 +++++++++ ReactKit/Views/RCTTabBarItemManager.h | 7 + ReactKit/Views/RCTTabBarItemManager.m | 25 +++ ReactKit/Views/RCTTabBarManager.h | 7 + ReactKit/Views/RCTTabBarManager.m | 17 ++ ReactKit/Views/RCTTextFieldManager.m | 2 +- ReactKit/Views/RCTView.h | 8 +- ReactKit/Views/RCTView.m | 21 +-- ReactKit/Views/RCTViewControllerProtocol.h | 13 ++ ReactKit/Views/RCTViewManager.h | 8 - ReactKit/Views/RCTViewManager.m | 5 - .../{Base => Views}/RCTViewNodeProtocol.h | 7 + ReactKit/Views/RCTWrapperViewController.h | 8 +- ReactKit/Views/RCTWrapperViewController.m | 121 +++++++----- ReactKit/Views/UIView+ReactKit.h | 13 ++ ReactKit/Views/UIView+ReactKit.m | 35 +++- packager/packager.js | 7 +- .../__tests__/HasteDependencyResolver-test.js | 10 +- .../src/DependencyResolver/haste/index.js | 68 +++---- .../react-packager/src/JSTransformer/index.js | 4 - .../react-packager/src/Packager/Package.js | 55 +++++- packager/react-packager/src/Packager/index.js | 14 +- packager/react-packager/src/Server/index.js | 31 +-- .../react-packager/src/lib/declareOpts.js | 2 + 62 files changed, 1290 insertions(+), 579 deletions(-) create mode 100644 Examples/UIExplorer/TabBarExample.js create mode 100644 Libraries/Components/TabBarIOS/TabBarIOS.android.js create mode 100644 Libraries/Components/TabBarIOS/TabBarIOS.ios.js create mode 100644 Libraries/Components/TabBarIOS/TabBarItemIOS.android.js create mode 100644 Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js create mode 100644 Libraries/Image/RCTGIFImage.h create mode 100644 Libraries/Image/RCTGIFImage.m rename Libraries/Image/{RCTNetworkImage.xcodeproj => RCTImage.xcodeproj}/project.pbxproj (74%) rename {ReactKit/Views => Libraries/Image}/RCTStaticImage.h (100%) rename {ReactKit/Views => Libraries/Image}/RCTStaticImage.m (100%) rename {ReactKit/Views => Libraries/Image}/RCTStaticImageManager.h (100%) rename {ReactKit/Views => Libraries/Image}/RCTStaticImageManager.m (88%) rename Libraries/Network/{RCTDataManager.xcodeproj => RCTNetwork.xcodeproj}/project.pbxproj (91%) rename ReactKit/{Base => Views}/RCTAnimationType.h (100%) rename ReactKit/{Base => Views}/RCTAutoInsetsProtocol.h (100%) rename ReactKit/{Base => Views}/RCTPointerEvents.h (100%) rename ReactKit/{Base => Views}/RCTScrollableProtocol.h (100%) create mode 100644 ReactKit/Views/RCTTabBar.h create mode 100644 ReactKit/Views/RCTTabBar.m create mode 100644 ReactKit/Views/RCTTabBarItem.h create mode 100644 ReactKit/Views/RCTTabBarItem.m create mode 100644 ReactKit/Views/RCTTabBarItemManager.h create mode 100644 ReactKit/Views/RCTTabBarItemManager.m create mode 100644 ReactKit/Views/RCTTabBarManager.h create mode 100644 ReactKit/Views/RCTTabBarManager.m create mode 100644 ReactKit/Views/RCTViewControllerProtocol.h rename ReactKit/{Base => Views}/RCTViewNodeProtocol.h (77%) diff --git a/Examples/Movies/Movies.xcodeproj/project.pbxproj b/Examples/Movies/Movies.xcodeproj/project.pbxproj index 00dd93007..5d450af8b 100644 --- a/Examples/Movies/Movies.xcodeproj/project.pbxproj +++ b/Examples/Movies/Movies.xcodeproj/project.pbxproj @@ -7,23 +7,30 @@ objects = { /* Begin PBXBuildFile section */ + 1341801E1AA91750003F314A /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1341801B1AA91740003F314A /* libRCTNetwork.a */; }; + 13442C061AA90EA00037E5B0 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13442C051AA90E7D0037E5B0 /* libRCTImage.a */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 58C572691AA6239800CDF9C8 /* libRCTDataManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C572631AA6236600CDF9C8 /* libRCTDataManager.a */; }; - 58C5726A1AA6239B00CDF9C8 /* libRCTNetworkImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C572561AA6236500CDF9C8 /* libRCTNetworkImage.a */; }; 58C5726B1AA6239E00CDF9C8 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C5725B1AA6236500CDF9C8 /* libRCTText.a */; }; 58C5726C1AA623A200CDF9C8 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C572681AA6236600CDF9C8 /* libReactKit.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 58C572551AA6236500CDF9C8 /* PBXContainerItemProxy */ = { + 1341801A1AA91740003F314A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 587650F31A9EB120008B8F17 /* RCTNetworkImage.xcodeproj */; + containerPortal = 134180151AA91740003F314A /* RCTNetwork.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511DB1A9E6C8500147676; + remoteInfo = RCTNetwork; + }; + 13442C041AA90E7D0037E5B0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 13442C001AA90E7D0037E5B0 /* RCTImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = 58B5115D1A9E6B3D00147676; - remoteInfo = RCTNetworkImage; + remoteInfo = RCTImage; }; 58C5725A1AA6236500CDF9C8 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; @@ -32,13 +39,6 @@ remoteGlobalIDString = 58B5119B1A9E6C1200147676; remoteInfo = RCTText; }; - 58C572621AA6236600CDF9C8 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 587650F01A9EB120008B8F17 /* RCTDataManager.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B511DB1A9E6C8500147676; - remoteInfo = RCTDataManager; - }; 58C572671AA6236600CDF9C8 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 587650F91A9EB120008B8F17 /* ReactKit.xcodeproj */; @@ -49,6 +49,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 134180151AA91740003F314A /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = ../../Libraries/Network/RCTNetwork.xcodeproj; sourceTree = ""; }; + 13442C001AA90E7D0037E5B0 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = ../../Libraries/Image/RCTImage.xcodeproj; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* Movies.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Movies.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; @@ -56,8 +58,6 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 587650F01A9EB120008B8F17 /* RCTDataManager.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTDataManager.xcodeproj; path = ../../Libraries/Network/RCTDataManager.xcodeproj; sourceTree = SOURCE_ROOT; }; - 587650F31A9EB120008B8F17 /* RCTNetworkImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetworkImage.xcodeproj; path = ../../Libraries/Image/RCTNetworkImage.xcodeproj; sourceTree = SOURCE_ROOT; }; 587650F61A9EB120008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = SOURCE_ROOT; }; 587650F91A9EB120008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ @@ -67,8 +67,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 58C572691AA6239800CDF9C8 /* libRCTDataManager.a in Frameworks */, - 58C5726A1AA6239B00CDF9C8 /* libRCTNetworkImage.a in Frameworks */, + 1341801E1AA91750003F314A /* libRCTNetwork.a in Frameworks */, + 13442C061AA90EA00037E5B0 /* libRCTImage.a in Frameworks */, 58C5726B1AA6239E00CDF9C8 /* libRCTText.a in Frameworks */, 58C5726C1AA623A200CDF9C8 /* libReactKit.a in Frameworks */, ); @@ -77,6 +77,22 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 134180161AA91740003F314A /* Products */ = { + isa = PBXGroup; + children = ( + 1341801B1AA91740003F314A /* libRCTNetwork.a */, + ); + name = Products; + sourceTree = ""; + }; + 13442C011AA90E7D0037E5B0 /* Products */ = { + isa = PBXGroup; + children = ( + 13442C051AA90E7D0037E5B0 /* libRCTImage.a */, + ); + name = Products; + sourceTree = ""; + }; 13B07FAE1A68108700A75B9A /* Movies */ = { isa = PBXGroup; children = ( @@ -93,22 +109,14 @@ 58C571FC1AA6124500CDF9C8 /* Libraries */ = { isa = PBXGroup; children = ( - 587650F01A9EB120008B8F17 /* RCTDataManager.xcodeproj */, - 587650F31A9EB120008B8F17 /* RCTNetworkImage.xcodeproj */, + 134180151AA91740003F314A /* RCTNetwork.xcodeproj */, + 13442C001AA90E7D0037E5B0 /* RCTImage.xcodeproj */, 587650F61A9EB120008B8F17 /* RCTText.xcodeproj */, 587650F91A9EB120008B8F17 /* ReactKit.xcodeproj */, ); name = Libraries; sourceTree = ""; }; - 58C572521AA6236500CDF9C8 /* Products */ = { - isa = PBXGroup; - children = ( - 58C572561AA6236500CDF9C8 /* libRCTNetworkImage.a */, - ); - name = Products; - sourceTree = ""; - }; 58C572571AA6236500CDF9C8 /* Products */ = { isa = PBXGroup; children = ( @@ -125,14 +133,6 @@ name = Products; sourceTree = ""; }; - 58C5725E1AA6236500CDF9C8 /* Products */ = { - isa = PBXGroup; - children = ( - 58C572631AA6236600CDF9C8 /* libRCTDataManager.a */, - ); - name = Products; - sourceTree = ""; - }; 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( @@ -192,12 +192,12 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 58C5725E1AA6236500CDF9C8 /* Products */; - ProjectRef = 587650F01A9EB120008B8F17 /* RCTDataManager.xcodeproj */; + ProductGroup = 13442C011AA90E7D0037E5B0 /* Products */; + ProjectRef = 13442C001AA90E7D0037E5B0 /* RCTImage.xcodeproj */; }, { - ProductGroup = 58C572521AA6236500CDF9C8 /* Products */; - ProjectRef = 587650F31A9EB120008B8F17 /* RCTNetworkImage.xcodeproj */; + ProductGroup = 134180161AA91740003F314A /* Products */; + ProjectRef = 134180151AA91740003F314A /* RCTNetwork.xcodeproj */; }, { ProductGroup = 58C572571AA6236500CDF9C8 /* Products */; @@ -216,11 +216,18 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 58C572561AA6236500CDF9C8 /* libRCTNetworkImage.a */ = { + 1341801B1AA91740003F314A /* libRCTNetwork.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libRCTNetworkImage.a; - remoteRef = 58C572551AA6236500CDF9C8 /* PBXContainerItemProxy */; + path = libRCTNetwork.a; + remoteRef = 1341801A1AA91740003F314A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 13442C051AA90E7D0037E5B0 /* libRCTImage.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTImage.a; + remoteRef = 13442C041AA90E7D0037E5B0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; 58C5725B1AA6236500CDF9C8 /* libRCTText.a */ = { @@ -230,13 +237,6 @@ remoteRef = 58C5725A1AA6236500CDF9C8 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 58C572631AA6236600CDF9C8 /* libRCTDataManager.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTDataManager.a; - remoteRef = 58C572621AA6236600CDF9C8 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 58C572681AA6236600CDF9C8 /* libReactKit.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -295,6 +295,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", + "/Users/nicklockwood/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/Network/build/Debug-iphoneos", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = Movies; @@ -314,6 +315,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", + "/Users/nicklockwood/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/Network/build/Debug-iphoneos", ); OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = Movies; diff --git a/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj b/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj index 4d0d681de..7cc9c357b 100644 --- a/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj +++ b/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj @@ -7,29 +7,22 @@ objects = { /* Begin PBXBuildFile section */ + 1341803E1AA91802003F314A /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1341803D1AA917ED003F314A /* libRCTImage.a */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 58C571F31AA611C900CDF9C8 /* libRCTNetworkImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C571ED1AA611BA00CDF9C8 /* libRCTNetworkImage.a */; }; 58C572501AA6229900CDF9C8 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C572471AA6224300CDF9C8 /* libReactKit.a */; }; 58C572511AA6229D00CDF9C8 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C5724D1AA6224400CDF9C8 /* libRCTText.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 58C571EC1AA611BA00CDF9C8 /* PBXContainerItemProxy */ = { + 1341803C1AA917ED003F314A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 58C571E71AA611BA00CDF9C8 /* RCTNetworkImage.xcodeproj */; + containerPortal = 134180381AA917ED003F314A /* RCTImage.xcodeproj */; proxyType = 2; remoteGlobalIDString = 58B5115D1A9E6B3D00147676; - remoteInfo = RCTNetworkImage; - }; - 58C571EE1AA611BA00CDF9C8 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 58C571E71AA611BA00CDF9C8 /* RCTNetworkImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B511681A9E6B3D00147676; - remoteInfo = RCTNetworkImageTests; + remoteInfo = RCTImage; }; 58C572461AA6224300CDF9C8 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; @@ -45,16 +38,10 @@ remoteGlobalIDString = 58B5119B1A9E6C1200147676; remoteInfo = RCTText; }; - 58C5724E1AA6224400CDF9C8 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B511A61A9E6C1300147676; - remoteInfo = RCTTextTests; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 134180381AA917ED003F314A /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = ../../Libraries/Image/RCTImage.xcodeproj; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* TicTacToe.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TicTacToe.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; @@ -64,7 +51,6 @@ 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = ""; }; - 58C571E71AA611BA00CDF9C8 /* RCTNetworkImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetworkImage.xcodeproj; path = ../../Libraries/Image/RCTNetworkImage.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -72,7 +58,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 58C571F31AA611C900CDF9C8 /* libRCTNetworkImage.a in Frameworks */, + 1341803E1AA91802003F314A /* libRCTImage.a in Frameworks */, 58C572501AA6229900CDF9C8 /* libReactKit.a in Frameworks */, 58C572511AA6229D00CDF9C8 /* libRCTText.a in Frameworks */, ); @@ -81,6 +67,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 134180391AA917ED003F314A /* Products */ = { + isa = PBXGroup; + children = ( + 1341803D1AA917ED003F314A /* libRCTImage.a */, + ); + name = Products; + sourceTree = ""; + }; 13B07FAE1A68108700A75B9A /* TicTacToe */ = { isa = PBXGroup; children = ( @@ -94,19 +88,10 @@ name = TicTacToe; sourceTree = ""; }; - 58C571E81AA611BA00CDF9C8 /* Products */ = { - isa = PBXGroup; - children = ( - 58C571ED1AA611BA00CDF9C8 /* libRCTNetworkImage.a */, - 58C571EF1AA611BA00CDF9C8 /* RCTNetworkImageTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; 58C572071AA6126D00CDF9C8 /* Libraries */ = { isa = PBXGroup; children = ( - 58C571E71AA611BA00CDF9C8 /* RCTNetworkImage.xcodeproj */, + 134180381AA917ED003F314A /* RCTImage.xcodeproj */, 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */, 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */, ); @@ -125,7 +110,6 @@ isa = PBXGroup; children = ( 58C5724D1AA6224400CDF9C8 /* libRCTText.a */, - 58C5724F1AA6224400CDF9C8 /* RCTTextTests.xctest */, ); name = Products; sourceTree = ""; @@ -189,8 +173,8 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 58C571E81AA611BA00CDF9C8 /* Products */; - ProjectRef = 58C571E71AA611BA00CDF9C8 /* RCTNetworkImage.xcodeproj */; + ProductGroup = 134180391AA917ED003F314A /* Products */; + ProjectRef = 134180381AA917ED003F314A /* RCTImage.xcodeproj */; }, { ProductGroup = 58C572481AA6224300CDF9C8 /* Products */; @@ -209,18 +193,11 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 58C571ED1AA611BA00CDF9C8 /* libRCTNetworkImage.a */ = { + 1341803D1AA917ED003F314A /* libRCTImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libRCTNetworkImage.a; - remoteRef = 58C571EC1AA611BA00CDF9C8 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 58C571EF1AA611BA00CDF9C8 /* RCTNetworkImageTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = RCTNetworkImageTests.xctest; - remoteRef = 58C571EE1AA611BA00CDF9C8 /* PBXContainerItemProxy */; + path = libRCTImage.a; + remoteRef = 1341803C1AA917ED003F314A /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; 58C572471AA6224300CDF9C8 /* libReactKit.a */ = { @@ -237,13 +214,6 @@ remoteRef = 58C5724C1AA6224400CDF9C8 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 58C5724F1AA6224400CDF9C8 /* RCTTextTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = RCTTextTests.xctest; - remoteRef = 58C5724E1AA6224400CDF9C8 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -288,9 +258,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = TicTacToe; }; @@ -302,9 +270,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = TicTacToe; }; diff --git a/Examples/UIExplorer/TabBarExample.js b/Examples/UIExplorer/TabBarExample.js new file mode 100644 index 000000000..22dc86a8b --- /dev/null +++ b/Examples/UIExplorer/TabBarExample.js @@ -0,0 +1,101 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule TabBarExample + */ +'use strict'; + +var React = require('React'); +var TabBarIOS = require('TabBarIOS'); +var TabBarItemIOS = require('TabBarItemIOS'); +var StyleSheet = require('StyleSheet'); +var Text = require('Text'); +var View = require('View'); + +var ix = require('ix'); + +var TabBarExample = React.createClass({ + + statics: { + title: '', + description: 'Tab-based navigation.' + }, + + getInitialState: function() { + return { + selectedTab: 'redTab', + notifCount: 0, + presses: 0, + }; + }, + + _renderContent: function(color, pageText) { + return ( + + {pageText} + {this.state.presses} re-renders of this tab + + ); + }, + + render: function() { + return ( + + { + this.setState({ + selectedTab: 'blueTab', + }); + }}> + {this._renderContent('#414A8C', 'Blue Tab')} + + { + this.setState({ + selectedTab: 'redTab', + notifCount: this.state.notifCount + 1, + }); + }}> + {this._renderContent('#783E33', 'Red Tab')} + + { + this.setState({ + selectedTab: 'greenTab', + presses: this.state.presses + 1 + }); + }}> + {this._renderContent('#21551C', 'Green Tab')} + + + ); + }, + +}); + +var styles = StyleSheet.create({ + tabContent: { + flex: 1, + alignItems: 'center', + }, + tabText: { + color: 'white', + margin: 50, + }, +}); + +module.exports = TabBarExample; diff --git a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj index daa467234..942ec24b0 100644 --- a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj +++ b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj @@ -7,48 +7,52 @@ objects = { /* Begin PBXBuildFile section */ - 1316A21A1AA397CA00C0188E /* libRCTNetworkImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1316A2101AA3871A00C0188E /* libRCTNetworkImage.a */; }; - 1316A21B1AA397CA00C0188E /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1316A2081AA386C700C0188E /* libRCTText.a */; }; - 1316A21C1AA397CA00C0188E /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1316A2171AA3875D00C0188E /* libReactKit.a */; }; + 13417FE91AA91432003F314A /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FE81AA91428003F314A /* libRCTImage.a */; }; + 134180011AA9153C003F314A /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FEF1AA914B8003F314A /* libRCTText.a */; }; + 134180021AA9153C003F314A /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FFF1AA91531003F314A /* libReactKit.a */; }; + 1341802C1AA9178B003F314A /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1341802B1AA91779003F314A /* libRCTNetwork.a */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 58C572891AA624A900CDF9C8 /* libRCTDataManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C572851AA6249E00CDF9C8 /* libRCTDataManager.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1316A2071AA386C700C0188E /* PBXContainerItemProxy */ = { + 13417FE71AA91428003F314A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */; + containerPortal = 13417FE31AA91428003F314A /* RCTImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B5115D1A9E6B3D00147676; + remoteInfo = RCTImage; + }; + 13417FEE1AA914B8003F314A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */; proxyType = 2; remoteGlobalIDString = 58B5119B1A9E6C1200147676; remoteInfo = RCTText; }; - 1316A20F1AA3871A00C0188E /* PBXContainerItemProxy */ = { + 13417FFE1AA91531003F314A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 58B5115D1A9E6B3D00147676; - remoteInfo = RCTNetworkImage; - }; - 1316A2161AA3875D00C0188E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 587651221A9EB168008B8F17 /* ReactKit.xcodeproj */; + containerPortal = 13417FFA1AA91531003F314A /* ReactKit.xcodeproj */; proxyType = 2; remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; remoteInfo = ReactKit; }; - 58C572841AA6249E00CDF9C8 /* PBXContainerItemProxy */ = { + 1341802A1AA91779003F314A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */; + containerPortal = 134180261AA91779003F314A /* RCTNetwork.xcodeproj */; proxyType = 2; remoteGlobalIDString = 58B511DB1A9E6C8500147676; - remoteInfo = RCTDataManager; + remoteInfo = RCTNetwork; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 13417FE31AA91428003F314A /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = ../../Libraries/Image/RCTImage.xcodeproj; sourceTree = ""; }; + 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; + 13417FFA1AA91531003F314A /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = ""; }; + 134180261AA91779003F314A /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = ../../Libraries/Network/RCTNetwork.xcodeproj; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* UIExplorer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UIExplorer.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; @@ -56,10 +60,6 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetworkImage.xcodeproj; path = ../../Libraries/Image/RCTNetworkImage.xcodeproj; sourceTree = SOURCE_ROOT; }; - 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = SOURCE_ROOT; }; - 587651221A9EB168008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = SOURCE_ROOT; }; - 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTDataManager.xcodeproj; path = ../../Libraries/Network/RCTDataManager.xcodeproj; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -67,51 +67,59 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 1316A21A1AA397CA00C0188E /* libRCTNetworkImage.a in Frameworks */, - 1316A21B1AA397CA00C0188E /* libRCTText.a in Frameworks */, - 58C572891AA624A900CDF9C8 /* libRCTDataManager.a in Frameworks */, - 1316A21C1AA397CA00C0188E /* libReactKit.a in Frameworks */, + 1341802C1AA9178B003F314A /* libRCTNetwork.a in Frameworks */, + 134180011AA9153C003F314A /* libRCTText.a in Frameworks */, + 134180021AA9153C003F314A /* libReactKit.a in Frameworks */, + 13417FE91AA91432003F314A /* libRCTImage.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 1316A2031AA386C700C0188E /* Products */ = { - isa = PBXGroup; - children = ( - 1316A2081AA386C700C0188E /* libRCTText.a */, - ); - name = Products; - sourceTree = ""; - }; - 1316A20B1AA3871A00C0188E /* Products */ = { - isa = PBXGroup; - children = ( - 1316A2101AA3871A00C0188E /* libRCTNetworkImage.a */, - ); - name = Products; - sourceTree = ""; - }; - 1316A2131AA3875D00C0188E /* Products */ = { - isa = PBXGroup; - children = ( - 1316A2171AA3875D00C0188E /* libReactKit.a */, - ); - name = Products; - sourceTree = ""; - }; 1316A21D1AA397F400C0188E /* Libraries */ = { isa = PBXGroup; children = ( - 587651221A9EB168008B8F17 /* ReactKit.xcodeproj */, - 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */, - 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */, - 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */, + 13417FFA1AA91531003F314A /* ReactKit.xcodeproj */, + 134180261AA91779003F314A /* RCTNetwork.xcodeproj */, + 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */, + 13417FE31AA91428003F314A /* RCTImage.xcodeproj */, ); name = Libraries; sourceTree = ""; }; + 13417FE41AA91428003F314A /* Products */ = { + isa = PBXGroup; + children = ( + 13417FE81AA91428003F314A /* libRCTImage.a */, + ); + name = Products; + sourceTree = ""; + }; + 13417FEB1AA914B8003F314A /* Products */ = { + isa = PBXGroup; + children = ( + 13417FEF1AA914B8003F314A /* libRCTText.a */, + ); + name = Products; + sourceTree = ""; + }; + 13417FFB1AA91531003F314A /* Products */ = { + isa = PBXGroup; + children = ( + 13417FFF1AA91531003F314A /* libReactKit.a */, + ); + name = Products; + sourceTree = ""; + }; + 134180271AA91779003F314A /* Products */ = { + isa = PBXGroup; + children = ( + 1341802B1AA91779003F314A /* libRCTNetwork.a */, + ); + name = Products; + sourceTree = ""; + }; 13B07FAE1A68108700A75B9A /* UIExplorer */ = { isa = PBXGroup; children = ( @@ -125,14 +133,6 @@ name = UIExplorer; sourceTree = ""; }; - 58C572811AA6249E00CDF9C8 /* Products */ = { - isa = PBXGroup; - children = ( - 58C572851AA6249E00CDF9C8 /* libRCTDataManager.a */, - ); - name = Products; - sourceTree = ""; - }; 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( @@ -192,20 +192,20 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 58C572811AA6249E00CDF9C8 /* Products */; - ProjectRef = 587651491A9F8619008B8F17 /* RCTDataManager.xcodeproj */; + ProductGroup = 13417FE41AA91428003F314A /* Products */; + ProjectRef = 13417FE31AA91428003F314A /* RCTImage.xcodeproj */; }, { - ProductGroup = 1316A20B1AA3871A00C0188E /* Products */; - ProjectRef = 5876511C1A9EB168008B8F17 /* RCTNetworkImage.xcodeproj */; + ProductGroup = 134180271AA91779003F314A /* Products */; + ProjectRef = 134180261AA91779003F314A /* RCTNetwork.xcodeproj */; }, { - ProductGroup = 1316A2031AA386C700C0188E /* Products */; - ProjectRef = 5876511F1A9EB168008B8F17 /* RCTText.xcodeproj */; + ProductGroup = 13417FEB1AA914B8003F314A /* Products */; + ProjectRef = 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */; }, { - ProductGroup = 1316A2131AA3875D00C0188E /* Products */; - ProjectRef = 587651221A9EB168008B8F17 /* ReactKit.xcodeproj */; + ProductGroup = 13417FFB1AA91531003F314A /* Products */; + ProjectRef = 13417FFA1AA91531003F314A /* ReactKit.xcodeproj */; }, ); projectRoot = ""; @@ -216,32 +216,32 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 1316A2081AA386C700C0188E /* libRCTText.a */ = { + 13417FE81AA91428003F314A /* libRCTImage.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTImage.a; + remoteRef = 13417FE71AA91428003F314A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 13417FEF1AA914B8003F314A /* libRCTText.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libRCTText.a; - remoteRef = 1316A2071AA386C700C0188E /* PBXContainerItemProxy */; + remoteRef = 13417FEE1AA914B8003F314A /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1316A2101AA3871A00C0188E /* libRCTNetworkImage.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTNetworkImage.a; - remoteRef = 1316A20F1AA3871A00C0188E /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 1316A2171AA3875D00C0188E /* libReactKit.a */ = { + 13417FFF1AA91531003F314A /* libReactKit.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libReactKit.a; - remoteRef = 1316A2161AA3875D00C0188E /* PBXContainerItemProxy */; + remoteRef = 13417FFE1AA91531003F314A /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 58C572851AA6249E00CDF9C8 /* libRCTDataManager.a */ = { + 1341802B1AA91779003F314A /* libRCTNetwork.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libRCTDataManager.a; - remoteRef = 58C572841AA6249E00CDF9C8 /* PBXContainerItemProxy */; + path = libRCTNetwork.a; + remoteRef = 1341802A1AA91779003F314A /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -293,9 +293,7 @@ ); INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = UIExplorer; }; @@ -312,9 +310,7 @@ ); INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = UIExplorer; }; diff --git a/Examples/UIExplorer/UIExplorerList.js b/Examples/UIExplorer/UIExplorerList.js index f6d55db36..606840567 100644 --- a/Examples/UIExplorer/UIExplorerList.js +++ b/Examples/UIExplorer/UIExplorerList.js @@ -32,6 +32,7 @@ var EXAMPLES = [ require('./ActivityIndicatorExample'), require('./ScrollViewExample'), require('./GeoLocationExample'), + require('./TabBarExample'), ]; var UIExplorerList = React.createClass({ diff --git a/Libraries/Components/TabBarIOS/TabBarIOS.android.js b/Libraries/Components/TabBarIOS/TabBarIOS.android.js new file mode 100644 index 000000000..7bddc1e92 --- /dev/null +++ b/Libraries/Components/TabBarIOS/TabBarIOS.android.js @@ -0,0 +1,29 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule TabBarIOS + */ + +'use strict'; + +var React = require('React'); +var View = require('View'); +var StyleSheet = require('StyleSheet'); + +var DummyTabBarIOS = React.createClass({ + render: function() { + return ( + + {this.props.children} + + ); + } +}); + +var styles = StyleSheet.create({ + tabGroup: { + flex: 1, + } +}); + +module.exports = DummyTabBarIOS; diff --git a/Libraries/Components/TabBarIOS/TabBarIOS.ios.js b/Libraries/Components/TabBarIOS/TabBarIOS.ios.js new file mode 100644 index 000000000..e3021b9b7 --- /dev/null +++ b/Libraries/Components/TabBarIOS/TabBarIOS.ios.js @@ -0,0 +1,36 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule TabBarIOS + */ +'use strict'; + +var React = require('React'); +var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); +var StyleSheet = require('StyleSheet'); + +var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass'); + +var TabBarIOS = React.createClass({ + render: function() { + return ( + + {this.props.children} + + ); + } +}); + +var styles = StyleSheet.create({ + tabGroup: { + flex: 1, + } +}); + +var config = { + validAttributes: ReactIOSViewAttributes.UIView, + uiViewClassName: 'RCTTabBar', +}; +var RKTabBar = createReactIOSNativeComponentClass(config); + +module.exports = TabBarIOS; diff --git a/Libraries/Components/TabBarIOS/TabBarItemIOS.android.js b/Libraries/Components/TabBarIOS/TabBarItemIOS.android.js new file mode 100644 index 000000000..634cc06c4 --- /dev/null +++ b/Libraries/Components/TabBarIOS/TabBarItemIOS.android.js @@ -0,0 +1,38 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule TabBarItemIOS + */ + +'use strict'; + +var Dimensions = require('Dimensions'); +var React = require('React'); +var View = require('View'); +var StyleSheet = require('StyleSheet'); + +var DummyTab = React.createClass({ + render: function() { + if (!this.props.selected) { + return ; + } + return ( + + {this.props.children} + + ); + } +}); + +var styles = StyleSheet.create({ + tab: { + // TODO(5405356): Implement overflow: visible so position: absolute isn't useless + // position: 'absolute', + width: Dimensions.get('window').width, + height: Dimensions.get('window').height, + borderColor: 'red', + borderWidth: 1, + } +}); + +module.exports = DummyTab; diff --git a/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js b/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js new file mode 100644 index 000000000..5e6cc5307 --- /dev/null +++ b/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js @@ -0,0 +1,94 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule TabBarItemIOS + */ +'use strict'; + +var Image = require('Image'); +var React = require('React'); +var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); +var Dimensions = require('Dimensions'); +var StaticContainer = require('StaticContainer.react'); +var StyleSheet = require('StyleSheet'); +var View = require('View'); + +var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass'); +var merge = require('merge'); + +var TabBarItemIOS = React.createClass({ + propTypes: { + icon: Image.sourcePropType.isRequired, + onPress: React.PropTypes.func.isRequired, + selected: React.PropTypes.bool.isRequired, + badgeValue: React.PropTypes.string, + title: React.PropTypes.string, + style: View.stylePropType, + }, + + getInitialState: function() { + return { + hasBeenSelected: false, + }; + }, + + componentWillMount: function() { + if (this.props.selected) { + this.setState({hasBeenSelected: true}); + } + }, + + componentWillReceiveProps: function(nextProps) { + if (this.state.hasBeenSelected || nextProps.selected) { + this.setState({hasBeenSelected: true}); + } + }, + + render: function() { + var tabContents = null; + // if the tab has already been shown once, always continue to show it so we + // preserve state between tab transitions + if (this.state.hasBeenSelected) { + tabContents = + + {this.props.children} + ; + } else { + tabContents = ; + } + + return ( + + {tabContents} + + ); + } +}); + +var styles = StyleSheet.create({ + tab: { + position: 'absolute', + width: Dimensions.get('window').width, + height: Dimensions.get('window').height, + } +}); + +var RKTabBarItem = createReactIOSNativeComponentClass({ + validAttributes: merge(ReactIOSViewAttributes.UIView, { + title: true, + icon: true, + selectedIcon: true, + selected: true, + badgeValue: true, + }), + uiViewClassName: 'RCTTabBarItem', +}); + +module.exports = TabBarItemIOS; diff --git a/Libraries/Components/View/View.js b/Libraries/Components/View/View.js index 060125ea7..826c395bc 100644 --- a/Libraries/Components/View/View.js +++ b/Libraries/Components/View/View.js @@ -71,7 +71,7 @@ var View = React.createClass({ accessible: PropTypes.bool, /** - * This string can be used to identify the accessible element. + * Used to locate this view in end-to-end tests. */ testID: PropTypes.string, diff --git a/Libraries/Image/RCTGIFImage.h b/Libraries/Image/RCTGIFImage.h new file mode 100644 index 000000000..38f290462 --- /dev/null +++ b/Libraries/Image/RCTGIFImage.h @@ -0,0 +1,8 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import +#import +#import + +extern CAKeyframeAnimation *RCTGIFImageWithData(NSData *data); +extern CAKeyframeAnimation *RCTGIFImageWithFileURL(NSURL *URL); diff --git a/Libraries/Image/RCTGIFImage.m b/Libraries/Image/RCTGIFImage.m new file mode 100644 index 000000000..8fe49f6bc --- /dev/null +++ b/Libraries/Image/RCTGIFImage.m @@ -0,0 +1,91 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTGIFImage.h" + +#import "RCTLog.h" + +static CAKeyframeAnimation *RCTGIFImageWithImageSource(CGImageSourceRef imageSource) +{ + if (!UTTypeConformsTo(CGImageSourceGetType(imageSource), kUTTypeGIF)) { + CFRelease(imageSource); + return nil; + } + + NSDictionary *properties = (__bridge_transfer NSDictionary *)CGImageSourceCopyProperties(imageSource, NULL); + NSUInteger loopCount = [properties[(id)kCGImagePropertyGIFDictionary][(id)kCGImagePropertyGIFLoopCount] unsignedIntegerValue]; + + size_t imageCount = CGImageSourceGetCount(imageSource); + NSTimeInterval duration = 0; + NSMutableArray *delays = [NSMutableArray arrayWithCapacity:imageCount]; + NSMutableArray *images = [NSMutableArray arrayWithCapacity:imageCount]; + for (size_t i = 0; i < imageCount; i++) { + CGImageRef image = CGImageSourceCreateImageAtIndex(imageSource, i, NULL); + NSDictionary *frameProperties = (__bridge_transfer NSDictionary *)CGImageSourceCopyPropertiesAtIndex(imageSource, i, NULL); + NSDictionary *frameGIFProperties = frameProperties[(id)kCGImagePropertyGIFDictionary]; + + const NSTimeInterval kDelayTimeIntervalDefault = 0.1; + NSNumber *delayTime = frameGIFProperties[(id)kCGImagePropertyGIFUnclampedDelayTime] ?: frameGIFProperties[(id)kCGImagePropertyGIFDelayTime]; + if (delayTime == nil) { + if (i == 0) { + delayTime = @(kDelayTimeIntervalDefault); + } else { + delayTime = delays[i - 1]; + } + } + + const NSTimeInterval kDelayTimeIntervalMinimum = 0.02; + if (delayTime.floatValue < (float)kDelayTimeIntervalMinimum - FLT_EPSILON) { + delayTime = @(kDelayTimeIntervalDefault); + } + + duration += delayTime.doubleValue; + delays[i] = delayTime; + images[i] = (__bridge_transfer id)image; + } + + NSMutableArray *keyTimes = [NSMutableArray arrayWithCapacity:delays.count]; + NSTimeInterval runningDuration = 0; + for (NSNumber *delayNumber in delays) { + [keyTimes addObject:@(runningDuration / duration)]; + runningDuration += delayNumber.doubleValue; + } + + [keyTimes addObject:@1.0]; + + CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"contents"]; + animation.calculationMode = kCAAnimationDiscrete; + animation.repeatCount = loopCount == 0 ? HUGE_VALF : loopCount; + animation.keyTimes = keyTimes; + animation.values = images; + animation.duration = duration; + return animation; +} + +CAKeyframeAnimation *RCTGIFImageWithData(NSData *data) +{ + if (data.length == 0) { + return nil; + } + + CGImageSourceRef imageSource = CGImageSourceCreateWithData((CFDataRef)data, NULL); + CAKeyframeAnimation *animation = RCTGIFImageWithImageSource(imageSource); + CFRelease(imageSource); + return animation; +} + +CAKeyframeAnimation *RCTGIFImageWithFileURL(NSURL *URL) +{ + if (!URL) { + return nil; + } + + if (![URL isFileURL]) { + RCTLogError(@"Loading remote image URLs synchronously is a really bad idea."); + return nil; + } + + CGImageSourceRef imageSource = CGImageSourceCreateWithURL((CFURLRef)URL, NULL); + CAKeyframeAnimation *animation = RCTGIFImageWithImageSource(imageSource); + CFRelease(imageSource); + return animation; +} diff --git a/Libraries/Image/RCTNetworkImage.xcodeproj/project.pbxproj b/Libraries/Image/RCTImage.xcodeproj/project.pbxproj similarity index 74% rename from Libraries/Image/RCTNetworkImage.xcodeproj/project.pbxproj rename to Libraries/Image/RCTImage.xcodeproj/project.pbxproj index 57b27a3c1..409d61d32 100644 --- a/Libraries/Image/RCTNetworkImage.xcodeproj/project.pbxproj +++ b/Libraries/Image/RCTImage.xcodeproj/project.pbxproj @@ -7,6 +7,9 @@ objects = { /* Begin PBXBuildFile section */ + 1304D5AB1AA8C4A30002E2BE /* RCTStaticImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 1304D5A81AA8C4A30002E2BE /* RCTStaticImage.m */; }; + 1304D5AC1AA8C4A30002E2BE /* RCTStaticImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1304D5AA1AA8C4A30002E2BE /* RCTStaticImageManager.m */; }; + 1304D5B21AA8C50D0002E2BE /* RCTGIFImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 1304D5B11AA8C50D0002E2BE /* RCTGIFImage.m */; }; 58B5118F1A9E6BD600147676 /* RCTImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B5118A1A9E6BD600147676 /* RCTImageDownloader.m */; }; 58B511901A9E6BD600147676 /* RCTNetworkImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B5118C1A9E6BD600147676 /* RCTNetworkImageView.m */; }; 58B511911A9E6BD600147676 /* RCTNetworkImageViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B5118E1A9E6BD600147676 /* RCTNetworkImageViewManager.m */; }; @@ -25,7 +28,13 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 58B5115D1A9E6B3D00147676 /* libRCTNetworkImage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTNetworkImage.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 1304D5A71AA8C4A30002E2BE /* RCTStaticImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTStaticImage.h; sourceTree = ""; }; + 1304D5A81AA8C4A30002E2BE /* RCTStaticImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTStaticImage.m; sourceTree = ""; }; + 1304D5A91AA8C4A30002E2BE /* RCTStaticImageManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTStaticImageManager.h; sourceTree = ""; }; + 1304D5AA1AA8C4A30002E2BE /* RCTStaticImageManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTStaticImageManager.m; sourceTree = ""; }; + 1304D5B01AA8C50D0002E2BE /* RCTGIFImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTGIFImage.h; sourceTree = ""; }; + 1304D5B11AA8C50D0002E2BE /* RCTGIFImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTGIFImage.m; sourceTree = ""; }; + 58B5115D1A9E6B3D00147676 /* libRCTImage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTImage.a; sourceTree = BUILT_PRODUCTS_DIR; }; 58B511891A9E6BD600147676 /* RCTImageDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageDownloader.h; sourceTree = ""; }; 58B5118A1A9E6BD600147676 /* RCTImageDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageDownloader.m; sourceTree = ""; }; 58B5118B1A9E6BD600147676 /* RCTNetworkImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNetworkImageView.h; sourceTree = ""; }; @@ -48,12 +57,18 @@ 58B511541A9E6B3D00147676 = { isa = PBXGroup; children = ( + 1304D5B01AA8C50D0002E2BE /* RCTGIFImage.h */, + 1304D5B11AA8C50D0002E2BE /* RCTGIFImage.m */, 58B511891A9E6BD600147676 /* RCTImageDownloader.h */, 58B5118A1A9E6BD600147676 /* RCTImageDownloader.m */, 58B5118B1A9E6BD600147676 /* RCTNetworkImageView.h */, 58B5118C1A9E6BD600147676 /* RCTNetworkImageView.m */, 58B5118D1A9E6BD600147676 /* RCTNetworkImageViewManager.h */, 58B5118E1A9E6BD600147676 /* RCTNetworkImageViewManager.m */, + 1304D5A71AA8C4A30002E2BE /* RCTStaticImage.h */, + 1304D5A81AA8C4A30002E2BE /* RCTStaticImage.m */, + 1304D5A91AA8C4A30002E2BE /* RCTStaticImageManager.h */, + 1304D5AA1AA8C4A30002E2BE /* RCTStaticImageManager.m */, 58B5115E1A9E6B3D00147676 /* Products */, ); sourceTree = ""; @@ -61,7 +76,7 @@ 58B5115E1A9E6B3D00147676 /* Products */ = { isa = PBXGroup; children = ( - 58B5115D1A9E6B3D00147676 /* libRCTNetworkImage.a */, + 58B5115D1A9E6B3D00147676 /* libRCTImage.a */, ); name = Products; sourceTree = ""; @@ -69,9 +84,9 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 58B5115C1A9E6B3D00147676 /* RCTNetworkImage */ = { + 58B5115C1A9E6B3D00147676 /* RCTImage */ = { isa = PBXNativeTarget; - buildConfigurationList = 58B511711A9E6B3D00147676 /* Build configuration list for PBXNativeTarget "RCTNetworkImage" */; + buildConfigurationList = 58B511711A9E6B3D00147676 /* Build configuration list for PBXNativeTarget "RCTImage" */; buildPhases = ( 58B511591A9E6B3D00147676 /* Sources */, 58B5115A1A9E6B3D00147676 /* Frameworks */, @@ -81,9 +96,9 @@ ); dependencies = ( ); - name = RCTNetworkImage; + name = RCTImage; productName = RCTNetworkImage; - productReference = 58B5115D1A9E6B3D00147676 /* libRCTNetworkImage.a */; + productReference = 58B5115D1A9E6B3D00147676 /* libRCTImage.a */; productType = "com.apple.product-type.library.static"; }; /* End PBXNativeTarget section */ @@ -100,7 +115,7 @@ }; }; }; - buildConfigurationList = 58B511581A9E6B3D00147676 /* Build configuration list for PBXProject "RCTNetworkImage" */; + buildConfigurationList = 58B511581A9E6B3D00147676 /* Build configuration list for PBXProject "RCTImage" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -112,7 +127,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 58B5115C1A9E6B3D00147676 /* RCTNetworkImage */, + 58B5115C1A9E6B3D00147676 /* RCTImage */, ); }; /* End PBXProject section */ @@ -124,7 +139,10 @@ files = ( 58B5118F1A9E6BD600147676 /* RCTImageDownloader.m in Sources */, 58B511911A9E6BD600147676 /* RCTNetworkImageViewManager.m in Sources */, + 1304D5AC1AA8C4A30002E2BE /* RCTStaticImageManager.m in Sources */, 58B511901A9E6BD600147676 /* RCTNetworkImageView.m in Sources */, + 1304D5B21AA8C50D0002E2BE /* RCTGIFImage.m in Sources */, + 1304D5AB1AA8C4A30002E2BE /* RCTStaticImage.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -213,8 +231,12 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../ReactKit/**", ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/UIExplorer-gjaibsjtheitasdxdtcvxxqavkvy/Build/Products/Debug-iphoneos", + ); OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = RCTImage; SKIP_INSTALL = YES; }; name = Debug; @@ -227,8 +249,12 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../ReactKit/**", ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/UIExplorer-gjaibsjtheitasdxdtcvxxqavkvy/Build/Products/Debug-iphoneos", + ); OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = RCTImage; SKIP_INSTALL = YES; }; name = Release; @@ -236,7 +262,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 58B511581A9E6B3D00147676 /* Build configuration list for PBXProject "RCTNetworkImage" */ = { + 58B511581A9E6B3D00147676 /* Build configuration list for PBXProject "RCTImage" */ = { isa = XCConfigurationList; buildConfigurations = ( 58B5116F1A9E6B3D00147676 /* Debug */, @@ -245,7 +271,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 58B511711A9E6B3D00147676 /* Build configuration list for PBXNativeTarget "RCTNetworkImage" */ = { + 58B511711A9E6B3D00147676 /* Build configuration list for PBXNativeTarget "RCTImage" */ = { isa = XCConfigurationList; buildConfigurations = ( 58B511721A9E6B3D00147676 /* Debug */, diff --git a/Libraries/Image/RCTImageDownloader.m b/Libraries/Image/RCTImageDownloader.m index 9f065aaa3..ea801dea7 100644 --- a/Libraries/Image/RCTImageDownloader.m +++ b/Libraries/Image/RCTImageDownloader.m @@ -109,39 +109,37 @@ typedef void (^RCTCachedDataDownloadBlock)(BOOL cached, NSData *data, NSError *e - (id)downloadImageForURL:(NSURL *)url size:(CGSize)size scale:(CGFloat)scale block:(RCTImageDownloadBlock)block { - NSString *cacheKey = [self cacheKeyForURL:url]; - __weak RCTImageDownloader *weakSelf = self; - return [self _downloadDataForURL:url block:^(BOOL cached, NSData *data, NSError *error) { - if (!data) { - return dispatch_async(dispatch_get_main_queue(), ^{ - block(nil, error); - }); - } + return [self downloadDataForURL:url block:^(NSData *data, NSError *error) { UIImage *image = [UIImage imageWithData:data scale:scale]; - if (image) { + + // Resize (TODO: should we take aspect ratio into account?) CGSize imageSize = size; if (CGSizeEqualToSize(imageSize, CGSizeZero)) { imageSize = image.size; + } else { + imageSize = (CGSize){ + MIN(size.width, image.size.width), + MIN(size.height, image.size.height) + }; } + // Rescale image if required size is smaller CGFloat imageScale = scale; - if (imageScale == 0 || imageScale > image.scale) { + if (imageScale == 0 || imageScale < image.scale) { imageScale = image.scale; } + // Decompress image at required size UIGraphicsBeginImageContextWithOptions(imageSize, NO, imageScale); [image drawInRect:(CGRect){{0, 0}, imageSize}]; image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); - - if (!cached) { - RCTImageDownloader *strongSelf = weakSelf; - [strongSelf->_cache setData:UIImagePNGRepresentation(image) forKey:cacheKey]; - } } + // TODO: should we cache the decompressed image? + dispatch_async(dispatch_get_main_queue(), ^{ block(image, nil); }); diff --git a/Libraries/Image/RCTNetworkImageView.m b/Libraries/Image/RCTNetworkImageView.m index 027fbf500..1b19dfe19 100644 --- a/Libraries/Image/RCTNetworkImageView.m +++ b/Libraries/Image/RCTNetworkImageView.m @@ -2,9 +2,10 @@ #import "RCTNetworkImageView.h" +#import "RCTConvert.h" +#import "RCTGIFImage.h" #import "RCTImageDownloader.h" #import "RCTUtils.h" -#import "RCTConvert.h" @implementation RCTNetworkImageView { @@ -53,7 +54,7 @@ if ([imageURL.pathExtension caseInsensitiveCompare:@"gif"] == NSOrderedSame) { _downloadToken = [_imageDownloader downloadDataForURL:imageURL block:^(NSData *data, NSError *error) { if (data) { - CAKeyframeAnimation *animation = [RCTConvert GIF:data]; + CAKeyframeAnimation *animation = RCTGIFImageWithData(data); CGImageRef firstFrame = (__bridge CGImageRef)animation.values.firstObject; self.layer.bounds = CGRectMake(0, 0, CGImageGetWidth(firstFrame), CGImageGetHeight(firstFrame)); self.layer.contentsScale = 1.0; diff --git a/Libraries/Image/RCTNetworkImageViewManager.m b/Libraries/Image/RCTNetworkImageViewManager.m index 5f8ad5d35..96d09c0cd 100644 --- a/Libraries/Image/RCTNetworkImageViewManager.m +++ b/Libraries/Image/RCTNetworkImageViewManager.m @@ -23,4 +23,3 @@ RCT_REMAP_VIEW_PROPERTY(src, imageURL) RCT_REMAP_VIEW_PROPERTY(resizeMode, contentMode) @end - diff --git a/ReactKit/Views/RCTStaticImage.h b/Libraries/Image/RCTStaticImage.h similarity index 100% rename from ReactKit/Views/RCTStaticImage.h rename to Libraries/Image/RCTStaticImage.h diff --git a/ReactKit/Views/RCTStaticImage.m b/Libraries/Image/RCTStaticImage.m similarity index 100% rename from ReactKit/Views/RCTStaticImage.m rename to Libraries/Image/RCTStaticImage.m diff --git a/ReactKit/Views/RCTStaticImageManager.h b/Libraries/Image/RCTStaticImageManager.h similarity index 100% rename from ReactKit/Views/RCTStaticImageManager.h rename to Libraries/Image/RCTStaticImageManager.h diff --git a/ReactKit/Views/RCTStaticImageManager.m b/Libraries/Image/RCTStaticImageManager.m similarity index 88% rename from ReactKit/Views/RCTStaticImageManager.m rename to Libraries/Image/RCTStaticImageManager.m index 84b782b1d..b83d8c42b 100644 --- a/ReactKit/Views/RCTStaticImageManager.m +++ b/Libraries/Image/RCTStaticImageManager.m @@ -4,8 +4,9 @@ #import -#import "RCTStaticImage.h" #import "RCTConvert.h" +#import "RCTGIFImage.h" +#import "RCTStaticImage.h" @implementation RCTStaticImageManager @@ -20,7 +21,7 @@ RCT_CUSTOM_VIEW_PROPERTY(src, RCTStaticImage *) { if (json) { if ([[[json description] pathExtension] caseInsensitiveCompare:@"gif"] == NSOrderedSame) { - [view.layer addAnimation:[RCTConvert GIF:json] forKey:@"contents"]; + [view.layer addAnimation:RCTGIFImageWithFileURL([RCTConvert NSURL:json]) forKey:@"contents"]; } else { view.image = [RCTConvert UIImage:json]; } @@ -40,4 +41,3 @@ RCT_CUSTOM_VIEW_PROPERTY(tintColor, RCTStaticImage *) } @end - diff --git a/Libraries/Network/RCTDataManager.xcodeproj/project.pbxproj b/Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj similarity index 91% rename from Libraries/Network/RCTDataManager.xcodeproj/project.pbxproj rename to Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj index 81b90312a..bfaa0413d 100644 --- a/Libraries/Network/RCTDataManager.xcodeproj/project.pbxproj +++ b/Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj @@ -23,7 +23,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 58B511DB1A9E6C8500147676 /* libRCTDataManager.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTDataManager.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 58B511DB1A9E6C8500147676 /* libRCTNetwork.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTNetwork.a; sourceTree = BUILT_PRODUCTS_DIR; }; 58B512061A9E6CE300147676 /* RCTDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDataManager.h; sourceTree = ""; }; 58B512071A9E6CE300147676 /* RCTDataManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDataManager.m; sourceTree = ""; }; /* End PBXFileReference section */ @@ -51,7 +51,7 @@ 58B511DC1A9E6C8500147676 /* Products */ = { isa = PBXGroup; children = ( - 58B511DB1A9E6C8500147676 /* libRCTDataManager.a */, + 58B511DB1A9E6C8500147676 /* libRCTNetwork.a */, ); name = Products; sourceTree = ""; @@ -59,9 +59,9 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 58B511DA1A9E6C8500147676 /* RCTDataManager */ = { + 58B511DA1A9E6C8500147676 /* RCTNetwork */ = { isa = PBXNativeTarget; - buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTDataManager" */; + buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTNetwork" */; buildPhases = ( 58B511D71A9E6C8500147676 /* Sources */, 58B511D81A9E6C8500147676 /* Frameworks */, @@ -71,9 +71,9 @@ ); dependencies = ( ); - name = RCTDataManager; + name = RCTNetwork; productName = RCTDataManager; - productReference = 58B511DB1A9E6C8500147676 /* libRCTDataManager.a */; + productReference = 58B511DB1A9E6C8500147676 /* libRCTNetwork.a */; productType = "com.apple.product-type.library.static"; }; /* End PBXNativeTarget section */ @@ -90,7 +90,7 @@ }; }; }; - buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTDataManager" */; + buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTNetwork" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -102,7 +102,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 58B511DA1A9E6C8500147676 /* RCTDataManager */, + 58B511DA1A9E6C8500147676 /* RCTNetwork */, ); }; /* End PBXProject section */ @@ -206,7 +206,7 @@ "/Users/nicklockwood/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/ReactKit/build/Debug-iphoneos", ); OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = RCTNetwork; SKIP_INSTALL = YES; }; name = Debug; @@ -224,7 +224,7 @@ "/Users/nicklockwood/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/ReactKit/build/Debug-iphoneos", ); OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = RCTNetwork; SKIP_INSTALL = YES; }; name = Release; @@ -232,7 +232,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTDataManager" */ = { + 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTNetwork" */ = { isa = XCConfigurationList; buildConfigurations = ( 58B511ED1A9E6C8500147676 /* Debug */, @@ -241,7 +241,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTDataManager" */ = { + 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTNetwork" */ = { isa = XCConfigurationList; buildConfigurations = ( 58B511F01A9E6C8500147676 /* Debug */, diff --git a/Libraries/Text/ExpandingText.js b/Libraries/Text/ExpandingText.js index 80b06492a..181e0a2b8 100644 --- a/Libraries/Text/ExpandingText.js +++ b/Libraries/Text/ExpandingText.js @@ -20,39 +20,49 @@ var styles = StyleSheet.create({ }); /** - * - A react component for displaying text which supports truncating - * based on a set truncLength. In the following example, the text will truncate + * A react component for displaying text which supports truncating + * based on a set truncLength. + * + * In the following example, the text will truncate * to show only the first 17 characters plus '...' with a See More button to - * expand the text to its full length + * expand the text to its full length. * - * renderText: function() { - * return ; - * }, - * - * More example code in `ExpandingTextExample.js` + * ``` + * render: function() { + * return ; + * }, + * ``` */ var ExpandingText = React.createClass({ - PropTypes: { + propTypes: { /** - * Text to be displayed. Text will be truncated if the character length - * is greater than the truncLength property. + * Text to be displayed. It will be truncated if the character length + * is greater than the `truncLength` property. */ - text: React.PropTypes.string.isRequired, + text: React.PropTypes.string, /** - * The styles that will be applied to the text (both truncated and expanded). + * The styles that will be applied to the text (both truncated and + * expanded). */ - textStyle: Text.stylePropType, + textStyle: Text.propTypes.style, /** - * The styles that will be applied to the See More button + * The styles that will be applied to the See More button. Default + * is bold. */ - seeMoreStyle: Text.stylePropType, + seeMoreStyle: Text.propTypes.style, + /** + * The caption that will be appended at the end, by default it is + * `'See More'`. + */ + seeMoreText: React.PropTypes.string, /** * The maximum character length for the text that will * be displayed by default. Note that ... will be * appended to the truncated text which is counted towards - * the total truncLength of the default displayed string + * the total truncLength of the default displayed string. + * The default is 130. */ - truncLength: React.PropTypes.number + truncLength: React.PropTypes.number, }, getDefaultProps: function() { diff --git a/Libraries/Text/Text.js b/Libraries/Text/Text.js index 07160bc66..71e022d9b 100644 --- a/Libraries/Text/Text.js +++ b/Libraries/Text/Text.js @@ -87,6 +87,10 @@ var Text = React.createClass({ */ suppressHighlighting: React.PropTypes.bool, style: stylePropType, + /** + * Used to locate this view in end-to-end tests. + */ + testID: React.PropTypes.string, }, viewConfig: viewConfig, diff --git a/ReactKit/Base/RCTConvert.h b/ReactKit/Base/RCTConvert.h index 25b8cecc2..a5aa59fe6 100644 --- a/ReactKit/Base/RCTConvert.h +++ b/ReactKit/Base/RCTConvert.h @@ -3,9 +3,9 @@ #import #import -#import "Layout.h" -#import "RCTPointerEvents.h" -#import "RCTAnimationType.h" +#import "../Layout/Layout.h" +#import "../Views/RCTAnimationType.h" +#import "../Views/RCTPointerEvents.h" /** * This class provides a collection of conversion functions for mapping @@ -47,7 +47,6 @@ + (UIColor *)UIColor:(id)json; + (CGColorRef)CGColor:(id)json; -+ (CAKeyframeAnimation *)GIF:(id)json; + (UIImage *)UIImage:(id)json; + (CGImageRef)CGImage:(id)json; @@ -68,6 +67,10 @@ @end +#ifdef __cplusplus +extern "C" { +#endif + /** * This function will attempt to set a property using a json value by first * inferring the correct type from all available information, and then @@ -82,3 +85,7 @@ BOOL RCTSetProperty(id target, NSString *keypath, id json); * be set, it will do nothing and return NO. */ BOOL RCTCopyProperty(id target, id source, NSString *keypath); + +#ifdef __cplusplus +} +#endif diff --git a/ReactKit/Base/RCTConvert.m b/ReactKit/Base/RCTConvert.m index 39b0c6874..bec60ff6c 100644 --- a/ReactKit/Base/RCTConvert.m +++ b/ReactKit/Base/RCTConvert.m @@ -4,9 +4,6 @@ #import -#import -#import - #import "RCTLog.h" CGFloat const RCTDefaultFontSize = 14; @@ -431,88 +428,11 @@ RCT_STRUCT_CONVERTER(CGAffineTransform, (@[@"a", @"b", @"c", @"d", @"tx", @"ty"] return [self UIColor:json].CGColor; } -+ (CAKeyframeAnimation *)GIF:(id)json -{ - CGImageSourceRef imageSource = NULL; - if ([json isKindOfClass:[NSString class]]) { - NSString *path = json; - if (path.length == 0) { - return nil; - } - - NSURL *fileURL = [path isAbsolutePath] ? [NSURL fileURLWithPath:path] : [[NSBundle mainBundle] URLForResource:path withExtension:nil]; - imageSource = CGImageSourceCreateWithURL((CFURLRef)fileURL, NULL); - } else if ([json isKindOfClass:[NSData class]]) { - NSData *data = json; - if (data.length == 0) { - return nil; - } - - imageSource = CGImageSourceCreateWithData((CFDataRef)data, NULL); - } else { - RCTLogMustFix(@"Expected NSString or NSData for GIF, received %@: %@", [json class], json); - return nil; - } - - if (!UTTypeConformsTo(CGImageSourceGetType(imageSource), kUTTypeGIF)) { - CFRelease(imageSource); - return nil; - } - - NSDictionary *properties = (__bridge_transfer NSDictionary *)CGImageSourceCopyProperties(imageSource, NULL); - NSUInteger loopCount = [properties[(id)kCGImagePropertyGIFDictionary][(id)kCGImagePropertyGIFLoopCount] unsignedIntegerValue]; - - size_t imageCount = CGImageSourceGetCount(imageSource); - NSTimeInterval duration = 0; - NSMutableArray *delays = [NSMutableArray arrayWithCapacity:imageCount]; - NSMutableArray *images = [NSMutableArray arrayWithCapacity:imageCount]; - for (size_t i = 0; i < imageCount; i++) { - CGImageRef image = CGImageSourceCreateImageAtIndex(imageSource, i, NULL); - NSDictionary *frameProperties = (__bridge_transfer NSDictionary *)CGImageSourceCopyPropertiesAtIndex(imageSource, i, NULL); - NSDictionary *frameGIFProperties = frameProperties[(id)kCGImagePropertyGIFDictionary]; - - const NSTimeInterval kDelayTimeIntervalDefault = 0.1; - NSNumber *delayTime = frameGIFProperties[(id)kCGImagePropertyGIFUnclampedDelayTime] ?: frameGIFProperties[(id)kCGImagePropertyGIFDelayTime]; - if (delayTime == nil) { - if (i == 0) { - delayTime = @(kDelayTimeIntervalDefault); - } else { - delayTime = delays[i - 1]; - } - } - - const NSTimeInterval kDelayTimeIntervalMinimum = 0.02; - if (delayTime.floatValue < (float)kDelayTimeIntervalMinimum - FLT_EPSILON) { - delayTime = @(kDelayTimeIntervalDefault); - } - - duration += delayTime.doubleValue; - delays[i] = delayTime; - images[i] = (__bridge_transfer id)image; - } - - CFRelease(imageSource); - - NSMutableArray *keyTimes = [NSMutableArray arrayWithCapacity:delays.count]; - NSTimeInterval runningDuration = 0; - for (NSNumber *delayNumber in delays) { - [keyTimes addObject:@(runningDuration / duration)]; - runningDuration += delayNumber.doubleValue; - } - - [keyTimes addObject:@1.0]; - - CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"contents"]; - animation.calculationMode = kCAAnimationDiscrete; - animation.repeatCount = loopCount == 0 ? HUGE_VALF : loopCount; - animation.keyTimes = keyTimes; - animation.values = images; - animation.duration = duration; - return animation; -} - + (UIImage *)UIImage:(id)json { + // TODO: we might as well cache the result of these checks (and possibly the + // image itself) so as to reduce overhead on subsequent checks of the same input + if (![json isKindOfClass:[NSString class]]) { RCTLogError(@"Expected NSString for UIImage, received %@: %@", [json class], json); return nil; @@ -532,9 +452,8 @@ RCT_STRUCT_CONVERTER(CGAffineTransform, (@[@"a", @"b", @"c", @"d", @"tx", @"ty"] image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:path ofType:nil]]; } } - if (!image) { - RCTLogWarn(@"No image was found at path %@", json); - } + // NOTE: we don't warn about nil images because there are legitimate + // case where we find out if a string is an image by using this method return image; } diff --git a/ReactKit/Modules/RCTUIManager.m b/ReactKit/Modules/RCTUIManager.m index 5a65669cd..47b2e6c84 100644 --- a/ReactKit/Modules/RCTUIManager.m +++ b/ReactKit/Modules/RCTUIManager.m @@ -1109,8 +1109,8 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView // Bubble dispatched events @"topTap": @{ @"phasedRegistrationNames": @{ - @"bubbled": @"notActuallyTapDontUseMe", - @"captured": @"notActuallyTapCaptureDontUseMe" + @"bubbled": @"onPress", + @"captured": @"onPressCapture" } }, @"topVisibleCellsChange": @{ diff --git a/ReactKit/ReactKit.xcodeproj/project.pbxproj b/ReactKit/ReactKit.xcodeproj/project.pbxproj index 721556306..899d865b4 100644 --- a/ReactKit/ReactKit.xcodeproj/project.pbxproj +++ b/ReactKit/ReactKit.xcodeproj/project.pbxproj @@ -7,12 +7,14 @@ objects = { /* Begin PBXBuildFile section */ - 1302F0FD1A78550100EBEF02 /* RCTStaticImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 1302F0FA1A78550100EBEF02 /* RCTStaticImage.m */; }; - 1302F0FE1A78550100EBEF02 /* RCTStaticImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1302F0FC1A78550100EBEF02 /* RCTStaticImageManager.m */; }; 134FCB361A6D42D900051CC8 /* RCTSparseArray.m in Sources */ = {isa = PBXBuildFile; fileRef = 83BEE46D1A6D19BC00B5863B /* RCTSparseArray.m */; }; 134FCB3D1A6E7F0800051CC8 /* RCTContextExecutor.m in Sources */ = {isa = PBXBuildFile; fileRef = 134FCB3A1A6E7F0800051CC8 /* RCTContextExecutor.m */; }; 134FCB3E1A6E7F0800051CC8 /* RCTWebViewExecutor.m in Sources */ = {isa = PBXBuildFile; fileRef = 134FCB3C1A6E7F0800051CC8 /* RCTWebViewExecutor.m */; }; 13723B501A82FD3C00F88898 /* RCTStatusBarManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */; }; + 137327E71AA5CF210034F82E /* RCTTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 137327E01AA5CF210034F82E /* RCTTabBar.m */; }; + 137327E81AA5CF210034F82E /* RCTTabBarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 137327E21AA5CF210034F82E /* RCTTabBarItem.m */; }; + 137327E91AA5CF210034F82E /* RCTTabBarItemManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 137327E41AA5CF210034F82E /* RCTTabBarItemManager.m */; }; + 137327EA1AA5CF210034F82E /* RCTTabBarManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 137327E61AA5CF210034F82E /* RCTTabBarManager.m */; }; 13A1F71E1A75392D00D3D453 /* RCTKeyCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = 13A1F71D1A75392D00D3D453 /* RCTKeyCommands.m */; }; 13B07FEF1A69327A00A75B9A /* RCTAlertManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FE81A69327A00A75B9A /* RCTAlertManager.m */; }; 13B07FF01A69327A00A75B9A /* RCTExceptionsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FEA1A69327A00A75B9A /* RCTExceptionsManager.m */; }; @@ -60,21 +62,27 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 1302F0F91A78550100EBEF02 /* RCTStaticImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTStaticImage.h; sourceTree = ""; }; - 1302F0FA1A78550100EBEF02 /* RCTStaticImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTStaticImage.m; sourceTree = ""; }; - 1302F0FB1A78550100EBEF02 /* RCTStaticImageManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTStaticImageManager.h; sourceTree = ""; }; - 1302F0FC1A78550100EBEF02 /* RCTStaticImageManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTStaticImageManager.m; sourceTree = ""; }; + 13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAnimationType.h; sourceTree = ""; }; + 13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPointerEvents.h; sourceTree = ""; }; + 13442BF41AA90E0B0037E5B0 /* RCTViewControllerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTViewControllerProtocol.h; sourceTree = ""; }; 134FCB391A6E7F0800051CC8 /* RCTContextExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTContextExecutor.h; sourceTree = ""; }; 134FCB3A1A6E7F0800051CC8 /* RCTContextExecutor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTContextExecutor.m; sourceTree = ""; }; 134FCB3B1A6E7F0800051CC8 /* RCTWebViewExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebViewExecutor.h; sourceTree = ""; }; 134FCB3C1A6E7F0800051CC8 /* RCTWebViewExecutor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWebViewExecutor.m; sourceTree = ""; }; 13723B4E1A82FD3C00F88898 /* RCTStatusBarManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTStatusBarManager.h; sourceTree = ""; }; 13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTStatusBarManager.m; sourceTree = ""; }; + 137327DF1AA5CF210034F82E /* RCTTabBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTabBar.h; sourceTree = ""; }; + 137327E01AA5CF210034F82E /* RCTTabBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTabBar.m; sourceTree = ""; }; + 137327E11AA5CF210034F82E /* RCTTabBarItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTabBarItem.h; sourceTree = ""; }; + 137327E21AA5CF210034F82E /* RCTTabBarItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTabBarItem.m; sourceTree = ""; }; + 137327E31AA5CF210034F82E /* RCTTabBarItemManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTabBarItemManager.h; sourceTree = ""; }; + 137327E41AA5CF210034F82E /* RCTTabBarItemManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTabBarItemManager.m; sourceTree = ""; }; + 137327E51AA5CF210034F82E /* RCTTabBarManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTabBarManager.h; sourceTree = ""; }; + 137327E61AA5CF210034F82E /* RCTTabBarManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTabBarManager.m; sourceTree = ""; }; 13A1F71C1A75392D00D3D453 /* RCTKeyCommands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTKeyCommands.h; sourceTree = ""; }; 13A1F71D1A75392D00D3D453 /* RCTKeyCommands.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTKeyCommands.m; sourceTree = ""; }; 13B07FC71A68125100A75B9A /* Layout.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Layout.c; sourceTree = ""; }; 13B07FC81A68125100A75B9A /* Layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Layout.h; sourceTree = ""; }; - 13B07FCD1A683B5F00A75B9A /* RCTScrollableProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTScrollableProtocol.h; sourceTree = ""; }; 13B07FE71A69327A00A75B9A /* RCTAlertManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAlertManager.h; sourceTree = ""; }; 13B07FE81A69327A00A75B9A /* RCTAlertManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAlertManager.m; sourceTree = ""; }; 13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTExceptionsManager.h; sourceTree = ""; }; @@ -101,7 +109,9 @@ 13B080191A69489C00A75B9A /* RCTUIActivityIndicatorViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIActivityIndicatorViewManager.m; sourceTree = ""; }; 13B080231A694A8400A75B9A /* RCTWrapperViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWrapperViewController.h; sourceTree = ""; }; 13B080241A694A8400A75B9A /* RCTWrapperViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWrapperViewController.m; sourceTree = ""; }; - 13DB9D681A8CC58200429C20 /* RCTAnimationType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAnimationType.h; sourceTree = ""; }; + 13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAutoInsetsProtocol.h; sourceTree = ""; }; + 13C325271AA63B6A0048765F /* RCTScrollableProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTScrollableProtocol.h; sourceTree = ""; }; + 13C325281AA63B6A0048765F /* RCTViewNodeProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTViewNodeProtocol.h; sourceTree = ""; }; 13E067481A70F434002CDEE1 /* RCTUIManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTUIManager.h; sourceTree = ""; }; 13E067491A70F434002CDEE1 /* RCTUIManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIManager.m; sourceTree = ""; }; 13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTShadowView.h; sourceTree = ""; }; @@ -112,7 +122,6 @@ 13E067501A70F44B002CDEE1 /* RCTView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTView.m; sourceTree = ""; }; 13E067531A70F44B002CDEE1 /* UIView+ReactKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+ReactKit.h"; sourceTree = ""; }; 13E067541A70F44B002CDEE1 /* UIView+ReactKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+ReactKit.m"; sourceTree = ""; }; - 13ED13891A80C9D40050A8F9 /* RCTPointerEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPointerEvents.h; sourceTree = ""; }; 13EFFCCF1A98E6FE002607DC /* RCTJSMethodRegistrar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSMethodRegistrar.h; sourceTree = ""; }; 5F5F0D971A9E456B001279FA /* RCTLocationObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTLocationObserver.h; sourceTree = ""; }; 5F5F0D981A9E456B001279FA /* RCTLocationObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLocationObserver.m; sourceTree = ""; }; @@ -135,8 +144,6 @@ 83CBBA591A601E9000E9B192 /* RCTRedBox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRedBox.m; sourceTree = ""; }; 83CBBA5E1A601EAA00E9B192 /* RCTBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBridge.h; sourceTree = ""; }; 83CBBA5F1A601EAA00E9B192 /* RCTBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBridge.m; sourceTree = ""; }; - 83CBBA611A601EB200E9B192 /* RCTAutoInsetsProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTAutoInsetsProtocol.h; sourceTree = ""; }; - 83CBBA621A601EB800E9B192 /* RCTViewNodeProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTViewNodeProtocol.h; sourceTree = ""; }; 83CBBA631A601ECA00E9B192 /* RCTJavaScriptExecutor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTJavaScriptExecutor.h; sourceTree = ""; }; 83CBBA651A601EF300E9B192 /* RCTEventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTEventDispatcher.h; sourceTree = ""; }; 83CBBA661A601EF300E9B192 /* RCTEventDispatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTEventDispatcher.m; sourceTree = ""; }; @@ -199,6 +206,12 @@ 13B07FF31A6947C200A75B9A /* Views */ = { isa = PBXGroup; children = ( + 13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */, + 13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */, + 13442BF41AA90E0B0037E5B0 /* RCTViewControllerProtocol.h */, + 13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */, + 13C325271AA63B6A0048765F /* RCTScrollableProtocol.h */, + 13C325281AA63B6A0048765F /* RCTViewNodeProtocol.h */, 13B0800C1A69489C00A75B9A /* RCTNavigator.h */, 13B0800D1A69489C00A75B9A /* RCTNavigator.m */, 13B0800E1A69489C00A75B9A /* RCTNavigatorManager.h */, @@ -213,10 +226,6 @@ 13B07FF91A6947C200A75B9A /* RCTScrollViewManager.m */, 13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */, 13E0674C1A70F44B002CDEE1 /* RCTShadowView.m */, - 1302F0F91A78550100EBEF02 /* RCTStaticImage.h */, - 1302F0FA1A78550100EBEF02 /* RCTStaticImage.m */, - 1302F0FB1A78550100EBEF02 /* RCTStaticImageManager.h */, - 1302F0FC1A78550100EBEF02 /* RCTStaticImageManager.m */, 13B080141A69489C00A75B9A /* RCTTextField.h */, 13B080151A69489C00A75B9A /* RCTTextField.m */, 13B080161A69489C00A75B9A /* RCTTextFieldManager.h */, @@ -229,6 +238,14 @@ 13E0674E1A70F44B002CDEE1 /* RCTViewManager.m */, 13B080231A694A8400A75B9A /* RCTWrapperViewController.h */, 13B080241A694A8400A75B9A /* RCTWrapperViewController.m */, + 137327DF1AA5CF210034F82E /* RCTTabBar.h */, + 137327E01AA5CF210034F82E /* RCTTabBar.m */, + 137327E11AA5CF210034F82E /* RCTTabBarItem.h */, + 137327E21AA5CF210034F82E /* RCTTabBarItem.m */, + 137327E31AA5CF210034F82E /* RCTTabBarItemManager.h */, + 137327E41AA5CF210034F82E /* RCTTabBarItemManager.m */, + 137327E51AA5CF210034F82E /* RCTTabBarManager.h */, + 137327E61AA5CF210034F82E /* RCTTabBarManager.m */, 13E067531A70F44B002CDEE1 /* UIView+ReactKit.h */, 13E067541A70F44B002CDEE1 /* UIView+ReactKit.m */, ); @@ -266,10 +283,8 @@ 83CBBA491A601E3B00E9B192 /* Base */ = { isa = PBXGroup; children = ( - 13DB9D681A8CC58200429C20 /* RCTAnimationType.h */, 83CBBA4A1A601E3B00E9B192 /* RCTAssert.h */, 83CBBA4B1A601E3B00E9B192 /* RCTAssert.m */, - 83CBBA611A601EB200E9B192 /* RCTAutoInsetsProtocol.h */, 83CBBA5E1A601EAA00E9B192 /* RCTBridge.h */, 83CBBA5F1A601EAA00E9B192 /* RCTBridge.m */, 830213F31A654E0800B993E6 /* RCTBridgeModule.h */, @@ -286,19 +301,16 @@ 13A1F71D1A75392D00D3D453 /* RCTKeyCommands.m */, 83CBBA4D1A601E3B00E9B192 /* RCTLog.h */, 83CBBA4E1A601E3B00E9B192 /* RCTLog.m */, - 13ED13891A80C9D40050A8F9 /* RCTPointerEvents.h */, 83CBBA581A601E9000E9B192 /* RCTRedBox.h */, 83CBBA591A601E9000E9B192 /* RCTRedBox.m */, 830A229C1A66C68A008503DA /* RCTRootView.h */, 830A229D1A66C68A008503DA /* RCTRootView.m */, - 13B07FCD1A683B5F00A75B9A /* RCTScrollableProtocol.h */, 83BEE46C1A6D19BC00B5863B /* RCTSparseArray.h */, 83BEE46D1A6D19BC00B5863B /* RCTSparseArray.m */, 83CBBA961A6020BB00E9B192 /* RCTTouchHandler.h */, 83CBBA971A6020BB00E9B192 /* RCTTouchHandler.m */, 83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */, 83CBBA501A601E3B00E9B192 /* RCTUtils.m */, - 83CBBA621A601EB800E9B192 /* RCTViewNodeProtocol.h */, ); path = Base; sourceTree = ""; @@ -383,7 +395,6 @@ 83CBBACC1A6023D300E9B192 /* RCTConvert.m in Sources */, 5F5F0D991A9E456B001279FA /* RCTLocationObserver.m in Sources */, 830A229E1A66C68A008503DA /* RCTRootView.m in Sources */, - 1302F0FD1A78550100EBEF02 /* RCTStaticImage.m in Sources */, 13B07FF01A69327A00A75B9A /* RCTExceptionsManager.m in Sources */, 83CBBA5A1A601E9000E9B192 /* RCTRedBox.m in Sources */, 83CBBA511A601E3B00E9B192 /* RCTAssert.m in Sources */, @@ -391,6 +402,7 @@ 13B080201A69489C00A75B9A /* RCTUIActivityIndicatorViewManager.m in Sources */, 13E067561A70F44B002CDEE1 /* RCTViewManager.m in Sources */, 13B080061A6947C200A75B9A /* RCTScrollViewManager.m in Sources */, + 137327EA1AA5CF210034F82E /* RCTTabBarManager.m in Sources */, 13B080261A694A8400A75B9A /* RCTWrapperViewController.m in Sources */, 13B080051A6947C200A75B9A /* RCTScrollView.m in Sources */, 13B07FF21A69327A00A75B9A /* RCTTiming.m in Sources */, @@ -401,18 +413,20 @@ 83CBBA521A601E3B00E9B192 /* RCTLog.m in Sources */, 13B0801D1A69489C00A75B9A /* RCTNavItemManager.m in Sources */, 13E067571A70F44B002CDEE1 /* RCTView.m in Sources */, + 137327E91AA5CF210034F82E /* RCTTabBarItemManager.m in Sources */, 134FCB361A6D42D900051CC8 /* RCTSparseArray.m in Sources */, 13A1F71E1A75392D00D3D453 /* RCTKeyCommands.m in Sources */, 83CBBA531A601E3B00E9B192 /* RCTUtils.m in Sources */, 83CBBA601A601EAA00E9B192 /* RCTBridge.m in Sources */, + 137327E81AA5CF210034F82E /* RCTTabBarItem.m in Sources */, 13E067551A70F44B002CDEE1 /* RCTShadowView.m in Sources */, 13B0801A1A69489C00A75B9A /* RCTNavigator.m in Sources */, 830BA4551A8E3BDA00D53203 /* RCTCache.m in Sources */, + 137327E71AA5CF210034F82E /* RCTTabBar.m in Sources */, 134FCB3E1A6E7F0800051CC8 /* RCTWebViewExecutor.m in Sources */, 13B0801C1A69489C00A75B9A /* RCTNavItem.m in Sources */, 83CBBA691A601EF300E9B192 /* RCTEventDispatcher.m in Sources */, 13E0674A1A70F434002CDEE1 /* RCTUIManager.m in Sources */, - 1302F0FE1A78550100EBEF02 /* RCTStaticImageManager.m in Sources */, 13B0801B1A69489C00A75B9A /* RCTNavigatorManager.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/ReactKit/Base/RCTAnimationType.h b/ReactKit/Views/RCTAnimationType.h similarity index 100% rename from ReactKit/Base/RCTAnimationType.h rename to ReactKit/Views/RCTAnimationType.h diff --git a/ReactKit/Base/RCTAutoInsetsProtocol.h b/ReactKit/Views/RCTAutoInsetsProtocol.h similarity index 100% rename from ReactKit/Base/RCTAutoInsetsProtocol.h rename to ReactKit/Views/RCTAutoInsetsProtocol.h diff --git a/ReactKit/Views/RCTNavigator.m b/ReactKit/Views/RCTNavigator.m index be78fccd6..05306e809 100644 --- a/ReactKit/Views/RCTNavigator.m +++ b/ReactKit/Views/RCTNavigator.m @@ -41,7 +41,6 @@ NSInteger kNeverProgressed = -10000; @end - /** * In general, `RCTNavigator` examines `_currentViews` (which are React child * views), and compares them to `_navigationController.viewControllers` (which @@ -138,7 +137,6 @@ NSInteger kNeverProgressed = -10000; return self; } - /** * Invoked when either a navigation item has been popped off, or when a * swipe-back gesture has began. The swipe-back gesture doesn't respect the @@ -184,7 +182,6 @@ NSInteger kNeverProgressed = -10000; @end - @interface RCTNavigator() { RCTEventDispatcher *_eventDispatcher; @@ -204,7 +201,7 @@ NSInteger kNeverProgressed = -10000; * * - The run loop retains the displayLink. * - `displayLink` retains its target. - * - We use `reactWillDestroy` to remove the `RCTNavigator`'s reference to the + * - We use `invalidate` to remove the `RCTNavigator`'s reference to the * `displayLink` and remove the `displayLink` from the run loop. * * @@ -212,7 +209,7 @@ NSInteger kNeverProgressed = -10000; * -------------- * * - Even though we could implement the `displayLink` cleanup without the - * `reactWillDestroy` hook by adding and removing it from the run loop at the + * `invalidate` hook by adding and removing it from the run loop at the * right times (begin/end animation), we need to account for the possibility * that the view itself is destroyed mid-interaction. So we always keep it * added to the run loop, but start/stop it with interactions/animations. We @@ -343,7 +340,7 @@ NSInteger kNeverProgressed = -10000; NSUInteger indexOfFrom = [_currentViews indexOfObject:fromController.navItem]; NSUInteger indexOfTo = [_currentViews indexOfObject:toController.navItem]; CGFloat destination = indexOfFrom < indexOfTo ? 1.0 : -1.0; - _dummyView.frame = (CGRect){destination}; + _dummyView.frame = (CGRect){{destination}}; _currentlyTransitioningFrom = indexOfFrom; _currentlyTransitioningTo = indexOfTo; if (indexOfFrom != indexOfTo) { @@ -450,24 +447,10 @@ NSInteger kNeverProgressed = -10000; return self.superview ? self.superview : self.reactNavSuperviewLink; } -- (void)addControllerToClosestParent:(UIViewController *)controller -{ - if (!controller.parentViewController) { - id responder = [self.superview nextResponder]; - while (responder && ![responder isKindOfClass:[UIViewController class]]) { - responder = [responder nextResponder]; - } - if (responder) { - [responder addChildViewController:controller]; - [controller didMoveToParentViewController:responder]; - } - } -} - - (void)reactBridgeDidFinishTransaction { - // we can't hook up the VC hierarchy in 'init' because the subviews aren't hooked up yet, - // so we do it on demand here + // we can't hook up the VC hierarchy in 'init' because the subviews aren't + // hooked up yet, so we do it on demand here [self addControllerToClosestParent:_navigationController]; NSInteger viewControllerCount = _navigationController.viewControllers.count; diff --git a/ReactKit/Views/RCTNavigatorManager.m b/ReactKit/Views/RCTNavigatorManager.m index 578b42bd0..85004471b 100644 --- a/ReactKit/Views/RCTNavigatorManager.m +++ b/ReactKit/Views/RCTNavigatorManager.m @@ -2,9 +2,9 @@ #import "RCTNavigatorManager.h" +#import "RCTBridge.h" #import "RCTConvert.h" #import "RCTNavigator.h" -#import "RCTShadowView.h" #import "RCTSparseArray.h" #import "RCTUIManager.h" @@ -12,7 +12,7 @@ - (UIView *)view { - return [[RCTNavigator alloc] initWithEventDispatcher:self.eventDispatcher]; + return [[RCTNavigator alloc] initWithEventDispatcher:self.bridge.eventDispatcher]; } RCT_EXPORT_VIEW_PROPERTY(requestedTopOfStack) @@ -34,16 +34,12 @@ RCT_EXPORT_VIEW_PROPERTY(requestedTopOfStack) RCT_EXPORT(); [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry){ - if (reactTag) { - RCTNavigator *navigator = viewRegistry[reactTag]; - if ([navigator isKindOfClass:[RCTNavigator class]]) { - BOOL wasAcquired = [navigator requestSchedulingJavaScriptNavigation]; - callback(@[@(wasAcquired)]); - } else { - RCTLogError(@"Cannot set lock: %@ (tag #%@) is not an RCTNavigator", navigator, reactTag); - } + RCTNavigator *navigator = viewRegistry[reactTag]; + if ([navigator isKindOfClass:[RCTNavigator class]]) { + BOOL wasAcquired = [navigator requestSchedulingJavaScriptNavigation]; + callback(@[@(wasAcquired)]); } else { - RCTLogError(@"Tag not specified for requestSchedulingJavaScriptNavigation"); + RCTLogError(@"Cannot set lock: %@ (tag #%@) is not an RCTNavigator", navigator, reactTag); } }]; } diff --git a/ReactKit/Base/RCTPointerEvents.h b/ReactKit/Views/RCTPointerEvents.h similarity index 100% rename from ReactKit/Base/RCTPointerEvents.h rename to ReactKit/Views/RCTPointerEvents.h diff --git a/ReactKit/Views/RCTScrollViewManager.m b/ReactKit/Views/RCTScrollViewManager.m index afcf6436a..6247dadb6 100644 --- a/ReactKit/Views/RCTScrollViewManager.m +++ b/ReactKit/Views/RCTScrollViewManager.m @@ -2,6 +2,7 @@ #import "RCTScrollViewManager.h" +#import "RCTBridge.h" #import "RCTConvert.h" #import "RCTScrollView.h" @@ -9,7 +10,7 @@ - (UIView *)view { - return [[RCTScrollView alloc] initWithEventDispatcher:self.eventDispatcher]; + return [[RCTScrollView alloc] initWithEventDispatcher:self.bridge.eventDispatcher]; } RCT_EXPORT_VIEW_PROPERTY(alwaysBounceHorizontal) diff --git a/ReactKit/Base/RCTScrollableProtocol.h b/ReactKit/Views/RCTScrollableProtocol.h similarity index 100% rename from ReactKit/Base/RCTScrollableProtocol.h rename to ReactKit/Views/RCTScrollableProtocol.h diff --git a/ReactKit/Views/RCTShadowView.m b/ReactKit/Views/RCTShadowView.m index f8c32763f..62d38249e 100644 --- a/ReactKit/Views/RCTShadowView.m +++ b/ReactKit/Views/RCTShadowView.m @@ -325,6 +325,11 @@ static void RCTProcessMetaProps(const float metaProps[META_PROP_COUNT], float st return _reactSubviews; } +- (RCTShadowView *)reactSuperview +{ + return _superview; +} + - (NSNumber *)reactTagAtPoint:(CGPoint)point { for (RCTShadowView *shadowView in _reactSubviews) { diff --git a/ReactKit/Views/RCTTabBar.h b/ReactKit/Views/RCTTabBar.h new file mode 100644 index 000000000..58da056a3 --- /dev/null +++ b/ReactKit/Views/RCTTabBar.h @@ -0,0 +1,11 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@class RCTEventDispatcher; + +@interface RCTTabBar : UIView + +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; + +@end diff --git a/ReactKit/Views/RCTTabBar.m b/ReactKit/Views/RCTTabBar.m new file mode 100644 index 000000000..9f49fbcaf --- /dev/null +++ b/ReactKit/Views/RCTTabBar.m @@ -0,0 +1,139 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTTabBar.h" + +#import "RCTEventDispatcher.h" +#import "RCTLog.h" +#import "RCTTabBarItem.h" +#import "RCTUtils.h" +#import "RCTView.h" +#import "RCTViewControllerProtocol.h" +#import "RCTWrapperViewController.h" +#import "UIView+ReactKit.h" + +@interface RKCustomTabBarController : UITabBarController + +@end + +@implementation RKCustomTabBarController + +@synthesize currentTopLayoutGuide = _currentTopLayoutGuide; +@synthesize currentBottomLayoutGuide = _currentBottomLayoutGuide; + +- (void)viewWillLayoutSubviews +{ + [super viewWillLayoutSubviews]; + _currentTopLayoutGuide = self.topLayoutGuide; + _currentBottomLayoutGuide = self.bottomLayoutGuide; +} + +@end + +@interface RCTTabBar() + +@end + +@implementation RCTTabBar +{ + BOOL _tabsChanged; + RCTEventDispatcher *_eventDispatcher; + UITabBarController *_tabController; + NSMutableArray *_tabViews; +} + +- (id)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher +{ + if ((self = [super initWithFrame:CGRectZero])) { + _eventDispatcher = eventDispatcher; + _tabViews = [[NSMutableArray alloc] init]; + _tabController = [[RKCustomTabBarController alloc] init]; + _tabController.delegate = self; + [self addSubview:_tabController.view]; + } + return self; +} + +- (UIViewController *)backingViewController +{ + return _tabController; +} + +- (void)dealloc +{ + _tabController.delegate = nil; +} + +- (NSArray *)reactSubviews +{ + return _tabViews; +} + +- (void)insertReactSubview:(UIView *)view atIndex:(NSInteger)atIndex +{ + if (![view isKindOfClass:[RCTTabBarItem class]]) { + RCTLogError(@"subview should be of type RCTTabBarItem"); + return; + } + [_tabViews insertObject:view atIndex:atIndex]; + _tabsChanged = YES; +} + +- (void)removeReactSubview:(UIView *)subview +{ + if (_tabViews.count == 0) { + RCTLogError(@"should have at least one view to remove a subview"); + return; + } + [_tabViews removeObject:subview]; + _tabsChanged = YES; +} + +- (void)layoutSubviews +{ + [super layoutSubviews]; + _tabController.view.frame = self.bounds; +} + +- (void)reactBridgeDidFinishTransaction +{ + // we can't hook up the VC hierarchy in 'init' because the subviews aren't + // hooked up yet, so we do it on demand here whenever a transaction has finished + [self addControllerToClosestParent:_tabController]; + //[RCTView addViewController:_tabController toBackingViewControllerForView:self]; + + if (_tabsChanged) { + + NSMutableArray *viewControllers = [NSMutableArray array]; + for (RCTTabBarItem *tab in [self reactSubviews]) { + UIViewController *controller = tab.backingViewController; + if (!controller) { + controller = [[RCTWrapperViewController alloc] initWithContentView:tab + eventDispatcher:_eventDispatcher]; + } + [viewControllers addObject:controller]; + } + + _tabController.viewControllers = viewControllers; + _tabsChanged = NO; + } + + [[self reactSubviews] enumerateObjectsUsingBlock:^(RCTTabBarItem *tab, NSUInteger index, BOOL *stop) { + UIViewController *controller = _tabController.viewControllers[index]; + controller.tabBarItem = tab.barItem; + if (tab.selected) { + _tabController.selectedViewController = controller; + } + }]; +} + +#pragma mark - UITabBarControllerDelegate + +- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController +{ + NSUInteger index = [tabBarController.viewControllers indexOfObject:viewController]; + RCTTabBarItem *tab = [self reactSubviews][index]; + [_eventDispatcher sendInputEventWithName:@"topTap" body:@{@"target": tab.reactTag}]; + return NO; +} + +@end diff --git a/ReactKit/Views/RCTTabBarItem.h b/ReactKit/Views/RCTTabBarItem.h new file mode 100644 index 000000000..18b03f151 --- /dev/null +++ b/ReactKit/Views/RCTTabBarItem.h @@ -0,0 +1,11 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface RCTTabBarItem : UIView + +@property (nonatomic, copy) NSString *icon; +@property (nonatomic, assign, getter=isSelected) BOOL selected; +@property (nonatomic, readonly) UITabBarItem *barItem; + +@end diff --git a/ReactKit/Views/RCTTabBarItem.m b/ReactKit/Views/RCTTabBarItem.m new file mode 100644 index 000000000..cca0e5180 --- /dev/null +++ b/ReactKit/Views/RCTTabBarItem.m @@ -0,0 +1,83 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTTabBarItem.h" + +#import "RCTConvert.h" +#import "RCTLog.h" +#import "UIView+ReactKit.h" + +@implementation RCTTabBarItem + +@synthesize barItem = _barItem; + +- (UITabBarItem *)barItem +{ + if (!_barItem) { + _barItem = [[UITabBarItem alloc] init]; + } + return _barItem; +} + +- (void)setIcon:(NSString *)icon +{ + static NSDictionary *systemIcons; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + systemIcons = @{ + @"more": @(UITabBarSystemItemMore), + @"favorites": @(UITabBarSystemItemFavorites), + @"featured": @(UITabBarSystemItemFeatured), + @"topRated": @(UITabBarSystemItemTopRated), + @"recents": @(UITabBarSystemItemRecents), + @"contacts": @(UITabBarSystemItemContacts), + @"history": @(UITabBarSystemItemHistory), + @"bookmarks": @(UITabBarSystemItemBookmarks), + @"search": @(UITabBarSystemItemSearch), + @"downloads": @(UITabBarSystemItemDownloads), + @"mostRecent": @(UITabBarSystemItemMostRecent), + @"mostViewed": @(UITabBarSystemItemMostViewed), + }; + }); + + // Update icon + BOOL wasSystemIcon = (systemIcons[_icon] != nil); + _icon = [icon copy]; + + // Check if string matches any custom images first + UIImage *image = [RCTConvert UIImage:_icon]; + UITabBarItem *oldItem = _barItem; + if (image) { + + // Recreate barItem if previous item was a system icon + if (wasSystemIcon) { + _barItem = nil; + self.barItem.image = image; + } else { + self.barItem.image = image; + return; + } + + } else { + + // Not a custom image, may be a system item? + NSNumber *systemIcon = systemIcons[icon]; + if (!systemIcon) { + RCTLogError(@"The tab bar icon '%@' did not match any known image or system icon", icon); + return; + } + _barItem = [[UITabBarItem alloc] initWithTabBarSystemItem:[systemIcon integerValue] tag:oldItem.tag]; + } + + // Reapply previous properties + _barItem.title = oldItem.title; + _barItem.imageInsets = oldItem.imageInsets; + _barItem.selectedImage = oldItem.selectedImage; + _barItem.badgeValue = oldItem.badgeValue; +} + +- (UIViewController *)backingViewController +{ + return self.superview.backingViewController; +} + +@end diff --git a/ReactKit/Views/RCTTabBarItemManager.h b/ReactKit/Views/RCTTabBarItemManager.h new file mode 100644 index 000000000..623020769 --- /dev/null +++ b/ReactKit/Views/RCTTabBarItemManager.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTTabBarItemManager : RCTViewManager + +@end diff --git a/ReactKit/Views/RCTTabBarItemManager.m b/ReactKit/Views/RCTTabBarItemManager.m new file mode 100644 index 000000000..f74bc09ed --- /dev/null +++ b/ReactKit/Views/RCTTabBarItemManager.m @@ -0,0 +1,25 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTTabBarItemManager.h" + +#import "RCTConvert.h" +#import "RCTTabBarItem.h" + +@implementation RCTTabBarItemManager + +- (UIView *)view +{ + return [[RCTTabBarItem alloc] init]; +} + +RCT_EXPORT_VIEW_PROPERTY(selected); +RCT_EXPORT_VIEW_PROPERTY(icon); +RCT_REMAP_VIEW_PROPERTY(selectedIcon, barItem.selectedImage); +RCT_REMAP_VIEW_PROPERTY(badgeValue, barItem.badgeValue); +RCT_CUSTOM_VIEW_PROPERTY(title, RCTTabBarItem *) +{ + view.barItem.title = json ? [RCTConvert NSString:json] : defaultView.barItem.title; + view.barItem.imageInsets = [view.barItem.title length] ? UIEdgeInsetsZero : (UIEdgeInsets){6, 0, -6, 0}; +} + +@end diff --git a/ReactKit/Views/RCTTabBarManager.h b/ReactKit/Views/RCTTabBarManager.h new file mode 100644 index 000000000..34f745e1c --- /dev/null +++ b/ReactKit/Views/RCTTabBarManager.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTTabBarManager : RCTViewManager + +@end diff --git a/ReactKit/Views/RCTTabBarManager.m b/ReactKit/Views/RCTTabBarManager.m new file mode 100644 index 000000000..70882bc16 --- /dev/null +++ b/ReactKit/Views/RCTTabBarManager.m @@ -0,0 +1,17 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTTabBarManager.h" + +#import "RCTBridge.h" +#import "RCTTabBar.h" + +@implementation RCTTabBarManager + +@synthesize bridge = _bridge; + +- (UIView *)view +{ + return [[RCTTabBar alloc] initWithEventDispatcher:_bridge.eventDispatcher]; +} + +@end diff --git a/ReactKit/Views/RCTTextFieldManager.m b/ReactKit/Views/RCTTextFieldManager.m index 5cdfd43a5..4f46c0dff 100644 --- a/ReactKit/Views/RCTTextFieldManager.m +++ b/ReactKit/Views/RCTTextFieldManager.m @@ -11,7 +11,7 @@ - (UIView *)view { - return [[RCTTextField alloc] initWithEventDispatcher:self.eventDispatcher]; + return [[RCTTextField alloc] initWithEventDispatcher:self.bridge.eventDispatcher]; } RCT_EXPORT_VIEW_PROPERTY(caretHidden) diff --git a/ReactKit/Views/RCTView.h b/ReactKit/Views/RCTView.h index 802336633..cf46eb9df 100644 --- a/ReactKit/Views/RCTView.h +++ b/ReactKit/Views/RCTView.h @@ -10,14 +10,18 @@ @interface RCTView : UIView +/** + * Used to control how touch events are processed. + */ @property (nonatomic, assign) RCTPointerEvents pointerEvents; + (void)autoAdjustInsetsForView:(UIView *)parentView withScrollView:(UIScrollView *)scrollView updateOffset:(BOOL)updateOffset; -+ (UIViewController *)backingViewControllerForView:(UIView *)view; - +/** + * Find the first view controller whose view, or any subview is the specified view. + */ + (UIEdgeInsets)contentInsetsForView:(UIView *)curView; @end diff --git a/ReactKit/Views/RCTView.m b/ReactKit/Views/RCTView.m index dd0144009..9666e717b 100644 --- a/ReactKit/Views/RCTView.m +++ b/ReactKit/Views/RCTView.m @@ -5,6 +5,7 @@ #import "RCTAutoInsetsProtocol.h" #import "RCTConvert.h" #import "RCTLog.h" +#import "UIView+ReactKit.h" static NSString *RCTRecursiveAccessibilityLabel(UIView *view) { @@ -23,15 +24,6 @@ static NSString *RCTRecursiveAccessibilityLabel(UIView *view) @implementation RCTView -- (id)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - _pointerEvents = RCTPointerEventsUnspecified; - } - return self; -} - - (NSString *)accessibilityLabel { if (super.accessibilityLabel) { @@ -108,19 +100,10 @@ static NSString *RCTRecursiveAccessibilityLabel(UIView *view) } } -+ (UIViewController *)backingViewControllerForView:(UIView *)view -{ - id responder = [view nextResponder]; - if ([responder isKindOfClass:[UIViewController class]]) { - return responder; - } - return nil; -} - + (UIEdgeInsets)contentInsetsForView:(UIView *)view { while (view) { - UIViewController *controller = [self backingViewControllerForView:view]; + UIViewController *controller = view.backingViewController; if (controller) { return (UIEdgeInsets){ controller.topLayoutGuide.length, 0, diff --git a/ReactKit/Views/RCTViewControllerProtocol.h b/ReactKit/Views/RCTViewControllerProtocol.h new file mode 100644 index 000000000..2c82572c3 --- /dev/null +++ b/ReactKit/Views/RCTViewControllerProtocol.h @@ -0,0 +1,13 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +/** + * A simple protocol that any React-managed ViewControllers should implement. + * We need all of our ViewControllers to cache layoutGuide changes so any View + * in our View hierarchy can access accurate layoutGuide info at any time. + */ +@protocol RCTViewControllerProtocol + +@property (nonatomic, readonly, strong) id currentTopLayoutGuide; +@property (nonatomic, readonly, strong) id currentBottomLayoutGuide; + +@end diff --git a/ReactKit/Views/RCTViewManager.h b/ReactKit/Views/RCTViewManager.h index d3b7c8a01..b98fc34a3 100644 --- a/ReactKit/Views/RCTViewManager.h +++ b/ReactKit/Views/RCTViewManager.h @@ -23,14 +23,6 @@ typedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, RCTSparseArray *v */ @property (nonatomic, strong) RCTBridge *bridge; -/** - * The event dispatcher is used to send events back to the JavaScript application. - * It can either be used directly by the module, or passed on to instantiated - * view subclasses so that they can handle their own events. - */ -// TODO: remove this, as it can be accessed directly from bridge -@property (nonatomic, readonly) RCTEventDispatcher *eventDispatcher; - /** * The module name exposed to React JS. If omitted, this will be inferred * automatically by using the view module's class name. It is better to not diff --git a/ReactKit/Views/RCTViewManager.m b/ReactKit/Views/RCTViewManager.m index d534e0e8b..44bac5211 100644 --- a/ReactKit/Views/RCTViewManager.m +++ b/ReactKit/Views/RCTViewManager.m @@ -14,11 +14,6 @@ @synthesize bridge = _bridge; -- (RCTEventDispatcher *)eventDispatcher -{ - return _bridge.eventDispatcher; -} - + (NSString *)moduleName { // Default implementation, works in most cases diff --git a/ReactKit/Base/RCTViewNodeProtocol.h b/ReactKit/Views/RCTViewNodeProtocol.h similarity index 77% rename from ReactKit/Base/RCTViewNodeProtocol.h rename to ReactKit/Views/RCTViewNodeProtocol.h index b6f59ea10..0e3e08099 100644 --- a/ReactKit/Base/RCTViewNodeProtocol.h +++ b/ReactKit/Views/RCTViewNodeProtocol.h @@ -13,6 +13,7 @@ - (void)insertReactSubview:(id)subview atIndex:(NSInteger)atIndex; - (void)removeReactSubview:(id)subview; - (NSMutableArray *)reactSubviews; +- (id)reactSuperview; - (NSNumber *)reactTagAtPoint:(CGPoint)point; // View is an RCTRootView @@ -26,3 +27,9 @@ - (void)reactBridgeDidFinishTransaction; @end + +// TODO: this is kinda dumb - let's come up with a +// better way of identifying root react views please! +static inline BOOL RCTIsReactRootView(NSNumber *reactTag) { + return reactTag.integerValue % 10 == 1; +} diff --git a/ReactKit/Views/RCTWrapperViewController.h b/ReactKit/Views/RCTWrapperViewController.h index 69075c6a4..afe736430 100644 --- a/ReactKit/Views/RCTWrapperViewController.h +++ b/ReactKit/Views/RCTWrapperViewController.h @@ -2,6 +2,8 @@ #import +#import "RCTViewControllerProtocol.h" + @class RCTEventDispatcher; @class RCTNavItem; @class RCTWrapperViewController; @@ -13,7 +15,7 @@ didMoveToNavigationController:(UINavigationController *)navigationController; @end -@interface RCTWrapperViewController : UIViewController +@interface RCTWrapperViewController : UIViewController - (instancetype)initWithContentView:(UIView *)contentView eventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; @@ -21,7 +23,7 @@ didMoveToNavigationController:(UINavigationController *)navigationController; - (instancetype)initWithNavItem:(RCTNavItem *)navItem eventDispatcher:(RCTEventDispatcher *)eventDispatcher; -@property (nonatomic, readwrite, weak) id navigationListener; -@property (nonatomic, strong, readwrite) RCTNavItem *navItem; +@property (nonatomic, weak) id navigationListener; +@property (nonatomic, strong) RCTNavItem *navItem; @end diff --git a/ReactKit/Views/RCTWrapperViewController.m b/ReactKit/Views/RCTWrapperViewController.m index 6b58d6631..aff0f2e4f 100644 --- a/ReactKit/Views/RCTWrapperViewController.m +++ b/ReactKit/Views/RCTWrapperViewController.m @@ -2,22 +2,30 @@ #import "RCTWrapperViewController.h" +#import + #import "RCTEventDispatcher.h" #import "RCTNavItem.h" #import "RCTUtils.h" +#import "RCTViewControllerProtocol.h" #import "UIView+ReactKit.h" @implementation RCTWrapperViewController { + UIView *_wrapperView; UIView *_contentView; RCTEventDispatcher *_eventDispatcher; CGFloat _previousTopLayout; CGFloat _previousBottomLayout; } -- (instancetype)initWithContentView:(UIView *)contentView eventDispatcher:(RCTEventDispatcher *)eventDispatcher +@synthesize currentTopLayoutGuide = _currentTopLayoutGuide; +@synthesize currentBottomLayoutGuide = _currentBottomLayoutGuide; + +- (instancetype)initWithContentView:(UIView *)contentView + eventDispatcher:(RCTEventDispatcher *)eventDispatcher { - if ((self = [super initWithNibName:nil bundle:nil])) { + if (self = [super initWithNibName:nil bundle:nil]) { _contentView = contentView; _eventDispatcher = eventDispatcher; self.automaticallyAdjustsScrollViewInsets = NO; @@ -25,80 +33,91 @@ return self; } -- (instancetype)initWithNavItem:(RCTNavItem *)navItem eventDispatcher:(RCTEventDispatcher *)eventDispatcher +- (instancetype)initWithNavItem:(RCTNavItem *)navItem + eventDispatcher:(RCTEventDispatcher *)eventDispatcher { - if ((self = [self initWithContentView:navItem eventDispatcher:eventDispatcher])) { + if (self = [self initWithContentView:navItem eventDispatcher:eventDispatcher]) { _navItem = navItem; } return self; } +- (void)viewWillLayoutSubviews +{ + [super viewWillLayoutSubviews]; + + _currentTopLayoutGuide = self.topLayoutGuide; + _currentBottomLayoutGuide = self.bottomLayoutGuide; +} + - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - [self.navigationController setNavigationBarHidden:!_navItem animated:animated]; - if (!_navItem) { - return; - } + // TODO: find a way to make this less-tightly coupled to navigation controller + if ([self.parentViewController isKindOfClass:[UINavigationController class]]) + { - self.navigationItem.title = _navItem.title; - - [self _configureNavBarStyle]; - - if (_navItem.rightButtonTitle.length > 0) { - self.navigationItem.rightBarButtonItem = - [[UIBarButtonItem alloc] initWithTitle:_navItem.rightButtonTitle - style:UIBarButtonItemStyleDone - target:self - action:@selector(rightButtonTapped)]; - } - - if (_navItem.backButtonTitle.length > 0) { - self.navigationItem.backBarButtonItem = - [[UIBarButtonItem alloc] initWithTitle:_navItem.backButtonTitle - style:UIBarButtonItemStylePlain - target:nil - action:nil]; - } -} - -- (void)_configureNavBarStyle -{ - UINavigationBar *bar = self.navigationController.navigationBar; - if (_navItem.barTintColor) { - bar.barTintColor = _navItem.barTintColor; - } - if (_navItem.tintColor) { - BOOL canSetTintColor = _navItem.barTintColor == nil; - if (canSetTintColor) { - bar.tintColor = _navItem.tintColor; + [self.navigationController setNavigationBarHidden:!_navItem animated:animated]; + if (!_navItem) { + return; + } + + self.navigationItem.title = _navItem.title; + + UINavigationBar *bar = self.navigationController.navigationBar; + if (_navItem.barTintColor) { + bar.barTintColor = _navItem.barTintColor; + } + if (_navItem.tintColor) { + BOOL canSetTintColor = _navItem.barTintColor == nil; + if (canSetTintColor) { + bar.tintColor = _navItem.tintColor; + } + } + if (_navItem.titleTextColor) { + [bar setTitleTextAttributes:@{NSForegroundColorAttributeName : _navItem.titleTextColor}]; + } + + if (_navItem.rightButtonTitle.length > 0) { + self.navigationItem.rightBarButtonItem = + [[UIBarButtonItem alloc] initWithTitle:_navItem.rightButtonTitle + style:UIBarButtonItemStyleDone + target:self + action:@selector(handleNavRightButtonTapped)]; + } + + if (_navItem.backButtonTitle.length > 0) { + self.navigationItem.backBarButtonItem = + [[UIBarButtonItem alloc] initWithTitle:_navItem.backButtonTitle + style:UIBarButtonItemStylePlain + target:nil + action:nil]; } - } - if (_navItem.titleTextColor) { - [bar setTitleTextAttributes:@{NSForegroundColorAttributeName : _navItem.titleTextColor}]; } } - (void)loadView { - // Add a wrapper so that UIViewControllerWrapperView (managed by the + // add a wrapper so that UIViewControllerWrapperView (managed by the // UINavigationController) doesn't end up resetting the frames for - // `contentView` which is a react-managed view. - self.view = [[UIView alloc] init]; - [self.view addSubview:_contentView]; + //`contentView` which is a react-managed view. + _wrapperView = [[UIView alloc] initWithFrame:_contentView.bounds]; + [_wrapperView addSubview:_contentView]; + self.view = _wrapperView; } -- (void)rightButtonTapped +- (void)handleNavRightButtonTapped { - [_eventDispatcher sendInputEventWithName:@"topNavRightButtonTap" body:@{@"target":_navItem.reactTag}]; + [_eventDispatcher sendInputEventWithName:@"topNavRightButtonTap" + body:@{@"target":_navItem.reactTag}]; } - (void)didMoveToParentViewController:(UIViewController *)parent { - // There's no clear setter for navigation controllers, but did move to parent view controller - // provides the desired effect. This is called after a pop finishes, be it a swipe to go back - // or a standard tap on the back button + // There's no clear setter for navigation controllers, but did move to parent + // view controller provides the desired effect. This is called after a pop + // finishes, be it a swipe to go back or a standard tap on the back button [super didMoveToParentViewController:parent]; if (parent == nil || [parent isKindOfClass:[UINavigationController class]]) { [self.navigationListener wrapperViewController:self didMoveToNavigationController:(UINavigationController *)parent]; diff --git a/ReactKit/Views/UIView+ReactKit.h b/ReactKit/Views/UIView+ReactKit.h index 3e45da8e7..9f0213a63 100644 --- a/ReactKit/Views/UIView+ReactKit.h +++ b/ReactKit/Views/UIView+ReactKit.h @@ -8,4 +8,17 @@ @interface UIView (ReactKit) +/** + * This method finds and returns the containing view controller for the view. + */ +- (UIViewController *)backingViewController; + +/** + * This method attaches the specified controller as a child of the + * the owning view controller of this view. Returns NO if no view + * controller is found (which may happen if the view is not currently + * attached to the view hierarchy). + */ +- (void)addControllerToClosestParent:(UIViewController *)controller; + @end diff --git a/ReactKit/Views/UIView+ReactKit.m b/ReactKit/Views/UIView+ReactKit.m index 39bca8ec6..a9feb8eed 100644 --- a/ReactKit/Views/UIView+ReactKit.m +++ b/ReactKit/Views/UIView+ReactKit.m @@ -5,6 +5,7 @@ #import #import "RCTAssert.h" +#import "RCTWrapperViewController.h" @implementation UIView (ReactKit) @@ -20,7 +21,7 @@ - (BOOL)isReactRootView { - return NO; + return RCTIsReactRootView(self.reactTag); } - (NSNumber *)reactTagAtPoint:(CGPoint)point @@ -39,7 +40,7 @@ - (void)removeReactSubview:(UIView *)subview { - RCTAssert(subview.superview == self, @""); + RCTAssert(subview.superview == self, @"%@ is a not a subview of %@", subview, self); [subview removeFromSuperview]; } @@ -48,4 +49,34 @@ return self.subviews; } +- (UIView *)reactSuperview +{ + return self.superview; +} + +- (UIViewController *)backingViewController +{ + id responder = [self nextResponder]; + if ([responder isKindOfClass:[RCTWrapperViewController class]]) { + return responder; + } + return nil; +} + +- (void)addControllerToClosestParent:(UIViewController *)controller +{ + if (!controller.parentViewController) { + UIView *parentView = (UIView *)self.reactSuperview; + while (parentView) { + if (parentView.backingViewController) { + [parentView.backingViewController addChildViewController:controller]; + [controller didMoveToParentViewController:parentView.backingViewController]; + break; + } + parentView = (UIView *)parentView.reactSuperview; + } + return; + } +} + @end diff --git a/packager/packager.js b/packager/packager.js index 08bab38b0..ca4e5c675 100644 --- a/packager/packager.js +++ b/packager/packager.js @@ -29,10 +29,6 @@ var options = parseCommandLine([{ }, { command: 'root', description: 'add another root(s) to be used by the packager in this project', -}, { - command: 'dev', - default: true, - description: 'produce development packages with extra warnings enabled', }]); if (!options.projectRoots) { @@ -97,7 +93,6 @@ function openStackFrameInEditor(req, res, next) { function getAppMiddleware(options) { return ReactPackager.middleware({ - dev: options.dev, projectRoots: options.projectRoots, blacklistRE: blacklist(false), cacheVersion: '2', @@ -106,7 +101,7 @@ function getAppMiddleware(options) { } function runServer( - options, /* {string projectRoot, bool web, bool dev} */ + options, /* {[]string projectRoot, bool web} */ readyCallback ) { var app = connect() diff --git a/packager/react-packager/src/DependencyResolver/haste/__tests__/HasteDependencyResolver-test.js b/packager/react-packager/src/DependencyResolver/haste/__tests__/HasteDependencyResolver-test.js index 9704c5b59..b25fd8211 100644 --- a/packager/react-packager/src/DependencyResolver/haste/__tests__/HasteDependencyResolver-test.js +++ b/packager/react-packager/src/DependencyResolver/haste/__tests__/HasteDependencyResolver-test.js @@ -24,7 +24,6 @@ describe('HasteDependencyResolver', function() { var depResolver = new HasteDependencyResolver({ projectRoot: '/root', - dev: false, }); // Is there a better way? How can I mock the prototype instead? @@ -36,7 +35,7 @@ describe('HasteDependencyResolver', function() { return q(); }); - return depResolver.getDependencies('/root/index.js') + return depResolver.getDependencies('/root/index.js', { dev: false }) .then(function(result) { expect(result.mainModuleId).toEqual('index'); expect(result.dependencies).toEqual([ @@ -85,7 +84,6 @@ describe('HasteDependencyResolver', function() { var depResolver = new HasteDependencyResolver({ projectRoot: '/root', - dev: true, }); // Is there a better way? How can I mock the prototype instead? @@ -97,7 +95,7 @@ describe('HasteDependencyResolver', function() { return q(); }); - return depResolver.getDependencies('/root/index.js') + return depResolver.getDependencies('/root/index.js', { dev: true }) .then(function(result) { expect(result.mainModuleId).toEqual('index'); expect(result.dependencies).toEqual([ @@ -147,7 +145,6 @@ describe('HasteDependencyResolver', function() { var depResolver = new HasteDependencyResolver({ projectRoot: '/root', polyfillModuleNames: ['some module'], - dev: false, }); // Is there a better way? How can I mock the prototype instead? @@ -159,7 +156,7 @@ describe('HasteDependencyResolver', function() { return q(); }); - return depResolver.getDependencies('/root/index.js') + return depResolver.getDependencies('/root/index.js', { dev: false }) .then(function(result) { expect(result.mainModuleId).toEqual('index'); expect(result.dependencies).toEqual([ @@ -218,7 +215,6 @@ describe('HasteDependencyResolver', function() { it('should ', function() { var depResolver = new HasteDependencyResolver({ projectRoot: '/root', - dev: false, }); var depGraph = depResolver._depGraph; diff --git a/packager/react-packager/src/DependencyResolver/haste/index.js b/packager/react-packager/src/DependencyResolver/haste/index.js index 9cb0661ac..6aada00b9 100644 --- a/packager/react-packager/src/DependencyResolver/haste/index.js +++ b/packager/react-packager/src/DependencyResolver/haste/index.js @@ -32,10 +32,6 @@ var validateOpts = declareOpts({ type: 'array', default: [], }, - dev: { - type: 'boolean', - default: true, - }, nonPersistent: { type: 'boolean', default: false, @@ -62,20 +58,20 @@ function HasteDependencyResolver(options) { fileWatcher: this._fileWatcher }); - this._polyfillModuleNames = [ - opts.dev - ? path.join(__dirname, 'polyfills/prelude_dev.js') - : path.join(__dirname, 'polyfills/prelude.js'), - path.join(__dirname, 'polyfills/require.js'), - path.join(__dirname, 'polyfills/polyfills.js'), - path.join(__dirname, 'polyfills/console.js'), - path.join(__dirname, 'polyfills/error-guard.js'), - ].concat( - opts.polyfillModuleNames || [] - ); + + this._polyfillModuleNames = opts.polyfillModuleNames || []; } -HasteDependencyResolver.prototype.getDependencies = function(main) { +var getDependenciesValidateOpts = declareOpts({ + dev: { + type: 'boolean', + default: true, + }, +}); + +HasteDependencyResolver.prototype.getDependencies = function(main, options) { + var opts = getDependenciesValidateOpts(options); + var depGraph = this._depGraph; var self = this; @@ -84,7 +80,7 @@ HasteDependencyResolver.prototype.getDependencies = function(main) { var dependencies = depGraph.getOrderedDependencies(main); var mainModuleId = dependencies[0].id; - self._prependPolyfillDependencies(dependencies); + self._prependPolyfillDependencies(dependencies, opts.dev); return { mainModuleId: mainModuleId, @@ -94,22 +90,30 @@ HasteDependencyResolver.prototype.getDependencies = function(main) { }; HasteDependencyResolver.prototype._prependPolyfillDependencies = function( - dependencies + dependencies, + isDev ) { - var polyfillModuleNames = this._polyfillModuleNames; - if (polyfillModuleNames.length > 0) { - var polyfillModules = polyfillModuleNames.map( - function(polyfillModuleName, idx) { - return new ModuleDescriptor({ - path: polyfillModuleName, - id: polyfillModuleName, - dependencies: polyfillModuleNames.slice(0, idx), - isPolyfill: true - }); - } - ); - dependencies.unshift.apply(dependencies, polyfillModules); - } + var polyfillModuleNames = [ + isDev + ? path.join(__dirname, 'polyfills/prelude_dev.js') + : path.join(__dirname, 'polyfills/prelude.js'), + path.join(__dirname, 'polyfills/require.js'), + path.join(__dirname, 'polyfills/polyfills.js'), + path.join(__dirname, 'polyfills/console.js'), + path.join(__dirname, 'polyfills/error-guard.js'), + ].concat(this._polyfillModuleNames); + + var polyfillModules = polyfillModuleNames.map( + function(polyfillModuleName, idx) { + return new ModuleDescriptor({ + path: polyfillModuleName, + id: polyfillModuleName, + dependencies: polyfillModuleNames.slice(0, idx), + isPolyfill: true + }); + } + ); + dependencies.unshift.apply(dependencies, polyfillModules); }; HasteDependencyResolver.prototype.wrapModule = function(module, code) { diff --git a/packager/react-packager/src/JSTransformer/index.js b/packager/react-packager/src/JSTransformer/index.js index 87cb6e1a3..35785e6ee 100644 --- a/packager/react-packager/src/JSTransformer/index.js +++ b/packager/react-packager/src/JSTransformer/index.js @@ -34,10 +34,6 @@ var validateOpts = declareOpts({ type: 'boolean', default: false, }, - dev: { - type: 'boolean', - default: true, - }, transformModulePath: { type:'string', required: false, diff --git a/packager/react-packager/src/Packager/Package.js b/packager/react-packager/src/Packager/Package.js index 3ef9c528f..5d9b201c7 100644 --- a/packager/react-packager/src/Packager/Package.js +++ b/packager/react-packager/src/Packager/Package.js @@ -7,6 +7,7 @@ var UglifyJS = require('uglify-js'); module.exports = Package; function Package(sourceMapUrl) { + this._finalized = false; this._modules = []; this._sourceMapUrl = sourceMapUrl; } @@ -40,23 +41,56 @@ Package.prototype.finalize = function(options) { Object.freeze(this._modules); Object.seal(this._modules); + this._finalized = true; }; -Package.prototype.getSource = function(options) { - if (!this._source) { - options = options || {}; +Package.prototype._assertFinalized = function() { + if (!this._finalized) { + throw new Error('Package need to be finalized before getting any source'); + } +}; + +Package.prototype._getSource = function() { + if (this._source == null) { this._source = _.pluck(this._modules, 'transformedCode').join('\n'); - if (options.inlineSourceMap) { - var sourceMap = this.getSourceMap({excludeSource: true}); - this._source += '\nRAW_SOURCE_MAP = ' + JSON.stringify(sourceMap) + ';'; - } - this._source += '\n\/\/@ sourceMappingURL=' + this._sourceMapUrl; } return this._source; }; +Package.prototype._getInlineSourceMap = function() { + if (this._inlineSourceMap == null) { + var sourceMap = this.getSourceMap({excludeSource: true}); + this._inlineSourceMap = '\nRAW_SOURCE_MAP = ' + + JSON.stringify(sourceMap) + ';'; + } + + return this._inlineSourceMap; +}; + +Package.prototype.getSource = function(options) { + this._assertFinalized(); + + options = options || {}; + + if (options.minify) { + return this.getMinifiedSourceAndMap().code; + } + + var source = this._getSource(); + + if (options.inlineSourceMap) { + source += this._getInlineSourceMap(); + } + + source += '\n\/\/@ sourceMappingURL=' + this._sourceMapUrl; + + return source; +}; + Package.prototype.getMinifiedSourceAndMap = function() { - var source = this.getSource({inlineSourceMap: false}); + this._assertFinalized(); + + var source = this._getSource(); try { return UglifyJS.minify(source, { fromString: true, @@ -88,6 +122,8 @@ Package.prototype.getMinifiedSourceAndMap = function() { }; Package.prototype.getSourceMap = function(options) { + this._assertFinalized(); + options = options || {}; var mappings = this._getMappings(); var map = { @@ -102,7 +138,6 @@ Package.prototype.getSourceMap = function(options) { return map; }; - Package.prototype._getMappings = function() { var modules = this._modules; diff --git a/packager/react-packager/src/Packager/index.js b/packager/react-packager/src/Packager/index.js index 123a39133..75cccdb26 100644 --- a/packager/react-packager/src/Packager/index.js +++ b/packager/react-packager/src/Packager/index.js @@ -36,10 +36,6 @@ var validateOpts = declareOpts({ type: 'boolean', default: false, }, - dev: { - type: 'boolean', - default: true, - }, transformModulePath: { type:'string', required: false, @@ -59,7 +55,6 @@ function Packager(options) { projectRoots: opts.projectRoots, blacklistRE: opts.blacklistRE, polyfillModuleNames: opts.polyfillModuleNames, - dev: opts.dev, nonPersistent: opts.nonPersistent, moduleFormat: opts.moduleFormat }); @@ -69,7 +64,6 @@ function Packager(options) { blacklistRE: opts.blacklistRE, cacheVersion: opts.cacheVersion, resetCache: opts.resetCache, - dev: opts.dev, transformModulePath: opts.transformModulePath, nonPersistent: opts.nonPersistent, }); @@ -82,14 +76,14 @@ Packager.prototype.kill = function() { ]); }; -Packager.prototype.package = function(main, runModule, sourceMapUrl) { +Packager.prototype.package = function(main, runModule, sourceMapUrl, isDev) { var transformModule = this._transformModule.bind(this); var ppackage = new Package(sourceMapUrl); var findEventId = Activity.startEvent('find dependencies'); var transformEventId; - return this.getDependencies(main) + return this.getDependencies(main, isDev) .then(function(result) { Activity.endEvent(findEventId); transformEventId = Activity.startEvent('transform'); @@ -119,8 +113,8 @@ Packager.prototype.invalidateFile = function(filePath) { this._transformer.invalidateFile(filePath); }; -Packager.prototype.getDependencies = function(main) { - return this._resolver.getDependencies(main); +Packager.prototype.getDependencies = function(main, isDev) { + return this._resolver.getDependencies(main, { dev: isDev }); }; Packager.prototype._transformModule = function(module) { diff --git a/packager/react-packager/src/Server/index.js b/packager/react-packager/src/Server/index.js index 406357217..053aa0333 100644 --- a/packager/react-packager/src/Server/index.js +++ b/packager/react-packager/src/Server/index.js @@ -35,10 +35,6 @@ var validateOpts = declareOpts({ type: 'boolean', default: false, }, - dev: { - type: 'boolean', - default: true, - }, transformModulePath: { type:'string', required: false, @@ -51,7 +47,6 @@ var validateOpts = declareOpts({ function Server(options) { var opts = validateOpts(options); - this._dev = opts.dev; this._projectRoots = opts.projectRoots; this._packages = Object.create(null); this._packager = new Packager(opts); @@ -73,14 +68,16 @@ Server.prototype._onFileChange = function(type, filepath, root) { }; Server.prototype._rebuildPackages = function() { - var dev = this._dev; var buildPackage = this._buildPackage.bind(this); var packages = this._packages; Object.keys(packages).forEach(function(key) { var options = getOptionsFromUrl(key); packages[key] = buildPackage(options).then(function(p) { // Make a throwaway call to getSource to cache the source string. - p.getSource({inlineSourceMap: dev}); + p.getSource({ + inlineSourceMap: options.dev, + minify: options.minify, + }); return p; }); }); @@ -97,7 +94,8 @@ Server.prototype._buildPackage = function(options) { return this._packager.package( options.main, options.runModule, - options.sourceMapUrl + options.sourceMapUrl, + options.dev ); }; @@ -166,11 +164,13 @@ Server.prototype.processRequest = function(req, res, next) { var building = this._packages[req.url] || this._buildPackage(options); this._packages[req.url] = building; - var dev = this._dev; - building.then( + building.then( function(p) { if (requestType === 'bundle') { - res.end(p.getSource({inlineSourceMap: dev})); + res.end(p.getSource({ + inlineSourceMap: options.dev, + minify: options.minify, + })); Activity.endEvent(startReqEventId); } else if (requestType === 'map') { res.end(JSON.stringify(p.getSourceMap())); @@ -196,8 +196,9 @@ function getOptionsFromUrl(reqUrl) { return { sourceMapUrl: urlObj.pathname.replace(/\.bundle$/, '.map'), main: main, - runModule: urlObj.query.runModule === 'true' || - urlObj.query.runModule === '1' || + dev: getBoolOptionFromQuery(urlObj.query, 'dev'), + minify: getBoolOptionFromQuery(urlObj.query, 'minify'), + runModule: getBoolOptionFromQuery(urlObj.query, 'runModule') || // Backwards compatibility. urlObj.pathname.split('.').some(function(part) { return part === 'runModule'; @@ -205,6 +206,10 @@ function getOptionsFromUrl(reqUrl) { }; } +function getBoolOptionFromQuery(query, opt) { + return query[opt] === 'true' || query[opt] === '1'; +} + function handleError(res, error) { res.writeHead(500, { 'Content-Type': 'application/json; charset=UTF-8', diff --git a/packager/react-packager/src/lib/declareOpts.js b/packager/react-packager/src/lib/declareOpts.js index ddd06061a..3b80da519 100644 --- a/packager/react-packager/src/lib/declareOpts.js +++ b/packager/react-packager/src/lib/declareOpts.js @@ -42,6 +42,8 @@ module.exports = function(descriptor) { var schema = Joi.object().keys(joiKeys); return function(opts) { + opts = opts || {}; + var res = Joi.validate(opts, schema, { abortEarly: true, allowUnknown: false, From 2bf1dff0519d2eeaad401923d8a71874ded1fd77 Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Fri, 6 Mar 2015 17:42:07 -0800 Subject: [PATCH 18/79] Minor packager updates Splitting this out from the next commit for clarity. --- .../src/Server/__tests__/Server-test.js | 54 ++++++++++++++----- packager/react-packager/src/Server/index.js | 45 +++++++++++++++- 2 files changed, 85 insertions(+), 14 deletions(-) diff --git a/packager/react-packager/src/Server/__tests__/Server-test.js b/packager/react-packager/src/Server/__tests__/Server-test.js index f55df7c28..71b7e400f 100644 --- a/packager/react-packager/src/Server/__tests__/Server-test.js +++ b/packager/react-packager/src/Server/__tests__/Server-test.js @@ -45,6 +45,7 @@ describe('processRequest', function() { var invalidatorFunc = jest.genMockFunction(); var watcherFunc = jest.genMockFunction(); var requestHandler; + var triggerFileChange; beforeEach(function() { Packager = require('../../Packager'); @@ -61,7 +62,15 @@ describe('processRequest', function() { }); }; - FileWatcher.prototype.on = watcherFunc; + + FileWatcher.prototype.on = function(eventType, callback) { + if (eventType !== 'all') { + throw new Error('Can only handle "all" event in watcher.'); + } + watcherFunc.apply(this, arguments); + triggerFileChange = callback; + return this; + }; Packager.prototype.invalidateFile = invalidatorFunc; @@ -109,17 +118,6 @@ describe('processRequest', function() { describe('file changes', function() { - var triggerFileChange; - beforeEach(function() { - FileWatcher.prototype.on = function(eventType, callback) { - if (eventType !== 'all') { - throw new Error('Can only handle "all" event in watcher.'); - } - triggerFileChange = callback; - return this; - }; - }); - pit('invalides files in package when file is updated', function() { return makeRequest( requestHandler, @@ -175,4 +173,36 @@ describe('processRequest', function() { }); }); }); + + describe('/onchange endpoint', function() { + var EventEmitter; + var req; + var res; + + beforeEach(function() { + EventEmitter = require.requireActual('events').EventEmitter; + req = new EventEmitter(); + req.url = '/onchange'; + res = { + writeHead: jest.genMockFn(), + end: jest.genMockFn() + }; + }); + + it('should hold on to request and inform on change', function() { + server.processRequest(req, res); + triggerFileChange('all', 'path/file.js', options.projectRoots[0]); + jest.runAllTimers(); + expect(res.end).toBeCalledWith(JSON.stringify({changed: true})); + }); + + it('should not inform changes on disconnected clients', function() { + server.processRequest(req, res); + req.emit('close'); + jest.runAllTimers(); + triggerFileChange('all', 'path/file.js', options.projectRoots[0]); + jest.runAllTimers(); + expect(res.end).not.toBeCalled(); + }); + }); }); diff --git a/packager/react-packager/src/Server/index.js b/packager/react-packager/src/Server/index.js index 053aa0333..8982bc916 100644 --- a/packager/react-packager/src/Server/index.js +++ b/packager/react-packager/src/Server/index.js @@ -50,6 +50,7 @@ function Server(options) { this._projectRoots = opts.projectRoots; this._packages = Object.create(null); this._packager = new Packager(opts); + this._changeWatchers = []; this._fileWatcher = options.nonPersistent ? FileWatcher.createDummyWatcher() @@ -65,6 +66,7 @@ Server.prototype._onFileChange = function(type, filepath, root) { // Make sure the file watcher event runs through the system before // we rebuild the packages. setImmediate(this._rebuildPackages.bind(this, absPath)); + setImmediate(this._informChangeWatchers.bind(this)); }; Server.prototype._rebuildPackages = function() { @@ -83,6 +85,20 @@ Server.prototype._rebuildPackages = function() { }); }; +Server.prototype._informChangeWatchers = function() { + var watchers = this._changeWatchers; + var headers = { + 'Content-Type': 'application/json; charset=UTF-8', + }; + + watchers.forEach(function(w) { + w.res.writeHead(205, headers); + w.res.end(JSON.stringify({ changed: true })); + }); + + this._changeWatchers = []; +}; + Server.prototype.end = function() { q.all([ this._fileWatcher.end(), @@ -142,6 +158,24 @@ Server.prototype._processDebugRequest = function(reqUrl, res) { } }; +Server.prototype._processOnChangeRequest = function(req, res) { + var watchers = this._changeWatchers; + + watchers.push({ + req: req, + res: res, + }); + + req.on('close', function() { + for (var i = 0; i < watchers.length; i++) { + if (watchers[i] && watchers[i].req === req) { + watchers.splice(i, 1); + break; + } + } + }); +}; + Server.prototype.processRequest = function(req, res, next) { var urlObj = url.parse(req.url, true); var pathname = urlObj.pathname; @@ -154,6 +188,9 @@ Server.prototype.processRequest = function(req, res, next) { } else if (pathname.match(/^\/debug/)) { this._processDebugRequest(req.url, res); return; + } else if (pathname.match(/^\/onchange\/?$/)) { + this._processOnChangeRequest(req, res); + return; } else { next(); return; @@ -196,7 +233,7 @@ function getOptionsFromUrl(reqUrl) { return { sourceMapUrl: urlObj.pathname.replace(/\.bundle$/, '.map'), main: main, - dev: getBoolOptionFromQuery(urlObj.query, 'dev'), + dev: getBoolOptionFromQuery(urlObj.query, 'dev', true), minify: getBoolOptionFromQuery(urlObj.query, 'minify'), runModule: getBoolOptionFromQuery(urlObj.query, 'runModule') || // Backwards compatibility. @@ -206,7 +243,11 @@ function getOptionsFromUrl(reqUrl) { }; } -function getBoolOptionFromQuery(query, opt) { +function getBoolOptionFromQuery(query, opt, defaultVal) { + if (query[opt] == null && defaultVal != null) { + return defaultVal; + } + return query[opt] === 'true' || query[opt] === '1'; } From cdd13f504fccd95509ffc3c44195bac8c8787607 Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Fri, 6 Mar 2015 17:48:12 -0800 Subject: [PATCH 19/79] Remove UIExplorer project.xcworkspace This file shouldn't be needed. --- .../project.xcworkspace/contents.xcworkspacedata | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 Examples/UIExplorer/UIExplorer.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Examples/UIExplorer/UIExplorer.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/UIExplorer/UIExplorer.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index e668abba3..000000000 --- a/Examples/UIExplorer/UIExplorer.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - From 418b27c36ec56fa0d9be6d7d858a9c4f3d382f2a Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Sun, 8 Mar 2015 22:39:23 -0700 Subject: [PATCH 20/79] Upgrade to React 0.13 - [React Native] Move copyProperties and mergeHelpers to github dir | Ben Alpert - [React Native] Update core modules for React 0.13 | Ben Alpert - [React Native] Update React to v0.13.0-rc2 | Ben Alpert --- .../Touchable/TouchableWithoutFeedback.js | 3 +- Libraries/ReactIOS/NativeModules/RKRawText.js | 21 --- Libraries/ReactIOS/ReactIOS.js | 16 +- .../ReactIOS/ReactIOSComponentEnvironment.js | 35 +--- Libraries/ReactIOS/ReactIOSComponentMixin.js | 11 +- .../ReactIOS/ReactIOSDefaultInjection.js | 25 +-- Libraries/ReactIOS/ReactIOSMount.js | 86 +++++++++- Libraries/ReactIOS/ReactIOSNativeComponent.js | 63 +++---- Libraries/ReactIOS/ReactIOSTextComponent.js | 62 +++++++ Libraries/ReactIOS/ReactTextComponent.js | 30 ---- .../createReactIOSNativeComponentClass.js | 13 +- Libraries/vendor/core/copyProperties.js | 53 ++++++ Libraries/vendor/core/mergeHelpers.js | 160 ++++++++++++++++++ package.json | 10 +- packager/blacklist.js | 1 - 15 files changed, 432 insertions(+), 157 deletions(-) delete mode 100644 Libraries/ReactIOS/NativeModules/RKRawText.js create mode 100644 Libraries/ReactIOS/ReactIOSTextComponent.js delete mode 100644 Libraries/ReactIOS/ReactTextComponent.js create mode 100644 Libraries/vendor/core/copyProperties.js create mode 100644 Libraries/vendor/core/mergeHelpers.js diff --git a/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/Libraries/Components/Touchable/TouchableWithoutFeedback.js index ebabdd9cc..ccc784e6a 100644 --- a/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -65,7 +65,7 @@ var TouchableWithoutFeedback = React.createClass({ render: function() { // Note(vjeux): use cloneWithProps once React has been upgraded var child = onlyChild(this.props.children); - Object.assign(child.props, { + return React.cloneElement(child, { accessible: true, testID: this.props.testID, onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder, @@ -75,7 +75,6 @@ var TouchableWithoutFeedback = React.createClass({ onResponderRelease: this.touchableHandleResponderRelease, onResponderTerminate: this.touchableHandleResponderTerminate }); - return child; } }); diff --git a/Libraries/ReactIOS/NativeModules/RKRawText.js b/Libraries/ReactIOS/NativeModules/RKRawText.js deleted file mode 100644 index c56f0f68f..000000000 --- a/Libraries/ReactIOS/NativeModules/RKRawText.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule RKRawText - * @typechecks static-only - */ - -"use strict"; - -var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); - -var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass'); - -var RKRawText = createReactIOSNativeComponentClass({ - validAttributes: { - text: true, - }, - uiViewClassName: 'RCTRawText', -}); - -module.exports = RKRawText; diff --git a/Libraries/ReactIOS/ReactIOS.js b/Libraries/ReactIOS/ReactIOS.js index 0022e09bd..4b4b19db0 100644 --- a/Libraries/ReactIOS/ReactIOS.js +++ b/Libraries/ReactIOS/ReactIOS.js @@ -7,8 +7,8 @@ "use strict"; var ReactChildren = require('ReactChildren'); +var ReactClass = require('ReactClass'); var ReactComponent = require('ReactComponent'); -var ReactCompositeComponent = require('ReactCompositeComponent'); var ReactContext = require('ReactContext'); var ReactCurrentOwner = require('ReactCurrentOwner'); var ReactElement = require('ReactElement'); @@ -16,7 +16,6 @@ var ReactElementValidator = require('ReactElementValidator'); var ReactInstanceHandles = require('ReactInstanceHandles'); var ReactIOSDefaultInjection = require('ReactIOSDefaultInjection'); var ReactIOSMount = require('ReactIOSMount'); -var ReactLegacyElement = require('ReactLegacyElement'); var ReactPropTypes = require('ReactPropTypes'); var deprecated = require('deprecated'); @@ -27,20 +26,14 @@ ReactIOSDefaultInjection.inject(); var createElement = ReactElement.createElement; var createFactory = ReactElement.createFactory; +var cloneElement = ReactElement.cloneElement; if (__DEV__) { createElement = ReactElementValidator.createElement; createFactory = ReactElementValidator.createFactory; + cloneElement = ReactElementValidator.cloneElement; } -// TODO: Drop legacy elements once classes no longer export these factories -createElement = ReactLegacyElement.wrapCreateElement( - createElement -); -createFactory = ReactLegacyElement.wrapCreateFactory( - createFactory -); - var resolveDefaultProps = function(element) { // Could be optimized, but not currently in heavy use. var defaultProps = element.type.defaultProps; @@ -82,9 +75,10 @@ var ReactIOS = { only: onlyChild }, PropTypes: ReactPropTypes, - createClass: ReactCompositeComponent.createClass, + createClass: ReactClass.createClass, createElement: createElement, createFactory: createFactory, + cloneElement: cloneElement, _augmentElement: augmentElement, render: render, unmountComponentAtNode: ReactIOSMount.unmountComponentAtNode, diff --git a/Libraries/ReactIOS/ReactIOSComponentEnvironment.js b/Libraries/ReactIOS/ReactIOSComponentEnvironment.js index 67da68b13..ac67a7580 100644 --- a/Libraries/ReactIOS/ReactIOSComponentEnvironment.js +++ b/Libraries/ReactIOS/ReactIOSComponentEnvironment.js @@ -13,10 +13,9 @@ var ReactPerf = require('ReactPerf'); var ReactIOSComponentEnvironment = { - /** - * Will need to supply something that implements this. - */ - BackendIDOperations: ReactIOSDOMIDOperations, + processChildrenUpdates: ReactIOSDOMIDOperations.dangerouslyProcessChildrenUpdates, + + replaceNodeWithMarkupByID: ReactIOSDOMIDOperations.dangerouslyReplaceNodeWithMarkupByID, /** * Nothing to do for UIKit bridge. @@ -34,34 +33,6 @@ var ReactIOSComponentEnvironment = { }, - /** - * @param {View} view View tree image. - * @param {number} containerViewID View to insert sub-view into. - */ - mountImageIntoNode: ReactPerf.measure( - // FIXME(frantic): #4441289 Hack to avoid modifying react-tools - 'ReactComponentBrowserEnvironment', - 'mountImageIntoNode', - function(mountImage, containerID) { - // Since we now know that the `mountImage` has been mounted, we can - // mark it as such. - ReactIOSTagHandles.associateRootNodeIDWithMountedNodeHandle( - mountImage.rootNodeID, - mountImage.tag - ); - var addChildTags = [mountImage.tag]; - var addAtIndices = [0]; - RKUIManager.manageChildren( - ReactIOSTagHandles.mostRecentMountedNodeHandleForRootNodeID(containerID), - null, // moveFromIndices - null, // moveToIndices - addChildTags, - addAtIndices, - null // removeAtIndices - ); - } - ), - ReactReconcileTransaction: ReactIOSReconcileTransaction, }; diff --git a/Libraries/ReactIOS/ReactIOSComponentMixin.js b/Libraries/ReactIOS/ReactIOSComponentMixin.js index 7abb213ee..f9ddde2c2 100644 --- a/Libraries/ReactIOS/ReactIOSComponentMixin.js +++ b/Libraries/ReactIOS/ReactIOSComponentMixin.js @@ -6,6 +6,7 @@ 'use strict'; var ReactIOSTagHandles = require('ReactIOSTagHandles'); +var ReactInstanceMap = require('ReactInstanceMap'); /** * ReactNative vs ReactWeb @@ -55,11 +56,17 @@ var ReactIOSComponentMixin = { * `getNodeHandle`. */ getNativeNode: function() { - return ReactIOSTagHandles.rootNodeIDToTag[this._rootNodeID]; + // TODO (balpert): Wrap iOS native components in a composite wrapper, then + // ReactInstanceMap.get here will always succeed + return ReactIOSTagHandles.rootNodeIDToTag[ + (ReactInstanceMap.get(this) || this)._rootNodeID + ]; }, getNodeHandle: function() { - return ReactIOSTagHandles.rootNodeIDToTag[this._rootNodeID]; + return ReactIOSTagHandles.rootNodeIDToTag[ + (ReactInstanceMap.get(this) || this)._rootNodeID + ]; } }; diff --git a/Libraries/ReactIOS/ReactIOSDefaultInjection.js b/Libraries/ReactIOS/ReactIOSDefaultInjection.js index 729c294e5..09dc9ea0a 100644 --- a/Libraries/ReactIOS/ReactIOSDefaultInjection.js +++ b/Libraries/ReactIOS/ReactIOSDefaultInjection.js @@ -15,20 +15,19 @@ var EventPluginUtils = require('EventPluginUtils'); var IOSDefaultEventPluginOrder = require('IOSDefaultEventPluginOrder'); var IOSNativeBridgeEventPlugin = require('IOSNativeBridgeEventPlugin'); var NodeHandle = require('NodeHandle'); -var ReactComponent = require('ReactComponent'); -var ReactCompositeComponent = require('ReactCompositeComponent'); +var ReactClass = require('ReactClass'); +var ReactComponentEnvironment = require('ReactComponentEnvironment'); var ReactDefaultBatchingStrategy = require('ReactDefaultBatchingStrategy'); -var ReactElement = require('ReactElement'); var ReactInstanceHandles = require('ReactInstanceHandles'); var ReactIOSComponentEnvironment = require('ReactIOSComponentEnvironment'); var ReactIOSComponentMixin = require('ReactIOSComponentMixin'); var ReactIOSGlobalInteractionHandler = require('ReactIOSGlobalInteractionHandler'); var ReactIOSGlobalResponderHandler = require('ReactIOSGlobalResponderHandler'); var ReactIOSMount = require('ReactIOSMount'); -var ReactTextComponent = require('ReactTextComponent'); +var ReactIOSTextComponent = require('ReactIOSTextComponent'); +var ReactNativeComponent = require('ReactNativeComponent'); var ReactUpdates = require('ReactUpdates'); var ResponderEventPlugin = require('ResponderEventPlugin'); -var RKRawText = require('RKRawText'); var UniversalWorkerNodeHandle = require('UniversalWorkerNodeHandle'); // Just to ensure this gets packaged, since its only caller is from Native. @@ -68,23 +67,17 @@ function inject() { ReactDefaultBatchingStrategy ); - ReactComponent.injection.injectEnvironment( + ReactComponentEnvironment.injection.injectEnvironment( ReactIOSComponentEnvironment ); EventPluginUtils.injection.injectMount(ReactIOSMount); - ReactCompositeComponent.injection.injectMixin(ReactIOSComponentMixin); + ReactClass.injection.injectMixin(ReactIOSComponentMixin); - ReactTextComponent.inject(function(initialText) { - // RKRawText is a class so we can't invoke it directly. Instead of using - // a factory, we use the internal fast path to create a descriptor. - // RKRawText is not quite a class yet, so we access the real class from - // the type property. TODO: Change this once factory wrappers are gone. - return new ReactElement(RKRawText.type, null, null, null, null, { - text: initialText - }); - }); + ReactNativeComponent.injection.injectTextComponentClass( + ReactIOSTextComponent + ); NodeHandle.injection.injectImplementation(UniversalWorkerNodeHandle); } diff --git a/Libraries/ReactIOS/ReactIOSMount.js b/Libraries/ReactIOS/ReactIOSMount.js index 4e29be92f..23691143a 100644 --- a/Libraries/ReactIOS/ReactIOSMount.js +++ b/Libraries/ReactIOS/ReactIOSMount.js @@ -9,7 +9,10 @@ var RKUIManager = require('NativeModulesDeprecated').RKUIManager; var ReactIOSTagHandles = require('ReactIOSTagHandles'); var ReactPerf = require('ReactPerf'); +var ReactReconciler = require('ReactReconciler'); +var ReactUpdates = require('ReactUpdates'); +var emptyObject = require('emptyObject'); var instantiateReactComponent = require('instantiateReactComponent'); var invariant = require('invariant'); @@ -19,6 +22,49 @@ function instanceNumberToChildRootID(rootNodeID, instanceNumber) { return rootNodeID + '[' + instanceNumber + ']'; } +/** + * Mounts this component and inserts it into the DOM. + * + * @param {ReactComponent} componentInstance The instance to mount. + * @param {number} rootID ID of the root node. + * @param {number} container container element to mount into. + * @param {ReactReconcileTransaction} transaction + */ +function mountComponentIntoNode( + componentInstance, + rootID, + container, + transaction) { + var markup = ReactReconciler.mountComponent( + componentInstance, rootID, transaction, emptyObject + ); + componentInstance._isTopLevel = true; + ReactIOSMount._mountImageIntoNode(markup, container); +} + +/** + * Batched mount. + * + * @param {ReactComponent} componentInstance The instance to mount. + * @param {number} rootID ID of the root node. + * @param {number} container container element to mount into. + */ +function batchedMountComponentIntoNode( + componentInstance, + rootID, + container) { + var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(); + transaction.perform( + mountComponentIntoNode, + null, + componentInstance, + rootID, + container, + transaction + ); + ReactUpdates.ReactReconcileTransaction.release(transaction); +} + /** * As soon as `ReactMount` is refactored to not rely on the DOM, we can share * code between the two. For now, we'll hard code the ID logic. @@ -52,9 +98,47 @@ var ReactIOSMount = { ReactIOSMount.instanceCount++ ); ReactIOSMount._instancesByContainerID[topRootNodeID] = instance; - instance.mountComponentIntoNode(childRootNodeID, topRootNodeID); + + // The initial render is synchronous but any updates that happen during + // rendering, in componentWillMount or componentDidMount, will be batched + // according to the current batching strategy. + + ReactUpdates.batchedUpdates( + batchedMountComponentIntoNode, + instance, + childRootNodeID, + topRootNodeID + ); }, + /** + * @param {View} view View tree image. + * @param {number} containerViewID View to insert sub-view into. + */ + _mountImageIntoNode: ReactPerf.measure( + // FIXME(frantic): #4441289 Hack to avoid modifying react-tools + 'ReactComponentBrowserEnvironment', + 'mountImageIntoNode', + function(mountImage, containerID) { + // Since we now know that the `mountImage` has been mounted, we can + // mark it as such. + ReactIOSTagHandles.associateRootNodeIDWithMountedNodeHandle( + mountImage.rootNodeID, + mountImage.tag + ); + var addChildTags = [mountImage.tag]; + var addAtIndices = [0]; + RKUIManager.manageChildren( + ReactIOSTagHandles.mostRecentMountedNodeHandleForRootNodeID(containerID), + null, // moveFromIndices + null, // moveToIndices + addChildTags, + addAtIndices, + null // removeAtIndices + ); + } + ), + /** * Standard unmounting of the component that is rendered into `containerID`, * but will also execute a command to remove the actual container view diff --git a/Libraries/ReactIOS/ReactIOSNativeComponent.js b/Libraries/ReactIOS/ReactIOSNativeComponent.js index 7c8381855..df8b59833 100644 --- a/Libraries/ReactIOS/ReactIOSNativeComponent.js +++ b/Libraries/ReactIOS/ReactIOSNativeComponent.js @@ -6,7 +6,6 @@ 'use strict'; var NativeMethodsMixin = require('NativeMethodsMixin'); -var ReactComponent = require('ReactComponent'); var ReactIOSComponentMixin = require('ReactIOSComponentMixin'); var ReactIOSEventEmitter = require('ReactIOSEventEmitter'); var ReactIOSStyleAttributes = require('ReactIOSStyleAttributes'); @@ -32,8 +31,6 @@ var deleteAllListeners = ReactIOSEventEmitter.deleteAllListeners; */ var ReactIOSNativeComponent = function(viewConfig) { this.viewConfig = viewConfig; - this.props = null; - this.previousFlattenedStyle = null; }; /** @@ -65,10 +62,19 @@ cachedIndexArray._cache = {}; * which is a `viewID` ... see the return value for `mountComponent` ! */ ReactIOSNativeComponent.Mixin = { + getPublicInstance: function() { + // TODO: This should probably use a composite wrapper + return this; + }, + + construct: function(element) { + this._currentElement = element; + }, + unmountComponent: function() { deleteAllListeners(this._rootNodeID); - ReactComponent.Mixin.unmountComponent.call(this); this.unmountChildren(); + this._rootNodeID = null; }, /** @@ -79,8 +85,8 @@ ReactIOSNativeComponent.Mixin = { * a child of a container can confidently record that in * `ReactIOSTagHandles`. */ - initializeChildren: function(children, containerTag, transaction) { - var mountImages = this.mountChildren(children, transaction); + initializeChildren: function(children, containerTag, transaction, context) { + var mountImages = this.mountChildren(children, transaction, context); // In a well balanced tree, half of the nodes are in the bottom row and have // no children - let's avoid calling out to the native bridge for a large // portion of the children. @@ -158,21 +164,18 @@ ReactIOSNativeComponent.Mixin = { /** * Updates the component's currently mounted representation. * + * @param {object} nextElement * @param {ReactReconcileTransaction} transaction - * @param {object} prevDescriptor + * @param {object} context * @internal */ - updateComponent: function(transaction, prevDescriptor) { - ReactComponent.Mixin.updateComponent.call( - this, - transaction, - prevDescriptor - ); - var nextDescriptor = this._currentElement; + receiveComponent: function(nextElement, transaction, context) { + var prevElement = this._currentElement; + this._currentElement = nextElement; var updatePayload = this.computeUpdatedProperties( - prevDescriptor.props, - nextDescriptor.props, + prevElement.props, + nextElement.props, this.viewConfig.validAttributes ); @@ -185,10 +188,10 @@ ReactIOSNativeComponent.Mixin = { } this._reconcileListenersUponUpdate( - prevDescriptor.props, - nextDescriptor.props + prevElement.props, + nextElement.props ); - this.updateChildren(this.props.children, transaction); + this.updateChildren(nextElement.props.children, transaction, context); }, /** @@ -223,25 +226,26 @@ ReactIOSNativeComponent.Mixin = { * @param {Transaction} transaction For creating/updating. * @return {string} Unique iOS view tag. */ - mountComponent: function(rootID, transaction, mountDepth) { - ReactComponent.Mixin.mountComponent.call( - this, - rootID, - transaction, - mountDepth - ); + mountComponent: function(rootID, transaction, context) { + this._rootNodeID = rootID; + var tag = ReactIOSTagHandles.allocateTag(); this.previousFlattenedStyle = {}; var updatePayload = this.computeUpdatedProperties( {}, // previous props - this.props, // next props + this._currentElement.props, // next props this.viewConfig.validAttributes ); RKUIManager.createView(tag, this.viewConfig.uiViewClassName, updatePayload); - this._registerListenersUponCreation(this.props); - this.initializeChildren(this.props.children, tag, transaction); + this._registerListenersUponCreation(this._currentElement.props); + this.initializeChildren( + this._currentElement.props.children, + tag, + transaction, + context + ); return { rootNodeID: rootID, tag: tag @@ -255,7 +259,6 @@ ReactIOSNativeComponent.Mixin = { */ Object.assign( ReactIOSNativeComponent.prototype, - ReactComponent.Mixin, ReactMultiChild.Mixin, ReactIOSNativeComponent.Mixin, NativeMethodsMixin, diff --git a/Libraries/ReactIOS/ReactIOSTextComponent.js b/Libraries/ReactIOS/ReactIOSTextComponent.js new file mode 100644 index 000000000..4ec0c7a1a --- /dev/null +++ b/Libraries/ReactIOS/ReactIOSTextComponent.js @@ -0,0 +1,62 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule ReactIOSTextComponent + */ + +'use strict'; + +var ReactIOSTagHandles = require('ReactIOSTagHandles'); +var RKUIManager = require('NativeModulesDeprecated').RKUIManager; + +var assign = require('Object.assign'); + +var ReactIOSTextComponent = function(props) { + // This constructor and its argument is currently used by mocks. +}; + +assign(ReactIOSTextComponent.prototype, { + + construct: function(text) { + // This is really a ReactText (ReactNode), not a ReactElement + this._currentElement = text; + this._stringText = '' + text; + this._rootNodeID = null; + }, + + mountComponent: function(rootID, transaction, context) { + this._rootNodeID = rootID; + var tag = ReactIOSTagHandles.allocateTag(); + RKUIManager.createView(tag, 'RCTRawText', {text: this._stringText}); + return { + rootNodeID: rootID, + tag: tag, + }; + }, + + receiveComponent: function(nextText, transaction, context) { + if (nextText !== this._currentElement) { + this._currentElement = nextText; + var nextStringText = '' + nextText; + if (nextStringText !== this._stringText) { + this._stringText = nextStringText; + RKUIManager.updateView( + ReactIOSTagHandles.mostRecentMountedNodeHandleForRootNodeID( + this._rootNodeID + ), + 'RCTRawText', + {text: this._stringText} + ); + } + } + }, + + unmountComponent: function() { + this._currentElement = null; + this._stringText = null; + this._rootNodeID = null; + } + +}); + +module.exports = ReactIOSTextComponent; diff --git a/Libraries/ReactIOS/ReactTextComponent.js b/Libraries/ReactIOS/ReactTextComponent.js deleted file mode 100644 index 7ecbed18a..000000000 --- a/Libraries/ReactIOS/ReactTextComponent.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright 2004-present Facebook. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @providesModule ReactTextComponent - * @typechecks static-only - */ - -"use strict"; - -var InjectedTextComponent = null; -var ReactTextComponent = function() { - return InjectedTextComponent.apply(this, arguments); -}; -ReactTextComponent.inject = function(textComponent) { - InjectedTextComponent = textComponent; -}; - -module.exports = ReactTextComponent; diff --git a/Libraries/ReactIOS/createReactIOSNativeComponentClass.js b/Libraries/ReactIOS/createReactIOSNativeComponentClass.js index 8df2f510b..465b26ba4 100644 --- a/Libraries/ReactIOS/createReactIOSNativeComponentClass.js +++ b/Libraries/ReactIOS/createReactIOSNativeComponentClass.js @@ -7,7 +7,6 @@ "use strict"; var ReactElement = require('ReactElement'); -var ReactLegacyElement = require('ReactLegacyElement'); var ReactIOSNativeComponent = require('ReactIOSNativeComponent'); /** @@ -15,15 +14,17 @@ var ReactIOSNativeComponent = require('ReactIOSNativeComponent'); * @private */ var createReactIOSNativeComponentClass = function(viewConfig) { - var Constructor = function(props) { + var Constructor = function(element) { + this._currentElement = element; + + this._rootNodeID = null; + this._renderedChildren = null; + this.previousFlattenedStyle = null; }; Constructor.displayName = viewConfig.uiViewClassName; Constructor.prototype = new ReactIOSNativeComponent(viewConfig); - Constructor.prototype.constructor = Constructor; - return ReactLegacyElement.wrapFactory( - ReactElement.createFactory(Constructor) - ); + return Constructor; }; module.exports = createReactIOSNativeComponentClass; diff --git a/Libraries/vendor/core/copyProperties.js b/Libraries/vendor/core/copyProperties.js new file mode 100644 index 000000000..e5a2638d9 --- /dev/null +++ b/Libraries/vendor/core/copyProperties.js @@ -0,0 +1,53 @@ +/** + * @generated SignedSource<> + * + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * !! This file is a check-in of a static_upstream project! !! + * !! !! + * !! You should not modify this file directly. Instead: !! + * !! 1) Use `fjs use-upstream` to temporarily replace this with !! + * !! the latest version from upstream. !! + * !! 2) Make your changes, test them, etc. !! + * !! 3) Use `fjs push-upstream` to copy your changes back to !! + * !! static_upstream. !! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * + * @providesModule copyProperties + */ + +/** + * Copy properties from one or more objects (up to 5) into the first object. + * This is a shallow copy. It mutates the first object and also returns it. + * + * NOTE: `arguments` has a very significant performance penalty, which is why + * we don't support unlimited arguments. + */ +function copyProperties(obj, a, b, c, d, e, f) { + obj = obj || {}; + + if (__DEV__) { + if (f) { + throw new Error('Too many arguments passed to copyProperties'); + } + } + + var args = [a, b, c, d, e]; + var ii = 0, v; + while (args[ii]) { + v = args[ii++]; + for (var k in v) { + obj[k] = v[k]; + } + + // IE ignores toString in object iteration.. See: + // webreflection.blogspot.com/2007/07/quick-fix-internet-explorer-and.html + if (v.hasOwnProperty && v.hasOwnProperty('toString') && + (typeof v.toString != 'undefined') && (obj.toString !== v.toString)) { + obj.toString = v.toString; + } + } + + return obj; +} + +module.exports = copyProperties; diff --git a/Libraries/vendor/core/mergeHelpers.js b/Libraries/vendor/core/mergeHelpers.js new file mode 100644 index 000000000..58fa238d4 --- /dev/null +++ b/Libraries/vendor/core/mergeHelpers.js @@ -0,0 +1,160 @@ +/** + * @generated SignedSource<> + * + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * !! This file is a check-in of a static_upstream project! !! + * !! !! + * !! You should not modify this file directly. Instead: !! + * !! 1) Use `fjs use-upstream` to temporarily replace this with !! + * !! the latest version from upstream. !! + * !! 2) Make your changes, test them, etc. !! + * !! 3) Use `fjs push-upstream` to copy your changes back to !! + * !! static_upstream. !! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * + * Copyright 2013-2014 Facebook, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @providesModule mergeHelpers + * + * requiresPolyfills: Array.isArray + */ + +"use strict"; + +var invariant = require('invariant'); +var keyMirror = require('keyMirror'); + +/** + * Maximum number of levels to traverse. Will catch circular structures. + * @const + */ +var MAX_MERGE_DEPTH = 36; + +/** + * We won't worry about edge cases like new String('x') or new Boolean(true). + * Functions are considered terminals, and arrays are not. + * @param {*} o The item/object/value to test. + * @return {boolean} true iff the argument is a terminal. + */ +var isTerminal = function(o) { + return typeof o !== 'object' || o === null; +}; + +var mergeHelpers = { + + MAX_MERGE_DEPTH: MAX_MERGE_DEPTH, + + isTerminal: isTerminal, + + /** + * Converts null/undefined values into empty object. + * + * @param {?Object=} arg Argument to be normalized (nullable optional) + * @return {!Object} + */ + normalizeMergeArg: function(arg) { + return arg === undefined || arg === null ? {} : arg; + }, + + /** + * If merging Arrays, a merge strategy *must* be supplied. If not, it is + * likely the caller's fault. If this function is ever called with anything + * but `one` and `two` being `Array`s, it is the fault of the merge utilities. + * + * @param {*} one Array to merge into. + * @param {*} two Array to merge from. + */ + checkMergeArrayArgs: function(one, two) { + invariant( + Array.isArray(one) && Array.isArray(two), + 'Tried to merge arrays, instead got %s and %s.', + one, + two + ); + }, + + /** + * @param {*} one Object to merge into. + * @param {*} two Object to merge from. + */ + checkMergeObjectArgs: function(one, two) { + mergeHelpers.checkMergeObjectArg(one); + mergeHelpers.checkMergeObjectArg(two); + }, + + /** + * @param {*} arg + */ + checkMergeObjectArg: function(arg) { + invariant( + !isTerminal(arg) && !Array.isArray(arg), + 'Tried to merge an object, instead got %s.', + arg + ); + }, + + /** + * @param {*} arg + */ + checkMergeIntoObjectArg: function(arg) { + invariant( + (!isTerminal(arg) || typeof arg === 'function') && !Array.isArray(arg), + 'Tried to merge into an object, instead got %s.', + arg + ); + }, + + /** + * Checks that a merge was not given a circular object or an object that had + * too great of depth. + * + * @param {number} Level of recursion to validate against maximum. + */ + checkMergeLevel: function(level) { + invariant( + level < MAX_MERGE_DEPTH, + 'Maximum deep merge depth exceeded. You may be attempting to merge ' + + 'circular structures in an unsupported way.' + ); + }, + + /** + * Checks that the supplied merge strategy is valid. + * + * @param {string} Array merge strategy. + */ + checkArrayStrategy: function(strategy) { + invariant( + strategy === undefined || strategy in mergeHelpers.ArrayStrategies, + 'You must provide an array strategy to deep merge functions to ' + + 'instruct the deep merge how to resolve merging two arrays.' + ); + }, + + /** + * Set of possible behaviors of merge algorithms when encountering two Arrays + * that must be merged together. + * - `clobber`: The left `Array` is ignored. + * - `indexByIndex`: The result is achieved by recursively deep merging at + * each index. (not yet supported.) + */ + ArrayStrategies: keyMirror({ + Clobber: true, + IndexByIndex: true + }) + +}; + +module.exports = mergeHelpers; diff --git a/package.json b/package.json index 18516ccbc..f0af6823e 100644 --- a/package.json +++ b/package.json @@ -28,19 +28,19 @@ "absolute-path": "0.0.0", "connect": "2.8.3", "debug": "~2.1.0", - "jstransform": "8.2.0", + "joi": "~5.1.0", + "jstransform": "10.0.1", "module-deps": "3.5.6", "optimist": "0.6.1", "q": "1.0.1", - "react-tools": "0.12.2", + "react-tools": "0.13.0-rc2", "sane": "1.0.1", "source-map": "0.1.31", "stacktrace-parser": "0.1.1", + "uglify-js": "~2.4.16", "underscore": "1.7.0", "worker-farm": "1.1.0", - "yargs": "1.3.2", - "joi": "~5.1.0", - "uglify-js": "~2.4.16" + "yargs": "1.3.2" }, "devDependencies": { "jest-cli": "0.2.1", diff --git a/packager/blacklist.js b/packager/blacklist.js index 2b710af62..eb81f4524 100644 --- a/packager/blacklist.js +++ b/packager/blacklist.js @@ -22,7 +22,6 @@ var webBlacklist = [ var iosBlacklist = [ 'node_modules/react-tools/src/browser/ui/React.js', 'node_modules/react-tools/src/browser/eventPlugins/ResponderEventPlugin.js', - 'node_modules/react-tools/src/browser/ReactTextComponent.js', // 'node_modules/react-tools/src/vendor/core/ExecutionEnvironment.js', '.web.js', '.android.js', From f87b0cb495470e3ca28599a82233d57a2dce9eb9 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Mon, 9 Mar 2015 11:49:58 -0700 Subject: [PATCH 21/79] [Website] Add a link when composing prop types --- website/layout/AutodocsLayout.js | 29 ++++++++++++++++++++++------- website/server/extractDocs.js | 2 +- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/website/layout/AutodocsLayout.js b/website/layout/AutodocsLayout.js index 9ff344199..2a38dc18a 100644 --- a/website/layout/AutodocsLayout.js +++ b/website/layout/AutodocsLayout.js @@ -8,12 +8,13 @@ var Header = require('Header'); var Marked = require('Marked'); var React = require('React'); var Site = require('Site'); +var slugify = require('slugify'); var Autodocs = React.createClass({ renderProp: function(name, prop) { return ( -
+
{name} {' '} @@ -23,12 +24,26 @@ var Autodocs = React.createClass({
); }, - renderProps: function(props) { - var result = Object.keys(props).sort().map((name) => - this.renderProp(name, props[name]) + renderCompose: function(name) { + return ( +
+
+ {name} props... +
+
+ ); + }, + renderProps: function(props, composes) { + return ( +
+ {(composes || []).map((name) => + this.renderCompose(name) + )} + {Object.keys(props).sort().map((name) => + this.renderProp(name, props[name]) + )} +
); - - return
{result}
; }, render: function() { var metadata = this.props.metadata; @@ -43,7 +58,7 @@ var Autodocs = React.createClass({ {content.description} - {this.renderProps(content.props)} + {this.renderProps(content.props, content.composes)} {content.fullDescription} diff --git a/website/server/extractDocs.js b/website/server/extractDocs.js index 095a9ac1a..5a5456e43 100644 --- a/website/server/extractDocs.js +++ b/website/server/extractDocs.js @@ -46,7 +46,7 @@ var components = [ '../Libraries/Image/Image.ios.js', '../Libraries/Components/ListView/ListView.js', '../Libraries/Components/Navigation/NavigatorIOS.ios.js', - '../Libraries/Components/ScrollView/ScrollView.ios.js', + '../Libraries/Components/ScrollView/ScrollView.js', '../Libraries/Text/Text.js', '../Libraries/Components/TextInput/TextInput.ios.js', '../Libraries/Components/Touchable/TouchableHighlight.js', From 05ec075c948b29dae18567f53e3af7ca972e7f70 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Mon, 9 Mar 2015 13:25:01 -0700 Subject: [PATCH 22/79] [Website] Better summary for propTypes --- website/layout/AutodocsLayout.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/website/layout/AutodocsLayout.js b/website/layout/AutodocsLayout.js index 2a38dc18a..8fadbf050 100644 --- a/website/layout/AutodocsLayout.js +++ b/website/layout/AutodocsLayout.js @@ -12,13 +12,38 @@ var slugify = require('slugify'); var Autodocs = React.createClass({ + renderType: function(type) { + if (type.name === 'enum') { + return 'enum(' + type.value.map((v => v.value)).join(', ') + ')'; + } + + if (type.name === 'shape') { + return '{' + Object.keys(type.value).map((key => key + ': ' + this.renderType(type.value[key]))).join(', ') + '}'; + } + + if (type.name === 'arrayOf') { + return '[' + this.renderType(type.value) + ']'; + } + + if (type.name === 'instanceOf') { + return type.value; + } + + if (type.name === 'custom') { + return type.raw; + } + + return type.name; + }, renderProp: function(name, prop) { return (
{name} {' '} - {prop.type && {prop.type.name}} + {prop.type && + {this.renderType(prop.type)} + }
{prop.description && {prop.description}}
From cb9b1f7b293f85e054a15d9336cdb85a005542fc Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Mon, 9 Mar 2015 16:18:15 -0700 Subject: [PATCH 23/79] Big Updates from Fri Mar 6 - [ReactNative] Oss RCTSlider | Tadeu Zagallo - [ReactNative] Oss RCTSwitch | Tadeu Zagallo - [ReactNative] Remove ImageSourcePropType | Christopher Chedeau - [ReactNative] s/Image.sourcePropType/Image.propTypes.source/ | Christopher Chedeau - [ReactNative] s/Text.stylePropType/Text.propTypes.style/ | Christopher Chedeau - [ReactNative] s/View.stylePropType/View.propTypes.style/ | Christopher Chedeau - [ReactNative] Remove nativePropTypes | Christopher Chedeau - [ReactNative] Inline ScrollViewPropTypes | Christopher Chedeau - [ReactNative] Unify ScrollView.android and ScrollView.ios | Christopher Chedeau - [ReactNative] Move around and reformat comments for the documentation | Christopher Chedeau - Improved Geolocation API | Nick Lockwood - [React Native] Move copyProperties and mergeHelpers to github dir | Ben Alpert - Fixed some misspellings that are propagating through our code | Skotch Vail - [ReactNative] OSS DatePicker | Spencer Ahrens - [React Native] Update core modules for React 0.13 | Ben Alpert - [React Native] Update React to v0.13.0-rc2 | Ben Alpert - [react-packager] onchange endpoint that informs of changes | Amjad Masad - [react-packager] dev option needs to default to true for backwards compat | Amjad Masad --- Examples/UIExplorer/DatePickerExample.js | 157 +++++++++ Examples/UIExplorer/GeoLocationExample.js | 10 +- Examples/UIExplorer/SliderExample.js | 57 ++++ Examples/UIExplorer/SwitchExample.js | 141 ++++++++ .../UIExplorer.xcodeproj/project.pbxproj | 30 ++ .../contents.xcworkspacedata | 7 + Examples/UIExplorer/UIExplorerList.js | 5 +- .../ActivityIndicatorIOS.ios.js | 1 - .../DatePicker/DatePickerIOS.ios.js | 155 +++++++++ Libraries/Components/ListView/ListView.js | 56 +-- .../Components/Navigation/NavigatorIOS.ios.js | 155 ++++----- .../{ScrollView.ios.js => ScrollView.js} | 191 +++++++---- Libraries/Components/ScrollViewPropTypes.js | 30 -- Libraries/Components/Slider/Slider.js | 83 +++++ .../Components/SwitchIOS/SwitchIOS.android.js | 41 +++ .../Components/SwitchIOS/SwitchIOS.ios.js | 117 +++++++ .../Components/TabBarIOS/TabBarItemIOS.ios.js | 4 +- .../Components/TextInput/TextInput.ios.js | 68 ++-- .../Touchable/TouchableHighlight.js | 40 +-- .../Components/Touchable/TouchableOpacity.js | 30 +- Libraries/Components/View/View.js | 33 +- .../{GeoLocation.js => Geolocation.ios.js} | 68 ++-- .../RCTGeolocation.xcodeproj/project.pbxproj | 256 ++++++++++++++ .../GeoLocation}/RCTLocationObserver.h | 0 Libraries/GeoLocation/RCTLocationObserver.m | 319 ++++++++++++++++++ Libraries/Image/Image.ios.js | 47 +-- Libraries/Image/ImageSourcePropType.js | 27 -- .../InitializeJavaScriptAppEngine.js | 2 +- Libraries/ReactIOS/nativePropType.js | 18 - Libraries/StyleSheet/ArrayOfPropType.js | 18 - Libraries/StyleSheet/EdgeInsetsPropType.js | 2 - Libraries/StyleSheet/PointPropType.js | 2 - Libraries/Text/Text.js | 50 ++- .../Utilities/validAttributesFromPropTypes.js | 20 -- Libraries/react-native/react-native.js | 3 + ReactKit/Base/RCTConvert.h | 2 + ReactKit/Base/RCTConvert.m | 2 + ReactKit/Modules/RCTLocationObserver.m | 182 ---------- ReactKit/Modules/RCTUIManager.m | 8 +- ReactKit/ReactKit.xcodeproj/project.pbxproj | 30 +- ReactKit/Views/RCTDatePickerManager.h | 7 + ReactKit/Views/RCTDatePickerManager.m | 51 +++ ReactKit/Views/RCTShadowView.h | 4 +- ReactKit/Views/RCTSliderManager.h | 7 + ReactKit/Views/RCTSliderManager.m | 43 +++ ReactKit/Views/RCTSwitch.h | 10 + ReactKit/Views/RCTSwitch.m | 15 + ReactKit/Views/RCTSwitchManager.h | 7 + ReactKit/Views/RCTSwitchManager.m | 39 +++ ReactKit/Views/RCTViewNodeProtocol.h | 1 - 50 files changed, 1998 insertions(+), 653 deletions(-) create mode 100644 Examples/UIExplorer/DatePickerExample.js create mode 100644 Examples/UIExplorer/SliderExample.js create mode 100644 Examples/UIExplorer/SwitchExample.js create mode 100644 Examples/UIExplorer/UIExplorer.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Libraries/Components/DatePicker/DatePickerIOS.ios.js rename Libraries/Components/ScrollView/{ScrollView.ios.js => ScrollView.js} (58%) delete mode 100644 Libraries/Components/ScrollViewPropTypes.js create mode 100644 Libraries/Components/Slider/Slider.js create mode 100644 Libraries/Components/SwitchIOS/SwitchIOS.android.js create mode 100644 Libraries/Components/SwitchIOS/SwitchIOS.ios.js rename Libraries/GeoLocation/{GeoLocation.js => Geolocation.ios.js} (65%) create mode 100644 Libraries/GeoLocation/RCTGeolocation.xcodeproj/project.pbxproj rename {ReactKit/Modules => Libraries/GeoLocation}/RCTLocationObserver.h (100%) create mode 100644 Libraries/GeoLocation/RCTLocationObserver.m delete mode 100644 Libraries/Image/ImageSourcePropType.js delete mode 100644 Libraries/ReactIOS/nativePropType.js delete mode 100644 Libraries/StyleSheet/ArrayOfPropType.js delete mode 100644 Libraries/Utilities/validAttributesFromPropTypes.js delete mode 100644 ReactKit/Modules/RCTLocationObserver.m create mode 100644 ReactKit/Views/RCTDatePickerManager.h create mode 100644 ReactKit/Views/RCTDatePickerManager.m create mode 100644 ReactKit/Views/RCTSliderManager.h create mode 100644 ReactKit/Views/RCTSliderManager.m create mode 100644 ReactKit/Views/RCTSwitch.h create mode 100644 ReactKit/Views/RCTSwitch.m create mode 100644 ReactKit/Views/RCTSwitchManager.h create mode 100644 ReactKit/Views/RCTSwitchManager.m diff --git a/Examples/UIExplorer/DatePickerExample.js b/Examples/UIExplorer/DatePickerExample.js new file mode 100644 index 000000000..a212546f4 --- /dev/null +++ b/Examples/UIExplorer/DatePickerExample.js @@ -0,0 +1,157 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule DatePickerExample + */ +'use strict'; + +var React = require('react-native'); +var { + DatePickerIOS, + StyleSheet, + Text, + TextInput, + View, +} = React; + +var DatePickerExample = React.createClass({ + getDefaultProps: function () { + return { + date: new Date(), + timeZoneOffsetInHours: (-1) * (new Date()).getTimezoneOffset() / 60, + }; + }, + + getInitialState: function() { + return { + date: this.props.date, + timeZoneOffsetInHours: this.props.timeZoneOffsetInHours, + }; + }, + + onDateChange: function(date) { + this.setState({date: date}); + }, + + onTimezoneChange: function(event) { + var offset = parseInt(event.nativeEvent.text, 10); + if (isNaN(offset)) { + return; + } + this.setState({timeZoneOffsetInHours: offset}); + }, + + render: function() { + // Ideally, the timezone input would be a picker rather than a + // text input, but we don't have any pickers yet :( + return ( + + + { + this.state.date.toLocaleDateString() + + ' ' + + this.state.date.toLocaleTimeString() + } + + + + hours from UTC + + + + + + + + + ); + }, +}); + +var WithLabel = React.createClass({ + render: function() { + return ( + + + + {this.props.label} + + + {this.props.children} + + ); + } +}); + +var Heading = React.createClass({ + render: function() { + return ( + + + {this.props.label} + + + ); + } +}); + +exports.title = ''; +exports.description = 'Select dates and times using the native UIDatePicker.'; +exports.examples = [ +{ + title: '', + render: function() { + return ; + }, +}]; + +var styles = StyleSheet.create({ + textinput: { + height: 26, + width: 50, + borderWidth: 0.5, + borderColor: '#0f0f0f', + padding: 4, + fontSize: 13, + }, + labelContainer: { + flexDirection: 'row', + alignItems: 'center', + marginVertical: 2, + }, + labelView: { + marginRight: 10, + paddingVertical: 2, + }, + label: { + fontWeight: 'bold', + }, + headingContainer: { + padding: 4, + backgroundColor: '#f6f7f8', + }, + heading: { + fontWeight: 'bold', + fontSize: 14, + }, +}); diff --git a/Examples/UIExplorer/GeoLocationExample.js b/Examples/UIExplorer/GeoLocationExample.js index 1ab5f290c..fac3dd205 100644 --- a/Examples/UIExplorer/GeoLocationExample.js +++ b/Examples/UIExplorer/GeoLocationExample.js @@ -1,7 +1,7 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. * - * @providesModule GeoLocationExample + * @providesModule GeolocationExample */ /* eslint no-console: 0 */ 'use strict'; @@ -15,19 +15,19 @@ var { } = React; exports.framework = 'React'; -exports.title = 'GeoLocation'; -exports.description = 'Examples of using the GeoLocation API.'; +exports.title = 'Geolocation'; +exports.description = 'Examples of using the Geolocation API.'; exports.examples = [ { title: 'navigator.geolocation', render: function() { - return ; + return ; }, } ]; -var GeoLocationExample = React.createClass({ +var GeolocationExample = React.createClass({ getInitialState: function() { return { initialPosition: 'unknown', diff --git a/Examples/UIExplorer/SliderExample.js b/Examples/UIExplorer/SliderExample.js new file mode 100644 index 000000000..0ff4f6713 --- /dev/null +++ b/Examples/UIExplorer/SliderExample.js @@ -0,0 +1,57 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule SliderExample + */ +'use strict'; + +var React = require('react-native'); +var { + Slider, + Text, + StyleSheet, + View, +} = React; + +var SliderExample = React.createClass({ + getInitialState() { + return { + value: 0, + }; + }, + + render() { + return ( + + + {this.state.value} + + this.setState({value: value})} /> + + ); + } +}); + +var styles = StyleSheet.create({ + slider: { + height: 10, + margin: 10, + }, + text: { + fontSize: 14, + textAlign: 'center', + fontWeight: 'bold', + margin: 10, + }, +}); + +exports.title = ''; +exports.description = 'Slider input for numeric values'; +exports.examples = [ + { + title: 'Slider', + render() { return ; } + } +]; diff --git a/Examples/UIExplorer/SwitchExample.js b/Examples/UIExplorer/SwitchExample.js new file mode 100644 index 000000000..9aa63833f --- /dev/null +++ b/Examples/UIExplorer/SwitchExample.js @@ -0,0 +1,141 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule SwitchExample + */ +'use strict'; + +var React = require('react-native'); +var { + SwitchIOS, + Text, + View +} = React; + +var BasicSwitchExample = React.createClass({ + getInitialState() { + return { + trueSwitchIsOn: true, + falseSwitchIsOn: false, + }; + }, + render() { + return ( + + this.setState({falseSwitchIsOn: value})} + style={{marginBottom: 10}} + value={this.state.falseSwitchIsOn} /> + this.setState({trueSwitchIsOn: value})} + value={this.state.trueSwitchIsOn} /> + + ); + } +}); + +var DisabledSwitchExample = React.createClass({ + render() { + return ( + + + + + ); + }, +}); + +var ColorSwitchExample = React.createClass({ + getInitialState() { + return { + colorTrueSwitchIsOn: true, + colorFalseSwitchIsOn: false, + }; + }, + render() { + return ( + + this.setState({colorFalseSwitchIsOn: value})} + onTintColor="#00ff00" + style={{marginBottom: 10}} + thumbTintColor="#0000ff" + tintColor="#ff0000" + value={this.state.colorFalseSwitchIsOn} /> + this.setState({colorTrueSwitchIsOn: value})} + onTintColor="#00ff00" + thumbTintColor="#0000ff" + tintColor="#ff0000" + value={this.state.colorTrueSwitchIsOn} /> + + ); + }, +}); + +var EventSwitchExample = React.createClass({ + getInitialState() { + return { + eventSwitchIsOn: false, + eventSwitchRegressionIsOn: true, + }; + }, + render() { + return ( + + + this.setState({eventSwitchIsOn: value})} + style={{marginBottom: 10}} + value={this.state.eventSwitchIsOn} /> + this.setState({eventSwitchIsOn: value})} + style={{marginBottom: 10}} + value={this.state.eventSwitchIsOn} /> + {this.state.eventSwitchIsOn ? "On" : "Off"} + + + this.setState({eventSwitchRegressionIsOn: value})} + style={{marginBottom: 10}} + value={this.state.eventSwitchRegressionIsOn} /> + this.setState({eventSwitchRegressionIsOn: value})} + style={{marginBottom: 10}} + value={this.state.eventSwitchRegressionIsOn} /> + {this.state.eventSwitchRegressionIsOn ? "On" : "Off"} + + + ); + } +}); + +exports.title = ''; +exports.description = 'Native boolean input'; +exports.examples = [ + { + title: 'Switches can be set to true or false', + render() { return ; } + }, + { + title: 'Switches can be disabled', + render() { return ; } + }, + { + title: 'Custom colors can be provided', + render() { return ; } + }, + { + title: 'Change events can be detected', + render() { return ; } + }, + { + title: 'Switches are controlled components', + render() { return ; } + } +]; diff --git a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj index 942ec24b0..ea13d28e3 100644 --- a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj +++ b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj @@ -11,6 +11,7 @@ 134180011AA9153C003F314A /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FEF1AA914B8003F314A /* libRCTText.a */; }; 134180021AA9153C003F314A /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FFF1AA91531003F314A /* libReactKit.a */; }; 1341802C1AA9178B003F314A /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1341802B1AA91779003F314A /* libRCTNetwork.a */; }; + 134A8A2A1AACED7A00945AAE /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 134A8A251AACED6A00945AAE /* libRCTGeolocation.a */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; @@ -46,6 +47,13 @@ remoteGlobalIDString = 58B511DB1A9E6C8500147676; remoteInfo = RCTNetwork; }; + 134A8A241AACED6A00945AAE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 134A8A201AACED6A00945AAE /* RCTGeolocation.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RCTGeolocation; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -53,6 +61,7 @@ 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; 13417FFA1AA91531003F314A /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = ""; }; 134180261AA91779003F314A /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = ../../Libraries/Network/RCTNetwork.xcodeproj; sourceTree = ""; }; + 134A8A201AACED6A00945AAE /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = ../../Libraries/Geolocation/RCTGeolocation.xcodeproj; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* UIExplorer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UIExplorer.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; @@ -67,6 +76,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 134A8A2A1AACED7A00945AAE /* libRCTGeolocation.a in Frameworks */, 1341802C1AA9178B003F314A /* libRCTNetwork.a in Frameworks */, 134180011AA9153C003F314A /* libRCTText.a in Frameworks */, 134180021AA9153C003F314A /* libReactKit.a in Frameworks */, @@ -80,6 +90,7 @@ 1316A21D1AA397F400C0188E /* Libraries */ = { isa = PBXGroup; children = ( + 134A8A201AACED6A00945AAE /* RCTGeolocation.xcodeproj */, 13417FFA1AA91531003F314A /* ReactKit.xcodeproj */, 134180261AA91779003F314A /* RCTNetwork.xcodeproj */, 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */, @@ -120,6 +131,14 @@ name = Products; sourceTree = ""; }; + 134A8A211AACED6A00945AAE /* Products */ = { + isa = PBXGroup; + children = ( + 134A8A251AACED6A00945AAE /* libRCTGeolocation.a */, + ); + name = Products; + sourceTree = ""; + }; 13B07FAE1A68108700A75B9A /* UIExplorer */ = { isa = PBXGroup; children = ( @@ -191,6 +210,10 @@ productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; projectDirPath = ""; projectReferences = ( + { + ProductGroup = 134A8A211AACED6A00945AAE /* Products */; + ProjectRef = 134A8A201AACED6A00945AAE /* RCTGeolocation.xcodeproj */; + }, { ProductGroup = 13417FE41AA91428003F314A /* Products */; ProjectRef = 13417FE31AA91428003F314A /* RCTImage.xcodeproj */; @@ -244,6 +267,13 @@ remoteRef = 1341802A1AA91779003F314A /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 134A8A251AACED6A00945AAE /* libRCTGeolocation.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTGeolocation.a; + remoteRef = 134A8A241AACED6A00945AAE /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ diff --git a/Examples/UIExplorer/UIExplorer.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/UIExplorer/UIExplorer.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..e668abba3 --- /dev/null +++ b/Examples/UIExplorer/UIExplorer.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Examples/UIExplorer/UIExplorerList.js b/Examples/UIExplorer/UIExplorerList.js index 606840567..e04edcab6 100644 --- a/Examples/UIExplorer/UIExplorerList.js +++ b/Examples/UIExplorer/UIExplorerList.js @@ -31,8 +31,11 @@ var EXAMPLES = [ require('./TouchableExample'), require('./ActivityIndicatorExample'), require('./ScrollViewExample'), - require('./GeoLocationExample'), + require('./DatePickerExample'), + require('./GeolocationExample'), require('./TabBarExample'), + require('./SwitchExample'), + require('./SliderExample'), ]; var UIExplorerList = React.createClass({ diff --git a/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js b/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js index 5bba89830..df762c5ee 100644 --- a/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js +++ b/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js @@ -15,7 +15,6 @@ var View = require('View'); var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass'); var keyMirror = require('keyMirror'); -var keyOf = require('keyOf'); var merge = require('merge'); var SpinnerSize = keyMirror({ diff --git a/Libraries/Components/DatePicker/DatePickerIOS.ios.js b/Libraries/Components/DatePicker/DatePickerIOS.ios.js new file mode 100644 index 000000000..b4a6d5bb1 --- /dev/null +++ b/Libraries/Components/DatePicker/DatePickerIOS.ios.js @@ -0,0 +1,155 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule DatePickerIOS + * + * This is a controlled component version of RKDatePickerIOS + */ +'use strict'; + +var NativeMethodsMixin = require('NativeMethodsMixin'); +var PropTypes = require('ReactPropTypes'); +var React = require('React'); +var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); +var RKDatePickerIOSConsts = require('NativeModules').RKUIManager.RCTDatePicker.Constants; +var StyleSheet = require('StyleSheet'); +var View = require('View'); + +var createReactIOSNativeComponentClass = + require('createReactIOSNativeComponentClass'); +var merge = require('merge'); + +var DATEPICKER = 'datepicker'; + +/** + * Use `DatePickerIOS` to render a date/time picker (selector) on iOS. This is + * a controlled component, so you must hook in to the `onDateChange` callback + * and update the `date` prop in order for the component to update, otherwise + * the user's change will be reverted immediately to reflect `props.date` as the + * source of truth. + */ +var DatePickerIOS = React.createClass({ + mixins: [NativeMethodsMixin], + + propTypes: { + /** + * The currently selected date. + */ + date: PropTypes.instanceOf(Date).isRequired, + + /** + * Date change handler. + * + * This is called when the user changes the date or time in the UI. + * The first and only argument is a Date object representing the new + * date and time. + */ + onDateChange: PropTypes.func.isRequired, + + /** + * Maximum date. + * + * Restricts the range of possible date/time values. + */ + maximumDate: PropTypes.instanceOf(Date), + + /** + * Minimum date. + * + * Restricts the range of possible date/time values. + */ + minimumDate: PropTypes.instanceOf(Date), + + /** + * The date picker mode. + * + * Valid modes on iOS are: 'date', 'time', 'datetime'. + */ + mode: PropTypes.oneOf(Object.keys(RKDatePickerIOSConsts.DatePickerModes)), + + /** + * The interval at which minutes can be selected. + */ + minuteInterval: PropTypes.oneOf([1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30]), + + /** + * Timezone offset in seconds. + * + * By default, the date picker will use the device's timezone. With this + * parameter, it is possible to force a certain timezone offset. For + * instance, to show times in Pacific Standard Time, pass -7 * 60. + */ + timeZoneOffsetInMinutes: PropTypes.number, + }, + + getDefaultProps: function() { + return { + mode: 'datetime', + }; + }, + + _onChange: function(event) { + var nativeTimeStamp = event.nativeEvent.timestamp; + this.props.onDateChange && this.props.onDateChange( + new Date(nativeTimeStamp) + ); + this.props.onChange && this.props.onChange(event); + + // We expect the onChange* handlers to be in charge of updating our `date` + // prop. That way they can also disallow/undo/mutate the selection of + // certain values. In other words, the embedder of this component should + // be the source of truth, not the native component. + var propsTimeStamp = this.props.date.getTime(); + if (nativeTimeStamp !== propsTimeStamp) { + this.refs[DATEPICKER].setNativeProps({ + date: propsTimeStamp, + }); + } + }, + + render: function() { + var props = this.props; + return ( + + + + ); + } +}); + +var styles = StyleSheet.create({ + rkDatePickerIOS: { + height: RKDatePickerIOSConsts.ComponentHeight, + width: RKDatePickerIOSConsts.ComponentWidth, + }, +}); + +var rkDatePickerIOSAttributes = merge(ReactIOSViewAttributes.UIView, { + date: true, + maximumDate: true, + minimumDate: true, + mode: true, + minuteInterval: true, + timeZoneOffsetInMinutes: true, +}); + +var RKDatePickerIOS = createReactIOSNativeComponentClass({ + validAttributes: rkDatePickerIOSAttributes, + uiViewClassName: 'RCTDatePicker', +}); + +module.exports = DatePickerIOS; diff --git a/Libraries/Components/ListView/ListView.js b/Libraries/Components/ListView/ListView.js index aa2f82e28..1eb7eef5d 100644 --- a/Libraries/Components/ListView/ListView.js +++ b/Libraries/Components/ListView/ListView.js @@ -19,29 +19,42 @@ var isEmpty = require('isEmpty'); var PropTypes = React.PropTypes; +var DEFAULT_PAGE_SIZE = 1; +var DEFAULT_INITIAL_ROWS = 10; +var DEFAULT_SCROLL_RENDER_AHEAD = 1000; +var DEFAULT_END_REACHED_THRESHOLD = 1000; +var DEFAULT_SCROLL_CALLBACK_THROTTLE = 50; +var RENDER_INTERVAL = 20; +var SCROLLVIEW_REF = 'listviewscroll'; + + /** * ListView - A core component designed for efficient display of vertically * scrolling lists of changing data. The minimal API is to create a - * `ListViewDataSource`, populate it with a simple array of data blobs, and + * `ListView.DataSource`, populate it with a simple array of data blobs, and * instantiate a `ListView` component with that data source and a `renderRow` * callback which takes a blob from the data array and returns a renderable - * component. Minimal example: + * component. * - * getInitialState: function() { - * var ds = new ListViewDataSource({rowHasChanged: (r1, r2) => r1 !== r2}); - * return { - * dataSource: ds.cloneWithRows(['row 1', 'row 2']), - * }; - * }, + * Minimal example: * - * render: function() { - * return ( - * {rowData}} - * /> - * ); - * }, + * ``` + * getInitialState: function() { + * var ds = new ListViewDataSource({rowHasChanged: (r1, r2) => r1 !== r2}); + * return { + * dataSource: ds.cloneWithRows(['row 1', 'row 2']), + * }; + * }, + * + * render: function() { + * return ( + * {rowData}} + * /> + * ); + * }, + * ``` * * ListView also supports more advanced features, including sections with sticky * section headers, header and footer support, callbacks on reaching the end of @@ -61,19 +74,8 @@ var PropTypes = React.PropTypes; * event-loop (customizable with the `pageSize` prop). This breaks up the * work into smaller chunks to reduce the chance of dropping frames while * rendering rows. - * - * Check out `ListViewSimpleExample.js`, `ListViewDataSource.js`, and the Movies - * app for more info and example usage. */ -var DEFAULT_PAGE_SIZE = 1; -var DEFAULT_INITIAL_ROWS = 10; -var DEFAULT_SCROLL_RENDER_AHEAD = 1000; -var DEFAULT_END_REACHED_THRESHOLD = 1000; -var DEFAULT_SCROLL_CALLBACK_THROTTLE = 50; -var RENDER_INTERVAL = 20; -var SCROLLVIEW_REF = 'listviewscroll'; - var ListView = React.createClass({ mixins: [ScrollResponder.Mixin, TimerMixin], diff --git a/Libraries/Components/Navigation/NavigatorIOS.ios.js b/Libraries/Components/Navigation/NavigatorIOS.ios.js index 527b10bd2..ded8ce8d9 100644 --- a/Libraries/Components/Navigation/NavigatorIOS.ios.js +++ b/Libraries/Components/Navigation/NavigatorIOS.ios.js @@ -19,80 +19,6 @@ var invariant = require('invariant'); var logError = require('logError'); var merge = require('merge'); -/** - * NavigatorIOS wraps UIKit navigation and allows you to add back-swipe - * functionality across your app. - * - * See UIExplorerApp and NavigatorIOSExample for a full example - * - * ======================= NavigatorIOS Routes ================================ - * A route is an object used to describe each page in the navigator. The first - * route is provided to NavigatorIOS as `initialRoute`: - * - * ``` - * render: function() { - * return ( - * - * ); - * }, - * ``` - * - * Now MyView will be rendered by the navigator. It will recieve the route - * object in the `route` prop, a navigator, and all of the props specified in - * `passProps`. - * - * See the initialRoute propType for a complete definition of a route. - * - * ====================== NavigatorIOS Navigator ============================== - * A `navigator` is an object of navigation functions that a view can call. It - * is passed as a prop to any component rendered by NavigatorIOS. - * - * ``` - * var MyView = React.createClass({ - * _handleBackButtonPress: function() { - * this.props.navigator.pop(); - * }, - * _handleNextButtonPress: function() { - * this.props.navigator.push(nextRoute); - * }, - * ... - * }); - * ``` - * - * A navigation object contains the following functions: - * - `push(route)` - Navigate forward to a new route - * - `pop()` - Go back one page - * - `popN(n)` - Go back N pages at once. When N=1, behavior matches `pop()` - * - `replace(route)` - Replace the route for the current page and immediately - * load the view for the new route - * - `replacePrevious(route)` - Replace the route/view for the previous page - * - `replacePreviousAndPop(route)` - Replaces the previous route/view and - * transitions back to it - * - `resetTo(route)` - Replaces the top item and popToTop - * - `popToRoute(route)` - Go back to the item for a particular route object - * - `popToTop()` - Go back to the top item - * - * Navigator functions are also available on the NavigatorIOS component: - * - * ``` - * var MyView = React.createClass({ - * _handleNavigationRequest: function() { - * this.refs.nav.push(otherRoute); - * }, - * render: () => ( - * - * ), - * }); - * ``` - * - */ var TRANSITIONER_REF = 'transitionerRef'; var PropTypes = React.PropTypes; @@ -153,6 +79,83 @@ var NavigatorTransitionerIOS = React.createClass({ * `` also removes children that will no longer be needed * (after the pop of a child has been fully completed/animated out). */ + +/** + * NavigatorIOS wraps UIKit navigation and allows you to add back-swipe + * functionality across your app. + * + * #### Routes + * A route is an object used to describe each page in the navigator. The first + * route is provided to NavigatorIOS as `initialRoute`: + * + * ``` + * render: function() { + * return ( + * + * ); + * }, + * ``` + * + * Now MyView will be rendered by the navigator. It will recieve the route + * object in the `route` prop, a navigator, and all of the props specified in + * `passProps`. + * + * See the initialRoute propType for a complete definition of a route. + * + * #### Navigator + * + * A `navigator` is an object of navigation functions that a view can call. It + * is passed as a prop to any component rendered by NavigatorIOS. + * + * ``` + * var MyView = React.createClass({ + * _handleBackButtonPress: function() { + * this.props.navigator.pop(); + * }, + * _handleNextButtonPress: function() { + * this.props.navigator.push(nextRoute); + * }, + * ... + * }); + * ``` + * + * A navigation object contains the following functions: + * + * - `push(route)` - Navigate forward to a new route + * - `pop()` - Go back one page + * - `popN(n)` - Go back N pages at once. When N=1, behavior matches `pop()` + * - `replace(route)` - Replace the route for the current page and immediately + * load the view for the new route + * - `replacePrevious(route)` - Replace the route/view for the previous page + * - `replacePreviousAndPop(route)` - Replaces the previous route/view and + * transitions back to it + * - `resetTo(route)` - Replaces the top item and popToTop + * - `popToRoute(route)` - Go back to the item for a particular route object + * - `popToTop()` - Go back to the top item + * + * Navigator functions are also available on the NavigatorIOS component: + * + * ``` + * var MyView = React.createClass({ + * _handleNavigationRequest: function() { + * this.refs.nav.push(otherRoute); + * }, + * render: () => ( + * + * ), + * }); + * ``` + * + */ var NavigatorIOS = React.createClass({ propTypes: { @@ -199,7 +202,7 @@ var NavigatorIOS = React.createClass({ /** * Styles for the navigation item containing the component */ - wrapperStyle: View.stylePropType, + wrapperStyle: View.propTypes.style, }).isRequired, @@ -207,7 +210,7 @@ var NavigatorIOS = React.createClass({ * The default wrapper style for components in the navigator. * A common use case is to set the backgroundColor for every page */ - itemWrapperStyle: View.stylePropType, + itemWrapperStyle: View.propTypes.style, /** * The color used for buttons in the navigation bar diff --git a/Libraries/Components/ScrollView/ScrollView.ios.js b/Libraries/Components/ScrollView/ScrollView.js similarity index 58% rename from Libraries/Components/ScrollView/ScrollView.ios.js rename to Libraries/Components/ScrollView/ScrollView.js index 08202f445..09f7b94d6 100644 --- a/Libraries/Components/ScrollView/ScrollView.ios.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -5,26 +5,27 @@ */ 'use strict'; -var ArrayOfPropType = require('ArrayOfPropType'); +var EdgeInsetsPropType = require('EdgeInsetsPropType'); +var Platform = require('Platform'); +var PointPropType = require('PointPropType'); +var RCTScrollView = require('NativeModules').RKUIManager.RCTScrollView; +var RCTScrollViewConsts = RCTScrollView.Constants; var React = require('React'); -var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); var ReactIOSTagHandles = require('ReactIOSTagHandles'); -var RKScrollView = require('NativeModules').RKUIManager.RCTScrollView; -var RKScrollViewConsts = RKScrollView.Constants; +var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); var RKUIManager = require('NativeModulesDeprecated').RKUIManager; var ScrollResponder = require('ScrollResponder'); -var ScrollViewPropTypes = require('ScrollViewPropTypes'); -var StyleSheetPropType = require('StyleSheetPropType'); var StyleSheet = require('StyleSheet'); +var StyleSheetPropType = require('StyleSheetPropType'); var View = require('View'); var ViewStylePropTypes = require('ViewStylePropTypes'); var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass'); +var deepDiffer = require('deepDiffer'); var flattenStyle = require('flattenStyle'); +var insetsDiffer = require('insetsDiffer'); var invariant = require('invariant'); -var merge = require('merge'); -var nativePropType = require('nativePropType'); -var validAttributesFromPropTypes = require('validAttributesFromPropTypes'); +var pointsDiffer = require('pointsDiffer'); var PropTypes = React.PropTypes; @@ -32,13 +33,13 @@ var SCROLLVIEW = 'ScrollView'; var INNERVIEW = 'InnerScrollView'; var keyboardDismissModeConstants = { - 'none': RKScrollViewConsts.KeyboardDismissMode.None, // default - 'interactive': RKScrollViewConsts.KeyboardDismissMode.Interactive, - 'onDrag': RKScrollViewConsts.KeyboardDismissMode.OnDrag, + 'none': RCTScrollViewConsts.KeyboardDismissMode.None, // default + 'interactive': RCTScrollViewConsts.KeyboardDismissMode.Interactive, + 'onDrag': RCTScrollViewConsts.KeyboardDismissMode.OnDrag, }; /** - * `React` component that wraps platform `RKScrollView` while providing + * Component that wraps platform ScrollView while providing * integration with touch locking "responder" system. * * Doesn't yet support other contained responders from blocking this scroll @@ -46,28 +47,49 @@ var keyboardDismissModeConstants = { */ var ScrollView = React.createClass({ + + // Only for compatibility with Android which is not yet up to date, + // DO NOT ADD NEW CALL SITES! + statics: { + keyboardDismissMode: { + None: 'none', + Interactive: 'interactive', + OnDrag: 'onDrag', + }, + }, + propTypes: { - ...ScrollViewPropTypes, + automaticallyAdjustContentInsets: PropTypes.bool, // true + contentInset: EdgeInsetsPropType, // zeros + contentOffset: PointPropType, // zeros + onScroll: PropTypes.func, + onScrollAnimationEnd: PropTypes.func, + scrollEnabled: PropTypes.bool, // tre + scrollIndicatorInsets: EdgeInsetsPropType, // zeros + showsHorizontalScrollIndicator: PropTypes.bool, + showsVerticalScrollIndicator: PropTypes.bool, + style: StyleSheetPropType(ViewStylePropTypes), + throttleScrollCallbackMS: PropTypes.number, // null /** * When true, the scroll view bounces horizontally when it reaches the end * even if the content is smaller than the scroll view itself. The default * value is true when `horizontal={true}` and false otherwise. */ - alwaysBounceHorizontal: nativePropType(PropTypes.bool), + alwaysBounceHorizontal: PropTypes.bool, /** * When true, the scroll view bounces vertically when it reaches the end * even if the content is smaller than the scroll view itself. The default * value is false when `horizontal={true}` and true otherwise. */ - alwaysBounceVertical: nativePropType(PropTypes.bool), + alwaysBounceVertical: PropTypes.bool, /** * When true, the scroll view automatically centers the content when the * content is smaller than the scroll view bounds; when the content is * larger than the scroll view, this property has no effect. The default * value is false. */ - centerContent: nativePropType(PropTypes.bool), + centerContent: PropTypes.bool, /** * These styles will be applied to the scroll view content container which * wraps all of the child views. Example: @@ -90,7 +112,7 @@ var ScrollView = React.createClass({ * - Normal: 0.998 (the default) * - Fast: 0.9 */ - decelerationRate: nativePropType(PropTypes.number), + decelerationRate: PropTypes.number, /** * When true, the scroll view's children are arranged horizontally in a row * instead of vertically in a column. The default value is false. @@ -115,26 +137,26 @@ var ScrollView = React.createClass({ * taps, and the keyboard will not dismiss automatically. The default value * is false. */ - keyboardShouldPersistTaps: nativePropType(PropTypes.bool), + keyboardShouldPersistTaps: PropTypes.bool, /** * The maximum allowed zoom scale. The default value is 1.0. */ - maximumZoomScale: nativePropType(PropTypes.number), + maximumZoomScale: PropTypes.number, /** * The minimum allowed zoom scale. The default value is 1.0. */ - minimumZoomScale: nativePropType(PropTypes.number), + minimumZoomScale: PropTypes.number, /** * When true, the scroll view stops on multiples of the scroll view's size * when scrolling. This can be used for horizontal pagination. The default * value is false. */ - pagingEnabled: nativePropType(PropTypes.bool), + pagingEnabled: PropTypes.bool, /** * When true, the scroll view scrolls to top when the status bar is tapped. * The default value is true. */ - scrollsToTop: nativePropType(PropTypes.bool), + scrollsToTop: PropTypes.bool, /** * An array of child indices determining which children get docked to the * top of the screen when scrolling. For example, passing @@ -142,7 +164,7 @@ var ScrollView = React.createClass({ * top of the scroll view. This property is not supported in conjunction * with `horizontal={true}`. */ - stickyHeaderIndices: nativePropType(ArrayOfPropType(PropTypes.number)), + stickyHeaderIndices: PropTypes.arrayOf(PropTypes.number), /** * Experimental: When true, offscreen child views (whose `overflow` value is * `hidden`) are removed from their native backing superview when offscreen. @@ -153,7 +175,7 @@ var ScrollView = React.createClass({ /** * The current scale of the scroll view content. The default value is 1.0. */ - zoomScale: nativePropType(PropTypes.number), + zoomScale: PropTypes.number, }, mixins: [ScrollResponder.Mixin], @@ -171,7 +193,11 @@ var ScrollView = React.createClass({ }, scrollTo: function(destY, destX) { - RKUIManager.scrollTo(ReactIOSTagHandles.rootNodeIDToTag[this._rootNodeID], destX, destY); + RKUIManager.scrollTo( + ReactIOSTagHandles.rootNodeIDToTag[this._rootNodeID], + destX || 0, + destY || 0 + ); }, render: function() { @@ -223,36 +249,47 @@ var ScrollView = React.createClass({ this.props.alwaysBounceVertical : !this.props.horizontal; - var props = merge( - this.props, { - alwaysBounceHorizontal, - alwaysBounceVertical, - keyboardDismissMode: this.props.keyboardDismissMode ? - keyboardDismissModeConstants[this.props.keyboardDismissMode] : - undefined, - style: [styles.base, this.props.style], - onTouchStart: this.scrollResponderHandleTouchStart, - onTouchMove: this.scrollResponderHandleTouchMove, - onTouchEnd: this.scrollResponderHandleTouchEnd, - onScrollBeginDrag: this.scrollResponderHandleScrollBeginDrag, - onScrollEndDrag: this.scrollResponderHandleScrollEndDrag, - onMomentumScrollBegin: this.scrollResponderHandleMomentumScrollBegin, - onMomentumScrollEnd: this.scrollResponderHandleMomentumScrollEnd, - onStartShouldSetResponder: this.scrollResponderHandleStartShouldSetResponder, - onStartShouldSetResponderCapture: this.scrollResponderHandleStartShouldSetResponderCapture, - onScrollShouldSetResponder: this.scrollResponderHandleScrollShouldSetResponder, - onScroll: this.scrollResponderHandleScroll, - onResponderGrant: this.scrollResponderHandleResponderGrant, - onResponderTerminationRequest: this.scrollResponderHandleTerminationRequest, - onResponderTerminate: this.scrollResponderHandleTerminate, - onResponderRelease: this.scrollResponderHandleResponderRelease, - onResponderReject: this.scrollResponderHandleResponderReject, + var props = { + ...this.props, + alwaysBounceHorizontal, + alwaysBounceVertical, + keyboardDismissMode: this.props.keyboardDismissMode ? + keyboardDismissModeConstants[this.props.keyboardDismissMode] : + undefined, + style: [styles.base, this.props.style], + onTouchStart: this.scrollResponderHandleTouchStart, + onTouchMove: this.scrollResponderHandleTouchMove, + onTouchEnd: this.scrollResponderHandleTouchEnd, + onScrollBeginDrag: this.scrollResponderHandleScrollBeginDrag, + onScrollEndDrag: this.scrollResponderHandleScrollEndDrag, + onMomentumScrollBegin: this.scrollResponderHandleMomentumScrollBegin, + onMomentumScrollEnd: this.scrollResponderHandleMomentumScrollEnd, + onStartShouldSetResponder: this.scrollResponderHandleStartShouldSetResponder, + onStartShouldSetResponderCapture: this.scrollResponderHandleStartShouldSetResponderCapture, + onScrollShouldSetResponder: this.scrollResponderHandleScrollShouldSetResponder, + onScroll: this.scrollResponderHandleScroll, + onResponderGrant: this.scrollResponderHandleResponderGrant, + onResponderTerminationRequest: this.scrollResponderHandleTerminationRequest, + onResponderTerminate: this.scrollResponderHandleTerminate, + onResponderRelease: this.scrollResponderHandleResponderRelease, + onResponderReject: this.scrollResponderHandleResponderReject, + }; + + var ScrollViewClass; + if (Platform.OS === 'ios') { + ScrollViewClass = RCTScrollView; + } else if (Platform.OS === 'android') { + if (this.props.horizontal) { + ScrollViewClass = AndroidHorizontalScrollView; + } else { + ScrollViewClass = AndroidScrollView; } - ); + } + return ( - + {contentContainer} - + ); } }); @@ -267,12 +304,46 @@ var styles = StyleSheet.create({ }, }); -var RKScrollView = createReactIOSNativeComponentClass({ - validAttributes: merge( - ReactIOSViewAttributes.UIView, - validAttributesFromPropTypes(ScrollView.propTypes) - ), - uiViewClassName: 'RCTScrollView', -}); +var validAttributes = { + ...ReactIOSViewAttributes.UIView, + alwaysBounceHorizontal: true, + alwaysBounceVertical: true, + automaticallyAdjustContentInsets: true, + centerContent: true, + contentInset: insetsDiffer, + contentOffset: pointsDiffer, + decelerationRate: true, + horizontal: true, + keyboardDismissMode: true, + keyboardShouldPersistTaps: true, + maximumZoomScale: true, + minimumZoomScale: true, + pagingEnabled: true, + removeClippedSubviews: true, + scrollEnabled: true, + scrollIndicatorInsets: insetsDiffer, + scrollsToTop: true, + showsHorizontalScrollIndicator: true, + showsVerticalScrollIndicator: true, + stickyHeaderIndices: deepDiffer, + throttleScrollCallbackMS: true, + zoomScale: true, +}; + +if (Platform.OS === 'android') { + var AndroidScrollView = createReactIOSNativeComponentClass({ + validAttributes: validAttributes, + uiViewClassName: 'AndroidScrollView', + }); + var AndroidHorizontalScrollView = createReactIOSNativeComponentClass({ + validAttributes: validAttributes, + uiViewClassName: 'AndroidHorizontalScrollView', + }); +} else if (Platform.OS === 'ios') { + var RCTScrollView = createReactIOSNativeComponentClass({ + validAttributes: validAttributes, + uiViewClassName: 'RCTScrollView', + }); +} module.exports = ScrollView; diff --git a/Libraries/Components/ScrollViewPropTypes.js b/Libraries/Components/ScrollViewPropTypes.js deleted file mode 100644 index f72dc9f05..000000000 --- a/Libraries/Components/ScrollViewPropTypes.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule ScrollViewPropTypes - */ -'use strict'; - -var EdgeInsetsPropType = require('EdgeInsetsPropType'); -var PointPropType = require('PointPropType'); -var PropTypes = require('ReactPropTypes'); -var StyleSheetPropType = require('StyleSheetPropType'); -var ViewStylePropTypes = require('ViewStylePropTypes'); - -var nativePropType = require('nativePropType'); - -var ScrollViewPropTypes = { - automaticallyAdjustContentInsets: nativePropType(PropTypes.bool), // true - contentInset: nativePropType(EdgeInsetsPropType), // zeroes - contentOffset: nativePropType(PointPropType), // zeroes - onScroll: PropTypes.func, - onScrollAnimationEnd: PropTypes.func, - scrollEnabled: nativePropType(PropTypes.bool), // true - scrollIndicatorInsets: nativePropType(EdgeInsetsPropType), // zeros - showsHorizontalScrollIndicator: nativePropType(PropTypes.bool), - showsVerticalScrollIndicator: nativePropType(PropTypes.bool), - style: StyleSheetPropType(ViewStylePropTypes), - throttleScrollCallbackMS: nativePropType(PropTypes.number), // null -}; - -module.exports = ScrollViewPropTypes; diff --git a/Libraries/Components/Slider/Slider.js b/Libraries/Components/Slider/Slider.js new file mode 100644 index 000000000..80f631c45 --- /dev/null +++ b/Libraries/Components/Slider/Slider.js @@ -0,0 +1,83 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule Slider + */ +'use strict'; + +var NativeMethodsMixin = require('NativeMethodsMixin'); +var PropTypes = require('ReactPropTypes'); +var React = require('React'); +var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); +var StyleSheet = require('StyleSheet'); +var View = require('View'); + +var createReactIOSNativeComponentClass = + require('createReactIOSNativeComponentClass'); +var merge = require('merge'); + +var Slider = React.createClass({ + mixins: [NativeMethodsMixin], + + propTypes: { + /** + * Used to style and layout the `Slider`. See `StyleSheet.js` and + * `ViewStylePropTypes.js` for more info. + */ + style: View.propTypes.style, + + /** + * Initial value of the slider. The value should be between 0 and 1. + * Default value is 0. + * + * *This is not a controlled component*, e.g. if you don't update + * the value, the component won't be reseted to it's inital value. + */ + value: PropTypes.number, + + /** + * Callback continuously called while the user is dragging the slider. + */ + onValueChange: PropTypes.func, + + /** + * Callback called when the user finishes changing the value (e.g. when + * the slider is released). + */ + onSlidingComplete: PropTypes.func, + }, + + _onValueChange: function(event) { + this.props.onChange && this.props.onChange(event); + if (event.nativeEvent.continuous) { + this.props.onValueChange && + this.props.onValueChange(event.nativeEvent.value); + } else { + this.props.onSlidingComplete && event.nativeEvent.value !== undefined && + this.props.onSlidingComplete(event.nativeEvent.value); + } + }, + + render: function() { + return ( + + ); + } +}); + +var styles = StyleSheet.create({ + slider: { + height: 40, + }, +}); + +var RKSlider = createReactIOSNativeComponentClass({ + validAttributes: merge(ReactIOSViewAttributes.UIView, {value: true}), + uiViewClassName: 'RCTSlider', +}); + +module.exports = Slider; diff --git a/Libraries/Components/SwitchIOS/SwitchIOS.android.js b/Libraries/Components/SwitchIOS/SwitchIOS.android.js new file mode 100644 index 000000000..72c24fa28 --- /dev/null +++ b/Libraries/Components/SwitchIOS/SwitchIOS.android.js @@ -0,0 +1,41 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule SwitchIOS + */ + +'use strict'; + +var React = require('React'); +var StyleSheet = require('StyleSheet'); +var Text = require('Text'); +var View = require('View'); + +var DummySwitchIOS = React.createClass({ + render: function() { + return ( + + SwitchIOS is not supported on this platform! + + ); + }, +}); + +var styles = StyleSheet.create({ + dummySwitchIOS: { + width: 120, + height: 50, + backgroundColor: '#ffbcbc', + borderWidth: 1, + borderColor: 'red', + alignItems: 'center', + justifyContent: 'center', + }, + text: { + color: '#333333', + margin: 5, + fontSize: 10, + } +}); + +module.exports = DummySwitchIOS; diff --git a/Libraries/Components/SwitchIOS/SwitchIOS.ios.js b/Libraries/Components/SwitchIOS/SwitchIOS.ios.js new file mode 100644 index 000000000..391b4da3a --- /dev/null +++ b/Libraries/Components/SwitchIOS/SwitchIOS.ios.js @@ -0,0 +1,117 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule SwitchIOS + * + * This is a controlled component version of RKSwitch. + */ +'use strict'; + +var NativeMethodsMixin = require('NativeMethodsMixin'); +var PropTypes = require('ReactPropTypes'); +var React = require('React'); +var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); +var StyleSheet = require('StyleSheet'); + +var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass'); +var merge = require('merge'); + +var SWITCH = 'switch'; + +/** + * Use `SwitchIOS` to render a boolean input on iOS. This is + * a controlled component, so you must hook in to the `onValueChange` callback + * and update the `value` prop in order for the component to update, otherwise + * the user's change will be reverted immediately to reflect `props.value` as the + * source of truth. + */ +var SwitchIOS = React.createClass({ + mixins: [NativeMethodsMixin], + + propTypes: { + /** + * The value of the switch, if true the switch will be turned on. + * Default value is false. + */ + value: PropTypes.bool, + + /** + * If true the user won't be able to toggle the switch. + * Default value is false. + */ + disabled: PropTypes.bool, + + /** + * Callback that is called when the user toggles the switch. + */ + onValueChange: PropTypes.func, + + /** + * Background color when the switch is turned on. + */ + onTintColor: PropTypes.string, + + /** + * Background color for the switch round button. + */ + thumbTintColor: PropTypes.string, + + /** + * Background color when the switch is turned off. + */ + tintColor: PropTypes.string, + }, + + getDefaultProps: function() { + return { + value: false, + disabled: false, + }; + }, + + _onChange: function(event) { + this.props.onChange && this.props.onChange(event); + this.props.onValueChange && this.props.onValueChange(event.nativeEvent.value); + + // The underlying switch might have changed, but we're controlled, + // and so want to ensure it represents our value. + this.refs[SWITCH].setNativeProps({on: this.props.value}); + }, + + render: function() { + return ( + + ); + } +}); + +var styles = StyleSheet.create({ + rkSwitch: { + height: 31, + width: 51, + }, +}); + +var rkSwitchAttributes = merge(ReactIOSViewAttributes.UIView, { + onTintColor: true, + tintColor: true, + thumbTintColor: true, + on: true, + enabled: true, +}); + +var RKSwitch = createReactIOSNativeComponentClass({ + validAttributes: rkSwitchAttributes, + uiViewClassName: 'RCTSwitch', +}); + +module.exports = SwitchIOS; diff --git a/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js b/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js index 5e6cc5307..763be7438 100644 --- a/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js +++ b/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js @@ -18,12 +18,12 @@ var merge = require('merge'); var TabBarItemIOS = React.createClass({ propTypes: { - icon: Image.sourcePropType.isRequired, + icon: Image.propTypes.source.isRequired, onPress: React.PropTypes.func.isRequired, selected: React.PropTypes.bool.isRequired, badgeValue: React.PropTypes.string, title: React.PropTypes.string, - style: View.stylePropType, + style: View.propTypes.style, }, getInitialState: function() { diff --git a/Libraries/Components/TextInput/TextInput.ios.js b/Libraries/Components/TextInput/TextInput.ios.js index aadd6c94a..20eda688b 100644 --- a/Libraries/Components/TextInput/TextInput.ios.js +++ b/Libraries/Components/TextInput/TextInput.ios.js @@ -26,39 +26,6 @@ var getObjectValues = require('getObjectValues'); var invariant = require('invariant'); var merge = require('merge'); -/** - * - A foundational component for inputting text into the app via a - * keyboard. Props provide configurability for several features, such as auto- - * correction, auto-capitalization, placeholder text, and different keyboard - * types, such as a numeric keypad. - * - * The simplest use case is to plop down a `TextInput` and subscribe to the - * `onChangeText` events to read the user input. There are also other events, such - * as `onSubmitEditing` and `onFocus` that can be subscribed to. A simple - * example: - * - * - * this.setState({input: text})} - * /> - * {'user input: ' + this.state.input} - * - * - * The `value` prop can be used to set the value of the input in order to make - * the state of the component clear, but does not behave as a true - * controlled component by default because all operations are asynchronous. - * Setting `value` once is like setting the default value, but you can change it - * continuously based on `onChangeText` events as well. If you really want to - * force the component to always revert to the value you are setting, you can - * set `controlled={true}`. - * - * The `multiline` prop is not supported in all releases, and some props are - * multiline only. - * - * More example code in `TextInputExample.js`. - */ - var autoCapitalizeConsts = RKUIManager.UIText.AutocapitalizationType; var clearButtonModeConsts = RKUIManager.UITextField.clearButtonMode; @@ -92,6 +59,39 @@ var notMultiline = { onSubmitEditing: true, }; +/** + * A foundational component for inputting text into the app via a + * keyboard. Props provide configurability for several features, such as auto- + * correction, auto-capitalization, placeholder text, and different keyboard + * types, such as a numeric keypad. + * + * The simplest use case is to plop down a `TextInput` and subscribe to the + * `onChangeText` events to read the user input. There are also other events, such + * as `onSubmitEditing` and `onFocus` that can be subscribed to. A simple + * example: + * + * ``` + * + * this.setState({input: text})} + * /> + * {'user input: ' + this.state.input} + * + * ``` + * + * The `value` prop can be used to set the value of the input in order to make + * the state of the component clear, but does not behave as a true + * controlled component by default because all operations are asynchronous. + * Setting `value` once is like setting the default value, but you can change it + * continuously based on `onChangeText` events as well. If you really want to + * force the component to always revert to the value you are setting, you can + * set `controlled={true}`. + * + * The `multiline` prop is not supported in all releases, and some props are + * multiline only. + */ + var TextInput = React.createClass({ propTypes: { /** @@ -188,7 +188,7 @@ var TextInput = React.createClass({ 'always', ]), - style: Text.stylePropType, + style: Text.propTypes.style, }, /** diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index 9381f52d6..a48e2f299 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -20,35 +20,35 @@ var keyOf = require('keyOf'); var merge = require('merge'); var onlyChild = require('onlyChild'); +var DEFAULT_PROPS = { + activeOpacity: 0.8, + underlayColor: 'black', +}; + /** - * TouchableHighlight - A wrapper for making views respond properly to touches. + * A wrapper for making views respond properly to touches. * On press down, the opacity of the wrapped view is decreased, which allows * the underlay color to show through, darkening or tinting the view. The * underlay comes from adding a view to the view hierarchy, which can sometimes * cause unwanted visual artifacts if not used correctly, for example if the * backgroundColor of the wrapped view isn't explicitly set to an opaque color. + * * Example: * - * renderButton: function() { - * return ( - * - * - * - * ); - * }, - * - * More example code in TouchableExample.js, and more in-depth discussion in - * Touchable.js. See also TouchableWithoutFeedback.js. + * ``` + * renderButton: function() { + * return ( + * + * + * + * ); + * }, + * ``` */ -var DEFAULT_PROPS = { - activeOpacity: 0.8, - underlayColor: 'black', -}; - var TouchableHighlight = React.createClass({ propTypes: { ...TouchableFeedbackPropType, @@ -67,7 +67,7 @@ var TouchableHighlight = React.createClass({ * active. */ underlayColor: React.PropTypes.string, - style: View.stylePropType, + style: View.propTypes.style, }, mixins: [NativeMethodsMixin, TimerMixin, Touchable.Mixin], diff --git a/Libraries/Components/Touchable/TouchableOpacity.js b/Libraries/Components/Touchable/TouchableOpacity.js index cb68d6df3..1b2f3898f 100644 --- a/Libraries/Components/Touchable/TouchableOpacity.js +++ b/Libraries/Components/Touchable/TouchableOpacity.js @@ -17,25 +17,25 @@ var keyOf = require('keyOf'); var onlyChild = require('onlyChild'); /** - * TouchableOpacity - A wrapper for making views respond properly to touches. + * A wrapper for making views respond properly to touches. * On press down, the opacity of the wrapped view is decreased, dimming it. * This is done without actually changing the view hierarchy, and in general is - * easy to add to an app without weird side-effects. Example: + * easy to add to an app without weird side-effects. * - * renderButton: function() { - * return ( - * - * - * - * ); - * }, + * Example: * - * More example code in TouchableExample.js, and more in-depth discussion in - * Touchable.js. See also TouchableHighlight.js and - * TouchableWithoutFeedback.js. + * ``` + * renderButton: function() { + * return ( + * + * + * + * ); + * }, + * ``` */ var TouchableOpacity = React.createClass({ diff --git a/Libraries/Components/View/View.js b/Libraries/Components/View/View.js index 826c395bc..b75988f4a 100644 --- a/Libraries/Components/View/View.js +++ b/Libraries/Components/View/View.js @@ -12,8 +12,13 @@ var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); var StyleSheetPropType = require('StyleSheetPropType'); var ViewStylePropTypes = require('ViewStylePropTypes'); + +var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass'); + +var stylePropType = StyleSheetPropType(ViewStylePropTypes); + /** - * - The most fundamental component for building UI, `View` is a + * The most fundamental component for building UI, `View` is a * container that supports layout with flexbox, style, some touch handling, and * accessibility controls, and is designed to be nested inside other views and * to have 0 to many children of any type. `View` maps directly to the native @@ -21,11 +26,13 @@ var ViewStylePropTypes = require('ViewStylePropTypes'); * `UIView`, `
`, `android.view`, etc. This example creates a `View` that * wraps two colored boxes and custom component in a row with padding. * - * - * - * - * - * + * ``` + * + * + * + * + * + * ``` * * By default, `View`s have a primary flex direction of 'column', so children * will stack up vertically by default. `View`s also expand to fill the parent @@ -39,20 +46,8 @@ var ViewStylePropTypes = require('ViewStylePropTypes'); * `View`s are designed to be used with `StyleSheet`s for clarity and * performance, although inline styles are also supported. It is common for * `StyleSheet`s to be combined dynamically. See `StyleSheet.js` for more info. - * - * Check out `ViewExample.js`, `LayoutExample.js`, and other apps for more code - * examples. */ - -var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass'); - -var stylePropType = StyleSheetPropType(ViewStylePropTypes); - var View = React.createClass({ - statics: { - stylePropType, - }, - mixins: [NativeMethodsMixin], /** @@ -141,12 +136,12 @@ var RKView = createReactIOSNativeComponentClass({ validAttributes: ReactIOSViewAttributes.RKView, uiViewClassName: 'RCTView', }); +RKView.propTypes = View.propTypes; var ViewToExport = RKView; if (__DEV__) { ViewToExport = View; } -ViewToExport.stylePropType = stylePropType; module.exports = ViewToExport; diff --git a/Libraries/GeoLocation/GeoLocation.js b/Libraries/GeoLocation/Geolocation.ios.js similarity index 65% rename from Libraries/GeoLocation/GeoLocation.js rename to Libraries/GeoLocation/Geolocation.ios.js index 9a7f792c4..1b5719212 100644 --- a/Libraries/GeoLocation/GeoLocation.js +++ b/Libraries/GeoLocation/Geolocation.ios.js @@ -1,12 +1,12 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. * - * @providesModule GeoLocation + * @providesModule Geolocation */ 'use strict'; var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); -var RCTLocationObserver = require('NativeModules').RKLocationObserver; +var RCTLocationObserver = require('NativeModulesDeprecated').RKLocationObserver; var invariant = require('invariant'); var logError = require('logError'); @@ -16,13 +16,6 @@ var subscriptions = []; var updatesEnabled = false; -var ensureObserving = function() { - if (!updatesEnabled) { - RCTLocationObserver.startObserving(); - updatesEnabled = true; - } -}; - /** * /!\ ATTENTION /!\ * You need to add NSLocationWhenInUseUsageDescription key @@ -30,43 +23,51 @@ var ensureObserving = function() { * to *fail silently*! * \!/ \!/ * - * GeoLocation follows the MDN specification: + * Geolocation follows the MDN specification: * https://developer.mozilla.org/en-US/docs/Web/API/Geolocation */ -class GeoLocation { - static getCurrentPosition(geo_success, geo_error, geo_options) { +var Geolocation = { + + getCurrentPosition: function(geo_success, geo_error, geo_options) { invariant( typeof geo_success === 'function', 'Must provide a valid geo_success callback.' ); - if (geo_options) { - warning('geo_options are not yet supported.'); - } - ensureObserving(); RCTLocationObserver.getCurrentPosition( geo_success, - geo_error || logError + geo_error || logError, + geo_options || {} ); - } - static watchPosition(callback) { - ensureObserving(); + }, + + watchPosition: function(success, error, options) { + if (!updatesEnabled) { + RCTLocationObserver.startObserving(options || {}); + updatesEnabled = true; + } var watchID = subscriptions.length; - subscriptions.push( + subscriptions.push([ RCTDeviceEventEmitter.addListener( - 'geoLocationDidChange', - callback - ) - ); + 'geolocationDidChange', + success + ), + error ? RCTDeviceEventEmitter.addListener( + 'geolocationError', + error + ) : null, + ]); return watchID; - } - static clearWatch(watchID) { + }, + + clearWatch: function(watchID) { var sub = subscriptions[watchID]; if (!sub) { // Silently exit when the watchID is invalid or already cleared // This is consistent with timers return; } - sub.remove(); + sub[0].remove(); + sub[1] && sub[1].remove(); subscriptions[watchID] = undefined; var noWatchers = true; for (var ii = 0; ii < subscriptions.length; ii++) { @@ -75,10 +76,11 @@ class GeoLocation { } } if (noWatchers) { - GeoLocation.stopObserving(); + Geolocation.stopObserving(); } - } - static stopObserving() { + }, + + stopObserving: function() { if (updatesEnabled) { RCTLocationObserver.stopObserving(); updatesEnabled = false; @@ -89,10 +91,8 @@ class GeoLocation { } } subscriptions = []; - } else { - warning('Tried to stop observing when not observing.'); } } } -module.exports = GeoLocation; +module.exports = Geolocation; diff --git a/Libraries/GeoLocation/RCTGeolocation.xcodeproj/project.pbxproj b/Libraries/GeoLocation/RCTGeolocation.xcodeproj/project.pbxproj new file mode 100644 index 000000000..94f9c3f91 --- /dev/null +++ b/Libraries/GeoLocation/RCTGeolocation.xcodeproj/project.pbxproj @@ -0,0 +1,256 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 134814061AA4E45400B7C361 /* RCTLocationObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 134814051AA4E45400B7C361 /* RCTLocationObserver.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 58B511D91A9E6C8500147676 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 134814041AA4E45400B7C361 /* RCTLocationObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTLocationObserver.h; sourceTree = ""; }; + 134814051AA4E45400B7C361 /* RCTLocationObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLocationObserver.m; sourceTree = ""; }; + 134814201AA4EA6300B7C361 /* libRCTGeolocation.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTGeolocation.a; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 58B511D81A9E6C8500147676 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 134814211AA4EA7D00B7C361 /* Products */ = { + isa = PBXGroup; + children = ( + 134814201AA4EA6300B7C361 /* libRCTGeolocation.a */, + ); + name = Products; + sourceTree = ""; + }; + 58B511D21A9E6C8500147676 = { + isa = PBXGroup; + children = ( + 134814041AA4E45400B7C361 /* RCTLocationObserver.h */, + 134814051AA4E45400B7C361 /* RCTLocationObserver.m */, + 134814211AA4EA7D00B7C361 /* Products */, + ); + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 58B511DA1A9E6C8500147676 /* RCTGeolocation */ = { + isa = PBXNativeTarget; + buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTGeolocation" */; + buildPhases = ( + 58B511D71A9E6C8500147676 /* Sources */, + 58B511D81A9E6C8500147676 /* Frameworks */, + 58B511D91A9E6C8500147676 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RCTGeolocation; + productName = RCTDataManager; + productReference = 134814201AA4EA6300B7C361 /* libRCTGeolocation.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 58B511D31A9E6C8500147676 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = Facebook; + TargetAttributes = { + 58B511DA1A9E6C8500147676 = { + CreatedOnToolsVersion = 6.1.1; + }; + }; + }; + buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTGeolocation" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 58B511D21A9E6C8500147676; + productRefGroup = 58B511D21A9E6C8500147676; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 58B511DA1A9E6C8500147676 /* RCTGeolocation */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 58B511D71A9E6C8500147676 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 134814061AA4E45400B7C361 /* RCTLocationObserver.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 58B511ED1A9E6C8500147676 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 58B511EE1A9E6C8500147676 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 58B511F01A9E6C8500147676 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "/Users/nicklockwood/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/ReactKit/build/Debug-iphoneos", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = RCTGeolocation; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 58B511F11A9E6C8500147676 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "/Users/nicklockwood/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/ReactKit/build/Debug-iphoneos", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = RCTGeolocation; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTGeolocation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58B511ED1A9E6C8500147676 /* Debug */, + 58B511EE1A9E6C8500147676 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTGeolocation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58B511F01A9E6C8500147676 /* Debug */, + 58B511F11A9E6C8500147676 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 58B511D31A9E6C8500147676 /* Project object */; +} diff --git a/ReactKit/Modules/RCTLocationObserver.h b/Libraries/GeoLocation/RCTLocationObserver.h similarity index 100% rename from ReactKit/Modules/RCTLocationObserver.h rename to Libraries/GeoLocation/RCTLocationObserver.h diff --git a/Libraries/GeoLocation/RCTLocationObserver.m b/Libraries/GeoLocation/RCTLocationObserver.m new file mode 100644 index 000000000..019653640 --- /dev/null +++ b/Libraries/GeoLocation/RCTLocationObserver.m @@ -0,0 +1,319 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTLocationObserver.h" + +#import +#import +#import + +#import "RCTAssert.h" +#import "RCTBridge.h" +#import "RCTConvert.h" +#import "RCTEventDispatcher.h" +#import "RCTLog.h" + +typedef NS_ENUM(NSInteger, RCTPositionErrorCode) { + RCTPositionErrorDenied = 1, + RCTPositionErrorUnavailable, + RCTPositionErrorTimeout, +}; + +#define RCT_DEFAULT_LOCATION_ACCURACY kCLLocationAccuracyHundredMeters + +typedef struct { + NSTimeInterval timeout; + NSTimeInterval maximumAge; + CLLocationAccuracy accuracy; +} RCTLocationOptions; + +static RCTLocationOptions RCTLocationOptionsWithJSON(id json) +{ + NSDictionary *options = [RCTConvert NSDictionary:json]; + return (RCTLocationOptions){ + .timeout = [RCTConvert NSTimeInterval:options[@"timeout"]] ?: INFINITY, + .maximumAge = [RCTConvert NSTimeInterval:options[@"maximumAge"]] ?: INFINITY, + .accuracy = [RCTConvert BOOL:options[@"enableHighAccuracy"]] ? kCLLocationAccuracyBest : RCT_DEFAULT_LOCATION_ACCURACY + }; +} + +static NSDictionary *RCTPositionError(RCTPositionErrorCode code, NSString *msg /* nil for default */) +{ + if (!msg) { + switch (code) { + case RCTPositionErrorDenied: + msg = @"User denied access to location services."; + break; + case RCTPositionErrorUnavailable: + msg = @"Unable to retrieve location."; + break; + case RCTPositionErrorTimeout: + msg = @"The location request timed out."; + break; + } + } + + return @{ + @"code": @(code), + @"message": msg, + @"PERMISSION_DENIED": @(RCTPositionErrorDenied), + @"POSITION_UNAVAILABLE": @(RCTPositionErrorUnavailable), + @"TIMEOUT": @(RCTPositionErrorTimeout) + }; +} + +@interface RCTLocationRequest : NSObject + +@property (nonatomic, copy) RCTResponseSenderBlock successBlock; +@property (nonatomic, copy) RCTResponseSenderBlock errorBlock; +@property (nonatomic, assign) RCTLocationOptions options; +@property (nonatomic, strong) NSTimer *timeoutTimer; + +@end + +@implementation RCTLocationRequest + +- (void)dealloc +{ + [_timeoutTimer invalidate]; +} + +@end + +@interface RCTLocationObserver () + +@end + +@implementation RCTLocationObserver +{ + CLLocationManager *_locationManager; + NSDictionary *_lastLocationEvent; + NSMutableArray *_pendingRequests; + BOOL _observingLocation; + RCTLocationOptions _observerOptions; +} + +@synthesize bridge = _bridge; + +#pragma mark - Lifecycle + +- (instancetype)init +{ + if ((self = [super init])) { + + _locationManager = [[CLLocationManager alloc] init]; + _locationManager.distanceFilter = RCT_DEFAULT_LOCATION_ACCURACY; + _locationManager.delegate = self; + + _pendingRequests = [[NSMutableArray alloc] init]; + } + return self; +} + +- (void)dealloc +{ + [_locationManager stopUpdatingLocation]; +} + +#pragma mark - Private API + +- (void)beginLocationUpdates +{ + // Request location access permission + if ([_locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) { + [_locationManager requestWhenInUseAuthorization]; + } + + // Start observing location + [_locationManager startUpdatingLocation]; +} + +#pragma mark - Timeout handler + +- (void)timeout:(NSTimer *)timer +{ + RCTLocationRequest *request = timer.userInfo; + NSString *message = [NSString stringWithFormat: @"Unable to fetch location within %zds.", (NSInteger)(timer.timeInterval * 1000.0)]; + request.errorBlock(@[RCTPositionError(RCTPositionErrorTimeout, message)]); + [_pendingRequests removeObject:request]; + + // Stop updating if no pending requests + if (_pendingRequests.count == 0 && !_observingLocation) { + [_locationManager stopUpdatingLocation]; + } +} + +#pragma mark - Public API + +- (void)startObserving:(NSDictionary *)optionsJSON +{ + RCT_EXPORT(); + + dispatch_async(dispatch_get_main_queue(), ^{ + + // Select best options + _observerOptions = RCTLocationOptionsWithJSON(optionsJSON); + for (RCTLocationRequest *request in _pendingRequests) { + _observerOptions.accuracy = MIN(_observerOptions.accuracy, request.options.accuracy); + } + + _locationManager.desiredAccuracy = _observerOptions.accuracy; + [self beginLocationUpdates]; + _observingLocation = YES; + + }); +} + +- (void)stopObserving +{ + RCT_EXPORT(); + + dispatch_async(dispatch_get_main_queue(), ^{ + + // Stop observing + _observingLocation = NO; + + // Stop updating if no pending requests + if (_pendingRequests.count == 0) { + [_locationManager stopUpdatingLocation]; + } + + }); +} + +- (void)getCurrentPosition:(RCTResponseSenderBlock)successBlock + withErrorCallback:(RCTResponseSenderBlock)errorBlock + options:(NSDictionary *)optionsJSON +{ + RCT_EXPORT(); + + if (!successBlock) { + RCTLogError(@"%@.getCurrentPosition called with nil success parameter.", [self class]); + return; + } + + dispatch_async(dispatch_get_main_queue(), ^{ + + if (![CLLocationManager locationServicesEnabled]) { + if (errorBlock) { + errorBlock(@[ + RCTPositionError(RCTPositionErrorUnavailable, @"Location services disabled.") + ]); + return; + } + } + + if (![CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied) { + if (errorBlock) { + errorBlock(@[ + RCTPositionError(RCTPositionErrorDenied, nil) + ]); + return; + } + } + + // Get options + RCTLocationOptions options = RCTLocationOptionsWithJSON(optionsJSON); + + // Check if previous recorded location exists and is good enough + if (_lastLocationEvent && + CFAbsoluteTimeGetCurrent() - [RCTConvert NSTimeInterval:_lastLocationEvent[@"timestamp"]] < options.maximumAge && + [_lastLocationEvent[@"coords"][@"accuracy"] doubleValue] >= options.accuracy) { + + // Call success block with most recent known location + successBlock(@[_lastLocationEvent]); + return; + } + + // Create request + RCTLocationRequest *request = [[RCTLocationRequest alloc] init]; + request.successBlock = successBlock; + request.errorBlock = errorBlock ?: ^(NSArray *args){}; + request.options = options; + request.timeoutTimer = [NSTimer scheduledTimerWithTimeInterval:options.timeout + target:self + selector:@selector(timeout:) + userInfo:request + repeats:NO]; + [_pendingRequests addObject:request]; + + // Configure location manager and begin updating location + _locationManager.desiredAccuracy = MIN(_locationManager.desiredAccuracy, options.accuracy); + [self beginLocationUpdates]; + + }); +} + +#pragma mark - CLLocationManagerDelegate + +- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations +{ + // Create event + CLLocation *location = [locations lastObject]; + _lastLocationEvent = @{ + @"coords": @{ + @"latitude": @(location.coordinate.latitude), + @"longitude": @(location.coordinate.longitude), + @"altitude": @(location.altitude), + @"accuracy": @(location.horizontalAccuracy), + @"altitudeAccuracy": @(location.verticalAccuracy), + @"heading": @(location.course), + @"speed": @(location.speed), + }, + @"timestamp": @(CFAbsoluteTimeGetCurrent() * 1000.0) // in ms + }; + + // Send event + if (_observingLocation) { + [_bridge.eventDispatcher sendDeviceEventWithName:@"geolocationDidChange" + body:_lastLocationEvent]; + } + + // Fire all queued callbacks + for (RCTLocationRequest *request in _pendingRequests) { + request.successBlock(@[_lastLocationEvent]); + } + [_pendingRequests removeAllObjects]; + + // Stop updating if not not observing + if (!_observingLocation) { + [_locationManager stopUpdatingLocation]; + } + + // Reset location accuracy + _locationManager.desiredAccuracy = RCT_DEFAULT_LOCATION_ACCURACY; +} + +- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error +{ + // Check error type + NSDictionary *jsError = nil; + switch (error.code) { + case kCLErrorDenied: + jsError = RCTPositionError(RCTPositionErrorDenied, nil); + break; + case kCLErrorNetwork: + jsError = RCTPositionError(RCTPositionErrorUnavailable, @"Unable to retrieve location due to a network failure"); + break; + case kCLErrorLocationUnknown: + default: + jsError = RCTPositionError(RCTPositionErrorUnavailable, nil); + break; + } + + // Send event + if (_observingLocation) { + [_bridge.eventDispatcher sendDeviceEventWithName:@"geolocationError" + body:jsError]; + } + + // Fire all queued error callbacks + for (RCTLocationRequest *request in _pendingRequests) { + request.errorBlock(@[jsError]); + } + [_pendingRequests removeAllObjects]; + + // Reset location accuracy + _locationManager.desiredAccuracy = RCT_DEFAULT_LOCATION_ACCURACY; +} + +@end diff --git a/Libraries/Image/Image.ios.js b/Libraries/Image/Image.ios.js index 5926cb144..f8ab583a9 100644 --- a/Libraries/Image/Image.ios.js +++ b/Libraries/Image/Image.ios.js @@ -10,7 +10,6 @@ var NativeMethodsMixin = require('NativeMethodsMixin'); var NativeModulesDeprecated = require('NativeModulesDeprecated'); var PropTypes = require('ReactPropTypes'); var ImageResizeMode = require('ImageResizeMode'); -var ImageSourcePropType = require('ImageSourcePropType'); var ImageStylePropTypes = require('ImageStylePropTypes'); var React = require('React'); var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); @@ -25,31 +24,40 @@ var merge = require('merge'); var warning = require('warning'); /** - * - A react component for displaying different types of images, + * A react component for displaying different types of images, * including network images, static resources, temporary local images, and - * images from local disk, such as the camera roll. Example usage: + * images from local disk, such as the camera roll. * - * renderImages: function() { - * return ( - * - * - * - * - * ); - * }, + * Example usage: * - * More example code in ImageExample.js + * ``` + * renderImages: function() { + * return ( + * + * + * + * + * ); + * }, + * ``` */ var Image = React.createClass({ propTypes: { - source: ImageSourcePropType, + source: PropTypes.shape({ + /** + * A string representing the resource identifier for the image, which + * could be an http address, a local file path, or the name of a static image + * resource (which should be wrapped in the `ix` function). + */ + uri: PropTypes.string, + }).isRequired, /** * accessible - Whether this element should be revealed as an accessible * element. @@ -78,7 +86,6 @@ var Image = React.createClass({ statics: { resizeMode: ImageResizeMode, - sourcePropType: ImageSourcePropType, }, mixins: [NativeMethodsMixin], diff --git a/Libraries/Image/ImageSourcePropType.js b/Libraries/Image/ImageSourcePropType.js deleted file mode 100644 index 84eaf6629..000000000 --- a/Libraries/Image/ImageSourcePropType.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule ImageSourcePropType - * @flow - */ -'use strict'; - -var { PropTypes } = require('React'); - -var ImageSourcePropType = PropTypes.shape({ - /** - * uri - A string representing the resource identifier for the image, which - * could be an http address, a local file path, or the name of a static image - * resource (which should be wrapped in the `ix` function). - */ - uri: PropTypes.string.isRequired, - /** - * width/height - Used to store the size of the image itself, but unused by - * the component - use normal style layout properties to define the - * size of the frame. - */ - width: PropTypes.number, - height: PropTypes.number, -}); - -module.exports = ImageSourcePropType; diff --git a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js index 3c507129b..422447d46 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js +++ b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js @@ -140,7 +140,7 @@ function setupXHR() { function setupGeolocation() { GLOBAL.navigator = GLOBAL.navigator || {}; - GLOBAL.navigator.geolocation = require('GeoLocation'); + GLOBAL.navigator.geolocation = require('Geolocation'); } setupDocumentShim(); diff --git a/Libraries/ReactIOS/nativePropType.js b/Libraries/ReactIOS/nativePropType.js deleted file mode 100644 index d61c7f191..000000000 --- a/Libraries/ReactIOS/nativePropType.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule nativePropType - */ -'use strict' - -/** - * A simple wrapper for prop types to mark them as native, which will allow them - * to be passed over the bridge to be applied to the native component if - * processed by `validAttributesFromPropTypes`. - */ -function nativePropType(propType) { - propType.isNative = true; - return propType; -} - -module.exports = nativePropType; diff --git a/Libraries/StyleSheet/ArrayOfPropType.js b/Libraries/StyleSheet/ArrayOfPropType.js deleted file mode 100644 index 89d224d8b..000000000 --- a/Libraries/StyleSheet/ArrayOfPropType.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule ArrayOfPropType - */ -'use strict' - -var ReactPropTypes = require('ReactPropTypes'); - -var deepDiffer = require('deepDiffer'); - -var ArrayOfPropType = (type, differ) => { - var checker = ReactPropTypes.arrayOf(type); - checker.differ = differ ? differ : deepDiffer; - return checker; -}; - -module.exports = ArrayOfPropType; diff --git a/Libraries/StyleSheet/EdgeInsetsPropType.js b/Libraries/StyleSheet/EdgeInsetsPropType.js index dcf38de79..a57abcaf8 100644 --- a/Libraries/StyleSheet/EdgeInsetsPropType.js +++ b/Libraries/StyleSheet/EdgeInsetsPropType.js @@ -17,6 +17,4 @@ var EdgeInsetsPropType = createStrictShapeTypeChecker({ right: PropTypes.number, }); -EdgeInsetsPropType.differ = insetsDiffer; - module.exports = EdgeInsetsPropType; diff --git a/Libraries/StyleSheet/PointPropType.js b/Libraries/StyleSheet/PointPropType.js index b281b96e0..c409bd660 100644 --- a/Libraries/StyleSheet/PointPropType.js +++ b/Libraries/StyleSheet/PointPropType.js @@ -15,6 +15,4 @@ var PointPropType = createStrictShapeTypeChecker({ y: PropTypes.number, }); -PointPropType.differ = pointsDiffer; - module.exports = PointPropType; diff --git a/Libraries/Text/Text.js b/Libraries/Text/Text.js index 71e022d9b..6171ecbde 100644 --- a/Libraries/Text/Text.js +++ b/Libraries/Text/Text.js @@ -28,46 +28,42 @@ var viewConfig = { }; /** - * - A react component for displaying text which supports nesting, + * A react component for displaying text which supports nesting, * styling, and touch handling. In the following example, the nested title and * body text will inherit the `fontFamily` from `styles.baseText`, but the title * provides its own additional styles. The title and body will stack on top of * each other on account of the literal newlines: * - * renderText: function() { - * return ( - * - * - * {this.state.titleText + '\n\n'} - * - * - * {this.state.bodyText} - * + * ``` + * renderText: function() { + * return ( + * + * + * {this.state.titleText + '\n\n'} * - * ); + * + * {this.state.bodyText} + * + * + * ); + * }, + * ... + * var styles = StyleSheet.create({ + * baseText: { + * fontFamily: 'Cochin', * }, - * ... - * var styles = StyleSheet.create({ - * baseText: { - * fontFamily: 'Cochin', - * }, - * titleText: { - * fontSize: 20, - * fontWeight: 'bold', - * }, - * }; - * - * More example code in `TextExample.ios.js` + * titleText: { + * fontSize: 20, + * fontWeight: 'bold', + * }, + * }; + * ``` */ var Text = React.createClass({ mixins: [Touchable.Mixin, NativeMethodsMixin], - statics: { - stylePropType: stylePropType, - }, - propTypes: { /** * Used to truncate the text with an elipsis after computing the text diff --git a/Libraries/Utilities/validAttributesFromPropTypes.js b/Libraries/Utilities/validAttributesFromPropTypes.js deleted file mode 100644 index d08d17cfa..000000000 --- a/Libraries/Utilities/validAttributesFromPropTypes.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule validAttributesFromPropTypes - */ -'use strict' - -function validAttributesFromPropTypes(propTypes) { - var validAttributes = {}; - for (var key in propTypes) { - var propType = propTypes[key]; - if (propType && propType.isNative) { - var diff = propType.differ; - validAttributes[key] = diff ? {diff} : true; - } - } - return validAttributes; -} - -module.exports = validAttributesFromPropTypes; diff --git a/Libraries/react-native/react-native.js b/Libraries/react-native/react-native.js index 78c93960b..7f7edaf72 100644 --- a/Libraries/react-native/react-native.js +++ b/Libraries/react-native/react-native.js @@ -8,6 +8,7 @@ var ReactNative = { ...require('React'), AppRegistry: require('AppRegistry'), + DatePickerIOS: require('DatePickerIOS'), ExpandingText: require('ExpandingText'), Image: require('Image'), LayoutAnimation: require('LayoutAnimation'), @@ -17,8 +18,10 @@ var ReactNative = { PixelRatio: require('PixelRatio'), ScrollView: require('ScrollView'), ActivityIndicatorIOS: require('ActivityIndicatorIOS'), + Slider: require('Slider'), StatusBarIOS: require('StatusBarIOS'), StyleSheet: require('StyleSheet'), + SwitchIOS: require('SwitchIOS'), Text: require('Text'), TextInput: require('TextInput'), TimerMixin: require('TimerMixin'), diff --git a/ReactKit/Base/RCTConvert.h b/ReactKit/Base/RCTConvert.h index a5aa59fe6..16cd6967b 100644 --- a/ReactKit/Base/RCTConvert.h +++ b/ReactKit/Base/RCTConvert.h @@ -19,6 +19,8 @@ + (float)float:(id)json; + (int)int:(id)json; ++ (NSArray *)NSArray:(id)json; ++ (NSDictionary *)NSDictionary:(id)json; + (NSString *)NSString:(id)json; + (NSNumber *)NSNumber:(id)json; + (NSInteger)NSInteger:(id)json; diff --git a/ReactKit/Base/RCTConvert.m b/ReactKit/Base/RCTConvert.m index bec60ff6c..760f8284d 100644 --- a/ReactKit/Base/RCTConvert.m +++ b/ReactKit/Base/RCTConvert.m @@ -99,6 +99,8 @@ RCT_CONVERTER(double, double, doubleValue) RCT_CONVERTER(float, float, floatValue) RCT_CONVERTER(int, int, intValue) +RCT_CONVERTER_CUSTOM(NSArray *, NSArray, [NSArray arrayWithArray:json]) +RCT_CONVERTER_CUSTOM(NSDictionary *, NSDictionary, [NSDictionary dictionaryWithDictionary:json]) RCT_CONVERTER(NSString *, NSString, description) RCT_CONVERTER_CUSTOM(NSNumber *, NSNumber, @([json doubleValue])) RCT_CONVERTER(NSInteger, NSInteger, integerValue) diff --git a/ReactKit/Modules/RCTLocationObserver.m b/ReactKit/Modules/RCTLocationObserver.m deleted file mode 100644 index fd9c7ac07..000000000 --- a/ReactKit/Modules/RCTLocationObserver.m +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - -#import "RCTLocationObserver.h" - -#import -#import - -#import "RCTAssert.h" -#import "RCTBridge.h" -#import "RCTEventDispatcher.h" -#import "RCTLog.h" - -// TODO (#5906496): Shouldn't these be configurable? -const CLLocationAccuracy RCTLocationAccuracy = 500.0; // meters - -@interface RCTPendingLocationRequest : NSObject - -@property (nonatomic, copy) RCTResponseSenderBlock successBlock; -@property (nonatomic, copy) RCTResponseSenderBlock errorBlock; - -@end - -@implementation RCTPendingLocationRequest @end - -@interface RCTLocationObserver () - -@end - -@implementation RCTLocationObserver -{ - CLLocationManager *_locationManager; - NSDictionary *_lastLocationEvent; - NSMutableDictionary *_pendingRequests; -} - -@synthesize bridge = _bridge; - -#pragma mark - Lifecycle - -- (instancetype)init -{ - if ((self = [super init])) { - _pendingRequests = [[NSMutableDictionary alloc] init]; - } - return self; -} - -- (void)dealloc -{ - [_locationManager stopUpdatingLocation]; -} - -#pragma mark - Public API - -- (void)startObserving -{ - RCT_EXPORT(); - - dispatch_async(dispatch_get_main_queue(), ^{ - - // Create the location manager if this object does not - // already have one, and it must be created and accessed - // on the main thread - if (nil == _locationManager) { - _locationManager = [[CLLocationManager alloc] init]; - } - - _locationManager.delegate = self; - _locationManager.desiredAccuracy = RCTLocationAccuracy; - - // Set a movement threshold for new events. - _locationManager.distanceFilter = RCTLocationAccuracy; // meters - - if([_locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) { - [_locationManager requestWhenInUseAuthorization]; - } - - [_locationManager startUpdatingLocation]; - - }); -} - -- (void)stopObserving -{ - RCT_EXPORT(); - - dispatch_async(dispatch_get_main_queue(), ^{ - [_locationManager stopUpdatingLocation]; - _lastLocationEvent = nil; - }); -} - -#pragma mark - CLLocationManagerDelegate - -- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations -{ - CLLocation *loc = [locations lastObject]; - NSDictionary *event = @{ - @"coords": @{ - @"latitude": @(loc.coordinate.latitude), - @"longitude": @(loc.coordinate.longitude), - @"altitude": @(loc.altitude), - @"accuracy": @(RCTLocationAccuracy), - @"altitudeAccuracy": @(RCTLocationAccuracy), - @"heading": @(loc.course), - @"speed": @(loc.speed), - }, - @"timestamp": @(CACurrentMediaTime()) - }; - [_bridge.eventDispatcher sendDeviceEventWithName:@"geoLocationDidChange" body:event]; - NSArray *pendingRequestsCopy; - - // TODO (#5906496): is this locking neccessary? If so, use something better than @synchronize - @synchronized(self) { - - pendingRequestsCopy = [_pendingRequests allValues]; - [_pendingRequests removeAllObjects]; - - _lastLocationEvent = event; - } - - for (RCTPendingLocationRequest *request in pendingRequestsCopy) { - if (request.successBlock) { - request.successBlock(@[event]); - } - } -} - -- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error -{ - NSArray *pendingRequestsCopy; - - // TODO (#5906496): is this locking neccessary? If so, use something better than @synchronize - @synchronized(self) { - pendingRequestsCopy = [_pendingRequests allValues]; - [_pendingRequests removeAllObjects]; - } - - NSString *errorMsg = @"User denied location service or location service not available."; - for (RCTPendingLocationRequest *request in pendingRequestsCopy) { - if (request.errorBlock) { - request.errorBlock(@[errorMsg]); - } - } -} - -- (void)getCurrentPosition:(RCTResponseSenderBlock)geoSuccess withErrorCallback:(RCTResponseSenderBlock)geoError -{ - RCT_EXPORT(); - - NSDictionary *lastLocationCopy; - // TODO (#5906496): is this locking neccessary? If so, use something better than @synchronize - @synchronized(self) { - if (![CLLocationManager locationServicesEnabled] || [CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied) { - if (geoError) { - NSString *errorMsg = @"User denied location service or location service not available."; - geoError(@[errorMsg]); - return; - } - } - - // If a request for the current position comes in before the OS has informed us, we wait for the first - // OS event and then call our callbacks. This obviates the need for handling of the otherwise - // common failure case of requesting the geolocation until it succeeds, assuming we would have - // instead returned an error if it wasn't yet available. - if (!_lastLocationEvent) { - NSInteger requestID = [_pendingRequests count]; - RCTPendingLocationRequest *request = [[RCTPendingLocationRequest alloc] init]; - request.successBlock = geoSuccess; - request.errorBlock = geoError; - _pendingRequests[@(requestID)] = request; - return; - } else { - lastLocationCopy = [_lastLocationEvent copy]; - } - } - if (geoSuccess) { - geoSuccess(@[lastLocationCopy]); - } -} - -@end diff --git a/ReactKit/Modules/RCTUIManager.m b/ReactKit/Modules/RCTUIManager.m index 47b2e6c84..a22f24540 100644 --- a/ReactKit/Modules/RCTUIManager.m +++ b/ReactKit/Modules/RCTUIManager.m @@ -74,8 +74,9 @@ UIViewAnimationCurve UIViewAnimationCurveFromRCTAnimationType(RCTAnimationType t _property = [RCTConvert NSString:config[@"property"]]; // TODO: this should be provided in ms, not seconds - _duration = [RCTConvert NSTimeInterval:config[@"duration"]] ?: duration; - _delay = [RCTConvert NSTimeInterval:config[@"delay"]]; + // (this will require changing all call sites to ms as well) + _duration = [RCTConvert NSTimeInterval:config[@"duration"]] * 1000.0 ?: duration; + _delay = [RCTConvert NSTimeInterval:config[@"delay"]] * 1000.0; _animationType = [RCTConvert RCTAnimationType:config[@"type"]]; if (_animationType == RCTAnimationTypeSpring) { _springDamping = [RCTConvert CGFloat:config[@"springDamping"]]; @@ -135,7 +136,8 @@ UIViewAnimationCurve UIViewAnimationCurveFromRCTAnimationType(RCTAnimationType t if ((self = [super init])) { // TODO: this should be provided in ms, not seconds - NSTimeInterval duration = [RCTConvert NSTimeInterval:config[@"duration"]]; + // (this will require changing all call sites to ms as well) + NSTimeInterval duration = [RCTConvert NSTimeInterval:config[@"duration"]] * 1000.0; _createAnimation = [[RCTAnimation alloc] initWithDuration:duration dictionary:config[@"create"]]; _updateAnimation = [[RCTAnimation alloc] initWithDuration:duration dictionary:config[@"update"]]; diff --git a/ReactKit/ReactKit.xcodeproj/project.pbxproj b/ReactKit/ReactKit.xcodeproj/project.pbxproj index 899d865b4..48cac5ded 100644 --- a/ReactKit/ReactKit.xcodeproj/project.pbxproj +++ b/ReactKit/ReactKit.xcodeproj/project.pbxproj @@ -34,7 +34,10 @@ 13E067561A70F44B002CDEE1 /* RCTViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E0674E1A70F44B002CDEE1 /* RCTViewManager.m */; }; 13E067571A70F44B002CDEE1 /* RCTView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067501A70F44B002CDEE1 /* RCTView.m */; }; 13E067591A70F44B002CDEE1 /* UIView+ReactKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067541A70F44B002CDEE1 /* UIView+ReactKit.m */; }; - 5F5F0D991A9E456B001279FA /* RCTLocationObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F5F0D981A9E456B001279FA /* RCTLocationObserver.m */; }; + 58C571C11AA56C1900CDF9C8 /* RCTDatePickerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */; }; + 14F3620D1AABD06A001CE568 /* RCTSwitch.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F362081AABD06A001CE568 /* RCTSwitch.m */; }; + 14F3620E1AABD06A001CE568 /* RCTSwitchManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F3620A1AABD06A001CE568 /* RCTSwitchManager.m */; }; + 14F484561AABFCE100FDF6B9 /* RCTSliderManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F484551AABFCE100FDF6B9 /* RCTSliderManager.m */; }; 830A229E1A66C68A008503DA /* RCTRootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 830A229D1A66C68A008503DA /* RCTRootView.m */; }; 830BA4551A8E3BDA00D53203 /* RCTCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 830BA4541A8E3BDA00D53203 /* RCTCache.m */; }; 832348161A77A5AA00B55238 /* Layout.c in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FC71A68125100A75B9A /* Layout.c */; }; @@ -123,8 +126,14 @@ 13E067531A70F44B002CDEE1 /* UIView+ReactKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+ReactKit.h"; sourceTree = ""; }; 13E067541A70F44B002CDEE1 /* UIView+ReactKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+ReactKit.m"; sourceTree = ""; }; 13EFFCCF1A98E6FE002607DC /* RCTJSMethodRegistrar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSMethodRegistrar.h; sourceTree = ""; }; - 5F5F0D971A9E456B001279FA /* RCTLocationObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTLocationObserver.h; sourceTree = ""; }; - 5F5F0D981A9E456B001279FA /* RCTLocationObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLocationObserver.m; sourceTree = ""; }; + 58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDatePickerManager.m; sourceTree = ""; }; + 58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDatePickerManager.h; sourceTree = ""; }; + 14F362071AABD06A001CE568 /* RCTSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSwitch.h; sourceTree = ""; }; + 14F362081AABD06A001CE568 /* RCTSwitch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSwitch.m; sourceTree = ""; }; + 14F362091AABD06A001CE568 /* RCTSwitchManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSwitchManager.h; sourceTree = ""; }; + 14F3620A1AABD06A001CE568 /* RCTSwitchManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSwitchManager.m; sourceTree = ""; }; + 14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSliderManager.h; sourceTree = ""; }; + 14F484551AABFCE100FDF6B9 /* RCTSliderManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSliderManager.m; sourceTree = ""; }; 830213F31A654E0800B993E6 /* RCTBridgeModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTBridgeModule.h; sourceTree = ""; }; 830A229C1A66C68A008503DA /* RCTRootView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootView.h; sourceTree = ""; }; 830A229D1A66C68A008503DA /* RCTRootView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootView.m; sourceTree = ""; }; @@ -187,8 +196,6 @@ 13B07FE01A69315300A75B9A /* Modules */ = { isa = PBXGroup; children = ( - 5F5F0D971A9E456B001279FA /* RCTLocationObserver.h */, - 5F5F0D981A9E456B001279FA /* RCTLocationObserver.m */, 13B07FE71A69327A00A75B9A /* RCTAlertManager.h */, 13B07FE81A69327A00A75B9A /* RCTAlertManager.m */, 13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */, @@ -206,7 +213,15 @@ 13B07FF31A6947C200A75B9A /* Views */ = { isa = PBXGroup; children = ( + 14F362071AABD06A001CE568 /* RCTSwitch.h */, + 14F362081AABD06A001CE568 /* RCTSwitch.m */, + 14F362091AABD06A001CE568 /* RCTSwitchManager.h */, + 14F3620A1AABD06A001CE568 /* RCTSwitchManager.m */, + 14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */, + 14F484551AABFCE100FDF6B9 /* RCTSliderManager.m */, 13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */, + 58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */, + 58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */, 13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */, 13442BF41AA90E0B0037E5B0 /* RCTViewControllerProtocol.h */, 13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */, @@ -393,14 +408,16 @@ 13B0801E1A69489C00A75B9A /* RCTTextField.m in Sources */, 13B07FEF1A69327A00A75B9A /* RCTAlertManager.m in Sources */, 83CBBACC1A6023D300E9B192 /* RCTConvert.m in Sources */, - 5F5F0D991A9E456B001279FA /* RCTLocationObserver.m in Sources */, 830A229E1A66C68A008503DA /* RCTRootView.m in Sources */, 13B07FF01A69327A00A75B9A /* RCTExceptionsManager.m in Sources */, 83CBBA5A1A601E9000E9B192 /* RCTRedBox.m in Sources */, 83CBBA511A601E3B00E9B192 /* RCTAssert.m in Sources */, 832348161A77A5AA00B55238 /* Layout.c in Sources */, + 14F3620D1AABD06A001CE568 /* RCTSwitch.m in Sources */, + 14F3620E1AABD06A001CE568 /* RCTSwitchManager.m in Sources */, 13B080201A69489C00A75B9A /* RCTUIActivityIndicatorViewManager.m in Sources */, 13E067561A70F44B002CDEE1 /* RCTViewManager.m in Sources */, + 58C571C11AA56C1900CDF9C8 /* RCTDatePickerManager.m in Sources */, 13B080061A6947C200A75B9A /* RCTScrollViewManager.m in Sources */, 137327EA1AA5CF210034F82E /* RCTTabBarManager.m in Sources */, 13B080261A694A8400A75B9A /* RCTWrapperViewController.m in Sources */, @@ -409,6 +426,7 @@ 13B0801F1A69489C00A75B9A /* RCTTextFieldManager.m in Sources */, 134FCB3D1A6E7F0800051CC8 /* RCTContextExecutor.m in Sources */, 13E067591A70F44B002CDEE1 /* UIView+ReactKit.m in Sources */, + 14F484561AABFCE100FDF6B9 /* RCTSliderManager.m in Sources */, 83CBBA981A6020BB00E9B192 /* RCTTouchHandler.m in Sources */, 83CBBA521A601E3B00E9B192 /* RCTLog.m in Sources */, 13B0801D1A69489C00A75B9A /* RCTNavItemManager.m in Sources */, diff --git a/ReactKit/Views/RCTDatePickerManager.h b/ReactKit/Views/RCTDatePickerManager.h new file mode 100644 index 000000000..65459b80c --- /dev/null +++ b/ReactKit/Views/RCTDatePickerManager.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTDatePickerManager : RCTViewManager + +@end diff --git a/ReactKit/Views/RCTDatePickerManager.m b/ReactKit/Views/RCTDatePickerManager.m new file mode 100644 index 000000000..39010214e --- /dev/null +++ b/ReactKit/Views/RCTDatePickerManager.m @@ -0,0 +1,51 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTDatePickerManager.h" + +#import "RCTBridge.h" +#import "RCTConvert.h" +#import "RCTEventDispatcher.h" +#import "UIView+ReactKit.h" + +@implementation RCTDatePickerManager + +- (UIView *)view +{ + UIDatePicker *picker = [[UIDatePicker alloc] init]; + [picker addTarget:self + action:@selector(onChange:) + forControlEvents:UIControlEventValueChanged]; + return picker; +} + +RCT_EXPORT_VIEW_PROPERTY(date) +RCT_EXPORT_VIEW_PROPERTY(minimumDate) +RCT_EXPORT_VIEW_PROPERTY(maximumDate) +RCT_EXPORT_VIEW_PROPERTY(minuteInterval) +RCT_REMAP_VIEW_PROPERTY(mode, datePickerMode) +RCT_REMAP_VIEW_PROPERTY(timeZoneOffsetInMinutes, timeZone) + +- (void)onChange:(UIDatePicker *)sender +{ + NSDictionary *event = @{ + @"target": sender.reactTag, + @"timestamp": @([sender.date timeIntervalSince1970] * 1000.0) + }; + [self.bridge.eventDispatcher sendInputEventWithName:@"topChange" body:event]; +} + +- (NSDictionary *)constantsToExport +{ + UIDatePicker *dp = [[UIDatePicker alloc] init]; + return @{ + @"ComponentHeight": @(CGRectGetHeight(dp.frame)), + @"ComponentWidth": @(CGRectGetWidth(dp.frame)), + @"DatePickerModes": @{ + @"time": @(UIDatePickerModeTime), + @"date": @(UIDatePickerModeDate), + @"datetime": @(UIDatePickerModeDateAndTime), + } + }; +} + +@end diff --git a/ReactKit/Views/RCTShadowView.h b/ReactKit/Views/RCTShadowView.h index 9a09bad4f..f869ca614 100644 --- a/ReactKit/Views/RCTShadowView.h +++ b/ReactKit/Views/RCTShadowView.h @@ -32,8 +32,8 @@ typedef void (^RCTApplierBlock)(RCTSparseArray *); @property (nonatomic, weak, readonly) RCTShadowView *superview; @property (nonatomic, assign, readonly) css_node_t *cssNode; @property (nonatomic, copy) NSString *moduleName; -@property (nonatomic, assign) BOOL isBGColorExplicitlySet; // Used to propogate to children -@property (nonatomic, strong) UIColor *backgroundColor; // Used to propogate to children +@property (nonatomic, assign) BOOL isBGColorExplicitlySet; // Used to propagate to children +@property (nonatomic, strong) UIColor *backgroundColor; // Used to propagate to children @property (nonatomic, assign) RCTUpdateLifecycle layoutLifecycle; /** diff --git a/ReactKit/Views/RCTSliderManager.h b/ReactKit/Views/RCTSliderManager.h new file mode 100644 index 000000000..1088ec569 --- /dev/null +++ b/ReactKit/Views/RCTSliderManager.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTSliderManager : RCTViewManager + +@end diff --git a/ReactKit/Views/RCTSliderManager.m b/ReactKit/Views/RCTSliderManager.m new file mode 100644 index 000000000..8561c0a97 --- /dev/null +++ b/ReactKit/Views/RCTSliderManager.m @@ -0,0 +1,43 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTSliderManager.h" + +#import "RCTBridge.h" +#import "RCTEventDispatcher.h" +#import "UIView+ReactKit.h" + +@implementation RCTSliderManager + +- (UIView *)view +{ + UISlider *slider = [[UISlider alloc] init]; + [slider addTarget:self action:@selector(sliderValueChanged:) forControlEvents:UIControlEventValueChanged]; + [slider addTarget:self action:@selector(sliderTouchEnd:) forControlEvents:UIControlEventTouchUpInside]; + return slider; +} + +- (void)sliderValueChanged:(UISlider *)sender +{ + NSDictionary *event = @{ + @"target": sender.reactTag, + @"value": @(sender.value), + @"continuous": @YES, + }; + + [self.bridge.eventDispatcher sendInputEventWithName:@"topChange" body:event]; +} + +- (void)sliderTouchEnd:(UISlider *)sender +{ + NSDictionary *event = @{ + @"target": sender.reactTag, + @"value": @(sender.value), + @"continuous": @NO, + }; + + [self.bridge.eventDispatcher sendInputEventWithName:@"topChange" body:event]; +} + +RCT_EXPORT_VIEW_PROPERTY(value); + +@end diff --git a/ReactKit/Views/RCTSwitch.h b/ReactKit/Views/RCTSwitch.h new file mode 100644 index 000000000..7866eb866 --- /dev/null +++ b/ReactKit/Views/RCTSwitch.h @@ -0,0 +1,10 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + + +#import + +@interface RCTSwitch : UISwitch + +@property (nonatomic, assign) BOOL wasOn; + +@end diff --git a/ReactKit/Views/RCTSwitch.m b/ReactKit/Views/RCTSwitch.m new file mode 100644 index 000000000..70233fede --- /dev/null +++ b/ReactKit/Views/RCTSwitch.m @@ -0,0 +1,15 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTSwitch.h" + +#import "RCTEventDispatcher.h" +#import "UIView+ReactKit.h" + +@implementation RCTSwitch + +- (void)setOn:(BOOL)on animated:(BOOL)animated { + _wasOn = on; + [super setOn:on animated:animated]; +} + +@end diff --git a/ReactKit/Views/RCTSwitchManager.h b/ReactKit/Views/RCTSwitchManager.h new file mode 100644 index 000000000..f6833d106 --- /dev/null +++ b/ReactKit/Views/RCTSwitchManager.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTSwitchManager : RCTViewManager + +@end diff --git a/ReactKit/Views/RCTSwitchManager.m b/ReactKit/Views/RCTSwitchManager.m new file mode 100644 index 000000000..61eab8199 --- /dev/null +++ b/ReactKit/Views/RCTSwitchManager.m @@ -0,0 +1,39 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTSwitchManager.h" + +#import "RCTBridge.h" +#import "RCTEventDispatcher.h" +#import "RCTSwitch.h" +#import "UIView+ReactKit.h" + +@implementation RCTSwitchManager + +- (UIView *)view +{ + RCTSwitch *switcher = [[RCTSwitch alloc] init]; + [switcher addTarget:self + action:@selector(onChange:) + forControlEvents:UIControlEventValueChanged]; + return switcher; +} + +- (void)onChange:(RCTSwitch *)sender +{ + if (sender.wasOn != sender.on) { + [self.bridge.eventDispatcher sendInputEventWithName:@"topChange" body:@{ + @"target": sender.reactTag, + @"value": @(sender.on) + }]; + + sender.wasOn = sender.on; + } +} + +RCT_EXPORT_VIEW_PROPERTY(onTintColor); +RCT_EXPORT_VIEW_PROPERTY(tintColor); +RCT_EXPORT_VIEW_PROPERTY(thumbTintColor); +RCT_EXPORT_VIEW_PROPERTY(on); +RCT_EXPORT_VIEW_PROPERTY(enabled); + +@end diff --git a/ReactKit/Views/RCTViewNodeProtocol.h b/ReactKit/Views/RCTViewNodeProtocol.h index 0e3e08099..71422b2c8 100644 --- a/ReactKit/Views/RCTViewNodeProtocol.h +++ b/ReactKit/Views/RCTViewNodeProtocol.h @@ -1,7 +1,6 @@ // Copyright 2004-present Facebook. All Rights Reserved. /** - * Logical node in a tree of application components. Both `ShadowView`s and * `UIView+ReactKit`s conform to this. Allows us to write utilities that * reason about trees generally. From a7e977c5ddf372b59ab4c77a0ced4fa2d67df604 Mon Sep 17 00:00:00 2001 From: Joe Stanton Date: Tue, 10 Mar 2015 08:58:11 +0000 Subject: [PATCH 24/79] Fix reference to GeoLocationExample --- Examples/UIExplorer/GeoLocationExample.js | 2 +- Examples/UIExplorer/UIExplorerList.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples/UIExplorer/GeoLocationExample.js b/Examples/UIExplorer/GeoLocationExample.js index fac3dd205..561808149 100644 --- a/Examples/UIExplorer/GeoLocationExample.js +++ b/Examples/UIExplorer/GeoLocationExample.js @@ -1,7 +1,7 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. * - * @providesModule GeolocationExample + * @providesModule GeoLocationExample */ /* eslint no-console: 0 */ 'use strict'; diff --git a/Examples/UIExplorer/UIExplorerList.js b/Examples/UIExplorer/UIExplorerList.js index e04edcab6..96c11d439 100644 --- a/Examples/UIExplorer/UIExplorerList.js +++ b/Examples/UIExplorer/UIExplorerList.js @@ -32,7 +32,7 @@ var EXAMPLES = [ require('./ActivityIndicatorExample'), require('./ScrollViewExample'), require('./DatePickerExample'), - require('./GeolocationExample'), + require('./GeoLocationExample'), require('./TabBarExample'), require('./SwitchExample'), require('./SliderExample'), From 83581cfe6bf046c6d659d96cb0b25f62e0e9da00 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Tue, 10 Mar 2015 13:55:54 -0700 Subject: [PATCH 25/79] Initial import of the lib to parse javascript code, in the same vein as we parse React proptypes --- website/jsdocs/TypeExpressionParser.js | 557 +++++++++++++++++++++ website/jsdocs/findExportDefinition.js | 276 ++++++++++ website/jsdocs/generic-function-visitor.js | 534 ++++++++++++++++++++ website/jsdocs/jsdocs.js | 519 +++++++++++++++++++ website/jsdocs/meta.js | 54 ++ website/jsdocs/traverseFlat.js | 97 ++++ website/jsdocs/type.js | 79 +++ website/package.json | 5 +- website/server/extractDocs.js | 19 +- 9 files changed, 2137 insertions(+), 3 deletions(-) create mode 100644 website/jsdocs/TypeExpressionParser.js create mode 100644 website/jsdocs/findExportDefinition.js create mode 100644 website/jsdocs/generic-function-visitor.js create mode 100644 website/jsdocs/jsdocs.js create mode 100644 website/jsdocs/meta.js create mode 100644 website/jsdocs/traverseFlat.js create mode 100644 website/jsdocs/type.js diff --git a/website/jsdocs/TypeExpressionParser.js b/website/jsdocs/TypeExpressionParser.js new file mode 100644 index 000000000..7efcb747a --- /dev/null +++ b/website/jsdocs/TypeExpressionParser.js @@ -0,0 +1,557 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +/*global exports:true*/ +"use strict"; + +var Syntax = require('esprima-fb').Syntax; + +function toObject(/*array*/ array) /*object*/ { + var object = {}; + for (var i = 0; i < array.length; i++) { + var value = array[i]; + object[value] = value; + } + return object; +} + +function reverseObject(/*object*/ object) /*object*/ { + var reversed = {}; + for (var key in object) { + if (object.hasOwnProperty(key)) { + reversed[object[key]] = key + } + } + return reversed; +} + +function getTagName(string) { + if (string === 'A') { + return 'Anchor'; + } + if (string === 'IMG') { + return 'Image'; + } + return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase(); +} + +var TOKENS = { + STRING: 'string', + OPENGENERIC: '<', + CLOSEGENERIC: '>', + COMMA: ',', + OPENPAREN: '(', + CLOSEPAREN: ')', + COLON: ':', + BAR: '|', + NULLABLE: '?', + EOL: 'eol', + OPENSEGMENT: '{', + CLOSESEGMENT: '}' +}; +var TOKENMAP = reverseObject(TOKENS); + +var SYMBOLS = { + SIMPLE: 'simple', + UNION: 'union', + GENERIC: 'generic', + FUNCTION: 'function', + SEGMENT: 'segment' +}; + +var PARSERS = { + SIMPLE: 1, + UNION: 2, + GENERIC: 4, + FUNCTION: 8, + SEGMENT: 16 +}; + +/*----- tokenizer-----*/ + +function createTokenStream(source) { + var stream = [], string, pos = 0; + + do { + var character = source.charAt(pos); + if (character && /\w/.test(character)) { + string = string ? string + character : character; + } else { + if (string) { + stream.push({ type: TOKENS.STRING, value: string }); + string = null; + } + + if (character) { + if (character in TOKENMAP) { + stream.push({ type: character }); + } else { + throwError('Invalid character: ' + character + ' at pos: ' + pos); + } + } else { + stream.push({ type: TOKENS.EOL }); + break; + } + } + } while (++pos); + + return stream; +} + +/*----- parser-----*/ + +var SIMPLETYPES = toObject([ + 'string', + 'number', + 'regexp', + 'boolean', + 'object', + 'function', + 'array', + 'date', + 'blob', + 'file', + 'int8array', + 'uint8array', + 'int16array', + 'uint16array', + 'int32array', + 'uint32array', + 'float32array', + 'float64array', + 'filelist', + 'promise', + 'map', + 'set' +]); + +// types typically used in legacy docblock +var BLACKLISTED = toObject([ + 'Object', + 'Boolean', + 'bool', + 'Number', + 'String', + 'int', + 'Node', + 'Element', +]); + +function createAst(type, value, length) { + return { type: type, value: value, length: length }; +} + +function nullable(fn) { + return function(stream, pos) { + var nullable = stream[pos].type == '?' && ++pos; + var ast = fn(stream, pos); + if (ast && nullable) { + ast.nullable = true; + ast.length++; + } + return ast; + }; +} + +var parseSimpleType = nullable(function(stream, pos) { + if (stream[pos].type == TOKENS.STRING) { + var value = stream[pos].value; + if ((/^[a-z]/.test(value) && !(value in SIMPLETYPES)) + || value in BLACKLISTED) { + throwError('Invalid type ' + value + ' at pos: ' + pos); + } + return createAst(SYMBOLS.SIMPLE, stream[pos].value, 1); + } +}); + +var parseUnionType = nullable(function(stream, pos) { + var parsers = + PARSERS.SIMPLE | PARSERS.GENERIC | PARSERS.FUNCTION | PARSERS.SEGMENT; + var list = parseList(stream, pos, TOKENS.BAR, parsers); + + if (list.value.length > 1) { + return createAst(SYMBOLS.UNION, list.value, list.length); + } +}); + +var parseGenericType = nullable(function(stream, pos, ast) { + var genericAst, typeAst; + if ((genericAst = parseSimpleType(stream, pos)) && + stream[pos + genericAst.length].type == TOKENS.OPENGENERIC && + (typeAst = parseAnyType(stream, pos += genericAst.length + 1))) { + + if (stream[pos + typeAst.length].type != TOKENS.CLOSEGENERIC) { + throwError('Missing ' + TOKENS.CLOSEGENERIC + + ' at pos: ' + pos + typeAst.length); + } + + return createAst(SYMBOLS.GENERIC, [genericAst, typeAst], + genericAst.length + typeAst.length + 2); + } +}); + +var parseFunctionType = nullable(function(stream, pos) { + if (stream[pos].type == TOKENS.STRING && + stream[pos].value == 'function' && + stream[++pos].type == TOKENS.OPENPAREN) { + + var list = stream[pos + 1].type != TOKENS.CLOSEPAREN + ? parseList(stream, pos + 1, TOKENS.COMMA) + : {value: [], length: 0}; + + pos += list.length + 1; + + if (stream[pos].type == TOKENS.CLOSEPAREN) { + var length = list.length + 3, returnAst; + + if (stream[++pos].type == TOKENS.COLON) { + returnAst = parseAnyType(stream, ++pos); + if (!returnAst) { + throwError('Could not parse return type at pos: ' + pos); + } + length += returnAst.length + 1; + } + return createAst(SYMBOLS.FUNCTION, [list.value, returnAst || null], + length); + } + } +}); + +function parseSegmentType(stream, pos) { + var segmentAst; + if (stream[pos].type == TOKENS.OPENSEGMENT && + (segmentAst = parseAnyType(stream, ++pos))) { + pos += segmentAst.length + if (stream[pos].type == TOKENS.CLOSESEGMENT) { + return createAst(SYMBOLS.SEGMENT, segmentAst, segmentAst.length + 2); + } + } +} + +function parseAnyType(stream, pos, parsers) { + if (!parsers) parsers = + PARSERS.SEGMENT | PARSERS.SIMPLE | PARSERS.UNION | PARSERS.GENERIC + | PARSERS.FUNCTION; + + var ast = + (parsers & PARSERS.UNION && parseUnionType(stream, pos)) || + (parsers & PARSERS.SEGMENT && parseSegmentType(stream, pos)) || + (parsers & PARSERS.GENERIC && parseGenericType(stream, pos)) || + (parsers & PARSERS.FUNCTION && parseFunctionType(stream, pos)) || + (parsers & PARSERS.SIMPLE && parseSimpleType(stream, pos)); + if (!ast) { + throwError('Could not parse ' + stream[pos].type); + } + return ast; +} + +function parseList(stream, pos, separator, parsers) { + var symbols = [], childAst, length = 0, separators = 0; + while (true) { + if (childAst = parseAnyType(stream, pos, parsers)) { + symbols.push(childAst); + length += childAst.length; + pos += childAst.length; + + if (stream[pos].type == separator) { + length++; + pos++; + separators++; + continue; + } + } + break; + } + + if (symbols.length && symbols.length != separators + 1) { + throwError('Malformed list expression'); + } + + return { + value: symbols, + length: length + }; +} + +var _source; +function throwError(msg) { + throw new Error(msg + '\nSource: ' + _source); +} + + +function parse(source) { + _source = source; + var stream = createTokenStream(source); + var ast = parseAnyType(stream, 0); + if (ast) { + if (ast.length + 1 != stream.length) { + console.log(ast); + throwError('Could not parse ' + stream[ast.length].type + + ' at token pos:' + ast.length); + } + return ast; + } else { + throwError('Failed to parse the source'); + } +} + +exports.createTokenStream = createTokenStream; +exports.parse = parse; +exports.parseList = parseList; + +/*----- compiler -----*/ + +var compilers = {}; + +compilers[SYMBOLS.SIMPLE] = function(ast) { + switch (ast.value) { + case 'DOMElement': return 'HTMLElement'; + case 'FBID': return 'string'; + default: return ast.value; + } +}; + +compilers[SYMBOLS.UNION] = function(ast) { + return ast.value.map(function(symbol) { + return compile(symbol); + }).join(TOKENS.BAR); +}; + +compilers[SYMBOLS.GENERIC] = function(ast) { + var type = compile(ast.value[0]); + var parametricType = compile(ast.value[1]); + if (type === 'HTMLElement') { + return 'HTML' + getTagName(parametricType) + 'Element'; + } + return type + '<' + parametricType + '>'; +}; + +compilers[SYMBOLS.FUNCTION] = function(ast) { + return 'function(' + ast.value[0].map(function(symbol) { + return compile(symbol); + }).join(TOKENS.COMMA) + ')' + + (ast.value[1] ? ':' + compile(ast.value[1]) : ''); +}; + +function compile(ast) { + return (ast.nullable ? '?' : '') + compilers[ast.type](ast); +} + +exports.compile = compile; + +/*----- normalizer -----*/ + +function normalize(ast) { + if (ast.type === SYMBOLS.UNION) { + return ast.value.map(normalize).reduce(function(list, nodes) { + return list ? list.concat(nodes) : nodes; + }); + } + + var valueNodes = ast.type === SYMBOLS.GENERIC + ? normalize(ast.value[1]) + : [ast.value]; + + return valueNodes.map(function(valueNode) { + return createAst( + ast.type, + ast.type === SYMBOLS.GENERIC + ? [ast.value[0], valueNode] + : valueNode, + ast.length); + }); +} + +exports.normalize = function(ast) { + var normalized = normalize(ast); + normalized = normalized.length === 1 + ? normalized[0] + : createAst(SYMBOLS.UNION, normalized, normalized.length); + if (ast.nullable) { + normalized.nullable = true; + } + return normalized; +}; + +/*----- Tracking TypeAliases -----*/ + +function initTypeAliasTracking(state) { + state.g.typeAliasScopes = []; +} + +function pushTypeAliases(state, typeAliases) { + state.g.typeAliasScopes.unshift(typeAliases); +} + +function popTypeAliases(state) { + state.g.typeAliasScopes.shift(); +} + +function getTypeAlias(id, state) { + var typeAliasScopes = state.g.typeAliasScopes; + for (var ii = 0; ii < typeAliasScopes.length; ii++) { + var typeAliasAnnotation = typeAliasScopes[ii][id.name]; + if (typeAliasAnnotation) { + return typeAliasAnnotation; + } + } + return null; +} + +exports.initTypeAliasTracking = initTypeAliasTracking; +exports.pushTypeAliases = pushTypeAliases; +exports.popTypeAliases = popTypeAliases; + +/*----- Tracking which TypeVariables are in scope -----*/ +// Counts how many scopes deep each type variable is + +function initTypeVariableScopeTracking(state) { + state.g.typeVariableScopeDepth = {}; +} + +function pushTypeVariables(node, state) { + var parameterDeclaration = node.typeParameters, scopeHistory; + + if (parameterDeclaration != null + && parameterDeclaration.type === Syntax.TypeParameterDeclaration) { + parameterDeclaration.params.forEach(function (id) { + scopeHistory = state.g.typeVariableScopeDepth[id.name] || 0; + state.g.typeVariableScopeDepth[id.name] = scopeHistory + 1; + }); + } +} + +function popTypeVariables(node, state) { + var parameterDeclaration = node.typeParameters, scopeHistory; + + if (parameterDeclaration != null + && parameterDeclaration.type === Syntax.TypeParameterDeclaration) { + parameterDeclaration.params.forEach(function (id) { + scopeHistory = state.g.typeVariableScopeDepth[id.name]; + state.g.typeVariableScopeDepth[id.name] = scopeHistory - 1; + }); + } +} + +function isTypeVariableInScope(id, state) { + return state.g.typeVariableScopeDepth[id.name] > 0; +} + +exports.initTypeVariableScopeTracking = initTypeVariableScopeTracking; +exports.pushTypeVariables = pushTypeVariables; +exports.popTypeVariables = popTypeVariables; + +/*----- FromFlowToTypechecks -----*/ + +function fromFlowAnnotation(/*object*/ annotation, state) /*?object*/ { + var ast; + switch (annotation.type) { + case "NumberTypeAnnotation": + return createAst(SYMBOLS.SIMPLE, "number", 0); + case "StringTypeAnnotation": + return createAst(SYMBOLS.SIMPLE, "string", 0); + case "BooleanTypeAnnotation": + return createAst(SYMBOLS.SIMPLE, "boolean", 0); + case "AnyTypeAnnotation": // fallthrough + case "VoidTypeAnnotation": + return null; + case "NullableTypeAnnotation": + ast = fromFlowAnnotation(annotation.typeAnnotation, state); + if (ast) { + ast.nullable = true; + } + return ast; + case 'ObjectTypeAnnotation': + // ObjectTypeAnnotation is always converted to a simple object type, as we + // don't support records + return createAst(SYMBOLS.SIMPLE, 'object', 0); + case 'FunctionTypeAnnotation': + var params = annotation.params + .map(function(param) { + return fromFlowAnnotation(param.typeAnnotation, state); + }) + .filter(function(ast) { + return !!ast; + }); + + var returnType = fromFlowAnnotation(annotation.returnType, state); + + // If any of the params have a type that cannot be expressed, then we have + // to render a simple function instead of a detailed one + if ((params.length || returnType) + && params.length === annotation.params.length) { + return createAst(SYMBOLS.FUNCTION, [params, returnType], 0) + } + return createAst(SYMBOLS.SIMPLE, 'function', 0); + case "GenericTypeAnnotation": + var alias = getTypeAlias(annotation.id, state); + if (alias) { + return fromFlowAnnotation(alias, state); + } + + // Qualified type identifiers are not handled by runtime typechecker, + // so simply omit the annotation for now. + if (annotation.id.type === "QualifiedTypeIdentifier") { + return null; + } + + if (isTypeVariableInScope(annotation.id, state)) { + return null; + } + + var name = annotation.id.name; + var nameLowerCased = name.toLowerCase(); + if (name !== 'Object' && BLACKLISTED.hasOwnProperty(name)) { + return null; + } + if (SIMPLETYPES.hasOwnProperty(nameLowerCased)) { + name = nameLowerCased; + } + + var id = createAst( + SYMBOLS.SIMPLE, + name, + 0 + ); + + switch (name) { + case "mixed": // fallthrough + case "$Enum": + // Not supported + return null; + case "array": // fallthrough + case "promise": + if (annotation.typeParameters) { + var parametricAst = fromFlowAnnotation( + annotation.typeParameters.params[0], + state + ); + if (parametricAst) { + return createAst( + SYMBOLS.GENERIC, + [id, parametricAst], + 0 + ); + } + } + break; + case '$Either': + if (annotation.typeParameters) { + return createAst( + SYMBOLS.UNION, + annotation.typeParameters.params.map( + function (node) { return fromFlowAnnotation(node, state); } + ), + 0 + ); + } + return null; + } + return id; + } + return null; +} + +exports.fromFlow = function(/*object*/ annotation, state) /*?string*/ { + var ast = fromFlowAnnotation(annotation, state); + return ast ? compile(ast) : null; +}; diff --git a/website/jsdocs/findExportDefinition.js b/website/jsdocs/findExportDefinition.js new file mode 100644 index 000000000..45bf4a539 --- /dev/null +++ b/website/jsdocs/findExportDefinition.js @@ -0,0 +1,276 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +/*jslint node: true */ +"use strict"; + +var esprima = require('esprima'); +var Syntax = esprima.Syntax; +var traverseFlat = require('./traverseFlat'); + + +/** + * If the expression is an identifier, it is resolved in the scope chain. + * If it is an assignment expression, it resolves to the right hand side. + * + * In all other cases the expression itself is returned. + * + * Since the scope chain constructed by the traverse function is very simple + * (it doesn't take into account *changes* to the variable through assignment + * statements), this function doesn't return the correct value in every + * situation. But it's good enough for how it is used in the parser. + * + * @param {object} expr + * @param {array} scopeChain + * + * @return {object} + */ +function resolveToValue(expr, scopeChain) { + switch (expr.type) { + case Syntax.AssignmentExpression: + if (expr.operator === '=') { + return resolveToValue(expr.right, scopeChain); + } + break; + case Syntax.Identifier: + var value; + scopeChain.some(function(scope, i) { + if (hasOwnProperty.call(scope, expr.name) && scope[expr.name]) { + value = resolveToValue(scope[expr.name], scopeChain.slice(i)); + return true; + } + }); + return value; + } + return expr; +} + +/** + * Returns true if the statement is of form `foo = bar;`. + * + * @param {object} node + * @return {bool} + */ +function isAssignmentStatement(node) { + return node.type === Syntax.ExpressionStatement && + node.expression.type === Syntax.AssignmentExpression && + node.expression.operator === '='; +} + +/** + * Splits a member or call expression into parts. E.g. foo.bar.baz becomes + * ['foo', 'bar', 'baz'] + * + * @param {object} expr + * @return {array} + */ +function expressionToArray(expr) { + var parts = []; + switch(expr.type) { + case Syntax.CallExpression: + parts = expressionToArray(expr.callee); + break; + case Syntax.MemberExpression: + parts = expressionToArray(expr.object); + if (expr.computed) { + parts.push('...'); + } else { + parts.push(expr.property.name || expr.property.value); + } + break; + case Syntax.Identifier: + parts = [expr.name]; + break; + case Syntax.Literal: + parts = [expr.raw]; + break; + case Syntax.ThisExpression: + parts = ['this']; + break; + case Syntax.ObjectExpression: + var properties = expr.properties.map(function(property) { + return expressionToString(property.key) + + ': ' + + expressionToString(property.value); + }); + parts = ['{' + properties.join(', ') + '}']; + break; + case Syntax.ArrayExpression: + parts = ['[' + expr.elements.map(expressionToString).join(', ') + ']']; + break; + } + return parts; +} + +/** + * Creates a string representation of a member expression. + * + * @param {object} expr + * @return {array} + */ +function expressionToString(expr) { + return expressionToArray(expr).join('.'); +} + +/** + * Returns true if the expression is of form `exports.foo = bar;` or + * `modules.exports = foo;`. + * + * @param {object} node + * @return {bool} + */ +function isExportsOrModuleExpression(expr) { + if (expr.left.type !== Syntax.MemberExpression) { + return false; + } + var exprArr = expressionToArray(expr.left); + return (exprArr[0] === 'module' && exprArr[1] === 'exports') || + exprArr[0] == 'exports'; +} + + +/** + * Finds module.exports / exports.X statements inside an assignment expression. + */ +function handleAssignmentExpression(expr, scopeChain, multipleExports) { + while (!isExportsOrModuleExpression(expr)) { + if (expr.type === Syntax.AssignmentExpression && + expr.right.type === Syntax.AssignmentExpression) { + expr = expr.right; + } else { + return; + } + } + + var definition = resolveToValue( + expr.right, + scopeChain + ); + + if (!definition) { + // handle empty var declaration, e.g. "var x; ... module.exports = x" + if (expr.right.type === Syntax.Identifier) { + var found = false; + scopeChain.some(function(scope) { + if (scope[expr.right.name] === null) { + return found = true; + } + }); + if (found) { + // fake definition so we still return something at least + return { + definition: { + type: Syntax.VariableDeclaration, + loc: expr.loc, + isSynthesized: true + }, + scopeChain: scopeChain + }; + } + } + return; + } + + var leftExpression = expr.left; + var leftExpressions = expressionToArray(leftExpression); + if (leftExpressions[0] === 'exports') { + // exports.A = A + if (leftExpressions.length === 2 && leftExpression.property) { + // The 2nd element is the field name + multipleExports.push({ + key: leftExpression.property, + value: definition + }); + } + } else if (definition) { + // module.exports = A + return { + definition: definition, + scopeChain: scopeChain + }; + } +} + +/** + * Given an AST, this function tries to find the object expression that is the + * module's exported value. + * + * @param {object} ast + * @return {?object} + */ +function findExportDefinition(ast) { + var multipleExports = []; + var singleExport; + traverseFlat(ast, function(node, scopeChain) { + if (singleExport) { + return false; + } + if (node.type === Syntax.VariableDeclaration) { + node.declarations.forEach(function (decl) { + if (!singleExport && decl.init && + decl.init.type === Syntax.AssignmentExpression) { + singleExport = handleAssignmentExpression( + decl.init, + scopeChain, + multipleExports + ); + } + }); + return false; + } + if (!isAssignmentStatement(node)) { + return false; + } + if (node.expression) { + singleExport = handleAssignmentExpression( + node.expression, + scopeChain, + multipleExports + ); + } + }); + + // NOT going to handle the f**ked up case where in the same file we have + // module.exports = A; exports.b = b; + if (singleExport) { + return singleExport; + } + + if (multipleExports.length === 1) { + return { + scopeChain: [], + definition: multipleExports[0].value + }; + } + + if (multipleExports.length > 0) { + // Synthesize an ObjectExpression union all exports + var properties = multipleExports.map(function(element) { + var key = element.key; + var value = element.value; + return { + type: Syntax.Property, + key: key, + value: value, + loc: { + start: { line: key.loc.start.line, column: key.loc.start.column }, + end: { line: value.loc.end.line, column: value.loc.end.column } + }, + range: [ key.range[0], value.range[1] ] + }; + }); + return { + scopeChain: [], + definition: { + isSynthesized: true, + type: Syntax.ObjectExpression, + properties: properties, + // Use the first export statement location + loc: properties[0].loc + } + }; + } + + return null; +}; + +module.exports = findExportDefinition; diff --git a/website/jsdocs/generic-function-visitor.js b/website/jsdocs/generic-function-visitor.js new file mode 100644 index 000000000..5262d3fb8 --- /dev/null +++ b/website/jsdocs/generic-function-visitor.js @@ -0,0 +1,534 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +/*global exports:true*/ +/*jslint node:true*/ +"use strict"; + +var util = require('util'); + +var Syntax = require('esprima-fb').Syntax; +var utils = require('jstransform/src/utils'); + +// Transforms +var meta = require('./meta'); +var type = require('./type'); + +var typeHintExp = /^\??[\w<>|:(),?]+$/; +var paramRe = /\*\s+@param\s+{?([^\s*{}.]+)}?(\s+([\w\$]+))?/g; +var returnRe = /\*\s+@return(s?)\s+{?([^\s*{}.]+)}?/; + +var nameToTransforms = { + 'sourcemeta': meta, + 'typechecks': type, +}; + +var excludes = []; + +function getTypeHintsFromDocBlock(node, docBlocksByLine) { + var comments = docBlocksByLine[node.loc.start.line - 1]; + if (!comments) { + return { + params: null, + returns: null + }; + } + + var params = []; + if (node.params) { + var paramNames = node.params.reduce(function(map, param) { + map[param.name] = true; + return map; + }, {}); + + var param; + while(param = paramRe.exec(comments.value)) { + + if (!param[1]) { + continue; + } + + var functionName = node.id + ? '`' + node.id.name + '\'' + : ''; + + if (!param[3]) { + throw new Error(util.format('Lines: %s-%s: Your @param declaration in' + + ' function %s is missing the parameter\'s name,' + + ' i.e. "@param {string} name"', + comments.loc.start.line, comments.loc.end.line, functionName)); + } + + // TODO(ostrulovich) if we're really nice, we should probably check edit + // distance and suggest the right name the user meant + if (!(param[3] in paramNames)) { + throw new Error(util.format('Lines: %s-%s: `%s\' is not a valid ' + + 'formal parameter of function %s. Must be one of: %s', + comments.loc.start.line, comments.loc.end.line, param[3], + functionName, Object.keys(paramNames).join(', '))); + } + + params.push([param[3], param[1]]); + } + } + var returnType = returnRe.exec(comments.value); + if (returnType && returnType[1]) { + throw new Error(util.format('Lines: %s-%s: Your @return declaration in' + + ' function %s is incorrectly written as @returns. Remove the trailing'+ + ' \'s\'.', + comments.loc.start.line, comments.loc.end.line, functionName)); + } + return { + params: params.length ? params : null, + returns: returnType ? returnType[2] : null + }; +} + +function getTypeHintFromInline(node, commentsByLine) { + var key = node.loc.start.column - 1; + var comments = commentsByLine[node.loc.start.line]; + if (!comments || !(key in comments)) { + return null; + } + // annotate the node + node.typeHint = comments[key].value; + return node.typeHint; +} + +/** + * Parses out comments from AST + * and populates commentsByLine and docBlocksByLine + */ +function parseComments(programNode, state) { + programNode.comments.forEach(function(c) { + if (c.type !== 'Block') return; + + var comments; + if (c.loc.start.line === c.loc.end.line && + typeHintExp.test(c.value)) { + // inline comments + comments = state.commentsByLine[c.loc.start.line] || + (state.commentsByLine[c.loc.start.line] = {}); + comments[c.loc.end.column] = c; + + comments = state.commentsByLine[c.loc.end.line] || + (state.commentsByLine[c.loc.start.line] = {}); + comments[c.loc.end.column] = c; + } else { + // docblocks + state.docBlocksByLine[c.loc.end.line] = c; + } + }); +} + +function getTypeHintParams(node, state) { + // First look for typehints in the docblock. + var typeHints = getTypeHintsFromDocBlock(node, state.docBlocksByLine); + + // If not found, look inline. + if (!typeHints.params && node.params) { + typeHints.params = node.params.map(function(param, index) { + return [param.name, getTypeHintFromInline(param, state.commentsByLine)]; + }).filter(function(param) { + return param[1]; + }); + } + if (!typeHints.returns) { + typeHints.returns = getTypeHintFromInline(node.body, state.commentsByLine); + } + + return typeHints; +} + +/** + * Get parameters needed for the dynamic typehint checks. + */ +function normalizeTypeHintParams(node, state, typeHints) { + var preCond = []; + if (typeHints.params.length > 0) { + typeHints.params.forEach(function(typeHint) { + if (typeHint[1]) { + preCond.push([ + typeHint[0], + '\''+ type.parseAndNormalize(typeHint[1], typeHint[0], node) +'\'', + '\''+ typeHint[0] +'\'' + ]); + } + }); + } + + var postCond = null; + if (typeHints.returns) { + postCond = type.parseAndNormalize(typeHints.returns, 'return', node); + } + + // If static-only, then we don't need to pass the type hint + // params since we're not going to do any dynamic checking. + var pragmas = utils.getDocblock(state); + if ('static-only' in pragmas) { + return null; + } + + var typeHintParams = {}; + if (preCond.length > 0) { + typeHintParams.params = preCond; + } + if (postCond) { + typeHintParams.returns = postCond; + } + return (preCond.length || postCond) ? typeHintParams : null; +} + +/** + * Takes in all the various params on the function in the docblock or inline + * comments and converts them into the format the bodyWrapper transform is + * expecting. If there are no params needed, returns null. + * + * For example, for a docblock like so + * @param {string} x + * @param {number} y + * @return {number} + * the resulting params object would contain + * { + * params: [ [ 'x', 'number' ], [ 'y', 'number' ] ], + * returns: 'number' + * } + * + * However the bodyWrapper transform expects input like + * { + * params: + * [ [ 'x', '\'number\'', '\'x\'' ], + * [ 'y', '\'number\'', '\'y\'' ] ], + * returns: 'number' + * } + */ +function formatBodyParams(node, state, params) /*?object*/ { + return normalizeTypeHintParams(node, state, params); +} + +/** + * Takes in all the various params on the function in the docblock or inline + * comments and converts them into the format the annotator transform is + * expecting. If there are no params needed, returns null. + * + * For example, for a docblock like so + * @param {string} x + * @param {number} y + * @return {number} + * the resulting params object would contain + * { + * params: [ [ 'x', 'number' ], [ 'y', 'number' ] ], + * returns: 'number' + * } + * + * However the bodyWrapper transform expects input like + * { + * params: [ 'number', 'number' ], + * returns: 'number' + * } + */ +function formatAnnotatorParams(params) /*?object*/ { + if ((!params.params || params.params.length === 0) && !params.returns) { + return null; + } + var annotatorParams = {}; + if (params.params && params.params.length > 0) { + var paramTypes = []; + params.params.forEach(function(paramArray) { + paramTypes.push(paramArray[1]); + }); + annotatorParams.params = paramTypes; + } + + if (params.returns) { + annotatorParams.returns = params.returns; + } + + return annotatorParams; +} + +/** + * Function used for determining how the params will be inlined + * into the function transform. We can't just use utils.format + * with %j because the way the data is stored in params vs + * formatted is different. + */ +function renderParams(/*?object*/ params) /*string*/ { + if (params == null) { + return null; + } + + var formattedParams = []; + if (params.params && params.params.length > 0) { + var preCond = params.params; + var joined = preCond.map(function(cond) { + return '[' + cond.join(', ') + ']'; + }).join(', '); + var paramString = '\"params\":' + '[' + joined + ']'; + formattedParams.push(paramString); + } + + if (params.returns) { + var returnParam = '\"returns\":' + '\'' + params.returns + '\''; + formattedParams.push(returnParam); + } + return "{" + formattedParams.join(',') + "}"; +} + +function getModuleName(state) { + var docblock = utils.getDocblock(state); + return docblock.providesModule || docblock.providesLegacy; +} + +function getFunctionMetadata(node, state) { + var funcMeta = { + module: getModuleName(state), + line: node.loc.start.line, + column: node.loc.start.column, + name: node.id && node.id.name + }; + if (!funcMeta.name) { + delete funcMeta.name; + } + return funcMeta; +} + +function getNameToTransforms() { + var filtered = {}; + Object.keys(nameToTransforms).forEach(function(name) { + if (excludes.indexOf(name) == -1) { + filtered[name] = nameToTransforms[name]; + } + }); + return filtered; +} + +/** + * Returns true if there are any transforms that would want to modify the + * current source. Usually we can rule out some transforms because the top + * pragma may say @nosourcemeta or there isn't a @typechecks. This function is + * used to rule out sources where no transform applies. + * + * @param {object} state + * @param {object} pragmas + * @return {bool} + */ +function shouldTraverseFile(state, pragmas) { + var t = false; + var nameToTransforms = getNameToTransforms(); + Object.keys(nameToTransforms).forEach(function(value) { + var transform = nameToTransforms[value]; + t = t || transform.shouldTraverseFile(state, pragmas); + }); + return t; +} + +/** + * Collects all the necessary information from the docblock and inline comments + * that may be useful to a transform. Currently only the type transform has + * information like @param and @return or the inline comments. + */ +function getAllParams(node, state) { + if (type.shouldTransformFile(state, utils.getDocblock(state))) { + return getTypeHintParams(node, state); + } + return {}; +} + +/** + * Returns an array of transforms that return true when shouldTransformFile is + * called. + */ +function getTransformsForFile(state, pragmas) { + var transforms = []; + var nameToTransforms = getNameToTransforms(); + Object.keys(nameToTransforms).forEach(function(value) { + var transform = nameToTransforms[value]; + if (transform.shouldTransformFile(state, pragmas)) { + transforms.push(transform); + } + }); + return transforms; +} + +/** + * Returns an array of trasnforms that return true when + * shouldTransformFunction is called. + */ +function getTransformsForFunction(transformsForFile, node, state, pragmas, + params) { + var transforms = []; + transformsForFile.forEach(function(transform) { + if (transform.shouldTransformFunction(node, state, pragmas, params)) { + transforms.push(transform); + } + }); + return transforms; +} + +/** + * This function will perform any checks over the JS source that doesn't + * require injecting in source code. For example the typechecks transform + * has a mode called static-only that does not add any extra code. + */ +function processStaticOnly(node, state) { + var pragmas = utils.getDocblock(state); + if (pragmas.typechecks === 'static-only') { + var params = getTypeHintParams(node, state); + normalizeTypeHintParams(node, state, params); + } +} + +function shouldWrapBody(transformsForFile) { + var t = false; + transformsForFile.forEach(function(transform) { + t = t || transform.wrapsBody(); + }); + return t; +} + +function shouldAnnotate(transformsForFile) { + var t = false; + transformsForFile.forEach(function(transform) { + t = t || transform.annotates(); + }); + return t; +} + +/** + * Gets the trailing arguments string that should be appended to + * __annotator(foo, + * and does not include a semicolon. + */ +function getTrailingAnnotatorArguments(funcMeta, annotatorParams) { + if (annotatorParams === null) { + return util.format(', %j)', funcMeta); + } + return util.format(', %j, %j)', funcMeta, annotatorParams); +} + +/** + * This is the main entry point into the generic function transforming. + */ +function genericFunctionTransformer(traverse, node, path, state) { + // The typechecks transform has a static-only mode that doesn't actually + // perform a transform but validates the types. + processStaticOnly(node, state, params); + + var params = getAllParams(node, state); + var transformsForFile = getTransformsForFile(state, utils.getDocblock(state)); + var transformsForFunction = + getTransformsForFunction( + transformsForFile, + node, + state, + utils.getDocblock(state), + params + ); + + if (transformsForFunction.length === 0) { + traverse(node.body, path, state); + return; + } + + var wrapBody = shouldWrapBody(transformsForFunction); + var annotate = shouldAnnotate(transformsForFunction); + + // There are two different objects containing the params for the wrapper + // vs annotator because the type param information only makes sense inside + // the body wrapper like [x, 'number', 'x']. During execution the body wrapper + // will be passed the correct values whereas during the annotator the + // arguments don't exist yet. + var bodyParams = wrapBody ? formatBodyParams(node, state, params) : null; + var annotatorParams = annotate ? formatAnnotatorParams(params) : null; + var funcMeta = getFunctionMetadata(node, state); + + // If there are no params to pass to the body, then don't wrap the + // body function. + wrapBody = wrapBody && bodyParams !== null; + var renderedBodyParams = renderParams(bodyParams); + + if (node.type === Syntax.FunctionExpression && annotate) { + utils.append('__annotator(', state); + } + + // Enter function body. + utils.catchup(node.body.range[0] + 1, state); + + // Insert a function that wraps the function body. + if (wrapBody) { + utils.append( + 'return __bodyWrapper(this, arguments, function() {', + state + ); + } + + // Recurse down into the child. + traverse(node.body, path, state); + // Move the cursor to the end of the function body. + utils.catchup(node.body.range[1] - 1, state); + + // Close the inserted function. + if (wrapBody) { + utils.append(util.format('}, %s);', renderedBodyParams), state); + } + + // Write the closing } of the function. + utils.catchup(node.range[1], state); + + if (!annotate) { + return; + } + + if (node.type === Syntax.FunctionExpression) { + utils.append( + getTrailingAnnotatorArguments(funcMeta, annotatorParams), + state + ); + } else if (node.type === Syntax.FunctionDeclaration) { + utils.append( + util.format( + '__annotator(%s', + node.id.name + ) + getTrailingAnnotatorArguments(funcMeta, annotatorParams) + ';', + state + ); + } +} + +function visitFunction(traverse, node, path, state) { + if (node.type === Syntax.Program) { + state.docBlocksByLine = {}; + state.commentsByLine = {}; + parseComments(node, state); + return; + } + + genericFunctionTransformer(traverse, node, path, state); + return false; +} +visitFunction.test = function(node, path, state) { + var pragmas = utils.getDocblock(state); + if (!shouldTraverseFile(state, pragmas)) { + return false; + } + + switch (node.type) { + case Syntax.Program: + case Syntax.FunctionExpression: + case Syntax.FunctionDeclaration: + return true; + default: + return false; + } +}; + +function setExcludes(excl) { + excludes = excl; +} + +exports.visitorList = [visitFunction]; +exports.setExcludes = setExcludes; +exports.formatAnnotatorParams = formatAnnotatorParams; +exports.getTrailingAnnotatorArguments = getTrailingAnnotatorArguments; +exports.getTypeHintsFromDocBlock = getTypeHintsFromDocBlock; +exports.getTypeHintFromInline = getTypeHintFromInline; diff --git a/website/jsdocs/jsdocs.js b/website/jsdocs/jsdocs.js new file mode 100644 index 000000000..1e65fcf25 --- /dev/null +++ b/website/jsdocs/jsdocs.js @@ -0,0 +1,519 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +/*jslint node: true */ +"use strict"; + +var esprima = require('esprima'); +var fs = require('fs'); +var Syntax = esprima.Syntax; + +var findExportDefinition = require('./findExportDefinition'); +var genericTransform = require('./generic-function-visitor'); +var genericVisitor = genericTransform.visitorList[0]; +var traverseFlat = require('./traverseFlat') +var parseTypehint = require('./TypeExpressionParser').parse; + +// Don't save object properties source code that is longer than this +var MAX_PROPERTY_SOURCE_LENGTH = 1000; + +function invariant(condition, message) { + if (!condition) { + throw new Error(message); + } +} + +/** + * If the expression is an identifier, it is resolved in the scope chain. + * If it is an assignment expression, it resolves to the right hand side. + * + * In all other cases the expression itself is returned. + * + * Since the scope chain constructed by the traverse function is very simple + * (it doesn't take into account *changes* to the variable through assignment + * statements), this function doesn't return the correct value in every + * situation. But it's good enough for how it is used in the parser. + * + * @param {object} expr + * @param {array} scopeChain + * + * @return {object} + */ +function resolveToValue(expr, scopeChain) { + switch (expr.type) { + case Syntax.AssignmentExpression: + if (expr.operator === '=') { + return resolveToValue(expr.right, scopeChain); + } + break; + case Syntax.Identifier: + var value; + scopeChain.some(function(scope, i) { + if (hasOwnProperty.call(scope, expr.name) && scope[expr.name]) { + value = resolveToValue(scope[expr.name], scopeChain.slice(i)); + return true; + } + }); + return value; + } + return expr; +} + +/** + * Strips the "static upstream" warning from the docblock. + * + * @param {?string} docblock + * @return {?string} + */ +function stripStaticUpstreamWarning(docblock) { + if (!docblock) { + return docblock; + } + // Esprima strips out the starting and ending tokens, so add them back + docblock = "/*" + docblock + "*/\n"; + return docblock; +} + +/** + * Parse a typehint, but swallow any errors. + */ +function safeParseTypehint(typehint) { + if (!typehint) { + return null; + } + try { + return JSON.stringify(parseTypehint(typehint)); + } catch (e) { + return null; + } +} + +/** + * Gets the docblock for the file + * + * @param {array} commentsForFile + * @return {?string} + */ +function getFileDocBlock(commentsForFile) { + var docblock; + commentsForFile.some(function(comment, i) { + if (comment.loc.start.line === 1) { + var lines = comment.value.split("\n"); + var filteredLines = lines.filter(function(line) { + var hasCopyright = !!line.match(/^\s*\*\s+Copyright/); + var hasProvides = !!line.match(/^\s*\*\s+@provides/); + return !hasCopyright && !hasProvides; + }); + docblock = filteredLines.join("\n"); + return true; + } + }); + return stripStaticUpstreamWarning(docblock); +} + +/** + * Gets the docblock for a given node. + * + * @param {object} Node to get docblock for + * @param {array} commentsForFile + * @param {array} linesForFile + * @return {?string} + */ +function getDocBlock(node, commentsForFile, linesForFile) { + if (node.isSynthesized === true) { + return ''; + } + var docblock; + var prevLine = node.loc.start.line - 1; + // skip blank lines + while (linesForFile[prevLine - 1].trim() === '') { + prevLine--; + } + + commentsForFile.some(function(comment, i) { + if (comment.loc.end.line === prevLine) { + if (comment.type === 'Line') { + // Don't accept line comments that are separated + if (prevLine !== node.loc.start.line - 1) { + return true; + } + var line = prevLine; + docblock = ''; + for (var ii = i; ii >= 0; ii--) { + var lineComment = commentsForFile[ii]; + if (lineComment.loc.end.line === line) { + docblock = '//' + lineComment.value + + (docblock ? "\n" + docblock : ""); + line--; + } else { + break; + } + } + } else { + docblock = stripStaticUpstreamWarning(comment.value); + } + return true; + } + }); + return docblock; +} + +/** + * Given the comments for a file, return the module name (by looking for + * @providesModule). + * + * @param {array} + * @return {?string} + */ +function getModuleName(commentsForFile) { + var moduleName; + commentsForFile.forEach(function(comment) { + if (comment.type === 'Block') { + var matches = comment.value.match(/@providesModule\s+(\S*)/); + if (matches && matches[1]) { + moduleName = matches[1]; + } + } + }); + return moduleName; +} + +/** + * Esprima includes the leading colon (and possibly spaces) as part of the + * typehint, so we have to strip those out. + */ +function sanitizeTypehint(string) { + for (var i = 0; i < string.length; i++) { + if (string[i] != ' ' && string[i] != ':') { + return string.substring(i); + } + } + return null; +} + +/** + * @param {object} node + * @param {object} state + * @param {string} source + * @param {array} commentsForFile + * @param {array} linesForFile + * @return {object} + */ +function getFunctionData(node, state, source, commentsForFile, linesForFile) { + var params = []; + var typechecks = commentsForFile.typechecks; + var typehintsFromBlock = null; + if (typechecks) { + // esprima has trouble with some params so ignore them (e.g. $__0) + if (!node.params.some(function(param) { return !param.name; })) { + try { + typehintsFromBlock = genericTransform.getTypeHintsFromDocBlock( + node, + state.docBlocksByLine + ); + } catch (e) { + } + } + } + node.params.forEach(function(param) { + // TODO: Handle other things like Syntax.ObjectPattern + if (param.type === Syntax.Identifier) { + var typehint; + if (typehintsFromBlock && typehintsFromBlock.params) { + typehintsFromBlock.params.some(function(paramTypehint) { + if (paramTypehint[0] === param.name) { + typehint = paramTypehint[1]; + return true; + } + }); + } + if (!typehint && typechecks) { + try { + typehint = genericTransform.getTypeHintFromInline( + param, + state.commentsByLine + ); + } catch (e) { + } + } + params.push({ + typehint: safeParseTypehint(typehint), + name: param.name + }); + } else if (param.type === Syntax.TypeAnnotatedIdentifier) { + params.push({ + typehint: sanitizeTypehint(source.substring( + param.annotation.range[0], + param.annotation.range[1] + )), + name: param.id.name + }); + } + }); + var returnTypehint = null; + if (node.returnType) { + returnTypehint = sanitizeTypehint(source.substring( + node.returnType.range[0], + node.returnType.range[1] + )); + } else if (typehintsFromBlock) { + returnTypehint = typehintsFromBlock.returns; + } + return { + line: node.loc.start.line, + source: source.substring.apply(source, node.range), + docblock: getDocBlock(node, commentsForFile, linesForFile), + modifiers: [], + params: params, + returntypehint: safeParseTypehint(returnTypehint) + }; +} + +/** + * @param {object} node + * @param {object} state + * @param {string} source + * @param {array} commentsForFile + * @param {array} linesForFile + * @return {object} + */ +function getObjectData(node, state, source, scopeChain, + commentsForFile, linesForFile) { + var methods = []; + var properties = []; + var superClass = null; + node.properties.forEach(function(property) { + if (property.type === Syntax.SpreadProperty) { + if (property.argument.type === Syntax.Identifier) { + superClass = property.argument.name; + } + return; + } + + switch (property.value.type) { + case Syntax.FunctionExpression: + var methodData = getFunctionData(property.value, state, source, + commentsForFile, linesForFile); + methodData.name = property.key.name || property.key.value; + methodData.source = source.substring.apply(source, property.range); + methodData.modifiers.push('static'); + methods.push(methodData); + break; + case Syntax.Identifier: + var expr = resolveToValue( + property.value, + scopeChain + ); + if (expr) { + if (expr.type === Syntax.FunctionDeclaration) { + var functionData = + getFunctionData(expr, state, source, commentsForFile, linesForFile); + functionData.name = property.key.name || property.key.value; + functionData.modifiers.push('static'); + methods.push(functionData); + break; + } else { + property.value = expr; + } + } + /* falls through */ + default: + var propertySource = ''; + var valueRange = property.value.range; + if (valueRange[1] - valueRange[0] < MAX_PROPERTY_SOURCE_LENGTH) { + propertySource = source.substring.apply(source, valueRange); + } + var docBlock = getDocBlock(property, commentsForFile, linesForFile); + /* CodexVarDef: modifiers, type, name, default, docblock */ + var propertyData = [ + ['static'], + '', + // Cast to String because this can be a Number + // Could also be a String literal (e.g. "key") hence the value + String(property.key.name || property.key.value), + propertySource, + docBlock || '', + property.loc.start.line + ]; + properties.push(propertyData); + break; + } + }); + return { + methods: methods, + properties: properties, + superClass: superClass + }; +} + +/** + * @param {object} node + * @param {object} state + * @param {string} source + * @param {array} commentsForFile + * @param {array} linesForFile + * @return {object} + */ +function getClassData(node, state, source, commentsForFile, linesForFile) { + var methods = []; + invariant(node.body.type === Syntax.ClassBody, 'Expected ClassBody'); + node.body.body.forEach(function(bodyItem) { + if (bodyItem.type === Syntax.MethodDefinition) { + if (bodyItem.value.type === Syntax.FunctionExpression) { + var methodData = + getFunctionData(bodyItem.value, state, source, + commentsForFile, linesForFile); + methodData.name = bodyItem.key.name; + methodData.source = source.substring.apply(source, bodyItem.range); + if (bodyItem.static) { + methodData.modifiers.push('static'); + } + methods.push(methodData); + } + } + }); + var data = { + methods: methods + }; + if (node.superClass && node.superClass.type === Syntax.Identifier) { + data.superClass = node.superClass.name; + } + return data; +} + + +/** + * Finds all the requires + * + * @param {object} ast + * @return {array} + */ +function findRequires(ast) { + var requires = []; + traverseFlat(ast, function(node, scopeChain) { + var requireData = getRequireData(node); + if (requireData) { + requires.push(requireData); + } + return !requireData; + }); + return requires; +} + +/** + * If the given node is a 'require' statement, returns a list of following data + * { + * name: string + * } + * + * @return ?object + */ +function getRequireData(node) { + if (!node || node.type !== Syntax.CallExpression) { + return null; + } + + var callee = node.callee; + if (callee.type !== Syntax.Identifier + || (callee.name !== 'require')) { + return null; + } + var args = node['arguments']; + if (args.length === 0) { + return null; + } + var firstArgument = args[0]; + if (firstArgument.type !== Syntax.Literal) { + return null; + } + + return { + name: firstArgument.value + }; +} + +/** + * Given the source of a file, this returns the data about the module's exported + * value. + * + * @param {string} source + * @return {?object} data + */ +function parseSource(source) { + var lines = source.split("\n"); + var ast = esprima.parse(source, { + loc: true, + comment: true, + range: true, + sourceType: 'nonStrictModule', + }); + + /** + * This sets up genericTransform so that it can be queried above. + */ + var _state = { + g: { + source: source + } + }; + if (genericVisitor.test(ast, [], _state)) { + // HACK: Mark that this file has typechecks on the comments object. + ast.comments.typechecks = true; + // This fills out the data for genericTransform. + genericVisitor(function() {}, ast, [], _state); + } + var result = findExportDefinition(ast.body); + if (result) { + var definition = result.definition; + var scopeChain = result.scopeChain; + var data; + var moduleName = getModuleName(ast.comments); + if (!moduleName) { + return null; + } + if (definition.type === Syntax.NewExpression && + definition.callee.type === Syntax.Identifier) { + var name = definition.callee.name; + // If the class is defined in the scopeChain, export that instead. + scopeChain.some(function(scope) { + if (hasOwnProperty.call(scope, name) && + scope[name].type === Syntax.ClassDeclaration) { + definition = scope[name]; + return true; + } + }); + } + console.log(definition.type); + switch (definition.type) { + case Syntax.ClassDeclaration: + data = getClassData(definition, _state, source, ast.comments, lines); + data.type = 'class'; + break; + case Syntax.ObjectExpression: + data = getObjectData(definition, _state, source, scopeChain, + ast.comments, lines); + data.type = 'object'; + break; + case Syntax.FunctionDeclaration: + case Syntax.FunctionExpression: + data = getFunctionData(definition, _state, source, ast.comments, lines); + data.type = 'function'; + break; + default: + data = {type: 'module'}; + break; + } + if (data) { + data.line = definition.loc.start.line; + data.name = moduleName; + data.docblock = + getDocBlock(definition, ast.comments, lines) || + getFileDocBlock(ast.comments); + data.requires = findRequires(ast.body); + return data; + } + } + return null; +} + + +module.exports = parseSource; diff --git a/website/jsdocs/meta.js b/website/jsdocs/meta.js new file mode 100644 index 000000000..0cc92da3e --- /dev/null +++ b/website/jsdocs/meta.js @@ -0,0 +1,54 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +/*global exports:true*/ +/*jslint node:true*/ +"use strict"; + +var util = require('util'); + +var Syntax = require('esprima-fb').Syntax; +var utils = require('jstransform/src/utils'); + +// Top level file pragmas that must not exist for the meta transform to +// be applied. +var mustNotHave = [ + 'nosourcemeta', +]; + +function shouldTraverseFile(state, pragmas) { + if (state.g.sourcemeta === undefined) { + var notHaves = true; + mustNotHave.forEach(function (value) { + notHaves = notHaves && !(value in pragmas); + }); + state.g.sourcemeta = notHaves; + } + return state.g.sourcemeta; +} + +var shouldTransformFile = shouldTraverseFile; + +function shouldTransformFunction(node, state, pragmas, params) /*bool*/ { + if (!shouldTransformFile(state, pragmas)) { + throw new Error( + 'shouldTransformFunction should not be called if shouldTransformFile ' + + 'fails' + ); + } + return true; +} + +function wrapsBody() { + return false; +} + +function annotates() { + return true; +} + +exports.shouldTransformFile = shouldTransformFile; +exports.shouldTraverseFile = shouldTraverseFile; +exports.shouldTransformFunction = shouldTransformFunction; +exports.wrapsBody = wrapsBody; +exports.annotates = annotates; +exports.name = 'sourcemeta'; diff --git a/website/jsdocs/traverseFlat.js b/website/jsdocs/traverseFlat.js new file mode 100644 index 000000000..5d2390dca --- /dev/null +++ b/website/jsdocs/traverseFlat.js @@ -0,0 +1,97 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +/*global exports:true*/ +/*jslint node:true*/ +"use strict"; + +var Syntax = require('esprima-fb').Syntax; + +/** + * Executes visitor on the object and its children (recursively). + * While traversing the tree, a scope chain is built and passed to the visitor. + * + * If the visitor returns false, the object's children are not traversed. + * + * @param {object} object + * @param {function} visitor + * @param {?array} scopeChain + */ +function traverse(object, visitor, scopeChain) { + scopeChain = scopeChain || [{}]; + + var scope = scopeChain[0]; + + switch (object.type) { + case Syntax.VariableDeclaration: + object.declarations.forEach(function(decl) { + scope[decl.id.name] = decl.init; + }); + break; + case Syntax.ClassDeclaration: + scope[object.id.name] = object; + break; + case Syntax.FunctionDeclaration: + // A function declaration creates a symbol in the current scope + scope[object.id.name] = object; + /* falls through */ + case Syntax.FunctionExpression: + case Syntax.Program: + scopeChain = [{}].concat(scopeChain); + break; + } + + if (object.type === Syntax.FunctionExpression || + object.type === Syntax.FunctionDeclaration) { + // add parameters to the new scope + object.params.forEach(function(param) { + // since the value of the parameters are unknown during parsing time + // we set the value to `undefined`. + scopeChain[0][param.name] = undefined; + }); + } + + if (object.type) { + if (visitor.call(null, object, scopeChain) === false) { + return; + } + } + + for (var key in object) { + if (object.hasOwnProperty(key)) { + var child = object[key]; + if (typeof child === 'object' && child !== null) { + traverse(child, visitor, scopeChain); + } + } + } +} + +/** + * Executes visitor on the object and its children, but only traverses into + * children which can be statically analyzed and don't depend on runtime + * information. + * + * @param {object} object + * @param {function} visitor + * @param {?array} scopeChain + */ +function traverseFlat(object, visitor, scopeChain) { + traverse(object, function(node, scopeChain) { + switch (node.type) { + case Syntax.FunctionDeclaration: + case Syntax.FunctionExpression: + case Syntax.IfStatement: + case Syntax.WithStatement: + case Syntax.SwitchStatement: + case Syntax.TryStatement: + case Syntax.WhileStatement: + case Syntax.DoWhileStatement: + case Syntax.ForStatement: + case Syntax.ForInStatement: + return false; + } + return visitor(node, scopeChain); + }, scopeChain); +} + +module.exports = traverseFlat; diff --git a/website/jsdocs/type.js b/website/jsdocs/type.js new file mode 100644 index 000000000..bcfe0b531 --- /dev/null +++ b/website/jsdocs/type.js @@ -0,0 +1,79 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +/*global exports:true*/ +"use strict"; + +var util = require('util'); + +var Syntax = require('esprima-fb').Syntax; +var utils = require('jstransform/src/utils'); + +var parse = require('./TypeExpressionParser').parse; +var compile = require('./TypeExpressionParser').compile; +var normalize = require('./TypeExpressionParser').normalize; + +function parseAndNormalize(source, name, object) { + if (/\?$/.test(source)) { + source = '?' + source.substring(0, source.length - 1); + } + try { + var ast = parse(source); + return compile(normalize(ast)); + } catch (e) { + var functionName = object.id + ? '`' + object.id.name + '\'' + : ''; + throw new Error(util.format('The type `%s\' specified for %s for ' + + 'the function %s, on line %s, could not be parsed. The error given was: %s', + source, name, functionName, object.loc.start.line, e.message + )); + } +} + +function initializeSettings(state, pragmas) { + state.g.typechecks = 'typechecks' in pragmas; + state.g.staticOnly = pragmas.typechecks === 'static-only'; +} + +function shouldTraverseFile(state, pragmas) { + if (state.g.typechecks === undefined) { + initializeSettings(state, pragmas); + } + return state.g.typechecks; +} + +function shouldTransformFile(state, pragmas) { + if (state.g.typechecks === undefined) { + initializeSettings(state, pragmas); + } + return !state.g.staticOnly && state.g.typechecks; +} + +function shouldTransformFunction(node, state, pragmas, params) { + if (!shouldTransformFile(state, pragmas)) { + throw new Error( + 'shouldTransformFunction should not be called if shouldTransformFile ' + + 'fails' + ); + } + + return (params.params && params.params.length > 0) || + params.returns || + (node.id && /^[A-Z]/.test(node.id.name)); +} + +function wrapsBody() { + return true; +} + +function annotates() { + return true; +} + +exports.parseAndNormalize = parseAndNormalize; +exports.shouldTransformFile = shouldTransformFile; +exports.shouldTraverseFile = shouldTraverseFile; +exports.shouldTransformFunction = shouldTransformFunction; +exports.wrapsBody = wrapsBody; +exports.annotates = annotates; +exports.name = 'typechecks'; diff --git a/website/package.json b/website/package.json index b5580871c..32642915d 100644 --- a/website/package.json +++ b/website/package.json @@ -10,6 +10,9 @@ "glob": "*", "mkdirp": "*", "request": "*", - "fs.extra": "*" + "fs.extra": "*", + "esprima": "*", + "esprima-fb": "*", + "jstransform": "*" } } diff --git a/website/server/extractDocs.js b/website/server/extractDocs.js index 5a5456e43..c18b58dd4 100644 --- a/website/server/extractDocs.js +++ b/website/server/extractDocs.js @@ -2,6 +2,7 @@ var docs = require('../react-docgen'); var fs = require('fs'); var path = require('path'); var slugify = require('../core/slugify'); +var jsDocs = require('../jsdocs/jsdocs.js') function getNameFromPath(filepath) { var ext = null; @@ -11,7 +12,7 @@ function getNameFromPath(filepath) { return filepath; } -function docsToMarkdown(filepath, i) { +function componentsToMarkdown(filepath, i) { var json = docs.parse( fs.readFileSync(filepath), function(node, recast) { @@ -42,11 +43,15 @@ function docsToMarkdown(filepath, i) { var components = [ '../Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js', + '../Libraries/Components/DatePicker/DatePickerIOS.ios.js', '../Libraries/Text/ExpandingText.js', '../Libraries/Image/Image.ios.js', '../Libraries/Components/ListView/ListView.js', '../Libraries/Components/Navigation/NavigatorIOS.ios.js', '../Libraries/Components/ScrollView/ScrollView.js', + '../Libraries/Components/Slider/Slider.js', + '../Libraries/Components/SwitchIOS/SwitchIOS.ios.js', + '../Libraries/Components/TabBarIOS/TabBarIOS.ios.js', '../Libraries/Text/Text.js', '../Libraries/Components/TextInput/TextInput.ios.js', '../Libraries/Components/Touchable/TouchableHighlight.js', @@ -55,6 +60,16 @@ var components = [ '../Libraries/Components/View/View.js', ]; + +function apisToMarkdown(filepath, i) { + var json = jsDocs(fs.readFileSync(filepath).toString()); + console.log(JSON.stringify(json, null, 2)); +} + +var apis = [ + '../Libraries/AppRegistry/AppRegistry.js', +]; + module.exports = function() { - return components.map(docsToMarkdown); + return components.map(componentsToMarkdown); }; From fab5ec617d2198eddee5cfbd5f18a4ddaeb79e81 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Tue, 10 Mar 2015 19:11:28 -0700 Subject: [PATCH 26/79] Updates from Tue Mar 10 - [ReactNative] Make tests run on TravisCI | Alex Kotliarskyi - [Relay] Update Relay + ES6 class containers | Christoph Pojer - [React Native] Add RCTAdSupport.xcodeproj | Alexsander Akers - [ReactNative][Android] Fix after a new React version was downstreamed | Philipp von Weitershausen - [React Native] Add preliminary animation API | Alex Akers - [ReactKit] Create test for OSS ReactKit | Alex Kotliarskyi - [React Native][Device ID][wip] implement most basic js access | Alex Akers - [ReactNative] OSS Picker | Spencer Ahrens - [ReactNative] Fix typo in RCTUIManager | Tadeu Zagallo - [ReactNative] Fix GeoLocation files letter case | Tadeu Zagallo - Unified the method signature for addUIBlock: to further simplify porting ViewManagers | Nick Lockwood - [ReactNative] Oss GeoMap | Tadeu Zagallo - [ReactNative] OSS CameraRoll | Tadeu Zagallo - [ReactNative] allowLossyConversion on NSString->NSData conversion | Andrew Rasmussen - [React Native][RFC] Print __DEV__ value on app start | Alex Kotliarskyi --- .travis.yml | 10 +- Examples/2048/2048.xcodeproj/project.pbxproj | 357 ++++++++++++++++++ Examples/2048/AppDelegate.h | 9 + Examples/2048/AppDelegate.m | 44 +++ Examples/2048/Base.lproj/LaunchScreen.xib | 41 ++ Examples/2048/Game2048.js | 298 +++++++++++++++ Examples/2048/GameBoard.js | 189 ++++++++++ .../AppIcon.appiconset/Contents.json | 38 ++ Examples/2048/Info.plist | 38 ++ Examples/2048/main.m | 11 + Examples/Movies/AppDelegate.m | 2 +- Examples/TicTacToe/AppDelegate.m | 2 +- Examples/UIExplorer/AdSupportIOSExample.js | 73 ++++ Examples/UIExplorer/AppDelegate.m | 2 +- Examples/UIExplorer/CameraRollExample.ios.js | 115 ++++++ Examples/UIExplorer/CameraRollView.ios.js | 231 ++++++++++++ ...cationExample.js => GeolocationExample.js} | 2 +- Examples/UIExplorer/MapViewExample.js | 196 ++++++++++ Examples/UIExplorer/PickerExample.js | 113 ++++++ .../UIExplorer.xcodeproj/project.pbxproj | 164 +++++++- .../xcschemes/UIExplorer.xcscheme | 24 ++ Examples/UIExplorer/UIExplorerList.js | 6 +- .../UIExplorer/UIExplorerTests/Info.plist | 24 ++ .../UIExplorerTests/UIExplorerTests.m | 52 +++ Libraries/AdSupport/AdSupportIOS.js | 14 + Libraries/AdSupport/RCTAdSupport.h | 7 + Libraries/AdSupport/RCTAdSupport.m | 20 + .../RCTAdSupport.xcodeproj/project.pbxproj | 248 ++++++++++++ Libraries/Animation/Animation.js | 34 ++ Libraries/Animation/AnimationMixin.js | 45 +++ Libraries/Animation/AnimationUtils.js | 226 +++++++++++ Libraries/AppRegistry/AppRegistry.js | 8 +- Libraries/CameraRoll/CameraRoll.js | 149 ++++++++ Libraries/Components/MapView/MapView.js | 165 ++++++++ .../Components/Touchable/TouchableBounce.js | 124 ++++++ .../Geolocation.ios.js | 0 .../RCTGeolocation.xcodeproj/project.pbxproj | 0 .../RCTLocationObserver.h | 0 .../RCTLocationObserver.m | 0 Libraries/Image/RCTCameraRollManager.h | 7 + Libraries/Image/RCTCameraRollManager.m | 148 ++++++++ .../Image/RCTImage.xcodeproj/project.pbxproj | 12 + Libraries/Image/RCTImageLoader.h | 13 + Libraries/Image/RCTImageLoader.m | 98 +++++ Libraries/Image/RCTStaticImage.m | 2 +- Libraries/Image/RCTStaticImageManager.m | 15 + Libraries/Picker/PickerIOS.android.js | 10 + Libraries/Picker/PickerIOS.ios.js | 120 ++++++ Libraries/ReactIOS/ReactIOS.js | 1 + ...pplication.ios.js => renderApplication.js} | 0 Libraries/Utilities/groupByEveryN.js | 46 +++ Libraries/react-native/react-native.js | 4 + ReactKit/Base/RCTAssert.h | 4 +- ReactKit/Base/RCTConvert.h | 6 + ReactKit/Base/RCTConvert.m | 108 ++++-- ReactKit/Base/RCTUtils.m | 27 +- ReactKit/Modules/RCTAnimationManager.h | 9 + ReactKit/Modules/RCTAnimationManager.m | 203 ++++++++++ ReactKit/Modules/RCTUIManager.m | 7 +- ReactKit/ReactKit.xcodeproj/project.pbxproj | 84 +++-- ReactKit/Views/RCTMap.h | 24 ++ ReactKit/Views/RCTMap.m | 130 +++++++ ReactKit/Views/RCTMapManager.h | 7 + ReactKit/Views/RCTMapManager.m | 119 ++++++ ReactKit/Views/RCTPicker.h | 11 + ReactKit/Views/RCTPicker.m | 91 +++++ ReactKit/Views/RCTPickerManager.h | 7 + ReactKit/Views/RCTPickerManager.m | 28 ++ ReactKit/Views/RCTTextField.m | 9 +- ReactKit/Views/RCTTextFieldManager.m | 1 - package.json | 3 +- 71 files changed, 4353 insertions(+), 82 deletions(-) create mode 100644 Examples/2048/2048.xcodeproj/project.pbxproj create mode 100644 Examples/2048/AppDelegate.h create mode 100644 Examples/2048/AppDelegate.m create mode 100644 Examples/2048/Base.lproj/LaunchScreen.xib create mode 100644 Examples/2048/Game2048.js create mode 100644 Examples/2048/GameBoard.js create mode 100644 Examples/2048/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Examples/2048/Info.plist create mode 100644 Examples/2048/main.m create mode 100644 Examples/UIExplorer/AdSupportIOSExample.js create mode 100644 Examples/UIExplorer/CameraRollExample.ios.js create mode 100644 Examples/UIExplorer/CameraRollView.ios.js rename Examples/UIExplorer/{GeoLocationExample.js => GeolocationExample.js} (97%) create mode 100644 Examples/UIExplorer/MapViewExample.js create mode 100644 Examples/UIExplorer/PickerExample.js create mode 100644 Examples/UIExplorer/UIExplorerTests/Info.plist create mode 100644 Examples/UIExplorer/UIExplorerTests/UIExplorerTests.m create mode 100644 Libraries/AdSupport/AdSupportIOS.js create mode 100644 Libraries/AdSupport/RCTAdSupport.h create mode 100644 Libraries/AdSupport/RCTAdSupport.m create mode 100644 Libraries/AdSupport/RCTAdSupport.xcodeproj/project.pbxproj create mode 100644 Libraries/Animation/Animation.js create mode 100644 Libraries/Animation/AnimationMixin.js create mode 100644 Libraries/Animation/AnimationUtils.js create mode 100644 Libraries/CameraRoll/CameraRoll.js create mode 100644 Libraries/Components/MapView/MapView.js create mode 100644 Libraries/Components/Touchable/TouchableBounce.js rename Libraries/{GeoLocation => Geolocation}/Geolocation.ios.js (100%) rename Libraries/{GeoLocation => Geolocation}/RCTGeolocation.xcodeproj/project.pbxproj (100%) rename Libraries/{GeoLocation => Geolocation}/RCTLocationObserver.h (100%) rename Libraries/{GeoLocation => Geolocation}/RCTLocationObserver.m (100%) create mode 100644 Libraries/Image/RCTCameraRollManager.h create mode 100644 Libraries/Image/RCTCameraRollManager.m create mode 100644 Libraries/Image/RCTImageLoader.h create mode 100644 Libraries/Image/RCTImageLoader.m create mode 100644 Libraries/Picker/PickerIOS.android.js create mode 100644 Libraries/Picker/PickerIOS.ios.js rename Libraries/ReactIOS/{renderApplication.ios.js => renderApplication.js} (100%) create mode 100644 Libraries/Utilities/groupByEveryN.js create mode 100644 ReactKit/Modules/RCTAnimationManager.h create mode 100644 ReactKit/Modules/RCTAnimationManager.m create mode 100644 ReactKit/Views/RCTMap.h create mode 100644 ReactKit/Views/RCTMap.m create mode 100644 ReactKit/Views/RCTMapManager.h create mode 100644 ReactKit/Views/RCTMapManager.m create mode 100644 ReactKit/Views/RCTPicker.h create mode 100644 ReactKit/Views/RCTPicker.m create mode 100644 ReactKit/Views/RCTPickerManager.h create mode 100644 ReactKit/Views/RCTPickerManager.m diff --git a/.travis.yml b/.travis.yml index 6e5919de3..98aeb094f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,7 @@ -language: node_js -node_js: - - "0.10" +language: objective-c +xcode_project: Examples/UIExplorer/UIExplorer.xcodeproj +xcode_scheme: UIExplorer +xcode_sdk: iphonesimulator8.1 +install: + - npm install + - npm test diff --git a/Examples/2048/2048.xcodeproj/project.pbxproj b/Examples/2048/2048.xcodeproj/project.pbxproj new file mode 100644 index 000000000..256cd7aef --- /dev/null +++ b/Examples/2048/2048.xcodeproj/project.pbxproj @@ -0,0 +1,357 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; + 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; + 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; + 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; + 8323482C1A77B59500B55238 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832348291A77B50100B55238 /* libReactKit.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B5119B1A9E6C1200147676; + remoteInfo = RCTText; + }; + 832348281A77B50100B55238 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 834D32361A76971A00F38302 /* ReactKit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; + remoteInfo = ReactKit; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 13B07F961A680F5B00A75B9A /* 2048.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 2048.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; + 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; + 834D32361A76971A00F38302 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8323482C1A77B59500B55238 /* libReactKit.a in Frameworks */, + 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 13B07FAE1A68108700A75B9A /* 2048 */ = { + isa = PBXGroup; + children = ( + 13B07FAF1A68108700A75B9A /* AppDelegate.h */, + 13B07FB01A68108700A75B9A /* AppDelegate.m */, + 13B07FB51A68108700A75B9A /* Images.xcassets */, + 13B07FB61A68108700A75B9A /* Info.plist */, + 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, + 13B07FB71A68108700A75B9A /* main.m */, + ); + name = 2048; + sourceTree = ""; + }; + 832341AE1AAA6A7D00B99B32 /* Libraries */ = { + isa = PBXGroup; + children = ( + 834D32361A76971A00F38302 /* ReactKit.xcodeproj */, + 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, + ); + name = Libraries; + sourceTree = ""; + }; + 832341B11AAA6A8300B99B32 /* Products */ = { + isa = PBXGroup; + children = ( + 832341B51AAA6A8300B99B32 /* libRCTText.a */, + ); + name = Products; + sourceTree = ""; + }; + 832348241A77B50100B55238 /* Products */ = { + isa = PBXGroup; + children = ( + 832348291A77B50100B55238 /* libReactKit.a */, + ); + name = Products; + sourceTree = ""; + }; + 83CBB9F61A601CBA00E9B192 = { + isa = PBXGroup; + children = ( + 13B07FAE1A68108700A75B9A /* 2048 */, + 832341AE1AAA6A7D00B99B32 /* Libraries */, + 83CBBA001A601CBA00E9B192 /* Products */, + ); + sourceTree = ""; + }; + 83CBBA001A601CBA00E9B192 /* Products */ = { + isa = PBXGroup; + children = ( + 13B07F961A680F5B00A75B9A /* 2048.app */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 13B07F861A680F5B00A75B9A /* 2048 */ = { + isa = PBXNativeTarget; + buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "2048" */; + buildPhases = ( + 13B07F871A680F5B00A75B9A /* Sources */, + 13B07F8C1A680F5B00A75B9A /* Frameworks */, + 13B07F8E1A680F5B00A75B9A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = 2048; + productName = "Hello World"; + productReference = 13B07F961A680F5B00A75B9A /* 2048.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 83CBB9F71A601CBA00E9B192 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = Facebook; + }; + buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "2048" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 83CBB9F61A601CBA00E9B192; + productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; + ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; + }, + { + ProductGroup = 832348241A77B50100B55238 /* Products */; + ProjectRef = 834D32361A76971A00F38302 /* ReactKit.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 13B07F861A680F5B00A75B9A /* 2048 */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTText.a; + remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 832348291A77B50100B55238 /* libReactKit.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libReactKit.a; + remoteRef = 832348281A77B50100B55238 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 13B07F8E1A680F5B00A75B9A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, + 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 13B07F871A680F5B00A75B9A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, + 13B07FC11A68108700A75B9A /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + 13B07FB21A68108700A75B9A /* Base */, + ); + name = LaunchScreen.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 13B07F941A680F5B00A75B9A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = 2048; + }; + name = Debug; + }; + 13B07F951A680F5B00A75B9A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = 2048; + }; + name = Release; + }; + 83CBBA201A601CBA00E9B192 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 83CBBA211A601CBA00E9B192 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "2048" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 13B07F941A680F5B00A75B9A /* Debug */, + 13B07F951A680F5B00A75B9A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "2048" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 83CBBA201A601CBA00E9B192 /* Debug */, + 83CBBA211A601CBA00E9B192 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; +} diff --git a/Examples/2048/AppDelegate.h b/Examples/2048/AppDelegate.h new file mode 100644 index 000000000..062fb99c0 --- /dev/null +++ b/Examples/2048/AppDelegate.h @@ -0,0 +1,9 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface AppDelegate : UIResponder + +@property (nonatomic, strong) UIWindow *window; + +@end diff --git a/Examples/2048/AppDelegate.m b/Examples/2048/AppDelegate.m new file mode 100644 index 000000000..76172139c --- /dev/null +++ b/Examples/2048/AppDelegate.m @@ -0,0 +1,44 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "AppDelegate.h" + +#import "RCTRootView.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + NSURL *jsCodeLocation; + RCTRootView *rootView = [[RCTRootView alloc] init]; + + // Loading JavaScript code - uncomment the one you want. + + // OPTION 1 + // Load from development server. Start the server from the repository root: + // + // $ npm start + // + // To run on device, change `localhost` to the IP address of your computer, and make sure your computer and + // iOS device are on the same Wi-Fi network. + jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/2048/Game2048.includeRequire.runModule.bundle?dev=true"]; + + // OPTION 2 + // Load from pre-bundled file on disk. To re-generate the static bundle, run + // + // $ curl http://localhost:8081/Examples/2048/Game2048.includeRequire.runModule.bundle -o main.jsbundle + // + // and uncomment the next following line + // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; + + rootView.scriptURL = jsCodeLocation; + rootView.moduleName = @"Game2048"; + + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + UIViewController *rootViewController = [[UIViewController alloc] init]; + rootViewController.view = rootView; + self.window.rootViewController = rootViewController; + [self.window makeKeyAndVisible]; + return YES; +} + +@end diff --git a/Examples/2048/Base.lproj/LaunchScreen.xib b/Examples/2048/Base.lproj/LaunchScreen.xib new file mode 100644 index 000000000..351e21c59 --- /dev/null +++ b/Examples/2048/Base.lproj/LaunchScreen.xib @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/2048/Game2048.js b/Examples/2048/Game2048.js new file mode 100644 index 000000000..4337aee91 --- /dev/null +++ b/Examples/2048/Game2048.js @@ -0,0 +1,298 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule Game2048 + * @flow + */ +'use strict'; + +var React = require('react-native'); +var { + Animation, + AppRegistry, + StyleSheet, + Text, + View, +} = React; + +var GameBoard = require('./GameBoard'); +var TouchableBounce = require('TouchableBounce'); + +var BOARD_PADDING = 3; +var CELL_MARGIN = 4; +var CELL_SIZE = 60; + +var Cell = React.createClass({ + render: function() { + return ; + } +}); + +var Board = React.createClass({ + render() { + return ( + + + + + + {this.props.children} + + ); + } +}); + +var Tile = React.createClass({ + mixins: [Animation.Mixin], + + calculateOffset() { + var tile = this.props.tile; + + var pos = (i) => { + return BOARD_PADDING + (i * (CELL_SIZE + CELL_MARGIN * 2) + CELL_MARGIN); + }; + + var animationPosition = (i) => { + return pos(i) + (CELL_SIZE / 2); + }; + + var offset = { + top: pos(tile.toRow()), + left: pos(tile.toColumn()), + }; + + if (tile.isNew()) { + offset.opacity = 0; + } else { + var point = [ + animationPosition(tile.toColumn()), + animationPosition(tile.toRow()), + ]; + this.startAnimation('this', 100, 0, 'easeInOutQuad', {position: point}); + } + + return offset; + }, + + componentDidMount() { + setTimeout(() => { + this.startAnimation('this', 300, 0, 'easeInOutQuad', {scaleXY: [1, 1]}); + this.startAnimation('this', 100, 0, 'easeInOutQuad', {opacity: 1}); + }, 0); + }, + + render() { + var tile = this.props.tile; + + var tileStyles = [ + styles.tile, + styles['tile' + tile.value], + this.calculateOffset() + ]; + + var textStyles = [ + styles.value, + tile.value > 4 && styles.whiteText, + tile.value > 100 && styles.threeDigits, + tile.value > 1000 && styles.fourDigits, + ]; + + return ( + + {tile.value} + + ); + } +}); + +var GameEndOverlay = React.createClass({ + render() { + var board = this.props.board; + + if (!board.hasWon() && !board.hasLost()) { + return ; + } + + var message = board.hasWon() ? + 'Good Job!' : 'Game Over'; + + return ( + + {message} + + + Try Again? + + + + ); + } +}); + +var Game2048 = React.createClass({ + getInitialState() { + return { board: new GameBoard() }; + }, + + restartGame() { + this.setState(this.getInitialState()); + }, + + handleTouchStart(event) { + if (this.state.board.hasWon()) { + return; + } + + this.startX = event.nativeEvent.pageX; + this.startY = event.nativeEvent.pageY; + }, + + handleTouchEnd(event) { + if (this.state.board.hasWon()) { + return; + } + + var deltaX = event.nativeEvent.pageX - this.startX; + var deltaY = event.nativeEvent.pageY - this.startY; + + var direction = -1; + if (Math.abs(deltaX) > 3 * Math.abs(deltaY) && Math.abs(deltaX) > 30) { + direction = deltaX > 0 ? 2 : 0; + } else if (Math.abs(deltaY) > 3 * Math.abs(deltaX) && Math.abs(deltaY) > 30) { + direction = deltaY > 0 ? 3 : 1; + } + + if (direction !== -1) { + this.setState({board: this.state.board.move(direction)}); + } + }, + + render() { + var tiles = this.state.board.tiles + .filter((tile) => tile.value) + .map((tile) => ); + + return ( + + + {tiles} + + + + ); + } +}); + +var styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + }, + board: { + padding: BOARD_PADDING, + backgroundColor: '#bbaaaa', + borderRadius: 5, + }, + overlay: { + position: 'absolute', + top: 0, + bottom: 0, + left: 0, + right: 0, + backgroundColor: 'rgba(221, 221, 221, 0.5)', + flex: 1, + flexDirection: 'column', + justifyContent: 'center', + alignItems: 'center', + }, + overlayMessage: { + fontSize: 40, + marginBottom: 20, + }, + tryAgain: { + backgroundColor: '#887766', + padding: 20, + borderRadius: 5, + }, + tryAgainText: { + color: '#ffffff', + fontSize: 20, + fontWeight: 'bold', + }, + cell: { + width: CELL_SIZE, + height: CELL_SIZE, + borderRadius: 5, + backgroundColor: '#ddccbb', + margin: CELL_MARGIN, + }, + row: { + flexDirection: 'row', + }, + tile: { + position: 'absolute', + width: CELL_SIZE, + height: CELL_SIZE, + backgroundColor: '#ddccbb', + borderRadius: 5, + flex: 1, + justifyContent: 'center', + alignItems: 'center', + }, + value: { + fontSize: 24, + color: '#776666', + fontFamily: 'Verdana', + fontWeight: 'bold', + }, + tile2: { + backgroundColor: '#eeeeee', + }, + tile4: { + backgroundColor: '#eeeecc', + }, + tile8: { + backgroundColor: '#ffbb88', + }, + tile16: { + backgroundColor: '#ff9966', + }, + tile32: { + backgroundColor: '#ff7755', + }, + tile64: { + backgroundColor: '#ff5533', + }, + tile128: { + backgroundColor: '#eecc77', + }, + tile256: { + backgroundColor: '#eecc66', + }, + tile512: { + backgroundColor: '#eecc55', + }, + tile1024: { + backgroundColor: '#eecc33', + }, + tile2048: { + backgroundColor: '#eecc22', + }, + whiteText: { + color: '#ffffff', + }, + threeDigits: { + fontSize: 20, + }, + fourDigits: { + fontSize: 18, + }, +}); + +AppRegistry.registerComponent('Game2048', () => Game2048); + +module.exports = Game2048; diff --git a/Examples/2048/GameBoard.js b/Examples/2048/GameBoard.js new file mode 100644 index 000000000..8db899116 --- /dev/null +++ b/Examples/2048/GameBoard.js @@ -0,0 +1,189 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule GameBoard + */ +'use strict'; + +// NB: Taken straight from: https://github.com/IvanVergiliev/2048-react/blob/master/src/board.js +// with no modificiation except to format it for CommonJS and fix lint errors + +var rotateLeft = function (matrix) { + var rows = matrix.length; + var columns = matrix[0].length; + var res = []; + for (var row = 0; row < rows; ++row) { + res.push([]); + for (var column = 0; column < columns; ++column) { + res[row][column] = matrix[column][columns - row - 1]; + } + } + return res; +}; + +var Tile = function (value, row, column) { + this.value = value || 0; + this.row = row || -1; + this.column = column || -1; + this.oldRow = -1; + this.oldColumn = -1; + this.markForDeletion = false; + this.mergedInto = null; + this.id = Tile.id++; +}; + +Tile.id = 0; + +Tile.prototype.moveTo = function (row, column) { + this.oldRow = this.row; + this.oldColumn = this.column; + this.row = row; + this.column = column; +}; + +Tile.prototype.isNew = function () { + return this.oldRow === -1 && !this.mergedInto; +}; + +Tile.prototype.hasMoved = function () { + return (this.fromRow() !== -1 && (this.fromRow() !== this.toRow() || this.fromColumn() !== this.toColumn())) || + this.mergedInto; +}; + +Tile.prototype.fromRow = function () { + return this.mergedInto ? this.row : this.oldRow; +}; + +Tile.prototype.fromColumn = function () { + return this.mergedInto ? this.column : this.oldColumn; +}; + +Tile.prototype.toRow = function () { + return this.mergedInto ? this.mergedInto.row : this.row; +}; + +Tile.prototype.toColumn = function () { + return this.mergedInto ? this.mergedInto.column : this.column; +}; + +var Board = function () { + this.tiles = []; + this.cells = []; + for (var i = 0; i < Board.size; ++i) { + this.cells[i] = [this.addTile(), this.addTile(), this.addTile(), this.addTile()]; + } + this.addRandomTile(); + this.setPositions(); + this.won = false; +}; + +Board.prototype.addTile = function () { + var res = new Tile(); + Tile.apply(res, arguments); + this.tiles.push(res); + return res; +}; + +Board.size = 4; + +Board.prototype.moveLeft = function () { + var hasChanged = false; + for (var row = 0; row < Board.size; ++row) { + var currentRow = this.cells[row].filter(function (tile) { return tile.value !== 0; }); + var resultRow = []; + for (var target = 0; target < Board.size; ++target) { + var targetTile = currentRow.length ? currentRow.shift() : this.addTile(); + if (currentRow.length > 0 && currentRow[0].value === targetTile.value) { + var tile1 = targetTile; + targetTile = this.addTile(targetTile.value); + tile1.mergedInto = targetTile; + var tile2 = currentRow.shift(); + tile2.mergedInto = targetTile; + targetTile.value += tile2.value; + } + resultRow[target] = targetTile; + this.won |= (targetTile.value === 2048); + hasChanged |= (targetTile.value !== this.cells[row][target].value); + } + this.cells[row] = resultRow; + } + return hasChanged; +}; + +Board.prototype.setPositions = function () { + this.cells.forEach(function (row, rowIndex) { + row.forEach(function (tile, columnIndex) { + tile.oldRow = tile.row; + tile.oldColumn = tile.column; + tile.row = rowIndex; + tile.column = columnIndex; + tile.markForDeletion = false; + }); + }); +}; + +Board.fourProbability = 0.1; + +Board.prototype.addRandomTile = function () { + var emptyCells = []; + for (var r = 0; r < Board.size; ++r) { + for (var c = 0; c < Board.size; ++c) { + if (this.cells[r][c].value === 0) { + emptyCells.push({r: r, c: c}); + } + } + } + var index = Math.floor(Math.random() * emptyCells.length); + var cell = emptyCells[index]; + var newValue = Math.random() < Board.fourProbability ? 4 : 2; + this.cells[cell.r][cell.c] = this.addTile(newValue); +}; + +Board.prototype.move = function (direction) { + // 0 -> left, 1 -> up, 2 -> right, 3 -> down + this.clearOldTiles(); + for (var i = 0; i < direction; ++i) { + this.cells = rotateLeft(this.cells); + } + var hasChanged = this.moveLeft(); + for (var i = direction; i < 4; ++i) { + this.cells = rotateLeft(this.cells); + } + if (hasChanged) { + this.addRandomTile(); + } + this.setPositions(); + return this; +}; + +Board.prototype.clearOldTiles = function () { + this.tiles = this.tiles.filter(function (tile) { return tile.markForDeletion === false; }); + this.tiles.forEach(function (tile) { tile.markForDeletion = true; }); +}; + +Board.prototype.hasWon = function () { + return this.won; +}; + +Board.deltaX = [-1, 0, 1, 0]; +Board.deltaY = [0, -1, 0, 1]; + +Board.prototype.hasLost = function () { + var canMove = false; + for (var row = 0; row < Board.size; ++row) { + for (var column = 0; column < Board.size; ++column) { + canMove |= (this.cells[row][column].value === 0); + for (var dir = 0; dir < 4; ++dir) { + var newRow = row + Board.deltaX[dir]; + var newColumn = column + Board.deltaY[dir]; + if (newRow < 0 || newRow >= Board.size || newColumn < 0 || newColumn >= Board.size) { + continue; + } + canMove |= (this.cells[row][column].value === this.cells[newRow][newColumn].value); + } + } + } + return !canMove; +}; + +module.exports = Board; diff --git a/Examples/2048/Images.xcassets/AppIcon.appiconset/Contents.json b/Examples/2048/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..118c98f74 --- /dev/null +++ b/Examples/2048/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,38 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/2048/Info.plist b/Examples/2048/Info.plist new file mode 100644 index 000000000..1c298405a --- /dev/null +++ b/Examples/2048/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.facebook.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/2048/main.m b/Examples/2048/main.m new file mode 100644 index 000000000..a43b55738 --- /dev/null +++ b/Examples/2048/main.m @@ -0,0 +1,11 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/Examples/Movies/AppDelegate.m b/Examples/Movies/AppDelegate.m index c01fc2ca9..c53f8edc4 100644 --- a/Examples/Movies/AppDelegate.m +++ b/Examples/Movies/AppDelegate.m @@ -20,7 +20,7 @@ // // To run on device, change `localhost` to the IP address of your computer, and make sure your computer and // iOS device are on the same Wi-Fi network. - jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/Movies/MoviesApp.includeRequire.runModule.bundle"]; + jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/Movies/MoviesApp.includeRequire.runModule.bundle?dev=true"]; // OPTION 2 // Load from pre-bundled file on disk. To re-generate the static bundle, run diff --git a/Examples/TicTacToe/AppDelegate.m b/Examples/TicTacToe/AppDelegate.m index 52e682752..d2add4fac 100644 --- a/Examples/TicTacToe/AppDelegate.m +++ b/Examples/TicTacToe/AppDelegate.m @@ -20,7 +20,7 @@ // // To run on device, change `localhost` to the IP address of your computer, and make sure your computer and // iOS device are on the same Wi-Fi network. - jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/TicTacToe/TicTacToeApp.includeRequire.runModule.bundle"]; + jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/TicTacToe/TicTacToeApp.includeRequire.runModule.bundle?dev=true"]; // OPTION 2 // Load from pre-bundled file on disk. To re-generate the static bundle, run diff --git a/Examples/UIExplorer/AdSupportIOSExample.js b/Examples/UIExplorer/AdSupportIOSExample.js new file mode 100644 index 000000000..1da508fd9 --- /dev/null +++ b/Examples/UIExplorer/AdSupportIOSExample.js @@ -0,0 +1,73 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule AdSupportIOSExample + */ +/* eslint no-console: 0 */ +'use strict'; + +var AdSupportIOS = require('AdSupportIOS'); + +var React = require('react-native'); +var { + StyleSheet, + Text, + View, +} = React; + +exports.framework = 'React'; +exports.title = 'Advertising ID'; +exports.description = 'Example of using the ad support API.'; + +exports.examples = [ + { + title: 'Ad Support IOS', + render: function() { + return ; + }, + } +]; + +var AdSupportIOSExample = React.createClass({ + getInitialState: function() { + return { + deviceID: 'No IDFA yet', + }; + }, + + componentDidMount: function() { + AdSupportIOS.getAdvertisingId( + this._onSuccess, + this._onFailure + ); + }, + + _onSuccess: function(deviceID) { + this.setState({ + 'deviceID': deviceID, + }); + }, + + _onFailure: function(e) { + this.setState({ + 'deviceID': 'Error!', + }); + }, + + render: function() { + return ( + + + Advertising ID: + {JSON.stringify(this.state.deviceID)} + + + ); + } +}); + +var styles = StyleSheet.create({ + title: { + fontWeight: 'bold', + }, +}); diff --git a/Examples/UIExplorer/AppDelegate.m b/Examples/UIExplorer/AppDelegate.m index a3fdbd629..b280f1357 100644 --- a/Examples/UIExplorer/AppDelegate.m +++ b/Examples/UIExplorer/AppDelegate.m @@ -20,7 +20,7 @@ // // To run on device, change `localhost` to the IP address of your computer, and make sure your computer and // iOS device are on the same Wi-Fi network. - jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/UIExplorer/UIExplorerApp.includeRequire.runModule.bundle"]; + jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/UIExplorer/UIExplorerApp.includeRequire.runModule.bundle?dev=true"]; // OPTION 2 // Load from pre-bundled file on disk. To re-generate the static bundle, run diff --git a/Examples/UIExplorer/CameraRollExample.ios.js b/Examples/UIExplorer/CameraRollExample.ios.js new file mode 100644 index 000000000..8037f536f --- /dev/null +++ b/Examples/UIExplorer/CameraRollExample.ios.js @@ -0,0 +1,115 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule CameraRollExample + */ +'use strict'; + +var React = require('react-native'); +var { + CameraRoll, + Image, + Slider, + StyleSheet, + SwitchIOS, + Text, + View, +} = React; + +var CameraRollView = require('./CameraRollView.ios'); + +var CAMERA_ROLL_VIEW = 'camera_roll_view'; + +var CameraRollExample = React.createClass({ + + getInitialState() { + return { + groupTypes: 'SavedPhotos', + sliderValue: 1, + bigImages: true, + }; + }, + + render() { + return ( + + + {(this.state.bigImages ? 'Big' : 'Small') + ' Images'} + + {'Group Type: ' + this.state.groupTypes} + + + ); + }, + + _renderImage(asset) { + var imageSize = this.state.bigImages ? 150 : 75; + var imageStyle = [styles.image, {width: imageSize, height: imageSize}]; + var location = asset.node.location.longitude ? + JSON.stringify(asset.node.location) : 'Unknown location'; + return ( + + + + {asset.node.image.uri} + {location} + {asset.node.group_name} + {new Date(asset.node.timestamp).toString()} + + + ); + }, + + _onSliderChange(value) { + var options = CameraRoll.GroupTypesOptions; + var index = Math.floor(value * options.length * 0.99); + var groupTypes = options[index]; + if (groupTypes !== this.state.groupTypes) { + this.setState({groupTypes: groupTypes}); + } + }, + + _onSwitchChange(value) { + this.refs[CAMERA_ROLL_VIEW].rendererChanged(); + this.setState({ bigImages: value }); + } +}); + +var styles = StyleSheet.create({ + row: { + flexDirection: 'row', + flex: 1, + }, + url: { + fontSize: 9, + marginBottom: 14, + }, + image: { + margin: 4, + }, + info: { + flex: 1, + }, +}); + +exports.title = ''; +exports.description = 'Example component that uses CameraRoll to list user\'s photos'; +exports.examples = [ + { + title: 'Photos', + render() { return ; } + } +]; diff --git a/Examples/UIExplorer/CameraRollView.ios.js b/Examples/UIExplorer/CameraRollView.ios.js new file mode 100644 index 000000000..f0ee92afc --- /dev/null +++ b/Examples/UIExplorer/CameraRollView.ios.js @@ -0,0 +1,231 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule CameraRollView + */ +'use strict'; + +var React = require('react-native'); +var { + ActivityIndicatorIOS, + CameraRoll, + Image, + ListView, + ListViewDataSource, + StyleSheet, + View, +} = React; + +var groupByEveryN = require('groupByEveryN'); +var logError = require('logError'); + +var propTypes = { + /** + * The group where the photos will be fetched from. Possible + * values are 'Album', 'All', 'Event', 'Faces', 'Library', 'PhotoStream' + * and SavedPhotos. + */ + groupTypes: React.PropTypes.oneOf([ + 'Album', + 'All', + 'Event', + 'Faces', + 'Library', + 'PhotoStream', + 'SavedPhotos', + ]), + + /** + * Number of images that will be fetched in one page. + */ + batchSize: React.PropTypes.number, + + /** + * A function that takes a single image as a parameter and renders it. + */ + renderImage: React.PropTypes.func, + + /** + * imagesPerRow: Number of images to be shown in each row. + */ + imagesPerRow: React.PropTypes.number, +}; + +var CameraRollView = React.createClass({ + propTypes: propTypes, + + getDefaultProps: function() { + return { + groupTypes: 'SavedPhotos', + batchSize: 5, + imagesPerRow: 1, + renderImage: function(asset) { + var imageSize = 150; + var imageStyle = [styles.image, {width: imageSize, height: imageSize}]; + return ( + + ); + }, + }; + }, + + getInitialState: function() { + var ds = new ListViewDataSource({rowHasChanged: this._rowHasChanged}); + + return { + assets: [], + groupTypes: this.props.groupTypes, + lastCursor: null, + noMore: false, + loadingMore: false, + dataSource: ds, + }; + }, + + /** + * This should be called when the image renderer is changed to tell the + * component to re-render its assets. + */ + rendererChanged: function() { + var ds = new ListViewDataSource({rowHasChanged: this._rowHasChanged}); + this.state.dataSource = ds.cloneWithRows( + groupByEveryN(this.state.assets, this.props.imagesPerRow) + ); + }, + + componentDidMount: function() { + this.fetch(); + }, + + componentWillReceiveProps: function(nextProps) { + if (this.props.groupTypes !== nextProps.groupTypes) { + this.fetch(true); + } + }, + + _fetch: function(clear) { + if (clear) { + this.setState(this.getInitialState(), this.fetch); + return; + } + + var fetchParams = { + first: this.props.batchSize, + groupTypes: this.props.groupTypes, + }; + if (this.state.lastCursor) { + fetchParams.after = this.state.lastCursor; + } + + CameraRoll.getPhotos(fetchParams, this._appendAssets, logError); + }, + + /** + * Fetches more images from the camera roll. If clear is set to true, it will + * set the component to its initial state and re-fetch the images. + */ + fetch: function(clear) { + if (!this.state.loadingMore) { + this.setState({loadingMore: true}, () => { this._fetch(clear); }); + } + }, + + render: function() { + return ( + + ); + }, + + _rowHasChanged: function(r1, r2) { + if (r1.length !== r2.length) { + return true; + } + + for (var i = 0; i < r1.length; i++) { + if (r1[i] !== r2[i]) { + return true; + } + } + + return false; + }, + + _renderFooterSpinner: function() { + if (!this.state.noMore) { + return ; + } + return null; + }, + + // rowData is an array of images + _renderRow: function(rowData, sectionID, rowID) { + var images = rowData.map((image) => { + if (image === null) { + return null; + } + return this.props.renderImage(image); + }); + + return ( + + {images} + + ); + }, + + _appendAssets: function(data) { + var assets = data.edges; + var newState = { loadingMore: false }; + + if (!data.page_info.has_next_page) { + newState.noMore = true; + } + + if (assets.length > 0) { + newState.lastCursor = data.page_info.end_cursor; + newState.assets = this.state.assets.concat(assets); + newState.dataSource = this.state.dataSource.cloneWithRows( + groupByEveryN(newState.assets, this.props.imagesPerRow) + ); + } + + this.setState(newState); + }, + + _onEndReached: function() { + if (!this.state.noMore) { + this.fetch(); + } + }, +}); + +var styles = StyleSheet.create({ + row: { + flexDirection: 'row', + flex: 1, + }, + url: { + fontSize: 9, + marginBottom: 14, + }, + image: { + margin: 4, + }, + info: { + flex: 1, + }, + container: { + flex: 1, + }, +}); + +module.exports = CameraRollView; diff --git a/Examples/UIExplorer/GeoLocationExample.js b/Examples/UIExplorer/GeolocationExample.js similarity index 97% rename from Examples/UIExplorer/GeoLocationExample.js rename to Examples/UIExplorer/GeolocationExample.js index 561808149..fac3dd205 100644 --- a/Examples/UIExplorer/GeoLocationExample.js +++ b/Examples/UIExplorer/GeolocationExample.js @@ -1,7 +1,7 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. * - * @providesModule GeoLocationExample + * @providesModule GeolocationExample */ /* eslint no-console: 0 */ 'use strict'; diff --git a/Examples/UIExplorer/MapViewExample.js b/Examples/UIExplorer/MapViewExample.js new file mode 100644 index 000000000..2094624be --- /dev/null +++ b/Examples/UIExplorer/MapViewExample.js @@ -0,0 +1,196 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule MapViewExample + */ +'use strict'; + +var React = require('react-native'); +var StyleSheet = require('StyleSheet'); +var { + MapView, + Text, + TextInput, + View, +} = React; + +var MapRegionInput = React.createClass({ + + propTypes: { + region: React.PropTypes.shape({ + latitude: React.PropTypes.number, + longitude: React.PropTypes.number, + latitudeDelta: React.PropTypes.number, + longitudeDelta: React.PropTypes.number, + }), + onChange: React.PropTypes.func.isRequired, + }, + + getInitialState: function() { + return { + latitude: 0, + longitude: 0, + latitudeDelta: 0, + longitudeDelta: 0, + }; + }, + + componentWillReceiveProps: function(nextProps) { + this.setState(nextProps.region); + }, + + render: function() { + var region = this.state; + return ( + + + + {'Latitude'} + + + + + + {'Longitude'} + + + + + + {'Latitude delta'} + + + + + + {'Longitude delta'} + + + + + + {'Change'} + + + + ); + }, + + _onChangeLatitude: function(e) { + this.setState({latitude: parseFloat(e.nativeEvent.text)}); + }, + + _onChangeLongitude: function(e) { + this.setState({longitude: parseFloat(e.nativeEvent.text)}); + }, + + _onChangeLatitudeDelta: function(e) { + this.setState({latitudeDelta: parseFloat(e.nativeEvent.text)}); + }, + + _onChangeLongitudeDelta: function(e) { + this.setState({longitudeDelta: parseFloat(e.nativeEvent.text)}); + }, + + _change: function() { + this.props.onChange(this.state); + }, + +}); + +var MapViewExample = React.createClass({ + + getInitialState() { + return { + mapRegion: null, + mapRegionInput: null, + }; + }, + + render() { + return ( + + + + + ); + }, + + _onRegionChanged(region) { + this.setState({mapRegionInput: region}); + }, + + _onRegionInputChanged(region) { + this.setState({ + mapRegion: region, + mapRegionInput: region, + }); + }, + +}); + +var styles = StyleSheet.create({ + map: { + height: 150, + margin: 10, + borderWidth: 1, + borderColor: '#000000', + }, + row: { + flexDirection: 'row', + justifyContent: 'space-between', + }, + textInput: { + width: 150, + height: 20, + borderWidth: 0.5, + borderColor: '#aaaaaa', + fontSize: 13, + padding: 4, + }, + changeButton: { + alignSelf: 'center', + marginTop: 5, + padding: 3, + borderWidth: 0.5, + borderColor: '#777777', + }, +}); + +exports.title = ''; +exports.description = 'Base component to display maps'; +exports.examples = [ + { + title: 'Map', + render() { return ; } + }, + { + title: 'Map shows user location', + render() { + return ; + } + } +]; diff --git a/Examples/UIExplorer/PickerExample.js b/Examples/UIExplorer/PickerExample.js new file mode 100644 index 000000000..3a77fa74d --- /dev/null +++ b/Examples/UIExplorer/PickerExample.js @@ -0,0 +1,113 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule PickerExample + */ +'use strict'; + +var React = require('react-native'); +var { + PickerIOS, + Text, + View, +} = React; + +var PickerItemIOS = PickerIOS.Item; + +var CAR_MAKES_AND_MODELS = { + amc: { + name: 'AMC', + models: ['AMX', 'Concord', 'Eagle', 'Gremlin', 'Matador', 'Pacer'], + }, + alfa: { + name: 'Alfa-Romeo', + models: ['159', '4C', 'Alfasud', 'Brera', 'GTV6', 'Giulia', 'MiTo', 'Spider'], + }, + aston: { + name: 'Aston Martin', + models: ['DB5', 'DB9', 'DBS', 'Rapide', 'Vanquish', 'Vantage'], + }, + audi: { + name: 'Audi', + models: ['90', '4000', '5000', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'Q5', 'Q7'], + }, + austin: { + name: 'Austin', + models: ['America', 'Maestro', 'Maxi', 'Mini', 'Montego', 'Princess'], + }, + borgward: { + name: 'Borgward', + models: ['Hansa', 'Isabella', 'P100'], + }, + buick: { + name: 'Buick', + models: ['Electra', 'LaCrosse', 'LeSabre', 'Park Avenue', 'Regal', + 'Roadmaster', 'Skylark'], + }, + cadillac: { + name: 'Cadillac', + models: ['Catera', 'Cimarron', 'Eldorado', 'Fleetwood', 'Sedan de Ville'], + }, + chevrolet: { + name: 'Chevrolet', + models: ['Astro', 'Aveo', 'Bel Air', 'Captiva', 'Cavalier', 'Chevelle', + 'Corvair', 'Corvette', 'Cruze', 'Nova', 'SS', 'Vega', 'Volt'], + }, +}; + +var PickerExample = React.createClass({ + getInitialState: function() { + return { + carMake: 'cadillac', + modelIndex: 3, + }; + }, + + render: function() { + var make = CAR_MAKES_AND_MODELS[this.state.carMake]; + var selectionString = make.name + ' ' + make.models[this.state.modelIndex]; + return ( + + Please choose a make for your car: + this.setState({carMake, modelIndex: 0})}> + {Object.keys(CAR_MAKES_AND_MODELS).map((carMake) => ( + + ) + )} + + Please choose a model of {make.name}: + this.setState({modelIndex})}> + {CAR_MAKES_AND_MODELS[this.state.carMake].models.map( + (modelName, modelIndex) => ( + + )) + } + + You selected: {selectionString} + + ); + }, +}); + +exports.title = ''; +exports.description = 'Render lists of selectable options with UIPickerView.'; +exports.examples = [ +{ + title: '', + render: function() { + return ; + }, +}]; diff --git a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj index ea13d28e3..d9a201502 100644 --- a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj +++ b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 004D28A31AAF61C70097A701 /* UIExplorerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 004D28A21AAF61C70097A701 /* UIExplorerTests.m */; }; 13417FE91AA91432003F314A /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FE81AA91428003F314A /* libRCTImage.a */; }; 134180011AA9153C003F314A /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FEF1AA914B8003F314A /* libRCTText.a */; }; 134180021AA9153C003F314A /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FFF1AA91531003F314A /* libReactKit.a */; }; @@ -16,9 +17,17 @@ 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 832C81C71AAF73C5007FA2F7 /* libRCTAdSupport.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832C81A61AAF6EFF007FA2F7 /* libRCTAdSupport.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 004D28A41AAF61C70097A701 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 13B07F861A680F5B00A75B9A; + remoteInfo = UIExplorer; + }; 13417FE71AA91428003F314A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 13417FE31AA91428003F314A /* RCTImage.xcodeproj */; @@ -54,9 +63,19 @@ remoteGlobalIDString = 134814201AA4EA6300B7C361; remoteInfo = RCTGeolocation; }; + 832C81A51AAF6EFF007FA2F7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 832C81A11AAF6EFE007FA2F7 /* RCTAdSupport.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; + remoteInfo = RCTAdSupport; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 004D289E1AAF61C70097A701 /* UIExplorerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UIExplorerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 004D28A11AAF61C70097A701 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 004D28A21AAF61C70097A701 /* UIExplorerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UIExplorerTests.m; sourceTree = ""; }; 13417FE31AA91428003F314A /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = ../../Libraries/Image/RCTImage.xcodeproj; sourceTree = ""; }; 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; 13417FFA1AA91531003F314A /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = ""; }; @@ -69,13 +88,22 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 832C81A11AAF6EFE007FA2F7 /* RCTAdSupport.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAdSupport.xcodeproj; path = ../../Libraries/AdSupport/RCTAdSupport.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 004D289B1AAF61C70097A701 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 832C81C71AAF73C5007FA2F7 /* libRCTAdSupport.a in Frameworks */, 134A8A2A1AACED7A00945AAE /* libRCTGeolocation.a in Frameworks */, 1341802C1AA9178B003F314A /* libRCTNetwork.a in Frameworks */, 134180011AA9153C003F314A /* libRCTText.a in Frameworks */, @@ -87,14 +115,32 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 004D289F1AAF61C70097A701 /* UIExplorerTests */ = { + isa = PBXGroup; + children = ( + 004D28A21AAF61C70097A701 /* UIExplorerTests.m */, + 004D28A01AAF61C70097A701 /* Supporting Files */, + ); + path = UIExplorerTests; + sourceTree = ""; + }; + 004D28A01AAF61C70097A701 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 004D28A11AAF61C70097A701 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; 1316A21D1AA397F400C0188E /* Libraries */ = { isa = PBXGroup; children = ( - 134A8A201AACED6A00945AAE /* RCTGeolocation.xcodeproj */, 13417FFA1AA91531003F314A /* ReactKit.xcodeproj */, + 832C81A11AAF6EFE007FA2F7 /* RCTAdSupport.xcodeproj */, + 134A8A201AACED6A00945AAE /* RCTGeolocation.xcodeproj */, + 13417FE31AA91428003F314A /* RCTImage.xcodeproj */, 134180261AA91779003F314A /* RCTNetwork.xcodeproj */, 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */, - 13417FE31AA91428003F314A /* RCTImage.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -152,11 +198,20 @@ name = UIExplorer; sourceTree = ""; }; + 832C81A21AAF6EFE007FA2F7 /* Products */ = { + isa = PBXGroup; + children = ( + 832C81A61AAF6EFF007FA2F7 /* libRCTAdSupport.a */, + ); + name = Products; + sourceTree = ""; + }; 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( 13B07FAE1A68108700A75B9A /* UIExplorer */, 1316A21D1AA397F400C0188E /* Libraries */, + 004D289F1AAF61C70097A701 /* UIExplorerTests */, 83CBBA001A601CBA00E9B192 /* Products */, ); sourceTree = ""; @@ -165,6 +220,7 @@ isa = PBXGroup; children = ( 13B07F961A680F5B00A75B9A /* UIExplorer.app */, + 004D289E1AAF61C70097A701 /* UIExplorerTests.xctest */, ); name = Products; sourceTree = ""; @@ -172,6 +228,24 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 004D289D1AAF61C70097A701 /* UIExplorerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 004D28AD1AAF61C70097A701 /* Build configuration list for PBXNativeTarget "UIExplorerTests" */; + buildPhases = ( + 004D289A1AAF61C70097A701 /* Sources */, + 004D289B1AAF61C70097A701 /* Frameworks */, + 004D289C1AAF61C70097A701 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 004D28A51AAF61C70097A701 /* PBXTargetDependency */, + ); + name = UIExplorerTests; + productName = UIExplorerTests; + productReference = 004D289E1AAF61C70097A701 /* UIExplorerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; 13B07F861A680F5B00A75B9A /* UIExplorer */ = { isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "UIExplorer" */; @@ -197,6 +271,12 @@ attributes = { LastUpgradeCheck = 0610; ORGANIZATIONNAME = Facebook; + TargetAttributes = { + 004D289D1AAF61C70097A701 = { + CreatedOnToolsVersion = 6.1.1; + TestTargetID = 13B07F861A680F5B00A75B9A; + }; + }; }; buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "UIExplorer" */; compatibilityVersion = "Xcode 3.2"; @@ -210,6 +290,10 @@ productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; projectDirPath = ""; projectReferences = ( + { + ProductGroup = 832C81A21AAF6EFE007FA2F7 /* Products */; + ProjectRef = 832C81A11AAF6EFE007FA2F7 /* RCTAdSupport.xcodeproj */; + }, { ProductGroup = 134A8A211AACED6A00945AAE /* Products */; ProjectRef = 134A8A201AACED6A00945AAE /* RCTGeolocation.xcodeproj */; @@ -234,6 +318,7 @@ projectRoot = ""; targets = ( 13B07F861A680F5B00A75B9A /* UIExplorer */, + 004D289D1AAF61C70097A701 /* UIExplorerTests */, ); }; /* End PBXProject section */ @@ -274,9 +359,23 @@ remoteRef = 134A8A241AACED6A00945AAE /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 832C81A61AAF6EFF007FA2F7 /* libRCTAdSupport.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTAdSupport.a; + remoteRef = 832C81A51AAF6EFF007FA2F7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ + 004D289C1AAF61C70097A701 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 13B07F8E1A680F5B00A75B9A /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -289,6 +388,14 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 004D289A1AAF61C70097A701 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 004D28A31AAF61C70097A701 /* UIExplorerTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 13B07F871A680F5B00A75B9A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -300,6 +407,14 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 004D28A51AAF61C70097A701 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 13B07F861A680F5B00A75B9A /* UIExplorer */; + targetProxy = 004D28A41AAF61C70097A701 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { isa = PBXVariantGroup; @@ -312,6 +427,42 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 004D28A61AAF61C70097A701 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = UIExplorerTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/UIExplorer.app/UIExplorer"; + }; + name = Debug; + }; + 004D28A71AAF61C70097A701 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = UIExplorerTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/UIExplorer.app/UIExplorer"; + }; + name = Release; + }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -435,6 +586,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 004D28AD1AAF61C70097A701 /* Build configuration list for PBXNativeTarget "UIExplorerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 004D28A61AAF61C70097A701 /* Debug */, + 004D28A71AAF61C70097A701 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "UIExplorer" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Examples/UIExplorer/UIExplorer.xcodeproj/xcshareddata/xcschemes/UIExplorer.xcscheme b/Examples/UIExplorer/UIExplorer.xcodeproj/xcshareddata/xcschemes/UIExplorer.xcscheme index 403b11e6f..2189d2d0e 100644 --- a/Examples/UIExplorer/UIExplorer.xcodeproj/xcshareddata/xcschemes/UIExplorer.xcscheme +++ b/Examples/UIExplorer/UIExplorer.xcodeproj/xcshareddata/xcschemes/UIExplorer.xcscheme @@ -20,6 +20,20 @@ ReferencedContainer = "container:UIExplorer.xcodeproj"> + + + + + + + + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.facebook.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Examples/UIExplorer/UIExplorerTests/UIExplorerTests.m b/Examples/UIExplorer/UIExplorerTests/UIExplorerTests.m new file mode 100644 index 000000000..1a7a70d78 --- /dev/null +++ b/Examples/UIExplorer/UIExplorerTests/UIExplorerTests.m @@ -0,0 +1,52 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import +#import + +#define TIMEOUT_SECONDS 30 + +@interface UIExplorerTests : XCTestCase + +@end + +@implementation UIExplorerTests + +- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test +{ + if (test(view)) { + return YES; + } + for (UIView *subview in [view subviews]) { + if ([self findSubviewInView:subview matching:test]) { + return YES; + } + } + return NO; +} + +- (void)testRootViewLoadsAndRenders { + UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; + + NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; + BOOL foundElement = NO; + + while ([date timeIntervalSinceNow] > 0 && !foundElement) { + [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:date]; + [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:date]; + + foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { + if ([view respondsToSelector:@selector(attributedText)]) { + NSString *text = [(id)view attributedText].string; + if ([text isEqualToString:@""]) { + return YES; + } + } + return NO; + }]; + } + + XCTAssertTrue(foundElement, @"Cound't find element with '' text in %d seconds", TIMEOUT_SECONDS); +} + + +@end diff --git a/Libraries/AdSupport/AdSupportIOS.js b/Libraries/AdSupport/AdSupportIOS.js new file mode 100644 index 000000000..598befd31 --- /dev/null +++ b/Libraries/AdSupport/AdSupportIOS.js @@ -0,0 +1,14 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule AdSupportIOS + */ +'use strict'; + +var AdSupport = require('NativeModules').RCTAdSupport; + +module.exports = { + getAdvertisingId: function(onSuccess, onFailure) { + AdSupport.getAdvertisingId(onSuccess, onFailure); + }, +}; diff --git a/Libraries/AdSupport/RCTAdSupport.h b/Libraries/AdSupport/RCTAdSupport.h new file mode 100644 index 000000000..2fbd3a8c0 --- /dev/null +++ b/Libraries/AdSupport/RCTAdSupport.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTBridgeModule.h" + +@interface RCTAdSupport : NSObject + +@end diff --git a/Libraries/AdSupport/RCTAdSupport.m b/Libraries/AdSupport/RCTAdSupport.m new file mode 100644 index 000000000..0cff24012 --- /dev/null +++ b/Libraries/AdSupport/RCTAdSupport.m @@ -0,0 +1,20 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTAdSupport.h" + +#import + +@implementation RCTAdSupport + +- (void)getAdvertisingId:(RCTResponseSenderBlock)callback withErrorCallback:(RCTResponseSenderBlock)errorCallback +{ + RCT_EXPORT(); + + if ([ASIdentifierManager class]) { + callback(@[[[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]]); + } else { + return errorCallback(@[@"as_identifier_unavailable"]); + } +} + +@end diff --git a/Libraries/AdSupport/RCTAdSupport.xcodeproj/project.pbxproj b/Libraries/AdSupport/RCTAdSupport.xcodeproj/project.pbxproj new file mode 100644 index 000000000..92576cd45 --- /dev/null +++ b/Libraries/AdSupport/RCTAdSupport.xcodeproj/project.pbxproj @@ -0,0 +1,248 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 832C819C1AAF6E1A007FA2F7 /* RCTAdSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 832C819B1AAF6E1A007FA2F7 /* RCTAdSupport.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 832C817E1AAF6DEF007FA2F7 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 832C81801AAF6DEF007FA2F7 /* libRCTAdSupport.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTAdSupport.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 832C819A1AAF6E1A007FA2F7 /* RCTAdSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAdSupport.h; sourceTree = ""; }; + 832C819B1AAF6E1A007FA2F7 /* RCTAdSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAdSupport.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 832C817D1AAF6DEF007FA2F7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 832C81771AAF6DEF007FA2F7 = { + isa = PBXGroup; + children = ( + 832C819A1AAF6E1A007FA2F7 /* RCTAdSupport.h */, + 832C819B1AAF6E1A007FA2F7 /* RCTAdSupport.m */, + 832C81811AAF6DEF007FA2F7 /* Products */, + ); + sourceTree = ""; + }; + 832C81811AAF6DEF007FA2F7 /* Products */ = { + isa = PBXGroup; + children = ( + 832C81801AAF6DEF007FA2F7 /* libRCTAdSupport.a */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 832C817F1AAF6DEF007FA2F7 /* RCTAdSupport */ = { + isa = PBXNativeTarget; + buildConfigurationList = 832C81941AAF6DF0007FA2F7 /* Build configuration list for PBXNativeTarget "RCTAdSupport" */; + buildPhases = ( + 832C817C1AAF6DEF007FA2F7 /* Sources */, + 832C817D1AAF6DEF007FA2F7 /* Frameworks */, + 832C817E1AAF6DEF007FA2F7 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RCTAdSupport; + productName = RCTAdSupport; + productReference = 832C81801AAF6DEF007FA2F7 /* libRCTAdSupport.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 832C81781AAF6DEF007FA2F7 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0620; + ORGANIZATIONNAME = Facebook; + TargetAttributes = { + 832C817F1AAF6DEF007FA2F7 = { + CreatedOnToolsVersion = 6.2; + }; + }; + }; + buildConfigurationList = 832C817B1AAF6DEF007FA2F7 /* Build configuration list for PBXProject "RCTAdSupport" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 832C81771AAF6DEF007FA2F7; + productRefGroup = 832C81811AAF6DEF007FA2F7 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 832C817F1AAF6DEF007FA2F7 /* RCTAdSupport */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 832C817C1AAF6DEF007FA2F7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 832C819C1AAF6E1A007FA2F7 /* RCTAdSupport.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 832C81921AAF6DF0007FA2F7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 832C81931AAF6DF0007FA2F7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 832C81951AAF6DF0007FA2F7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 832C81961AAF6DF0007FA2F7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 832C817B1AAF6DEF007FA2F7 /* Build configuration list for PBXProject "RCTAdSupport" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 832C81921AAF6DF0007FA2F7 /* Debug */, + 832C81931AAF6DF0007FA2F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 832C81941AAF6DF0007FA2F7 /* Build configuration list for PBXNativeTarget "RCTAdSupport" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 832C81951AAF6DF0007FA2F7 /* Debug */, + 832C81961AAF6DF0007FA2F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 832C81781AAF6DEF007FA2F7 /* Project object */; +} diff --git a/Libraries/Animation/Animation.js b/Libraries/Animation/Animation.js new file mode 100644 index 000000000..80029f148 --- /dev/null +++ b/Libraries/Animation/Animation.js @@ -0,0 +1,34 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule Animation + * @flow + */ +'use strict'; + +var { RCTAnimationManager } = require('NativeModules'); +var AnimationUtils = require('AnimationUtils'); + +type EasingFunction = (t: number) => number; + +var Animation = { + Mixin: require('AnimationMixin'), + + startAnimation: function( + node: any, + duration: number, + delay: number, + easing: (string | EasingFunction), + properties: {[key: string]: any} + ): number { + var nodeHandle = +node.getNodeHandle(); + var easingSample = AnimationUtils.evaluateEasingFunction(duration, easing); + RCTAnimationManager.startAnimation(nodeHandle, AnimationUtils.allocateTag(), duration, delay, easingSample, properties); + }, + + stopAnimation: function(tag) { + RCTAnimationManager.stopAnimation(tag); + }, +}; + +module.exports = Animation; diff --git a/Libraries/Animation/AnimationMixin.js b/Libraries/Animation/AnimationMixin.js new file mode 100644 index 000000000..ff29e2735 --- /dev/null +++ b/Libraries/Animation/AnimationMixin.js @@ -0,0 +1,45 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule AnimationMixin + * @flow + */ +'use strict'; + +var AnimationUtils = require('AnimationUtils'); +var { RCTAnimationManager } = require('NativeModules'); + +var invariant = require('invariant'); + +type EasingFunction = (t: number) => number; + +var AnimationMixin = { + getInitialState: function(): Object { + return {}; + }, + + startAnimation: function( + refKey: string, + duration: number, + delay: number, + easing: (string | EasingFunction), + properties: {[key: string]: any} + ): number { + var ref = this.refs[refKey]; + invariant( + ref, + 'Invalid refKey ' + refKey + '; ' + + 'valid refs: ' + JSON.stringify(Object.keys(this.refs)) + ); + + var nodeHandle = +ref.getNodeHandle(); + var easingSample = AnimationUtils.evaluateEasingFunction(duration, easing); + RCTAnimationManager.startAnimation(nodeHandle, AnimationUtils.allocateTag(), duration, delay, easingSample, properties); + }, + + stopAnimation: function(tag: number) { + RCTAnimationManager.stopAnimation(tag); + }, +}; + +module.exports = AnimationMixin; diff --git a/Libraries/Animation/AnimationUtils.js b/Libraries/Animation/AnimationUtils.js new file mode 100644 index 000000000..cf986abe8 --- /dev/null +++ b/Libraries/Animation/AnimationUtils.js @@ -0,0 +1,226 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule AnimationUtils + * @flow + */ +'use strict'; + +type EasingFunction = (t: number) => number; + +var b = 0, + c = 1, + d = 1; +var defaults = { + easeInQuad: function(t) { + return c * (t /= 1) * t + b; + }, + easeOutQuad: function(t) { + return -c * (t /= d) * (t - 2) + b; + }, + easeInOutQuad: function(t) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t + b; + } + return -c / 2 * ((--t) * (t - 2) - 1) + b; + }, + easeInCubic: function(t) { + return c * (t /= d) * t * t + b; + }, + easeOutCubic: function(t) { + return c * ((t = t / d - 1) * t * t + 1) + b; + }, + easeInOutCubic: function(t) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t + b; + } + return c / 2 * ((t -= 2) * t * t + 2) + b; + }, + easeInQuart: function(t) { + return c * (t /= d) * t * t * t + b; + }, + easeOutQuart: function(t) { + return -c * ((t = t / d - 1) * t * t * t - 1) + b; + }, + easeInOutQuart: function(t) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t * t + b; + } + return -c / 2 * ((t -= 2) * t * t * t - 2) + b; + }, + easeInQuint: function(t) { + return c * (t /= d) * t * t * t * t + b; + }, + easeOutQuint: function(t) { + return c * ((t = t / d - 1) * t * t * t * t + 1) + b; + }, + easeInOutQuint: function(t) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t * t * t + b; + } + return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; + }, + easeInSine: function(t) { + return -c * Math.cos(t / d * (Math.PI / 2)) + c + b; + }, + easeOutSine: function(t) { + return c * Math.sin(t / d * (Math.PI / 2)) + b; + }, + easeInOutSine: function(t) { + return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; + }, + easeInExpo: function(t) { + return (t === 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b; + }, + easeOutExpo: function(t) { + return (t === d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; + }, + easeInOutExpo: function(t) { + if (t === 0) { + return b; + } + if (t === d) { + return b + c; + } + if ((t /= d / 2) < 1) { + return c / 2 * Math.pow(2, 10 * (t - 1)) + b; + } + return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; + }, + easeInCirc: function(t) { + return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; + }, + easeOutCirc: function(t) { + return c * Math.sqrt(1 - (t = t / d - 1) * t) + b; + }, + easeInOutCirc: function(t) { + if ((t /= d / 2) < 1) { + return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; + } + return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; + }, + easeInElastic: function(t) { + var s = 1.70158; + var p = 0; + var a = c; + if (t === 0) { + return b; + } + if ((t /= d) === 1) { + return b + c; + } + if (!p) { + p = d * 0.3; + } + if (a < Math.abs(c)) { + a = c; + var s = p / 4; + } else { + var s = p / (2 * Math.PI) * Math.asin(c / a); + } + return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + }, + easeOutElastic: function(t) { + var s = 1.70158; + var p = 0; + var a = c; + if (t === 0) { + return b; + } + if ((t /= d) === 1) { + return b + c; + } + if (!p) { + p = d * 0.3; + } + if (a < Math.abs(c)) { + a = c; + var s = p / 4; + } else { + var s = p / (2 * Math.PI) * Math.asin(c / a); + } + return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b; + }, + easeInOutElastic: function(t) { + var s = 1.70158; + var p = 0; + var a = c; + if (t === 0) { + return b; + } + if ((t /= d / 2) === 2) { + return b + c; + } + if (!p) { + p = d * (0.3 * 1.5); + } + if (a < Math.abs(c)) { + a = c; + var s = p / 4; + } else { + var s = p / (2 * Math.PI) * Math.asin(c / a); + } + if (t < 1) { + return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + } + return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * 0.5 + c + b; + }, + easeInBack: function(t) { + var s = 1.70158; + return c * (t /= d) * t * ((s + 1) * t - s) + b; + }, + easeOutBack: function(t) { + var s = 1.70158; + return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; + }, + easeInOutBack: function(t) { + var s = 1.70158; + if ((t /= d / 2) < 1) { + return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b; + } + return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b; + }, + easeInBounce: function(t) { + return c - this.easeOutBounce(d - t) + b; + }, + easeOutBounce: function(t) { + if ((t /= d) < (1 / 2.75)) { + return c * (7.5625 * t * t) + b; + } else if (t < (2 / 2.75)) { + return c * (7.5625 * (t -= (1.5 / 2.75)) * t + 0.75) + b; + } else if (t < (2.5 / 2.75)) { + return c * (7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375) + b; + } else { + return c * (7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375) + b; + } + }, + easeInOutBounce: function(t) { + if (t < d / 2) { + return this.easeInBounce(t * 2) * 0.5 + b; + } + return this.easeOutBounce(t * 2 - d) * 0.5 + c * 0.5 + b; + }, +}; + +var ticksPerSecond = 60; +var lastUsedTag = 0; + +module.exports = { + allocateTag: function(): number { + return ++lastUsedTag; + }, + + evaluateEasingFunction: function(duration: number, easing: string | EasingFunction): Array { + if (typeof easing === 'string') { + easing = defaults[easing] || defaults.easeOutQuad; + } + + var tickCount = Math.round(duration * ticksPerSecond / 1000); + var sample = []; + for (var i = 0; i <= tickCount; i++) { + sample.push(easing(i / tickCount)); + } + + return sample; + }, +}; diff --git a/Libraries/AppRegistry/AppRegistry.js b/Libraries/AppRegistry/AppRegistry.js index a11f5d494..346bc302c 100644 --- a/Libraries/AppRegistry/AppRegistry.js +++ b/Libraries/AppRegistry/AppRegistry.js @@ -53,10 +53,12 @@ var AppRegistry = { runApplication: function(appKey, appParameters) { console.log( - 'Running application "' + appKey + '" with appParams: ', - appParameters + 'Running application "' + appKey + '" with appParams: ' + + JSON.stringify(appParameters) + '. ' + + '__DEV__ === ' + __DEV__ + + ', development-level warning are ' + (__DEV__ ? 'ON' : 'OFF') + + ', performance optimizations are ' + (__DEV__ ? 'OFF' : 'ON') ); - invariant( runnables[appKey] && runnables[appKey].run, 'Application ' + appKey + ' has not been registered.' diff --git a/Libraries/CameraRoll/CameraRoll.js b/Libraries/CameraRoll/CameraRoll.js new file mode 100644 index 000000000..54295fc52 --- /dev/null +++ b/Libraries/CameraRoll/CameraRoll.js @@ -0,0 +1,149 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule CameraRoll + */ +'use strict'; + +var ReactPropTypes = require('ReactPropTypes'); +var RKCameraRollManager = require('NativeModules').RKCameraRollManager; + +var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker'); +var deepFreezeAndThrowOnMutationInDev = + require('deepFreezeAndThrowOnMutationInDev'); +var invariant = require('invariant'); + +var GROUP_TYPES_OPTIONS = [ + 'Album', + 'All', + 'Event', + 'Faces', + 'Library', + 'PhotoStream', + 'SavedPhotos', // default +]; + +deepFreezeAndThrowOnMutationInDev(GROUP_TYPES_OPTIONS); + +/** + * Shape of the param arg for the `getPhotos` function. + */ +var getPhotosParamChecker = createStrictShapeTypeChecker({ + /** + * The number of photos wanted in reverse order of the photo application + * (i.e. most recent first for SavedPhotos). + */ + first: ReactPropTypes.number.isRequired, + + /** + * A cursor that matches `page_info { end_cursor }` returned from a previous + * call to `getPhotos` + */ + after: ReactPropTypes.string, + + /** + * Specifies which group types to filter the results to. + */ + groupTypes: ReactPropTypes.oneOf(GROUP_TYPES_OPTIONS), + + /** + * Specifies filter on group names, like 'Recent Photos' or custom album + * titles. + */ + groupName: ReactPropTypes.string, +}); + +/** + * Shape of the return value of the `getPhotos` function. + */ +var getPhotosReturnChecker = createStrictShapeTypeChecker({ + edges: ReactPropTypes.arrayOf(createStrictShapeTypeChecker({ + node: createStrictShapeTypeChecker({ + type: ReactPropTypes.string.isRequired, + group_name: ReactPropTypes.string.isRequired, + image: createStrictShapeTypeChecker({ + uri: ReactPropTypes.string.isRequired, + height: ReactPropTypes.number.isRequired, + width: ReactPropTypes.number.isRequired, + isStored: ReactPropTypes.bool, + }).isRequired, + timestamp: ReactPropTypes.number.isRequired, + location: createStrictShapeTypeChecker({ + latitude: ReactPropTypes.number, + longitude: ReactPropTypes.number, + altitude: ReactPropTypes.number, + heading: ReactPropTypes.number, + speed: ReactPropTypes.number, + }), + }).isRequired, + })).isRequired, + page_info: createStrictShapeTypeChecker({ + has_next_page: ReactPropTypes.bool.isRequired, + start_cursor: ReactPropTypes.string, + end_cursor: ReactPropTypes.string, + }).isRequired, +}); + +class CameraRoll { + /** + * Saves the image with tag `tag` to the camera roll. + * + * @param {string} tag - Can be any of the three kinds of tags we accept: + * 1. URL + * 2. assets-library tag + * 3. tag returned from storing an image in memory + */ + static saveImageWithTag(tag, successCallback, errorCallback) { + invariant( + typeof tag === 'string', + 'CameraRoll.saveImageWithTag tag must be a valid string.' + ); + RKCameraRollManager.saveImageWithTag( + tag, + (imageTag) => { + successCallback && successCallback(imageTag); + }, + (errorMessage) => { + errorCallback && errorCallback(errorMessage); + }); + } + + /** + * Invokes `callback` with photo identifier objects from the local camera + * roll of the device matching shape defined by `getPhotosReturnChecker`. + * + * @param {object} params - See `getPhotosParamChecker`. + * @param {function} callback - Invoked with arg of shape defined by + * `getPhotosReturnChecker` on success. + * @param {function} errorCallback - Invoked with error message on error. + */ + static getPhotos(params, callback, errorCallback) { + var metaCallback = callback; + if (__DEV__) { + getPhotosParamChecker({params}, 'params', 'CameraRoll.getPhotos'); + invariant( + typeof callback === 'function', + 'CameraRoll.getPhotos callback must be a valid function.' + ); + invariant( + typeof errorCallback === 'function', + 'CameraRoll.getPhotos errorCallback must be a valid function.' + ); + } + if (__DEV__) { + metaCallback = (response) => { + getPhotosReturnChecker( + {response}, + 'response', + 'CameraRoll.getPhotos callback' + ); + callback(response); + }; + } + RKCameraRollManager.getPhotos(params, metaCallback, errorCallback); + } +} + +CameraRoll.GroupTypesOptions = GROUP_TYPES_OPTIONS; + +module.exports = CameraRoll; diff --git a/Libraries/Components/MapView/MapView.js b/Libraries/Components/MapView/MapView.js new file mode 100644 index 000000000..105a80a31 --- /dev/null +++ b/Libraries/Components/MapView/MapView.js @@ -0,0 +1,165 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule MapView + */ +'use strict'; + +var EdgeInsetsPropType = require('EdgeInsetsPropType'); +var NativeMethodsMixin = require('NativeMethodsMixin'); +var React = require('React'); +var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); +var View = require('View'); + +var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass'); +var deepDiffer = require('deepDiffer'); +var insetsDiffer = require('insetsDiffer'); +var merge = require('merge'); + +var MapView = React.createClass({ + mixins: [NativeMethodsMixin], + + propTypes: { + /** + * Used to style and layout the `MapView`. See `StyleSheet.js` and + * `ViewStylePropTypes.js` for more info. + */ + style: View.propTypes.style, + + /** + * If `true` the app will ask for the user's location and focus on it. + * Default value is `false`. + * + * **NOTE**: You need to add NSLocationWhenInUseUsageDescription key in + * Info.plist to enable geolocation, otherwise it is going + * to *fail silently*! + */ + showsUserLocation: React.PropTypes.bool, + + /** + * If `false` the user won't be able to pinch/zoom the map. + * Default `value` is true. + */ + zoomEnabled: React.PropTypes.bool, + + /** + * When this property is set to `true` and a valid camera is associated with + * the map, the camera’s heading angle is used to rotate the plane of the + * map around its center point. When this property is set to `false`, the + * camera’s heading angle is ignored and the map is always oriented so + * that true north is situated at the top of the map view + */ + rotateEnabled: React.PropTypes.bool, + + /** + * When this property is set to `true` and a valid camera is associated + * with the map, the camera’s pitch angle is used to tilt the plane + * of the map. When this property is set to `false`, the camera’s pitch + * angle is ignored and the map is always displayed as if the user + * is looking straight down onto it. + */ + pitchEnabled: React.PropTypes.bool, + + /** + * If `false` the user won't be able to change the map region being displayed. + * Default value is `true`. + */ + scrollEnabled: React.PropTypes.bool, + + /** + * The region to be displayed by the map. + * + * The region is defined by the center coordinates and the span of + * coordinates to display. + */ + region: React.PropTypes.shape({ + /** + * Coordinates for the center of the map. + */ + latitude: React.PropTypes.number.isRequired, + longitude: React.PropTypes.number.isRequired, + + /** + * Distance between the minimun and the maximum latitude/longitude + * to be displayed. + */ + latitudeDelta: React.PropTypes.number.isRequired, + longitudeDelta: React.PropTypes.number.isRequired, + }), + + /** + * Maximum size of area that can be displayed. + */ + maxDelta: React.PropTypes.number, + + /** + * Minimum size of area that can be displayed. + */ + minDelta: React.PropTypes.number, + + /** + * Insets for the map's legal label, originally at bottom left of the map. + * See `EdgeInsetsPropType.js` for more information. + */ + legalLabelInsets: EdgeInsetsPropType, + + /** + * Callback that is called continuously when the user is dragging the map. + */ + onRegionChange: React.PropTypes.func, + + /** + * Callback that is called once, when the user is done moving the map. + */ + onRegionChangeComplete: React.PropTypes.func, + }, + + _onChange: function(event) { + if (event.nativeEvent.continuous) { + this.props.onRegionChange && + this.props.onRegionChange(event.nativeEvent.region); + } else { + this.props.onRegionChangeComplete && + this.props.onRegionChangeComplete(event.nativeEvent.region); + } + }, + + render: function() { + return ( + + ); + }, + +}); + +var RKMap = createReactIOSNativeComponentClass({ + validAttributes: merge( + ReactIOSViewAttributes.UIView, { + showsUserLocation: true, + zoomEnabled: true, + rotateEnabled: true, + pitchEnabled: true, + scrollEnabled: true, + region: {diff: deepDiffer}, + maxDelta: true, + minDelta: true, + legalLabelInsets: {diff: insetsDiffer}, + } + ), + uiViewClassName: 'RCTMap', +}); + +module.exports = MapView; diff --git a/Libraries/Components/Touchable/TouchableBounce.js b/Libraries/Components/Touchable/TouchableBounce.js new file mode 100644 index 000000000..2eb052fd8 --- /dev/null +++ b/Libraries/Components/Touchable/TouchableBounce.js @@ -0,0 +1,124 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule TouchableBounce + */ +'use strict'; + +var NativeMethodsMixin = require('NativeMethodsMixin'); +var React = require('React'); +var POPAnimation = require('POPAnimation'); +var Animation = require('Animation'); +var Touchable = require('Touchable'); + +var merge = require('merge'); +var copyProperties = require('copyProperties'); +var onlyChild = require('onlyChild'); + +/** + * When the scroll view is disabled, this defines how far your touch may move + * off of the button, before deactivating the button. Once deactivated, try + * moving it back and you'll see that the button is once again reactivated! + * Move it back and forth several times while the scroll view is disabled. + */ +var PRESS_RECT_OFFSET = {top: 20, left: 20, right: 20, bottom: 30}; +/** + * Example of using the `TouchableMixin` to play well with other responder + * locking views including `ScrollView`. `TouchableMixin` provides touchable + * hooks (`this.touchableHandle*`) that we forward events to. In turn, + * `TouchableMixin` expects us to implement some abstract methods to handle + * interesting interactions such as `handleTouchablePress`. + */ +var TouchableBounce = React.createClass({ + mixins: [Touchable.Mixin, NativeMethodsMixin], + + propTypes: { + onPress: React.PropTypes.func, + // The function passed takes a callback to start the animation which should + // be run after this onPress handler is done. You can use this (for example) + // to update UI before starting the animation. + onPressWithCompletion: React.PropTypes.func, + // the function passed is called after the animation is complete + onPressAnimationComplete: React.PropTypes.func, + }, + + getInitialState: function() { + return merge(this.touchableGetInitialState(), {animationID: null}); + }, + + bounceTo: function(value, velocity, bounciness, fromValue, callback) { + if (POPAnimation) { + this.state.animationID && this.removeAnimation(this.state.animationID); + var anim = { + property: POPAnimation.Properties.scaleXY, + dynamicsTension: 0, + toValue: [value, value], + velocity: [velocity, velocity], + springBounciness: bounciness, + }; + if (fromValue) { + anim.fromValue = [fromValue, fromValue]; + } + this.state.animationID = POPAnimation.createSpringAnimation(anim); + this.addAnimation(this.state.animationID, callback); + } else { + Animation.startAnimation(this, 300, 0, 'easeOutBack', {scaleXY: [value, value]}); + if (fromValue && typeof fromValue === 'function') { + callback = fromValue; + } + if (callback) { + setTimeout(callback, 300); + } + } + }, + + /** + * `Touchable.Mixin` self callbacks. The mixin will invoke these if they are + * defined on your component. + */ + touchableHandleActivePressIn: function() { + this.bounceTo(0.93, 0.1, 0); + }, + + touchableHandleActivePressOut: function() { + this.bounceTo(1, 0.4, 0); + }, + + touchableHandlePress: function() { + if (this.props.onPressWithCompletion) { + this.props.onPressWithCompletion( + this.bounceTo.bind(this, 1, 10, 10, 0.93, this.props.onPressAnimationComplete) + ); + return; + } + + this.bounceTo(1, 10, 10, undefined, this.props.onPressAnimationComplete); + this.props.onPress && this.props.onPress(); + }, + + touchableGetPressRectOffset: function() { + return PRESS_RECT_OFFSET; // Always make sure to predeclare a constant! + }, + + touchableGetHighlightDelayMS: function() { + return 0; + }, + + render: function() { + // Note(vjeux): use cloneWithProps once React has been upgraded + var child = onlyChild(this.props.children); + copyProperties(child.props, { + accessible: true, + testID: this.props.testID, + onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder, + onResponderTerminationRequest: this.touchableHandleResponderTerminationRequest, + onResponderGrant: this.touchableHandleResponderGrant, + onResponderMove: this.touchableHandleResponderMove, + onResponderRelease: this.touchableHandleResponderRelease, + onResponderTerminate: this.touchableHandleResponderTerminate + }); + return child; + } +}); + +module.exports = TouchableBounce; diff --git a/Libraries/GeoLocation/Geolocation.ios.js b/Libraries/Geolocation/Geolocation.ios.js similarity index 100% rename from Libraries/GeoLocation/Geolocation.ios.js rename to Libraries/Geolocation/Geolocation.ios.js diff --git a/Libraries/GeoLocation/RCTGeolocation.xcodeproj/project.pbxproj b/Libraries/Geolocation/RCTGeolocation.xcodeproj/project.pbxproj similarity index 100% rename from Libraries/GeoLocation/RCTGeolocation.xcodeproj/project.pbxproj rename to Libraries/Geolocation/RCTGeolocation.xcodeproj/project.pbxproj diff --git a/Libraries/GeoLocation/RCTLocationObserver.h b/Libraries/Geolocation/RCTLocationObserver.h similarity index 100% rename from Libraries/GeoLocation/RCTLocationObserver.h rename to Libraries/Geolocation/RCTLocationObserver.h diff --git a/Libraries/GeoLocation/RCTLocationObserver.m b/Libraries/Geolocation/RCTLocationObserver.m similarity index 100% rename from Libraries/GeoLocation/RCTLocationObserver.m rename to Libraries/Geolocation/RCTLocationObserver.m diff --git a/Libraries/Image/RCTCameraRollManager.h b/Libraries/Image/RCTCameraRollManager.h new file mode 100644 index 000000000..4a957d6a2 --- /dev/null +++ b/Libraries/Image/RCTCameraRollManager.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTBridgeModule.h" + +@interface RCTCameraRollManager : NSObject + +@end diff --git a/Libraries/Image/RCTCameraRollManager.m b/Libraries/Image/RCTCameraRollManager.m new file mode 100644 index 000000000..9f86ffb69 --- /dev/null +++ b/Libraries/Image/RCTCameraRollManager.m @@ -0,0 +1,148 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTCameraRollManager.h" + +#import +#import +#import +#import + + #import "RCTImageLoader.h" +#import "RCTLog.h" + +@implementation RCTCameraRollManager + +- (void)saveImageWithTag:(NSString *)imageTag successCallback:(RCTResponseSenderBlock)successCallback errorCallback:(RCTResponseSenderBlock)errorCallback +{ + RCT_EXPORT(); + + [RCTImageLoader loadImageWithTag:imageTag callback:^(NSError *loadError, UIImage *loadedImage) { + if (loadError) { + errorCallback(@[[loadError localizedDescription]]); + return; + } + [[RCTImageLoader assetsLibrary] writeImageToSavedPhotosAlbum:[loadedImage CGImage] metadata:nil completionBlock:^(NSURL *assetURL, NSError *saveError) { + if (saveError) { + NSString *errorMessage = [NSString stringWithFormat:@"Error saving cropped image: %@", saveError]; + RCTLogWarn(@"%@", errorMessage); + errorCallback(@[errorMessage]); + return; + } + successCallback(@[[assetURL absoluteString]]); + }]; + }]; +} + +- (void)callCallback:(RCTResponseSenderBlock)callback withAssets:(NSArray *)assets hasNextPage:(BOOL)hasNextPage +{ + if (![assets count]) { + callback(@[@{ + @"edges": assets, + @"page_info": @{ + @"has_next_page": @NO} + }]); + return; + } + callback(@[@{ + @"edges": assets, + @"page_info": @{ + @"start_cursor": assets[0][@"node"][@"image"][@"uri"], + @"end_cursor": assets[assets.count - 1][@"node"][@"image"][@"uri"], + @"has_next_page": @(hasNextPage)} + }]); +} + +- (void)getPhotos:(NSDictionary *)params callback:(RCTResponseSenderBlock)callback errorCallback:(RCTResponseSenderBlock)errorCallback +{ + RCT_EXPORT(); + + NSUInteger first = [params[@"first"] integerValue]; + NSString *afterCursor = params[@"after"]; + NSString *groupTypesStr = params[@"groupTypes"]; + NSString *groupName = params[@"groupName"]; + ALAssetsGroupType groupTypes; + if ([groupTypesStr isEqualToString:@"Album"]) { + groupTypes = ALAssetsGroupAlbum; + } else if ([groupTypesStr isEqualToString:@"All"]) { + groupTypes = ALAssetsGroupAll; + } else if ([groupTypesStr isEqualToString:@"Event"]) { + groupTypes = ALAssetsGroupEvent; + } else if ([groupTypesStr isEqualToString:@"Faces"]) { + groupTypes = ALAssetsGroupFaces; + } else if ([groupTypesStr isEqualToString:@"Library"]) { + groupTypes = ALAssetsGroupLibrary; + } else if ([groupTypesStr isEqualToString:@"PhotoStream"]) { + groupTypes = ALAssetsGroupPhotoStream; + } else { + groupTypes = ALAssetsGroupSavedPhotos; + } + + BOOL __block foundAfter = NO; + BOOL __block hasNextPage = NO; + BOOL __block calledCallback = NO; + NSMutableArray *assets = [[NSMutableArray alloc] init]; + + [[RCTImageLoader assetsLibrary] enumerateGroupsWithTypes:groupTypes usingBlock:^(ALAssetsGroup *group, BOOL *stopGroups) { + if (group && (groupName == nil || [groupName isEqualToString:[group valueForProperty:ALAssetsGroupPropertyName]])) { + [group setAssetsFilter:ALAssetsFilter.allPhotos]; + [group enumerateAssetsWithOptions:NSEnumerationReverse usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stopAssets) { + if (result) { + NSString *uri = [(NSURL *)[result valueForProperty:ALAssetPropertyAssetURL] absoluteString]; + if (afterCursor && !foundAfter) { + if ([afterCursor isEqualToString:uri]) { + foundAfter = YES; + } + return; // Skip until we get to the first one + } + if (first == [assets count]) { + *stopAssets = YES; + *stopGroups = YES; + hasNextPage = YES; + RCTAssert(calledCallback == NO, @"Called the callback before we finished processing the results."); + [self callCallback:callback withAssets:assets hasNextPage:hasNextPage]; + calledCallback = YES; + return; + } + CGSize dimensions = [result defaultRepresentation].dimensions; + CLLocation *loc = [result valueForProperty:ALAssetPropertyLocation]; + NSDate *date = [result valueForProperty:ALAssetPropertyDate]; + [assets addObject:@{ + @"node": @{ + @"type": [result valueForProperty:ALAssetPropertyType], + @"group_name": [group valueForProperty:ALAssetsGroupPropertyName], + @"image": @{ + @"uri": uri, + @"height": @(dimensions.height), + @"width": @(dimensions.width), + @"isStored": @YES, + }, + @"timestamp": @([date timeIntervalSince1970]), + @"location": loc ? + @{ + @"latitude": @(loc.coordinate.latitude), + @"longitude": @(loc.coordinate.longitude), + @"altitude": @(loc.altitude), + @"heading": @(loc.course), + @"speed": @(loc.speed), + } : @{}, + } + }]; + } + }]; + } else { + // Sometimes the enumeration continues even if we set stop above, so we guard against calling the callback + // multiple times here. + if (!calledCallback) { + [self callCallback:callback withAssets:assets hasNextPage:hasNextPage]; + calledCallback = YES; + } + } + } failureBlock:^(NSError *error) { + if (error.code != ALAssetsLibraryAccessUserDeniedError) { + RCTLogError(@"Failure while iterating through asset groups %@", error); + } + errorCallback(@[error.description]); + }]; +} + +@end diff --git a/Libraries/Image/RCTImage.xcodeproj/project.pbxproj b/Libraries/Image/RCTImage.xcodeproj/project.pbxproj index 409d61d32..dea9cb419 100644 --- a/Libraries/Image/RCTImage.xcodeproj/project.pbxproj +++ b/Libraries/Image/RCTImage.xcodeproj/project.pbxproj @@ -10,6 +10,8 @@ 1304D5AB1AA8C4A30002E2BE /* RCTStaticImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 1304D5A81AA8C4A30002E2BE /* RCTStaticImage.m */; }; 1304D5AC1AA8C4A30002E2BE /* RCTStaticImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1304D5AA1AA8C4A30002E2BE /* RCTStaticImageManager.m */; }; 1304D5B21AA8C50D0002E2BE /* RCTGIFImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 1304D5B11AA8C50D0002E2BE /* RCTGIFImage.m */; }; + 143879351AAD238D00F088A5 /* RCTCameraRollManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 143879341AAD238D00F088A5 /* RCTCameraRollManager.m */; }; + 143879381AAD32A300F088A5 /* RCTImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 143879371AAD32A300F088A5 /* RCTImageLoader.m */; }; 58B5118F1A9E6BD600147676 /* RCTImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B5118A1A9E6BD600147676 /* RCTImageDownloader.m */; }; 58B511901A9E6BD600147676 /* RCTNetworkImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B5118C1A9E6BD600147676 /* RCTNetworkImageView.m */; }; 58B511911A9E6BD600147676 /* RCTNetworkImageViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B5118E1A9E6BD600147676 /* RCTNetworkImageViewManager.m */; }; @@ -34,6 +36,10 @@ 1304D5AA1AA8C4A30002E2BE /* RCTStaticImageManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTStaticImageManager.m; sourceTree = ""; }; 1304D5B01AA8C50D0002E2BE /* RCTGIFImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTGIFImage.h; sourceTree = ""; }; 1304D5B11AA8C50D0002E2BE /* RCTGIFImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTGIFImage.m; sourceTree = ""; }; + 143879331AAD238D00F088A5 /* RCTCameraRollManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTCameraRollManager.h; sourceTree = ""; }; + 143879341AAD238D00F088A5 /* RCTCameraRollManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTCameraRollManager.m; sourceTree = ""; }; + 143879361AAD32A300F088A5 /* RCTImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageLoader.h; sourceTree = ""; }; + 143879371AAD32A300F088A5 /* RCTImageLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageLoader.m; sourceTree = ""; }; 58B5115D1A9E6B3D00147676 /* libRCTImage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTImage.a; sourceTree = BUILT_PRODUCTS_DIR; }; 58B511891A9E6BD600147676 /* RCTImageDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageDownloader.h; sourceTree = ""; }; 58B5118A1A9E6BD600147676 /* RCTImageDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageDownloader.m; sourceTree = ""; }; @@ -57,6 +63,10 @@ 58B511541A9E6B3D00147676 = { isa = PBXGroup; children = ( + 143879361AAD32A300F088A5 /* RCTImageLoader.h */, + 143879371AAD32A300F088A5 /* RCTImageLoader.m */, + 143879331AAD238D00F088A5 /* RCTCameraRollManager.h */, + 143879341AAD238D00F088A5 /* RCTCameraRollManager.m */, 1304D5B01AA8C50D0002E2BE /* RCTGIFImage.h */, 1304D5B11AA8C50D0002E2BE /* RCTGIFImage.m */, 58B511891A9E6BD600147676 /* RCTImageDownloader.h */, @@ -142,6 +152,8 @@ 1304D5AC1AA8C4A30002E2BE /* RCTStaticImageManager.m in Sources */, 58B511901A9E6BD600147676 /* RCTNetworkImageView.m in Sources */, 1304D5B21AA8C50D0002E2BE /* RCTGIFImage.m in Sources */, + 143879351AAD238D00F088A5 /* RCTCameraRollManager.m in Sources */, + 143879381AAD32A300F088A5 /* RCTImageLoader.m in Sources */, 1304D5AB1AA8C4A30002E2BE /* RCTStaticImage.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Libraries/Image/RCTImageLoader.h b/Libraries/Image/RCTImageLoader.h new file mode 100644 index 000000000..3554f4b46 --- /dev/null +++ b/Libraries/Image/RCTImageLoader.h @@ -0,0 +1,13 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@class ALAssetsLibrary; +@class UIImage; + +@interface RCTImageLoader : NSObject + ++ (ALAssetsLibrary *)assetsLibrary; ++ (void)loadImageWithTag:(NSString *)tag callback:(void (^)(NSError *error, UIImage *image))callback; + +@end diff --git a/Libraries/Image/RCTImageLoader.m b/Libraries/Image/RCTImageLoader.m new file mode 100644 index 000000000..ec3e1dda2 --- /dev/null +++ b/Libraries/Image/RCTImageLoader.m @@ -0,0 +1,98 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTImageLoader.h" + +#import +#import +#import +#import +#import + +#import "RCTConvert.h" +#import "RCTImageDownloader.h" +#import "RCTLog.h" + +NSError *errorWithMessage(NSString *message) { + NSDictionary *errorInfo = @{NSLocalizedDescriptionKey: message}; + NSError *error = [[NSError alloc] initWithDomain:RCTErrorDomain code:0 userInfo:errorInfo]; + return error; +} + +@implementation RCTImageLoader + ++ (ALAssetsLibrary *)assetsLibrary +{ + static ALAssetsLibrary *assetsLibrary = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + assetsLibrary = [[ALAssetsLibrary alloc] init]; + }); + return assetsLibrary; +} + ++ (void)loadImageWithTag:(NSString *)imageTag callback:(void (^)(NSError *error, UIImage *image))callback +{ + if ([imageTag hasPrefix:@"assets-library"]) { + [[RCTImageLoader assetsLibrary] assetForURL:[NSURL URLWithString:imageTag] resultBlock:^(ALAsset *asset) { + if (asset) { + ALAssetRepresentation *representation = [asset defaultRepresentation]; + ALAssetOrientation orientation = [representation orientation]; + UIImage *image = [UIImage imageWithCGImage:[representation fullResolutionImage] scale:1.0f orientation:(UIImageOrientation)orientation]; + callback(nil, image); + } else { + NSString *errorText = [NSString stringWithFormat:@"Failed to load asset at URL %@ with no error message.", imageTag]; + NSError *error = errorWithMessage(errorText); + callback(error, nil); + } + } failureBlock:^(NSError *loadError) { + NSString *errorText = [NSString stringWithFormat:@"Failed to load asset at URL %@.\niOS Error: %@", imageTag, loadError]; + NSError *error = errorWithMessage(errorText); + callback(error, nil); + }]; + } else if ([imageTag hasPrefix:@"ph://"]) { + // Using PhotoKit for iOS 8+ + // 'ph://' prefix is used by FBMediaKit to differentiate between assets-library. It is prepended to the local ID so that it + // is in the form of NSURL which is what assets-library is based on. + // This means if we use any FB standard photo picker, we will get this prefix =( + NSString *phAssetID = [imageTag substringFromIndex:[@"ph://" length]]; + PHFetchResult *results = [PHAsset fetchAssetsWithLocalIdentifiers:@[phAssetID] options:nil]; + if (results.count == 0) { + NSString *errorText = [NSString stringWithFormat:@"Failed to fetch PHAsset with local identifier %@ with no error message.", phAssetID]; + NSError *error = errorWithMessage(errorText); + callback(error, nil); + return; + } + + PHAsset *asset = [results firstObject]; + [[PHImageManager defaultManager] requestImageForAsset:asset targetSize:PHImageManagerMaximumSize contentMode:PHImageContentModeDefault options:nil resultHandler:^(UIImage *result, NSDictionary *info) { + if (result) { + callback(nil, result); + } else { + NSString *errorText = [NSString stringWithFormat:@"Failed to load PHAsset with local identifier %@ with no error message.", phAssetID]; + NSError *error = errorWithMessage(errorText); + callback(error, nil); + return; + } + }]; + } else if ([imageTag hasPrefix:@"http"]) { + NSURL *url = [NSURL URLWithString:imageTag]; + if (!url) { + NSString *errorMessage = [NSString stringWithFormat:@"Invalid URL: %@", imageTag]; + callback(errorWithMessage(errorMessage), nil); + return; + } + [[RCTImageDownloader sharedInstance] downloadDataForURL:url block:^(NSData *data, NSError *error) { + if (error) { + callback(error, nil); + } else { + callback(nil, [UIImage imageWithData:data]); + } + }]; + } else { + NSString *errorMessage = [NSString stringWithFormat:@"Unrecognized tag protocol: %@", imageTag]; + NSError *error = errorWithMessage(errorMessage); + callback(error, nil); + } +} + +@end diff --git a/Libraries/Image/RCTStaticImage.m b/Libraries/Image/RCTStaticImage.m index b57b763ed..e8378fc72 100644 --- a/Libraries/Image/RCTStaticImage.m +++ b/Libraries/Image/RCTStaticImage.m @@ -24,7 +24,7 @@ // Apply trilinear filtering to smooth out mis-sized images self.layer.minificationFilter = kCAFilterTrilinear; self.layer.magnificationFilter = kCAFilterTrilinear; - + super.image = image; } diff --git a/Libraries/Image/RCTStaticImageManager.m b/Libraries/Image/RCTStaticImageManager.m index b83d8c42b..ef60247f2 100644 --- a/Libraries/Image/RCTStaticImageManager.m +++ b/Libraries/Image/RCTStaticImageManager.m @@ -6,6 +6,7 @@ #import "RCTConvert.h" #import "RCTGIFImage.h" +#import "RCTImageLoader.h" #import "RCTStaticImage.h" @implementation RCTStaticImageManager @@ -39,5 +40,19 @@ RCT_CUSTOM_VIEW_PROPERTY(tintColor, RCTStaticImage *) view.tintColor = defaultView.tintColor; } } +RCT_CUSTOM_VIEW_PROPERTY(imageTag, RCTStaticImage *) +{ + if (json) { + [RCTImageLoader loadImageWithTag:[RCTConvert NSString:json] callback:^(NSError *error, UIImage *image) { + if (error) { + RCTLogWarn(@"%@", error.localizedDescription); + } else { + view.image = image; + } + }]; + } else { + view.image = defaultView.image; + } +} @end diff --git a/Libraries/Picker/PickerIOS.android.js b/Libraries/Picker/PickerIOS.android.js new file mode 100644 index 000000000..72cc87a75 --- /dev/null +++ b/Libraries/Picker/PickerIOS.android.js @@ -0,0 +1,10 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule PickerIOS + * + * This is a controlled component version of RKPickerIOS + */ +'use strict'; + +module.exports = require('UnimplementedView'); diff --git a/Libraries/Picker/PickerIOS.ios.js b/Libraries/Picker/PickerIOS.ios.js new file mode 100644 index 000000000..04559a700 --- /dev/null +++ b/Libraries/Picker/PickerIOS.ios.js @@ -0,0 +1,120 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule PickerIOS + * + * This is a controlled component version of RKPickerIOS + */ +'use strict'; + +var NativeMethodsMixin = require('NativeMethodsMixin'); +var React = require('React'); +var ReactChildren = require('ReactChildren'); +var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); +var RKPickerIOSConsts = require('NativeModules').RKUIManager.RCTPicker.Constants; +var StyleSheet = require('StyleSheet'); +var View = require('View'); + +var createReactIOSNativeComponentClass = + require('createReactIOSNativeComponentClass'); +var merge = require('merge'); + +var PICKER = 'picker'; + +var PickerIOS = React.createClass({ + mixins: [NativeMethodsMixin], + + propTypes: { + onValueChange: React.PropTypes.func, + selectedValue: React.PropTypes.any, // string or integer basically + }, + + getInitialState: function() { + return this._stateFromProps(this.props); + }, + + componentWillReceiveProps: function(nextProps) { + this.setState(this._stateFromProps(nextProps)); + }, + + // Translate PickerIOS prop and children into stuff that RKPickerIOS understands. + _stateFromProps: function(props) { + var selectedIndex = 0; + var items = []; + ReactChildren.forEach(props.children, function (child, index) { + if (child.props.value === props.selectedValue) { + selectedIndex = index; + } + items.push({value: child.props.value, label: child.props.label}); + }); + return {selectedIndex, items}; + }, + + render: function() { + return ( + + + + ); + }, + + _onChange: function(event) { + if (this.props.onChange) { + this.props.onChange(event); + } + if (this.props.onValueChange) { + this.props.onValueChange(event.nativeEvent.newValue); + } + + // The picker is a controlled component. This means we expect the + // on*Change handlers to be in charge of updating our + // `selectedValue` prop. That way they can also + // disallow/undo/mutate the selection of certain values. In other + // words, the embedder of this component should be the source of + // truth, not the native component. + if (this.state.selectedIndex !== event.nativeEvent.newIndex) { + this.refs[PICKER].setNativeProps({ + selectedIndex: this.state.selectedIndex + }); + } + }, +}); + +PickerIOS.Item = React.createClass({ + propTypes: { + value: React.PropTypes.any, // string or integer basically + label: React.PropTypes.string, + }, + + render: function() { + // These items don't get rendered directly. + return null; + }, +}); + +var styles = StyleSheet.create({ + rkPickerIOS: { + // The picker will conform to whatever width is given, but we do + // have to set the component's height explicitly on the + // surrounding view to ensure it gets rendered. + height: RKPickerIOSConsts.ComponentHeight, + }, +}); + +var rkPickerIOSAttributes = merge(ReactIOSViewAttributes.UIView, { + items: true, + selectedIndex: true, +}); + +var RKPickerIOS = createReactIOSNativeComponentClass({ + validAttributes: rkPickerIOSAttributes, + uiViewClassName: 'RCTPicker', +}); + +module.exports = PickerIOS; diff --git a/Libraries/ReactIOS/ReactIOS.js b/Libraries/ReactIOS/ReactIOS.js index 4b4b19db0..2dfcb2604 100644 --- a/Libraries/ReactIOS/ReactIOS.js +++ b/Libraries/ReactIOS/ReactIOS.js @@ -74,6 +74,7 @@ var ReactIOS = { count: ReactChildren.count, only: onlyChild }, + Component: ReactComponent, PropTypes: ReactPropTypes, createClass: ReactClass.createClass, createElement: createElement, diff --git a/Libraries/ReactIOS/renderApplication.ios.js b/Libraries/ReactIOS/renderApplication.js similarity index 100% rename from Libraries/ReactIOS/renderApplication.ios.js rename to Libraries/ReactIOS/renderApplication.js diff --git a/Libraries/Utilities/groupByEveryN.js b/Libraries/Utilities/groupByEveryN.js new file mode 100644 index 000000000..e85e58ed0 --- /dev/null +++ b/Libraries/Utilities/groupByEveryN.js @@ -0,0 +1,46 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule groupByEveryN + */ + +/** + * Useful method to split an array into groups of the same number of elements. + * You can use it to generate grids, rows, pages... + * + * If the input length is not a multiple of the count, it'll fill the last + * array with null so you can display a placeholder. + * + * Example: + * groupByEveryN([1, 2, 3, 4, 5], 3) + * => [[1, 2, 3], [4, 5, null]] + * + * groupByEveryN([1, 2, 3], 2).map(elems => { + * return {elems.map(elem => {elem})}; + * }) + */ +'use strict'; + +function groupByEveryN(array, n) { + var result = []; + var temp = []; + + for (var i = 0; i < array.length; ++i) { + if (i > 0 && i % n === 0) { + result.push(temp); + temp = []; + } + temp.push(array[i]); + } + + if (temp.length > 0) { + while (temp.length !== n) { + temp.push(null); + } + result.push(temp); + } + + return result; +} + +module.exports = groupByEveryN; diff --git a/Libraries/react-native/react-native.js b/Libraries/react-native/react-native.js index 7f7edaf72..4d4eee73d 100644 --- a/Libraries/react-native/react-native.js +++ b/Libraries/react-native/react-native.js @@ -7,14 +7,18 @@ var ReactNative = { ...require('React'), + Animation: require('Animation'), AppRegistry: require('AppRegistry'), + CameraRoll: require('CameraRoll'), DatePickerIOS: require('DatePickerIOS'), ExpandingText: require('ExpandingText'), + MapView: require('MapView'), Image: require('Image'), LayoutAnimation: require('LayoutAnimation'), ListView: require('ListView'), ListViewDataSource: require('ListViewDataSource'), NavigatorIOS: require('NavigatorIOS'), + PickerIOS: require('PickerIOS'), PixelRatio: require('PixelRatio'), ScrollView: require('ScrollView'), ActivityIndicatorIOS: require('ActivityIndicatorIOS'), diff --git a/ReactKit/Base/RCTAssert.h b/ReactKit/Base/RCTAssert.h index 66f670430..0aaf176f0 100644 --- a/ReactKit/Base/RCTAssert.h +++ b/ReactKit/Base/RCTAssert.h @@ -4,8 +4,8 @@ #define RCTErrorDomain @"RCTErrorDomain" -#define RCTAssert(condition, message, ...) _RCTAssert(condition, message, ##__VA_ARGS__) -#define RCTCAssert(condition, message, ...) _RCTCAssert(condition, message, ##__VA_ARGS__) +#define RCTAssert(condition, message, ...) _RCTAssert((condition) != 0, message, ##__VA_ARGS__) +#define RCTCAssert(condition, message, ...) _RCTCAssert((condition) != 0, message, ##__VA_ARGS__) typedef void (^RCTAssertFunction)(BOOL condition, NSString *message, ...); diff --git a/ReactKit/Base/RCTConvert.h b/ReactKit/Base/RCTConvert.h index 16cd6967b..709410f17 100644 --- a/ReactKit/Base/RCTConvert.h +++ b/ReactKit/Base/RCTConvert.h @@ -88,6 +88,12 @@ BOOL RCTSetProperty(id target, NSString *keypath, id json); */ BOOL RCTCopyProperty(id target, id source, NSString *keypath); +/** + * This function attempts to convert a JSON value to an object that can be used + * in KVC with the specific target and key path. + */ +id RCTConvertValue(id target, NSString *keypath, id json); + #ifdef __cplusplus } #endif diff --git a/ReactKit/Base/RCTConvert.m b/ReactKit/Base/RCTConvert.m index 760f8284d..a2dcea511 100644 --- a/ReactKit/Base/RCTConvert.m +++ b/ReactKit/Base/RCTConvert.m @@ -608,7 +608,7 @@ static NSString *RCTGuessTypeEncoding(id target, NSString *key, id value, NSStri return nil; } -static NSDictionary *RCTConvertValue(id value, NSString *encoding) +static id RCTConvertValueWithEncoding(id value, NSString *encoding) { static NSDictionary *converters = nil; static dispatch_once_t onceToken; @@ -690,18 +690,7 @@ static NSDictionary *RCTConvertValue(id value, NSString *encoding) return converter ? converter(value) : value; } -BOOL RCTSetProperty(id target, NSString *keypath, id value) -{ - // Split keypath - NSArray *parts = [keypath componentsSeparatedByString:@"."]; - NSString *key = [parts lastObject]; - for (NSUInteger i = 0; i < parts.count - 1; i++) { - target = [target valueForKey:parts[i]]; - if (!target) { - return NO; - } - } - +static NSString *RCTPropertyEncoding(id target, NSString *key, id value) { // Check target class for property definition NSString *encoding = nil; objc_property_t property = class_getProperty([target class], [key UTF8String]); @@ -720,7 +709,7 @@ BOOL RCTSetProperty(id target, NSString *keypath, id value) [key substringFromIndex:1]]); if (![target respondsToSelector:setter]) { - return NO; + return nil; } // Get type of first method argument @@ -730,17 +719,92 @@ BOOL RCTSetProperty(id target, NSString *keypath, id value) encoding = @(typeEncoding); free(typeEncoding); } + + if (encoding.length == 0 || [encoding isEqualToString:@(@encode(id))]) { + // Not enough info about the type encoding to be useful, so + // try to guess the type from the value and property name + encoding = RCTGuessTypeEncoding(target, key, value, encoding); + } + } - if (encoding.length == 0 || [encoding isEqualToString:@(@encode(id))]) { - // Not enough info about the type encoding to be useful, so - // try to guess the type from the value and property name - encoding = RCTGuessTypeEncoding(target, key, value, encoding); + return encoding; +} + +static id RCTConvertValueWithExplicitEncoding(id target, NSString *key, id json, NSString *encoding) { + if (!encoding) return nil; + + // Special case for numeric encodings, which may be enums + if ([json isKindOfClass:[NSString class]] && + [@"iIsSlLqQ" rangeOfString:[encoding substringToIndex:1]].length) { + + /** + * NOTE: the property names below may seem weird, but it's + * because they are tested as case-sensitive suffixes, so + * "apitalizationType" will match any of the following + * + * - capitalizationType + * - autocapitalizationType + * - autoCapitalizationType + * - titleCapitalizationType + * - etc. + */ + static NSDictionary *converters = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + converters = + @{ + @"apitalizationType": ^(id val) { + return [RCTConvert UITextAutocapitalizationType:val]; + }, + @"eyboardType": ^(id val) { + return [RCTConvert UIKeyboardType:val]; + }, + @"extAlignment": ^(id val) { + return [RCTConvert NSTextAlignment:val]; + }, + @"ointerEvents": ^(id val) { + return [RCTConvert RCTPointerEvents:val]; + }, + }; + }); + for (NSString *subkey in converters) { + if ([key hasSuffix:subkey]) { + NSInteger (^converter)(NSString *) = converters[subkey]; + json = @(converter(json)); + break; + } + } } + return RCTConvertValueWithEncoding(json, encoding); +} + +id RCTConvertValue(id target, NSString *key, id json) { + NSString *encoding = RCTPropertyEncoding(target, key, json); + return RCTConvertValueWithExplicitEncoding(target, key, json, encoding); +} + +BOOL RCTSetProperty(id target, NSString *keypath, id value) +{ + // Split keypath + NSArray *parts = [keypath componentsSeparatedByString:@"."]; + NSString *key = [parts lastObject]; + for (NSUInteger i = 0; i < parts.count - 1; i++) { + target = [target valueForKey:parts[i]]; + if (!target) { + return NO; + } + } + + NSString *encoding = RCTPropertyEncoding(target, key, value); + if (!encoding) return NO; + + value = RCTConvertValueWithExplicitEncoding(target, keypath, value, encoding); + // Special case for numeric encodings, which may be enums if ([value isKindOfClass:[NSString class]] && - [@"iIsSlLqQ" rangeOfString:[encoding substringToIndex:1]].length) { + [@"iIsSlLqQ" rangeOfString:[encoding substringToIndex:1]].location != NSNotFound) { /** * NOTE: the property names below may seem weird, but it's @@ -798,15 +862,15 @@ BOOL RCTSetProperty(id target, NSString *keypath, id value) }); void (^block)(UITextField *f, NSInteger v) = specialCases[key]; - if (block) - { + if (block) { block(target, [value integerValue]); return YES; } } // Set converted value - [target setValue:RCTConvertValue(value, encoding) forKey:key]; + [target setValue:value forKey:key]; + return YES; } diff --git a/ReactKit/Base/RCTUtils.m b/ReactKit/Base/RCTUtils.m index 1b686008f..40007a69b 100644 --- a/ReactKit/Base/RCTUtils.m +++ b/ReactKit/Base/RCTUtils.m @@ -2,11 +2,15 @@ #import "RCTUtils.h" -#import #import #import + #import +#import + +#import "RCTLog.h" + NSString *RCTJSONStringify(id jsonObject, NSError **error) { NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonObject options:0 error:error]; @@ -15,7 +19,14 @@ NSString *RCTJSONStringify(id jsonObject, NSError **error) id RCTJSONParse(NSString *jsonString, NSError **error) { - NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; + if (!jsonString) { + return nil; + } + NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO]; + if (!jsonData) { + RCTLog(@"RCTJSONParse received the following string, which could not be losslessly converted to UTF8 data: '%@'", jsonString); + jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES]; + } return [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingAllowFragments error:error]; } @@ -63,7 +74,7 @@ CGSize RCTScreenSize() size = [UIScreen mainScreen].bounds.size; } }); - + return size; } @@ -93,7 +104,7 @@ NSTimeInterval RCTTGetAbsoluteTime(void) int ret = mach_timebase_info(&tb_info); assert(0 == ret); }); - + uint64_t timeInNanoseconds = (mach_absolute_time() * tb_info.numer) / tb_info.denom; return ((NSTimeInterval)timeInNanoseconds) / 1000000; } @@ -103,11 +114,11 @@ void RCTSwapClassMethods(Class cls, SEL original, SEL replacement) Method originalMethod = class_getClassMethod(cls, original); IMP originalImplementation = method_getImplementation(originalMethod); const char *originalArgTypes = method_getTypeEncoding(originalMethod); - + Method replacementMethod = class_getClassMethod(cls, replacement); IMP replacementImplementation = method_getImplementation(replacementMethod); const char *replacementArgTypes = method_getTypeEncoding(replacementMethod); - + if (class_addMethod(cls, original, replacementImplementation, replacementArgTypes)) { class_replaceMethod(cls, replacement, originalImplementation, originalArgTypes); @@ -123,11 +134,11 @@ void RCTSwapInstanceMethods(Class cls, SEL original, SEL replacement) Method originalMethod = class_getInstanceMethod(cls, original); IMP originalImplementation = method_getImplementation(originalMethod); const char *originalArgTypes = method_getTypeEncoding(originalMethod); - + Method replacementMethod = class_getInstanceMethod(cls, replacement); IMP replacementImplementation = method_getImplementation(replacementMethod); const char *replacementArgTypes = method_getTypeEncoding(replacementMethod); - + if (class_addMethod(cls, original, replacementImplementation, replacementArgTypes)) { class_replaceMethod(cls, replacement, originalImplementation, originalArgTypes); diff --git a/ReactKit/Modules/RCTAnimationManager.h b/ReactKit/Modules/RCTAnimationManager.h new file mode 100644 index 000000000..9f2391514 --- /dev/null +++ b/ReactKit/Modules/RCTAnimationManager.h @@ -0,0 +1,9 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "RCTBridgeModule.h" + +@interface RCTAnimationManager : NSObject + +@end diff --git a/ReactKit/Modules/RCTAnimationManager.m b/ReactKit/Modules/RCTAnimationManager.m new file mode 100644 index 000000000..a5de9aa29 --- /dev/null +++ b/ReactKit/Modules/RCTAnimationManager.m @@ -0,0 +1,203 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTAnimationManager.h" + +#import +#import + +#import "RCTSparseArray.h" +#import "RCTUIManager.h" + +#if CGFLOAT_IS_DOUBLE + #define CG_APPEND(PREFIX, SUFFIX_F, SUFFIX_D) PREFIX##SUFFIX_D +#else + #define CG_APPEND(PREFIX, SUFFIX_F, SUFFIX_D) PREFIX##SUFFIX_F +#endif + +@implementation RCTAnimationManager +{ + RCTSparseArray *_animationRegistry; // Main thread only; animation tag -> view tag +} + +@synthesize bridge = _bridge; + +- (instancetype)init +{ + if ((self = [super init])) { + _animationRegistry = [[RCTSparseArray alloc] init]; + } + + return self; +} + +- (id (^)(CGFloat))interpolateFrom:(CGFloat[])fromArray to:(CGFloat[])toArray count:(NSUInteger)count typeName:(const char *)typeName +{ + if (count == 1) { + CGFloat from = *fromArray, to = *toArray, delta = to - from; + return ^(CGFloat t) { + return @(from + t * delta); + }; + } + + CG_APPEND(vDSP_vsub,,D)(fromArray, 1, toArray, 1, toArray, 1, count); + + const size_t size = count * sizeof(CGFloat); + NSData *deltaData = [NSData dataWithBytes:toArray length:size]; + NSData *fromData = [NSData dataWithBytes:fromArray length:size]; + + return ^(CGFloat t) { + const CGFloat *delta = deltaData.bytes; + const CGFloat *fromArray = fromData.bytes; + + CGFloat value[count]; + CG_APPEND(vDSP_vma,,D)(delta, 1, &t, 0, fromArray, 1, value, 1, count); + return [NSValue valueWithBytes:value objCType:typeName]; + }; +} + +- (void)startAnimationForTag:(NSNumber *)reactTag animationTag:(NSNumber *)animationTag duration:(double)duration delay:(double)delay easingSample:(NSArray *)easingSample properties:(NSDictionary *)properties +{ + RCT_EXPORT(startAnimation); + + __weak RCTAnimationManager *weakSelf = self; + [_bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) { + RCTAnimationManager *strongSelf = weakSelf; + + UIView *view = viewRegistry[reactTag]; + if (!view) { + RCTLogWarn(@"React tag %@ is not registered with the view registry", reactTag); + return; + } + + [properties enumerateKeysAndObjectsUsingBlock:^(NSString *key, id obj, BOOL *stop) { + NSValue *toValue = nil; + if ([key isEqualToString:@"scaleXY"]) { + key = @"transform.scale"; + toValue = obj[0]; + } else if ([obj respondsToSelector:@selector(count)]) { + switch ([obj count]) { + case 2: + if ([obj respondsToSelector:@selector(objectForKey:)] && [obj objectForKey:@"w"]) { + toValue = [NSValue valueWithCGSize:[RCTConvert CGSize:obj]]; + } else { + toValue = [NSValue valueWithCGPoint:[RCTConvert CGPoint:obj]]; + } + break; + case 4: + toValue = [NSValue valueWithCGRect:[RCTConvert CGRect:obj]]; + break; + case 16: + toValue = [NSValue valueWithCGAffineTransform:[RCTConvert CGAffineTransform:obj]]; + break; + } + } + + if (!toValue) toValue = obj; + + const char *typeName = toValue.objCType; + + size_t count; + switch (typeName[0]) { + case 'i': + case 'I': + case 's': + case 'S': + case 'l': + case 'L': + case 'q': + case 'Q': + count = 1; + break; + + default: { + NSUInteger size; + NSGetSizeAndAlignment(typeName, &size, NULL); + count = size / sizeof(CGFloat); + break; + } + } + + CGFloat toFields[count]; + + switch (typeName[0]) { +#define CASE(encoding, type) \ + case encoding: { \ + type value; \ + [toValue getValue:&value]; \ + toFields[0] = value; \ + break; \ + } + + CASE('i', int) + CASE('I', unsigned int) + CASE('s', short) + CASE('S', unsigned short) + CASE('l', long) + CASE('L', unsigned long) + CASE('q', long long) + CASE('Q', unsigned long long) + +#undef CASE + + default: + [toValue getValue:toFields]; + break; + } + + NSValue *fromValue = [view.layer.presentationLayer valueForKeyPath:key]; + CGFloat fromFields[count]; + [fromValue getValue:fromFields]; + + id (^interpolationBlock)(CGFloat t) = [strongSelf interpolateFrom:fromFields to:toFields count:count typeName:typeName]; + + NSMutableArray *sampledValues = [NSMutableArray arrayWithCapacity:easingSample.count]; + for (NSNumber *sample in easingSample) { + CGFloat t = sample.CG_APPEND(, floatValue, doubleValue); + [sampledValues addObject:interpolationBlock(t)]; + } + + CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:key]; + animation.beginTime = CACurrentMediaTime() + delay / 1000.0; + animation.duration = duration / 1000.0; + animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; + animation.values = sampledValues; + + [view.layer setValue:toValue forKey:key]; + + NSString *animationKey = [NSString stringWithFormat:@"RCT.%@.%@", animationTag, key]; + [view.layer addAnimation:animation forKey:animationKey]; + }]; + + strongSelf->_animationRegistry[animationTag] = reactTag; + }]; +} + +- (void)stopAnimation:(NSNumber *)animationTag +{ + RCT_EXPORT(stopAnimation); + + __weak RCTAnimationManager *weakSelf = self; + [_bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) { + RCTAnimationManager *strongSelf = weakSelf; + + NSNumber *reactTag = strongSelf->_animationRegistry[animationTag]; + if (!reactTag) return; + + UIView *view = viewRegistry[reactTag]; + for (NSString *animationKey in view.layer.animationKeys) { + if ([animationKey hasPrefix:@"RCT"]) { + NSRange periodLocation = [animationKey rangeOfString:@"." options:0 range:NSMakeRange(3, animationKey.length - 3)]; + if (periodLocation.location != NSNotFound) { + NSInteger integerTag = [[animationKey substringWithRange:NSMakeRange(3, periodLocation.location)] integerValue]; + if (animationTag.integerValue == integerTag) { + [view.layer removeAnimationForKey:animationKey]; + } + } + } + } + + strongSelf->_animationRegistry[animationTag] = nil; + }]; +} + +@end diff --git a/ReactKit/Modules/RCTUIManager.m b/ReactKit/Modules/RCTUIManager.m index a22f24540..ae69890d3 100644 --- a/ReactKit/Modules/RCTUIManager.m +++ b/ReactKit/Modules/RCTUIManager.m @@ -2,24 +2,25 @@ #import "RCTUIManager.h" -#import #import +#import + #import "Layout.h" #import "RCTAnimationType.h" #import "RCTAssert.h" #import "RCTBridge.h" #import "RCTConvert.h" -#import "RCTRootView.h" #import "RCTLog.h" #import "RCTNavigator.h" +#import "RCTRootView.h" #import "RCTScrollableProtocol.h" #import "RCTShadowView.h" #import "RCTSparseArray.h" #import "RCTUtils.h" #import "RCTView.h" -#import "RCTViewNodeProtocol.h" #import "RCTViewManager.h" +#import "RCTViewNodeProtocol.h" #import "UIView+ReactKit.h" typedef void (^react_view_node_block_t)(id); diff --git a/ReactKit/ReactKit.xcodeproj/project.pbxproj b/ReactKit/ReactKit.xcodeproj/project.pbxproj index 48cac5ded..fc8e49ac3 100644 --- a/ReactKit/ReactKit.xcodeproj/project.pbxproj +++ b/ReactKit/ReactKit.xcodeproj/project.pbxproj @@ -34,13 +34,18 @@ 13E067561A70F44B002CDEE1 /* RCTViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E0674E1A70F44B002CDEE1 /* RCTViewManager.m */; }; 13E067571A70F44B002CDEE1 /* RCTView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067501A70F44B002CDEE1 /* RCTView.m */; }; 13E067591A70F44B002CDEE1 /* UIView+ReactKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E067541A70F44B002CDEE1 /* UIView+ReactKit.m */; }; - 58C571C11AA56C1900CDF9C8 /* RCTDatePickerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */; }; 14F3620D1AABD06A001CE568 /* RCTSwitch.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F362081AABD06A001CE568 /* RCTSwitch.m */; }; 14F3620E1AABD06A001CE568 /* RCTSwitchManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F3620A1AABD06A001CE568 /* RCTSwitchManager.m */; }; 14F484561AABFCE100FDF6B9 /* RCTSliderManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F484551AABFCE100FDF6B9 /* RCTSliderManager.m */; }; + 14435CE51AAC4AE100FC20F4 /* RCTMap.m in Sources */ = {isa = PBXBuildFile; fileRef = 14435CE21AAC4AE100FC20F4 /* RCTMap.m */; }; + 14435CE61AAC4AE100FC20F4 /* RCTMapManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 14435CE41AAC4AE100FC20F4 /* RCTMapManager.m */; }; + 58114A161AAE854800E7D092 /* RCTPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 58114A131AAE854800E7D092 /* RCTPicker.m */; }; + 58114A171AAE854800E7D092 /* RCTPickerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58114A151AAE854800E7D092 /* RCTPickerManager.m */; }; + 58C571C11AA56C1900CDF9C8 /* RCTDatePickerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */; }; 830A229E1A66C68A008503DA /* RCTRootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 830A229D1A66C68A008503DA /* RCTRootView.m */; }; 830BA4551A8E3BDA00D53203 /* RCTCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 830BA4541A8E3BDA00D53203 /* RCTCache.m */; }; 832348161A77A5AA00B55238 /* Layout.c in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FC71A68125100A75B9A /* Layout.c */; }; + 83C911101AAE6521001323A3 /* RCTAnimationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 83C9110F1AAE6521001323A3 /* RCTAnimationManager.m */; }; 83CBBA511A601E3B00E9B192 /* RCTAssert.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA4B1A601E3B00E9B192 /* RCTAssert.m */; }; 83CBBA521A601E3B00E9B192 /* RCTLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA4E1A601E3B00E9B192 /* RCTLog.m */; }; 83CBBA531A601E3B00E9B192 /* RCTUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 83CBBA501A601E3B00E9B192 /* RCTUtils.m */; }; @@ -126,14 +131,22 @@ 13E067531A70F44B002CDEE1 /* UIView+ReactKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+ReactKit.h"; sourceTree = ""; }; 13E067541A70F44B002CDEE1 /* UIView+ReactKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+ReactKit.m"; sourceTree = ""; }; 13EFFCCF1A98E6FE002607DC /* RCTJSMethodRegistrar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSMethodRegistrar.h; sourceTree = ""; }; - 58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDatePickerManager.m; sourceTree = ""; }; - 58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDatePickerManager.h; sourceTree = ""; }; 14F362071AABD06A001CE568 /* RCTSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSwitch.h; sourceTree = ""; }; 14F362081AABD06A001CE568 /* RCTSwitch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSwitch.m; sourceTree = ""; }; 14F362091AABD06A001CE568 /* RCTSwitchManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSwitchManager.h; sourceTree = ""; }; 14F3620A1AABD06A001CE568 /* RCTSwitchManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSwitchManager.m; sourceTree = ""; }; 14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSliderManager.h; sourceTree = ""; }; 14F484551AABFCE100FDF6B9 /* RCTSliderManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSliderManager.m; sourceTree = ""; }; + 14435CE11AAC4AE100FC20F4 /* RCTMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMap.h; sourceTree = ""; }; + 14435CE21AAC4AE100FC20F4 /* RCTMap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMap.m; sourceTree = ""; }; + 14435CE31AAC4AE100FC20F4 /* RCTMapManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMapManager.h; sourceTree = ""; }; + 14435CE41AAC4AE100FC20F4 /* RCTMapManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMapManager.m; sourceTree = ""; }; + 58114A121AAE854800E7D092 /* RCTPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPicker.h; sourceTree = ""; }; + 58114A131AAE854800E7D092 /* RCTPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPicker.m; sourceTree = ""; }; + 58114A141AAE854800E7D092 /* RCTPickerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPickerManager.h; sourceTree = ""; }; + 58114A151AAE854800E7D092 /* RCTPickerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPickerManager.m; sourceTree = ""; }; + 58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDatePickerManager.m; sourceTree = ""; }; + 58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDatePickerManager.h; sourceTree = ""; }; 830213F31A654E0800B993E6 /* RCTBridgeModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTBridgeModule.h; sourceTree = ""; }; 830A229C1A66C68A008503DA /* RCTRootView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootView.h; sourceTree = ""; }; 830A229D1A66C68A008503DA /* RCTRootView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootView.m; sourceTree = ""; }; @@ -141,6 +154,8 @@ 830BA4541A8E3BDA00D53203 /* RCTCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTCache.m; sourceTree = ""; }; 83BEE46C1A6D19BC00B5863B /* RCTSparseArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSparseArray.h; sourceTree = ""; }; 83BEE46D1A6D19BC00B5863B /* RCTSparseArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSparseArray.m; sourceTree = ""; }; + 83C9110E1AAE6521001323A3 /* RCTAnimationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAnimationManager.h; sourceTree = ""; }; + 83C9110F1AAE6521001323A3 /* RCTAnimationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAnimationManager.m; sourceTree = ""; }; 83CBBA2E1A601D0E00E9B192 /* libReactKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libReactKit.a; sourceTree = BUILT_PRODUCTS_DIR; }; 83CBBA4A1A601E3B00E9B192 /* RCTAssert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAssert.h; sourceTree = ""; }; 83CBBA4B1A601E3B00E9B192 /* RCTAssert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAssert.m; sourceTree = ""; }; @@ -198,8 +213,12 @@ children = ( 13B07FE71A69327A00A75B9A /* RCTAlertManager.h */, 13B07FE81A69327A00A75B9A /* RCTAlertManager.m */, + 83C9110E1AAE6521001323A3 /* RCTAnimationManager.h */, + 83C9110F1AAE6521001323A3 /* RCTAnimationManager.m */, 13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */, 13B07FEA1A69327A00A75B9A /* RCTExceptionsManager.m */, + 5F5F0D971A9E456B001279FA /* RCTLocationObserver.h */, + 5F5F0D981A9E456B001279FA /* RCTLocationObserver.m */, 13723B4E1A82FD3C00F88898 /* RCTStatusBarManager.h */, 13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */, 13B07FED1A69327A00A75B9A /* RCTTiming.h */, @@ -213,20 +232,14 @@ 13B07FF31A6947C200A75B9A /* Views */ = { isa = PBXGroup; children = ( - 14F362071AABD06A001CE568 /* RCTSwitch.h */, - 14F362081AABD06A001CE568 /* RCTSwitch.m */, - 14F362091AABD06A001CE568 /* RCTSwitchManager.h */, - 14F3620A1AABD06A001CE568 /* RCTSwitchManager.m */, - 14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */, - 14F484551AABFCE100FDF6B9 /* RCTSliderManager.m */, 13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */, + 13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */, 58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */, 58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */, - 13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */, - 13442BF41AA90E0B0037E5B0 /* RCTViewControllerProtocol.h */, - 13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */, - 13C325271AA63B6A0048765F /* RCTScrollableProtocol.h */, - 13C325281AA63B6A0048765F /* RCTViewNodeProtocol.h */, + 14435CE11AAC4AE100FC20F4 /* RCTMap.h */, + 14435CE21AAC4AE100FC20F4 /* RCTMap.m */, + 14435CE31AAC4AE100FC20F4 /* RCTMapManager.h */, + 14435CE41AAC4AE100FC20F4 /* RCTMapManager.m */, 13B0800C1A69489C00A75B9A /* RCTNavigator.h */, 13B0800D1A69489C00A75B9A /* RCTNavigator.m */, 13B0800E1A69489C00A75B9A /* RCTNavigatorManager.h */, @@ -235,24 +248,24 @@ 13B080111A69489C00A75B9A /* RCTNavItem.m */, 13B080121A69489C00A75B9A /* RCTNavItemManager.h */, 13B080131A69489C00A75B9A /* RCTNavItemManager.m */, + 58114A121AAE854800E7D092 /* RCTPicker.h */, + 58114A131AAE854800E7D092 /* RCTPicker.m */, + 58114A141AAE854800E7D092 /* RCTPickerManager.h */, + 58114A151AAE854800E7D092 /* RCTPickerManager.m */, + 13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */, 13B07FF61A6947C200A75B9A /* RCTScrollView.h */, 13B07FF71A6947C200A75B9A /* RCTScrollView.m */, 13B07FF81A6947C200A75B9A /* RCTScrollViewManager.h */, 13B07FF91A6947C200A75B9A /* RCTScrollViewManager.m */, + 13C325271AA63B6A0048765F /* RCTScrollableProtocol.h */, 13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */, 13E0674C1A70F44B002CDEE1 /* RCTShadowView.m */, - 13B080141A69489C00A75B9A /* RCTTextField.h */, - 13B080151A69489C00A75B9A /* RCTTextField.m */, - 13B080161A69489C00A75B9A /* RCTTextFieldManager.h */, - 13B080171A69489C00A75B9A /* RCTTextFieldManager.m */, - 13B080181A69489C00A75B9A /* RCTUIActivityIndicatorViewManager.h */, - 13B080191A69489C00A75B9A /* RCTUIActivityIndicatorViewManager.m */, - 13E0674F1A70F44B002CDEE1 /* RCTView.h */, - 13E067501A70F44B002CDEE1 /* RCTView.m */, - 13E0674D1A70F44B002CDEE1 /* RCTViewManager.h */, - 13E0674E1A70F44B002CDEE1 /* RCTViewManager.m */, - 13B080231A694A8400A75B9A /* RCTWrapperViewController.h */, - 13B080241A694A8400A75B9A /* RCTWrapperViewController.m */, + 14F484541AABFCE100FDF6B9 /* RCTSliderManager.h */, + 14F484551AABFCE100FDF6B9 /* RCTSliderManager.m */, + 14F362071AABD06A001CE568 /* RCTSwitch.h */, + 14F362081AABD06A001CE568 /* RCTSwitch.m */, + 14F362091AABD06A001CE568 /* RCTSwitchManager.h */, + 14F3620A1AABD06A001CE568 /* RCTSwitchManager.m */, 137327DF1AA5CF210034F82E /* RCTTabBar.h */, 137327E01AA5CF210034F82E /* RCTTabBar.m */, 137327E11AA5CF210034F82E /* RCTTabBarItem.h */, @@ -261,6 +274,20 @@ 137327E41AA5CF210034F82E /* RCTTabBarItemManager.m */, 137327E51AA5CF210034F82E /* RCTTabBarManager.h */, 137327E61AA5CF210034F82E /* RCTTabBarManager.m */, + 13B080141A69489C00A75B9A /* RCTTextField.h */, + 13B080151A69489C00A75B9A /* RCTTextField.m */, + 13B080161A69489C00A75B9A /* RCTTextFieldManager.h */, + 13B080171A69489C00A75B9A /* RCTTextFieldManager.m */, + 13B080181A69489C00A75B9A /* RCTUIActivityIndicatorViewManager.h */, + 13B080191A69489C00A75B9A /* RCTUIActivityIndicatorViewManager.m */, + 13E0674F1A70F44B002CDEE1 /* RCTView.h */, + 13E067501A70F44B002CDEE1 /* RCTView.m */, + 13442BF41AA90E0B0037E5B0 /* RCTViewControllerProtocol.h */, + 13E0674D1A70F44B002CDEE1 /* RCTViewManager.h */, + 13E0674E1A70F44B002CDEE1 /* RCTViewManager.m */, + 13C325281AA63B6A0048765F /* RCTViewNodeProtocol.h */, + 13B080231A694A8400A75B9A /* RCTWrapperViewController.h */, + 13B080241A694A8400A75B9A /* RCTWrapperViewController.m */, 13E067531A70F44B002CDEE1 /* UIView+ReactKit.h */, 13E067541A70F44B002CDEE1 /* UIView+ReactKit.m */, ); @@ -435,12 +462,17 @@ 134FCB361A6D42D900051CC8 /* RCTSparseArray.m in Sources */, 13A1F71E1A75392D00D3D453 /* RCTKeyCommands.m in Sources */, 83CBBA531A601E3B00E9B192 /* RCTUtils.m in Sources */, + 14435CE61AAC4AE100FC20F4 /* RCTMapManager.m in Sources */, + 83C911101AAE6521001323A3 /* RCTAnimationManager.m in Sources */, 83CBBA601A601EAA00E9B192 /* RCTBridge.m in Sources */, + 58114A161AAE854800E7D092 /* RCTPicker.m in Sources */, 137327E81AA5CF210034F82E /* RCTTabBarItem.m in Sources */, 13E067551A70F44B002CDEE1 /* RCTShadowView.m in Sources */, + 58114A171AAE854800E7D092 /* RCTPickerManager.m in Sources */, 13B0801A1A69489C00A75B9A /* RCTNavigator.m in Sources */, 830BA4551A8E3BDA00D53203 /* RCTCache.m in Sources */, 137327E71AA5CF210034F82E /* RCTTabBar.m in Sources */, + 14435CE51AAC4AE100FC20F4 /* RCTMap.m in Sources */, 134FCB3E1A6E7F0800051CC8 /* RCTWebViewExecutor.m in Sources */, 13B0801C1A69489C00A75B9A /* RCTNavItem.m in Sources */, 83CBBA691A601EF300E9B192 /* RCTEventDispatcher.m in Sources */, diff --git a/ReactKit/Views/RCTMap.h b/ReactKit/Views/RCTMap.h new file mode 100644 index 000000000..5ab56079b --- /dev/null +++ b/ReactKit/Views/RCTMap.h @@ -0,0 +1,24 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import +#import + +extern const CLLocationDegrees RCTMapDefaultSpan; +extern const NSTimeInterval RCTMapRegionChangeObserveInterval; +extern const CGFloat RCTMapZoomBoundBuffer; + +@class RCTEventDispatcher; + +@interface RCTMap: MKMapView + +@property (nonatomic, assign) BOOL followUserLocation; +@property (nonatomic, copy) NSDictionary *JSONRegion; +@property (nonatomic, assign) CGFloat minDelta; +@property (nonatomic, assign) CGFloat maxDelta; +@property (nonatomic, assign) UIEdgeInsets legalLabelInsets; +@property (nonatomic, strong) NSTimer *regionChangeObserveTimer; + +@end + +#define FLUSH_NAN(value) \ + (isnan(value) ? 0 : value) diff --git a/ReactKit/Views/RCTMap.m b/ReactKit/Views/RCTMap.m new file mode 100644 index 000000000..09dac2a5b --- /dev/null +++ b/ReactKit/Views/RCTMap.m @@ -0,0 +1,130 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTMap.h" + +#import "RCTEventDispatcher.h" +#import "RCTLog.h" +#import "RCTUtils.h" + +const CLLocationDegrees RCTMapDefaultSpan = 0.005; +const NSTimeInterval RCTMapRegionChangeObserveInterval = 0.1; +const CGFloat RCTMapZoomBoundBuffer = 0.01; + +@interface RCTMap() + +@property (nonatomic, strong) UIView *legalLabel; +@property (nonatomic, strong) CLLocationManager *locationManager; + +@end + +@implementation RCTMap + +- (instancetype)init +{ + self = [super init]; + if (self) { + // Find Apple link label + for (UIView *subview in self.subviews) { + if ([NSStringFromClass(subview.class) isEqualToString:@"MKAttributionLabel"]) { + // This check is super hacky, but the whole premise of moving around Apple's internal subviews is super hacky + _legalLabel = subview; + break; + } + } + } + return self; +} + +- (void)dealloc +{ + [self.regionChangeObserveTimer invalidate]; +} + +- (void)layoutSubviews +{ + [super layoutSubviews]; + + // Force resize subviews - only the layer is resized by default + CGRect mapFrame = self.frame; + self.frame = CGRectZero; + self.frame = mapFrame; + + if (_legalLabel) { + dispatch_async(dispatch_get_main_queue(), ^{ + CGRect frame = _legalLabel.frame; + if (_legalLabelInsets.left) { + frame.origin.x = _legalLabelInsets.left; + } else if (_legalLabelInsets.right) { + frame.origin.x = mapFrame.size.width - _legalLabelInsets.right - frame.size.width; + } + if (_legalLabelInsets.top) { + frame.origin.y = _legalLabelInsets.top; + } else if (_legalLabelInsets.bottom) { + frame.origin.y = mapFrame.size.height - _legalLabelInsets.bottom - frame.size.height; + } + _legalLabel.frame = frame; + }); + } +} + +#pragma mark Accessors + +- (void)setShowsUserLocation:(BOOL)showsUserLocation +{ + if (self.showsUserLocation != showsUserLocation) { + if (showsUserLocation && !_locationManager) { + _locationManager = [[CLLocationManager alloc] init]; + if ([_locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) { + [_locationManager requestWhenInUseAuthorization]; + } + } + [super setShowsUserLocation:showsUserLocation]; + + // If it needs to show user location, force map view centered + // on user's current location on user location updates + self.followUserLocation = showsUserLocation; + } +} + +- (void)setJSONRegion:(NSDictionary *)region +{ + if (region) { + MKCoordinateRegion coordinateRegion = self.region; + if ([region[@"latitude"] isKindOfClass:[NSNumber class]]) { + coordinateRegion.center.latitude = [region[@"latitude"] doubleValue]; + } else { + RCTLogError(@"region must include numeric latitude, got: %@", region); + return; + } + if ([region[@"longitude"] isKindOfClass:[NSNumber class]]) { + coordinateRegion.center.longitude = [region[@"longitude"] doubleValue]; + } else { + RCTLogError(@"region must include numeric longitude, got: %@", region); + return; + } + if ([region[@"latitudeDelta"] isKindOfClass:[NSNumber class]]) { + coordinateRegion.span.latitudeDelta = [region[@"latitudeDelta"] doubleValue]; + } + if ([region[@"longitudeDelta"] isKindOfClass:[NSNumber class]]) { + coordinateRegion.span.longitudeDelta = [region[@"longitudeDelta"] doubleValue]; + } + + [self setRegion:coordinateRegion animated:YES]; + } +} + +- (NSDictionary *)JSONRegion +{ + MKCoordinateRegion region = self.region; + if (!CLLocationCoordinate2DIsValid(region.center)) { + return nil; + } + return @{ + @"latitude": @(FLUSH_NAN(region.center.latitude)), + @"longitude": @(FLUSH_NAN(region.center.longitude)), + @"latitudeDelta": @(FLUSH_NAN(region.span.latitudeDelta)), + @"longitudeDelta": @(FLUSH_NAN(region.span.longitudeDelta)), + }; +} + +@end diff --git a/ReactKit/Views/RCTMapManager.h b/ReactKit/Views/RCTMapManager.h new file mode 100644 index 000000000..93b7049ca --- /dev/null +++ b/ReactKit/Views/RCTMapManager.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTMapManager : RCTViewManager + +@end diff --git a/ReactKit/Views/RCTMapManager.m b/ReactKit/Views/RCTMapManager.m new file mode 100644 index 000000000..421396a1e --- /dev/null +++ b/ReactKit/Views/RCTMapManager.m @@ -0,0 +1,119 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTMapManager.h" + +#import "RCTBridge.h" +#import "RCTEventDispatcher.h" +#import "RCTMap.h" +#import "UIView+ReactKit.h" + +@interface RCTMapManager() + +@end + +@implementation RCTMapManager + +- (UIView *)view +{ + RCTMap *map = [[RCTMap alloc] init]; + map.delegate = self; + return map; +} + +RCT_EXPORT_VIEW_PROPERTY(showsUserLocation); +RCT_EXPORT_VIEW_PROPERTY(zoomEnabled); +RCT_EXPORT_VIEW_PROPERTY(rotateEnabled); +RCT_EXPORT_VIEW_PROPERTY(pitchEnabled); +RCT_EXPORT_VIEW_PROPERTY(scrollEnabled); +RCT_EXPORT_VIEW_PROPERTY(maxDelta); +RCT_EXPORT_VIEW_PROPERTY(minDelta); +RCT_EXPORT_VIEW_PROPERTY(legalLabelInsets); +RCT_REMAP_VIEW_PROPERTY(region, JSONRegion) + +#pragma mark MKMapViewDelegate + +- (void)mapView:(RCTMap *)mapView didUpdateUserLocation:(MKUserLocation *)location +{ + if (mapView.followUserLocation) { + MKCoordinateRegion region; + region.span.latitudeDelta = RCTMapDefaultSpan; + region.span.longitudeDelta = RCTMapDefaultSpan; + region.center = location.coordinate; + [mapView setRegion:region animated:YES]; + + // Move to user location only for the first time it loads up. + mapView.followUserLocation = NO; + } +} + +- (void)mapView:(RCTMap *)mapView regionWillChangeAnimated:(BOOL)animated +{ + [self _regionChanged:mapView]; + + mapView.regionChangeObserveTimer = [NSTimer timerWithTimeInterval:RCTMapRegionChangeObserveInterval + target:self + selector:@selector(_onTick:) + userInfo:@{ @"mapView": mapView } + repeats:YES]; + [[NSRunLoop mainRunLoop] addTimer:mapView.regionChangeObserveTimer forMode:NSRunLoopCommonModes]; +} + +- (void)mapView:(RCTMap *)mapView regionDidChangeAnimated:(BOOL)animated +{ + [self _regionChanged:mapView]; + [self _emitRegionChangeEvent:mapView continuous:NO]; + + [mapView.regionChangeObserveTimer invalidate]; + mapView.regionChangeObserveTimer = nil; +} + +#pragma mark Private + +- (void)_onTick:(NSTimer *)timer +{ + [self _regionChanged:timer.userInfo[@"mapView"]]; +} + +- (void)_regionChanged:(RCTMap *)mapView +{ + BOOL needZoom = NO; + CGFloat newLongitudeDelta = 0.0f; + MKCoordinateRegion region = mapView.region; + // On iOS 7, it's possible that we observe invalid locations during initialization of the map. + // Filter those out. + if (!CLLocationCoordinate2DIsValid(region.center)) { + return; + } + // Calculation on float is not 100% accurate. If user zoom to max/min and then move, it's likely the map will auto zoom to max/min from time to time. + // So let's try to make map zoom back to 99% max or 101% min so that there are some buffer that moving the map won't constantly hitting the max/min bound. + if (mapView.maxDelta > FLT_EPSILON && region.span.longitudeDelta > mapView.maxDelta) { + needZoom = YES; + newLongitudeDelta = mapView.maxDelta * (1 - RCTMapZoomBoundBuffer); + } else if (mapView.minDelta > FLT_EPSILON && region.span.longitudeDelta < mapView.minDelta) { + needZoom = YES; + newLongitudeDelta = mapView.minDelta * (1 + RCTMapZoomBoundBuffer); + } + if (needZoom) { + region.span.latitudeDelta = region.span.latitudeDelta / region.span.longitudeDelta * newLongitudeDelta; + region.span.longitudeDelta = newLongitudeDelta; + mapView.region = region; + } + + // Continously observe region changes + [self _emitRegionChangeEvent:mapView continuous:YES]; +} + +- (void)_emitRegionChangeEvent:(RCTMap *)mapView continuous:(BOOL)continuous +{ + NSDictionary *region = mapView.JSONRegion; + if (region) { + NSDictionary *event = @{ + @"target": [mapView reactTag], + @"continuous": @(continuous), + @"region": mapView.JSONRegion, + }; + [self.bridge.eventDispatcher sendInputEventWithName:@"topChange" body:event]; + } +} + +@end diff --git a/ReactKit/Views/RCTPicker.h b/ReactKit/Views/RCTPicker.h new file mode 100644 index 000000000..cbc55c7f3 --- /dev/null +++ b/ReactKit/Views/RCTPicker.h @@ -0,0 +1,11 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@class RCTEventDispatcher; + +@interface RCTPicker : UIPickerView + +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; + +@end diff --git a/ReactKit/Views/RCTPicker.m b/ReactKit/Views/RCTPicker.m new file mode 100644 index 000000000..1fcb33c1c --- /dev/null +++ b/ReactKit/Views/RCTPicker.m @@ -0,0 +1,91 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTPicker.h" + +#import "RCTConvert.h" +#import "RCTEventDispatcher.h" +#import "RCTUtils.h" +#import "UIView+ReactKit.h" + +const NSInteger UNINITIALIZED_INDEX = -1; + +@interface RCTPicker() +{ + RCTEventDispatcher *_eventDispatcher; + NSArray *_items; + NSInteger _selectedIndex; +} +@end + +@implementation RCTPicker + +- (id)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher +{ + if (self = [super initWithFrame:CGRectZero]) { + _eventDispatcher = eventDispatcher; + _selectedIndex = UNINITIALIZED_INDEX; + self.delegate = self; + } + return self; +} + +- (void)setItems:(NSArray *)items +{ + if (_items != items) { + _items = [items copy]; + [self setNeedsLayout]; + } +} + +- (void)setSelectedIndex:(NSInteger)selectedIndex +{ + if (_selectedIndex != selectedIndex) { + BOOL animated = _selectedIndex != UNINITIALIZED_INDEX; // Don't animate the initial value + _selectedIndex = selectedIndex; + dispatch_async(dispatch_get_main_queue(), ^{ + [self selectRow:selectedIndex inComponent:0 animated:animated]; + }); + } +} + +#pragma mark - UIPickerViewDataSource protocol + +- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView +{ + return 1; +} + +- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component +{ + return [_items count]; +} + +#pragma mark - UIPickerViewDelegate methods + +- (NSDictionary *)itemForRow:(NSInteger)row +{ + return (NSDictionary*)[_items objectAtIndex:row]; +} + +- (id)valueForRow:(NSInteger)row +{ + return [self itemForRow:row][@"value"]; +} + +- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component +{ + return [self itemForRow:row][@"label"]; +} + +- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component +{ + _selectedIndex = row; + NSDictionary *event = @{ + @"target": self.reactTag, + @"newIndex": @(row), + @"newValue": [self valueForRow:row] + }; + + [_eventDispatcher sendInputEventWithName:@"topChange" body:event]; +} +@end diff --git a/ReactKit/Views/RCTPickerManager.h b/ReactKit/Views/RCTPickerManager.h new file mode 100644 index 000000000..49cd74cb7 --- /dev/null +++ b/ReactKit/Views/RCTPickerManager.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTViewManager.h" + +@interface RCTPickerManager : RCTViewManager + +@end diff --git a/ReactKit/Views/RCTPickerManager.m b/ReactKit/Views/RCTPickerManager.m new file mode 100644 index 000000000..320aae0d6 --- /dev/null +++ b/ReactKit/Views/RCTPickerManager.m @@ -0,0 +1,28 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTPickerManager.h" + +#import "RCTBridge.h" +#import "RCTConvert.h" +#import "RCTPicker.h" + +@implementation RCTPickerManager + +- (UIView *)view +{ + return [[RCTPicker alloc] initWithEventDispatcher:self.bridge.eventDispatcher]; +} + +RCT_EXPORT_VIEW_PROPERTY(items) +RCT_EXPORT_VIEW_PROPERTY(selectedIndex) + +- (NSDictionary *)constantsToExport +{ + RCTPicker *pv = [[RCTPicker alloc] init]; + return @{ + @"ComponentHeight": @(CGRectGetHeight(pv.frame)), + @"ComponentWidth": @(CGRectGetWidth(pv.frame)) + }; +} + +@end diff --git a/ReactKit/Views/RCTTextField.m b/ReactKit/Views/RCTTextField.m index b684517b3..0dca73daa 100644 --- a/ReactKit/Views/RCTTextField.m +++ b/ReactKit/Views/RCTTextField.m @@ -17,7 +17,7 @@ - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher { if ((self = [super initWithFrame:CGRectZero])) { - + _eventDispatcher = eventDispatcher; [self addTarget:self action:@selector(_textFieldDidChange) forControlEvents:UIControlEventEditingChanged]; [self addTarget:self action:@selector(_textFieldBeginEditing) forControlEvents:UIControlEventEditingDidBegin]; @@ -40,7 +40,7 @@ - (void)removeReactSubview:(UIView *)subview { // TODO: this is a bit broken - if the TextField inserts any of - // it's own views below or between React's, the indices won't match + // its own views below or between React's, the indices won't match [_reactSubviews removeObject:subview]; [subview removeFromSuperview]; } @@ -48,7 +48,7 @@ - (void)insertReactSubview:(UIView *)view atIndex:(NSInteger)atIndex { // TODO: this is a bit broken - if the TextField inserts any of - // it's own views below or between React's, the indices won't match + // its own views below or between React's, the indices won't match [_reactSubviews insertObject:view atIndex:atIndex]; [super insertSubview:view atIndex:atIndex]; } @@ -74,7 +74,7 @@ - (void)setAutoCorrect:(BOOL)autoCorrect { - [super setAutocorrectionType:(autoCorrect ? UITextAutocorrectionTypeYes : UITextAutocorrectionTypeNo)]; + self.autocorrectionType = (autoCorrect ? UITextAutocorrectionTypeYes : UITextAutocorrectionTypeNo); } - (BOOL)autoCorrect @@ -117,7 +117,6 @@ RCT_TEXT_EVENT_HANDLER(_textFieldSubmitEditing, RCTTextEventTypeSubmit) return result; } -// Prevent native from becoming first responder (TODO: why?) - (BOOL)canBecomeFirstResponder { return _jsRequestingFirstResponder; diff --git a/ReactKit/Views/RCTTextFieldManager.m b/ReactKit/Views/RCTTextFieldManager.m index 4f46c0dff..52b29dc36 100644 --- a/ReactKit/Views/RCTTextFieldManager.m +++ b/ReactKit/Views/RCTTextFieldManager.m @@ -20,7 +20,6 @@ RCT_REMAP_VIEW_PROPERTY(autoCapitalize, autocapitalizationType) RCT_EXPORT_VIEW_PROPERTY(enabled) RCT_EXPORT_VIEW_PROPERTY(placeholder) RCT_EXPORT_VIEW_PROPERTY(text) -RCT_EXPORT_VIEW_PROPERTY(font) RCT_EXPORT_VIEW_PROPERTY(clearButtonMode) RCT_EXPORT_VIEW_PROPERTY(keyboardType) RCT_REMAP_VIEW_PROPERTY(color, textColor) diff --git a/package.json b/package.json index f0af6823e..13a3467e8 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "scriptPreprocessor": "jestSupport/scriptPreprocess.js", "setupEnvScriptFile": "jestSupport/env.js", "testPathIgnorePatterns": [ - "/node_modules/" + "/node_modules/", + "packager/react-packager/src/Activity/" ], "testFileExtensions": [ "js" From 62947e5b71f7f6a616875516eb0864df31b802c4 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Wed, 11 Mar 2015 12:29:36 -0700 Subject: [PATCH 27/79] Updates from Wed Mar 11 - [ReactNative] Remove duplicate example entries | Spencer Ahrens - Unforked RKNavigator, RKScrollView and RKView | Nick Lockwood --- .../UIExplorer/ActivityIndicatorExample.js | 2 - Examples/UIExplorer/AdSupportIOSExample.js | 3 - Examples/UIExplorer/CameraRollExample.ios.js | 2 - Examples/UIExplorer/DatePickerExample.js | 2 - Examples/UIExplorer/ExpandingTextExample.js | 2 - Examples/UIExplorer/GeolocationExample.js | 2 - Examples/UIExplorer/ImageExample.js | 2 - Examples/UIExplorer/LayoutExample.js | 2 - Examples/UIExplorer/ListViewSimpleExample.js | 2 - Examples/UIExplorer/MapViewExample.js | 2 - Examples/UIExplorer/NavigatorIOSExample.js | 2 - Examples/UIExplorer/PickerExample.js | 2 - Examples/UIExplorer/PointerEventsExample.js | 2 - Examples/UIExplorer/ScrollViewExample.js | 2 - Examples/UIExplorer/SliderExample.js | 2 - Examples/UIExplorer/StatusBarIOSExample.js | 2 - Examples/UIExplorer/SwitchExample.js | 2 - Examples/UIExplorer/TabBarExample.js | 2 - Examples/UIExplorer/TextExample.ios.js | 2 - Examples/UIExplorer/TextInputExample.js | 2 - Examples/UIExplorer/TouchableExample.js | 2 - .../UIExplorer.xcodeproj/project.pbxproj | 56 ++-- Examples/UIExplorer/ViewExample.js | 2 - Libraries/AdSupport/RCTAdSupport.h | 2 + Libraries/AdSupport/RCTAdSupport.m | 2 - ReactKit/Base/RCTConvert.h | 10 +- ReactKit/Base/RCTConvert.m | 131 ++++----- ReactKit/Modules/RCTStatusBarManager.m | 12 +- ReactKit/Modules/RCTUIManager.m | 19 -- ReactKit/Views/RCTScrollView.m | 28 +- ReactKit/Views/RCTScrollViewManager.m | 23 ++ ReactKit/Views/RCTScrollableProtocol.h | 2 +- ReactKit/Views/RCTTabBar.m | 1 - ReactKit/Views/RCTView.h | 17 ++ ReactKit/Views/RCTView.m | 251 ++++++++++++++++++ ReactKit/Views/RCTWrapperViewController.m | 4 +- 36 files changed, 418 insertions(+), 185 deletions(-) diff --git a/Examples/UIExplorer/ActivityIndicatorExample.js b/Examples/UIExplorer/ActivityIndicatorExample.js index ec96febd5..3371551a0 100644 --- a/Examples/UIExplorer/ActivityIndicatorExample.js +++ b/Examples/UIExplorer/ActivityIndicatorExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule ActivityIndicatorExample */ 'use strict'; diff --git a/Examples/UIExplorer/AdSupportIOSExample.js b/Examples/UIExplorer/AdSupportIOSExample.js index 1da508fd9..63f3a63eb 100644 --- a/Examples/UIExplorer/AdSupportIOSExample.js +++ b/Examples/UIExplorer/AdSupportIOSExample.js @@ -1,9 +1,6 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule AdSupportIOSExample */ -/* eslint no-console: 0 */ 'use strict'; var AdSupportIOS = require('AdSupportIOS'); diff --git a/Examples/UIExplorer/CameraRollExample.ios.js b/Examples/UIExplorer/CameraRollExample.ios.js index 8037f536f..31634d583 100644 --- a/Examples/UIExplorer/CameraRollExample.ios.js +++ b/Examples/UIExplorer/CameraRollExample.ios.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule CameraRollExample */ 'use strict'; diff --git a/Examples/UIExplorer/DatePickerExample.js b/Examples/UIExplorer/DatePickerExample.js index a212546f4..ab8b17625 100644 --- a/Examples/UIExplorer/DatePickerExample.js +++ b/Examples/UIExplorer/DatePickerExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule DatePickerExample */ 'use strict'; diff --git a/Examples/UIExplorer/ExpandingTextExample.js b/Examples/UIExplorer/ExpandingTextExample.js index 74d6eb300..2a2f61fc8 100644 --- a/Examples/UIExplorer/ExpandingTextExample.js +++ b/Examples/UIExplorer/ExpandingTextExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule ExpandingTextExample */ 'use strict'; diff --git a/Examples/UIExplorer/GeolocationExample.js b/Examples/UIExplorer/GeolocationExample.js index fac3dd205..78ba29b9d 100644 --- a/Examples/UIExplorer/GeolocationExample.js +++ b/Examples/UIExplorer/GeolocationExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule GeolocationExample */ /* eslint no-console: 0 */ 'use strict'; diff --git a/Examples/UIExplorer/ImageExample.js b/Examples/UIExplorer/ImageExample.js index 00a8b39e6..12b4d8843 100644 --- a/Examples/UIExplorer/ImageExample.js +++ b/Examples/UIExplorer/ImageExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule ImageExample */ 'use strict'; diff --git a/Examples/UIExplorer/LayoutExample.js b/Examples/UIExplorer/LayoutExample.js index 746ef0ac6..2586694ec 100644 --- a/Examples/UIExplorer/LayoutExample.js +++ b/Examples/UIExplorer/LayoutExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule LayoutExample */ 'use strict'; diff --git a/Examples/UIExplorer/ListViewSimpleExample.js b/Examples/UIExplorer/ListViewSimpleExample.js index c6b158f03..c0a84fc54 100644 --- a/Examples/UIExplorer/ListViewSimpleExample.js +++ b/Examples/UIExplorer/ListViewSimpleExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. -* -* @provides ListViewSimpleExample */ 'use strict'; diff --git a/Examples/UIExplorer/MapViewExample.js b/Examples/UIExplorer/MapViewExample.js index 2094624be..c13341dc7 100644 --- a/Examples/UIExplorer/MapViewExample.js +++ b/Examples/UIExplorer/MapViewExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule MapViewExample */ 'use strict'; diff --git a/Examples/UIExplorer/NavigatorIOSExample.js b/Examples/UIExplorer/NavigatorIOSExample.js index fa998528f..1d09d32a3 100644 --- a/Examples/UIExplorer/NavigatorIOSExample.js +++ b/Examples/UIExplorer/NavigatorIOSExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule NavigatorIOSExample */ 'use strict'; diff --git a/Examples/UIExplorer/PickerExample.js b/Examples/UIExplorer/PickerExample.js index 3a77fa74d..53f717bf3 100644 --- a/Examples/UIExplorer/PickerExample.js +++ b/Examples/UIExplorer/PickerExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule PickerExample */ 'use strict'; diff --git a/Examples/UIExplorer/PointerEventsExample.js b/Examples/UIExplorer/PointerEventsExample.js index 10600d54d..be9f5a521 100644 --- a/Examples/UIExplorer/PointerEventsExample.js +++ b/Examples/UIExplorer/PointerEventsExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule PointerEventsExample */ 'use strict'; diff --git a/Examples/UIExplorer/ScrollViewExample.js b/Examples/UIExplorer/ScrollViewExample.js index 68df23b1d..0dca6b3be 100644 --- a/Examples/UIExplorer/ScrollViewExample.js +++ b/Examples/UIExplorer/ScrollViewExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule ScrollViewExample */ 'use strict'; diff --git a/Examples/UIExplorer/SliderExample.js b/Examples/UIExplorer/SliderExample.js index 0ff4f6713..d1ff73779 100644 --- a/Examples/UIExplorer/SliderExample.js +++ b/Examples/UIExplorer/SliderExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule SliderExample */ 'use strict'; diff --git a/Examples/UIExplorer/StatusBarIOSExample.js b/Examples/UIExplorer/StatusBarIOSExample.js index 1ee83419a..bca275501 100644 --- a/Examples/UIExplorer/StatusBarIOSExample.js +++ b/Examples/UIExplorer/StatusBarIOSExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule StatusBarIOSExample */ 'use strict'; diff --git a/Examples/UIExplorer/SwitchExample.js b/Examples/UIExplorer/SwitchExample.js index 9aa63833f..23538e169 100644 --- a/Examples/UIExplorer/SwitchExample.js +++ b/Examples/UIExplorer/SwitchExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule SwitchExample */ 'use strict'; diff --git a/Examples/UIExplorer/TabBarExample.js b/Examples/UIExplorer/TabBarExample.js index 22dc86a8b..34518284d 100644 --- a/Examples/UIExplorer/TabBarExample.js +++ b/Examples/UIExplorer/TabBarExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule TabBarExample */ 'use strict'; diff --git a/Examples/UIExplorer/TextExample.ios.js b/Examples/UIExplorer/TextExample.ios.js index a0d5eba33..1894b31ff 100644 --- a/Examples/UIExplorer/TextExample.ios.js +++ b/Examples/UIExplorer/TextExample.ios.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule TextExample */ 'use strict'; diff --git a/Examples/UIExplorer/TextInputExample.js b/Examples/UIExplorer/TextInputExample.js index e1f28895b..bce5de9d8 100644 --- a/Examples/UIExplorer/TextInputExample.js +++ b/Examples/UIExplorer/TextInputExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule TextInputExample */ 'use strict'; diff --git a/Examples/UIExplorer/TouchableExample.js b/Examples/UIExplorer/TouchableExample.js index 66a919a3c..4226ec18a 100644 --- a/Examples/UIExplorer/TouchableExample.js +++ b/Examples/UIExplorer/TouchableExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule TouchableExample */ 'use strict'; diff --git a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj index d9a201502..c1f6820cc 100644 --- a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj +++ b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj @@ -12,12 +12,12 @@ 134180011AA9153C003F314A /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FEF1AA914B8003F314A /* libRCTText.a */; }; 134180021AA9153C003F314A /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FFF1AA91531003F314A /* libReactKit.a */; }; 1341802C1AA9178B003F314A /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1341802B1AA91779003F314A /* libRCTNetwork.a */; }; + 134454601AAFCABD003F0779 /* libRCTAdSupport.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1344545A1AAFCAAE003F0779 /* libRCTAdSupport.a */; }; 134A8A2A1AACED7A00945AAE /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 134A8A251AACED6A00945AAE /* libRCTGeolocation.a */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 832C81C71AAF73C5007FA2F7 /* libRCTAdSupport.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832C81A61AAF6EFF007FA2F7 /* libRCTAdSupport.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -56,6 +56,13 @@ remoteGlobalIDString = 58B511DB1A9E6C8500147676; remoteInfo = RCTNetwork; }; + 134454591AAFCAAE003F0779 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 134454551AAFCAAE003F0779 /* RCTAdSupport.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; + remoteInfo = RCTAdSupport; + }; 134A8A241AACED6A00945AAE /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 134A8A201AACED6A00945AAE /* RCTGeolocation.xcodeproj */; @@ -63,13 +70,6 @@ remoteGlobalIDString = 134814201AA4EA6300B7C361; remoteInfo = RCTGeolocation; }; - 832C81A51AAF6EFF007FA2F7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 832C81A11AAF6EFE007FA2F7 /* RCTAdSupport.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; - remoteInfo = RCTAdSupport; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -80,6 +80,7 @@ 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; 13417FFA1AA91531003F314A /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = ""; }; 134180261AA91779003F314A /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = ../../Libraries/Network/RCTNetwork.xcodeproj; sourceTree = ""; }; + 134454551AAFCAAE003F0779 /* RCTAdSupport.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAdSupport.xcodeproj; path = ../../Libraries/AdSupport/RCTAdSupport.xcodeproj; sourceTree = ""; }; 134A8A201AACED6A00945AAE /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = ../../Libraries/Geolocation/RCTGeolocation.xcodeproj; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* UIExplorer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UIExplorer.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; @@ -88,7 +89,6 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 832C81A11AAF6EFE007FA2F7 /* RCTAdSupport.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAdSupport.xcodeproj; path = ../../Libraries/AdSupport/RCTAdSupport.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -103,7 +103,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 832C81C71AAF73C5007FA2F7 /* libRCTAdSupport.a in Frameworks */, + 134454601AAFCABD003F0779 /* libRCTAdSupport.a in Frameworks */, 134A8A2A1AACED7A00945AAE /* libRCTGeolocation.a in Frameworks */, 1341802C1AA9178B003F314A /* libRCTNetwork.a in Frameworks */, 134180011AA9153C003F314A /* libRCTText.a in Frameworks */, @@ -136,7 +136,7 @@ isa = PBXGroup; children = ( 13417FFA1AA91531003F314A /* ReactKit.xcodeproj */, - 832C81A11AAF6EFE007FA2F7 /* RCTAdSupport.xcodeproj */, + 134454551AAFCAAE003F0779 /* RCTAdSupport.xcodeproj */, 134A8A201AACED6A00945AAE /* RCTGeolocation.xcodeproj */, 13417FE31AA91428003F314A /* RCTImage.xcodeproj */, 134180261AA91779003F314A /* RCTNetwork.xcodeproj */, @@ -177,6 +177,14 @@ name = Products; sourceTree = ""; }; + 134454561AAFCAAE003F0779 /* Products */ = { + isa = PBXGroup; + children = ( + 1344545A1AAFCAAE003F0779 /* libRCTAdSupport.a */, + ); + name = Products; + sourceTree = ""; + }; 134A8A211AACED6A00945AAE /* Products */ = { isa = PBXGroup; children = ( @@ -198,14 +206,6 @@ name = UIExplorer; sourceTree = ""; }; - 832C81A21AAF6EFE007FA2F7 /* Products */ = { - isa = PBXGroup; - children = ( - 832C81A61AAF6EFF007FA2F7 /* libRCTAdSupport.a */, - ); - name = Products; - sourceTree = ""; - }; 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( @@ -291,8 +291,8 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 832C81A21AAF6EFE007FA2F7 /* Products */; - ProjectRef = 832C81A11AAF6EFE007FA2F7 /* RCTAdSupport.xcodeproj */; + ProductGroup = 134454561AAFCAAE003F0779 /* Products */; + ProjectRef = 134454551AAFCAAE003F0779 /* RCTAdSupport.xcodeproj */; }, { ProductGroup = 134A8A211AACED6A00945AAE /* Products */; @@ -352,6 +352,13 @@ remoteRef = 1341802A1AA91779003F314A /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 1344545A1AAFCAAE003F0779 /* libRCTAdSupport.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTAdSupport.a; + remoteRef = 134454591AAFCAAE003F0779 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 134A8A251AACED6A00945AAE /* libRCTGeolocation.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -359,13 +366,6 @@ remoteRef = 134A8A241AACED6A00945AAE /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 832C81A61AAF6EFF007FA2F7 /* libRCTAdSupport.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTAdSupport.a; - remoteRef = 832C81A51AAF6EFF007FA2F7 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ diff --git a/Examples/UIExplorer/ViewExample.js b/Examples/UIExplorer/ViewExample.js index 660c191bb..eb2288a49 100644 --- a/Examples/UIExplorer/ViewExample.js +++ b/Examples/UIExplorer/ViewExample.js @@ -1,7 +1,5 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule ViewExample */ 'use strict'; diff --git a/Libraries/AdSupport/RCTAdSupport.h b/Libraries/AdSupport/RCTAdSupport.h index 2fbd3a8c0..0d52b4d2e 100644 --- a/Libraries/AdSupport/RCTAdSupport.h +++ b/Libraries/AdSupport/RCTAdSupport.h @@ -1,5 +1,7 @@ // Copyright 2004-present Facebook. All Rights Reserved. +#import + #import "RCTBridgeModule.h" @interface RCTAdSupport : NSObject diff --git a/Libraries/AdSupport/RCTAdSupport.m b/Libraries/AdSupport/RCTAdSupport.m index 0cff24012..3712b1b9b 100644 --- a/Libraries/AdSupport/RCTAdSupport.m +++ b/Libraries/AdSupport/RCTAdSupport.m @@ -2,8 +2,6 @@ #import "RCTAdSupport.h" -#import - @implementation RCTAdSupport - (void)getAdvertisingId:(RCTResponseSenderBlock)callback withErrorCallback:(RCTResponseSenderBlock)errorCallback diff --git a/ReactKit/Base/RCTConvert.h b/ReactKit/Base/RCTConvert.h index 709410f17..47c1cc2ed 100644 --- a/ReactKit/Base/RCTConvert.h +++ b/ReactKit/Base/RCTConvert.h @@ -19,12 +19,13 @@ + (float)float:(id)json; + (int)int:(id)json; ++ (NSInteger)NSInteger:(id)json; ++ (NSUInteger)NSUInteger:(id)json; + + (NSArray *)NSArray:(id)json; + (NSDictionary *)NSDictionary:(id)json; + (NSString *)NSString:(id)json; + (NSNumber *)NSNumber:(id)json; -+ (NSInteger)NSInteger:(id)json; -+ (NSUInteger)NSUInteger:(id)json; + (NSURL *)NSURL:(id)json; + (NSURLRequest *)NSURLRequest:(id)json; @@ -57,6 +58,11 @@ + (UIFont *)UIFont:(UIFont *)font withFamily:(id)json; + (UIFont *)UIFont:(UIFont *)font withFamily:(id)json size:(id)json weight:(id)json; ++ (NSArray *)NSStringArray:(id)json; ++ (NSArray *)NSNumberArray:(id)json; ++ (NSArray *)UIColorArray:(id)json; ++ (NSArray *)CGColorArray:(id)json; + + (BOOL)css_overflow:(id)json; + (css_flex_direction_t)css_flex_direction_t:(id)json; + (css_justify_t)css_justify_t:(id)json; diff --git a/ReactKit/Base/RCTConvert.m b/ReactKit/Base/RCTConvert.m index a2dcea511..7a47b1fe0 100644 --- a/ReactKit/Base/RCTConvert.m +++ b/ReactKit/Base/RCTConvert.m @@ -92,6 +92,19 @@ RCT_CONVERTER_CUSTOM(type, name, [json getter]) } \ } +#define RCT_ARRAY_CONVERTER(type) \ ++ (NSArray *)type##Array:(id)json \ +{ \ + NSMutableArray *values = [[NSMutableArray alloc] init]; \ + for (id jsonValue in [self NSArray:json]) { \ + id value = [self type:jsonValue]; \ + if (!value) { \ + [values addObject:value]; \ + } \ + } \ + return values; \ +} + @implementation RCTConvert RCT_CONVERTER(BOOL, BOOL, boolValue) @@ -99,12 +112,13 @@ RCT_CONVERTER(double, double, doubleValue) RCT_CONVERTER(float, float, floatValue) RCT_CONVERTER(int, int, intValue) +RCT_CONVERTER(NSInteger, NSInteger, integerValue) +RCT_CONVERTER_CUSTOM(NSUInteger, NSUInteger, [json unsignedIntegerValue]) + RCT_CONVERTER_CUSTOM(NSArray *, NSArray, [NSArray arrayWithArray:json]) RCT_CONVERTER_CUSTOM(NSDictionary *, NSDictionary, [NSDictionary dictionaryWithDictionary:json]) RCT_CONVERTER(NSString *, NSString, description) RCT_CONVERTER_CUSTOM(NSNumber *, NSNumber, @([json doubleValue])) -RCT_CONVERTER(NSInteger, NSInteger, integerValue) -RCT_CONVERTER_CUSTOM(NSUInteger, NSUInteger, [json unsignedIntegerValue]) + (NSURL *)NSURL:(id)json { @@ -137,17 +151,12 @@ RCT_CONVERTER_CUSTOM(NSTimeInterval, NSTimeInterval, [json doubleValue] / 1000.0 // JS standard for time zones is minutes. RCT_CONVERTER_CUSTOM(NSTimeZone *, NSTimeZone, [NSTimeZone timeZoneForSecondsFromGMT:[json doubleValue] * 60.0]) -/** - * NOTE: We don't deliberately don't support NSTextAlignmentJustified in the - * X-platform RCTText implementation because it isn't available on Android. - * We may wish to support this for iOS-specific controls such as UILabel. - */ RCT_ENUM_CONVERTER(NSTextAlignment, (@{ @"auto": @(NSTextAlignmentNatural), @"left": @(NSTextAlignmentLeft), @"center": @(NSTextAlignmentCenter), @"right": @(NSTextAlignmentRight), - /* @"justify": @(NSTextAlignmentJustify), */ + @"justify": @(NSTextAlignmentJustified), }), NSTextAlignmentNatural, integerValue) RCT_ENUM_CONVERTER(NSWritingDirection, (@{ @@ -491,7 +500,7 @@ RCT_STRUCT_CONVERTER(CGAffineTransform, (@[@"a", @"b", @"c", @"d", @"tx", @"ty"] } // Get font family - NSString *familyName = [RCTConvert NSString:family]; + NSString *familyName = [self NSString:family]; if (familyName) { if ([UIFont fontNamesForFamilyName:familyName].count == 0) { font = [UIFont fontWithName:familyName size:fontDescriptor.pointSize]; @@ -511,7 +520,7 @@ RCT_STRUCT_CONVERTER(CGAffineTransform, (@[@"a", @"b", @"c", @"d", @"tx", @"ty"] } // Get font weight - NSString *fontWeight = [RCTConvert NSString:weight]; + NSString *fontWeight = [self NSString:weight]; if (fontWeight) { static NSSet *values; @@ -539,6 +548,20 @@ RCT_STRUCT_CONVERTER(CGAffineTransform, (@[@"a", @"b", @"c", @"d", @"tx", @"ty"] return [UIFont fontWithDescriptor:fontDescriptor size:fontDescriptor.pointSize]; } +RCT_ARRAY_CONVERTER(NSString) +RCT_ARRAY_CONVERTER(NSNumber) +RCT_ARRAY_CONVERTER(UIColor) + +// Can't use RCT_ARRAY_CONVERTER due to bridged cast ++ (NSArray *)CGColorArray:(id)json +{ + NSMutableArray *colors = [[NSMutableArray alloc] init]; + for (id value in [self NSArray:json]) { + [colors addObject:(__bridge id)[self CGColor:value]]; + } + return colors; +} + typedef BOOL css_overflow; RCT_ENUM_CONVERTER(css_overflow, (@{ @@ -596,15 +619,31 @@ RCT_ENUM_CONVERTER(RCTAnimationType, (@{ static NSString *RCTGuessTypeEncoding(id target, NSString *key, id value, NSString *encoding) { + /** + * NOTE: the property names below may seem weird, but it's + * because they are tested as case-sensitive suffixes, so + * "ffset" will match any of the following + * + * - offset + * - contentOffset + */ + // TODO (#5906496): handle more cases - if ([key rangeOfString:@"color" options:NSCaseInsensitiveSearch].location != NSNotFound) { + if ([key hasSuffix:@"olor"]) { if ([target isKindOfClass:[CALayer class]]) { return @(@encode(CGColorRef)); } else { return @"@\"UIColor\""; } + } else if ([key hasSuffix:@"Inset"] || [key hasSuffix:@"Insets"]) { + return @(@encode(UIEdgeInsets)); + } else if ([key hasSuffix:@"rame"] || [key hasSuffix:@"ounds"]) { + return @(@encode(CGRect)); + } else if ([key hasSuffix:@"ffset"] || [key hasSuffix:@"osition"]) { + return @(@encode(CGPoint)); + } else if ([key hasSuffix:@"ize"]) { + return @(@encode(CGSize)); } - return nil; } @@ -690,7 +729,8 @@ static id RCTConvertValueWithEncoding(id value, NSString *encoding) return converter ? converter(value) : value; } -static NSString *RCTPropertyEncoding(id target, NSString *key, id value) { +static NSString *RCTPropertyEncoding(id target, NSString *key, id value) +{ // Check target class for property definition NSString *encoding = nil; objc_property_t property = class_getProperty([target class], [key UTF8String]); @@ -728,15 +768,16 @@ static NSString *RCTPropertyEncoding(id target, NSString *key, id value) { } - return encoding; + // id encoding means unknown, as opposed to nil which means no setter exists. + return encoding ?: @(@encode(id)); } -static id RCTConvertValueWithExplicitEncoding(id target, NSString *key, id json, NSString *encoding) { - if (!encoding) return nil; - +static id RCTConvertValueWithExplicitEncoding(id target, NSString *key, id json, NSString *encoding) +{ // Special case for numeric encodings, which may be enums if ([json isKindOfClass:[NSString class]] && - [@"iIsSlLqQ" rangeOfString:[encoding substringToIndex:1]].length) { + ([encoding isEqualToString:@(@encode(id))] || + [@"iIsSlLqQ" rangeOfString:[encoding substringToIndex:1]].length)) { /** * NOTE: the property names below may seem weird, but it's @@ -780,7 +821,8 @@ static id RCTConvertValueWithExplicitEncoding(id target, NSString *key, id json, return RCTConvertValueWithEncoding(json, encoding); } -id RCTConvertValue(id target, NSString *key, id json) { +id RCTConvertValue(id target, NSString *key, id json) +{ NSString *encoding = RCTPropertyEncoding(target, key, json); return RCTConvertValueWithExplicitEncoding(target, key, json, encoding); } @@ -797,54 +839,15 @@ BOOL RCTSetProperty(id target, NSString *keypath, id value) } } + // Get encoding NSString *encoding = RCTPropertyEncoding(target, key, value); - if (!encoding) return NO; - - value = RCTConvertValueWithExplicitEncoding(target, keypath, value, encoding); - - // Special case for numeric encodings, which may be enums - if ([value isKindOfClass:[NSString class]] && - [@"iIsSlLqQ" rangeOfString:[encoding substringToIndex:1]].location != NSNotFound) { - - /** - * NOTE: the property names below may seem weird, but it's - * because they are tested as case-sensitive suffixes, so - * "apitalizationType" will match any of the following - * - * - capitalizationType - * - autocapitalizationType - * - autoCapitalizationType - * - titleCapitalizationType - * - etc. - */ - static NSDictionary *converters = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - converters = - @{ - @"apitalizationType": ^(id val) { - return [RCTConvert UITextAutocapitalizationType:val]; - }, - @"eyboardType": ^(id val) { - return [RCTConvert UIKeyboardType:val]; - }, - @"extAlignment": ^(id val) { - return [RCTConvert NSTextAlignment:val]; - }, - @"ointerEvents": ^(id val) { - return [RCTConvert RCTPointerEvents:val]; - }, - }; - }); - for (NSString *subkey in converters) { - if ([key hasSuffix:subkey]) { - NSInteger (^converter)(NSString *) = converters[subkey]; - value = @(converter(value)); - break; - } - } + if (!encoding) { + return NO; } + // Convert value + value = RCTConvertValueWithExplicitEncoding(target, keypath, value, encoding); + // Another nasty special case if ([target isKindOfClass:[UITextField class]]) { static NSDictionary *specialCases = nil; diff --git a/ReactKit/Modules/RCTStatusBarManager.m b/ReactKit/Modules/RCTStatusBarManager.m index b391dc6bd..c9639f070 100644 --- a/ReactKit/Modules/RCTStatusBarManager.m +++ b/ReactKit/Modules/RCTStatusBarManager.m @@ -11,18 +11,18 @@ static BOOL RCTViewControllerBasedStatusBarAppearance() static BOOL value; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - value = [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIViewControllerBasedStatusBarAppearance"] boolValue]; + value = [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIViewControllerBasedStatusBarAppearance"] ?: @YES boolValue]; }); - + return value; } - (void)setStyle:(UIStatusBarStyle)statusBarStyle animated:(BOOL)animated { RCT_EXPORT(); - + dispatch_async(dispatch_get_main_queue(), ^{ - + if (RCTViewControllerBasedStatusBarAppearance()) { RCTLogError(@"RCTStatusBarManager module requires that the \ UIViewControllerBasedStatusBarAppearance key in the Info.plist is set to NO"); @@ -36,9 +36,9 @@ static BOOL RCTViewControllerBasedStatusBarAppearance() - (void)setHidden:(BOOL)hidden withAnimation:(UIStatusBarAnimation)animation { RCT_EXPORT(); - + dispatch_async(dispatch_get_main_queue(), ^{ - + if (RCTViewControllerBasedStatusBarAppearance()) { RCTLogError(@"RCTStatusBarManager module requires that the \ UIViewControllerBasedStatusBarAppearance key in the Info.plist is set to NO"); diff --git a/ReactKit/Modules/RCTUIManager.m b/ReactKit/Modules/RCTUIManager.m index ae69890d3..98b10dfa0 100644 --- a/ReactKit/Modules/RCTUIManager.m +++ b/ReactKit/Modules/RCTUIManager.m @@ -1058,25 +1058,6 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView }]; } -- (void)getScrollViewContentSize:(NSNumber *)reactTag callback:(RCTResponseSenderBlock)callback failCallback:(RCTResponseSenderBlock)failCallback -{ - RCT_EXPORT(); - - [self addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) { - UIView *view = viewRegistry[reactTag]; - if (!view) { - NSString *error = [[NSString alloc] initWithFormat:@"cannot find view with tag %@", reactTag]; - RCTLogError(@"%@", error); - failCallback(@[@{@"error": error}]); - return; - } - - CGSize size = ((id)view).contentSize; - NSDictionary *dict = @{@"width" : @(size.width), @"height" : @(size.height)}; - callback(@[dict]); - }]; -} - /** * JS sets what *it* considers to be the responder. Later, scroll views can use * this in order to determine if scrolling is appropriate. diff --git a/ReactKit/Views/RCTScrollView.m b/ReactKit/Views/RCTScrollView.m index bd03d45de..55b6690c9 100644 --- a/ReactKit/Views/RCTScrollView.m +++ b/ReactKit/Views/RCTScrollView.m @@ -259,14 +259,14 @@ CGFloat const ZINDEX_STICKY_HEADER = 50; - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher { if ((self = [super initWithFrame:CGRectZero])) { - + _eventDispatcher = eventDispatcher; _scrollView = [[RCTCustomScrollView alloc] initWithFrame:CGRectZero]; _scrollView.delegate = self; _scrollView.delaysContentTouches = NO; _automaticallyAdjustContentInsets = YES; _contentInset = UIEdgeInsetsZero; - + _throttleScrollCallbackMS = 0; _lastScrollDispatchTime = CACurrentMediaTime(); _cachedChildFrames = [[NSMutableArray alloc] init]; @@ -337,6 +337,8 @@ CGFloat const ZINDEX_STICKY_HEADER = 50; [RCTView autoAdjustInsetsForView:self withScrollView:_scrollView updateOffset:YES]; + + [self updateClippedSubviews]; } - (void)setContentInset:(UIEdgeInsets)contentInset @@ -387,9 +389,11 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidZoom, RCTScrollEventTypeMove) - (void)scrollViewDidScroll:(UIScrollView *)scrollView { + [self updateClippedSubviews]; + NSTimeInterval now = CACurrentMediaTime(); NSTimeInterval throttleScrollCallbackSeconds = _throttleScrollCallbackMS / 1000.0; - + /** * TODO: this logic looks wrong, and it may be because it is. Currently, if _throttleScrollCallbackMS * is set to zero (the default), the "didScroll" event is only sent once per scroll, instead of repeatedly @@ -398,11 +402,11 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidZoom, RCTScrollEventTypeMove) */ if (_allowNextScrollNoMatterWhat || (_throttleScrollCallbackMS != 0 && throttleScrollCallbackSeconds < (now - _lastScrollDispatchTime))) { - + // Calculate changed frames NSMutableArray *updatedChildFrames = [[NSMutableArray alloc] init]; [[_contentView reactSubviews] enumerateObjectsUsingBlock:^(UIView *subview, NSUInteger idx, BOOL *stop) { - + // Check if new or changed CGRect newFrame = subview.frame; BOOL frameChanged = NO; @@ -413,7 +417,7 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidZoom, RCTScrollEventTypeMove) frameChanged = YES; _cachedChildFrames[idx] = [NSValue valueWithCGRect:newFrame]; } - + // Create JS frame object if (frameChanged) { [updatedChildFrames addObject: @{ @@ -424,9 +428,9 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidZoom, RCTScrollEventTypeMove) @"height": @(newFrame.size.height), }]; } - + }]; - + // If there are new frames, add them to event data NSDictionary *userData = nil; if (updatedChildFrames.count > 0) { @@ -568,13 +572,7 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidZoom, RCTScrollEventTypeMove) - (BOOL)respondsToSelector:(SEL)aSelector { - if ([super respondsToSelector:aSelector]) { - return YES; - } - if ([NSStringFromSelector(aSelector) hasPrefix:@"set"]) { - return [_scrollView respondsToSelector:aSelector]; - } - return NO; + return [super respondsToSelector:aSelector] || [_scrollView respondsToSelector:aSelector]; } - (void)setValue:(id)value forUndefinedKey:(NSString *)key diff --git a/ReactKit/Views/RCTScrollViewManager.m b/ReactKit/Views/RCTScrollViewManager.m index 6247dadb6..470c2c3f2 100644 --- a/ReactKit/Views/RCTScrollViewManager.m +++ b/ReactKit/Views/RCTScrollViewManager.m @@ -5,6 +5,8 @@ #import "RCTBridge.h" #import "RCTConvert.h" #import "RCTScrollView.h" +#import "RCTSparseArray.h" +#import "RCTUIManager.h" @implementation RCTScrollViewManager @@ -52,4 +54,25 @@ RCT_EXPORT_VIEW_PROPERTY(contentOffset); }; } +- (void)getContentSize:(NSNumber *)reactTag + callback:(RCTResponseSenderBlock)callback +{ + RCT_EXPORT(); + + [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) { + + UIView *view = viewRegistry[reactTag]; + if (!view) { + RCTLogError(@"Cannot find view with tag %@", reactTag); + return; + } + + CGSize size = ((id)view).contentSize; + callback(@[@{ + @"width" : @(size.width), + @"height" : @(size.height) + }]); + }]; +} + @end diff --git a/ReactKit/Views/RCTScrollableProtocol.h b/ReactKit/Views/RCTScrollableProtocol.h index a0ae7b611..8232449f1 100644 --- a/ReactKit/Views/RCTScrollableProtocol.h +++ b/ReactKit/Views/RCTScrollableProtocol.h @@ -8,7 +8,7 @@ */ @protocol RCTScrollableProtocol -@property (nonatomic, readwrite, weak) NSObject *nativeMainScrollDelegate; +@property (nonatomic, weak) NSObject *nativeMainScrollDelegate; @property (nonatomic, readonly) CGSize contentSize; - (void)scrollToOffset:(CGPoint)offset; diff --git a/ReactKit/Views/RCTTabBar.m b/ReactKit/Views/RCTTabBar.m index 9f49fbcaf..d9a0ef39a 100644 --- a/ReactKit/Views/RCTTabBar.m +++ b/ReactKit/Views/RCTTabBar.m @@ -99,7 +99,6 @@ // we can't hook up the VC hierarchy in 'init' because the subviews aren't // hooked up yet, so we do it on demand here whenever a transaction has finished [self addControllerToClosestParent:_tabController]; - //[RCTView addViewController:_tabController toBackingViewControllerForView:self]; if (_tabsChanged) { diff --git a/ReactKit/Views/RCTView.h b/ReactKit/Views/RCTView.h index cf46eb9df..379fa7160 100644 --- a/ReactKit/Views/RCTView.h +++ b/ReactKit/Views/RCTView.h @@ -24,4 +24,21 @@ */ + (UIEdgeInsets)contentInsetsForView:(UIView *)curView; +/** + * This is an optimization used to improve performance + * for large scrolling views with many subviews, such as a + * list or table. If set to YES, any clipped subviews will + * be removed from the view hierarchy whenever -updateClippedSubviews + * is called. This would typically be triggered by a scroll event + */ +@property (nonatomic, assign) BOOL removeClippedSubviews; + +/** + * Hide subviews if they are outside the view bounds. + * This is an optimisation used predominantly with RKScrollViews + * but it is applied recursively to all subviews that have + * removeClippedSubviews set to YES + */ +- (void)updateClippedSubviews; + @end diff --git a/ReactKit/Views/RCTView.m b/ReactKit/Views/RCTView.m index 9666e717b..609f26243 100644 --- a/ReactKit/Views/RCTView.m +++ b/ReactKit/Views/RCTView.m @@ -7,6 +7,65 @@ #import "RCTLog.h" #import "UIView+ReactKit.h" +@implementation UIView (RCTViewUnmounting) + +- (void)react_remountAllSubviews +{ + // Normal views don't support unmounting, so all + // this does is forward message to our subviews, + // in case any of those do support it + + for (UIView *subview in self.subviews) { + [subview react_remountAllSubviews]; + } +} + +- (void)react_updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(UIView *)clipView +{ + // Even though we don't support subview unmounting + // we do support clipsToBounds, so if that's enabled + // we'll update the clipping + + if (self.clipsToBounds && [self.subviews count] > 0) { + clipRect = [clipView convertRect:clipRect toView:self]; + clipRect = CGRectIntersection(clipRect, self.bounds); + clipView = self; + } + + // Normal views don't support unmounting, so all + // this does is forward message to our subviews, + // in case any of those do support it + + for (UIView *subview in self.subviews) { + [subview react_updateClippedSubviewsWithClipRect:clipRect relativeToView:clipView]; + } +} + +- (UIView *)react_findClipView +{ + UIView *testView = self; + UIView *clipView = nil; + CGRect clipRect = self.bounds; + while (testView) { + if (testView.clipsToBounds) { + if (clipView) { + CGRect testRect = [clipView convertRect:clipRect toView:testView]; + if (!CGRectContainsRect(testView.bounds, testRect)) { + clipView = testView; + clipRect = CGRectIntersection(testView.bounds, testRect); + } + } else { + clipView = testView; + clipRect = [self convertRect:self.bounds toView:clipView]; + } + } + testView = testView.superview; + } + return clipView ?: self.window; +} + +@end + static NSString *RCTRecursiveAccessibilityLabel(UIView *view) { NSMutableString *str = [NSMutableString stringWithString:@""]; @@ -23,6 +82,9 @@ static NSString *RCTRecursiveAccessibilityLabel(UIView *view) } @implementation RCTView +{ + NSMutableArray *_reactSubviews; +} - (NSString *)accessibilityLabel { @@ -115,4 +177,193 @@ static NSString *RCTRecursiveAccessibilityLabel(UIView *view) return UIEdgeInsetsZero; } +#pragma mark - View unmounting + +- (void)react_remountAllSubviews +{ + if (_reactSubviews) { + NSInteger index = 0; + for (UIView *view in _reactSubviews) { + if (view.superview != self) { + if (index < [self subviews].count) { + [self insertSubview:view atIndex:index]; + } else { + [self addSubview:view]; + } + [view react_remountAllSubviews]; + } + index++; + } + } else { + // If react_subviews is nil, we must already be showing all subviews + [super react_remountAllSubviews]; + } +} + +- (void)remountSubview:(UIView *)view +{ + // Calculate insertion index for view + NSInteger index = 0; + for (UIView *subview in _reactSubviews) { + if (subview == view) { + [self insertSubview:view atIndex:index]; + break; + } + if (subview.superview) { + // View is mounted, so bump the index + index++; + } + } +} + +- (void)mountOrUnmountSubview:(UIView *)view withClipRect:(CGRect)clipRect relativeToView:(UIView *)clipView +{ + if (view.clipsToBounds) { + + // View has cliping enabled, so we can easily test if it is partially + // or completely within the clipRect, and mount or unmount it accordingly + + if (CGRectIntersectsRect(clipRect, view.frame)) { + + // View is at least partially visible, so remount it if unmounted + if (view.superview == nil) { + [self remountSubview:view]; + } + + // Then test its subviews + if (CGRectContainsRect(clipRect, view.frame)) { + [view react_remountAllSubviews]; + } else { + [view react_updateClippedSubviewsWithClipRect:clipRect relativeToView:clipView]; + } + + } else if (view.superview) { + + // View is completely outside the clipRect, so unmount it + [view removeFromSuperview]; + } + + } else { + + // View has clipping disabled, so there's no way to tell if it has + // any visible subviews without an expensive recursive test, so we'll + // just add it. + + if (view.superview == nil) { + [self remountSubview:view]; + } + + // Check if subviews need to be mounted/unmounted + [view react_updateClippedSubviewsWithClipRect:clipRect relativeToView:clipView]; + } +} + +- (void)react_updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(UIView *)clipView +{ + // TODO (#5906496): for scrollviews (the primary use-case) we could + // optimize this by only doing a range check along the scroll axis, + // instead of comparing the whole frame + + if (_reactSubviews == nil) { + // Use default behavior if unmounting is disabled + return [super react_updateClippedSubviewsWithClipRect:clipRect relativeToView:clipView]; + } + + if ([_reactSubviews count] == 0) { + // Do nothing if we have no subviews + return; + } + + if (CGSizeEqualToSize(self.bounds.size, CGSizeZero)) { + // Do nothing if layout hasn't happened yet + return; + } + + // Convert clipping rect to local coordinates + clipRect = [clipView convertRect:clipRect toView:self]; + clipView = self; + if (self.clipsToBounds) { + clipRect = CGRectIntersection(clipRect, self.bounds); + } + + // Mount / unmount views + for (UIView *view in _reactSubviews) { + [self mountOrUnmountSubview:view withClipRect:clipRect relativeToView:clipView]; + } +} + +- (void)setRemoveClippedSubviews:(BOOL)removeClippedSubviews +{ + if (removeClippedSubviews && !_reactSubviews) { + _reactSubviews = [self.subviews mutableCopy]; + } else if (!removeClippedSubviews && _reactSubviews) { + [self react_remountAllSubviews]; + _reactSubviews = nil; + } +} + +- (BOOL)removeClippedSubviews +{ + return _reactSubviews != nil; +} + +- (void)insertReactSubview:(UIView *)view atIndex:(NSInteger)atIndex +{ + if (_reactSubviews == nil) { + [self insertSubview:view atIndex:atIndex]; + } else { + [_reactSubviews insertObject:view atIndex:atIndex]; + + // Find a suitable view to use for clipping + UIView *clipView = [self react_findClipView]; + if (clipView) { + + // If possible, don't add subviews if they are clipped + [self mountOrUnmountSubview:view withClipRect:clipView.bounds relativeToView:clipView]; + + } else { + + // Fallback if we can't find a suitable clipView + [self remountSubview:view]; + } + } +} + +- (void)removeReactSubview:(UIView *)subview +{ + [_reactSubviews removeObject:subview]; + [subview removeFromSuperview]; +} + +- (NSArray *)reactSubviews +{ + // The _reactSubviews array is only used when we have hidden + // offscreen views. If _reactSubviews is nil, we can assume + // that [self reactSubviews] and [self subviews] are the same + + return _reactSubviews ?: [self subviews]; +} + +- (void)updateClippedSubviews +{ + // Find a suitable view to use for clipping + UIView *clipView = [self react_findClipView]; + if (clipView) { + [self react_updateClippedSubviewsWithClipRect:clipView.bounds relativeToView:clipView]; + } +} + +- (void)layoutSubviews +{ + // TODO (#5906496): this a nasty performance drain, but necessary + // to prevent gaps appearing when the loading spinner disappears. + // We might be able to fix this another way by triggering a call + // to updateClippedSubviews manually after loading + + [super layoutSubviews]; + if (_reactSubviews) { + [self updateClippedSubviews]; + } +} + @end diff --git a/ReactKit/Views/RCTWrapperViewController.m b/ReactKit/Views/RCTWrapperViewController.m index aff0f2e4f..f05a1f3c2 100644 --- a/ReactKit/Views/RCTWrapperViewController.m +++ b/ReactKit/Views/RCTWrapperViewController.m @@ -99,8 +99,8 @@ - (void)loadView { - // add a wrapper so that UIViewControllerWrapperView (managed by the - // UINavigationController) doesn't end up resetting the frames for + // Add a wrapper so that the wrapper view managed by the + // UINavigationController doesn't end up resetting the frames for //`contentView` which is a react-managed view. _wrapperView = [[UIView alloc] initWithFrame:_contentView.bounds]; [_wrapperView addSubview:_contentView]; From 74b9bc1311537f5e0cfcb33272f4d85da2183076 Mon Sep 17 00:00:00 2001 From: Ryan Rhee Date: Wed, 11 Mar 2015 14:17:18 -0700 Subject: [PATCH 28/79] [website] the react npm package doesn't capitalize the r --- website/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/package.json b/website/package.json index 32642915d..be043eab6 100644 --- a/website/package.json +++ b/website/package.json @@ -3,7 +3,7 @@ "start": "node server/server.js" }, "dependencies": { - "React": "~0.12.0", + "react": "~0.12.0", "optimist": "0.6.0", "react-page-middleware": "git://github.com/facebook/react-page-middleware.git", "connect": "2.8.3", From 33bfb322ad49654db50078af101bee90a5e7f46b Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Thu, 12 Mar 2015 11:03:32 -0700 Subject: [PATCH 29/79] Wire up jsdocs for apis --- website/jsdocs/findExportDefinition.js | 2 +- website/jsdocs/jsdocs.js | 4 +- website/layout/AutodocsLayout.js | 85 ++++++++++++++++++++++++-- website/package.json | 1 - website/server/extractDocs.js | 51 ++++++++++------ 5 files changed, 117 insertions(+), 26 deletions(-) diff --git a/website/jsdocs/findExportDefinition.js b/website/jsdocs/findExportDefinition.js index 45bf4a539..07c38b5a7 100644 --- a/website/jsdocs/findExportDefinition.js +++ b/website/jsdocs/findExportDefinition.js @@ -3,7 +3,7 @@ /*jslint node: true */ "use strict"; -var esprima = require('esprima'); +var esprima = require('esprima-fb'); var Syntax = esprima.Syntax; var traverseFlat = require('./traverseFlat'); diff --git a/website/jsdocs/jsdocs.js b/website/jsdocs/jsdocs.js index 1e65fcf25..c0eabd9bb 100644 --- a/website/jsdocs/jsdocs.js +++ b/website/jsdocs/jsdocs.js @@ -3,7 +3,7 @@ /*jslint node: true */ "use strict"; -var esprima = require('esprima'); +var esprima = require('esprima-fb'); var fs = require('fs'); var Syntax = esprima.Syntax; @@ -482,7 +482,7 @@ function parseSource(source) { } }); } - console.log(definition.type); + switch (definition.type) { case Syntax.ClassDeclaration: data = getClassData(definition, _state, source, ast.comments, lines); diff --git a/website/layout/AutodocsLayout.js b/website/layout/AutodocsLayout.js index 8fadbf050..bc22bcc47 100644 --- a/website/layout/AutodocsLayout.js +++ b/website/layout/AutodocsLayout.js @@ -11,7 +11,7 @@ var Site = require('Site'); var slugify = require('slugify'); -var Autodocs = React.createClass({ +var ComponentDoc = React.createClass({ renderType: function(type) { if (type.name === 'enum') { return 'enum(' + type.value.map((v => v.value)).join(', ') + ')'; @@ -35,6 +35,7 @@ var Autodocs = React.createClass({ return type.name; }, + renderProp: function(name, prop) { return (
@@ -49,6 +50,7 @@ var Autodocs = React.createClass({
); }, + renderCompose: function(name) { return (
@@ -58,6 +60,7 @@ var Autodocs = React.createClass({
); }, + renderProps: function(props, composes) { return (
@@ -70,6 +73,79 @@ var Autodocs = React.createClass({
); }, + + render: function() { + var content = this.props.content; + return ( +
+ + {content.description} + + {this.renderProps(content.props, content.composes)} +
+ ); + } +}); + +var APIDoc = React.createClass({ + removeCommentsFromDocblock: function(docblock) { + return docblock + .trim('\n ') + .replace(/^\/\*+/, '') + .replace(/\*\/$/, '') + .split('\n') + .map(function(line) { + return line.trim().replace(/^\* */, ''); + }) + .join('\n'); + }, + + renderMethod: function(method) { + return ( +
+
+ {method.modifiers.length && + {method.modifiers.join(' ') + ' '} + } + {method.name}( + + {method.params + .map(function(param) { return param.name; }) + .join(', ')} + + ) +
+
+ ); + }, + + + renderMethods: function(methods) { + return ( +
+ {methods.map(this.renderMethod)} +
+ ); + }, + + render: function() { + var content = this.props.content; + if (!content.methods) { + return
Error
; + } + return ( +
+ + {this.removeCommentsFromDocblock(content.docblock)} + + {this.renderMethods(content.methods)} +
{JSON.stringify(content, null, 2)}
+
+ ); + } +}); + +var Autodocs = React.createClass({ render: function() { var metadata = this.props.metadata; var content = JSON.parse(this.props.children); @@ -80,10 +156,9 @@ var Autodocs = React.createClass({

{metadata.title}

- - {content.description} - - {this.renderProps(content.props, content.composes)} + {content.type === 'component' ? + : + } {content.fullDescription} diff --git a/website/package.json b/website/package.json index be043eab6..7155b78b1 100644 --- a/website/package.json +++ b/website/package.json @@ -11,7 +11,6 @@ "mkdirp": "*", "request": "*", "fs.extra": "*", - "esprima": "*", "esprima-fb": "*", "jstransform": "*" } diff --git a/website/server/extractDocs.js b/website/server/extractDocs.js index c18b58dd4..44bc6a967 100644 --- a/website/server/extractDocs.js +++ b/website/server/extractDocs.js @@ -12,29 +12,23 @@ function getNameFromPath(filepath) { return filepath; } -function componentsToMarkdown(filepath, i) { - var json = docs.parse( - fs.readFileSync(filepath), - function(node, recast) { - return docs.resolver.findExportedReactCreateClassCall(node, recast) || - docs.resolver.findAllReactCreateClassCalls(node, recast)[0]; - } - ); +function componentsToMarkdown(type, json, filepath, i) { var componentName = getNameFromPath(filepath); var docFilePath = '../docs/' + componentName + '.md'; if (fs.existsSync(docFilePath)) { json.fullDescription = fs.readFileSync(docFilePath).toString(); } + json.type = type; var res = [ '---', 'id: ' + slugify(componentName), 'title: ' + componentName, 'layout: autodocs', - 'category: Components', + 'category: ' + type + 's', 'permalink: docs/' + slugify(componentName) + '.html', - components[i + 1] && ('next: ' + slugify(getNameFromPath(components[i + 1]))), + all[i + 1] && ('next: ' + slugify(getNameFromPath(all[i + 1]))), '---', JSON.stringify(json, null, 2), ].filter(function(line) { return line; }).join('\n'); @@ -60,16 +54,39 @@ var components = [ '../Libraries/Components/View/View.js', ]; - -function apisToMarkdown(filepath, i) { - var json = jsDocs(fs.readFileSync(filepath).toString()); - console.log(JSON.stringify(json, null, 2)); -} - var apis = [ '../Libraries/AppRegistry/AppRegistry.js', + '../Libraries/Animation/Animation.js', + '../Libraries/CameraRoll/CameraRoll.js', + '../Libraries/Animation/LayoutAnimation.js', + '../Libraries/Utilities/PixelRatio.js', + '../Libraries/Components/StatusBar/StatusBarIOS.ios.js', + '../Libraries/StyleSheet/StyleSheet.js', ]; +var all = components.concat(apis); + module.exports = function() { - return components.map(componentsToMarkdown); + var i = 0; + return [].concat( + components.map(function(filepath) { + var json = docs.parse( + fs.readFileSync(filepath), + function(node, recast) { + return docs.resolver.findExportedReactCreateClassCall(node, recast) || + docs.resolver.findAllReactCreateClassCalls(node, recast)[0]; + } + ); + return componentsToMarkdown('component', json, filepath, i++); + }), + apis.map(function(filepath) { + try { + var json = jsDocs(fs.readFileSync(filepath).toString()); + } catch(e) { + console.error('Cannot parse file', filepath); + var json = {}; + } + return componentsToMarkdown('api', json, filepath, i++); + }) + ); }; From 9f37aea739cf0db902949c26b84634334570d062 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Thu, 12 Mar 2015 11:36:45 -0700 Subject: [PATCH 30/79] Support flow and @param type hints --- website/jsdocs/jsdocs.js | 25 +++++++++++++++++++++---- website/layout/AutodocsLayout.js | 13 ++++++++++++- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/website/jsdocs/jsdocs.js b/website/jsdocs/jsdocs.js index c0eabd9bb..678ab83de 100644 --- a/website/jsdocs/jsdocs.js +++ b/website/jsdocs/jsdocs.js @@ -74,7 +74,7 @@ function stripStaticUpstreamWarning(docblock) { } /** - * Parse a typehint, but swallow any errors. + * Parse a typehint into the 'nice' form, if possible. */ function safeParseTypehint(typehint) { if (!typehint) { @@ -83,7 +83,7 @@ function safeParseTypehint(typehint) { try { return JSON.stringify(parseTypehint(typehint)); } catch (e) { - return null; + return typehint; } } @@ -218,7 +218,12 @@ function getFunctionData(node, state, source, commentsForFile, linesForFile) { // TODO: Handle other things like Syntax.ObjectPattern if (param.type === Syntax.Identifier) { var typehint; - if (typehintsFromBlock && typehintsFromBlock.params) { + if (param.typeAnnotation) { + typehint = sanitizeTypehint(source.substring( + param.typeAnnotation.range[0], + param.typeAnnotation.range[1] + )); + } else if (typehintsFromBlock && typehintsFromBlock.params) { typehintsFromBlock.params.some(function(paramTypehint) { if (paramTypehint[0] === param.name) { typehint = paramTypehint[1]; @@ -237,7 +242,7 @@ function getFunctionData(node, state, source, commentsForFile, linesForFile) { } params.push({ typehint: safeParseTypehint(typehint), - name: param.name + name: param.name + (param.optional ? '?' : ''), }); } else if (param.type === Syntax.TypeAnnotatedIdentifier) { params.push({ @@ -258,12 +263,19 @@ function getFunctionData(node, state, source, commentsForFile, linesForFile) { } else if (typehintsFromBlock) { returnTypehint = typehintsFromBlock.returns; } + var tparams = null; + if (node.typeParameters) { + tparams = node.typeParameters.params.map(function(x) { + return x.name; + }); + } return { line: node.loc.start.line, source: source.substring.apply(source, node.range), docblock: getDocBlock(node, commentsForFile, linesForFile), modifiers: [], params: params, + tparams: tparams, returntypehint: safeParseTypehint(returnTypehint) }; } @@ -377,6 +389,11 @@ function getClassData(node, state, source, commentsForFile, linesForFile) { if (node.superClass && node.superClass.type === Syntax.Identifier) { data.superClass = node.superClass.name; } + if (node.typeParameters) { + data.tparams = node.typeParameters.params.map(function(x) { + return x.name; + }); + } return data; } diff --git a/website/layout/AutodocsLayout.js b/website/layout/AutodocsLayout.js index bc22bcc47..7a1a6dddd 100644 --- a/website/layout/AutodocsLayout.js +++ b/website/layout/AutodocsLayout.js @@ -110,7 +110,18 @@ var APIDoc = React.createClass({ {method.name}( {method.params - .map(function(param) { return param.name; }) + .map(function(param) { + var res = param.name; + if (param.typehint) { + try { + var typehint = JSON.parse(param.typehint).value; + } catch(e) { + var typehint = param.typehint; + } + res += ': ' + typehint; + } + return res; + }) .join(', ')} ) From 642c13e3e3a2d6581288c649479605b86f12dc06 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Thu, 12 Mar 2015 12:51:44 -0700 Subject: [PATCH 31/79] Updates from Thu Mar 12 - Fixed sticky section headers in ListView | Nick Lockwood - [ReactNative] AppState cleanup, remove Subscribable, add in OSS examples | Eric Vicenti - [react-packager] package.json cleanup (seperate packager into it's own package) | Amjad Masad - [ReactNative] Move PushNotificationIOS to oss | Tadeu Zagallo - [ReactNative] Fix shake gesture after RedBox is dismissed | Alex Kotliarskyi - [catlyst|madman] fix prop type warning | Jiajie Zhu - [ReactNative] Remove Subscribable from TextInput | Eric Vicenti - Unforked ExceptionsManager, AlertManager and AppState | Nick Lockwood - [ReactNative|MAdMan] Notification Subscribable | Eric Vicenti - [ReactNative] OSS AsyncStorage with example | Spencer Ahrens --- Examples/2048/AppDelegate.m | 2 +- Examples/Movies/AppDelegate.m | 2 +- Examples/TicTacToe/AppDelegate.m | 2 +- Examples/UIExplorer/AppStateExample.js | 60 ++++ Examples/UIExplorer/AppStateIOSExample.js | 69 +++++ Examples/UIExplorer/AsyncStorageExample.js | 103 ++++++ Examples/UIExplorer/UIExplorerApp.js | 4 +- Examples/UIExplorer/UIExplorerList.js | 3 + Libraries/AppState/AppState.js | 46 +++ Libraries/AppStateIOS/AppStateIOS.android.js | 24 ++ Libraries/AppStateIOS/AppStateIOS.ios.js | 55 ++++ Libraries/Components/ListView/ListView.js | 4 +- Libraries/Components/ScrollView/ScrollView.js | 8 +- .../Components/TextInput/TextInput.ios.js | 22 +- Libraries/Image/Image.ios.js | 2 +- .../RCTNetwork.xcodeproj/project.pbxproj | 6 + Libraries/Network/RCTReachability.h | 11 + Libraries/Network/RCTReachability.m | 85 +++++ Libraries/ReactIOS/renderApplication.js | 12 +- Libraries/Storage/AsyncStorage.ios.js | 193 ++++++++++++ Libraries/Utilities/PushNotificationIOS.js | 74 +++++ Libraries/react-native/react-native.js | 7 +- ReactKit/Base/RCTRedBox.m | 2 + ReactKit/Base/RCTUtils.h | 5 + ReactKit/Base/RCTUtils.m | 19 ++ ReactKit/Modules/RCTAppState.h | 7 + ReactKit/Modules/RCTAppState.m | 105 +++++++ ReactKit/Modules/RCTAsyncLocalStorage.h | 24 ++ ReactKit/Modules/RCTAsyncLocalStorage.m | 292 ++++++++++++++++++ ReactKit/Modules/RCTExceptionsManager.h | 10 +- ReactKit/Modules/RCTExceptionsManager.m | 22 +- ReactKit/ReactKit.xcodeproj/project.pbxproj | 26 +- ReactKit/Views/RCTPicker.h | 3 + package.json | 16 +- packager/blacklist.js | 10 +- packager/package.json | 45 +++ 36 files changed, 1329 insertions(+), 51 deletions(-) create mode 100644 Examples/UIExplorer/AppStateExample.js create mode 100644 Examples/UIExplorer/AppStateIOSExample.js create mode 100644 Examples/UIExplorer/AsyncStorageExample.js create mode 100644 Libraries/AppState/AppState.js create mode 100644 Libraries/AppStateIOS/AppStateIOS.android.js create mode 100644 Libraries/AppStateIOS/AppStateIOS.ios.js create mode 100644 Libraries/Network/RCTReachability.h create mode 100644 Libraries/Network/RCTReachability.m create mode 100644 Libraries/Storage/AsyncStorage.ios.js create mode 100644 Libraries/Utilities/PushNotificationIOS.js create mode 100644 ReactKit/Modules/RCTAppState.h create mode 100644 ReactKit/Modules/RCTAppState.m create mode 100644 ReactKit/Modules/RCTAsyncLocalStorage.h create mode 100644 ReactKit/Modules/RCTAsyncLocalStorage.m create mode 100644 packager/package.json diff --git a/Examples/2048/AppDelegate.m b/Examples/2048/AppDelegate.m index 76172139c..32d9dd85c 100644 --- a/Examples/2048/AppDelegate.m +++ b/Examples/2048/AppDelegate.m @@ -20,7 +20,7 @@ // // To run on device, change `localhost` to the IP address of your computer, and make sure your computer and // iOS device are on the same Wi-Fi network. - jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/2048/Game2048.includeRequire.runModule.bundle?dev=true"]; + jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/2048/Game2048.includeRequire.runModule.bundle"]; // OPTION 2 // Load from pre-bundled file on disk. To re-generate the static bundle, run diff --git a/Examples/Movies/AppDelegate.m b/Examples/Movies/AppDelegate.m index c53f8edc4..c01fc2ca9 100644 --- a/Examples/Movies/AppDelegate.m +++ b/Examples/Movies/AppDelegate.m @@ -20,7 +20,7 @@ // // To run on device, change `localhost` to the IP address of your computer, and make sure your computer and // iOS device are on the same Wi-Fi network. - jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/Movies/MoviesApp.includeRequire.runModule.bundle?dev=true"]; + jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/Movies/MoviesApp.includeRequire.runModule.bundle"]; // OPTION 2 // Load from pre-bundled file on disk. To re-generate the static bundle, run diff --git a/Examples/TicTacToe/AppDelegate.m b/Examples/TicTacToe/AppDelegate.m index d2add4fac..52e682752 100644 --- a/Examples/TicTacToe/AppDelegate.m +++ b/Examples/TicTacToe/AppDelegate.m @@ -20,7 +20,7 @@ // // To run on device, change `localhost` to the IP address of your computer, and make sure your computer and // iOS device are on the same Wi-Fi network. - jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/TicTacToe/TicTacToeApp.includeRequire.runModule.bundle?dev=true"]; + jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/TicTacToe/TicTacToeApp.includeRequire.runModule.bundle"]; // OPTION 2 // Load from pre-bundled file on disk. To re-generate the static bundle, run diff --git a/Examples/UIExplorer/AppStateExample.js b/Examples/UIExplorer/AppStateExample.js new file mode 100644 index 000000000..ea6400b91 --- /dev/null +++ b/Examples/UIExplorer/AppStateExample.js @@ -0,0 +1,60 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + */ +'use strict'; + +var React = require('react-native'); +var { + AppState, + StyleSheet, + Text, + TouchableHighlight, + View, +} = React; + +var Button = React.createClass({ + render: function() { + return ( + + + {this.props.label} + + + ); + } +}); + +var styles = StyleSheet.create({ + button: { + padding: 10, + alignItems: 'center', + justifyContent: 'center', + }, + buttonLabel: { + color: 'blue', + }, +}); + +exports.title = 'AppState'; +exports.description = 'App background status and badge value'; +exports.examples = [ +{ + title: 'Set Badge Number', + render: function() { + return ( + +
); @@ -100,6 +105,19 @@ var APIDoc = React.createClass({ .join('\n'); }, + renderTypehintRec: function(typehint) { + if (typehint.type === 'simple') { + return typehint.value; + } + + if (typehint.type === 'generic') { + return this.renderTypehintRec(typehint.value[0]) + '<' + this.renderTypehintRec(typehint.value[1]) + '>'; + } + + return JSON.stringify(typehint); + + }, + renderTypehint: function(typehint) { try { var typehint = JSON.parse(typehint); @@ -107,11 +125,7 @@ var APIDoc = React.createClass({ return typehint; } - if (typehint.type === 'simple') { - return typehint.value; - } - - return ':(' + JSON.stringify(typehint); + return this.renderTypehintRec(typehint); }, renderMethod: function(method) { @@ -161,8 +175,8 @@ var APIDoc = React.createClass({ {this.removeCommentsFromDocblock(content.docblock)} + Methods {this.renderMethods(content.methods)} -
{JSON.stringify(content, null, 2)}
); } diff --git a/website/src/react-native/index.js b/website/src/react-native/_index.js similarity index 100% rename from website/src/react-native/index.js rename to website/src/react-native/_index.js From 1a48ef37f3ecbc0cc1ae449b3199ca9a1dea0980 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 15 Mar 2015 18:46:48 -0700 Subject: [PATCH 39/79] Attempt at getting Travis CI to automatically push the website --- .travis.yml | 8 ++++++++ website/setup.sh | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100755 website/setup.sh diff --git a/.travis.yml b/.travis.yml index 98aeb094f..127ba96cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,3 +5,11 @@ xcode_sdk: iphonesimulator8.1 install: - npm install - npm test + +# Automatically publish the website +script: ./website/setup.sh; ./website/publish.sh +env: + - secure: "g8Xjbslq4R+3oLVgBvXM5QhiJ+7q+H+dH4+sXReyyZ64M5gf32U7oOjQNVkdx79dnGFc6a619otGsX4RiEkQlkiR+4uCgJUIgPwN4YFCIgYu4Z/0FnbbRu5yyywh5zv4WwGmAtMkgGztoMBnps5gCiPUM/RGIqwVk0Ghbmh5c2k=" +branches: + only: + - master diff --git a/website/setup.sh b/website/setup.sh new file mode 100755 index 000000000..69b5bddf4 --- /dev/null +++ b/website/setup.sh @@ -0,0 +1,7 @@ +cd ../../ +git clone git@github.com:facebook/react-native.git react-native-gh-pages +cd react-native-gh-pages +git checkout origin/gh-pages +git checkout -b gh-pages +git push --set-upstream origin gh-pages +cd ../react-native/website From 6ab5a9ad1ecff41e35360fd1011df1d4dea5411f Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 15 Mar 2015 18:51:36 -0700 Subject: [PATCH 40/79] Attempt number #2 at auto-publishing --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 127ba96cc..a9b80708c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ install: - npm test # Automatically publish the website -script: ./website/setup.sh; ./website/publish.sh +script: cd website; ./setup.sh; ./publish.sh env: - secure: "g8Xjbslq4R+3oLVgBvXM5QhiJ+7q+H+dH4+sXReyyZ64M5gf32U7oOjQNVkdx79dnGFc6a619otGsX4RiEkQlkiR+4uCgJUIgPwN4YFCIgYu4Z/0FnbbRu5yyywh5zv4WwGmAtMkgGztoMBnps5gCiPUM/RGIqwVk0Ghbmh5c2k=" branches: From dfda33bb6ffe94533abdcd13225706b679c68454 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 15 Mar 2015 18:55:55 -0700 Subject: [PATCH 41/79] Attempt #3 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a9b80708c..7d6d41586 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ install: - npm test # Automatically publish the website -script: cd website; ./setup.sh; ./publish.sh +script: cd website; npm install; ./setup.sh; ./publish.sh env: - secure: "g8Xjbslq4R+3oLVgBvXM5QhiJ+7q+H+dH4+sXReyyZ64M5gf32U7oOjQNVkdx79dnGFc6a619otGsX4RiEkQlkiR+4uCgJUIgPwN4YFCIgYu4Z/0FnbbRu5yyywh5zv4WwGmAtMkgGztoMBnps5gCiPUM/RGIqwVk0Ghbmh5c2k=" branches: From 9acf831624f9a13e4c7d3091bad7a6b0e5a06306 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 15 Mar 2015 19:24:38 -0700 Subject: [PATCH 42/79] Force new travis build --- docs/GettingStarted.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 0c60ccc51..9b88919aa 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -7,7 +7,6 @@ permalink: docs/getting-started.html next: network --- - Our first React Native implementation is `ReactKit`, targeting iOS. We are also working on an Android implementation which we will release later. `ReactKit` apps are built using the [React JS](https://github.com/facebook/react) framework, and render directly to From ad3192c3602909041f46bac661f01a6ef1e1dc98 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 15 Mar 2015 19:32:59 -0700 Subject: [PATCH 43/79] Attempt #5 --- website/server/generate.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/server/generate.js b/website/server/generate.js index 0ec921036..2f811979a 100644 --- a/website/server/generate.js +++ b/website/server/generate.js @@ -5,6 +5,8 @@ var fs = require('fs.extra'); var mkdirp = require('mkdirp'); var server = require('./server.js'); +require('./convert.js')(); + // Sadly, our setup fatals when doing multiple concurrent requests // I don't have the time to dig into why, it's easier to just serialize // requests. From 591d7b321f33a9bad6ce92743cf4d26f5b4b914f Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 15 Mar 2015 19:54:14 -0700 Subject: [PATCH 44/79] Make the publish script faster by not converting all the files on every file --- website/core/Header.js | 7 +++---- website/core/center.js | 6 ++++-- website/server/generate.js | 1 + website/server/server.js | 6 ++++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/website/core/Header.js b/website/core/Header.js index f49cae374..24e6784db 100644 --- a/website/core/Header.js +++ b/website/core/Header.js @@ -9,10 +9,9 @@ var slugify = require('slugify'); var Header = React.createClass({ render: function() { var slug = slugify(this.props.toSlug || this.props.children); - var H = React.DOM['h' + this.props.level]; - - return this.transferPropsTo( - + var H = 'h' + this.props.level; + return ( +
{this.props.children} {' '}# diff --git a/website/core/center.js b/website/core/center.js index 78fb127d5..fdc930965 100644 --- a/website/core/center.js +++ b/website/core/center.js @@ -7,8 +7,10 @@ var React = require('React'); var center = React.createClass({ render: function() { - return this.transferPropsTo( -
{this.props.children}
+ return ( +
+ {this.props.children} +
); } }); diff --git a/website/server/generate.js b/website/server/generate.js index 2f811979a..3191ef992 100644 --- a/website/server/generate.js +++ b/website/server/generate.js @@ -6,6 +6,7 @@ var mkdirp = require('mkdirp'); var server = require('./server.js'); require('./convert.js')(); +server.noconvert = true; // Sadly, our setup fatals when doing multiple concurrent requests // I don't have the time to dig into why, it's easier to just serialize diff --git a/website/server/server.js b/website/server/server.js index e74d95b87..57a11e3b0 100644 --- a/website/server/server.js +++ b/website/server/server.js @@ -36,7 +36,9 @@ var app = connect() .use(function(req, res, next) { // convert all the md files on every request. This is not optimal // but fast enough that we don't really need to care right now. - convert(); + if (!server.noconvert) { + convert(); + } next(); }) .use(reactMiddleware.provide(buildOptions)) @@ -49,5 +51,5 @@ var app = connect() var portToUse = port || 8080; var server = http.createServer(app); server.listen(portToUse); -console.log('Open http://localhost:' + portToUse + '/react-native/index.html'); +console.log('Open http://localhost:' + portToUse + '/react-native/_index.html'); module.exports = server; From 7c9969025e7a59a399d780e79ef10f41c5f7171c Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 15 Mar 2015 20:06:18 -0700 Subject: [PATCH 45/79] Make the publish script exit with code 0 even if there's nothing changed --- website/publish.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/website/publish.sh b/website/publish.sh index 409db1459..e2e0d971a 100755 --- a/website/publish.sh +++ b/website/publish.sh @@ -20,3 +20,4 @@ git add --all git commit -m "update website" git push cd ../react-native/website +exit 0 From 0001b9845d397b4027472464aa0e4119a8d3610f Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 15 Mar 2015 20:16:48 -0700 Subject: [PATCH 46/79] Attempt n+1 --- website/publish.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/website/publish.sh b/website/publish.sh index e2e0d971a..51746e4da 100755 --- a/website/publish.sh +++ b/website/publish.sh @@ -18,6 +18,4 @@ rm -Rf build/ cd ../../react-native-gh-pages git add --all git commit -m "update website" -git push -cd ../react-native/website -exit 0 +git push; cd ../react-native/website; exit 0 From a68f2b50a4229bc883206c51f4d16dfa248e3673 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 15 Mar 2015 20:27:08 -0700 Subject: [PATCH 47/79] Trying again... --- .travis.yml | 2 +- website/publish.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7d6d41586..40d9874b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ install: - npm test # Automatically publish the website -script: cd website; npm install; ./setup.sh; ./publish.sh +script: cd website; npm install; ./setup.sh; ./publish.sh; echo env: - secure: "g8Xjbslq4R+3oLVgBvXM5QhiJ+7q+H+dH4+sXReyyZ64M5gf32U7oOjQNVkdx79dnGFc6a619otGsX4RiEkQlkiR+4uCgJUIgPwN4YFCIgYu4Z/0FnbbRu5yyywh5zv4WwGmAtMkgGztoMBnps5gCiPUM/RGIqwVk0Ghbmh5c2k=" branches: diff --git a/website/publish.sh b/website/publish.sh index 51746e4da..409db1459 100755 --- a/website/publish.sh +++ b/website/publish.sh @@ -18,4 +18,5 @@ rm -Rf build/ cd ../../react-native-gh-pages git add --all git commit -m "update website" -git push; cd ../react-native/website; exit 0 +git push +cd ../react-native/website From 25aafc3e7a178b2d2c93302e7cac602c5c0d8c9d Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 15 Mar 2015 21:08:17 -0700 Subject: [PATCH 48/79] Only publish the website for committed changes --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 40d9874b3..ec63d40c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ install: - npm test # Automatically publish the website -script: cd website; npm install; ./setup.sh; ./publish.sh; echo +script: '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && (cd website; npm install; ./setup.sh; ./publish.sh; echo)' env: - secure: "g8Xjbslq4R+3oLVgBvXM5QhiJ+7q+H+dH4+sXReyyZ64M5gf32U7oOjQNVkdx79dnGFc6a619otGsX4RiEkQlkiR+4uCgJUIgPwN4YFCIgYu4Z/0FnbbRu5yyywh5zv4WwGmAtMkgGztoMBnps5gCiPUM/RGIqwVk0Ghbmh5c2k=" branches: From 3b2e61a912ba892457e15979a9a4af04bf1a27be Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 15 Mar 2015 21:16:49 -0700 Subject: [PATCH 49/79] Let's try one more time --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ec63d40c3..20831d207 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ install: - npm test # Automatically publish the website -script: '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && (cd website; npm install; ./setup.sh; ./publish.sh; echo)' +script: '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && (cd website; npm install; ./setup.sh; ./publish.sh; echo) || echo' env: - secure: "g8Xjbslq4R+3oLVgBvXM5QhiJ+7q+H+dH4+sXReyyZ64M5gf32U7oOjQNVkdx79dnGFc6a619otGsX4RiEkQlkiR+4uCgJUIgPwN4YFCIgYu4Z/0FnbbRu5yyywh5zv4WwGmAtMkgGztoMBnps5gCiPUM/RGIqwVk0Ghbmh5c2k=" branches: From 90164c36389ea6b674538822cf0e60a11cc91b2b Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 15 Mar 2015 20:55:39 -0700 Subject: [PATCH 50/79] Updates from Sun 15 Mar - [ReactNative] Add website to blacklist | Christopher Chedeau - Ported ART to new UIManager | Nick Lockwood - [ReactNative] Fix File Watcher test | Christopher Chedeau - [ReactNative] OSS Interaction Manager | Christopher Chedeau --- Libraries/Image/RCTStaticImageManager.m | 6 +- Libraries/Interaction/InteractionManager.js | 64 ++++----- Libraries/Text/RCTTextManager.m | 10 +- Libraries/react-native/react-native.js | 3 +- ReactKit/Base/RCTConvert.h | 117 +++++++++++++++++ ReactKit/Base/RCTConvert.m | 124 ++++-------------- ReactKit/Views/RCTTabBarItemManager.m | 2 +- ReactKit/Views/RCTTextFieldManager.m | 6 +- .../Views/RCTUIActivityIndicatorViewManager.m | 2 +- ReactKit/Views/RCTViewManager.h | 8 +- ReactKit/Views/RCTViewManager.m | 18 +-- packager/blacklist.js | 1 + 12 files changed, 203 insertions(+), 158 deletions(-) diff --git a/Libraries/Image/RCTStaticImageManager.m b/Libraries/Image/RCTStaticImageManager.m index ef60247f2..e292c2064 100644 --- a/Libraries/Image/RCTStaticImageManager.m +++ b/Libraries/Image/RCTStaticImageManager.m @@ -18,7 +18,7 @@ RCT_EXPORT_VIEW_PROPERTY(capInsets) RCT_REMAP_VIEW_PROPERTY(resizeMode, contentMode) -RCT_CUSTOM_VIEW_PROPERTY(src, RCTStaticImage *) +RCT_CUSTOM_VIEW_PROPERTY(src, RCTStaticImage) { if (json) { if ([[[json description] pathExtension] caseInsensitiveCompare:@"gif"] == NSOrderedSame) { @@ -30,7 +30,7 @@ RCT_CUSTOM_VIEW_PROPERTY(src, RCTStaticImage *) view.image = defaultView.image; } } -RCT_CUSTOM_VIEW_PROPERTY(tintColor, RCTStaticImage *) +RCT_CUSTOM_VIEW_PROPERTY(tintColor, RCTStaticImage) { if (json) { view.renderingMode = UIImageRenderingModeAlwaysTemplate; @@ -40,7 +40,7 @@ RCT_CUSTOM_VIEW_PROPERTY(tintColor, RCTStaticImage *) view.tintColor = defaultView.tintColor; } } -RCT_CUSTOM_VIEW_PROPERTY(imageTag, RCTStaticImage *) +RCT_CUSTOM_VIEW_PROPERTY(imageTag, RCTStaticImage) { if (json) { [RCTImageLoader loadImageWithTag:[RCTConvert NSString:json] callback:^(NSError *error, UIImage *image) { diff --git a/Libraries/Interaction/InteractionManager.js b/Libraries/Interaction/InteractionManager.js index 3e895f3b0..fbdd0cc9f 100644 --- a/Libraries/Interaction/InteractionManager.js +++ b/Libraries/Interaction/InteractionManager.js @@ -13,6 +13,14 @@ var invariant = require('invariant'); var keyMirror = require('keyMirror'); var setImmediate = require('setImmediate'); +var _emitter = new EventEmitter(); +var _interactionSet = new Set(); +var _addInteractionSet = new Set(); +var _deleteInteractionSet = new Set(); +var _nextUpdateHandle = null; +var _queue = []; +var _inc = 0; + /** * InteractionManager allows long-running work to be scheduled after any * interactions/animations have completed. In particular, this allows JavaScript @@ -20,11 +28,14 @@ var setImmediate = require('setImmediate'); * * Applications can schedule tasks to run after interactions with the following: * - * InteractionManager.runAfterInteractions(() => { - * // ...long-running synchronous task... - * }); + * ``` + * InteractionManager.runAfterInteractions(() => { + * // ...long-running synchronous task... + * }); + * ``` * * Compare this to other scheduling alternatives: + * * - requestAnimationFrame(): for code that animates a view over time. * - setImmediate/setTimeout(): run code later, note this may delay animations. * - runAfterInteractions(): run code later, without delaying active animations. @@ -37,27 +48,32 @@ var setImmediate = require('setImmediate'); * creating an interaction 'handle' on animation start, and clearing it upon * completion: * - * var handle = InteractionManager.createInteractionHandle(); - * // run animation... (`runAfterInteractions` tasks are queued) - * // later, on animation completion: - * InteractionManager.clearInteractionHandle(handle); - * // queued tasks run if all handles were cleared + * ``` + * var handle = InteractionManager.createInteractionHandle(); + * // run animation... (`runAfterInteractions` tasks are queued) + * // later, on animation completion: + * InteractionManager.clearInteractionHandle(handle); + * // queued tasks run if all handles were cleared + * ``` */ - -var _emitter = new EventEmitter(); -var _interactionSet = new Set(); -var _addInteractionSet = new Set(); -var _deleteInteractionSet = new Set(); -var _nextUpdateHandle = null; -var _queue = []; -var _inc = 0; - var InteractionManager = { Events: keyMirror({ interactionStart: true, interactionComplete: true, }), + /** + * Schedule a function to run after all interactions have completed. + */ + runAfterInteractions(callback) { + invariant( + typeof callback === 'function', + 'Must specify a function to schedule.' + ); + scheduleUpdate(); + _queue.push(callback); + }, + /** * Notify manager that an interaction has started. */ @@ -81,20 +97,6 @@ var InteractionManager = { _deleteInteractionSet.add(handle); }, - /** - * Schedule a function to run after all interactions have completed. - * - * @param {function} callback - */ - runAfterInteractions(callback) { - invariant( - typeof callback === 'function', - 'Must specify a function to schedule.' - ); - scheduleUpdate(); - _queue.push(callback); - }, - addListener: _emitter.addListener.bind(_emitter), }; diff --git a/Libraries/Text/RCTTextManager.m b/Libraries/Text/RCTTextManager.m index ffe0d8b1e..80f350fea 100644 --- a/Libraries/Text/RCTTextManager.m +++ b/Libraries/Text/RCTTextManager.m @@ -24,7 +24,7 @@ } RCT_REMAP_VIEW_PROPERTY(containerBackgroundColor, backgroundColor) -RCT_CUSTOM_VIEW_PROPERTY(numberOfLines, RCTText *) +RCT_CUSTOM_VIEW_PROPERTY(numberOfLines, RCTText) { NSLineBreakMode truncationMode = NSLineBreakByClipping; view.numberOfLines = json ? [RCTConvert NSInteger:json] : defaultView.numberOfLines; @@ -34,16 +34,16 @@ RCT_CUSTOM_VIEW_PROPERTY(numberOfLines, RCTText *) view.lineBreakMode = truncationMode; } -RCT_CUSTOM_SHADOW_PROPERTY(backgroundColor, RCTShadowText *) +RCT_CUSTOM_SHADOW_PROPERTY(backgroundColor, RCTShadowText) { view.textBackgroundColor = json ? [RCTConvert UIColor:json] : defaultView.textBackgroundColor; } -RCT_CUSTOM_SHADOW_PROPERTY(containerBackgroundColor, RCTShadowText *) +RCT_CUSTOM_SHADOW_PROPERTY(containerBackgroundColor, RCTShadowText) { view.backgroundColor = json ? [RCTConvert UIColor:json] : defaultView.backgroundColor; view.isBGColorExplicitlySet = json ? YES : defaultView.isBGColorExplicitlySet; } -RCT_CUSTOM_SHADOW_PROPERTY(numberOfLines, RCTShadowText *) +RCT_CUSTOM_SHADOW_PROPERTY(numberOfLines, RCTShadowText) { NSLineBreakMode truncationMode = NSLineBreakByClipping; view.maxNumberOfLines = json ? [RCTConvert NSInteger:json] : defaultView.maxNumberOfLines; @@ -52,7 +52,7 @@ RCT_CUSTOM_SHADOW_PROPERTY(numberOfLines, RCTShadowText *) } view.truncationMode = truncationMode; } -RCT_CUSTOM_SHADOW_PROPERTY(textAlign, RCTShadowText *) +RCT_CUSTOM_SHADOW_PROPERTY(textAlign, RCTShadowText) { view.textAlign = json ? [RCTConvert NSTextAlignment:json] : defaultView.textAlign; } diff --git a/Libraries/react-native/react-native.js b/Libraries/react-native/react-native.js index 6f0b22df5..00be3f65a 100644 --- a/Libraries/react-native/react-native.js +++ b/Libraries/react-native/react-native.js @@ -7,9 +7,9 @@ var ReactNative = { ...require('React'), - Animation: require('Animation'), ActivityIndicatorIOS: require('ActivityIndicatorIOS'), AlertIOS: require('AlertIOS'), + Animation: require('Animation'), AppRegistry: require('AppRegistry'), AppState: require('AppState'), AppStateIOS: require('AppStateIOS'), @@ -18,6 +18,7 @@ var ReactNative = { DatePickerIOS: require('DatePickerIOS'), ExpandingText: require('ExpandingText'), Image: require('Image'), + InteractionManager: require('InteractionManager'), LayoutAnimation: require('LayoutAnimation'), ListView: require('ListView'), ListViewDataSource: require('ListViewDataSource'), diff --git a/ReactKit/Base/RCTConvert.h b/ReactKit/Base/RCTConvert.h index 47c1cc2ed..d4baaf19a 100644 --- a/ReactKit/Base/RCTConvert.h +++ b/ReactKit/Base/RCTConvert.h @@ -44,6 +44,9 @@ + (CGRect)CGRect:(id)json; + (UIEdgeInsets)UIEdgeInsets:(id)json; ++ (CGLineCap)CGLineCap:(id)json; ++ (CGLineJoin)CGLineJoin:(id)json; + + (CATransform3D)CATransform3D:(id)json; + (CGAffineTransform)CGAffineTransform:(id)json; @@ -103,3 +106,117 @@ id RCTConvertValue(id target, NSString *keypath, id json); #ifdef __cplusplus } #endif + +/** + * This macro is used for creating converter functions with arbitrary logic. + */ +#define RCT_CONVERTER_CUSTOM(type, name, code) \ ++ (type)name:(id)json \ +{ \ + if (json == [NSNull null]) { \ + json = nil; \ + } \ + @try { \ + return code; \ + } \ + @catch (__unused NSException *e) { \ + RCTLogError(@"JSON value '%@' of type '%@' cannot be converted to '%s'", \ + json, [json class], #type); \ + json = nil; \ + return code; \ + } \ +} + +/** + * This macro is used for creating simple converter functions that just call + * the specified getter method on the json value. + */ +#define RCT_CONVERTER(type, name, getter) \ +RCT_CONVERTER_CUSTOM(type, name, [json getter]) + +/** + * This macro is used for creating converters for enum types. + */ +#define RCT_ENUM_CONVERTER(type, values, default, getter) \ ++ (type)type:(id)json \ +{ \ + static NSDictionary *mapping; \ + static dispatch_once_t onceToken; \ + dispatch_once(&onceToken, ^{ \ + mapping = values; \ + }); \ + if (!json || json == [NSNull null]) { \ + return default; \ + } \ + if ([json isKindOfClass:[NSNumber class]]) { \ + if ([[mapping allValues] containsObject:json] || [json getter] == default) { \ + return [json getter]; \ + } \ + RCTLogError(@"Invalid %s '%@'. should be one of: %@", #type, json, [mapping allValues]); \ + return default; \ + } \ + if (![json isKindOfClass:[NSString class]]) { \ + RCTLogError(@"Expected NSNumber or NSString for %s, received %@: %@", #type, [json class], json); \ + } \ + id value = mapping[json]; \ + if(!value && [json description].length > 0) { \ + RCTLogError(@"Invalid %s '%@'. should be one of: %@", #type, json, [mapping allKeys]); \ + } \ + return value ? [value getter] : default; \ +} + +/** + * This macro is used for creating converter functions for structs that consist + * of a number of CGFloat properties, such as CGPoint, CGRect, etc. + */ +#define RCT_CGSTRUCT_CONVERTER(type, values) \ ++ (type)type:(id)json \ +{ \ + @try { \ + static NSArray *fields; \ + static NSUInteger count; \ + static dispatch_once_t onceToken; \ + dispatch_once(&onceToken, ^{ \ + fields = values; \ + count = [fields count]; \ + }); \ + type result; \ + if ([json isKindOfClass:[NSArray class]]) { \ + if ([json count] != count) { \ + RCTLogError(@"Expected array with count %zd, but count is %zd: %@", count, [json count], json); \ + } else { \ + for (NSUInteger i = 0; i < count; i++) { \ + ((CGFloat *)&result)[i] = [json[i] doubleValue]; \ + } \ + } \ + } else if ([json isKindOfClass:[NSDictionary class]]) { \ + for (NSUInteger i = 0; i < count; i++) { \ + ((CGFloat *)&result)[i] = [json[fields[i]] doubleValue]; \ + } \ + } else if (json && json != [NSNull null]) { \ + RCTLogError(@"Expected NSArray or NSDictionary for %s, received %@: %@", #type, [json class], json); \ + } \ + return result; \ + } \ + @catch (__unused NSException *e) { \ + RCTLogError(@"JSON value '%@' cannot be converted to '%s'", json, #type); \ + type result; \ + return result; \ + } \ +} + +/** + * This macro is used for creating converter functions for typed arrays. + */ +#define RCT_ARRAY_CONVERTER(type) \ ++ (NSArray *)type##Array:(id)json \ +{ \ + NSMutableArray *values = [[NSMutableArray alloc] init]; \ + for (id jsonValue in [self NSArray:json]) { \ + id value = [self type:jsonValue]; \ + if (value) { \ + [values addObject:value]; \ + } \ + } \ + return values; \ +} diff --git a/ReactKit/Base/RCTConvert.m b/ReactKit/Base/RCTConvert.m index 7a47b1fe0..e972ea26b 100644 --- a/ReactKit/Base/RCTConvert.m +++ b/ReactKit/Base/RCTConvert.m @@ -11,100 +11,6 @@ NSString *const RCTDefaultFontName = @"HelveticaNeue"; NSString *const RCTDefaultFontWeight = @"normal"; NSString *const RCTBoldFontWeight = @"bold"; -#define RCT_CONVERTER_CUSTOM(type, name, code) \ -+ (type)name:(id)json \ -{ \ - @try { \ - return code; \ - } \ - @catch (__unused NSException *e) { \ - RCTLogError(@"JSON value '%@' of type '%@' cannot be converted to '%s'", \ - json, [json class], #type); \ - json = nil; \ - return code; \ - } \ -} - -#define RCT_CONVERTER(type, name, getter) \ -RCT_CONVERTER_CUSTOM(type, name, [json getter]) - -#define RCT_ENUM_CONVERTER(type, values, default, getter) \ -+ (type)type:(id)json \ -{ \ - static NSDictionary *mapping; \ - static dispatch_once_t onceToken; \ - dispatch_once(&onceToken, ^{ \ - mapping = values; \ - }); \ - if (!json) { \ - return default; \ - } \ - if ([json isKindOfClass:[NSNumber class]]) { \ - if ([[mapping allValues] containsObject:json] || [json getter] == default) { \ - return [json getter]; \ - } \ - RCTLogError(@"Invalid %s '%@'. should be one of: %@", #type, json, [mapping allValues]); \ - return default; \ - } \ - if (![json isKindOfClass:[NSString class]]) { \ - RCTLogError(@"Expected NSNumber or NSString for %s, received %@: %@", #type, [json class], json); \ - } \ - id value = mapping[json]; \ - if(!value && [json description].length > 0) { \ - RCTLogError(@"Invalid %s '%@'. should be one of: %@", #type, json, [mapping allKeys]); \ - } \ - return value ? [value getter] : default; \ -} - -#define RCT_STRUCT_CONVERTER(type, values) \ -+ (type)type:(id)json \ -{ \ - @try { \ - static NSArray *fields; \ - static NSUInteger count; \ - static dispatch_once_t onceToken; \ - dispatch_once(&onceToken, ^{ \ - fields = values; \ - count = [fields count]; \ - }); \ - type result; \ - if ([json isKindOfClass:[NSArray class]]) { \ - if ([json count] != count) { \ - RCTLogError(@"Expected array with count %zd, but count is %zd: %@", count, [json count], json); \ - } else { \ - for (NSUInteger i = 0; i < count; i++) { \ - ((CGFloat *)&result)[i] = [json[i] doubleValue]; \ - } \ - } \ - } else if ([json isKindOfClass:[NSDictionary class]]) { \ - for (NSUInteger i = 0; i < count; i++) { \ - ((CGFloat *)&result)[i] = [json[fields[i]] doubleValue]; \ - } \ - } else if (json) { \ - RCTLogError(@"Expected NSArray or NSDictionary for %s, received %@: %@", #type, [json class], json); \ - } \ - return result; \ - } \ - @catch (__unused NSException *e) { \ - RCTLogError(@"JSON value '%@' cannot be converted to '%s'", json, #type); \ - type result; \ - return result; \ - } \ -} - -#define RCT_ARRAY_CONVERTER(type) \ -+ (NSArray *)type##Array:(id)json \ -{ \ - NSMutableArray *values = [[NSMutableArray alloc] init]; \ - for (id jsonValue in [self NSArray:json]) { \ - id value = [self type:jsonValue]; \ - if (!value) { \ - [values addObject:value]; \ - } \ - } \ - return values; \ -} - @implementation RCTConvert RCT_CONVERTER(BOOL, BOOL, boolValue) @@ -178,19 +84,31 @@ RCT_ENUM_CONVERTER(UIKeyboardType, (@{ }), UIKeyboardTypeDefault, integerValue) RCT_CONVERTER(CGFloat, CGFloat, doubleValue) -RCT_STRUCT_CONVERTER(CGPoint, (@[@"x", @"y"])) -RCT_STRUCT_CONVERTER(CGSize, (@[@"w", @"h"])) -RCT_STRUCT_CONVERTER(CGRect, (@[@"x", @"y", @"w", @"h"])) -RCT_STRUCT_CONVERTER(UIEdgeInsets, (@[@"top", @"left", @"bottom", @"right"])) +RCT_CGSTRUCT_CONVERTER(CGPoint, (@[@"x", @"y"])) +RCT_CGSTRUCT_CONVERTER(CGSize, (@[@"w", @"h"])) +RCT_CGSTRUCT_CONVERTER(CGRect, (@[@"x", @"y", @"w", @"h"])) +RCT_CGSTRUCT_CONVERTER(UIEdgeInsets, (@[@"top", @"left", @"bottom", @"right"])) -RCT_STRUCT_CONVERTER(CATransform3D, (@[ +RCT_ENUM_CONVERTER(CGLineJoin, (@{ + @"miter": @(kCGLineJoinMiter), + @"round": @(kCGLineJoinRound), + @"bevel": @(kCGLineJoinBevel), +}), kCGLineJoinMiter, intValue) + +RCT_ENUM_CONVERTER(CGLineCap, (@{ + @"butt": @(kCGLineCapButt), + @"round": @(kCGLineCapRound), + @"square": @(kCGLineCapSquare), +}), kCGLineCapButt, intValue) + +RCT_CGSTRUCT_CONVERTER(CATransform3D, (@[ @"m11", @"m12", @"m13", @"m14", @"m21", @"m22", @"m23", @"m24", @"m31", @"m32", @"m33", @"m34", @"m41", @"m42", @"m43", @"m44" ])) -RCT_STRUCT_CONVERTER(CGAffineTransform, (@[@"a", @"b", @"c", @"d", @"tx", @"ty"])) +RCT_CGSTRUCT_CONVERTER(CGAffineTransform, (@[@"a", @"b", @"c", @"d", @"tx", @"ty"])) + (UIColor *)UIColor:(id)json { @@ -804,6 +722,12 @@ static id RCTConvertValueWithExplicitEncoding(id target, NSString *key, id json, @"extAlignment": ^(id val) { return [RCTConvert NSTextAlignment:val]; }, + @"Cap": ^(id val) { + return [RCTConvert CGLineCap:val]; + }, + @"Join": ^(id val) { + return [RCTConvert CGLineJoin:val]; + }, @"ointerEvents": ^(id val) { return [RCTConvert RCTPointerEvents:val]; }, diff --git a/ReactKit/Views/RCTTabBarItemManager.m b/ReactKit/Views/RCTTabBarItemManager.m index f74bc09ed..a840dd6bf 100644 --- a/ReactKit/Views/RCTTabBarItemManager.m +++ b/ReactKit/Views/RCTTabBarItemManager.m @@ -16,7 +16,7 @@ RCT_EXPORT_VIEW_PROPERTY(selected); RCT_EXPORT_VIEW_PROPERTY(icon); RCT_REMAP_VIEW_PROPERTY(selectedIcon, barItem.selectedImage); RCT_REMAP_VIEW_PROPERTY(badgeValue, barItem.badgeValue); -RCT_CUSTOM_VIEW_PROPERTY(title, RCTTabBarItem *) +RCT_CUSTOM_VIEW_PROPERTY(title, RCTTabBarItem) { view.barItem.title = json ? [RCTConvert NSString:json] : defaultView.barItem.title; view.barItem.imageInsets = [view.barItem.title length] ? UIEdgeInsetsZero : (UIEdgeInsets){6, 0, -6, 0}; diff --git a/ReactKit/Views/RCTTextFieldManager.m b/ReactKit/Views/RCTTextFieldManager.m index 52b29dc36..40a46e100 100644 --- a/ReactKit/Views/RCTTextFieldManager.m +++ b/ReactKit/Views/RCTTextFieldManager.m @@ -23,15 +23,15 @@ RCT_EXPORT_VIEW_PROPERTY(text) RCT_EXPORT_VIEW_PROPERTY(clearButtonMode) RCT_EXPORT_VIEW_PROPERTY(keyboardType) RCT_REMAP_VIEW_PROPERTY(color, textColor) -RCT_CUSTOM_VIEW_PROPERTY(fontSize, RCTTextField *) +RCT_CUSTOM_VIEW_PROPERTY(fontSize, RCTTextField) { view.font = [RCTConvert UIFont:view.font withSize:json ?: @(defaultView.font.pointSize)]; } -RCT_CUSTOM_VIEW_PROPERTY(fontWeight, RCTTextField *) +RCT_CUSTOM_VIEW_PROPERTY(fontWeight, RCTTextField) { view.font = [RCTConvert UIFont:view.font withWeight:json]; // TODO } -RCT_CUSTOM_VIEW_PROPERTY(fontFamily, RCTTextField *) +RCT_CUSTOM_VIEW_PROPERTY(fontFamily, RCTTextField) { view.font = [RCTConvert UIFont:view.font withFamily:json ?: defaultView.font.familyName]; } diff --git a/ReactKit/Views/RCTUIActivityIndicatorViewManager.m b/ReactKit/Views/RCTUIActivityIndicatorViewManager.m index e56f01106..2322e0d90 100644 --- a/ReactKit/Views/RCTUIActivityIndicatorViewManager.m +++ b/ReactKit/Views/RCTUIActivityIndicatorViewManager.m @@ -13,7 +13,7 @@ RCT_EXPORT_VIEW_PROPERTY(activityIndicatorViewStyle) RCT_EXPORT_VIEW_PROPERTY(color) -RCT_CUSTOM_VIEW_PROPERTY(animating, UIActivityIndicatorView *) +RCT_CUSTOM_VIEW_PROPERTY(animating, UIActivityIndicatorView) { BOOL animating = json ? [json boolValue] : [defaultView isAnimating]; if (animating != [view isAnimating]) { diff --git a/ReactKit/Views/RCTViewManager.h b/ReactKit/Views/RCTViewManager.h index b98fc34a3..2240228b8 100644 --- a/ReactKit/Views/RCTViewManager.h +++ b/ReactKit/Views/RCTViewManager.h @@ -122,11 +122,11 @@ RCT_REMAP_VIEW_PROPERTY(name, name) * view properties. The macro should be followed by a method body, which can * refer to "json", "view" and "defaultView" to implement the required logic. */ -#define RCT_CUSTOM_VIEW_PROPERTY(name, viewType) \ -- (void)set_##name:(id)json forView:(viewType)view withDefaultView:(viewType)defaultView +#define RCT_CUSTOM_VIEW_PROPERTY(name, viewClass) \ +- (void)set_##name:(id)json forView:(viewClass *)view withDefaultView:(viewClass *)defaultView -#define RCT_CUSTOM_SHADOW_PROPERTY(name, viewType) \ -- (void)set_##name:(id)json forShadowView:(viewType)view withDefaultView:(viewType)defaultView +#define RCT_CUSTOM_SHADOW_PROPERTY(name, viewClass) \ +- (void)set_##name:(id)json forShadowView:(viewClass *)view withDefaultView:(viewClass *)defaultView /** * These are useful in cases where the module's superclass handles a diff --git a/ReactKit/Views/RCTViewManager.m b/ReactKit/Views/RCTViewManager.m index 44bac5211..011f66f24 100644 --- a/ReactKit/Views/RCTViewManager.m +++ b/ReactKit/Views/RCTViewManager.m @@ -78,11 +78,11 @@ RCT_REMAP_VIEW_PROPERTY(borderColor, layer.borderColor); RCT_REMAP_VIEW_PROPERTY(borderRadius, layer.cornerRadius) RCT_REMAP_VIEW_PROPERTY(borderWidth, layer.borderWidth) RCT_REMAP_VIEW_PROPERTY(transformMatrix, layer.transform) -RCT_CUSTOM_VIEW_PROPERTY(overflow, UIView *) +RCT_CUSTOM_VIEW_PROPERTY(overflow, UIView) { view.clipsToBounds = json ? ![RCTConvert css_overflow:json] : defaultView.clipsToBounds; } -RCT_CUSTOM_VIEW_PROPERTY(pointerEvents, RCTView *) +RCT_CUSTOM_VIEW_PROPERTY(pointerEvents, RCTView) { if ([view respondsToSelector:@selector(setPointerEvents:)]) { view.pointerEvents = json ? [RCTConvert RCTPointerEvents:json] : defaultView.pointerEvents; @@ -112,32 +112,32 @@ RCT_CUSTOM_VIEW_PROPERTY(pointerEvents, RCTView *) // ShadowView properties -RCT_CUSTOM_SHADOW_PROPERTY(backgroundColor, RCTShadowView *) +RCT_CUSTOM_SHADOW_PROPERTY(backgroundColor, RCTShadowView) { view.backgroundColor = json ? [RCTConvert UIColor:json] : defaultView.backgroundColor; view.isBGColorExplicitlySet = json ? YES : defaultView.isBGColorExplicitlySet; } -RCT_CUSTOM_SHADOW_PROPERTY(flexDirection, RCTShadowView *) +RCT_CUSTOM_SHADOW_PROPERTY(flexDirection, RCTShadowView) { view.flexDirection = json? [RCTConvert css_flex_direction_t:json] : defaultView.flexDirection; } -RCT_CUSTOM_SHADOW_PROPERTY(flexWrap, RCTShadowView *) +RCT_CUSTOM_SHADOW_PROPERTY(flexWrap, RCTShadowView) { view.flexWrap = json ? [RCTConvert css_wrap_type_t:json] : defaultView.flexWrap; } -RCT_CUSTOM_SHADOW_PROPERTY(justifyContent, RCTShadowView *) +RCT_CUSTOM_SHADOW_PROPERTY(justifyContent, RCTShadowView) { view.justifyContent = json ? [RCTConvert css_justify_t:json] : defaultView.justifyContent; } -RCT_CUSTOM_SHADOW_PROPERTY(alignItems, RCTShadowView *) +RCT_CUSTOM_SHADOW_PROPERTY(alignItems, RCTShadowView) { view.alignItems = json ? [RCTConvert css_align_t:json] : defaultView.alignItems; } -RCT_CUSTOM_SHADOW_PROPERTY(alignSelf, RCTShadowView *) +RCT_CUSTOM_SHADOW_PROPERTY(alignSelf, RCTShadowView) { view.alignSelf = json ? [RCTConvert css_align_t:json] : defaultView.alignSelf; } -RCT_CUSTOM_SHADOW_PROPERTY(position, RCTShadowView *) +RCT_CUSTOM_SHADOW_PROPERTY(position, RCTShadowView) { view.positionType = json ? [RCTConvert css_position_type_t:json] : defaultView.positionType; } diff --git a/packager/blacklist.js b/packager/blacklist.js index 468a60404..850a87244 100644 --- a/packager/blacklist.js +++ b/packager/blacklist.js @@ -7,6 +7,7 @@ // modulePathIgnorePatterns. var sharedBlacklist = [ __dirname, + 'website', 'node_modules/parse/node_modules/xmlhttprequest/lib/XMLHttpRequest.js', 'node_modules/react-tools/src/utils/ImmutableObject.js', 'node_modules/react-tools/src/core/ReactInstanceHandles.js', From 4d598fe4fb0396c7ec955ba5ef86ddf22e86833a Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 15 Mar 2015 21:21:08 -0700 Subject: [PATCH 51/79] Use after_success instead of script, to hopefully get back xcode tests --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 20831d207..d5f4e59e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ install: - npm test # Automatically publish the website -script: '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && (cd website; npm install; ./setup.sh; ./publish.sh; echo) || echo' +after_success: '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && (cd website; npm install; ./setup.sh; ./publish.sh; echo) || echo' env: - secure: "g8Xjbslq4R+3oLVgBvXM5QhiJ+7q+H+dH4+sXReyyZ64M5gf32U7oOjQNVkdx79dnGFc6a619otGsX4RiEkQlkiR+4uCgJUIgPwN4YFCIgYu4Z/0FnbbRu5yyywh5zv4WwGmAtMkgGztoMBnps5gCiPUM/RGIqwVk0Ghbmh5c2k=" branches: From 85a13b48eb7756e3cbee6beb0db34813be0ba9f9 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Mon, 16 Mar 2015 09:24:33 -0700 Subject: [PATCH 52/79] [website] Do not absorb spaces in markdown comments --- website/layout/AutodocsLayout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/layout/AutodocsLayout.js b/website/layout/AutodocsLayout.js index f0481379a..3b8ea2ce5 100644 --- a/website/layout/AutodocsLayout.js +++ b/website/layout/AutodocsLayout.js @@ -100,7 +100,7 @@ var APIDoc = React.createClass({ .replace(/\*\/$/, '') .split('\n') .map(function(line) { - return line.trim().replace(/^\* */, ''); + return line.trim().replace(/^\* ?/, ''); }) .join('\n'); }, From 9b95a896e9f181b5bf51f251994e97c6a577b327 Mon Sep 17 00:00:00 2001 From: Spencer Ahrens Date: Mon, 16 Mar 2015 11:49:31 -0700 Subject: [PATCH 53/79] Cleanup doc text. --- docs/Image.md | 6 +++--- docs/Network.md | 10 +++++----- docs/Physical vs Logical Pixels.md | 4 ++-- docs/Timers.md | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/Image.md b/docs/Image.md index 55b10bb40..867bbaae7 100644 --- a/docs/Image.md +++ b/docs/Image.md @@ -8,7 +8,7 @@ In React Native, this behavior is intentionally not implemented. It is more work ## Background Image via Nesting -A common feature request from developers familiar with the web is `background-image`. It turns out that iOS has a very elegant solution to this: you can add elements as a children to an `` component. This simplifies the API and solves the use case. +A common feature request from developers familiar with the web is `background-image`. To handle this use case, simply create a normal `` component and add whatever children to it you would like to layer on top of it. ```javascript return ( @@ -24,7 +24,7 @@ Image decoding can take more than a frame-worth of time. This is one of the majo ## Static Assets -In the course of a project you add and remove images and in many instances, you end up shipping images you are not using anymore in the app. In order to fight this, we need to find a way to know statically which images are being used in the app. To do that, we introduced a marker called `ix`. The only allowed way to refer to an image in the bundle is to literally write `ix('name-of-the-asset')` in the source. +In the course of a project, it is not uncommon to add and remove many images and accidentally end up shipping images you are no longer using in the app. In order to fight this, we need to find a way to know statically which images are being used in the app. To do that, we introduced a marker called `ix`. The only allowed way to refer to an image in the bundle is to literally write `ix('name-of-the-asset')` in the source. ```javascript var { ix } = React; @@ -55,6 +55,6 @@ In React Native, one interesting decision is that the `src` attribute is named ` ``` -On the infrastructure side, the reason is that it allows to attach metadata to this object. For example if you are using `ix`, then we add a `isStored` attribute to flag it as a local file (don't rely on this fact, it's likely to change in the future!). This is also future proofing, for example we may want to support sprites at some point, instead of outputting `{uri: ...}`, we can output `{uri: ..., crop: {left: 10, top: 50, width: 20, height: 40}}` and transparently support spriting on all the existing call sites. +On the infrastructure side, the reason is that it allows to attach metadata to this object. For example if you are using `ix`, then we add an `isStatic` attribute to flag it as a local file (don't rely on this fact, it's likely to change in the future!). This is also future proofing, for example we may want to support sprites at some point, instead of outputting `{uri: ...}`, we can output `{uri: ..., crop: {left: 10, top: 50, width: 20, height: 40}}` and transparently support spriting on all the existing call sites. On the user side, this lets you annotate the object with useful attributes such as the dimension of the image in order to compute the size it's going to be displayed in. Feel free to use it as your data structure to store more information about your image. diff --git a/docs/Network.md b/docs/Network.md index 2526d1e5d..70ecb10e8 100644 --- a/docs/Network.md +++ b/docs/Network.md @@ -7,11 +7,11 @@ permalink: docs/network.html next: pixels --- -One of React Native goal is to be a playground where we can experiment with different architectures and crazy ideas. Since browsers are not flexible enough, we had no choice but to reimplement the entire stack. In the places that we did not intend to change, we tried to be as faithful as possible to the browser APIs, the networking stack is a great example. +One of React Native goal is to be a playground where we can experiment with different architectures and crazy ideas. Since browsers are not flexible enough, we had no choice but to reimplement the entire stack. In the places that we did not intend to change, we tried to be as faithful as possible to the browser APIs. The networking stack is a great example. ## XMLHttpRequest -XMLHttpRequest API is implemented on-top of [iOS networking apis](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html). The notable difference from web is the security model: you can read from arbitrary websites on the internet, there isn't no concept of [CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing). +XMLHttpRequest API is implemented on-top of [iOS networking apis](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html). The notable difference from web is the security model: you can read from arbitrary websites on the internet since there is no concept of [CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing). ```javascript var request = new XMLHttpRequest(); @@ -31,13 +31,13 @@ request.open('GET', 'https://mywebsite.com/endpoint.php'); request.send(); ``` -Please follow the [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) for a description of the API. +Please follow the [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) for a complete description of the API. -As a developer, you're probably not going to use XMLHttpRequest directly as its API is very tedious to work with. But the fact that it is implemented and compatible with the browser one gives you the ability to use third-party libraries such as [Parse JS SDK](https://parse.com/docs/js_guide) or [super-agent](https://github.com/visionmedia/superagent) directly from npm. +As a developer, you're probably not going to use XMLHttpRequest directly as its API is very tedious to work with. But the fact that it is implemented and compatible with the browser API gives you the ability to use third-party libraries such as [Parse JS SDK](https://parse.com/docs/js_guide) or [super-agent](https://github.com/visionmedia/superagent) directly from npm. ## Fetch -[fetch](https://fetch.spec.whatwg.org/) is a better API being worked on by the standard committee and already available in Chrome. It is available in React Native by default. +[fetch](https://fetch.spec.whatwg.org/) is a better networking API being worked on by the standard committee and is already available in Chrome. It is available in React Native by default. ```javascript fetch('https://mywebsite.com/endpoint.php') diff --git a/docs/Physical vs Logical Pixels.md b/docs/Physical vs Logical Pixels.md index e551d5ee4..0aac1e01c 100644 --- a/docs/Physical vs Logical Pixels.md +++ b/docs/Physical vs Logical Pixels.md @@ -10,7 +10,7 @@ next: style ## Pixel Grid Snapping -In iOS, you can specify positions and dimensions for elements with arbitrary precision, for example 29.674825. But, ultimately the physical display only have a fixed number of pixels, for example 640×960 for iphone 4 or 750×1334 for iphone 6. iOS tries to be as faithful as possible to the user value by spreading one original pixel into multiple ones to be trick the eye. The downside of this technique is that it makes the resulting element look blurry. +In iOS, you can specify positions and dimensions for elements with arbitrary precision, for example 29.674825. But, ultimately the physical display only have a fixed number of pixels, for example 640×960 for iphone 4 or 750×1334 for iphone 6. iOS tries to be as faithful as possible to the user value by spreading one original pixel into multiple ones to trick the eye. The downside of this technique is that it makes the resulting element look blurry. In practice, we found out that developers do not want this feature and they have to work around it by doing manual rounding in order to avoid having blurry elements. In React Native, we are rounding all the pixels automatically. @@ -20,7 +20,7 @@ In React Native, everything in JS and within the layout engine work with arbitra ## Displaying a line that's as thin as the device permits -A width of 1 is actually 2 physical pixels thick on an iPhone 4 and ~3 physical pixels thick on an iphone 6+. If you want to display a line that's as thin as possible, you can use a width of `1 / PixelRatio.get()`. It's a technique that works on all the devices independent of their pixel density. +A width of 1 is actually 2 physical pixels thick on an iPhone 4 and 3 physical pixels thick on an iphone 6+. If you want to display a line that's as thin as possible, you can use a width of `1 / PixelRatio.get()`. It's a technique that works on all the devices independent of their pixel density. ```javascript style={{ borderWidth: 1 / PixelRatio.get() }} diff --git a/docs/Timers.md b/docs/Timers.md index 6328f7562..ecca4290c 100644 --- a/docs/Timers.md +++ b/docs/Timers.md @@ -20,12 +20,12 @@ Timers are an important part of an application and React Native implements the [ `setImmediate` is executed at the end of the current JavaScript execution block, right before sending the batched response back to native. Note that if you call `setImmediate` within a `setImmediate` callback, it will be executed right away, it won't yield back to native in between. -The `Promise` implementation uses `setImmediate` its asynchronicity primitive. +The `Promise` implementation uses `setImmediate` as its asynchronicity primitive. ## InteractionManager -One reason why native apps feel so good performance wise is that barely any work is being done during an interaction/animation. In React Native, you can use `InteractionManager` that allows long-running work to be scheduled after any interactions/animations have completed. +One reason why well-built native apps feel so smooth is by avoiding expensive operations during interactions and animations. In React Native, we currently have a limitation that there is only a single JS execution thread, but you can use `InteractionManager` to make sure long-running work is scheduled to start after any interactions/animations have completed. Applications can schedule tasks to run after interactions with the following: From 84207f2ec86efd743fef7d69aa622948c900963e Mon Sep 17 00:00:00 2001 From: Felix Kling Date: Mon, 16 Mar 2015 15:06:57 -0700 Subject: [PATCH 54/79] Use npm version of react-docgen --- website/package.json | 20 +- website/react-docgen/.gitignore | 1 - website/react-docgen/CONTRIBUTING.md | 43 ---- website/react-docgen/LICENSE | 30 --- website/react-docgen/PATENTS | 23 -- website/react-docgen/README.md | 222 ------------------ website/react-docgen/bin/react-docgen.js | 168 ------------- website/react-docgen/example/buildDocs.sh | 42 ---- .../example/components/Component.js | 27 --- .../example/components/NoComponent.js | 4 - .../react-docgen/example/generateMarkdown.js | 80 ------- website/react-docgen/flow/react-docgen.js | 35 --- website/react-docgen/flow/recast.js | 35 --- website/react-docgen/lib/Documentation.js | 62 ----- .../lib/__mocks__/Documentation.js | 28 --- .../react-docgen/lib/__tests__/main-test.js | 75 ------ .../react-docgen/lib/__tests__/parse-test.js | 52 ---- .../componentDocblockHandler-test.js | 84 ------- .../__tests__/defaultPropsHandler-test.js | 73 ------ .../__tests__/propDocblockHandler-test.js | 195 --------------- .../__tests__/propTypeHandler-test.js | 203 ---------------- .../lib/handlers/componentDocblockHandler.js | 50 ---- .../lib/handlers/defaultPropsHandler.js | 79 ------- website/react-docgen/lib/handlers/index.js | 16 -- .../lib/handlers/propDocBlockHandler.js | 45 ---- .../lib/handlers/propTypeHandler.js | 121 ---------- website/react-docgen/lib/main.js | 61 ----- website/react-docgen/lib/parse.js | 69 ------ .../findAllReactCreateClassCalls-test.js | 106 --------- .../findExportedReactCreateClassCall-test.js | 106 --------- .../resolver/findAllReactCreateClassCalls.js | 47 ---- .../findExportedReactCreateClassCall.js | 78 ------ website/react-docgen/lib/resolver/index.js | 16 -- .../lib/utils/__tests__/docblock-test.js | 40 ---- .../lib/utils/__tests__/getMembers-test.js | 51 ---- .../lib/utils/__tests__/getPropType-test.js | 144 ------------ .../__tests__/getPropertyValuePath-test.js | 42 ---- .../isExportsOrModuleAssignment-test.js | 46 ---- .../lib/utils/__tests__/match-test.js | 41 ---- website/react-docgen/lib/utils/docblock.js | 60 ----- .../react-docgen/lib/utils/expressionTo.js | 80 ------- website/react-docgen/lib/utils/getMembers.js | 62 ----- .../react-docgen/lib/utils/getNameOrValue.js | 34 --- website/react-docgen/lib/utils/getPropType.js | 153 ------------ .../react-docgen/lib/utils/getPropertyName.js | 32 --- .../lib/utils/getPropertyValuePath.js | 31 --- website/react-docgen/lib/utils/index.js | 23 -- .../lib/utils/isExportsOrModuleAssignment.js | 37 --- .../lib/utils/isReactCreateClassCall.js | 37 --- .../lib/utils/isReactModuleName.js | 28 --- website/react-docgen/lib/utils/match.js | 40 ---- .../react-docgen/lib/utils/resolveToModule.js | 54 ----- .../react-docgen/lib/utils/resolveToValue.js | 46 ---- website/react-docgen/package.json | 41 ---- website/react-docgen/preprocessor.js | 9 - website/react-docgen/tests/preprocessor.js | 9 - website/react-docgen/tests/utils.js | 49 ---- website/server/extractDocs.js | 2 +- 58 files changed, 11 insertions(+), 3476 deletions(-) delete mode 100644 website/react-docgen/.gitignore delete mode 100644 website/react-docgen/CONTRIBUTING.md delete mode 100644 website/react-docgen/LICENSE delete mode 100644 website/react-docgen/PATENTS delete mode 100644 website/react-docgen/README.md delete mode 100755 website/react-docgen/bin/react-docgen.js delete mode 100755 website/react-docgen/example/buildDocs.sh delete mode 100644 website/react-docgen/example/components/Component.js delete mode 100644 website/react-docgen/example/components/NoComponent.js delete mode 100644 website/react-docgen/example/generateMarkdown.js delete mode 100644 website/react-docgen/flow/react-docgen.js delete mode 100644 website/react-docgen/flow/recast.js delete mode 100644 website/react-docgen/lib/Documentation.js delete mode 100644 website/react-docgen/lib/__mocks__/Documentation.js delete mode 100644 website/react-docgen/lib/__tests__/main-test.js delete mode 100644 website/react-docgen/lib/__tests__/parse-test.js delete mode 100644 website/react-docgen/lib/handlers/__tests__/componentDocblockHandler-test.js delete mode 100644 website/react-docgen/lib/handlers/__tests__/defaultPropsHandler-test.js delete mode 100644 website/react-docgen/lib/handlers/__tests__/propDocblockHandler-test.js delete mode 100644 website/react-docgen/lib/handlers/__tests__/propTypeHandler-test.js delete mode 100644 website/react-docgen/lib/handlers/componentDocblockHandler.js delete mode 100644 website/react-docgen/lib/handlers/defaultPropsHandler.js delete mode 100644 website/react-docgen/lib/handlers/index.js delete mode 100644 website/react-docgen/lib/handlers/propDocBlockHandler.js delete mode 100644 website/react-docgen/lib/handlers/propTypeHandler.js delete mode 100644 website/react-docgen/lib/main.js delete mode 100644 website/react-docgen/lib/parse.js delete mode 100644 website/react-docgen/lib/resolver/__tests__/findAllReactCreateClassCalls-test.js delete mode 100644 website/react-docgen/lib/resolver/__tests__/findExportedReactCreateClassCall-test.js delete mode 100644 website/react-docgen/lib/resolver/findAllReactCreateClassCalls.js delete mode 100644 website/react-docgen/lib/resolver/findExportedReactCreateClassCall.js delete mode 100644 website/react-docgen/lib/resolver/index.js delete mode 100644 website/react-docgen/lib/utils/__tests__/docblock-test.js delete mode 100644 website/react-docgen/lib/utils/__tests__/getMembers-test.js delete mode 100644 website/react-docgen/lib/utils/__tests__/getPropType-test.js delete mode 100644 website/react-docgen/lib/utils/__tests__/getPropertyValuePath-test.js delete mode 100644 website/react-docgen/lib/utils/__tests__/isExportsOrModuleAssignment-test.js delete mode 100644 website/react-docgen/lib/utils/__tests__/match-test.js delete mode 100644 website/react-docgen/lib/utils/docblock.js delete mode 100644 website/react-docgen/lib/utils/expressionTo.js delete mode 100644 website/react-docgen/lib/utils/getMembers.js delete mode 100644 website/react-docgen/lib/utils/getNameOrValue.js delete mode 100644 website/react-docgen/lib/utils/getPropType.js delete mode 100644 website/react-docgen/lib/utils/getPropertyName.js delete mode 100644 website/react-docgen/lib/utils/getPropertyValuePath.js delete mode 100644 website/react-docgen/lib/utils/index.js delete mode 100644 website/react-docgen/lib/utils/isExportsOrModuleAssignment.js delete mode 100644 website/react-docgen/lib/utils/isReactCreateClassCall.js delete mode 100644 website/react-docgen/lib/utils/isReactModuleName.js delete mode 100644 website/react-docgen/lib/utils/match.js delete mode 100644 website/react-docgen/lib/utils/resolveToModule.js delete mode 100644 website/react-docgen/lib/utils/resolveToValue.js delete mode 100644 website/react-docgen/package.json delete mode 100644 website/react-docgen/preprocessor.js delete mode 100644 website/react-docgen/tests/preprocessor.js delete mode 100644 website/react-docgen/tests/utils.js diff --git a/website/package.json b/website/package.json index 98cce63f2..1f2cd7159 100644 --- a/website/package.json +++ b/website/package.json @@ -1,18 +1,18 @@ { "scripts": { - "start": "node server/server.js", - "postinstall": "cd react-docgen && npm install" + "start": "node server/server.js" }, "dependencies": { - "react": "~0.12.0", - "optimist": "0.6.0", - "react-page-middleware": "git://github.com/facebook/react-page-middleware.git", "connect": "2.8.3", - "glob": "*", - "mkdirp": "*", - "request": "*", - "fs.extra": "*", "esprima-fb": "*", - "jstransform": "*" + "fs.extra": "*", + "glob": "*", + "jstransform": "*", + "mkdirp": "*", + "optimist": "0.6.0", + "react": "~0.12.0", + "react-docgen": "^1.0.0", + "react-page-middleware": "git://github.com/facebook/react-page-middleware.git", + "request": "*" } } diff --git a/website/react-docgen/.gitignore b/website/react-docgen/.gitignore deleted file mode 100644 index 849ddff3b..000000000 --- a/website/react-docgen/.gitignore +++ /dev/null @@ -1 +0,0 @@ -dist/ diff --git a/website/react-docgen/CONTRIBUTING.md b/website/react-docgen/CONTRIBUTING.md deleted file mode 100644 index ffee7fdee..000000000 --- a/website/react-docgen/CONTRIBUTING.md +++ /dev/null @@ -1,43 +0,0 @@ -# Contributing to react-docgen -We want to make contributing to this project as easy and transparent as -possible. - -## Our Development Process -The majority of development on react-docgen will occur through GitHub. Accordingly, -the process for contributing will follow standard GitHub protocol. - -## Pull Requests -We actively welcome your pull requests. -1. Fork the repo and create your branch from `master`. -2. If you've added code that should be tested, add tests -3. If you've changed APIs, update the documentation. -4. Ensure the test suite passes. -5. Make sure your code lints and typechecks. -6. If you haven't already, complete the Contributor License Agreement ("CLA"). - -## Contributor License Agreement ("CLA") -In order to accept your pull request, we need you to submit a CLA. You only need -to do this once to work on any of Facebook's open source projects. - -Complete your CLA here: - -## Issues -We use GitHub issues to track public bugs. Please ensure your description is -clear and has sufficient instructions to be able to reproduce the issue. - -Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe -disclosure of security bugs. In those cases, please go through the process -outlined on that page and do not file a public issue. - -## Coding Style -* Use semicolons; -* Commas last, -* 2 spaces for indentation (no tabs) -* Prefer `'` over `"` -* `"use strict";` -* 80 character line length -* "Attractive" - -## License -By contributing to react-docgen, you agree that your contributions will be licensed -under its BSD license. diff --git a/website/react-docgen/LICENSE b/website/react-docgen/LICENSE deleted file mode 100644 index 17e428880..000000000 --- a/website/react-docgen/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -BSD License - -For React docs generator software - -Copyright (c) 2015, Facebook, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name Facebook nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/website/react-docgen/PATENTS b/website/react-docgen/PATENTS deleted file mode 100644 index f8ef30d1d..000000000 --- a/website/react-docgen/PATENTS +++ /dev/null @@ -1,23 +0,0 @@ -Additional Grant of Patent Rights - -"Software" means the React docs generator software distributed by Facebook, Inc. - -Facebook hereby grants you a perpetual, worldwide, royalty-free, non-exclusive, -irrevocable (subject to the termination provision below) license under any -rights in any patent claims owned by Facebook, to make, have made, use, sell, -offer to sell, import, and otherwise transfer the Software. For avoidance of -doubt, no license is granted under Facebook’s rights in any patent claims that -are infringed by (i) modifications to the Software made by you or a third party, -or (ii) the Software in combination with any software or other technology -provided by you or a third party. - -The license granted hereunder will terminate, automatically and without notice, -for anyone that makes any claim (including by filing any lawsuit, assertion or -other action) alleging (a) direct, indirect, or contributory infringement or -inducement to infringe any patent: (i) by Facebook or any of its subsidiaries or -affiliates, whether or not such claim is related to the Software, (ii) by any -party if such claim arises in whole or in part from any software, product or -service of Facebook or any of its subsidiaries or affiliates, whether or not -such claim is related to the Software, or (iii) by any party relating to the -Software; or (b) that any right in any patent claim of Facebook is invalid or -unenforceable. diff --git a/website/react-docgen/README.md b/website/react-docgen/README.md deleted file mode 100644 index db9835fe9..000000000 --- a/website/react-docgen/README.md +++ /dev/null @@ -1,222 +0,0 @@ -# react-docgen - -`react-docgen` is a CLI and toolbox to help extracting information from React components, and generate documentation from it. - -It uses [recast][] to parse the source into an AST and provides methods to process this AST to extract the desired information. The output / return value is a JSON blob / JavaScript object. - -It provides a default implementation for React components defined via `React.createClass`. These component definitions must follow certain guidelines in order to be analyzable (see below for more info). - -## Install - -Install the module directly from npm: - -``` -npm install -g react-docgen -``` - -## CLI - -Installing the module adds a `react-docgen` executable which allows you do convert -a single file, multiple files or an input stream. We are trying to make the -executable as versatile as possible so that it can be integrated into many -workflows. - -``` -Usage: react-docgen [path]... [options] - -path A component file or directory. If no path is provided it reads from stdin. - -Options: - -o FILE, --out FILE store extracted information in FILE - --pretty pretty print JSON - -x, --extension File extensions to consider. Repeat to define multiple extensions. Default: [js,jsx] - -i, --ignore Folders to ignore. Default: [node_modules,__tests__] - -Extract meta information from React components. -If a directory is passed, it is recursively traversed. -``` - -By default, `react-docgen` will look for the exported component created through `React.createClass` in each file. Have a look below for how to customize this behavior. - -Have a look at `example/` for an example of how to use the result to generate -a markdown version of the documentation. - -## API - -The tool can be used programmatically to extract component information and customize the extraction process: - -```js -var reactDocs = require('react-docgen'); -var componentInfo = reactDocs.parse(src); -``` - -As with the CLI, this will look for the exported component created through `React.createClass` in the provided source. The whole process of analyzing the source code is separated into two parts: - -- Locating/finding the nodes in the AST which define the component -- Extracting information from those nodes - -`parse` accepts more arguments with which this behavior can be customized. - -### parse(source \[, resolver \[, handlers\]\]) - -| Parameter | Type | Description | -| -------------- | ------ | --------------- | -| source | string | The source text | -| resolver | function | A function of the form `(ast: ASTNode, recast: Object) => (NodePath|Array)`. Given an AST and a reference to recast, it returns an (array of) NodePath which represents the component definition. | -| handlers | Array\ | An array of functions of the form `(documentation: Documentation, definition: NodePath) => void`. Each function is called with a `Documentation` object and a reference to the component definition as returned by `resolver`. Handlers extract relevant information from the definition and augment `documentation`. - - -#### resolver - -The resolver's task is to extract those parts from the source code which the handlers can analyze. For example, the `findExportedReactCreateClassCall` resolver inspects the AST to find - -```js -var Component = React.createClass(); -module.exports = Component; -``` - -and returns the ObjectExpression to which `` resolves. - -`findAllReactCreateClassCalls` works similarly, but simply finds all `React.createClass` calls, not only the one that creates the exported component. - - This makes it easy, together with the utility methods created to analyze the AST, to introduce new or custom resolver methods. For example, a resolver could look for plain ObjectExpressions with a `render` method or `class Component extends React.Component` instead (**note:** a default resolver for `class` based react components is planned). - -#### handlers - -Handlers do the actual work and extract the desired information from the result the resolver returned. Like the resolver, they try to delegate as much work as possible to the reusable utility functions. - -For example, while the `propTypesHandler` expects the prop types definition to be an ObjectExpression and be located inside an ObjectExpression under the property name `propTypes`, most of the work is actually performed by the `getPropType` utility function. - -## Guidelines for default resolvers and handlers - -- Modules have to export a single component, and only that component is - analyzed. -- The component definition must be an object literal. -- `propTypes` must be an object literal or resolve to an object literal in the - same file. -- The `return` statement in `getDefaultProps` must contain an object literal. - -## Example - -For the following component - -```js -var React = require('react'); - -/** - * General component description. - */ -var Component = React.createClass({ - propTypes: { - /** - * Description of prop "foo". - */ - foo: React.PropTypes.number, - /** - * Description of prop "bar" (a custom validation function). - */ - bar: function(props, propName, componentName) { - // ... - }, - baz: React.PropTypes.oneOfType([ - React.PropTypes.number, - React.PropTypes.string - ]), - }, - - getDefaultProps: function() { - return { - foo: 42, - bar: 21 - }; - }, - - render: function() { - // ... - } -}); - -module.exports = Component; -``` - -we are getting this output: - -``` -{ - "props": { - "foo": { - "type": { - "name": "number" - }, - "required": false, - "description": "Description of prop \"foo\".", - "defaultValue": { - "value": "42", - "computed": false - } - }, - "bar": { - "type": { - "name": "custom" - }, - "required": false, - "description": "Description of prop \"bar\" (a custom validation function).", - "defaultValue": { - "value": "21", - "computed": false - } - }, - "baz": { - "type": { - "name": "union", - "value": [ - { - "name": "number" - }, - { - "name": "string" - } - ] - }, - "required": false, - "description": "" - } - }, - "description": "General component description." -} -``` - -## Result data structure - -The structure of the JSON blob / JavaScript object is as follows: - -``` -{ - "description": string - "props": { - "": { - "type": { - "name": "", - ["value": ] - ["raw": string] - }, - "required": boolean, - "description": string, - ["defaultValue": { - "value": number | string, - "computed": boolean - }] - }, - ... - }, - ["composes": ] -} -``` -(`[...]` means the property may not exist if such information was not found in the component definition) - -- ``: For each prop that was found, there will be an entry in `props` under the same name. -- ``: The name of the type, which is usually corresponds to the function name in `React.PropTypes`. However, for types define with `oneOf`, we use `"enum"` and for `oneOfType` we use `"union"`. If a custom function is provided or the type cannot be resolved to anything of `React.PropTypes`, we use `"custom"`. -- ``: Some types accept parameters which define the type in more detail (such as `arrayOf`, `instanceOf`, `oneOf`, etc). Those are stored in ``. The data type of `` depends on the type definition. - - -[recast]: https://github.com/benjamn/recast diff --git a/website/react-docgen/bin/react-docgen.js b/website/react-docgen/bin/react-docgen.js deleted file mode 100755 index da5c50764..000000000 --- a/website/react-docgen/bin/react-docgen.js +++ /dev/null @@ -1,168 +0,0 @@ -#!/usr/bin/env node -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -var argv = require('nomnom') - .script('react-docgen') - .help( - 'Extract meta information from React components.\n' + - 'If a directory is passed, it is recursively traversed.' - ) - .options({ - path: { - position: 0, - help: 'A component file or directory. If no path is provided it reads from stdin.', - metavar: 'PATH', - list: true - }, - out: { - abbr: 'o', - help: 'store extracted information in FILE', - metavar: 'FILE' - }, - pretty: { - help: 'pretty print JSON', - flag: true - }, - extension: { - abbr: 'x', - help: 'File extensions to consider. Repeat to define multiple extensions. Default:', - list: true, - default: ['js', 'jsx'] - }, - ignoreDir: { - abbr: 'i', - full: 'ignore', - help: 'Folders to ignore. Default:', - list: true, - default: ['node_modules', '__tests__'] - } - }) - .parse(); - -var async = require('async'); -var dir = require('node-dir'); -var fs = require('fs'); -var parser = require('../dist/main.js'); - -var output = argv.o; -var paths = argv.path; -var extensions = new RegExp('\\.(?:' + argv.extension.join('|') + ')$'); -var ignoreDir = argv.ignoreDir; - -function writeError(msg, path) { - if (path) { - process.stderr.write('Error with path "' + path + '": '); - } - process.stderr.write(msg + '\n'); -} - -function exitWithError(error) { - writeError(error); - process.exit(1); -} - -function exitWithResult(result) { - result = argv.pretty ? - JSON.stringify(result, null, 2) : - JSON.stringify(result); - if (argv.o) { - fs.writeFileSync(argv.o, result); - } else { - process.stdout.write(result + '\n'); - } - process.exit(0); -} - -/** - * 1. No files passed, consume input stream - */ -if (paths.length === 0) { - var source = ''; - process.stdin.setEncoding('utf8'); - process.stdin.resume(); - var timer = setTimeout(function() { - process.stderr.write('Still waiting for std input...'); - }, 5000); - process.stdin.on('data', function (chunk) { - clearTimeout(timer); - source += chunk; - }); - process.stdin.on('end', function () { - exitWithResult(parser.parse(source)); - }); -} - -function traverseDir(path, result, done) { - dir.readFiles( - path, - { - match: extensions, - excludeDir: ignoreDir - }, - function(error, content, filename, next) { - if (error) { - exitWithError(error); - } - try { - result[filename] = parser.parse(content); - } catch(error) { - writeError(error, path); - } - next(); - }, - function(error) { - if (error) { - writeError(error); - } - done(); - } - ); -} - -/** - * 2. Paths are passed. - */ -var result = Object.create(null); -async.eachSeries(paths, function(path, done) { - fs.stat(path, function(error, stats) { - if (error) { - writeError(error, path); - done(); - return; - } - if (stats.isDirectory()) { - traverseDir(path, result, done); - } - else { - try { - result[path] = parser.parse(fs.readFileSync(path)); - } catch(error) { - writeError(error, path); - } - finally { - done(); - } - } - }); -}, function() { - var resultsPaths = Object.keys(result); - if (resultsPaths.length === 0) { - // we must have gotten an error - process.exit(1); - } - if (paths.length === 1) { // a single path? - fs.stat(paths[0], function(error, stats) { - exitWithResult(stats.isDirectory() ? result : result[resultsPaths[0]]); - }); - } else { - exitWithResult(result); - } -}); diff --git a/website/react-docgen/example/buildDocs.sh b/website/react-docgen/example/buildDocs.sh deleted file mode 100755 index 6230fe3fb..000000000 --- a/website/react-docgen/example/buildDocs.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env node - -/** - * This example script expects a JSON blob generated by react-docgen as input, - * e.g. react-docgen components/* | buildDocs.sh - */ - -var fs = require('fs'); -var generateMarkdown = require('./generateMarkdown'); -var path = require('path'); - -var json = ''; -process.stdin.setEncoding('utf8'); -process.stdin.on('readable', function() { - var chunk = process.stdin.read(); - if (chunk !== null) { - json += chunk; - } -}); - -process.stdin.on('end', function() { - buildDocs(JSON.parse(json)); -}); - -function buildDocs(api) { - // api is an object keyed by filepath. We use the file name as component name. - for (var filepath in api) { - var name = getComponentName(filepath); - var markdown = generateMarkdown(name, api[filepath]); - fs.writeFileSync(name + '.md', markdown); - process.stdout.write(filepath + ' -> ' + name + '.md\n'); - } -} - -function getComponentName(filepath) { - var name = path.basename(filepath); - var ext; - while ((ext = path.extname(name))) { - name = name.substring(0, name.length - ext.length); - } - return name; -} diff --git a/website/react-docgen/example/components/Component.js b/website/react-docgen/example/components/Component.js deleted file mode 100644 index e62f85af6..000000000 --- a/website/react-docgen/example/components/Component.js +++ /dev/null @@ -1,27 +0,0 @@ -var React = require('react'); -var Foo = require('Foo'); - -/** - * General component description. - */ -var Component = React.createClass({ - propTypes: { - ...Foo.propTypes, - /** - * Prop description - */ - bar: React.PropTypes.number - }, - - getDefaultProps: function() { - return { - bar: 21 - }; - }, - - render: function() { - // ... - } -}); - -module.exports = Component; diff --git a/website/react-docgen/example/components/NoComponent.js b/website/react-docgen/example/components/NoComponent.js deleted file mode 100644 index 96cf951e3..000000000 --- a/website/react-docgen/example/components/NoComponent.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * An example for a module that is not a component. - */ -module.exports = "abc"; diff --git a/website/react-docgen/example/generateMarkdown.js b/website/react-docgen/example/generateMarkdown.js deleted file mode 100644 index b4018c052..000000000 --- a/website/react-docgen/example/generateMarkdown.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -"use strict"; - -function stringOfLength(string, length) { - var newString = ''; - for (var i = 0; i < length; i++) { - newString += string; - } - return newString; -} - -function generateTitle(name) { - var title = '`' + name + '` (component)'; - return title + '\n' + stringOfLength('=', title.length) + '\n'; -} - -function generateDesciption(description) { - return description + '\n'; -} - -function generatePropType(type) { - var values; - if (Array.isArray(type.value)) { - values = '(' + - type.value.map(function(typeValue) { - return typeValue.name || typeValue.value; - }).join('|') + - ')'; - } else { - values = type.value; - } - - return 'type: `' + type.name + (values ? values: '') + '`\n'; -} - -function generatePropDefaultValue(value) { - return 'defaultValue: `' + value.value + '`\n'; -} - -function generateProp(propName, prop) { - return ( - '### `' + propName + '`' + (prop.required ? ' (required)' : '') + '\n' + - '\n' + - (prop.description ? prop.description + '\n\n' : '') + - (prop.type ? generatePropType(prop.type) : '') + - (prop.defaultValue ? generatePropDefaultValue(prop.defaultValue) : '') + - '\n' - ); -} - -function generateProps(props) { - var title = 'Props'; - - return ( - title + '\n' + - stringOfLength('-', title.length) + '\n' + - '\n' + - Object.keys(props).sort().map(function(propName) { - return generateProp(propName, props[propName]); - }).join('\n') - ); -} - -function generateMarkdown(name, reactAPI) { - var markdownString = - generateTitle(name) + '\n' + - generateDesciption(reactAPI.description) + '\n' + - generateProps(reactAPI.props); - - return markdownString; -} - -module.exports = generateMarkdown; diff --git a/website/react-docgen/flow/react-docgen.js b/website/react-docgen/flow/react-docgen.js deleted file mode 100644 index 645bb2a9b..000000000 --- a/website/react-docgen/flow/react-docgen.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -type PropTypeDescriptor = { - name: string; - value?: any; - raw?: string; -}; - -type PropDescriptor = { - type?: PropTypeDescriptor; - required?: boolean; - defaultValue?: any; - description?: string; -}; - -declare class Documentation { - addComposes(moduleName: string): void; - getDescription(): string; - setDescription(description: string): void; - getPropDescriptor(propName: string): PropDescriptor; - toObject(): Object; -} - - -type Handler = (documentation: Documentation, path: NodePath) => void; -type Resolver = - (node: ASTNode, recast: Recast) => (NodePath|Array|void); diff --git a/website/react-docgen/flow/recast.js b/website/react-docgen/flow/recast.js deleted file mode 100644 index 8e73094ed..000000000 --- a/website/react-docgen/flow/recast.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * A minimal set of declarations to make flow work with the recast API. - */ - -type ASTNode = Object; - -declare class Scope { - lookup(name: string): ?Scope; - getBindings(): Object>; -} - -declare class NodePath { - node: ASTNode; - parent: NodePath; - scope: Scope; - - get(...x: (string|number)): NodePath; - each(f: (p: NodePath) => void): void; - map(f: (p: NodePath) => T): Array; -} - -type Recast = { - parse: (src: string) => ASTNode; - print: (path: NodePath) => {code: string}; -}; diff --git a/website/react-docgen/lib/Documentation.js b/website/react-docgen/lib/Documentation.js deleted file mode 100644 index 9f457e73e..000000000 --- a/website/react-docgen/lib/Documentation.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -class Documentation { - _props: Object; - _description: string; - _composes: Array; - - constructor() { - this._props = {}; - this._description = ''; - this._composes = []; - } - - addComposes(moduleName: string) { - if (this._composes.indexOf(moduleName) === -1) { - this._composes.push(moduleName); - } - } - - getDescription(): string { - return this._description; - } - - setDescription(description: string): void { - this._description = description; - } - - getPropDescriptor(propName: string): PropDescriptor { - var propDescriptor = this._props[propName]; - if (!propDescriptor) { - propDescriptor = this._props[propName] = {}; - } - return propDescriptor; - } - - toObject(): Object { - var obj = { - description: this._description, - props: this._props - }; - - if (this._composes.length) { - obj.composes = this._composes; - } - return obj; - } -} - -module.exports = Documentation; diff --git a/website/react-docgen/lib/__mocks__/Documentation.js b/website/react-docgen/lib/__mocks__/Documentation.js deleted file mode 100644 index 123270280..000000000 --- a/website/react-docgen/lib/__mocks__/Documentation.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -function Documentation() { - return { - description: '', - composes: [], - descriptors: {}, - getPropDescriptor(name) { - return this.descriptors[name] || (this.descriptors[name] = {}); - }, - addComposes(name) { - this.composes.push(name); - }, - setDescription(descr) { - this.description = descr; - } - }; -} - -module.exports = Documentation; diff --git a/website/react-docgen/lib/__tests__/main-test.js b/website/react-docgen/lib/__tests__/main-test.js deleted file mode 100644 index e115422ee..000000000 --- a/website/react-docgen/lib/__tests__/main-test.js +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); - -var source = [ - 'var React = require("React");', - 'var PropTypes = React.PropTypes;', - '/**', - ' * Example component description', - ' */', - 'var Component = React.createClass({', - ' propTypes: {', - ' /**', - ' * Example prop description', - ' */', - ' foo: PropTypes.bool', - ' },', - ' getDefaultProps: function() {', - ' return {', - ' foo: true', - ' };', - ' }', - '});', - 'module.exports = Component;' -].join('\n'); - -describe('main', function() { - var utils; - var docgen; - - beforeEach(function() { - utils = require('../../tests/utils'); - docgen = require('../main'); - }); - - it('parses with default resolver/handlers', function() { - var docs = docgen.parse(source); - expect(docs).toEqual({ - description: 'Example component description', - props: { - foo: { - type: { - name: 'bool' - }, - defaultValue: { - computed: false, - value: 'true' - }, - description: 'Example prop description', - required: false - } - } - }); - }); - - it('parses with custom handlers', function() { - var docs = docgen.parse(source, null, [ - docgen.handlers.componentDocblockHandler, - ]); - expect(docs).toEqual({ - description: 'Example component description', - props: {} - }); - }); -}); diff --git a/website/react-docgen/lib/__tests__/parse-test.js b/website/react-docgen/lib/__tests__/parse-test.js deleted file mode 100644 index e332b9a0f..000000000 --- a/website/react-docgen/lib/__tests__/parse-test.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); - -describe('parse', function() { - var utils; - var parse; - - beforeEach(function() { - utils = require('../../tests/utils'); - parse = require('../parse'); - }); - - function pathFromSource(source) { - return utils.parse(source).get('body', 0, 'expression'); - } - - it('allows custom component definition resolvers', function() { - var path = pathFromSource('({foo: "bar"})'); - var resolver = jest.genMockFunction().mockReturnValue(path); - var handler = jest.genMockFunction(); - parse('', resolver, [handler]); - - expect(resolver).toBeCalled(); - expect(handler.mock.calls[0][1]).toBe(path); - }); - - it('errors if component definition is not found', function() { - var resolver = jest.genMockFunction(); - expect(function() { - parse('', resolver); - }).toThrow(parse.ERROR_MISSING_DEFINITION); - expect(resolver).toBeCalled(); - - handler = jest.genMockFunction().mockReturnValue([]); - expect(function() { - parse('', resolver); - }).toThrow(parse.ERROR_MISSING_DEFINITION); - expect(resolver).toBeCalled(); - }); - -}); diff --git a/website/react-docgen/lib/handlers/__tests__/componentDocblockHandler-test.js b/website/react-docgen/lib/handlers/__tests__/componentDocblockHandler-test.js deleted file mode 100644 index 6e9c53e18..000000000 --- a/website/react-docgen/lib/handlers/__tests__/componentDocblockHandler-test.js +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); -jest.mock('../../Documentation'); - -describe('componentDocblockHandler', function() { - var utils; - var documentation; - var componentDocblockHandler; - - function parse(src) { - var programPath = utils.parse(src); - return programPath.get( - 'body', - programPath.node.body.length - 1, - 'declarations', - 0, - 'init', - 'arguments', - 0 - ); - } - - beforeEach(function() { - utils = require('../../../tests/utils'); - documentation = new (require('../../Documentation')); - componentDocblockHandler = require('../componentDocblockHandler'); - }); - - it('finds docblocks for component definitions', function() { - var definition = parse([ - '/**', - ' * Component description', - ' */', - 'var Component = React.createClass({});', - ].join('\n')); - - componentDocblockHandler(documentation, definition); - expect(documentation.description).toBe('Component description'); - }); - - it('ignores other types of comments', function() { - var definition = parse([ - '/*', - ' * This is not a docblock', - ' */', - 'var Component = React.createClass({});', - ].join('\n')); - - componentDocblockHandler(documentation, definition); - expect(documentation.description).toBe(''); - - definition = parse([ - '// Inline comment', - 'var Component = React.createClass({});', - ].join('\n')); - - componentDocblockHandler(documentation, definition); - expect(documentation.description).toBe(''); - }); - - it('only considers the docblock directly above the definition', function() { - var definition = parse([ - '/**', - ' * This is the wrong docblock', - ' */', - 'var something_else = "foo";', - 'var Component = React.createClass({});', - ].join('\n')); - - componentDocblockHandler(documentation, definition); - expect(documentation.description).toBe(''); - }); -}); diff --git a/website/react-docgen/lib/handlers/__tests__/defaultPropsHandler-test.js b/website/react-docgen/lib/handlers/__tests__/defaultPropsHandler-test.js deleted file mode 100644 index dd83dfd5f..000000000 --- a/website/react-docgen/lib/handlers/__tests__/defaultPropsHandler-test.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); -jest.mock('../../Documentation'); - -describe('defaultPropsHandler', function() { - var utils; - var documentation; - var defaultValueHandler; - - function parse(src) { - return utils.parse(src).get('body', 0, 'expression'); - } - - beforeEach(function() { - utils = require('../../../tests/utils'); - documentation = new (require('../../Documentation')); - defaultPropsHandler = require('../defaultPropsHandler'); - }); - - it ('should find prop default values that are literals', function() { - var definition = parse([ - '({', - ' getDefaultProps: function() {', - ' return {', - ' foo: "bar",', - ' bar: 42,', - ' baz: ["foo", "bar"],', - ' abc: {xyz: abc.def, 123: 42}', - ' };', - ' }', - '});' - ].join('\n')); - - defaultPropsHandler(documentation, definition); - expect(documentation.descriptors).toEqual({ - foo: { - defaultValue: { - value: '"bar"', - computed: false - } - }, - bar: { - defaultValue: { - value: '42', - computed: false - } - }, - baz: { - defaultValue: { - value: '["foo", "bar"]', - computed: false - } - }, - abc: { - defaultValue: { - value: '{xyz: abc.def, 123: 42}', - computed: false - } - } - }); - }); -}); diff --git a/website/react-docgen/lib/handlers/__tests__/propDocblockHandler-test.js b/website/react-docgen/lib/handlers/__tests__/propDocblockHandler-test.js deleted file mode 100644 index 74eb03fb5..000000000 --- a/website/react-docgen/lib/handlers/__tests__/propDocblockHandler-test.js +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); -jest.mock('../../Documentation'); - -describe('propDocblockHandler', function() { - var utils; - var documentation; - var propDocblockHandler; - - beforeEach(function() { - utils = require('../../../tests/utils'); - documentation = new (require('../../Documentation')); - propDocblockHandler = require('../propDocblockHandler'); - }); - - function parse(definition) { - var programPath = utils.parse(definition); - return programPath.get( - 'body', - programPath.node.body.length - 1, - 'expression' - ); - } - - it('finds docblocks for prop types', function() { - var definition = parse([ - '({', - ' propTypes: {', - ' /**', - ' * Foo comment', - ' */', - ' foo: Prop.bool,', - '', - ' /**', - ' * Bar comment', - ' */', - ' bar: Prop.bool,', - ' }', - '})' - ].join('\n')); - - propDocblockHandler(documentation, definition); - expect(documentation.descriptors).toEqual({ - foo: { - description: 'Foo comment' - }, - bar: { - description: 'Bar comment' - } - }); - }); - - it('can handle multline comments', function() { - var definition = parse([ - '({', - ' propTypes: {', - ' /**', - ' * Foo comment with', - ' * many lines!', - ' *', - ' * even with empty lines in between', - ' */', - ' foo: Prop.bool', - ' }', - '})' - ].join('\n')); - - propDocblockHandler(documentation, definition); - expect(documentation.descriptors).toEqual({ - foo: { - description: - 'Foo comment with\nmany lines!\n\neven with empty lines in between' - }, - }); - }); - - it('ignores non-docblock comments', function() { - var definition = parse([ - '({', - ' propTypes: {', - ' /**', - ' * Foo comment', - ' */', - ' // TODO: remove this comment', - ' foo: Prop.bool,', - '', - ' /**', - ' * Bar comment', - ' */', - ' /* This is not a doc comment */', - ' bar: Prop.bool,', - ' }', - '})' - ].join('\n')); - - propDocblockHandler(documentation, definition); - expect(documentation.descriptors).toEqual({ - foo: { - description: 'Foo comment' - }, - bar: { - description: 'Bar comment' - } - }); - }); - - it('only considers the comment with the property below it', function() { - var definition = parse([ - '({', - ' propTypes: {', - ' /**', - ' * Foo comment', - ' */', - ' foo: Prop.bool,', - ' bar: Prop.bool,', - ' }', - '})' - ].join('\n')); - - propDocblockHandler(documentation, definition); - expect(documentation.descriptors).toEqual({ - foo: { - description: 'Foo comment' - }, - bar: { - description: '' - } - }); - }); - - it('understands and ignores the spread operator', function() { - var definition = parse([ - '({', - ' propTypes: {', - ' ...Foo.propTypes,', - ' /**', - ' * Foo comment', - ' */', - ' foo: Prop.bool,', - ' }', - '})' - ].join('\n')); - - propDocblockHandler(documentation, definition); - expect(documentation.descriptors).toEqual({ - foo: { - description: 'Foo comment' - } - }); - }); - - it('resolves variables', function() { - var definition = parse([ - 'var Props = {', - ' /**', - ' * Foo comment', - ' */', - ' foo: Prop.bool,', - '};', - '({', - ' propTypes: Props', - '})' - ].join('\n')); - - propDocblockHandler(documentation, definition); - expect(documentation.descriptors).toEqual({ - foo: { - description: 'Foo comment' - } - }); - }); - - it('does not error if propTypes cannot be found', function() { - var definition = parse([ - '({', - ' fooBar: 42', - '})', - ].join('\n')); - - expect(function() { - propDocblockHandler(documentation, definition); - }).not.toThrow(); - }); -}); diff --git a/website/react-docgen/lib/handlers/__tests__/propTypeHandler-test.js b/website/react-docgen/lib/handlers/__tests__/propTypeHandler-test.js deleted file mode 100644 index 529f73cf2..000000000 --- a/website/react-docgen/lib/handlers/__tests__/propTypeHandler-test.js +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); -jest.mock('../../Documentation'); - -describe('propTypeHandler', function() { - var utils; - var getPropTypeMock; - var documentation; - var propTypeHandler; - - beforeEach(function() { - utils = require('../../../tests/utils'); - getPropTypeMock = jest.genMockFunction().mockImplementation(() => ({})); - jest.setMock('../../utils/getPropType', getPropTypeMock); - jest.mock('../../utils/getPropType'); - - documentation = new (require('../../Documentation')); - propTypeHandler = require('../propTypeHandler'); - }); - - function parse(definition) { - var programPath = utils.parseWithTemplate(definition, utils.REACT_TEMPLATE); - return programPath.get( - 'body', - programPath.node.body.length - 1, - 'expression' - ); - } - - it('passes the correct argument to getPropType', function() { - var definition = parse( - '({propTypes: {foo: PropTypes.bool, abc: PropTypes.xyz}})' - ); - var propertyPath = definition.get('properties', 0, 'value'); - var fooPath = propertyPath.get('properties', 0, 'value'); - var xyzPath = propertyPath.get('properties', 1, 'value'); - - propTypeHandler(documentation, definition); - - expect(getPropTypeMock).toBeCalledWith(fooPath); - expect(getPropTypeMock).toBeCalledWith(xyzPath); - }); - - it('finds definitions via React.PropTypes', function() { - var definition = parse([ - '({', - ' propTypes: {', - ' foo: PropTypes.bool,', - ' bar: require("react").PropTypes.bool,', - ' }', - '})', - ].join('\n')); - - - propTypeHandler(documentation, definition); - expect(documentation.descriptors).toEqual({ - foo: { - type: {}, - required: false - }, - bar: { - type: {}, - required: false - } - }); - }); - - it('finds definitions via the ReactPropTypes module', function() { - var definition = parse([ - '({', - ' propTypes: {', - ' foo: require("ReactPropTypes").bool,', - ' }', - '})', - ].join('\n')); - - - propTypeHandler(documentation, definition); - expect(documentation.descriptors).toEqual({ - foo: { - type: {}, - required: false - }, - }); - }); - - it('detects whether a prop is required', function() { - var definition = parse([ - '({', - ' propTypes: {', - ' simple_prop: PropTypes.array.isRequired,', - ' complex_prop: ', - ' PropTypes.oneOfType([PropTypes.number, PropTypes.bool]).isRequired,', - ' }', - '})' - ].join('\n')); - - propTypeHandler(documentation, definition); - expect(documentation.descriptors).toEqual({ - simple_prop: { - type: {}, - required: true - }, - complex_prop: { - type: {}, - required: true - } - }); - }); - - it('only considers definitions from React or ReactPropTypes', function() { - var definition = parse([ - '({', - ' propTypes: {', - ' custom_propA: PropTypes.bool,', - ' custom_propB: Prop.bool.isRequired', - ' }', - '})', - ].join('\n')); - - propTypeHandler(documentation, definition); - expect(documentation.descriptors).toEqual({ - custom_propA: { - type: {}, - required: false - }, - custom_propB: { - type: { - name: 'custom', - raw: 'Prop.bool.isRequired' - }, - required: false - } - }); - }); - - it('understands the spread operator', function() { - var definition = parse([ - 'var Foo = require("Foo.react");', - 'var props = {bar: PropTypes.bool};', - '({', - ' propTypes: {', - ' ...Foo.propTypes,', - ' ...props,', - ' foo: PropTypes.number', - ' }', - '})', - ].join('\n')); - - propTypeHandler(documentation, definition); - expect(documentation.composes).toEqual(['Foo.react']); - expect(documentation.descriptors).toEqual({ - foo: { - type: {}, - required: false - }, - bar: { - type: {}, - required: false - }, - }); - }); - - it('resolves variables', function() { - var definition = parse([ - 'var props = {bar: PropTypes.bool};', - '({', - ' propTypes: props', - '})', - ].join('\n')); - - propTypeHandler(documentation, definition); - expect(documentation.descriptors).toEqual({ - bar: { - type: {}, - required: false - }, - }); - }); - - it('does not error if propTypes cannot be found', function() { - var definition = parse([ - '({', - ' fooBar: 42', - '})', - ].join('\n')); - - expect(function() { - propTypeHandler(documentation, definition); - }).not.toThrow(); - }); -}); diff --git a/website/react-docgen/lib/handlers/componentDocblockHandler.js b/website/react-docgen/lib/handlers/componentDocblockHandler.js deleted file mode 100644 index 17009fab0..000000000 --- a/website/react-docgen/lib/handlers/componentDocblockHandler.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var Documentation = require('../Documentation'); - -var n = require('recast').types.namedTypes; -var getDocblock = require('../utils/docblock').getDocblock; - -/** - * Finds the nearest block comment before the component definition. - */ -function componentDocblockHandler( - documentation: Documentation, - path: NodePath -) { - var description = null; - // Find parent statement (e.g. var Component = React.createClass();) - while (path && !n.Statement.check(path.node)) { - path = path.parent; - } - if (path) { - description = getDocblock(path); - } - if (description == null) { - // If this is the first statement in the module body, the comment is attached - // to the program node - var programPath = path; - while (programPath && !n.Program.check(programPath.node)) { - programPath = programPath.parent; - } - if (programPath.get('body', 0) === path) { - description = getDocblock(programPath); - } - } - documentation.setDescription(description || ''); -} - -module.exports = componentDocblockHandler; diff --git a/website/react-docgen/lib/handlers/defaultPropsHandler.js b/website/react-docgen/lib/handlers/defaultPropsHandler.js deleted file mode 100644 index e6f607580..000000000 --- a/website/react-docgen/lib/handlers/defaultPropsHandler.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var Documentation = require('../Documentation'); - -var getPropertyName = require('../utils/getPropertyName'); -var getPropertyValuePath = require('../utils/getPropertyValuePath'); -var recast = require('recast'); -var resolveToValue = require('../utils/resolveToValue'); -var types = recast.types.namedTypes; -var visit = recast.types.visit; - -function getDefaultValue(path) { - var node = path.node; - var defaultValue; - if (types.Literal.check(node)) { - defaultValue = node.raw; - } else { - path = resolveToValue(path); - node = path.node; - defaultValue = recast.print(path).code; - } - if (typeof defaultValue !== 'undefined') { - return { - value: defaultValue, - computed: types.CallExpression.check(node) || - types.MemberExpression.check(node) || - types.Identifier.check(node) - }; - } -} - -function defaultPropsHandler(documentation: Documentation, path: NodePath) { - var getDefaultPropsPath = getPropertyValuePath(path, 'getDefaultProps'); - if (!getDefaultPropsPath || - !types.FunctionExpression.check(getDefaultPropsPath.node)) { - return; - } - - // Find the value that is returned from the function and process it if it is - // an object literal. - var objectExpressionPath; - visit(getDefaultPropsPath.get('body'), { - visitFunction: () => false, - visitReturnStatement: function(path) { - var resolvedPath = resolveToValue(path.get('argument')); - if (types.ObjectExpression.check(resolvedPath.node)) { - objectExpressionPath = resolvedPath; - } - return false; - } - }); - - if (objectExpressionPath) { - objectExpressionPath.get('properties').each(function(propertyPath) { - var propDescriptor = documentation.getPropDescriptor( - getPropertyName(propertyPath) - ); - var defaultValue = getDefaultValue(propertyPath.get('value')); - if (defaultValue) { - propDescriptor.defaultValue = defaultValue; - } - }); - } -} - -module.exports = defaultPropsHandler; diff --git a/website/react-docgen/lib/handlers/index.js b/website/react-docgen/lib/handlers/index.js deleted file mode 100644 index ab27a9328..000000000 --- a/website/react-docgen/lib/handlers/index.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -exports.componentDocblockHandler = require('./componentDocblockHandler'); -exports.defaultPropsHandler = require('./defaultPropsHandler'); -exports.propTypeHandler = require('./propTypeHandler'); -exports.propDocBlockHandler = require('./propDocBlockHandler'); diff --git a/website/react-docgen/lib/handlers/propDocBlockHandler.js b/website/react-docgen/lib/handlers/propDocBlockHandler.js deleted file mode 100644 index 0a2d04c8f..000000000 --- a/website/react-docgen/lib/handlers/propDocBlockHandler.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var Documentation = require('../Documentation'); - -var getDocblock = require('../utils/docblock').getDocblock; -var getPropertyName = require('../utils/getPropertyName'); -var getPropertyValuePath = require('../utils/getPropertyValuePath'); -var types = require('recast').types.namedTypes; -var resolveToValue = require('../utils/resolveToValue'); - -function propDocBlockHandler(documentation: Documentation, path: NodePath) { - var propTypesPath = getPropertyValuePath(path, 'propTypes'); - if (!propTypesPath) { - return; - } - propTypesPath = resolveToValue(propTypesPath); - if (!propTypesPath || !types.ObjectExpression.check(propTypesPath.node)) { - return; - } - - propTypesPath.get('properties').each(function(propertyPath) { - // we only support documentation of actual properties, not spread - if (types.Property.check(propertyPath.node)) { - var propDescriptor = documentation.getPropDescriptor( - getPropertyName(propertyPath) - ); - propDescriptor.description = getDocblock(propertyPath) || ''; - } - }); -} - -module.exports = propDocBlockHandler; diff --git a/website/react-docgen/lib/handlers/propTypeHandler.js b/website/react-docgen/lib/handlers/propTypeHandler.js deleted file mode 100644 index e1fe72838..000000000 --- a/website/react-docgen/lib/handlers/propTypeHandler.js +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var Documentation = require('../Documentation'); - -var getMembers = require('../utils/getMembers'); -var getNameOrValue = require('../utils/getNameOrValue'); -var getPropType = require('../utils/getPropType'); -var getPropertyName = require('../utils/getPropertyName'); -var getPropertyValuePath = require('../utils/getPropertyValuePath'); -var isReactModuleName = require('../utils/isReactModuleName'); -var recast = require('recast'); -var resolveToModule = require('../utils/resolveToModule'); -var resolveToValue = require('../utils/resolveToValue'); -var types = recast.types.namedTypes; - -function isPropTypesExpression(path) { - var moduleName = resolveToModule(path); - if (moduleName) { - return isReactModuleName(moduleName) || moduleName === 'ReactPropTypes'; - } - return false; -} - -/** - * Returns true of the prop is required, according to its type defintion - */ -function isRequired(path) { - return getMembers(path).some( - member => !member.computed && member.path.node.name === 'isRequired' || - member.computed && member.path.node.value === 'isRequired' - ); -} - -/** - * Handles member expressions of the form - * - * ComponentA.propTypes - * - * it resolves ComponentA to its module name and adds it to the "composes" entry - * in the documentation. - */ -function amendComposes(documentation, path) { - var node = path.node; - if (!types.MemberExpression.check(node) || - getNameOrValue(path.get('property')) !== 'propTypes' || - !types.Identifier.check(node.object)) { - return; - } - - var moduleName = resolveToModule(path.get('object')); - if (moduleName) { - documentation.addComposes(moduleName); - } -} - -function amendPropTypes(documentation, path) { - path.get('properties').each(function(propertyPath) { - switch (propertyPath.node.type) { - case types.Property.name: - var propDescriptor = documentation.getPropDescriptor( - getPropertyName(propertyPath) - ); - var valuePath = propertyPath.get('value'); - var type = isPropTypesExpression(valuePath) ? - getPropType(valuePath) : - {name: 'custom', raw: recast.print(valuePath).code}; - - if (type) { - propDescriptor.type = type; - propDescriptor.required = - type.name !== 'custom' && isRequired(valuePath); - } - break; - case types.SpreadProperty.name: - var resolvedValuePath = resolveToValue(propertyPath.get('argument')); - switch (resolvedValuePath.node.type) { - case types.ObjectExpression.name: // normal object literal - amendPropTypes(documentation, resolvedValuePath); - break; - case types.MemberExpression.name: - amendComposes(documentation, resolvedValuePath); - break; - } - break; - } - }); -} - -function propTypeHandler(documentation: Documentation, path: NodePath) { - var propTypesPath = getPropertyValuePath(path, 'propTypes'); - if (!propTypesPath) { - return; - } - propTypesPath = resolveToValue(propTypesPath); - if (!propTypesPath || !types.ObjectExpression.check(propTypesPath.node)) { - return; - } - - switch (propTypesPath.node.type) { - case types.ObjectExpression.name: - amendPropTypes(documentation, propTypesPath); - break; - case types.MemberExpression.name: - amendComposes(documentation, propTypesPath); - } -} - -module.exports = propTypeHandler; diff --git a/website/react-docgen/lib/main.js b/website/react-docgen/lib/main.js deleted file mode 100644 index 99fea25e7..000000000 --- a/website/react-docgen/lib/main.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var handlers = require('./handlers'); -var parse = require('./parse'); -var resolver = require('./resolver'); -var utils = require('./utils'); - -var defaultResolver = resolver.findExportedReactCreateClassCall; -var defaultHandlers = [ - handlers.propTypeHandler, - handlers.propDocBlockHandler, - handlers.defaultPropsHandler, - handlers.componentDocblockHandler, -]; - -/** - * See `lib/parse.js` for more information about the arguments. This function - * simply sets default values for convenience. - * - * The default resolver looks for *exported* `React.createClass(def)` calls - * and expected `def` to resolve to an object expression. - * - * The default `handlers` look for `propTypes` and `getDefaultProps` in the - * provided object expression, and extract prop type information, prop - * documentation (from docblocks), default prop values and component - * documentation (from a docblock). - */ -function defaultParse( - src: string, - resolver?: ?Resolver, - handlers?: ?Array -): (Array|Object) { - if (!resolver) { - resolver = defaultResolver; - } - if (!handlers) { - handlers = defaultHandlers; - } - - return parse(src, resolver, handlers); -} - -module.exports = { - parse: defaultParse, - handlers, - resolver, - utils -}; diff --git a/website/react-docgen/lib/parse.js b/website/react-docgen/lib/parse.js deleted file mode 100644 index 58b4f36d5..000000000 --- a/website/react-docgen/lib/parse.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var Documentation = require('./Documentation'); - -var recast = require('recast'); - -var ERROR_MISSING_DEFINITION = 'No suitable component definition found.'; - -function executeHandlers(handlers, componentDefinitions) { - return componentDefinitions.map(componentDefinition => { - var documentation = new Documentation(); - handlers.forEach(handler => handler(documentation, componentDefinition)); - return documentation.toObject(); - }); -} - -/** - * Takes JavaScript source code and returns an object with the information - * extract from it. - * - * `resolver` is a strategy to find the AST node(s) of the component - * definition(s) inside `src`. - * It is a function that gets passed the program AST node of - * the source as first argument, and a reference to recast as second argument. - * - * This allows you define your own strategy for finding component definitions. - * - * `handlers` is an array of functions which are passed a reference to the - * component definitions (extracted by `resolver`) so that they can extract - * information from it. They get also passed a reference to a `Documentation` - * object to attach the information to. - * - * If `resolver` returns an array of component definitions, `parse` will return - * an array of documentation objects. If `resolver` returns a single node - * instead, `parse` will return a documentation object. - */ -function parse( - src: string, - resolver: Resolver, - handlers: Array -): (Array|Object) { - var ast = recast.parse(src); - var componentDefinitions = resolver(ast.program, recast); - var isArray = Array.isArray(componentDefinitions); - - if (!componentDefinitions || (isArray && componentDefinitions.length === 0)) { - throw new Error(ERROR_MISSING_DEFINITION); - } - - return isArray ? - executeHandlers(handlers, componentDefinitions) : - executeHandlers(handlers, [componentDefinitions])[0]; -} - -module.exports = parse; -exports.ERROR_MISSING_DEFINITION = ERROR_MISSING_DEFINITION; diff --git a/website/react-docgen/lib/resolver/__tests__/findAllReactCreateClassCalls-test.js b/website/react-docgen/lib/resolver/__tests__/findAllReactCreateClassCalls-test.js deleted file mode 100644 index a78e6a77d..000000000 --- a/website/react-docgen/lib/resolver/__tests__/findAllReactCreateClassCalls-test.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); - -describe('React documentation parser', function() { - var findAllReactCreateClassCalls; - var recast; - - function parse(source) { - return findAllReactCreateClassCalls( - recast.parse(source).program, - recast - ); - } - - beforeEach(function() { - findAllReactCreateClassCalls = require('../findAllReactCreateClassCalls'); - recast = require('recast'); - }); - - - it('finds React.createClass', function() { - var source = [ - 'var React = require("React");', - 'var Component = React.createClass({});', - 'module.exports = Component;' - ].join('\n'); - - var result = parse(source); - expect(Array.isArray(result)).toBe(true); - expect(result.length).toBe(1); - expect(result[0] instanceof recast.types.NodePath).toBe(true); - expect(result[0].node.type).toBe('ObjectExpression'); - }); - - it('finds React.createClass, independent of the var name', function() { - var source = [ - 'var R = require("React");', - 'var Component = R.createClass({});', - 'module.exports = Component;' - ].join('\n'); - - var result = parse(source); - expect(Array.isArray(result)).toBe(true); - expect(result.length).toBe(1); - }); - - it('does not process X.createClass of other modules', function() { - var source = [ - 'var R = require("NoReact");', - 'var Component = R.createClass({});', - 'module.exports = Component;' - ].join('\n'); - - var result = parse(source); - expect(Array.isArray(result)).toBe(true); - expect(result.length).toBe(0); - }); - - it('finds assignments to exports', function() { - var source = [ - 'var R = require("React");', - 'var Component = R.createClass({});', - 'exports.foo = 42;', - 'exports.Component = Component;' - ].join('\n'); - - var result = parse(source); - expect(Array.isArray(result)).toBe(true); - expect(result.length).toBe(1); - }); - - it('accepts multiple definitions', function() { - var source = [ - 'var R = require("React");', - 'var ComponentA = R.createClass({});', - 'var ComponentB = R.createClass({});', - 'exports.ComponentB = ComponentB;' - ].join('\n'); - - var result = parse(source); - expect(Array.isArray(result)).toBe(true); - expect(result.length).toBe(2); - - source = [ - 'var R = require("React");', - 'var ComponentA = R.createClass({});', - 'var ComponentB = R.createClass({});', - 'module.exports = ComponentB;' - ].join('\n'); - - result = parse(source); - expect(Array.isArray(result)).toBe(true); - expect(result.length).toBe(2); - }); -}); diff --git a/website/react-docgen/lib/resolver/__tests__/findExportedReactCreateClassCall-test.js b/website/react-docgen/lib/resolver/__tests__/findExportedReactCreateClassCall-test.js deleted file mode 100644 index b0e4cba92..000000000 --- a/website/react-docgen/lib/resolver/__tests__/findExportedReactCreateClassCall-test.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); - -describe('React documentation parser', function() { - var findExportedReactCreateClass; - var recast; - - function parse(source) { - return findExportedReactCreateClass( - recast.parse(source).program, - recast - ); - } - - beforeEach(function() { - findExportedReactCreateClass = - require('../findExportedReactCreateClassCall'); - recast = require('recast'); - }); - - it('finds React.createClass', function() { - var source = [ - 'var React = require("React");', - 'var Component = React.createClass({});', - 'module.exports = Component;' - ].join('\n'); - - expect(parse(source)).toBeDefined(); - }); - - it('finds React.createClass, independent of the var name', function() { - var source = [ - 'var R = require("React");', - 'var Component = R.createClass({});', - 'module.exports = Component;' - ].join('\n'); - - expect(parse(source)).toBeDefined(); - }); - - it('does not process X.createClass of other modules', function() { - var source = [ - 'var R = require("NoReact");', - 'var Component = R.createClass({});', - 'module.exports = Component;' - ].join('\n'); - - expect(parse(source)).toBeUndefined(); - }); - - it('finds assignments to exports', function() { - var source = [ - 'var R = require("React");', - 'var Component = R.createClass({});', - 'exports.foo = 42;', - 'exports.Component = Component;' - ].join('\n'); - - expect(parse(source)).toBeDefined(); - }); - - it('errors if multiple components are exported', function() { - var source = [ - 'var R = require("React");', - 'var ComponentA = R.createClass({});', - 'var ComponentB = R.createClass({});', - 'exports.ComponentA = ComponentA;', - 'exports.ComponentB = ComponentB;' - ].join('\n'); - - expect(function() { - parse(source) - }).toThrow(); - }); - - it('accepts multiple definitions if only one is exported', function() { - var source = [ - 'var R = require("React");', - 'var ComponentA = R.createClass({});', - 'var ComponentB = R.createClass({});', - 'exports.ComponentB = ComponentB;' - ].join('\n'); - - expect(parse(source)).toBeDefined(); - - source = [ - 'var R = require("React");', - 'var ComponentA = R.createClass({});', - 'var ComponentB = R.createClass({});', - 'module.exports = ComponentB;' - ].join('\n'); - - expect(parse(source)).toBeDefined(); - }); -}); diff --git a/website/react-docgen/lib/resolver/findAllReactCreateClassCalls.js b/website/react-docgen/lib/resolver/findAllReactCreateClassCalls.js deleted file mode 100644 index 7971a1d26..000000000 --- a/website/react-docgen/lib/resolver/findAllReactCreateClassCalls.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var isReactCreateClassCall = require('../utils/isReactCreateClassCall'); -var resolveToValue = require('../utils/resolveToValue'); - -/** - * Given an AST, this function tries to find all object expressions that are - * passed to `React.createClass` calls, by resolving all references properly. - */ -function findAllReactCreateClassCalls( - ast: ASTNode, - recast: Object -): Array { - var types = recast.types.namedTypes; - var definitions = []; - - recast.visit(ast, { - visitCallExpression: function(path) { - if (!isReactCreateClassCall(path)) { - return false; - } - // We found React.createClass. Lets get cracking! - var resolvedPath = resolveToValue(path.get('arguments', 0)); - if (types.ObjectExpression.check(resolvedPath.node)) { - definitions.push(resolvedPath); - } - return false; - } - }); - - return definitions; -} - -module.exports = findAllReactCreateClassCalls; diff --git a/website/react-docgen/lib/resolver/findExportedReactCreateClassCall.js b/website/react-docgen/lib/resolver/findExportedReactCreateClassCall.js deleted file mode 100644 index ccb8a3907..000000000 --- a/website/react-docgen/lib/resolver/findExportedReactCreateClassCall.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var isExportsOrModuleAssignment = - require('../utils/isExportsOrModuleAssignment'); -var isReactCreateClassCall = require('../utils/isReactCreateClassCall'); -var resolveToValue = require('../utils/resolveToValue'); - -var ERROR_MULTIPLE_DEFINITIONS = - 'Multiple exported component definitions found.'; - -function ignore() { - return false; -} - -/** - * Given an AST, this function tries to find the object expression that is - * passed to `React.createClass`, by resolving all references properly. - */ -function findExportedReactCreateClass( - ast: ASTNode, - recast: Object -): ?NodePath { - var types = recast.types.namedTypes; - var definition; - - recast.visit(ast, { - visitFunctionDeclaration: ignore, - visitFunctionExpression: ignore, - visitIfStatement: ignore, - visitWithStatement: ignore, - visitSwitchStatement: ignore, - visitCatchCause: ignore, - visitWhileStatement: ignore, - visitDoWhileStatement: ignore, - visitForStatement: ignore, - visitForInStatement: ignore, - visitAssignmentExpression: function(path) { - // Ignore anything that is not `exports.X = ...;` or - // `module.exports = ...;` - if (!isExportsOrModuleAssignment(path)) { - return false; - } - // Resolve the value of the right hand side. It should resolve to a call - // expression, something like React.createClass - path = resolveToValue(path.get('right')); - if (!isReactCreateClassCall(path)) { - return false; - } - if (definition) { - // If a file exports multiple components, ... complain! - throw new Error(ERROR_MULTIPLE_DEFINITIONS); - } - // We found React.createClass. Lets get cracking! - var resolvedPath = resolveToValue(path.get('arguments', 0)); - if (types.ObjectExpression.check(resolvedPath.node)) { - definition = resolvedPath; - } - return false; - } - }); - - return definition; -} - -module.exports = findExportedReactCreateClass; diff --git a/website/react-docgen/lib/resolver/index.js b/website/react-docgen/lib/resolver/index.js deleted file mode 100644 index dd3b92cc7..000000000 --- a/website/react-docgen/lib/resolver/index.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -exports.findAllReactCreateClassCalls = - require('./findAllReactCreateClassCalls'); -exports.findExportedReactCreateClassCall = - require('./findExportedReactCreateClassCall'); diff --git a/website/react-docgen/lib/utils/__tests__/docblock-test.js b/website/react-docgen/lib/utils/__tests__/docblock-test.js deleted file mode 100644 index 23e3d1eb1..000000000 --- a/website/react-docgen/lib/utils/__tests__/docblock-test.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); - -describe('docblock', function() { - - describe('getDoclets', function() { - var getDoclets; - - beforeEach(function() { - getDoclets = require('../docblock').getDoclets; - }); - - it('extacts single line doclets', function() { - expect(getDoclets('@foo bar\n@bar baz')) - .toEqual({foo: 'bar', bar: 'baz'}); - }); - - it('extacts multi line doclets', function() { - expect(getDoclets('@foo bar\nbaz\n@bar baz')) - .toEqual({foo: 'bar\nbaz', bar: 'baz'}); - }); - - it('extacts boolean doclets', function() { - expect(getDoclets('@foo bar\nbaz\n@abc\n@bar baz')) - .toEqual({foo: 'bar\nbaz', abc: true, bar: 'baz'}); - }); - }); - -}); diff --git a/website/react-docgen/lib/utils/__tests__/getMembers-test.js b/website/react-docgen/lib/utils/__tests__/getMembers-test.js deleted file mode 100644 index 486c5dac8..000000000 --- a/website/react-docgen/lib/utils/__tests__/getMembers-test.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); - -describe('getMembers', function() { - var recast; - var getMembers; - var memberExpressionPath; - - function parse(src) { - return new recast.types.NodePath( - recast.parse(src).program.body[0].expression - ); - } - - beforeEach(function() { - getMembers = require('../getMembers'); - recast = require('recast'); - memberExpressionPath = parse('foo.bar(123)(456)[baz][42]'); - }); - - - it('finds all "members" "inside" a MemberExpression', function() { - var b = recast.types.builders; - var members = getMembers(memberExpressionPath); - - //bar(123) - expect(members[0].path.node.name).toEqual('bar'); - expect(members[0].computed).toBe(false); - expect(members[0].argumentsPath.get(0).node.value).toEqual(123); - //[baz] - expect(members[1].path.node.name).toEqual('baz'); - expect(members[1].computed).toBe(true); - expect(members[1].argumentsPath).toBe(null); - //[42] - expect(members[2].path.node.value).toEqual(42); - expect(members[2].computed).toBe(true); - expect(members[2].argumentsPath).toBe(null); - }); - -}); diff --git a/website/react-docgen/lib/utils/__tests__/getPropType-test.js b/website/react-docgen/lib/utils/__tests__/getPropType-test.js deleted file mode 100644 index e94208c70..000000000 --- a/website/react-docgen/lib/utils/__tests__/getPropType-test.js +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); - -describe('getPropType', function() { - var utils; - var getPropType; - - function parse(src) { - return utils.parse(src).get('body', 0, 'expression'); - } - - beforeEach(function() { - getPropType = require('../getPropType'); - utils = require('../../../tests/utils'); - }); - - it('detects simple prop types', function() { - var simplePropTypes = [ - 'array', - 'bool', - 'func', - 'number', - 'object', - 'string', - 'any', - 'element', - 'node', - ]; - - simplePropTypes.forEach( - type => expect(getPropType(parse('React.PropTypes.' + type))) - .toEqual({name: type}) - ); - - // It doesn't actually matter what the MemberExpression is - simplePropTypes.forEach( - type => expect(getPropType(parse('Foo.' + type + '.bar'))) - .toEqual({name: type}) - ); - - // Doesn't even have to be a MemberExpression - simplePropTypes.forEach( - type => expect(getPropType(parse(type))) - .toEqual({name: type}) - ); - }); - - it('detects complex prop types', function() { - expect(getPropType(parse('oneOf(["foo", "bar"])'))).toEqual({ - name: 'enum', - value: [ - {value: '"foo"', computed: false}, - {value: '"bar"', computed: false} - ] - }); - - expect(getPropType(parse('oneOfType([number, bool])'))).toEqual({ - name: 'union', - value: [ - {name: 'number'}, - {name: 'bool'} - ] - }); - - // custom type - expect(getPropType(parse('oneOfType([foo])'))).toEqual({ - name: 'union', - value: [{name: 'custom', raw: 'foo'}] - }); - - // custom type - expect(getPropType(parse('instanceOf(Foo)'))).toEqual({ - name: 'instanceOf', - value: 'Foo' - }); - - expect(getPropType(parse('arrayOf(string)'))).toEqual({ - name: 'arrayOf', - value: {name: 'string'} - }); - - expect(getPropType(parse('shape({foo: string, bar: bool})'))).toEqual({ - name: 'shape', - value: { - foo: { - name: 'string' - }, - bar: { - name: 'bool' - } - } - }); - - // custom - expect(getPropType(parse('shape({foo: xyz})'))).toEqual({ - name: 'shape', - value: { - foo: { - name: 'custom', - raw: 'xyz' - } - } - }); - }); - - it('resolves variables to their values', function() { - var src = [ - 'var shape = {bar: PropTypes.string};', - 'PropTypes.shape(shape);', - ].join('\n'); - var propTypeExpression = utils.parse(src).get('body', 1, 'expression'); - - expect(getPropType(propTypeExpression)).toEqual({ - name: 'shape', - value: { - bar: {name: 'string'} - } - }); - }); - - it('detects custom validation functions', function() { - expect(getPropType(parse('(function() {})'))).toEqual({ - name: 'custom', - raw: '(function() {})' - }); - - expect(getPropType(parse('() => {}'))).toEqual({ - name: 'custom', - raw: '() => {}' - }); - }); - -}); diff --git a/website/react-docgen/lib/utils/__tests__/getPropertyValuePath-test.js b/website/react-docgen/lib/utils/__tests__/getPropertyValuePath-test.js deleted file mode 100644 index 5b88a86f3..000000000 --- a/website/react-docgen/lib/utils/__tests__/getPropertyValuePath-test.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); - -describe('getPropertyValuePath', function() { - var recast; - var getPropertyValuePath; - - function parse(src) { - return new recast.types.NodePath( - recast.parse(src).program.body[0] - ); - } - - beforeEach(function() { - getPropertyValuePath = require('../getPropertyValuePath'); - recast = require('recast'); - }); - - it('returns the value path if the property exists', function() { - var objectExpressionPath = parse('({foo: 21, bar: 42})').get('expression'); - expect(getPropertyValuePath(objectExpressionPath, 'bar')) - .toBe(objectExpressionPath.get('properties', 1).get('value')); - }); - - it('returns undefined if the property does not exist', function() { - var objectExpressionPath = parse('({foo: 21, bar: 42})').get('expression'); - expect(getPropertyValuePath(objectExpressionPath, 'baz')) - .toBeUndefined(); - }); - -}); diff --git a/website/react-docgen/lib/utils/__tests__/isExportsOrModuleAssignment-test.js b/website/react-docgen/lib/utils/__tests__/isExportsOrModuleAssignment-test.js deleted file mode 100644 index ecf5b5bb9..000000000 --- a/website/react-docgen/lib/utils/__tests__/isExportsOrModuleAssignment-test.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); - -describe('isExportsOrModuleAssignment', function() { - var recast; - var isExportsOrModuleAssignment; - - function parse(src) { - return new recast.types.NodePath( - recast.parse(src).program.body[0] - ); - } - - beforeEach(function() { - isExportsOrModuleAssignment = require('../isExportsOrModuleAssignment'); - recast = require('recast'); - }); - - it('detects "module.exports = ...;"', function() { - expect(isExportsOrModuleAssignment(parse('module.exports = foo;'))) - .toBe(true); - }); - - it('detects "exports.foo = ..."', function() { - expect(isExportsOrModuleAssignment(parse('exports.foo = foo;'))) - .toBe(true); - }); - - it('does not accept "exports = foo;"', function() { - // That doesn't actually export anything - expect(isExportsOrModuleAssignment(parse('exports = foo;'))) - .toBe(false); - }); - -}); diff --git a/website/react-docgen/lib/utils/__tests__/match-test.js b/website/react-docgen/lib/utils/__tests__/match-test.js deleted file mode 100644 index ae41dac52..000000000 --- a/website/react-docgen/lib/utils/__tests__/match-test.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -jest.autoMockOff(); - -describe('match', function() { - var match; - - beforeEach(function() { - match = require('../match'); - }); - - it('matches with exact properties', function() { - expect(match({foo: {bar: 42}}, {foo: {bar: 42}})).toBe(true); - }); - - it('matches a subset of properties in the target', function() { - expect(match({foo: {bar: 42, baz: "xyz"}}, {foo: {bar: 42}})).toBe(true); - }); - - it('does not match if properties are different/missing', function() { - expect(match( - {foo: {bar: 42, baz: "xyz"}}, - {foo: {bar: 21, baz: "xyz"}} - )).toBe(false); - - expect(match( - {foo: {baz: "xyz"}}, - {foo: {bar: 21, baz: "xyz"}} - )).toBe(false); - }); -}); diff --git a/website/react-docgen/lib/utils/docblock.js b/website/react-docgen/lib/utils/docblock.js deleted file mode 100644 index 09f888a88..000000000 --- a/website/react-docgen/lib/utils/docblock.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * Helper functions to work with docblock comments. - * @flow - */ -"use strict"; - -var types = require('recast').types.namedTypes; -var docletPattern = /^@(\w+)(?:$|\s((?:[^](?!^@\w))*))/gmi; - -function parseDocblock(str) { - var lines = str.split('\n'); - for (var i = 0, l = lines.length; i < l; i++) { - lines[i] = lines[i].replace(/^\s*\*\s?/, ''); - } - return lines.join('\n').trim(); -} - -/** - * Given a path, this function returns the closest preceding docblock if it - * exists. - */ -function getDocblock(path: NodePath): ?string { - if (path.node.comments) { - var comments = path.node.comments.leading.filter(function(comment) { - return comment.type === 'Block' && comment.value.indexOf('*\n') === 0; - }); - if (comments.length > 0) { - return parseDocblock(comments[comments.length - 1].value); - } - } - return null; -} - -/** - * Given a string, this functions returns an object with doclet names as keys - * and their "content" as values. - */ -function getDoclets(str: string): Object { - var doclets = Object.create(null); - var match = docletPattern.exec(str); - - for (; match; match = docletPattern.exec(str)) { - doclets[match[1]] = match[2] || true; - } - - return doclets; -} - -exports.getDocblock = getDocblock; -exports.getDoclets = getDoclets; diff --git a/website/react-docgen/lib/utils/expressionTo.js b/website/react-docgen/lib/utils/expressionTo.js deleted file mode 100644 index aa713a81b..000000000 --- a/website/react-docgen/lib/utils/expressionTo.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var resolveToValue = require('./resolveToValue'); -var types = require('recast').types.namedTypes; - -/** - * Splits a MemberExpression or CallExpression into parts. - * E.g. foo.bar.baz becomes ['foo', 'bar', 'baz'] - */ -function toArray(path: NodePath): Array { - var parts = [path]; - var result = []; - - while (parts.length > 0) { - path = parts.shift(); - var node = path.node; - if (types.CallExpression.check(node)) { - parts.push(path.get('callee')); - continue; - } else if (types.MemberExpression.check(node)) { - parts.push(path.get('object')); - if (node.computed) { - var resolvedPath = resolveToValue(path.get('property')); - if (resolvedPath !== undefined) { - result = result.concat(toArray(resolvedPath)); - } else { - result.push(''); - } - } else { - result.push(node.property.name); - } - continue; - } else if (types.Identifier.check(node)) { - result.push(node.name); - continue; - } else if (types.Literal.check(node)) { - result.push(node.raw); - continue; - } else if (types.ThisExpression.check(node)) { - result.push('this'); - continue; - } else if (types.ObjectExpression.check(node)) { - var properties = path.get('properties').map(function(property) { - return toString(property.get('key')) + - ': ' + - toString(property.get('value')); - }); - result.push('{' + properties.join(', ') + '}'); - continue; - } else if(types.ArrayExpression.check(node)) { - result.push('[' + path.get('elements').map(toString).join(', ') + ']'); - continue; - } - } - - return result.reverse(); -} - -/** - * Creates a string representation of a member expression. - */ -function toString(path: NodePath): string { - return toArray(path).join('.'); -} - -exports.String = toString; -exports.Array = toArray; diff --git a/website/react-docgen/lib/utils/getMembers.js b/website/react-docgen/lib/utils/getMembers.js deleted file mode 100644 index e4ffce3f7..000000000 --- a/website/react-docgen/lib/utils/getMembers.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * Helper methods for dealing with MemberExpressions (and CallExpressions). - * @flow - */ -"use strict"; - -type MemberDescriptor = { - path: NodePath; - computed: boolean; - argumentsPath?: ?NodePath; -} - -var types = require('recast').types.namedTypes; - -/** - * Given a "nested" Member/CallExpression, e.g. - * - * foo.bar()[baz][42] - * - * this returns a list of "members". In this example it would be something like - * [ - * {path: NodePath, arguments: NodePath, computed: false}, - * {path: NodePath, arguments: null, computed: true}, - * {path: NodePath<42>, arguments: null, computed: false} - * ] - */ -function getMembers(path: NodePath): Array { - var result = []; - var argumentsPath = null; - loop: while(true) { - switch (true) { - case types.MemberExpression.check(path.node): - result.push({ - path: path.get('property'), - computed: path.node.computed, - argumentsPath: argumentsPath, - }); - argumentsPath = null; - path = path.get('object'); - break; - case types.CallExpression.check(path.node): - argumentsPath = path.get('arguments'); - path = path.get('callee'); - break; - default: - break loop; - } - } - return result.reverse(); -} - -module.exports = getMembers; diff --git a/website/react-docgen/lib/utils/getNameOrValue.js b/website/react-docgen/lib/utils/getNameOrValue.js deleted file mode 100644 index 9c63d2fe6..000000000 --- a/website/react-docgen/lib/utils/getNameOrValue.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var types = require('recast').types.namedTypes; - -/** - * If node is an Identifier, it returns its name. If it is a literal, it returns - * its value. - */ -function getNameOrValue(path: NodePath, raw?: boolean): string { - var node = path.node; - switch (node.type) { - case types.Identifier.name: - return node.name; - case types.Literal.name: - return raw ? node.raw : node.value; - default: - throw new TypeError('Argument must be an Identifier or a Literal'); - } -} - -module.exports = getNameOrValue; diff --git a/website/react-docgen/lib/utils/getPropType.js b/website/react-docgen/lib/utils/getPropType.js deleted file mode 100644 index 6a4c291a0..000000000 --- a/website/react-docgen/lib/utils/getPropType.js +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var getMembers = require('./getMembers'); -var getPropertyName = require('./getPropertyName'); -var recast = require('recast'); -var resolveToValue = require('./resolveToValue'); - -var types = recast.types.namedTypes; - -function getEnumValues(path) { - return path.get('elements').map(function(elementPath) { - return { - value: recast.print(elementPath).code, - computed: !types.Literal.check(elementPath.node) - }; - }); -} - -function getPropTypeOneOf(argumentPath) { - var type = {name: 'enum'}; - if (!types.ArrayExpression.check(argumentPath.node)) { - type.computed = true; - type.value = recast.print(argumentPath).code; - } else { - type.value = getEnumValues(argumentPath); - } - return type; -} - -function getPropTypeOneOfType(argumentPath) { - var type = {name: 'union'}; - if (!types.ArrayExpression.check(argumentPath.node)) { - type.computed = true; - type.value = recast.print(argumentPath).code; - } else { - type.value = argumentPath.get('elements').map(getPropType); - } - return type; -} - -function getPropTypeArrayOf(argumentPath) { - var type = {name: 'arrayOf'}; - var subType = getPropType(argumentPath); - - if (subType.name === 'unknown') { - type.value = recast.print(argumentPath).code; - type.computed = true; - } else { - type.value = subType; - } - return type; -} - -function getPropTypeShape(argumentPath) { - var type: {name: string; value: any;} = {name: 'shape', value: 'unkown'}; - if (!types.ObjectExpression.check(argumentPath.node)) { - argumentPath = resolveToValue(argumentPath); - } - - if (types.ObjectExpression.check(argumentPath.node)) { - type.value = {}; - argumentPath.get('properties').each(function(propertyPath) { - type.value[getPropertyName(propertyPath)] = - getPropType(propertyPath.get('value')); - }); - } - - return type; -} - -function getPropTypeInstanceOf(argumentPath) { - return { - name: 'instanceOf', - value: recast.print(argumentPath).code - }; -} - -var simplePropTypes = { - array: 1, - bool: 1, - func: 1, - number: 1, - object: 1, - string: 1, - any: 1, - element: 1, - node: 1 -}; - -var propTypes = { - oneOf: getPropTypeOneOf, - oneOfType: getPropTypeOneOfType, - instanceOf: getPropTypeInstanceOf, - arrayOf: getPropTypeArrayOf, - shape: getPropTypeShape -}; - -/** - * Tries to identify the prop type by inspecting the path for known - * prop type names. This method doesn't check whether the found type is actually - * from React.PropTypes. It simply assumes that a match has the same meaning - * as the React.PropTypes one. - * - * If there is no match, "custom" is returned. - */ -function getPropType(path: NodePath): PropTypeDescriptor { - var node = path.node; - var descriptor; - getMembers(path).some(member => { - var node = member.path.node; - var name; - if (types.Literal.check(node)) { - name = node.value; - } else if (types.Identifier.check(node) && !member.computed) { - name = node.name; - } - if (simplePropTypes.hasOwnProperty(name)) { - descriptor = {name}; - return true; - } else if (propTypes.hasOwnProperty(name) && member.argumentsPath) { - descriptor = propTypes[name](member.argumentsPath.get(0)); - return true; - } - }); - if (!descriptor) { - if (types.Identifier.check(node) && - simplePropTypes.hasOwnProperty(node.name)) { - descriptor = {name: node.name}; - } else if (types.CallExpression.check(node) && - types.Identifier.check(node.callee) && - propTypes.hasOwnProperty(node.callee.name)) { - descriptor = propTypes[node.callee.name](path.get('arguments', 0)); - } else { - descriptor = {name: 'custom', raw: recast.print(path).code}; - } - } - return descriptor; -} - -module.exports = getPropType; diff --git a/website/react-docgen/lib/utils/getPropertyName.js b/website/react-docgen/lib/utils/getPropertyName.js deleted file mode 100644 index ae70396f4..000000000 --- a/website/react-docgen/lib/utils/getPropertyName.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var getNameOrValue = require('./getNameOrValue'); -var types = require('recast').types.namedTypes; - -/** - * In an ObjectExpression, the name of a property can either be an identifier - * or a literal (or dynamic, but we don't support those). This function simply - * returns the value of the literal or name of the identifier. - */ -function getPropertyName(propertyPath: NodePath): string { - if (propertyPath.node.computed) { - throw new TypeError('Propery name must be an Identifier or a Literal'); - } - - return getNameOrValue(propertyPath.get('key'), false); -} - -module.exports = getPropertyName; diff --git a/website/react-docgen/lib/utils/getPropertyValuePath.js b/website/react-docgen/lib/utils/getPropertyValuePath.js deleted file mode 100644 index 40451366e..000000000 --- a/website/react-docgen/lib/utils/getPropertyValuePath.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var types = require('recast').types.namedTypes; -var getPropertyName = require('./getPropertyName'); - -/** - * Given an ObjectExpression, this function returns the path of the value of - * the property with name `propertyName`. - */ -function getPropertyValuePath(path: NodePath, propertyName: string): ?NodePath { - types.ObjectExpression.assert(path.node); - - return path.get('properties') - .filter(propertyPath => getPropertyName(propertyPath) === propertyName) - .map(propertyPath => propertyPath.get('value'))[0]; -} - -module.exports = getPropertyValuePath; diff --git a/website/react-docgen/lib/utils/index.js b/website/react-docgen/lib/utils/index.js deleted file mode 100644 index 7db01a585..000000000 --- a/website/react-docgen/lib/utils/index.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -"use strict"; - -exports.docblock = require('./docblock'); -exports.getMembers = require('./getMembers'); -exports.getPropType = require('./getPropType'); -exports.getPropertyName = require('./getPropertyName'); -exports.getPropertyValuePath = require('./getPropertyValuePath'); -exports.isExportsOrModuleAssignment = require('./isExportsOrModuleAssignment'); -exports.isReactCreateClassCall = require('./isReactCreateClassCall'); -exports.isReactModuleName = require('./isReactModuleName'); -exports.match = require('./match'); -exports.resolveToModule = require('./resolveToModule'); -exports.resolveToValue = require('./resolveToValue'); diff --git a/website/react-docgen/lib/utils/isExportsOrModuleAssignment.js b/website/react-docgen/lib/utils/isExportsOrModuleAssignment.js deleted file mode 100644 index f6d7f1a9c..000000000 --- a/website/react-docgen/lib/utils/isExportsOrModuleAssignment.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var expressionTo = require('./expressionTo'); -var types = require('recast').types.namedTypes; - -/** - * Returns true if the expression is of form `exports.foo = ...;` or - * `modules.exports = ...;`. - */ -function isExportsOrModuleAssignment(path: NodePath): boolean { - if (types.ExpressionStatement.check(path.node)) { - path = path.get('expression'); - } - if (!types.AssignmentExpression.check(path.node) || - !types.MemberExpression.check(path.node.left)) { - return false; - } - - var exprArr = expressionTo.Array(path.get('left')); - return (exprArr[0] === 'module' && exprArr[1] === 'exports') || - exprArr[0] == 'exports'; -} - -module.exports = isExportsOrModuleAssignment; diff --git a/website/react-docgen/lib/utils/isReactCreateClassCall.js b/website/react-docgen/lib/utils/isReactCreateClassCall.js deleted file mode 100644 index 5231f3da8..000000000 --- a/website/react-docgen/lib/utils/isReactCreateClassCall.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var isReactModuleName = require('./isReactModuleName'); -var match = require('./match'); -var resolveToModule = require('./resolveToModule'); -var types = require('recast').types.namedTypes; - -/** - * Returns true if the expression is a function call of the form - * `React.createClass(...)`. - */ -function isReactCreateClassCall(path: NodePath): boolean { - if (types.ExpressionStatement.check(path.node)) { - path = path.get('expression'); - } - - if (!match(path.node, {callee: {property: {name: 'createClass'}}})) { - return false; - } - var module = resolveToModule(path.get('callee', 'object')); - return module && isReactModuleName(module); -} - -module.exports = isReactCreateClassCall; diff --git a/website/react-docgen/lib/utils/isReactModuleName.js b/website/react-docgen/lib/utils/isReactModuleName.js deleted file mode 100644 index 1b9f8878b..000000000 --- a/website/react-docgen/lib/utils/isReactModuleName.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var reactModules = ['react', 'react/addons']; - -/** - * Takes a module name (string) and returns true if it refers to a root react - * module name. - */ -function isReactModuleName(moduleName: string): boolean { - return reactModules.some(function(reactModuleName) { - return reactModuleName === moduleName.toLowerCase(); - }); -} - -module.exports = isReactModuleName; diff --git a/website/react-docgen/lib/utils/match.js b/website/react-docgen/lib/utils/match.js deleted file mode 100644 index 6caeac9ca..000000000 --- a/website/react-docgen/lib/utils/match.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -/** - * This function takes an AST node and matches it against "pattern". Pattern - * is simply a (nested) object literal and it is traversed to see whether node - * contains those (nested) properties with the provided values. - */ -function match(node: ASTNOde, pattern: Object): boolean { - if (!node) { - return false; - } - for (var prop in pattern) { - if (!node[prop]) { - return false; - } - if (pattern[prop] && typeof pattern[prop] === 'object') { - if (!match(node[prop], pattern[prop])) { - return false; - } - } else if (node[prop] !== pattern[prop]) { - return false; - } - } - return true; -} - -module.exports = match; diff --git a/website/react-docgen/lib/utils/resolveToModule.js b/website/react-docgen/lib/utils/resolveToModule.js deleted file mode 100644 index d60769b33..000000000 --- a/website/react-docgen/lib/utils/resolveToModule.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var match = require('./match'); -var resolveToValue = require('./resolveToValue'); -var types = require('recast').types.namedTypes; - -/** - * Given a path (e.g. call expression, member expression or identifier), - * this function tries to find the name of module from which the "root value" - * was imported. - */ -function resolveToModule(path: NodePath): ?string { - var node = path.node; - switch (node.type) { - case types.VariableDeclarator.name: - if (node.init) { - return resolveToModule(path.get('init')); - } - break; - case types.CallExpression.name: - if (match(node.callee, {type: types.Identifier.name, name: 'require'})) { - return node['arguments'][0].value; - } - return resolveToModule(path.get('callee')); - case types.Identifier.name: - var valuePath = resolveToValue(path); - if (valuePath !== path) { - return resolveToModule(valuePath); - } - break; - case types.MemberExpression.name: - while (path && types.MemberExpression.check(path.node)) { - path = path.get('object'); - } - if (path) { - return resolveToModule(path); - } - } -} - -module.exports = resolveToModule; diff --git a/website/react-docgen/lib/utils/resolveToValue.js b/website/react-docgen/lib/utils/resolveToValue.js deleted file mode 100644 index 4e352d75f..000000000 --- a/website/react-docgen/lib/utils/resolveToValue.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * @flow - */ -"use strict"; - -var types = require('recast').types.namedTypes; - -/** - * If the path is an identifier, it is resolved in the scope chain. - * If it is an assignment expression, it resolves to the right hand side. - * - * Else the path itself is returned. - */ -function resolveToValue(path: NodePath): NodePath { - var node = path.node; - if (types.AssignmentExpression.check(node)) { - if (node.operator === '=') { - return resolveToValue(node.get('right')); - } - } else if (types.Identifier.check(node)) { - var scope = path.scope.lookup(node.name); - if (scope) { - var bindings = scope.getBindings()[node.name]; - if (bindings.length > 0) { - var parentPath = scope.getBindings()[node.name][0].parent; - if (types.VariableDeclarator.check(parentPath.node)) { - parentPath = parentPath.get('init'); - } - return resolveToValue(parentPath); - } - } - } - return path; -} - -module.exports = resolveToValue; diff --git a/website/react-docgen/package.json b/website/react-docgen/package.json deleted file mode 100644 index b84e7cfb6..000000000 --- a/website/react-docgen/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "react-docgen", - "version": "1.0.0", - "description": "A CLI and toolkit to extract information from React components for documentation generation.", - "repository": { - "type": "git", - "url": "https://github.com/reactjs/react-docgen.git" - }, - "bugs": "https://github.com/reactjs/react-docgen/issues", - "bin": { - "react-docgen": "bin/react-docgen.js" - }, - "main": "dist/main.js", - "scripts": { - "watch": "jsx lib/ dist/ --harmony --strip-types -w", - "build": "rm -rf dist/ && jsx lib/ dist/ --harmony --strip-types --no-cache-dir", - "prepublish": "npm run build", - "test": "jest" - }, - "keywords": [ - "react", - "documentation-generation" - ], - "author": "Felix Kling", - "license": "BSD-3-Clause", - "dependencies": { - "async": "^0.9.0", - "node-dir": "^0.1.6", - "nomnom": "^1.8.1", - "recast": "^0.9.17" - }, - "devDependencies": { - "jest-cli": "^0.3.0", - "react-tools": "^0.12.2" - }, - "jest": { - "scriptPreprocessor": "./tests/preprocessor", - "testPathDirs": ["lib"], - "unmockedModulePathPatterns": ["tests/utils"] - } -} diff --git a/website/react-docgen/preprocessor.js b/website/react-docgen/preprocessor.js deleted file mode 100644 index f827426d4..000000000 --- a/website/react-docgen/preprocessor.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; - -var reactTools = require('react-tools'); - -function process(source) { - return reactTools.transform(source, {harmony: true, stripTypes: true}); -} - -exports.process = process; diff --git a/website/react-docgen/tests/preprocessor.js b/website/react-docgen/tests/preprocessor.js deleted file mode 100644 index f827426d4..000000000 --- a/website/react-docgen/tests/preprocessor.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; - -var reactTools = require('react-tools'); - -function process(source) { - return reactTools.transform(source, {harmony: true, stripTypes: true}); -} - -exports.process = process; diff --git a/website/react-docgen/tests/utils.js b/website/react-docgen/tests/utils.js deleted file mode 100644 index c48770427..000000000 --- a/website/react-docgen/tests/utils.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; - -/** - * Helper methods for tests. - */ - -var recast = require.requireActual('recast'); - -function stringify(value) { - if (Array.isArray(value)) { - return value.join('\n'); - } - return value; -} - -/** - * Returns a NodePath to the program node of the passed node - */ -function parse(src) { - return new recast.types.NodePath(recast.parse(stringify(src)).program); -} - -/** - * Injects src into template by replacing the occurrence of %s. - */ -function parseWithTemplate(src, template) { - return parse(template.replace('%s', stringify(src))); -} - -/** - * Default template that simply defines React and PropTypes. - */ -var REACT_TEMPLATE = [ - 'var React = require("React");', - 'var PropTypes = React.PropTypes;', - '%s;', -].join('\n'); - -var MODULE_TEMPLATE = [ - 'var React = require("React");', - 'var PropTypes = React.PropTypes;', - 'var Component = React.createClass(%s);', - 'module.exports = Component' -].join('\n'); - -exports.parse = parse; -exports.parseWithTemplate = parseWithTemplate; -exports.REACT_TEMPLATE = REACT_TEMPLATE; -exports.MODULE_TEMPLATE = MODULE_TEMPLATE; diff --git a/website/server/extractDocs.js b/website/server/extractDocs.js index bfaff5f51..301e390e7 100644 --- a/website/server/extractDocs.js +++ b/website/server/extractDocs.js @@ -1,4 +1,4 @@ -var docs = require('../react-docgen'); +var docs = require('react-docgen'); var fs = require('fs'); var path = require('path'); var slugify = require('../core/slugify'); From 2b66b21c953c9beb21f973c3ef538d3aa073feed Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Mon, 16 Mar 2015 19:01:28 -0700 Subject: [PATCH 55/79] Updates from Mon 16 Mar - [ReactNative] Share same server port for debugger proxy | Alex Kotliarskyi - [react-packager] small fixes to image loader | Amjad Masad - [ReactNative] NetworkInformation.reachability API w/ example | Eric Vicenti - [ReactNative] Put launchOptions in RCTPushNotificationManager | Andrew Rasmussen - [ReactNative] Improve PixelRatio documentation | Christopher Chedeau --- Examples/UIExplorer/NetInfoExample.js | 135 +++++++++++++++++ Examples/UIExplorer/UIExplorerList.js | 1 + Libraries/AppState/AppState.js | 18 --- Libraries/Network/NetInfo.js | 143 ++++++++++++++++++ Libraries/ReactIOS/renderApplication.js | 6 +- Libraries/Utilities/PixelRatio.js | 48 +++--- Libraries/Utilities/PushNotificationIOS.js | 14 ++ Libraries/react-native/react-native.js | 1 + ReactKit/Base/RCTBridge.m | 2 +- ReactKit/Modules/RCTPushNotificationManager.h | 12 ++ ReactKit/Modules/RCTPushNotificationManager.m | 64 ++++++++ .../haste/DependencyGraph/index.js | 19 ++- 12 files changed, 411 insertions(+), 52 deletions(-) create mode 100644 Examples/UIExplorer/NetInfoExample.js create mode 100644 Libraries/Network/NetInfo.js create mode 100644 ReactKit/Modules/RCTPushNotificationManager.h create mode 100644 ReactKit/Modules/RCTPushNotificationManager.m diff --git a/Examples/UIExplorer/NetInfoExample.js b/Examples/UIExplorer/NetInfoExample.js new file mode 100644 index 000000000..017da9921 --- /dev/null +++ b/Examples/UIExplorer/NetInfoExample.js @@ -0,0 +1,135 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + */ +'use strict'; + +var React = require('react-native'); +var { + NetInfo, + Text, + View +} = React; + +var ReachabilitySubscription = React.createClass({ + getInitialState() { + return { + reachabilityHistory: [], + }; + }, + componentDidMount: function() { + NetInfo.reachabilityIOS.addEventListener( + 'change', + this._handleReachabilityChange + ); + }, + componentWillUnmount: function() { + NetInfo.reachabilityIOS.removeEventListener( + 'change', + this._handleReachabilityChange + ); + }, + _handleReachabilityChange: function(reachability) { + var reachabilityHistory = this.state.reachabilityHistory.slice(); + reachabilityHistory.push(reachability); + this.setState({ + reachabilityHistory, + }); + }, + render() { + return ( + + {JSON.stringify(this.state.reachabilityHistory)} + + ); + } +}); + +var ReachabilityCurrent = React.createClass({ + getInitialState() { + return { + reachability: null, + }; + }, + componentDidMount: function() { + NetInfo.reachabilityIOS.addEventListener( + 'change', + this._handleReachabilityChange + ); + NetInfo.reachabilityIOS.fetch().done( + (reachability) => { this.setState({reachability}); } + ); + }, + componentWillUnmount: function() { + NetInfo.reachabilityIOS.removeEventListener( + 'change', + this._handleReachabilityChange + ); + }, + _handleReachabilityChange: function(reachability) { + this.setState({ + reachability, + }); + }, + render() { + return ( + + {this.state.reachability} + + ); + } +}); + +var IsConnected = React.createClass({ + getInitialState() { + return { + isConnected: null, + }; + }, + componentDidMount: function() { + NetInfo.isConnected.addEventListener( + 'change', + this._handleConnectivityChange + ); + NetInfo.isConnected.fetch().done( + (isConnected) => { this.setState({isConnected}); } + ); + }, + componentWillUnmount: function() { + NetInfo.isConnected.removeEventListener( + 'change', + this._handleConnectivityChange + ); + }, + _handleConnectivityChange: function(isConnected) { + this.setState({ + isConnected, + }); + }, + render() { + return ( + + {this.state.isConnected ? 'Online' : 'Offline'} + + ); + } +}); + +exports.title = 'NetInfo'; +exports.description = 'Monitor network status'; +exports.examples = [ + { + title: 'NetInfo.isConnected', + description: 'Asyncronously load and observe connectivity', + render() { return ; } + }, + { + title: 'NetInfo.reachabilityIOS', + description: 'Asyncronously load and observe iOS reachability', + render() { return ; } + }, + { + title: 'NetInfo.reachabilityIOS', + description: 'Observed updates to iOS reachability', + render() { return ; } + }, +]; diff --git a/Examples/UIExplorer/UIExplorerList.js b/Examples/UIExplorer/UIExplorerList.js index b7108681e..a4f70fbcd 100644 --- a/Examples/UIExplorer/UIExplorerList.js +++ b/Examples/UIExplorer/UIExplorerList.js @@ -42,6 +42,7 @@ var EXAMPLES = [ require('./MapViewExample'), require('./WebViewExample'), require('./AppStateIOSExample'), + require('./NetInfoExample'), require('./AlertIOSExample'), require('./AdSupportIOSExample'), require('./AppStateExample'), diff --git a/Libraries/AppState/AppState.js b/Libraries/AppState/AppState.js index 43b9db1a5..ca5a7e607 100644 --- a/Libraries/AppState/AppState.js +++ b/Libraries/AppState/AppState.js @@ -25,22 +25,4 @@ var AppState = { }; -// This check avoids redboxing if native RKReachability library isn't included in app -// TODO: Move reachability API into separate JS module to prevent need for this -if (RKReachability) { - AppState.networkReachability = new Subscribable( - RCTDeviceEventEmitter, - 'reachabilityDidChange', - (resp) => resp.network_reachability, - RKReachability.getCurrentReachability - ); -} - -AppState.NetworkReachability = keyMirror({ - wifi: true, - cell: true, - none: true, - unknown: true, -}); - module.exports = AppState; diff --git a/Libraries/Network/NetInfo.js b/Libraries/Network/NetInfo.js new file mode 100644 index 000000000..59c29cb07 --- /dev/null +++ b/Libraries/Network/NetInfo.js @@ -0,0 +1,143 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule NetInfo + * @flow + */ +'use strict'; + +var NativeModules = require('NativeModules'); +var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); +var RKReachability = NativeModules.RKReachability; + +var DEVICE_REACHABILITY_EVENT = 'reachabilityDidChange'; + +type ChangeEventName = $Enum<{ + change: string; +}>; + + +/** + * NetInfo exposes info about online/offline status + * + * == iOS Reachability + * + * Asyncronously determine if the device is online and on a cellular network. + * + * - "none" - device is offline + * - "wifi" - device is online and connected via wifi, or is the iOS simulator + * - "cell" - device is connected via Edge, 3G, WiMax, or LTE + * - "unknown" - error case and the network status is unknown + * + * ``` + * NetInfo.reachabilityIOS.fetch().done((reach) => { + * console.log('Initial: ' + reach); + * }); + * function handleFirstReachabilityChange(reach) { + * console.log('First change: ' + reach); + * NetInfo.reachabilityIOS.removeEventListener( + * 'change', + * handleFirstReachabilityChange + * ); + * } + * NetInfo.reachabilityIOS.addEventListener( + * 'change', + * handleFirstReachabilityChange + * ); + * ``` + */ + +var NetInfo = {}; + +if (RKReachability) { + var _reachabilitySubscriptions = {}; + + NetInfo.reachabilityIOS = { + addEventListener: function ( + eventName: ChangeEventName, + handler: Function + ): void { + _reachabilitySubscriptions[handler] = RCTDeviceEventEmitter.addListener( + DEVICE_REACHABILITY_EVENT, + (appStateData) => { + handler(appStateData.network_reachability); + } + ); + }, + + removeEventListener: function( + eventName: ChangeEventName, + handler: Function + ): void { + if (!_reachabilitySubscriptions[handler]) { + return; + } + _reachabilitySubscriptions[handler].remove(); + _reachabilitySubscriptions[handler] = null; + }, + + fetch: function(): Promise { + return new Promise((resolve, reject) => { + RKReachability.getCurrentReachability( + (resp) => { + resolve(resp.network_reachability); + }, + reject + ); + }); + }, + }; + + /** + * + * == NetInfo.isConnected + * + * Available on all platforms. Asyncronously fetch a boolean to determine + * internet connectivity. + * + * ``` + * NetInfo.isConnected.fetch().done((isConnected) => { + * console.log('First, is ' + (isConnected ? 'online' : 'offline')); + * }); + * function handleFirstConnectivityChange(isConnected) { + * console.log('Then, is ' + (isConnected ? 'online' : 'offline')); + * NetInfo.isConnected.removeEventListener( + * 'change', + * handleFirstConnectivityChange + * ); + * } + * NetInfo.isConnected.addEventListener( + * 'change', + * handleFirstConnectivityChange + * ); + * ``` + * + */ + var _isConnectedSubscriptions = {}; + NetInfo.isConnected = { + addEventListener: function ( + eventName: ChangeEventName, + handler: Function + ): void { + _isConnectedSubscriptions[handler] = (reachability) => { + handler(reachability !== 'none'); + }; + NetInfo.reachabilityIOS.addEventListener(eventName, _isConnectedSubscriptions[handler]); + }, + + removeEventListener: function( + eventName: ChangeEventName, + handler: Function + ): void { + NetInfo.reachabilityIOS.removeEventListener(eventName, _isConnectedSubscriptions[handler]); + }, + + fetch: function(): Promise { + return NetInfo.reachabilityIOS.fetch().then( + (reachability) => reachability !== 'none' + ); + }, + }; +} + +module.exports = NetInfo; diff --git a/Libraries/ReactIOS/renderApplication.js b/Libraries/ReactIOS/renderApplication.js index 64e26126c..176dfa72a 100644 --- a/Libraries/ReactIOS/renderApplication.js +++ b/Libraries/ReactIOS/renderApplication.js @@ -15,12 +15,10 @@ function renderApplication(RootComponent, initialProps, rootTag) { rootTag, 'Expect to have a valid rootTag, instead got ', rootTag ); - var pushNotification = initialProps.launchOptions && - initialProps.launchOptions.remoteNotification && - new PushNotificationIOS(initialProps.launchOptions.remoteNotification); + var initialNotification = PushNotificationIOS.popInitialNotification(); React.render( , rootTag diff --git a/Libraries/Utilities/PixelRatio.js b/Libraries/Utilities/PixelRatio.js index 0eeb074c6..f9b1ac13a 100644 --- a/Libraries/Utilities/PixelRatio.js +++ b/Libraries/Utilities/PixelRatio.js @@ -10,45 +10,49 @@ var Dimensions = require('Dimensions'); /** * PixelRatio class gives access to the device pixel density. * - * Some examples: - * - PixelRatio.get() === 2 - * - iPhone 4, 4S - * - iPhone 5, 5c, 5s - * - iPhone 6 - * - * - PixelRatio.get() === 3 - * - iPhone 6 plus - * * There are a few use cases for using PixelRatio: * - * == Displaying a line that's as thin as the device permits + * ### Displaying a line that's as thin as the device permits * * A width of 1 is actually pretty thick on an iPhone 4+, we can do one that's - * thinner using a width of 1 / PixelRatio.get(). It's a technique that works + * thinner using a width of `1 / PixelRatio.get()`. It's a technique that works * on all the devices independent of their pixel density. * - * style={{ borderWidth: 1 / PixelRatio.get() }} + * ``` + * style={{ borderWidth: 1 / PixelRatio.get() }} + * ``` * - * == Fetching a correctly sized image + * ### Fetching a correctly sized image * * You should get a higher resolution image if you are on a high pixel density * device. A good rule of thumb is to multiply the size of the image you display * by the pixel ratio. * - * var image = getImage({ - * width: 200 * PixelRatio.get(), - * height: 100 * PixelRatio.get() - * }); - * + * ``` + * var image = getImage({ + * width: 200 * PixelRatio.get(), + * height: 100 * PixelRatio.get() + * }); + * + * ``` */ class PixelRatio { + /** + * Returns the device pixel density. Some examples: + * + * - PixelRatio.get() === 2 + * - iPhone 4, 4S + * - iPhone 5, 5c, 5s + * - iPhone 6 + * - PixelRatio.get() === 3 + * - iPhone 6 plus + */ static get() { return Dimensions.get('window').scale; } +} - static startDetecting() { - // no-op for iOS, but this is useful for other platforms - } -}; +// No-op for iOS, but used on the web. Should not be documented. +PixelRatio.startDetecting = function() {}; module.exports = PixelRatio; diff --git a/Libraries/Utilities/PushNotificationIOS.js b/Libraries/Utilities/PushNotificationIOS.js index 0cd8a6db6..86733bde3 100644 --- a/Libraries/Utilities/PushNotificationIOS.js +++ b/Libraries/Utilities/PushNotificationIOS.js @@ -5,8 +5,14 @@ */ 'use strict'; +var NativeModules = require('NativeModules'); var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); +var RCTPushNotificationManager = NativeModules.RCTPushNotificationManager; +if (RCTPushNotificationManager) { + var _initialNotification = RCTPushNotificationManager.initialNotification; +} + var _notifHandlers = {}; var DEVICE_NOTIF_EVENT = 'remoteNotificationReceived'; @@ -30,6 +36,14 @@ class PushNotificationIOS { _notifHandlers[handler] = null; } + + static popInitialNotification() { + var initialNotification = _initialNotification && + new PushNotificationIOS(_initialNotification); + _initialNotification = null; + return initialNotification; + } + constructor(nativeNotif) { this._data = {}; diff --git a/Libraries/react-native/react-native.js b/Libraries/react-native/react-native.js index 00be3f65a..5e164b5fc 100644 --- a/Libraries/react-native/react-native.js +++ b/Libraries/react-native/react-native.js @@ -24,6 +24,7 @@ var ReactNative = { ListViewDataSource: require('ListViewDataSource'), MapView: require('MapView'), NavigatorIOS: require('NavigatorIOS'), + NetInfo: require('NetInfo'), PickerIOS: require('PickerIOS'), PixelRatio: require('PixelRatio'), ScrollView: require('ScrollView'), diff --git a/ReactKit/Base/RCTBridge.m b/ReactKit/Base/RCTBridge.m index 5173bc5d2..1fd446b3f 100644 --- a/ReactKit/Base/RCTBridge.m +++ b/ReactKit/Base/RCTBridge.m @@ -554,7 +554,7 @@ static id _latestJSExecutor; }]; if (dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC)) != 0) { - RCTLogMustFix(@"JavaScriptExecutor took too long to inject JSON object"); + RCTLogError(@"JavaScriptExecutor took too long to inject JSON object"); } } diff --git a/ReactKit/Modules/RCTPushNotificationManager.h b/ReactKit/Modules/RCTPushNotificationManager.h new file mode 100644 index 000000000..e0ba53a62 --- /dev/null +++ b/ReactKit/Modules/RCTPushNotificationManager.h @@ -0,0 +1,12 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +extern NSString *const RKRemoteNotificationReceived; +extern NSString *const RKOpenURLNotification; + +@interface RCTPushNotificationManager : NSObject + +- (instancetype)initWithInitialNotification:(NSDictionary *)initialNotification NS_DESIGNATED_INITIALIZER; + +@end diff --git a/ReactKit/Modules/RCTPushNotificationManager.m b/ReactKit/Modules/RCTPushNotificationManager.m new file mode 100644 index 000000000..b895f4d28 --- /dev/null +++ b/ReactKit/Modules/RCTPushNotificationManager.m @@ -0,0 +1,64 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTPushNotificationManager.h" + +#import "RCTAssert.h" +#import "RCTBridge.h" +#import "RCTEventDispatcher.h" + +NSString *const RKRemoteNotificationReceived = @"RemoteNotificationReceived"; +NSString *const RKOpenURLNotification = @"RKOpenURLNotification"; + +@implementation RCTPushNotificationManager +{ + NSDictionary *_initialNotification; +} + +@synthesize bridge = _bridge; + +- (instancetype)init +{ + return [self initWithInitialNotification:nil]; +} + +- (instancetype)initWithInitialNotification:(NSDictionary *)initialNotification +{ + if ((self = [super init])) { + _initialNotification = [initialNotification copy]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(handleRemoteNotificationReceived:) + name:RKRemoteNotificationReceived + object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(handleOpenURLNotification:) + name:RKOpenURLNotification + object:nil]; + } + return self; +} + +- (void)handleRemoteNotificationReceived:(NSNotification *)notification +{ + [_bridge.eventDispatcher sendDeviceEventWithName:@"remoteNotificationReceived" + body:[notification userInfo]]; +} + +- (void)handleOpenURLNotification:(NSNotification *)notification +{ + [_bridge.eventDispatcher sendDeviceEventWithName:@"openURL" + body:[notification userInfo]]; +} + +- (NSDictionary *)constantsToExport +{ + return @{ + @"initialNotification": _initialNotification ?: [NSNull null] + }; +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +@end diff --git a/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js b/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js index 122701d56..a7bf1f533 100644 --- a/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js +++ b/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js @@ -134,13 +134,17 @@ DependecyGraph.prototype.resolveDependency = function( fromModule, depModuleId ) { - // Process asset requires. - var assetMatch = depModuleId.match(/^image!(.+)/); - if (assetMatch && assetMatch[1]) { - if (!this._assetMap[assetMatch[1]]) { - throw new Error('Cannot find asset: ' + assetMatch[1]); + + if (this._assetMap != null) { + // Process asset requires. + var assetMatch = depModuleId.match(/^image!(.+)/); + if (assetMatch && assetMatch[1]) { + if (!this._assetMap[assetMatch[1]]) { + console.warn('Cannot find asset: ' + assetMatch[1]); + return null; + } + return this._assetMap[assetMatch[1]]; } - return this._assetMap[assetMatch[1]]; } var packageJson, modulePath, dep; @@ -577,7 +581,8 @@ function buildAssetMap(roots, exts) { } else { var ext = path.extname(file).replace(/^\./, ''); if (exts.indexOf(ext) !== -1) { - var assetName = path.basename(file, '.' + ext); + var assetName = path.basename(file, '.' + ext) + .replace(/@[\d\.]+x/, ''); if (map[assetName] != null) { debug('Conflcting assets', assetName); } From f7cf017d29a6166b4ab72e76bf908ef6d5af8554 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Tue, 17 Mar 2015 13:42:44 -0700 Subject: [PATCH 56/79] Updates from Tue 17 Mar - [ReactNative] Remove pushNotification prop from renderApplication | Eric Vicenti - [react_native] Stub VibrationIOS on Android | Andy Street - [ReactNative] Simplify and test interpolators | Christopher Chedeau - [ReactNative] Increase timeout for obj-c tests | Christopher Chedeau - [ReactNative] Updated RKText to new UIManager system | Nick Lockwood - [ReactNative] Unforked RCTShadowView, moved RKTextView into FBReactKitTextModule | Nick Lockwood - [ReactKit] Remove NativeModulesDeprecated | Spencer Ahrens - [ReactNative] Allow single callbacks in NativeModules | Spencer Ahrens - [ReactNative] s/RK/RCT in OSS | Spencer Ahrens - [ReactNative] Cleanup StyleSheet API | Christopher Chedeau - [RCTVibration] Basic Vibration API | Christopher Chedeau - [React Native] Prevent crash in redbox code with two thrown errors | Ben Alpert - [ReactNative] unbreak Android | Andrew Rasmussen --- .../UIExplorer.xcodeproj/project.pbxproj | 30 +++ Examples/UIExplorer/UIExplorerList.js | 1 + .../UIExplorerTests/UIExplorerTests.m | 2 +- Examples/UIExplorer/VibrationIOSExample.js | 42 +++ Libraries/ActionSheetIOS/ActionSheetIOS.js | 3 +- Libraries/Animation/AnimationUtils.js | 194 +++++++------- Libraries/Animation/LayoutAnimation.js | 4 +- .../__tests__/AnimationUtils-test.js | 46 ++++ Libraries/AppState/AppState.js | 13 +- Libraries/AppStateIOS/AppStateIOS.ios.js | 4 +- .../BatchedBridgedModules/NativeModules.js | 8 +- .../NativeModulesDeprecated.js | 16 -- .../BatchedBridgedModules/POPAnimation.js | 92 +++---- .../RCTAlertManager.ios.js | 10 + .../RKAlertManager.ios.js | 10 - .../BatchedBridgeFactory.js | 43 +-- Libraries/CameraRoll/CameraRoll.js | 6 +- .../ActivityIndicatorIOS.ios.js | 2 +- .../DatePicker/DatePickerIOS.ios.js | 16 +- Libraries/Components/ListView/ListView.js | 6 +- Libraries/Components/MapView/MapView.js | 4 +- .../Components/Navigation/NavigatorIOS.ios.js | 20 +- Libraries/Components/ScrollResponder.js | 16 +- Libraries/Components/ScrollView/ScrollView.js | 6 +- Libraries/Components/Slider/Slider.js | 4 +- .../Components/StatusBar/StatusBarIOS.ios.js | 16 +- Libraries/Components/Subscribable.js | 2 +- .../Components/SwitchIOS/SwitchIOS.ios.js | 6 +- .../Components/TabBarIOS/TabBarIOS.ios.js | 6 +- .../Components/TabBarIOS/TabBarItemIOS.ios.js | 6 +- .../Components/TextInput/TextInput.ios.js | 24 +- .../Components/TextInput/TextInputState.js | 6 +- .../Touchable/TouchableHighlight.js | 2 +- Libraries/Components/View/View.js | 14 +- .../Components/WebView/WebView.android.js | 14 +- Libraries/Components/WebView/WebView.ios.js | 28 +- Libraries/Image/Image.ios.js | 12 +- .../InitializeJavaScriptAppEngine.js | 14 +- .../System/JSTimers/JSTimers.js | 10 +- Libraries/Network/NetInfo.js | 6 +- Libraries/Network/XMLHttpRequest.ios.js | 4 +- Libraries/Picker/PickerIOS.android.js | 2 +- Libraries/Picker/PickerIOS.ios.js | 12 +- Libraries/RCTTest/RCTTestRunner.m | 2 +- Libraries/RKBackendNode/queryLayoutByID.js | 4 +- .../ReactIOS/IOSNativeBridgeEventPlugin.js | 8 +- Libraries/ReactIOS/NativeMethodsMixin.js | 17 +- .../ReactIOS/ReactIOSComponentEnvironment.js | 3 - Libraries/ReactIOS/ReactIOSDOMIDOperations.js | 6 +- .../ReactIOSGlobalResponderHandler.js | 6 +- Libraries/ReactIOS/ReactIOSMount.js | 8 +- Libraries/ReactIOS/ReactIOSNativeComponent.js | 8 +- Libraries/ReactIOS/ReactIOSTextComponent.js | 6 +- Libraries/ReactIOS/ReactIOSViewAttributes.js | 4 +- Libraries/ReactIOS/renderApplication.js | 5 +- Libraries/Storage/AsyncStorage.ios.js | 30 +-- Libraries/StyleSheet/StyleSheet.js | 72 +---- Libraries/StyleSheet/StyleSheetValidation.js | 72 +++++ Libraries/Text/RCTTextManager.m | 4 + Libraries/Text/Text.js | 4 +- Libraries/Utilities/AlertIOS.js | 4 +- Libraries/Utilities/Dimensions.js | 2 +- Libraries/Utilities/MessageQueue.js | 26 +- .../Utilities/nativeModulePrefixDuplicator.js | 25 ++ Libraries/Vibration/RCTVibration.h | 7 + Libraries/Vibration/RCTVibration.m | 15 ++ .../RCTVibration.xcodeproj/project.pbxproj | 248 ++++++++++++++++++ Libraries/Vibration/VibrationIOS.android.js | 18 ++ Libraries/Vibration/VibrationIOS.ios.js | 32 +++ Libraries/react-native/react-native.js | 1 + ReactKit/Base/RCTConvert.h | 1 + ReactKit/Base/RCTRedBox.m | 5 +- ReactKit/Modules/RCTUIManager.m | 9 +- ReactKit/Views/RCTShadowView.h | 13 +- ReactKit/Views/RCTShadowView.m | 7 +- ReactKit/Views/RCTTextFieldManager.m | 9 +- ReactKit/Views/RCTViewManager.m | 4 +- 77 files changed, 937 insertions(+), 530 deletions(-) create mode 100644 Examples/UIExplorer/VibrationIOSExample.js create mode 100644 Libraries/Animation/__tests__/AnimationUtils-test.js delete mode 100644 Libraries/BatchedBridge/BatchedBridgedModules/NativeModulesDeprecated.js create mode 100644 Libraries/BatchedBridge/BatchedBridgedModules/RCTAlertManager.ios.js delete mode 100644 Libraries/BatchedBridge/BatchedBridgedModules/RKAlertManager.ios.js create mode 100644 Libraries/StyleSheet/StyleSheetValidation.js create mode 100644 Libraries/Utilities/nativeModulePrefixDuplicator.js create mode 100644 Libraries/Vibration/RCTVibration.h create mode 100644 Libraries/Vibration/RCTVibration.m create mode 100644 Libraries/Vibration/RCTVibration.xcodeproj/project.pbxproj create mode 100644 Libraries/Vibration/VibrationIOS.android.js create mode 100644 Libraries/Vibration/VibrationIOS.ios.js diff --git a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj index f33ddefce..6e214d3b9 100644 --- a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj +++ b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj @@ -19,6 +19,7 @@ 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 147CED4C1AB3532B00DA3E4C /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 147CED4B1AB34F8C00DA3E4C /* libRCTActionSheet.a */; }; + D85B829E1AB6D5D7003F4FE2 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D85B829C1AB6D5CE003F4FE2 /* libRCTVibration.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -78,6 +79,13 @@ remoteGlobalIDString = 134814201AA4EA6300B7C361; remoteInfo = RCTActionSheet; }; + D85B829B1AB6D5CE003F4FE2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D85B82911AB6D5CE003F4FE2 /* RCTVibration.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; + remoteInfo = RCTVibration; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -98,6 +106,7 @@ 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 14E0EEC81AB118F7000DECC3 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = ../../Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj; sourceTree = ""; }; + D85B82911AB6D5CE003F4FE2 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = ../../Libraries/Vibration/RCTVibration.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -112,6 +121,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + D85B829E1AB6D5D7003F4FE2 /* libRCTVibration.a in Frameworks */, 147CED4C1AB3532B00DA3E4C /* libRCTActionSheet.a in Frameworks */, 134454601AAFCABD003F0779 /* libRCTAdSupport.a in Frameworks */, 134A8A2A1AACED7A00945AAE /* libRCTGeolocation.a in Frameworks */, @@ -145,6 +155,7 @@ 1316A21D1AA397F400C0188E /* Libraries */ = { isa = PBXGroup; children = ( + D85B82911AB6D5CE003F4FE2 /* RCTVibration.xcodeproj */, 14E0EEC81AB118F7000DECC3 /* RCTActionSheet.xcodeproj */, 13417FFA1AA91531003F314A /* ReactKit.xcodeproj */, 134454551AAFCAAE003F0779 /* RCTAdSupport.xcodeproj */, @@ -244,6 +255,14 @@ name = Products; sourceTree = ""; }; + D85B82921AB6D5CE003F4FE2 /* Products */ = { + isa = PBXGroup; + children = ( + D85B829C1AB6D5CE003F4FE2 /* libRCTVibration.a */, + ); + name = Products; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -333,6 +352,10 @@ ProductGroup = 13417FEB1AA914B8003F314A /* Products */; ProjectRef = 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */; }, + { + ProductGroup = D85B82921AB6D5CE003F4FE2 /* Products */; + ProjectRef = D85B82911AB6D5CE003F4FE2 /* RCTVibration.xcodeproj */; + }, { ProductGroup = 13417FFB1AA91531003F314A /* Products */; ProjectRef = 13417FFA1AA91531003F314A /* ReactKit.xcodeproj */; @@ -396,6 +419,13 @@ remoteRef = 147CED4A1AB34F8C00DA3E4C /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + D85B829C1AB6D5CE003F4FE2 /* libRCTVibration.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTVibration.a; + remoteRef = D85B829B1AB6D5CE003F4FE2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ diff --git a/Examples/UIExplorer/UIExplorerList.js b/Examples/UIExplorer/UIExplorerList.js index a4f70fbcd..bc46292fd 100644 --- a/Examples/UIExplorer/UIExplorerList.js +++ b/Examples/UIExplorer/UIExplorerList.js @@ -47,6 +47,7 @@ var EXAMPLES = [ require('./AdSupportIOSExample'), require('./AppStateExample'), require('./ActionSheetIOSExample'), + require('./VibrationIOSExample'), ]; var UIExplorerList = React.createClass({ diff --git a/Examples/UIExplorer/UIExplorerTests/UIExplorerTests.m b/Examples/UIExplorer/UIExplorerTests/UIExplorerTests.m index 1a7a70d78..237270f67 100644 --- a/Examples/UIExplorer/UIExplorerTests/UIExplorerTests.m +++ b/Examples/UIExplorer/UIExplorerTests/UIExplorerTests.m @@ -3,7 +3,7 @@ #import #import -#define TIMEOUT_SECONDS 30 +#define TIMEOUT_SECONDS 240 @interface UIExplorerTests : XCTestCase diff --git a/Examples/UIExplorer/VibrationIOSExample.js b/Examples/UIExplorer/VibrationIOSExample.js new file mode 100644 index 000000000..bd768bcbb --- /dev/null +++ b/Examples/UIExplorer/VibrationIOSExample.js @@ -0,0 +1,42 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + */ +'use strict'; + +var React = require('react-native'); +var { + StyleSheet, + View, + Text, + TouchableHighlight, + VibrationIOS +} = React; + +exports.framework = 'React'; +exports.title = 'VibrationIOS'; +exports.description = 'Vibration API for iOS'; +exports.examples = [{ + title: 'VibrationIOS.vibrate()', + render() { + return ( + VibrationIOS.vibrate()}> + + Vibrate + + + ); + }, +}]; + +var styles = StyleSheet.create({ + wrapper: { + borderRadius: 5, + marginBottom: 5, + }, + button: { + backgroundColor: '#eeeeee', + padding: 10, + }, +}); diff --git a/Libraries/ActionSheetIOS/ActionSheetIOS.js b/Libraries/ActionSheetIOS/ActionSheetIOS.js index d4cc84a48..5a24f06b0 100644 --- a/Libraries/ActionSheetIOS/ActionSheetIOS.js +++ b/Libraries/ActionSheetIOS/ActionSheetIOS.js @@ -5,8 +5,9 @@ */ 'use strict'; +var { RCTActionSheetManager } = require('NativeModules'); + var invariant = require('invariant'); -var RCTActionSheetManager = require('NativeModulesDeprecated').RKActionSheetManager; var ActionSheetIOS = { showActionSheetWithOptions(options, callback) { diff --git a/Libraries/Animation/AnimationUtils.js b/Libraries/Animation/AnimationUtils.js index cf986abe8..d36e817cf 100644 --- a/Libraries/Animation/AnimationUtils.js +++ b/Libraries/Animation/AnimationUtils.js @@ -8,197 +8,191 @@ type EasingFunction = (t: number) => number; -var b = 0, - c = 1, - d = 1; var defaults = { easeInQuad: function(t) { - return c * (t /= 1) * t + b; + return t * t; }, easeOutQuad: function(t) { - return -c * (t /= d) * (t - 2) + b; + return -t * (t - 2); }, easeInOutQuad: function(t) { - if ((t /= d / 2) < 1) { - return c / 2 * t * t + b; + t = t * 2; + if (t < 1) { + return 0.5 * t * t; } - return -c / 2 * ((--t) * (t - 2) - 1) + b; + return -((t - 1) * (t - 3) - 1) / 2; }, easeInCubic: function(t) { - return c * (t /= d) * t * t + b; + return t * t * t; }, easeOutCubic: function(t) { - return c * ((t = t / d - 1) * t * t + 1) + b; + t -= 1; + return t * t * t + 1; }, easeInOutCubic: function(t) { - if ((t /= d / 2) < 1) { - return c / 2 * t * t * t + b; + t *= 2; + if (t < 1) { + return 0.5 * t * t * t; } - return c / 2 * ((t -= 2) * t * t + 2) + b; + t -= 2; + return (t * t * t + 2) / 2; }, easeInQuart: function(t) { - return c * (t /= d) * t * t * t + b; + return t * t * t * t; }, easeOutQuart: function(t) { - return -c * ((t = t / d - 1) * t * t * t - 1) + b; + t -= 1; + return -(t * t * t * t - 1); }, easeInOutQuart: function(t) { - if ((t /= d / 2) < 1) { - return c / 2 * t * t * t * t + b; + t *= 2; + if (t < 1) { + return 0.5 * t * t * t * t; } - return -c / 2 * ((t -= 2) * t * t * t - 2) + b; + t -= 2; + return -(t * t * t * t - 2) / 2; }, easeInQuint: function(t) { - return c * (t /= d) * t * t * t * t + b; + return t * t * t * t * t; }, easeOutQuint: function(t) { - return c * ((t = t / d - 1) * t * t * t * t + 1) + b; + t -= 1; + return t * t * t * t * t + 1; }, easeInOutQuint: function(t) { - if ((t /= d / 2) < 1) { - return c / 2 * t * t * t * t * t + b; + t *= 2; + if (t < 1) { + return (t * t * t * t * t) / 2; } - return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; + t -= 2; + return (t * t * t * t * t + 2) / 2; }, easeInSine: function(t) { - return -c * Math.cos(t / d * (Math.PI / 2)) + c + b; + return -Math.cos(t * (Math.PI / 2)) + 1; }, easeOutSine: function(t) { - return c * Math.sin(t / d * (Math.PI / 2)) + b; + return Math.sin(t * (Math.PI / 2)); }, easeInOutSine: function(t) { - return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; + return -(Math.cos(Math.PI * t) - 1) / 2; }, easeInExpo: function(t) { - return (t === 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b; + return (t === 0) ? 0 : Math.pow(2, 10 * (t - 1)); }, easeOutExpo: function(t) { - return (t === d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; + return (t === 1) ? 1 : (-Math.pow(2, -10 * t) + 1); }, easeInOutExpo: function(t) { if (t === 0) { - return b; + return 0; } - if (t === d) { - return b + c; + if (t === 1) { + return 1; } - if ((t /= d / 2) < 1) { - return c / 2 * Math.pow(2, 10 * (t - 1)) + b; + t *= 2; + if (t < 1) { + return 0.5 * Math.pow(2, 10 * (t - 1)); } - return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; + return (-Math.pow(2, -10 * (t - 1)) + 2) / 2; }, easeInCirc: function(t) { - return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; + return -(Math.sqrt(1 - t * t) - 1); }, easeOutCirc: function(t) { - return c * Math.sqrt(1 - (t = t / d - 1) * t) + b; + t -= 1; + return Math.sqrt(1 - t * t); }, easeInOutCirc: function(t) { - if ((t /= d / 2) < 1) { - return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; + t *= 2; + if (t < 1) { + return -(Math.sqrt(1 - t * t) - 1) / 2; } - return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; + t -= 2; + return (Math.sqrt(1 - t * t) + 1) / 2; }, easeInElastic: function(t) { var s = 1.70158; - var p = 0; - var a = c; + var p = 0.3; if (t === 0) { - return b; + return 0; } - if ((t /= d) === 1) { - return b + c; + if (t === 1) { + return 1; } - if (!p) { - p = d * 0.3; - } - if (a < Math.abs(c)) { - a = c; - var s = p / 4; - } else { - var s = p / (2 * Math.PI) * Math.asin(c / a); - } - return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + var s = p / (2 * Math.PI) * Math.asin(1); + t -= 1; + return -(Math.pow(2, 10 * t) * Math.sin((t * 1 - s) * (2 * Math.PI) / p)); }, easeOutElastic: function(t) { var s = 1.70158; - var p = 0; - var a = c; + var p = 0.3; if (t === 0) { - return b; + return 0; } - if ((t /= d) === 1) { - return b + c; + if (t === 1) { + return 1; } - if (!p) { - p = d * 0.3; - } - if (a < Math.abs(c)) { - a = c; - var s = p / 4; - } else { - var s = p / (2 * Math.PI) * Math.asin(c / a); - } - return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b; + var s = p / (2 * Math.PI) * Math.asin(1); + return Math.pow(2, -10 * t) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) + 1; }, easeInOutElastic: function(t) { var s = 1.70158; - var p = 0; - var a = c; + var p = 0.3 * 1.5; if (t === 0) { - return b; + return 0; } - if ((t /= d / 2) === 2) { - return b + c; - } - if (!p) { - p = d * (0.3 * 1.5); - } - if (a < Math.abs(c)) { - a = c; - var s = p / 4; - } else { - var s = p / (2 * Math.PI) * Math.asin(c / a); + t *= 2; + if (t === 2) { + return 1; } + var s = p / (2 * Math.PI) * Math.asin(1); if (t < 1) { - return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + t -= 1; + return -(Math.pow(2, 10 * t) * Math.sin((t * 1 - s) * (2 * Math.PI) / p)) / 2; } - return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * 0.5 + c + b; + t -= 1; + return Math.pow(2, -10 * t) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) / 2 + 1; }, easeInBack: function(t) { var s = 1.70158; - return c * (t /= d) * t * ((s + 1) * t - s) + b; + return t * t * ((s + 1) * t - s); }, easeOutBack: function(t) { var s = 1.70158; - return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; + t -= 1; + return (t * t * ((s + 1) * t + s) + 1); }, easeInOutBack: function(t) { - var s = 1.70158; - if ((t /= d / 2) < 1) { - return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b; + var s = 1.70158 * 1.525; + t *= 2; + if (t < 1) { + return (t * t * ((s + 1) * t - s)) / 2; } - return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b; + t -= 2; + return (t * t * ((s + 1) * t + s) + 2) / 2; }, easeInBounce: function(t) { - return c - this.easeOutBounce(d - t) + b; + return 1 - this.easeOutBounce(1 - t); }, easeOutBounce: function(t) { - if ((t /= d) < (1 / 2.75)) { - return c * (7.5625 * t * t) + b; + if (t < (1 / 2.75)) { + return 7.5625 * t * t; } else if (t < (2 / 2.75)) { - return c * (7.5625 * (t -= (1.5 / 2.75)) * t + 0.75) + b; + t -= 1.5 / 2.75; + return 7.5625 * t * t + 0.75; } else if (t < (2.5 / 2.75)) { - return c * (7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375) + b; + t -= 2.25 / 2.75; + return 7.5625 * t * t + 0.9375; } else { - return c * (7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375) + b; + t -= 2.625 / 2.75; + return 7.5625 * t * t + 0.984375; } }, easeInOutBounce: function(t) { - if (t < d / 2) { - return this.easeInBounce(t * 2) * 0.5 + b; + if (t < 0.5) { + return this.easeInBounce(t * 2) / 2; } - return this.easeOutBounce(t * 2 - d) * 0.5 + c * 0.5 + b; + return this.easeOutBounce(t * 2 - 1) / 2 + 0.5; }, }; diff --git a/Libraries/Animation/LayoutAnimation.js b/Libraries/Animation/LayoutAnimation.js index 5ce5648b3..a5adc567b 100644 --- a/Libraries/Animation/LayoutAnimation.js +++ b/Libraries/Animation/LayoutAnimation.js @@ -6,7 +6,7 @@ 'use strict'; var PropTypes = require('ReactPropTypes'); -var RKUIManager = require('NativeModules').RKUIManager; +var RCTUIManager = require('NativeModules').RCTUIManager; var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker'); var keyMirror = require('keyMirror'); @@ -47,7 +47,7 @@ var configChecker = createStrictShapeTypeChecker({ var LayoutAnimation = { configureNext(config, onAnimationDidEnd, onError) { configChecker({config}, 'config', 'LayoutAnimation.configureNext'); - RKUIManager.configureNextLayoutAnimation(config, onAnimationDidEnd, onError); + RCTUIManager.configureNextLayoutAnimation(config, onAnimationDidEnd, onError); }, create(duration, type, creationProp) { return { diff --git a/Libraries/Animation/__tests__/AnimationUtils-test.js b/Libraries/Animation/__tests__/AnimationUtils-test.js new file mode 100644 index 000000000..00ca67dab --- /dev/null +++ b/Libraries/Animation/__tests__/AnimationUtils-test.js @@ -0,0 +1,46 @@ +'use strict'; + +jest.autoMockOff(); + +var AnimationUtils = require('AnimationUtils'); + +describe('AnimationUtils', function() { + var DURATION = 300; + + var Samples = { + easeInQuad: [0,0.0030864197530864196,0.012345679012345678,0.027777777777777776,0.04938271604938271,0.0771604938271605,0.1111111111111111,0.15123456790123457,0.19753086419753085,0.25,0.308641975308642,0.37345679012345684,0.4444444444444444,0.5216049382716049,0.6049382716049383,0.6944444444444445,0.7901234567901234,0.8919753086419753,1], + easeOutQuad: [0,0.10802469135802469,0.20987654320987653,0.3055555555555555,0.3950617283950617,0.47839506172839513,0.5555555555555556,0.6265432098765432,0.691358024691358,0.75,0.8024691358024691,0.8487654320987654,0.888888888888889,0.9228395061728394,0.9506172839506174,0.9722222222222221,0.9876543209876543,0.9969135802469136,1], + easeInOutQuad: [0,0.006172839506172839,0.024691358024691357,0.05555555555555555,0.09876543209876543,0.154320987654321,0.2222222222222222,0.30246913580246915,0.3950617283950617,0.5,0.6049382716049383,0.697530864197531,0.7777777777777777,0.845679012345679,0.9012345679012346,0.9444444444444444,0.9753086419753086,0.9938271604938271,1], + easeInCubic: [0,0.00017146776406035664,0.0013717421124828531,0.004629629629629629,0.010973936899862825,0.021433470507544586,0.037037037037037035,0.05881344307270234,0.0877914951989026,0.125,0.1714677640603567,0.22822359396433475,0.2962962962962963,0.37671467764060357,0.4705075445816187,0.5787037037037038,0.7023319615912208,0.8424211248285322,1], + easeOutCubic: [0,0.15757887517146785,0.2976680384087792,0.42129629629629617,0.5294924554183813,0.6232853223593964,0.7037037037037036,0.7717764060356652,0.8285322359396433,0.875,0.9122085048010974,0.9411865569272977,0.9629629629629629,0.9785665294924554,0.9890260631001372,0.9953703703703703,0.9986282578875172,0.9998285322359396,1], + easeInOutCubic: [0,0.0006858710562414266,0.0054869684499314125,0.018518518518518517,0.0438957475994513,0.08573388203017834,0.14814814814814814,0.23525377229080935,0.3511659807956104,0.5,0.6488340192043895,0.7647462277091908,0.8518518518518519,0.9142661179698217,0.9561042524005487,0.9814814814814815,0.9945130315500685,0.9993141289437586,1], + easeInQuart: [0,0.000009525986892242035,0.00015241579027587256,0.0007716049382716049,0.002438652644413961,0.005953741807651274,0.012345679012345678,0.02287189452827313,0.039018442310623375,0.0625,0.09525986892242039,0.1394699740893157,0.19753086419753085,0.2720717116293248,0.3659503124523701,0.48225308641975323,0.624295076969974,0.7956199512269471,1], + easeOutQuart: [0,0.20438004877305294,0.375704923030026,0.5177469135802468,0.6340496875476299,0.7279282883706752,0.802469135802469,0.8605300259106843,0.9047401310775796,0.9375,0.9609815576893767,0.9771281054717269,0.9876543209876543,0.9940462581923487,0.997561347355586,0.9992283950617284,0.9998475842097241,0.9999904740131078,1], + easeInOutQuart: [0,0.00007620789513793628,0.0012193263222069805,0.006172839506172839,0.019509221155311687,0.047629934461210194,0.09876543209876543,0.18297515622618504,0.312147538484987,0.5,0.687852461515013,0.8170248437738151,0.9012345679012346,0.9523700655387898,0.9804907788446883,0.9938271604938271,0.998780673677793,0.999923792104862,1], + easeInQuint: [0,5.292214940134463e-7,0.000016935087808430282,0.00012860082304526747,0.000541922809869769,0.0016538171687920206,0.004115226337448559,0.008894625649883995,0.01734152991583261,0.03125,0.05292214940134466,0.08523165083235959,0.1316872427983539,0.1964962361767346,0.28462802079628785,0.401877572016461,0.5549289573066435,0.75141884282545,1], + easeOutQuint: [0,0.24858115717454998,0.4450710426933565,0.598122427983539,0.7153719792037121,0.8035037638232654,0.868312757201646,0.9147683491676404,0.9470778505986553,0.96875,0.9826584700841674,0.991105374350116,0.9958847736625515,0.998346182831208,0.9994580771901302,0.9998713991769548,0.9999830649121916,0.999999470778506,1], + easeInOutQuint: [0,0.000008467543904215141,0.0002709614049348845,0.0020576131687242796,0.008670764957916305,0.02646107470067233,0.06584362139917695,0.14231401039814393,0.27746447865332174,0.5,0.7225355213466782,0.8576859896018563,0.934156378600823,0.9735389252993276,0.9913292350420837,0.9979423868312757,0.9997290385950651,0.9999915324560957,1], + easeInSine: [0,0.003805301908254455,0.01519224698779198,0.03407417371093169,0.06030737921409157,0.09369221296335006,0.1339745962155613,0.1808479557110082,0.233955556881022,0.2928932188134524,0.35721239031346064,0.42642356364895384,0.4999999999999999,0.5773817382593005,0.6579798566743311,0.7411809548974793,0.8263518223330696,0.9128442572523416,0.9999999999999999], + easeOutSine: [0,0.08715574274765817,0.17364817766693033,0.25881904510252074,0.3420201433256687,0.42261826174069944,0.49999999999999994,0.573576436351046,0.6427876096865393,0.7071067811865475,0.766044443118978,0.8191520442889918,0.8660254037844386,0.9063077870366499,0.9396926207859083,0.9659258262890683,0.984807753012208,0.9961946980917455,1], + easeInOutSine: [0,0.00759612349389599,0.030153689607045786,0.06698729810778065,0.116977778440511,0.17860619515673032,0.24999999999999994,0.32898992833716556,0.4131759111665348,0.49999999999999994,0.5868240888334652,0.6710100716628343,0.7499999999999999,0.8213938048432696,0.883022221559489,0.9330127018922194,0.9698463103929542,0.9924038765061041,1], + easeInExpo: [0,0.0014352875901128893,0.002109491677524035,0.0031003926796253885,0.004556754060844206,0.006697218616039631,0.009843133202303688,0.014466792379488908,0.021262343752724643,0.03125,0.045929202883612456,0.06750373368076916,0.09921256574801243,0.1458161299470146,0.2143109957132682,0.31498026247371835,0.46293735614364506,0.6803950000871883,1], + easeOutExpo: [0,0.31960499991281155,0.5370626438563548,0.6850197375262816,0.7856890042867318,0.8541838700529854,0.9007874342519875,0.9324962663192309,0.9540707971163875,0.96875,0.9787376562472754,0.9855332076205111,0.9901568667976963,0.9933027813839603,0.9954432459391558,0.9968996073203746,0.9978905083224759,0.9985647124098871,1], + easeInOutExpo: [0,0.0010547458387620175,0.002278377030422103,0.004921566601151844,0.010631171876362321,0.022964601441806228,0.049606282874006216,0.1071554978566341,0.23146867807182253,0.5,0.7685313219281775,0.892844502143366,0.9503937171259937,0.9770353985581938,0.9893688281236377,0.9950784333988482,0.9977216229695779,0.998945254161238,1], + easeInCirc: [0,0.0015444024660317135,0.006192010000093506,0.013986702816730645,0.025003956956430873,0.03935464078941209,0.057190958417936644,0.07871533601238889,0.10419358352238339,0.1339745962155614,0.1685205807169019,0.20845517506805522,0.2546440075000701,0.3083389112228482,0.37146063894529113,0.4472292016074334,0.5418771527091488,0.6713289009389102,1], + easeOutCirc: [0,0.3286710990610898,0.45812284729085123,0.5527707983925666,0.6285393610547089,0.6916610887771518,0.7453559924999298,0.7915448249319448,0.8314794192830981,0.8660254037844386,0.8958064164776166,0.9212846639876111,0.9428090415820634,0.9606453592105879,0.9749960430435691,0.9860132971832694,0.9938079899999065,0.9984555975339683,1], + easeInOutCirc: [0,0.003096005000046753,0.012501978478215436,0.028595479208968322,0.052096791761191696,0.08426029035845095,0.12732200375003505,0.18573031947264557,0.2709385763545744,0.5,0.7290614236454256,0.8142696805273546,0.8726779962499649,0.915739709641549,0.9479032082388084,0.9714045207910317,0.9874980215217846,0.9969039949999532,1], + easeInElastic: [0,0.0008570943160003016,0.0020526300563455885,0.0005383775388688477,-0.003807112477441741,-0.005595444524068916,0.0017092421431128787,0.014076838118604966,0.012696991251677569,-0.015625000000000045,-0.045618646044515744,-0.01936028903971309,0.07600123467884114,0.13030605320629246,-0.012461076179381799,-0.29598462833976175,-0.3176868895106366,0.2694906924487451,1], + easeOutElastic: [0,0.7305093075512543,1.3176868895106364,1.2959846283397618,1.0124610761793817,0.8696939467937076,0.9239987653211588,1.019360289039713,1.0456186460445158,1.015625,0.9873030087483224,0.9859231618813951,0.9982907578568871,1.005595444524069,1.0038071124774417,0.9994616224611311,0.9979473699436544,0.9991429056839997,1], + easeInOutElastic: [0,0.0010420781824747765,-0.0003083357248478688,-0.004888288728445655,0.0010292130059457788,0.022895545534212507,-0.0028843488305936938,-0.10707491183281304,0.004488485931276091,0.5,0.995511514068724,1.107074911832813,1.0028843488305939,0.9771044544657875,0.9989707869940542,1.0048882887284456,1.000308335724848,0.9989579218175252,1], + easeInBack: [0,-0.004788556241426612,-0.017301289437585736,-0.0347587962962963,-0.05438167352537723,-0.07339051783264748,-0.08900592592592595,-0.09844849451303156,-0.0989388203017833,-0.08769750000000004,-0.06194513031550073,-0.018902307956104283,0.044210370370370254,0.13017230795610413,0.2417629080932785,0.3817615740740742,0.5529477091906719,0.7581007167352535,0.9999999999999998], + easeOutBack: [2.220446049250313e-16,0.24189928326474652,0.44705229080932807,0.6182384259259258,0.7582370919067215,0.8698276920438959,0.9557896296296297,1.0189023079561044,1.0619451303155008,1.0876975,1.0989388203017834,1.0984484945130315,1.089005925925926,1.0733905178326475,1.0543816735253773,1.0347587962962963,1.0173012894375857,1.0047885562414267,1], + easeInOutBack: [0,-0.01355231550068587,-0.04434668449931412,-0.07758924074074074,-0.09848611796982167,-0.0922434499314129,-0.0440673703703704,0.060835986968449905,0.237260488340192,0.5,0.762739511659808,0.9391640130315503,1.0440673703703702,1.0922434499314129,1.0984861179698218,1.0775892407407408,1.0443466844993141,1.0135523155006858,1], + }; + + Object.keys(Samples).forEach(function(type) { + it('should interpolate ' + type, function() { + expect(AnimationUtils.evaluateEasingFunction(DURATION, type)) + .toEqual(Samples[type]); + }); + }); +}); diff --git a/Libraries/AppState/AppState.js b/Libraries/AppState/AppState.js index ca5a7e607..47834936a 100644 --- a/Libraries/AppState/AppState.js +++ b/Libraries/AppState/AppState.js @@ -5,22 +5,17 @@ */ 'use strict'; -var NativeModules = require('NativeModulesDeprecated'); -var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); -var RKAppState = NativeModules.RKAppState; -var RKReachability = NativeModules.RKReachability; -var Subscribable = require('Subscribable'); - -var keyMirror = require('keyMirror'); +var NativeModules = require('NativeModules'); +var RCTAppState = NativeModules.RCTAppState; var AppState = { setApplicationIconBadgeNumber: function(number) { - RKAppState.setApplicationIconBadgeNumber(number); + RCTAppState.setApplicationIconBadgeNumber(number); }, getApplicationIconBadgeNumber: function(callback) { - RKAppState.getApplicationIconBadgeNumber(callback); + RCTAppState.getApplicationIconBadgeNumber(callback); }, }; diff --git a/Libraries/AppStateIOS/AppStateIOS.ios.js b/Libraries/AppStateIOS/AppStateIOS.ios.js index 8f03654b5..1f6bca95b 100644 --- a/Libraries/AppStateIOS/AppStateIOS.ios.js +++ b/Libraries/AppStateIOS/AppStateIOS.ios.js @@ -7,7 +7,7 @@ var NativeModules = require('NativeModules'); var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); -var RKAppState = NativeModules.RKAppState; +var RCTAppState = NativeModules.RCTAppState; var logError = require('logError'); @@ -45,7 +45,7 @@ RCTDeviceEventEmitter.addListener( } ); -RKAppState.getCurrentAppState( +RCTAppState.getCurrentAppState( (appStateData) => { AppStateIOS.currentState = appStateData.app_state; }, diff --git a/Libraries/BatchedBridge/BatchedBridgedModules/NativeModules.js b/Libraries/BatchedBridge/BatchedBridgedModules/NativeModules.js index 680528575..f8029f8b8 100644 --- a/Libraries/BatchedBridge/BatchedBridgedModules/NativeModules.js +++ b/Libraries/BatchedBridge/BatchedBridgedModules/NativeModules.js @@ -7,10 +7,8 @@ var NativeModules = require('BatchedBridge').RemoteModules; -// Dirty hack to support old (RK) and new (RCT) native module name conventions -Object.keys(NativeModules).forEach((moduleName) => { - var rkModuleName = moduleName.replace(/^RCT/, 'RK'); - NativeModules[rkModuleName] = NativeModules[moduleName]; -}); +var nativeModulePrefixDuplicator = require('nativeModulePrefixDuplicator'); + +nativeModulePrefixDuplicator(NativeModules); module.exports = NativeModules; diff --git a/Libraries/BatchedBridge/BatchedBridgedModules/NativeModulesDeprecated.js b/Libraries/BatchedBridge/BatchedBridgedModules/NativeModulesDeprecated.js deleted file mode 100644 index 2d83d6f9a..000000000 --- a/Libraries/BatchedBridge/BatchedBridgedModules/NativeModulesDeprecated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule NativeModulesDeprecated - */ -'use strict'; - -var RemoteModulesDeprecated = require('BatchedBridge').RemoteModulesDeprecated; - -// Dirty hack to support old (RK) and new (RCT) native module name conventions -Object.keys(RemoteModulesDeprecated).forEach((moduleName) => { - var rkModuleName = moduleName.replace(/^RCT/, 'RK'); - RemoteModulesDeprecated[rkModuleName] = RemoteModulesDeprecated[moduleName]; -}); - -module.exports = RemoteModulesDeprecated; diff --git a/Libraries/BatchedBridge/BatchedBridgedModules/POPAnimation.js b/Libraries/BatchedBridge/BatchedBridgedModules/POPAnimation.js index 8ec0bd62f..3195e3ee1 100644 --- a/Libraries/BatchedBridge/BatchedBridgedModules/POPAnimation.js +++ b/Libraries/BatchedBridge/BatchedBridgedModules/POPAnimation.js @@ -5,8 +5,8 @@ */ 'use strict'; -var RKPOPAnimationManager = require('NativeModulesDeprecated').RKPOPAnimationManager; -if (!RKPOPAnimationManager) { +var RCTPOPAnimationManager = require('NativeModules').RCTPOPAnimationManager; +if (!RCTPOPAnimationManager) { // POP animation isn't available in the OSS fork - this is a temporary // workaround to enable its availability to be determined at runtime. module.exports = null; @@ -18,45 +18,45 @@ var getObjectValues = require('getObjectValues'); var invariant = require('invariant'); var merge = require('merge'); -var RKTypes = RKPOPAnimationManager.Types; -var RKProperties = RKPOPAnimationManager.Properties; +var RCTTypes = RCTPOPAnimationManager.Types; +var RCTProperties = RCTPOPAnimationManager.Properties; var Properties = { - bounds: RKProperties.bounds, - opacity: RKProperties.opacity, - position: RKProperties.position, - positionX: RKProperties.positionX, - positionY: RKProperties.positionY, - zPosition: RKProperties.zPosition, - rotation: RKProperties.rotation, - rotationX: RKProperties.rotationX, - rotationY: RKProperties.rotationY, - scaleX: RKProperties.scaleX, - scaleXY: RKProperties.scaleXY, - scaleY: RKProperties.scaleY, - shadowColor: RKProperties.shadowColor, - shadowOffset: RKProperties.shadowOffset, - shadowOpacity: RKProperties.shadowOpacity, - shadowRadius: RKProperties.shadowRadius, - size: RKProperties.size, - subscaleXY: RKProperties.subscaleXY, - subtranslationX: RKProperties.subtranslationX, - subtranslationXY: RKProperties.subtranslationXY, - subtranslationY: RKProperties.subtranslationY, - subtranslationZ: RKProperties.subtranslationZ, - translationX: RKProperties.translationX, - translationXY: RKProperties.translationXY, - translationY: RKProperties.translationY, - translationZ: RKProperties.translationZ, + bounds: RCTProperties.bounds, + opacity: RCTProperties.opacity, + position: RCTProperties.position, + positionX: RCTProperties.positionX, + positionY: RCTProperties.positionY, + zPosition: RCTProperties.zPosition, + rotation: RCTProperties.rotation, + rotationX: RCTProperties.rotationX, + rotationY: RCTProperties.rotationY, + scaleX: RCTProperties.scaleX, + scaleXY: RCTProperties.scaleXY, + scaleY: RCTProperties.scaleY, + shadowColor: RCTProperties.shadowColor, + shadowOffset: RCTProperties.shadowOffset, + shadowOpacity: RCTProperties.shadowOpacity, + shadowRadius: RCTProperties.shadowRadius, + size: RCTProperties.size, + subscaleXY: RCTProperties.subscaleXY, + subtranslationX: RCTProperties.subtranslationX, + subtranslationXY: RCTProperties.subtranslationXY, + subtranslationY: RCTProperties.subtranslationY, + subtranslationZ: RCTProperties.subtranslationZ, + translationX: RCTProperties.translationX, + translationXY: RCTProperties.translationXY, + translationY: RCTProperties.translationY, + translationZ: RCTProperties.translationZ, }; var Types = { - decay: RKTypes.decay, - easeIn: RKTypes.easeIn, - easeInEaseOut: RKTypes.easeInEaseOut, - easeOut: RKTypes.easeOut, - linear: RKTypes.linear, - spring: RKTypes.spring, + decay: RCTTypes.decay, + easeIn: RCTTypes.easeIn, + easeInEaseOut: RCTTypes.easeInEaseOut, + easeOut: RCTTypes.easeOut, + linear: RCTTypes.linear, + spring: RCTTypes.spring, }; var POPAnimation = { @@ -98,7 +98,7 @@ var POPAnimation = { ); } - RKPOPAnimationManager.createAnimationInternal(tag, typeName, attrs); + RCTPOPAnimationManager.createAnimationInternal(tag, typeName, attrs); return tag; }, @@ -127,35 +127,35 @@ var POPAnimation = { }, addAnimation: function(nodeHandle, anim, callback) { - RKPOPAnimationManager.addAnimation(nodeHandle, anim, callback); + RCTPOPAnimationManager.addAnimation(nodeHandle, anim, callback); }, removeAnimation: function(nodeHandle, anim) { - RKPOPAnimationManager.removeAnimation(nodeHandle, anim); + RCTPOPAnimationManager.removeAnimation(nodeHandle, anim); }, }; -// Make sure that we correctly propagate RKPOPAnimationManager constants +// Make sure that we correctly propagate RCTPOPAnimationManager constants // to POPAnimation if (__DEV__) { var allProperties = merge( - RKPOPAnimationManager.Properties, - RKPOPAnimationManager.Properties + RCTPOPAnimationManager.Properties, + RCTPOPAnimationManager.Properties ); for (var key in allProperties) { invariant( - POPAnimation.Properties[key] === RKPOPAnimationManager.Properties[key], + POPAnimation.Properties[key] === RCTPOPAnimationManager.Properties[key], 'POPAnimation doesn\'t copy property ' + key + ' correctly' ); } var allTypes = merge( - RKPOPAnimationManager.Types, - RKPOPAnimationManager.Types + RCTPOPAnimationManager.Types, + RCTPOPAnimationManager.Types ); for (var key in allTypes) { invariant( - POPAnimation.Types[key] === RKPOPAnimationManager.Types[key], + POPAnimation.Types[key] === RCTPOPAnimationManager.Types[key], 'POPAnimation doesn\'t copy type ' + key + ' correctly' ); } diff --git a/Libraries/BatchedBridge/BatchedBridgedModules/RCTAlertManager.ios.js b/Libraries/BatchedBridge/BatchedBridgedModules/RCTAlertManager.ios.js new file mode 100644 index 000000000..3621795da --- /dev/null +++ b/Libraries/BatchedBridge/BatchedBridgedModules/RCTAlertManager.ios.js @@ -0,0 +1,10 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule RCTAlertManager + */ +'use strict'; + +var { RCTAlertManager } = require('NativeModules'); + +module.exports = RCTAlertManager; diff --git a/Libraries/BatchedBridge/BatchedBridgedModules/RKAlertManager.ios.js b/Libraries/BatchedBridge/BatchedBridgedModules/RKAlertManager.ios.js deleted file mode 100644 index 39d3cbc27..000000000 --- a/Libraries/BatchedBridge/BatchedBridgedModules/RKAlertManager.ios.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule RKAlertManager - */ -'use strict'; - -var RKAlertManager = require('NativeModulesDeprecated').RKAlertManager; - -module.exports = RKAlertManager; diff --git a/Libraries/BatchedBridge/BatchingImplementation/BatchedBridgeFactory.js b/Libraries/BatchedBridge/BatchingImplementation/BatchedBridgeFactory.js index d6c7f5f3f..a41a13226 100644 --- a/Libraries/BatchedBridge/BatchingImplementation/BatchedBridgeFactory.js +++ b/Libraries/BatchedBridge/BatchingImplementation/BatchedBridgeFactory.js @@ -22,33 +22,6 @@ var MethodTypes = keyMirror({ */ var BatchedBridgeFactory = { MethodTypes: MethodTypes, - /** - * @deprecated: Remove callsites and delete this method. - * - * @param {MessageQueue} messageQueue Message queue that has been created with - * the `moduleConfig` (among others perhaps). - * @param {object} moduleConfig Configuration of module names/method - * names to callback types. - * @return {object} Remote representation of configured module. - */ - _createDeprecatedBridgedModule: function(messageQueue, moduleConfig, moduleName) { - var remoteModule = mapObject(moduleConfig.methods, function(methodConfig, memberName) { - return methodConfig.type === MethodTypes.local ? null : function() { - var lastArg = arguments.length ? arguments[arguments.length - 1] : null; - var hasCB = - typeof lastArg == 'function'; - var args = slice.call(arguments, 0, arguments.length - (hasCB ? 1 : 0)); - var cb = hasCB ? lastArg : null; - return messageQueue.callDeprecated(moduleName, memberName, args, cb); - }; - }); - for (var constName in moduleConfig.constants) { - warning(!remoteModule[constName], 'saw constant and method named %s', constName); - remoteModule[constName] = moduleConfig.constants[constName]; - } - return remoteModule; - }, - /** * @param {MessageQueue} messageQueue Message queue that has been created with * the `moduleConfig` (among others perhaps). @@ -63,14 +36,14 @@ var BatchedBridgeFactory = { var secondLastArg = arguments.length > 1 ? arguments[arguments.length - 2] : null; var hasSuccCB = typeof lastArg === 'function'; var hasErrorCB = typeof secondLastArg === 'function'; - var hasCBs = hasSuccCB; - invariant( - (hasSuccCB && hasErrorCB) || (!hasSuccCB && !hasErrorCB), - 'You must supply error callbacks and success callbacks or neither' + hasErrorCB && invariant( + hasSuccCB, + 'Cannot have a non-function arg after a function arg.' ); - var args = slice.call(arguments, 0, arguments.length - (hasCBs ? 2 : 0)); - var onSucc = hasCBs ? lastArg : null; - var onFail = hasCBs ? secondLastArg : null; + var numCBs = (hasSuccCB ? 1 : 0) + (hasErrorCB ? 1 : 0); + var args = slice.call(arguments, 0, arguments.length - numCBs); + var onSucc = hasSuccCB ? lastArg : null; + var onFail = hasErrorCB ? secondLastArg : null; return messageQueue.call(moduleName, memberName, args, onFail, onSucc); }; }); @@ -92,8 +65,6 @@ var BatchedBridgeFactory = { invokeCallbackAndReturnFlushedQueue: messageQueue.invokeCallbackAndReturnFlushedQueue.bind(messageQueue), flushedQueue: messageQueue.flushedQueue.bind(messageQueue), - // These deprecated modules do not accept an error callback. - RemoteModulesDeprecated: mapObject(modulesConfig, this._createDeprecatedBridgedModule.bind(this, messageQueue)), RemoteModules: mapObject(modulesConfig, this._createBridgedModule.bind(this, messageQueue)), setLoggingEnabled: messageQueue.setLoggingEnabled.bind(messageQueue), getLoggedOutgoingItems: messageQueue.getLoggedOutgoingItems.bind(messageQueue), diff --git a/Libraries/CameraRoll/CameraRoll.js b/Libraries/CameraRoll/CameraRoll.js index 54295fc52..d97fa8ce2 100644 --- a/Libraries/CameraRoll/CameraRoll.js +++ b/Libraries/CameraRoll/CameraRoll.js @@ -6,7 +6,7 @@ 'use strict'; var ReactPropTypes = require('ReactPropTypes'); -var RKCameraRollManager = require('NativeModules').RKCameraRollManager; +var RCTCameraRollManager = require('NativeModules').RCTCameraRollManager; var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker'); var deepFreezeAndThrowOnMutationInDev = @@ -98,7 +98,7 @@ class CameraRoll { typeof tag === 'string', 'CameraRoll.saveImageWithTag tag must be a valid string.' ); - RKCameraRollManager.saveImageWithTag( + RCTCameraRollManager.saveImageWithTag( tag, (imageTag) => { successCallback && successCallback(imageTag); @@ -140,7 +140,7 @@ class CameraRoll { callback(response); }; } - RKCameraRollManager.getPhotos(params, metaCallback, errorCallback); + RCTCameraRollManager.getPhotos(params, metaCallback, errorCallback); } } diff --git a/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js b/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js index df762c5ee..c494e031c 100644 --- a/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js +++ b/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js @@ -53,7 +53,7 @@ var ActivityIndicatorIOS = React.createClass({ render: function() { var style = styles.sizeSmall; - var NativeConstants = NativeModules.RKUIManager.UIActivityIndicatorView.Constants; + var NativeConstants = NativeModules.RCTUIManager.UIActivityIndicatorView.Constants; var activityIndicatorViewStyle = NativeConstants.StyleWhite; if (this.props.size === 'large') { style = styles.sizeLarge; diff --git a/Libraries/Components/DatePicker/DatePickerIOS.ios.js b/Libraries/Components/DatePicker/DatePickerIOS.ios.js index b4a6d5bb1..c45672d65 100644 --- a/Libraries/Components/DatePicker/DatePickerIOS.ios.js +++ b/Libraries/Components/DatePicker/DatePickerIOS.ios.js @@ -3,7 +3,7 @@ * * @providesModule DatePickerIOS * - * This is a controlled component version of RKDatePickerIOS + * This is a controlled component version of RCTDatePickerIOS */ 'use strict'; @@ -11,7 +11,7 @@ var NativeMethodsMixin = require('NativeMethodsMixin'); var PropTypes = require('ReactPropTypes'); var React = require('React'); var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); -var RKDatePickerIOSConsts = require('NativeModules').RKUIManager.RCTDatePicker.Constants; +var RCTDatePickerIOSConsts = require('NativeModules').RCTUIManager.RCTDatePicker.Constants; var StyleSheet = require('StyleSheet'); var View = require('View'); @@ -65,7 +65,7 @@ var DatePickerIOS = React.createClass({ * * Valid modes on iOS are: 'date', 'time', 'datetime'. */ - mode: PropTypes.oneOf(Object.keys(RKDatePickerIOSConsts.DatePickerModes)), + mode: PropTypes.oneOf(Object.keys(RCTDatePickerIOSConsts.DatePickerModes)), /** * The interval at which minutes can be selected. @@ -111,7 +111,7 @@ var DatePickerIOS = React.createClass({ var props = this.props; return ( - + ); }, }); @@ -70,12 +70,12 @@ var NavigatorTransitionerIOS = React.createClass({ /** * Think of `` as simply a component that renders an - * `RKNavigator`, and moves the `RKNavigator`'s `requestedTopOfStack` pointer - * forward and backward. The `RKNavigator` interprets changes in + * `RCTNavigator`, and moves the `RCTNavigator`'s `requestedTopOfStack` pointer + * forward and backward. The `RCTNavigator` interprets changes in * `requestedTopOfStack` to be pushes and pops of children that are rendered. * `` always ensures that whenever the `requestedTopOfStack` * pointer is moved, that we've also rendered enough children so that the - * `RKNavigator` can carry out the push/pop with those children. + * `RCTNavigator` can carry out the push/pop with those children. * `` also removes children that will no longer be needed * (after the pop of a child has been fully completed/animated out). */ @@ -496,7 +496,7 @@ var NavigatorIOS = React.createClass({ return ( - - + ); }, diff --git a/Libraries/Components/ScrollResponder.js b/Libraries/Components/ScrollResponder.js index 4221722bd..b8f4c96c6 100644 --- a/Libraries/Components/ScrollResponder.js +++ b/Libraries/Components/ScrollResponder.js @@ -6,14 +6,14 @@ 'use strict'; var NativeModules = require('NativeModules'); -var NativeModulesDeprecated = require('NativeModulesDeprecated'); +var NativeModules = require('NativeModules'); var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); var Subscribable = require('Subscribable'); var TextInputState = require('TextInputState'); -var RKUIManager = NativeModules.RKUIManager; -var RKUIManagerDeprecated = NativeModulesDeprecated.RKUIManager; -var RKScrollViewConsts = RKUIManager.RCTScrollView.Constants; +var RCTUIManager = NativeModules.RCTUIManager; +var RCTUIManagerDeprecated = NativeModules.RCTUIManager; +var RCTScrollViewConsts = RCTUIManager.RCTScrollView.Constants; var warning = require('warning'); @@ -99,7 +99,7 @@ var IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16; var ScrollResponderMixin = { mixins: [Subscribable.Mixin], - statics: RKScrollViewConsts, + statics: RCTScrollViewConsts, scrollResponderMixinGetInitialState: function() { return { isTouching: false, @@ -336,7 +336,7 @@ var ScrollResponderMixin = { * can also be used to quickly scroll to any element we want to focus */ scrollResponderScrollTo: function(offsetX, offsetY) { - RKUIManagerDeprecated.scrollTo(this.getNodeHandle(), offsetX, offsetY); + RCTUIManagerDeprecated.scrollTo(this.getNodeHandle(), offsetX, offsetY); }, /** @@ -344,7 +344,7 @@ var ScrollResponderMixin = { * @param {object} rect Should have shape {x, y, w, h} */ scrollResponderZoomTo: function(rect) { - RKUIManagerDeprecated.zoomToRect(this.getNodeHandle(), rect); + RCTUIManagerDeprecated.zoomToRect(this.getNodeHandle(), rect); }, /** @@ -354,7 +354,7 @@ var ScrollResponderMixin = { */ scrollResponderScrollNativeHandleToKeyboard: function(nodeHandle, additionalOffset) { this.additionalScrollOffset = additionalOffset || 0; - RKUIManager.measureLayout( + RCTUIManager.measureLayout( nodeHandle, this.getNodeHandle(), this.scrollResponderTextInputFocusError, diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index 4edfeda81..804b6f578 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -8,12 +8,12 @@ var EdgeInsetsPropType = require('EdgeInsetsPropType'); var Platform = require('Platform'); var PointPropType = require('PointPropType'); -var RCTScrollView = require('NativeModules').RKUIManager.RCTScrollView; +var RCTScrollView = require('NativeModules').RCTUIManager.RCTScrollView; var RCTScrollViewConsts = RCTScrollView.Constants; var React = require('React'); var ReactIOSTagHandles = require('ReactIOSTagHandles'); var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); -var RKUIManager = require('NativeModulesDeprecated').RKUIManager; +var RCTUIManager = require('NativeModules').RCTUIManager; var ScrollResponder = require('ScrollResponder'); var StyleSheet = require('StyleSheet'); var StyleSheetPropType = require('StyleSheetPropType'); @@ -182,7 +182,7 @@ var ScrollView = React.createClass({ }, scrollTo: function(destY, destX) { - RKUIManager.scrollTo( + RCTUIManager.scrollTo( this.getNodeHandle(), destX || 0, destY || 0 diff --git a/Libraries/Components/Slider/Slider.js b/Libraries/Components/Slider/Slider.js index 80f631c45..a0be43066 100644 --- a/Libraries/Components/Slider/Slider.js +++ b/Libraries/Components/Slider/Slider.js @@ -60,7 +60,7 @@ var Slider = React.createClass({ render: function() { return ( - resp.network_reachability, - * RKReachability.getCurrentReachability + * RCTReachability.getCurrentReachability * ); * * var myComponent = React.createClass({ diff --git a/Libraries/Components/SwitchIOS/SwitchIOS.ios.js b/Libraries/Components/SwitchIOS/SwitchIOS.ios.js index 391b4da3a..15c0af5aa 100644 --- a/Libraries/Components/SwitchIOS/SwitchIOS.ios.js +++ b/Libraries/Components/SwitchIOS/SwitchIOS.ios.js @@ -3,7 +3,7 @@ * * @providesModule SwitchIOS * - * This is a controlled component version of RKSwitch. + * This is a controlled component version of RCTSwitch. */ 'use strict'; @@ -80,7 +80,7 @@ var SwitchIOS = React.createClass({ render: function() { return ( - + {this.props.children} - + ); } }); @@ -31,6 +31,6 @@ var config = { validAttributes: ReactIOSViewAttributes.UIView, uiViewClassName: 'RCTTabBar', }; -var RKTabBar = createReactIOSNativeComponentClass(config); +var RCTTabBar = createReactIOSNativeComponentClass(config); module.exports = TabBarIOS; diff --git a/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js b/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js index 763be7438..70333d54e 100644 --- a/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js +++ b/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js @@ -58,7 +58,7 @@ var TabBarItemIOS = React.createClass({ } return ( - {tabContents} - + ); } }); @@ -80,7 +80,7 @@ var styles = StyleSheet.create({ } }); -var RKTabBarItem = createReactIOSNativeComponentClass({ +var RCTTabBarItem = createReactIOSNativeComponentClass({ validAttributes: merge(ReactIOSViewAttributes.UIView, { title: true, icon: true, diff --git a/Libraries/Components/TextInput/TextInput.ios.js b/Libraries/Components/TextInput/TextInput.ios.js index e04ed88ee..21ad49f53 100644 --- a/Libraries/Components/TextInput/TextInput.ios.js +++ b/Libraries/Components/TextInput/TextInput.ios.js @@ -8,7 +8,7 @@ var DocumentSelectionState = require('DocumentSelectionState'); var EventEmitter = require('EventEmitter'); var NativeMethodsMixin = require('NativeMethodsMixin'); -var RKUIManager = require('NativeModules').RKUIManager; +var RCTUIManager = require('NativeModules').RCTUIManager; var PropTypes = require('ReactPropTypes'); var React = require('React'); var ReactChildren = require('ReactChildren'); @@ -25,10 +25,10 @@ var getObjectValues = require('getObjectValues'); var invariant = require('invariant'); var merge = require('merge'); -var autoCapitalizeConsts = RKUIManager.UIText.AutocapitalizationType; -var clearButtonModeConsts = RKUIManager.UITextField.clearButtonMode; +var autoCapitalizeConsts = RCTUIManager.UIText.AutocapitalizationType; +var clearButtonModeConsts = RCTUIManager.UITextField.clearButtonMode; -var RKTextViewAttributes = merge(ReactIOSViewAttributes.UIView, { +var RCTTextViewAttributes = merge(ReactIOSViewAttributes.UIView, { autoCorrect: true, autoCapitalize: true, color: true, @@ -42,7 +42,7 @@ var RKTextViewAttributes = merge(ReactIOSViewAttributes.UIView, { text: true, }); -var RKTextFieldAttributes = merge(RKTextViewAttributes, { +var RCTTextFieldAttributes = merge(RCTTextViewAttributes, { caretHidden: true, enabled: true, clearButtonMode: true, @@ -198,7 +198,7 @@ var TextInput = React.createClass({ viewConfig: { uiViewClassName: 'RCTTextField', - validAttributes: RKTextFieldAttributes, + validAttributes: RCTTextFieldAttributes, }, isFocused: function() { @@ -309,7 +309,7 @@ var TextInput = React.createClass({ } } textContainer = - ; + return ; }, }); -var RKView = createReactIOSNativeComponentClass({ - validAttributes: ReactIOSViewAttributes.RKView, +var RCTView = createReactIOSNativeComponentClass({ + validAttributes: ReactIOSViewAttributes.RCTView, uiViewClassName: 'RCTView', }); -RKView.propTypes = View.propTypes; +RCTView.propTypes = View.propTypes; -var ViewToExport = RKView; +var ViewToExport = RCTView; if (__DEV__) { ViewToExport = View; } diff --git a/Libraries/Components/WebView/WebView.android.js b/Libraries/Components/WebView/WebView.android.js index 8190258ae..d153ebe92 100644 --- a/Libraries/Components/WebView/WebView.android.js +++ b/Libraries/Components/WebView/WebView.android.js @@ -16,9 +16,9 @@ var keyMirror = require('keyMirror'); var merge = require('merge'); var PropTypes = React.PropTypes; -var RKUIManager = require('NativeModules').RKUIManager; +var RCTUIManager = require('NativeModules').RCTUIManager; -var RK_WEBVIEW_REF = 'webview'; +var RCT_WEBVIEW_REF = 'webview'; var WebViewState = keyMirror({ IDLE: null, @@ -81,7 +81,7 @@ var WebView = React.createClass({ var webView = { var prettyStack = errorToString(e, map); - RKExceptionsManager.updateExceptionMessage(e.message, prettyStack); + RCTExceptionsManager.updateExceptionMessage(e.message, prettyStack); }) .then(null, error => { GLOBAL.console.error('#CLOWNTOWN (error while displaying error): ' + error.message); @@ -95,7 +95,7 @@ function setupRedBoxErrorHandler() { /** * Sets up a set of window environment wrappers that ensure that the * BatchedBridge is flushed after each tick. In both the case of the - * `UIWebView` based `RKJavaScriptCaller` and `RKContextCaller`, we + * `UIWebView` based `RCTJavaScriptCaller` and `RCTContextCaller`, we * implement our own custom timing bridge that should be immune to * unexplainably dropped timing signals. */ @@ -115,7 +115,7 @@ function setupTimers() { } function setupAlert() { - var RKAlertManager = require('RKAlertManager'); + var { RCTAlertManager } = require('NativeModules'); if (!GLOBAL.alert) { GLOBAL.alert = function(text) { var alertOpts = { @@ -123,7 +123,7 @@ function setupAlert() { message: '' + text, buttons: [{'cancel': 'Okay'}], }; - RKAlertManager.alertWithArgs(alertOpts, null); + RCTAlertManager.alertWithArgs(alertOpts, null); }; } } diff --git a/Libraries/JavaScriptAppEngine/System/JSTimers/JSTimers.js b/Libraries/JavaScriptAppEngine/System/JSTimers/JSTimers.js index 13297ef00..1b25e00c1 100644 --- a/Libraries/JavaScriptAppEngine/System/JSTimers/JSTimers.js +++ b/Libraries/JavaScriptAppEngine/System/JSTimers/JSTimers.js @@ -7,7 +7,7 @@ // Note that the module JSTimers is split into two in order to solve a cycle // in dependencies. NativeModules > BatchedBridge > MessageQueue > JSTimersExecution -var RKTiming = require('NativeModules').RKTiming; +var RCTTiming = require('NativeModules').RCTTiming; var JSTimersExecution = require('JSTimersExecution'); /** @@ -43,7 +43,7 @@ var JSTimers = { return func.apply(undefined, args); }; JSTimersExecution.types[freeIndex] = JSTimersExecution.Type.setTimeout; - RKTiming.createTimer(newID, duration, Date.now(), /** recurring */ false); + RCTTiming.createTimer(newID, duration, Date.now(), /** recurring */ false); return newID; }, @@ -60,7 +60,7 @@ var JSTimers = { return func.apply(undefined, args); }; JSTimersExecution.types[freeIndex] = JSTimersExecution.Type.setInterval; - RKTiming.createTimer(newID, duration, Date.now(), /** recurring */ true); + RCTTiming.createTimer(newID, duration, Date.now(), /** recurring */ true); return newID; }, @@ -90,7 +90,7 @@ var JSTimers = { JSTimersExecution.timerIDs[freeIndex] = newID; JSTimersExecution.callbacks[freeIndex] = func; JSTimersExecution.types[freeIndex] = JSTimersExecution.Type.requestAnimationFrame; - RKTiming.createTimer(newID, 0, Date.now(), /** recurring */ false); + RCTTiming.createTimer(newID, 0, Date.now(), /** recurring */ false); return newID; }, @@ -126,7 +126,7 @@ var JSTimers = { if (index !== -1) { JSTimersExecution._clearIndex(index); if (JSTimersExecution.types[index] !== JSTimersExecution.Type.setImmediate) { - RKTiming.deleteTimer(timerID); + RCTTiming.deleteTimer(timerID); } } }, diff --git a/Libraries/Network/NetInfo.js b/Libraries/Network/NetInfo.js index 59c29cb07..671b064a2 100644 --- a/Libraries/Network/NetInfo.js +++ b/Libraries/Network/NetInfo.js @@ -8,7 +8,7 @@ var NativeModules = require('NativeModules'); var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); -var RKReachability = NativeModules.RKReachability; +var RCTReachability = NativeModules.RCTReachability; var DEVICE_REACHABILITY_EVENT = 'reachabilityDidChange'; @@ -49,7 +49,7 @@ type ChangeEventName = $Enum<{ var NetInfo = {}; -if (RKReachability) { +if (RCTReachability) { var _reachabilitySubscriptions = {}; NetInfo.reachabilityIOS = { @@ -78,7 +78,7 @@ if (RKReachability) { fetch: function(): Promise { return new Promise((resolve, reject) => { - RKReachability.getCurrentReachability( + RCTReachability.getCurrentReachability( (resp) => { resolve(resp.network_reachability); }, diff --git a/Libraries/Network/XMLHttpRequest.ios.js b/Libraries/Network/XMLHttpRequest.ios.js index 042cbe4b9..b747d0bed 100644 --- a/Libraries/Network/XMLHttpRequest.ios.js +++ b/Libraries/Network/XMLHttpRequest.ios.js @@ -6,7 +6,7 @@ */ 'use strict'; -var RKDataManager = require('NativeModulesDeprecated').RKDataManager; +var RCTDataManager = require('NativeModules').RCTDataManager; var crc32 = require('crc32'); @@ -91,7 +91,7 @@ class XMLHttpRequest { } this._sent = true; - RKDataManager.queryData( + RCTDataManager.queryData( 'http', JSON.stringify({ method: this._method, diff --git a/Libraries/Picker/PickerIOS.android.js b/Libraries/Picker/PickerIOS.android.js index 72cc87a75..51103157a 100644 --- a/Libraries/Picker/PickerIOS.android.js +++ b/Libraries/Picker/PickerIOS.android.js @@ -3,7 +3,7 @@ * * @providesModule PickerIOS * - * This is a controlled component version of RKPickerIOS + * This is a controlled component version of RCTPickerIOS */ 'use strict'; diff --git a/Libraries/Picker/PickerIOS.ios.js b/Libraries/Picker/PickerIOS.ios.js index 04559a700..c2d1c2241 100644 --- a/Libraries/Picker/PickerIOS.ios.js +++ b/Libraries/Picker/PickerIOS.ios.js @@ -3,7 +3,7 @@ * * @providesModule PickerIOS * - * This is a controlled component version of RKPickerIOS + * This is a controlled component version of RCTPickerIOS */ 'use strict'; @@ -11,7 +11,7 @@ var NativeMethodsMixin = require('NativeMethodsMixin'); var React = require('React'); var ReactChildren = require('ReactChildren'); var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); -var RKPickerIOSConsts = require('NativeModules').RKUIManager.RCTPicker.Constants; +var RCTPickerIOSConsts = require('NativeModules').RCTUIManager.RCTPicker.Constants; var StyleSheet = require('StyleSheet'); var View = require('View'); @@ -37,7 +37,7 @@ var PickerIOS = React.createClass({ this.setState(this._stateFromProps(nextProps)); }, - // Translate PickerIOS prop and children into stuff that RKPickerIOS understands. + // Translate PickerIOS prop and children into stuff that RCTPickerIOS understands. _stateFromProps: function(props) { var selectedIndex = 0; var items = []; @@ -53,7 +53,7 @@ var PickerIOS = React.createClass({ render: function() { return ( - , rootTag diff --git a/Libraries/Storage/AsyncStorage.ios.js b/Libraries/Storage/AsyncStorage.ios.js index a29288f36..754e59cb1 100644 --- a/Libraries/Storage/AsyncStorage.ios.js +++ b/Libraries/Storage/AsyncStorage.ios.js @@ -6,12 +6,12 @@ */ 'use strict'; -var NativeModules = require('NativeModulesDeprecated'); -var RKAsyncLocalStorage = NativeModules.RKAsyncLocalStorage; -var RKAsyncRocksDBStorage = NativeModules.RKAsyncRocksDBStorage; +var NativeModules = require('NativeModules'); +var RCTAsyncLocalStorage = NativeModules.RCTAsyncLocalStorage; +var RCTAsyncRocksDBStorage = NativeModules.RCTAsyncRocksDBStorage; // We use RocksDB if available. -var RKAsyncStorage = RKAsyncRocksDBStorage || RKAsyncLocalStorage; +var RCTAsyncStorage = RCTAsyncRocksDBStorage || RCTAsyncLocalStorage; /** * AsyncStorage is a simple, asynchronous, persistent, global, key-value storage @@ -33,7 +33,7 @@ var AsyncStorage = { key: string, callback: (error: ?Error, result: ?string) => void ): void { - RKAsyncStorage.multiGet([key], function(errors, result) { + RCTAsyncStorage.multiGet([key], function(errors, result) { // Unpack result to get value from [[key,value]] var value = (result && result[0] && result[0][1]) ? result[0][1] : null; callback((errors && convertError(errors[0])) || null, value); @@ -49,7 +49,7 @@ var AsyncStorage = { value: string, callback: ?(error: ?Error) => void ): void { - RKAsyncStorage.multiSet([[key,value]], function(errors) { + RCTAsyncStorage.multiSet([[key,value]], function(errors) { callback && callback((errors && convertError(errors[0])) || null); }); }, @@ -58,7 +58,7 @@ var AsyncStorage = { key: string, callback: ?(error: ?Error) => void ): void { - RKAsyncStorage.multiRemove([key], function(errors) { + RCTAsyncStorage.multiRemove([key], function(errors) { callback && callback((errors && convertError(errors[0])) || null); }); }, @@ -73,7 +73,7 @@ var AsyncStorage = { value: string, callback: ?(error: ?Error) => void ): void { - RKAsyncStorage.multiMerge([[key,value]], function(errors) { + RCTAsyncStorage.multiMerge([[key,value]], function(errors) { callback && callback((errors && convertError(errors[0])) || null); }); }, @@ -84,7 +84,7 @@ var AsyncStorage = { * own keys instead. */ clear: function(callback: ?(error: ?Error) => void) { - RKAsyncStorage.clear(function(error) { + RCTAsyncStorage.clear(function(error) { callback && callback(convertError(error)); }); }, @@ -93,7 +93,7 @@ var AsyncStorage = { * Gets *all* keys known to the system, for all callers, libraries, etc. */ getAllKeys: function(callback: (error: ?Error) => void) { - RKAsyncStorage.getAllKeys(function(error, keys) { + RCTAsyncStorage.getAllKeys(function(error, keys) { callback(convertError(error), keys); }); }, @@ -118,7 +118,7 @@ var AsyncStorage = { keys: Array, callback: (errors: ?Array, result: ?Array>) => void ): void { - RKAsyncStorage.multiGet(keys, function(errors, result) { + RCTAsyncStorage.multiGet(keys, function(errors, result) { callback( (errors && errors.map((error) => convertError(error))) || null, result @@ -136,7 +136,7 @@ var AsyncStorage = { keyValuePairs: Array>, callback: ?(errors: ?Array) => void ): void { - RKAsyncStorage.multiSet(keyValuePairs, function(errors) { + RCTAsyncStorage.multiSet(keyValuePairs, function(errors) { callback && callback( (errors && errors.map((error) => convertError(error))) || null ); @@ -150,7 +150,7 @@ var AsyncStorage = { keys: Array, callback: ?(errors: ?Array) => void ): void { - RKAsyncStorage.multiRemove(keys, function(errors) { + RCTAsyncStorage.multiRemove(keys, function(errors) { callback && callback( (errors && errors.map((error) => convertError(error))) || null ); @@ -167,7 +167,7 @@ var AsyncStorage = { keyValuePairs: Array>, callback: ?(errors: ?Array) => void ): void { - RKAsyncStorage.multiMerge(keyValuePairs, function(errors) { + RCTAsyncStorage.multiMerge(keyValuePairs, function(errors) { callback && callback( (errors && errors.map((error) => convertError(error))) || null ); @@ -176,7 +176,7 @@ var AsyncStorage = { }; // Not all native implementations support merge. -if (!RKAsyncStorage.multiMerge) { +if (!RCTAsyncStorage.multiMerge) { delete AsyncStorage.mergeItem; delete AsyncStorage.multiMerge; } diff --git a/Libraries/StyleSheet/StyleSheet.js b/Libraries/StyleSheet/StyleSheet.js index cca0f87da..ec771e332 100644 --- a/Libraries/StyleSheet/StyleSheet.js +++ b/Libraries/StyleSheet/StyleSheet.js @@ -5,19 +5,15 @@ */ 'use strict'; -var ImageStylePropTypes = require('ImageStylePropTypes'); -var ReactPropTypeLocations = require('ReactPropTypeLocations'); var StyleSheetRegistry = require('StyleSheetRegistry'); -var TextStylePropTypes = require('TextStylePropTypes'); -var ViewStylePropTypes = require('ViewStylePropTypes'); - -var invariant = require('invariant'); +var StyleSheetValidation = require('StyleSheetValidation'); /** * A StyleSheet is an abstraction similar to CSS StyleSheets * * Create a new StyleSheet: * + * ``` * var styles = StyleSheet.create({ * container: { * borderRadius: 4, @@ -31,21 +27,26 @@ var invariant = require('invariant'); * activeTitle: { * color: 'red', * }, - * }) + * }); + * ``` * * Use a StyleSheet: * + * ``` * * * + * ``` * * Code quality: + * * - By moving styles away from the render function, you're making the code * code easier to understand. * - Naming the styles is a good way to add meaning to the low level components * in the render function. * * Performance: + * * - Making a stylesheet from a style object makes it possible to refer to it * by ID instead of creating a new style object every time. * - It also allows to send the style only once through the bridge. All @@ -55,66 +56,11 @@ class StyleSheet { static create(obj) { var result = {}; for (var key in obj) { - StyleSheet.validateStyle(key, obj); + StyleSheetValidation.validateStyle(key, obj); result[key] = StyleSheetRegistry.registerStyle(obj[key]); } return result; } - - static validateStyleProp(prop, style, caller) { - if (!__DEV__) { - return; - } - if (allStylePropTypes[prop] === undefined) { - var message1 = '"' + prop + '" is not a valid style property.'; - var message2 = '\nValid style props: ' + - JSON.stringify(Object.keys(allStylePropTypes), null, ' '); - styleError(message1, style, caller, message2); - } - var error = allStylePropTypes[prop]( - style, - prop, - caller, - ReactPropTypeLocations.prop - ); - if (error) { - styleError(error.message, style, caller); - } - } - - static validateStyle(name, styles) { - if (!__DEV__) { - return; - } - for (var prop in styles[name]) { - StyleSheet.validateStyleProp(prop, styles[name], 'StyleSheet ' + name); - } - } - - static addValidStylePropTypes(stylePropTypes) { - for (var key in stylePropTypes) { - invariant( - allStylePropTypes[key] === undefined || - allStylePropTypes[key] === stylePropTypes[key], - 'Attemped to redefine existing style prop type "' + key + '".' - ); - allStylePropTypes[key] = stylePropTypes[key]; - } - } } -var styleError = function(message1, style, caller, message2) { - invariant( - false, - message1 + '\n' + (caller || '<>') + ': ' + - JSON.stringify(style, null, ' ') + (message2 || '') - ); -}; - -var allStylePropTypes = {}; - -StyleSheet.addValidStylePropTypes(ImageStylePropTypes); -StyleSheet.addValidStylePropTypes(TextStylePropTypes); -StyleSheet.addValidStylePropTypes(ViewStylePropTypes); - module.exports = StyleSheet; diff --git a/Libraries/StyleSheet/StyleSheetValidation.js b/Libraries/StyleSheet/StyleSheetValidation.js new file mode 100644 index 000000000..694f11d5a --- /dev/null +++ b/Libraries/StyleSheet/StyleSheetValidation.js @@ -0,0 +1,72 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule StyleSheetValidation + */ +'use strict'; + +var ImageStylePropTypes = require('ImageStylePropTypes'); +var ReactPropTypeLocations = require('ReactPropTypeLocations'); +var TextStylePropTypes = require('TextStylePropTypes'); +var ViewStylePropTypes = require('ViewStylePropTypes'); + +var invariant = require('invariant'); + +class StyleSheetValidation { + static validateStyleProp(prop, style, caller) { + if (!__DEV__) { + return; + } + if (allStylePropTypes[prop] === undefined) { + var message1 = '"' + prop + '" is not a valid style property.'; + var message2 = '\nValid style props: ' + + JSON.stringify(Object.keys(allStylePropTypes), null, ' '); + styleError(message1, style, caller, message2); + } + var error = allStylePropTypes[prop]( + style, + prop, + caller, + ReactPropTypeLocations.prop + ); + if (error) { + styleError(error.message, style, caller); + } + } + + static validateStyle(name, styles) { + if (!__DEV__) { + return; + } + for (var prop in styles[name]) { + StyleSheetValidation.validateStyleProp(prop, styles[name], 'StyleSheet ' + name); + } + } + + static addValidStylePropTypes(stylePropTypes) { + for (var key in stylePropTypes) { + invariant( + allStylePropTypes[key] === undefined || + allStylePropTypes[key] === stylePropTypes[key], + 'Attemped to redefine existing style prop type "' + key + '".' + ); + allStylePropTypes[key] = stylePropTypes[key]; + } + } +} + +var styleError = function(message1, style, caller, message2) { + invariant( + false, + message1 + '\n' + (caller || '<>') + ': ' + + JSON.stringify(style, null, ' ') + (message2 || '') + ); +}; + +var allStylePropTypes = {}; + +StyleSheetValidation.addValidStylePropTypes(ImageStylePropTypes); +StyleSheetValidation.addValidStylePropTypes(TextStylePropTypes); +StyleSheetValidation.addValidStylePropTypes(ViewStylePropTypes); + +module.exports = StyleSheetValidation; diff --git a/Libraries/Text/RCTTextManager.m b/Libraries/Text/RCTTextManager.m index 80f350fea..2a0ed3db7 100644 --- a/Libraries/Text/RCTTextManager.m +++ b/Libraries/Text/RCTTextManager.m @@ -23,6 +23,8 @@ return [[RCTShadowText alloc] init]; } +#pragma mark - View properties + RCT_REMAP_VIEW_PROPERTY(containerBackgroundColor, backgroundColor) RCT_CUSTOM_VIEW_PROPERTY(numberOfLines, RCTText) { @@ -34,6 +36,8 @@ RCT_CUSTOM_VIEW_PROPERTY(numberOfLines, RCTText) view.lineBreakMode = truncationMode; } +#pragma mark - Shadow properties + RCT_CUSTOM_SHADOW_PROPERTY(backgroundColor, RCTShadowText) { view.textBackgroundColor = json ? [RCTConvert UIColor:json] : defaultView.textBackgroundColor; diff --git a/Libraries/Text/Text.js b/Libraries/Text/Text.js index 6171ecbde..5d4efcd5c 100644 --- a/Libraries/Text/Text.js +++ b/Libraries/Text/Text.js @@ -184,12 +184,12 @@ var Text = React.createClass({ props.onResponderMove = this.handleResponderMove; props.onResponderRelease = this.handleResponderRelease; props.onResponderTerminate = this.handleResponderTerminate; - return ; + return ; }, }); var PRESS_RECT_OFFSET = {top: 20, left: 20, right: 20, bottom: 30}; -var RKText = createReactIOSNativeComponentClass(viewConfig); +var RCTText = createReactIOSNativeComponentClass(viewConfig); module.exports = Text; diff --git a/Libraries/Utilities/AlertIOS.js b/Libraries/Utilities/AlertIOS.js index ee0bb2d0b..bbbdc8981 100644 --- a/Libraries/Utilities/AlertIOS.js +++ b/Libraries/Utilities/AlertIOS.js @@ -6,9 +6,7 @@ */ 'use strict'; -var NativeModules = require('NativeModulesDeprecated'); - -var RCTAlertManager = NativeModules.RCTAlertManager; +var { RCTAlertManager } = require('NativeModules'); var DEFAULT_BUTTON_TEXT = 'OK'; var DEFAULT_BUTTON = { diff --git a/Libraries/Utilities/Dimensions.js b/Libraries/Utilities/Dimensions.js index 97e8d2d01..d33515799 100644 --- a/Libraries/Utilities/Dimensions.js +++ b/Libraries/Utilities/Dimensions.js @@ -9,7 +9,7 @@ var NativeModules = require('NativeModules'); var invariant = require('invariant'); -var dimensions = NativeModules.RKUIManager.Dimensions; +var dimensions = NativeModules.RCTUIManager.Dimensions; class Dimensions { /** diff --git a/Libraries/Utilities/MessageQueue.js b/Libraries/Utilities/MessageQueue.js index c5cba0525..1a487d56f 100644 --- a/Libraries/Utilities/MessageQueue.js +++ b/Libraries/Utilities/MessageQueue.js @@ -415,28 +415,6 @@ var MessageQueueMixin = { return ret; }, - callDeprecated: function(moduleName, methodName, params, cb, scope) { - invariant( - !cb || typeof cb === 'function', - 'Last argument (callback) must be function' - ); - // Store callback _before_ sending the request, just in case the MailBox - // returns the response in a blocking manner - if (cb) { - this._storeCallbacksInCurrentThread(null, cb, scope, this._POOLED_CBIDS); - params.push(this._POOLED_CBIDS.successCallbackID); - } - var moduleID = this._remoteModuleNameToModuleID[moduleName]; - if (moduleID === undefined || moduleID === null) { - throw new Error('Unrecognized module name:' + moduleName); - } - var methodID = this._remoteModuleNameToMethodNameToID[moduleName][methodName]; - if (methodID === undefined || moduleID === null) { - throw new Error('Unrecognized method name:' + methodName); - } - this._pushRequestToOutgoingItems(moduleID, methodID, params); - }, - call: function(moduleName, methodName, params, onFail, onSucc, scope) { invariant( (!onFail || typeof onFail === 'function') && @@ -445,9 +423,9 @@ var MessageQueueMixin = { ); // Store callback _before_ sending the request, just in case the MailBox // returns the response in a blocking manner. - if (onFail || onSucc) { + if (onSucc) { this._storeCallbacksInCurrentThread(onFail, onSucc, scope, this._POOLED_CBIDS); - params.push(this._POOLED_CBIDS.errorCallbackID); + onFail && params.push(this._POOLED_CBIDS.errorCallbackID); params.push(this._POOLED_CBIDS.successCallbackID); } var moduleID = this._remoteModuleNameToModuleID[moduleName]; diff --git a/Libraries/Utilities/nativeModulePrefixDuplicator.js b/Libraries/Utilities/nativeModulePrefixDuplicator.js new file mode 100644 index 000000000..fb2951612 --- /dev/null +++ b/Libraries/Utilities/nativeModulePrefixDuplicator.js @@ -0,0 +1,25 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule nativeModulePrefixDuplicator + */ +'use strict'; + +// Dirty hack to support old (RK) and new (RCT) native module name conventions +function nativeModulePrefixDuplicator(modules) { + Object.keys(modules).forEach((moduleName) => { + var rkModuleName = moduleName.replace(/^RCT/, 'RK'); + var rctModuleName = moduleName.replace(/^RK/, 'RCT'); + if (rkModuleName !== rctModuleName) { + if (modules[rkModuleName] && modules[rctModuleName]) { + throw new Error( + 'Module cannot be registered as both RCT and RK: ' + moduleName + ); + } + modules[rkModuleName] = modules[moduleName]; + modules[rctModuleName] = modules[moduleName]; + } + }); +} + +module.exports = nativeModulePrefixDuplicator; diff --git a/Libraries/Vibration/RCTVibration.h b/Libraries/Vibration/RCTVibration.h new file mode 100644 index 000000000..fe499acee --- /dev/null +++ b/Libraries/Vibration/RCTVibration.h @@ -0,0 +1,7 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTBridgeModule.h" + +@interface RCTVibration : NSObject + +@end diff --git a/Libraries/Vibration/RCTVibration.m b/Libraries/Vibration/RCTVibration.m new file mode 100644 index 000000000..e0e8e63be --- /dev/null +++ b/Libraries/Vibration/RCTVibration.m @@ -0,0 +1,15 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTVibration.h" + +#import + +@implementation RCTVibration + +- (void)vibrate +{ + RCT_EXPORT(); + AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); +} + +@end diff --git a/Libraries/Vibration/RCTVibration.xcodeproj/project.pbxproj b/Libraries/Vibration/RCTVibration.xcodeproj/project.pbxproj new file mode 100644 index 000000000..efd86976e --- /dev/null +++ b/Libraries/Vibration/RCTVibration.xcodeproj/project.pbxproj @@ -0,0 +1,248 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 832C819C1AAF6E1A007FA2F7 /* RCTVibration.m in Sources */ = {isa = PBXBuildFile; fileRef = 832C819B1AAF6E1A007FA2F7 /* RCTVibration.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 832C817E1AAF6DEF007FA2F7 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 832C81801AAF6DEF007FA2F7 /* libRCTVibration.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTVibration.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 832C819A1AAF6E1A007FA2F7 /* RCTVibration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTVibration.h; sourceTree = ""; }; + 832C819B1AAF6E1A007FA2F7 /* RCTVibration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTVibration.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 832C817D1AAF6DEF007FA2F7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 832C81771AAF6DEF007FA2F7 = { + isa = PBXGroup; + children = ( + 832C819A1AAF6E1A007FA2F7 /* RCTVibration.h */, + 832C819B1AAF6E1A007FA2F7 /* RCTVibration.m */, + 832C81811AAF6DEF007FA2F7 /* Products */, + ); + sourceTree = ""; + }; + 832C81811AAF6DEF007FA2F7 /* Products */ = { + isa = PBXGroup; + children = ( + 832C81801AAF6DEF007FA2F7 /* libRCTVibration.a */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 832C817F1AAF6DEF007FA2F7 /* RCTVibration */ = { + isa = PBXNativeTarget; + buildConfigurationList = 832C81941AAF6DF0007FA2F7 /* Build configuration list for PBXNativeTarget "RCTVibration" */; + buildPhases = ( + 832C817C1AAF6DEF007FA2F7 /* Sources */, + 832C817D1AAF6DEF007FA2F7 /* Frameworks */, + 832C817E1AAF6DEF007FA2F7 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RCTVibration; + productName = RCTVibration; + productReference = 832C81801AAF6DEF007FA2F7 /* libRCTVibration.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 832C81781AAF6DEF007FA2F7 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0620; + ORGANIZATIONNAME = Facebook; + TargetAttributes = { + 832C817F1AAF6DEF007FA2F7 = { + CreatedOnToolsVersion = 6.2; + }; + }; + }; + buildConfigurationList = 832C817B1AAF6DEF007FA2F7 /* Build configuration list for PBXProject "RCTVibration" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 832C81771AAF6DEF007FA2F7; + productRefGroup = 832C81811AAF6DEF007FA2F7 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 832C817F1AAF6DEF007FA2F7 /* RCTVibration */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 832C817C1AAF6DEF007FA2F7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 832C819C1AAF6E1A007FA2F7 /* RCTVibration.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 832C81921AAF6DF0007FA2F7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 832C81931AAF6DF0007FA2F7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 832C81951AAF6DF0007FA2F7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 832C81961AAF6DF0007FA2F7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 832C817B1AAF6DEF007FA2F7 /* Build configuration list for PBXProject "RCTVibration" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 832C81921AAF6DF0007FA2F7 /* Debug */, + 832C81931AAF6DF0007FA2F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 832C81941AAF6DF0007FA2F7 /* Build configuration list for PBXNativeTarget "RCTVibration" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 832C81951AAF6DF0007FA2F7 /* Debug */, + 832C81961AAF6DF0007FA2F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 832C81781AAF6DEF007FA2F7 /* Project object */; +} diff --git a/Libraries/Vibration/VibrationIOS.android.js b/Libraries/Vibration/VibrationIOS.android.js new file mode 100644 index 000000000..0828d35c1 --- /dev/null +++ b/Libraries/Vibration/VibrationIOS.android.js @@ -0,0 +1,18 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * Stub of VibrationIOS for Android. + * + * @providesModule VibrationIOS + */ +'use strict'; + +var warning = require('warning'); + +var VibrationIOS = { + vibrate: function() { + warning('VibrationIOS is not supported on this platform!'); + } +}; + +module.exports = VibrationIOS; diff --git a/Libraries/Vibration/VibrationIOS.ios.js b/Libraries/Vibration/VibrationIOS.ios.js new file mode 100644 index 000000000..054d6c81e --- /dev/null +++ b/Libraries/Vibration/VibrationIOS.ios.js @@ -0,0 +1,32 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule VibrationIOS + */ +'use strict'; + +var {RCTVibration} = require('NativeModules'); +var invariant = require('invariant'); + +/** + * The Vibration API is exposed at `VibrationIOS.vibrate()`. On iOS, calling this + * function will trigger a one second vibration. The vibration is asynchronous + * so this method will return immediately. + * + * There will be no effect on devices that do not support Vibration, eg. the iOS + * simulator. + * + * Vibration patterns are currently unsupported. + */ + +var VibrationIOS = { + vibrate: function() { + invariant( + arguments[0] === undefined, + 'Vibration patterns not supported.' + ); + RCTVibration.vibrate(); + } +}; + +module.exports = VibrationIOS; diff --git a/Libraries/react-native/react-native.js b/Libraries/react-native/react-native.js index 5e164b5fc..cda4a3014 100644 --- a/Libraries/react-native/react-native.js +++ b/Libraries/react-native/react-native.js @@ -38,6 +38,7 @@ var ReactNative = { TouchableHighlight: require('TouchableHighlight'), TouchableOpacity: require('TouchableOpacity'), TouchableWithoutFeedback: require('TouchableWithoutFeedback'), + VibrationIOS: require('VibrationIOS'), View: require('View'), WebView: require('WebView'), invariant: require('invariant'), diff --git a/ReactKit/Base/RCTConvert.h b/ReactKit/Base/RCTConvert.h index d4baaf19a..3c1afaad7 100644 --- a/ReactKit/Base/RCTConvert.h +++ b/ReactKit/Base/RCTConvert.h @@ -36,6 +36,7 @@ + (NSTextAlignment)NSTextAlignment:(id)json; + (NSWritingDirection)NSWritingDirection:(id)json; ++ (UITextAutocapitalizationType)UITextAutocapitalizationType:(id)json; + (UIKeyboardType)UIKeyboardType:(id)json; + (CGFloat)CGFloat:(id)json; diff --git a/ReactKit/Base/RCTRedBox.m b/ReactKit/Base/RCTRedBox.m index 1d037cd4f..1c70394fd 100644 --- a/ReactKit/Base/RCTRedBox.m +++ b/ReactKit/Base/RCTRedBox.m @@ -85,10 +85,9 @@ - (void)showErrorMessage:(NSString *)message withStack:(NSArray *)stack showIfHidden:(BOOL)shouldShow { - _lastStackTrace = stack; - _lastErrorMessage = message; - if (self.hidden && shouldShow) { + _lastStackTrace = stack; + _lastErrorMessage = message; _cachedMessageCell = [self reuseCell:nil forErrorMessage:message]; [_stackTraceTableView reloadData]; diff --git a/ReactKit/Modules/RCTUIManager.m b/ReactKit/Modules/RCTUIManager.m index 98b10dfa0..93090e2c1 100644 --- a/ReactKit/Modules/RCTUIManager.m +++ b/ReactKit/Modules/RCTUIManager.m @@ -718,7 +718,7 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView } RCTShadowView *shadowView = [manager shadowView]; - shadowView.moduleName = viewName; + shadowView.viewName = viewName; shadowView.reactTag = reactTag; RCTSetShadowViewProps(props, shadowView, _defaultShadowViews[viewName], manager); _shadowViewRegistry[shadowView.reactTag] = shadowView; @@ -973,8 +973,7 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView NSMutableArray *results = [[NSMutableArray alloc] initWithCapacity:[childShadowViews count]]; CGRect layoutRect = [RCTConvert CGRect:rect]; - for (int ii = 0; ii < [childShadowViews count]; ii++) { - RCTShadowView *childShadowView = [childShadowViews objectAtIndex:ii]; + [childShadowViews enumerateObjectsUsingBlock:^(RCTShadowView *childShadowView, NSUInteger idx, BOOL *stop) { CGRect childLayout = [RCTShadowView measureLayout:childShadowView relativeTo:shadowView]; if (CGRectIsNull(childLayout)) { RCTLogError(@"View %@ (tag #%@) is not a decendant of %@ (tag #%@)", @@ -992,7 +991,7 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView topOffset <= layoutRect.origin.y + layoutRect.size.height && topOffset + height >= layoutRect.origin.y) { // This view is within the layout rect - NSDictionary *result = @{@"index": @(ii), + NSDictionary *result = @{@"index": @(idx), @"left": @(leftOffset), @"top": @(topOffset), @"width": @(width), @@ -1000,7 +999,7 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView [results addObject:result]; } - } + }]; callback(@[results]); } diff --git a/ReactKit/Views/RCTShadowView.h b/ReactKit/Views/RCTShadowView.h index f869ca614..3b961fac6 100644 --- a/ReactKit/Views/RCTShadowView.h +++ b/ReactKit/Views/RCTShadowView.h @@ -2,8 +2,8 @@ #import -#import "Layout.h" -#import "RCTUIManager.h" +#import "../Layout/Layout.h" + #import "RCTViewNodeProtocol.h" @class RCTSparseArray; @@ -31,7 +31,7 @@ typedef void (^RCTApplierBlock)(RCTSparseArray *); @property (nonatomic, weak, readonly) RCTShadowView *superview; @property (nonatomic, assign, readonly) css_node_t *cssNode; -@property (nonatomic, copy) NSString *moduleName; +@property (nonatomic, copy) NSString *viewName; @property (nonatomic, assign) BOOL isBGColorExplicitlySet; // Used to propagate to children @property (nonatomic, strong) UIColor *backgroundColor; // Used to propagate to children @property (nonatomic, assign) RCTUpdateLifecycle layoutLifecycle; @@ -54,6 +54,9 @@ typedef void (^RCTApplierBlock)(RCTSparseArray *); */ @property (nonatomic, assign) CGFloat top; @property (nonatomic, assign) CGFloat left; +@property (nonatomic, assign) CGFloat bottom; +@property (nonatomic, assign) CGFloat right; + @property (nonatomic, assign) CGFloat width; @property (nonatomic, assign) CGFloat height; @property (nonatomic, assign) CGRect frame; @@ -66,8 +69,8 @@ typedef void (^RCTApplierBlock)(RCTSparseArray *); */ @property (nonatomic, assign) CGFloat borderTop; @property (nonatomic, assign) CGFloat borderLeft; -@property (nonatomic, assign) CGFloat borderWidth; -@property (nonatomic, assign) CGFloat borderHeight; +@property (nonatomic, assign) CGFloat borderBottom; +@property (nonatomic, assign) CGFloat borderRight; - (void)setBorderWidth:(CGFloat)value; diff --git a/ReactKit/Views/RCTShadowView.m b/ReactKit/Views/RCTShadowView.m index 62d38249e..d28495b4c 100644 --- a/ReactKit/Views/RCTShadowView.m +++ b/ReactKit/Views/RCTShadowView.m @@ -44,7 +44,7 @@ typedef enum { static void RCTPrint(void *context) { RCTShadowView *shadowView = (__bridge RCTShadowView *)context; - printf("%s(%zd), ", [[shadowView moduleName] UTF8String], [[shadowView reactTag] integerValue]); + printf("%s(%zd), ", shadowView.viewName.UTF8String, shadowView.reactTag.integerValue); } static css_node_t *RCTGetChild(void *context, int i) @@ -132,12 +132,13 @@ static void RCTProcessMetaProps(const float metaProps[META_PROP_COUNT], float st RCTRoundPixelValue(absolutePosition.y + node->layout.position[CSS_TOP] + node->layout.dimensions[CSS_HEIGHT]) }; - CGRect frame = { + CGRect frame = {{ RCTRoundPixelValue(node->layout.position[CSS_LEFT]), RCTRoundPixelValue(node->layout.position[CSS_TOP]), + }, { RCTRoundPixelValue(absoluteBottomRight.x - absoluteTopLeft.x), RCTRoundPixelValue(absoluteBottomRight.y - absoluteTopLeft.y) - }; + }}; if (!CGRectEqualToRect(frame, _frame)) { _frame = frame; diff --git a/ReactKit/Views/RCTTextFieldManager.m b/ReactKit/Views/RCTTextFieldManager.m index 40a46e100..9576935b9 100644 --- a/ReactKit/Views/RCTTextFieldManager.m +++ b/ReactKit/Views/RCTTextFieldManager.m @@ -2,6 +2,7 @@ #import "RCTTextFieldManager.h" +#import "RCTBridge.h" #import "RCTConvert.h" #import "RCTShadowView.h" #import "RCTSparseArray.h" @@ -16,20 +17,24 @@ RCT_EXPORT_VIEW_PROPERTY(caretHidden) RCT_EXPORT_VIEW_PROPERTY(autoCorrect) -RCT_REMAP_VIEW_PROPERTY(autoCapitalize, autocapitalizationType) RCT_EXPORT_VIEW_PROPERTY(enabled) RCT_EXPORT_VIEW_PROPERTY(placeholder) RCT_EXPORT_VIEW_PROPERTY(text) RCT_EXPORT_VIEW_PROPERTY(clearButtonMode) RCT_EXPORT_VIEW_PROPERTY(keyboardType) RCT_REMAP_VIEW_PROPERTY(color, textColor) +RCT_CUSTOM_VIEW_PROPERTY(autoCapitalize, RCTTextField) +{ + view.autocapitalizationType = json ? [RCTConvert UITextAutocapitalizationType:json] + : defaultView.autocapitalizationType; +} RCT_CUSTOM_VIEW_PROPERTY(fontSize, RCTTextField) { view.font = [RCTConvert UIFont:view.font withSize:json ?: @(defaultView.font.pointSize)]; } RCT_CUSTOM_VIEW_PROPERTY(fontWeight, RCTTextField) { - view.font = [RCTConvert UIFont:view.font withWeight:json]; // TODO + view.font = [RCTConvert UIFont:view.font withWeight:json]; // TODO: default value } RCT_CUSTOM_VIEW_PROPERTY(fontFamily, RCTTextField) { diff --git a/ReactKit/Views/RCTViewManager.m b/ReactKit/Views/RCTViewManager.m index 011f66f24..151f72cfe 100644 --- a/ReactKit/Views/RCTViewManager.m +++ b/ReactKit/Views/RCTViewManager.m @@ -62,7 +62,7 @@ return nil; } -// View properties +#pragma mark - View properties RCT_EXPORT_VIEW_PROPERTY(accessibilityLabel) RCT_EXPORT_VIEW_PROPERTY(hidden) @@ -110,7 +110,7 @@ RCT_CUSTOM_VIEW_PROPERTY(pointerEvents, RCTView) } } -// ShadowView properties +#pragma mark - ShadowView properties RCT_CUSTOM_SHADOW_PROPERTY(backgroundColor, RCTShadowView) { From 55598f913caef4e7c8a7cd47e9ec354f6aeb2dde Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Tue, 17 Mar 2015 20:41:06 -0700 Subject: [PATCH 57/79] [website] Expose all the functions exported by react-native in the docs --- website/server/extractDocs.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/server/extractDocs.js b/website/server/extractDocs.js index 301e390e7..cf3c9e75c 100644 --- a/website/server/extractDocs.js +++ b/website/server/extractDocs.js @@ -54,19 +54,24 @@ var components = [ '../Libraries/Components/Touchable/TouchableOpacity.js', '../Libraries/Components/Touchable/TouchableWithoutFeedback.js', '../Libraries/Components/View/View.js', + '../Libraries/Components/WebView/WebView.ios.js', ]; var apis = [ + '../Libraries/Utilities/AlertIOS.js', '../Libraries/Animation/Animation.js', '../Libraries/AppRegistry/AppRegistry.js', '../Libraries/AppState/AppState.js', '../Libraries/AppStateIOS/AppStateIOS.ios.js', '../Libraries/Storage/AsyncStorage.ios.js', '../Libraries/CameraRoll/CameraRoll.js', + '../Libraries/Interaction/InteractionManager.js', '../Libraries/Animation/LayoutAnimation.js', + '../Libraries/Network/NetInfo.js', '../Libraries/Utilities/PixelRatio.js', '../Libraries/Components/StatusBar/StatusBarIOS.ios.js', '../Libraries/StyleSheet/StyleSheet.js', + '../Libraries/Vibration/VibrationIOS.ios.js', ]; var all = components.concat(apis); From e1143dea9bab3ba56236e6e756283bd40f8a07d2 Mon Sep 17 00:00:00 2001 From: Spencer Ahrens Date: Tue, 17 Mar 2015 21:12:13 -0700 Subject: [PATCH 58/79] Add IntegrationTests to travis CI. --- .travis.yml | 12 +- .../contents.xcworkspacedata | 7 ++ .../xcschemes/IntegrationTests.xcscheme | 110 ++++++++++++++++++ ReactKit/ReactKit.xcodeproj/project.pbxproj | 5 +- build.sh | 14 +++ 5 files changed, 140 insertions(+), 8 deletions(-) create mode 100644 IntegrationTests/IntegrationTests.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 IntegrationTests/IntegrationTests.xcodeproj/xcshareddata/xcschemes/IntegrationTests.xcscheme create mode 100755 build.sh diff --git a/.travis.yml b/.travis.yml index d5f4e59e4..4d290f162 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,15 @@ language: objective-c -xcode_project: Examples/UIExplorer/UIExplorer.xcodeproj -xcode_scheme: UIExplorer -xcode_sdk: iphonesimulator8.1 +before_install: + - brew update + - brew reinstall xctool install: - npm install - npm test - -# Automatically publish the website -after_success: '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && (cd website; npm install; ./setup.sh; ./publish.sh; echo) || echo' env: - secure: "g8Xjbslq4R+3oLVgBvXM5QhiJ+7q+H+dH4+sXReyyZ64M5gf32U7oOjQNVkdx79dnGFc6a619otGsX4RiEkQlkiR+4uCgJUIgPwN4YFCIgYu4Z/0FnbbRu5yyywh5zv4WwGmAtMkgGztoMBnps5gCiPUM/RGIqwVk0Ghbmh5c2k=" +script: ./build.sh 8.1 +# Automatically publish the website +after_success: '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && (cd website; npm install; ./setup.sh; ./publish.sh; echo) || echo' branches: only: - master diff --git a/IntegrationTests/IntegrationTests.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/IntegrationTests/IntegrationTests.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..d698e9ecd --- /dev/null +++ b/IntegrationTests/IntegrationTests.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/IntegrationTests/IntegrationTests.xcodeproj/xcshareddata/xcschemes/IntegrationTests.xcscheme b/IntegrationTests/IntegrationTests.xcodeproj/xcshareddata/xcschemes/IntegrationTests.xcscheme new file mode 100644 index 000000000..8c75e37ee --- /dev/null +++ b/IntegrationTests/IntegrationTests.xcodeproj/xcshareddata/xcschemes/IntegrationTests.xcscheme @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ReactKit/ReactKit.xcodeproj/project.pbxproj b/ReactKit/ReactKit.xcodeproj/project.pbxproj index d00c6b2c8..3e9607e25 100644 --- a/ReactKit/ReactKit.xcodeproj/project.pbxproj +++ b/ReactKit/ReactKit.xcodeproj/project.pbxproj @@ -387,7 +387,7 @@ isa = PBXNativeTarget; buildConfigurationList = 83CBBA3F1A601D0F00E9B192 /* Build configuration list for PBXNativeTarget "ReactKit" */; buildPhases = ( - 006B79A01A781F38006873D1 /* ShellScript */, + 006B79A01A781F38006873D1 /* Launch Packager */, 83CBBA2A1A601D0E00E9B192 /* Sources */, 83CBBA2B1A601D0E00E9B192 /* Frameworks */, 83CBBA2C1A601D0E00E9B192 /* Copy Files */, @@ -434,13 +434,14 @@ /* End PBXProject section */ /* Begin PBXShellScriptBuildPhase section */ - 006B79A01A781F38006873D1 /* ShellScript */ = { + 006B79A01A781F38006873D1 /* Launch Packager */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); + name = "Launch Packager"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..ed68320c2 --- /dev/null +++ b/build.sh @@ -0,0 +1,14 @@ +#!/bin/sh +xctool \ + -project IntegrationTests/IntegrationTests.xcodeproj \ + -scheme IntegrationTests \ + -sdk iphonesimulator8.1 \ + -destination "platform=iOS Simulator,OS=${1},name=iPhone 5" \ + build test + +xctool \ + -project Examples/UIExplorer/UIExplorer.xcodeproj \ + -scheme UIExplorer \ + -sdk iphonesimulator8.1 \ + -destination "platform=iOS Simulator,OS=${1},name=iPhone 5" \ + build test From cdcaaa2f6bb4cf39fc0802b418c14674d172c1e8 Mon Sep 17 00:00:00 2001 From: Alexander Kotliarskyi Date: Wed, 18 Mar 2015 10:35:49 -0700 Subject: [PATCH 59/79] Travis: fail build early if tests fail --- build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.sh b/build.sh index ed68320c2..22b332a13 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,7 @@ #!/bin/sh + +set -e + xctool \ -project IntegrationTests/IntegrationTests.xcodeproj \ -scheme IntegrationTests \ From 06a87bec25d7184269ef95d5190ef63ce77f0942 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Wed, 18 Mar 2015 15:57:49 -0700 Subject: [PATCH 60/79] Updates from Wed 18 Mar - [ReactNative] Add AsyncStorageTest | Spencer Ahrens - [ReactNative] Add timers integration test | Spencer Ahrens - [ReactNative] Remove ExpandingText | Tadeu Zagallo - [TouchableHighlight] Preserve underlay style when restoring inactive props | Christopher Chedeau - clean flow errors in react-native-github | Basil Hosmer - [ReactNative] Sort React Native exports into two groups, Components and APIs | Christopher Chedeau - [ReactNative] Rename Slider to SliderIOS | Tadeu Zagallo - [react_native] JS files from D1919491: Improve JS logging | Martin Kosiba - [ReactNative] Add TimerExample | Spencer Ahrens - [RFC][ReactNative] increase timer resolution | Spencer Ahrens - [ReactNative] Strip prefixes from NativeModules keys | Spencer Ahrens - [ReactNative] Small docs cleanup in ActivityIndicatorIOS and DatePickerIOS | Christopher Chedeau - [ReactNative] Improvements on perf measurement output | Jing Chen - [ReactNative] Clean up Touchable PropTypes | Christopher Chedeau - [ReactKit] Fail tests when redbox shows up | Alex Kotliarskyi --- .flowconfig | 5 +- Examples/2048/Game2048.js | 5 + Examples/Movies/MovieScreen.js | 8 +- Examples/UIExplorer/CameraRollExample.ios.js | 4 +- Examples/UIExplorer/ExpandingTextExample.js | 52 ----- Examples/UIExplorer/ListViewPagingExample.js | 4 +- .../{SliderExample.js => SliderIOSExample.js} | 8 +- Examples/UIExplorer/TimerExample.js | 193 ++++++++++++++++++ .../UIExplorer.xcodeproj/project.pbxproj.rej | 72 +++++++ Examples/UIExplorer/UIExplorerList.js | 4 +- .../UIExplorerTests/UIExplorerTests.m | 8 +- IntegrationTests/AsyncStorageTest.js | 148 ++++++++++++++ .../IntegrationTestHarnessTest.js | 2 +- IntegrationTests/IntegrationTestsApp.js | 2 + .../IntegrationTestsTests.m | 10 + IntegrationTests/TimersTest.js | 150 ++++++++++++++ Libraries/ActionSheetIOS/ActionSheetIOS.js | 2 +- Libraries/AdSupport/AdSupportIOS.js | 2 +- Libraries/Animation/Animation.js | 2 +- Libraries/Animation/AnimationMixin.js | 2 +- Libraries/Animation/LayoutAnimation.js | 2 +- Libraries/Animation/POPAnimationMixin.js | 7 +- Libraries/AppState/AppState.js | 2 +- Libraries/AppStateIOS/AppStateIOS.ios.js | 2 +- .../BatchedBridgedModules/NativeModules.js | 4 +- .../BatchedBridgedModules/POPAnimation.js | 2 +- .../RCTAlertManager.ios.js | 2 +- Libraries/CameraRoll/CameraRoll.js | 2 +- .../ActivityIndicatorIOS.ios.js | 7 +- .../DatePicker/DatePickerIOS.ios.js | 8 +- Libraries/Components/ListView/ListView.js | 2 +- .../Components/ListView/ListViewDataSource.js | 12 +- .../Components/Navigation/NavigatorIOS.ios.js | 2 +- Libraries/Components/ScrollResponder.js | 4 +- Libraries/Components/ScrollView/ScrollView.js | 4 +- .../Slider.js => SliderIOS/SliderIOS.js} | 6 +- .../Components/StatusBar/StatusBarIOS.ios.js | 2 +- .../Components/TextInput/TextInput.ios.js | 2 +- .../Components/TextInput/TextInputState.js | 2 +- .../Touchable/TouchableFeedbackPropType.js | 22 -- .../Touchable/TouchableHighlight.js | 14 +- .../Components/Touchable/TouchableOpacity.js | 4 +- .../Touchable/TouchableWithoutFeedback.js | 12 +- .../Components/WebView/WebView.android.js | 2 +- Libraries/Components/WebView/WebView.ios.js | 2 +- Libraries/Geolocation/Geolocation.ios.js | 2 +- Libraries/Image/Image.ios.js | 2 +- .../InitializeJavaScriptAppEngine.js | 4 +- .../Initialization/loadSourceMap.js | 2 +- .../System/JSTimers/JSTimers.js | 4 +- Libraries/Network/NetInfo.js | 2 +- Libraries/Network/XMLHttpRequest.ios.js | 2 +- Libraries/Picker/PickerIOS.ios.js | 2 +- Libraries/RKBackendNode/queryLayoutByID.js | 2 +- .../ReactIOS/IOSNativeBridgeEventPlugin.js | 2 +- Libraries/ReactIOS/NativeMethodsMixin.js | 4 +- Libraries/ReactIOS/ReactIOSDOMIDOperations.js | 2 +- .../ReactIOSGlobalResponderHandler.js | 2 +- Libraries/ReactIOS/ReactIOSMount.js | 2 +- Libraries/ReactIOS/ReactIOSNativeComponent.js | 2 +- Libraries/ReactIOS/ReactIOSTextComponent.js | 2 +- Libraries/Storage/AsyncStorage.ios.js | 4 +- Libraries/Text/ExpandingText.js | 130 ------------ Libraries/Utilities/AlertIOS.js | 2 +- Libraries/Utilities/Dimensions.js | 2 +- Libraries/Utilities/PushNotificationIOS.js | 2 +- Libraries/Utilities/RCTRenderingPerf.js | 13 ++ .../Utilities/nativeModulePrefixDuplicator.js | 25 --- .../Utilities/nativeModulePrefixNormalizer.js | 24 +++ Libraries/Vibration/VibrationIOS.ios.js | 3 +- Libraries/react-native/addons.js | 2 + .../react-native/react-native-interface.js | 1 - Libraries/react-native/react-native.js | 41 ++-- ReactKit/Modules/RCTTiming.m | 6 + .../haste/polyfills/console.js | 62 +++--- 75 files changed, 795 insertions(+), 373 deletions(-) delete mode 100644 Examples/UIExplorer/ExpandingTextExample.js rename Examples/UIExplorer/{SliderExample.js => SliderIOSExample.js} (90%) create mode 100644 Examples/UIExplorer/TimerExample.js create mode 100644 Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj.rej create mode 100644 IntegrationTests/AsyncStorageTest.js create mode 100644 IntegrationTests/TimersTest.js rename Libraries/Components/{Slider/Slider.js => SliderIOS/SliderIOS.js} (95%) delete mode 100644 Libraries/Components/Touchable/TouchableFeedbackPropType.js delete mode 100644 Libraries/Text/ExpandingText.js delete mode 100644 Libraries/Utilities/nativeModulePrefixDuplicator.js create mode 100644 Libraries/Utilities/nativeModulePrefixNormalizer.js diff --git a/.flowconfig b/.flowconfig index 20bb68756..82d818dcc 100644 --- a/.flowconfig +++ b/.flowconfig @@ -9,7 +9,7 @@ # Ignore react-tools where there are overlaps, but don't ignore anything that # react-native relies on -.*/node_modules/react-tools/src/vendor/.* +.*/node_modules/react-tools/src/vendor/core/ExecutionEnvironment.js .*/node_modules/react-tools/src/browser/.* .*/node_modules/react-tools/src/core/ReactInstanceHandles.js .*/node_modules/react-tools/src/event/.* @@ -17,9 +17,6 @@ # Ignore jest .*/react-native/node_modules/jest-cli/.* -# Ignore Libraries -.*/Libraries/.* - [include] [libs] diff --git a/Examples/2048/Game2048.js b/Examples/2048/Game2048.js index e6b7fa6d4..f4ad51b41 100644 --- a/Examples/2048/Game2048.js +++ b/Examples/2048/Game2048.js @@ -129,11 +129,16 @@ class GameEndOverlay extends React.Component { } class Game2048 extends React.Component { + startX: number; + startY: number; + constructor(props) { super(props); this.state = { board: new GameBoard(), }; + this.startX = 0; + this.startY = 0; } restartGame() { diff --git a/Examples/Movies/MovieScreen.js b/Examples/Movies/MovieScreen.js index 53c8879dc..8584d8753 100644 --- a/Examples/Movies/MovieScreen.js +++ b/Examples/Movies/MovieScreen.js @@ -6,7 +6,6 @@ var React = require('react-native'); var { - ExpandingText, Image, PixelRatio, ScrollView, @@ -40,10 +39,9 @@ var MovieScreen = React.createClass({ - + + {this.props.movie.synopsis} + diff --git a/Examples/UIExplorer/CameraRollExample.ios.js b/Examples/UIExplorer/CameraRollExample.ios.js index 31634d583..7be014a33 100644 --- a/Examples/UIExplorer/CameraRollExample.ios.js +++ b/Examples/UIExplorer/CameraRollExample.ios.js @@ -7,7 +7,7 @@ var React = require('react-native'); var { CameraRoll, Image, - Slider, + SliderIOS, StyleSheet, SwitchIOS, Text, @@ -35,7 +35,7 @@ var CameraRollExample = React.createClass({ onValueChange={this._onSwitchChange} value={this.state.bigImages} /> {(this.state.bigImages ? 'Big' : 'Small') + ' Images'} - diff --git a/Examples/UIExplorer/ExpandingTextExample.js b/Examples/UIExplorer/ExpandingTextExample.js deleted file mode 100644 index 2a2f61fc8..000000000 --- a/Examples/UIExplorer/ExpandingTextExample.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Copyright 2004-present Facebook. All Rights Reserved. - */ -'use strict'; - -var React = require('react-native'); -var { - ExpandingText -} = React; - -var LOREM = 'Lorem ipsum dolor sit amet, mea adipisci inimicus ex, paulo essent bonorum et ius, rebum deserunt mediocritatem ius ei.'; - -exports.title = ''; -exports.description = 'Base component for rendering text that is truncated and can be expanded upon tap.'; -exports.examples = [ -{ - title: 'Expanding text (truncLength=20)', - description: 'Setting the truncLength prop will cause the text to truncate to that character length', - render: function() { - return ; - } -}, { - title: 'Expanding text (truncLength=80)', - description: 'The higher the truncLength the more characters that will be shown by default', - render: function() { - return ; - } -}, { - title: 'Expanding text with custom style', - description: 'You can style the text within the ExpandingText component', - render: function() { - return ( - - ); - } -}, { - title: 'See More button with custom style' , - description: 'You can also style just the See More button', - render: function() { - return ( - - ); - } -}]; diff --git a/Examples/UIExplorer/ListViewPagingExample.js b/Examples/UIExplorer/ListViewPagingExample.js index c74795eb5..0eec2700c 100644 --- a/Examples/UIExplorer/ListViewPagingExample.js +++ b/Examples/UIExplorer/ListViewPagingExample.js @@ -99,11 +99,11 @@ var ListViewPagingExample = React.createClass({ }; }, - renderRow: function(rowData, sectionID, rowID) { + renderRow: function(rowData: string, sectionID: string, rowID: string): ReactElement { return (); }, - renderSectionHeader: function(sectionData, sectionID) { + renderSectionHeader: function(sectionData: string, sectionID: string) { return ( diff --git a/Examples/UIExplorer/SliderExample.js b/Examples/UIExplorer/SliderIOSExample.js similarity index 90% rename from Examples/UIExplorer/SliderExample.js rename to Examples/UIExplorer/SliderIOSExample.js index d1ff73779..bc58ccec7 100644 --- a/Examples/UIExplorer/SliderExample.js +++ b/Examples/UIExplorer/SliderIOSExample.js @@ -5,7 +5,7 @@ var React = require('react-native'); var { - Slider, + SliderIOS, Text, StyleSheet, View, @@ -24,7 +24,7 @@ var SliderExample = React.createClass({ {this.state.value} - this.setState({value: value})} /> @@ -45,11 +45,11 @@ var styles = StyleSheet.create({ }, }); -exports.title = ''; +exports.title = ''; exports.description = 'Slider input for numeric values'; exports.examples = [ { - title: 'Slider', + title: 'SliderIOS', render() { return ; } } ]; diff --git a/Examples/UIExplorer/TimerExample.js b/Examples/UIExplorer/TimerExample.js new file mode 100644 index 000000000..6d48738d4 --- /dev/null +++ b/Examples/UIExplorer/TimerExample.js @@ -0,0 +1,193 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + */ +'use strict'; + +var React = require('react-native'); +var { + AlertIOS, + StyleSheet, + Text, + TimerMixin, + TouchableHighlight, + View, +} = React; + +var Button = React.createClass({ + render: function() { + return ( + + + {this.props.children} + + + ); + }, +}); + +var TimerTester = React.createClass({ + mixins: [TimerMixin], + + render: function() { + var args = 'fn' + (this.props.dt !== undefined ? ', ' + this.props.dt : ''); + return ( + + ); + }, + + _run: function() { + if (!this._start) { + var d = new Date(); + this._start = d.getTime(); + this._iters = 100; + this._ii = 0; + if (this.props.type === 'setTimeout') { + if (this.props.dt < 1) { + this._iters = 5000; + } else if (this.props.dt > 20) { + this._iters = 10; + } + this._timerFn = () => this.setTimeout(this._run, this.props.dt); + } else if (this.props.type === 'requestAnimationFrame') { + this._timerFn = () => this.requestAnimationFrame(this._run); + } else if (this.props.type === 'setImmediate') { + this._iters = 5000; + this._timerFn = () => this.setImmediate(this._run); + } else if (this.props.type === 'setInterval') { + this._iters = 30; // Only used for forceUpdate periodicidy + this._timerFn = null; + this._handle = this.setInterval(this._run, this.props.dt); + } + } + if (this._ii >= this._iters && !this._handle) { + var d = new Date(); + var e = (d.getTime() - this._start); + var msg = 'Finished ' + this._ii + ' ' + this.props.type + ' calls.\n' + + 'Elapsed time: ' + e + ' ms\n' + (e / this._ii) + ' ms / iter'; + console.log(msg); + AlertIOS.alert(msg); + this._start = null; + this.forceUpdate(() => { this._ii = 0; }); + return; + } + this._ii++; + // Only re-render occasionally so we don't slow down timers. + if (this._ii % (this._iters / 5) === 0) { + this.forceUpdate(); + } + this._timerFn && this._timerFn(); + }, + + clear: function() { + this.clearInterval(this._handle); // invalid handles are ignored + if (this._handle) { + // Configure things so we can do a final run to update UI and reset state. + this._handle = null; + this._iters = this._ii; + this._run(); + } + }, +}); + +var styles = StyleSheet.create({ + button: { + borderColor: 'gray', + borderRadius: 8, + borderWidth: 1, + padding: 10, + margin: 5, + alignItems: 'center', + justifyContent: 'center', + }, +}); + +exports.framework = 'React'; +exports.title = 'Timers, TimerMixin'; +exports.description = 'The TimerMixin provides timer functions for executing ' + + 'code in the future that are safely cleaned up when the component unmounts.'; + +exports.examples = [ + { + title: 'this.setTimeout(fn, t)', + description: 'Execute function fn t milliseconds in the future. If ' + + 't === 0, it will be enqueued immediately in the next event loop. ' + + 'Larger values will fire on the closest frame.', + render: function() { + return ( + + + + + + ); + }, + }, + { + title: 'this.requestAnimationFrame(fn)', + description: 'Execute function fn on the next frame.', + render: function() { + return ( + + + + ); + }, + }, + { + title: 'this.setImmediate(fn)', + description: 'Execute function fn at the end of the current JS event loop.', + render: function() { + return ( + + + + ); + }, + }, + { + title: 'this.setInterval(fn, t)', + description: 'Execute function fn every t milliseconds until cancelled ' + + 'or component is unmounted.', + render: function() { + var IntervalExample = React.createClass({ + getInitialState: function() { + return { + showTimer: true, + }; + }, + + render: function() { + if (this.state.showTimer) { + var timer = + ; + var toggleText = 'Unmount timer'; + } else { + var timer = null; + var toggleText = 'Mount new timer'; + } + return ( + + {timer} + + + + ); + }, + + _toggleTimer: function() { + this.setState({showTimer: !this.state.showTimer}); + }, + }); + return ; + }, + }, +]; diff --git a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj.rej b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj.rej new file mode 100644 index 000000000..fa002c8b0 --- /dev/null +++ b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj.rej @@ -0,0 +1,72 @@ +diff a/Libraries/FBReactKit/js/react-native-github/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj b/Libraries/FBReactKit/js/react-native-github/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj (rejected hunks) +@@ -19,6 +19,7 @@ + 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; + 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 147CED4C1AB3532B00DA3E4C /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 147CED4B1AB34F8C00DA3E4C /* libRCTActionSheet.a */; }; ++ D85B829E1AB6D5D7003F4FE2 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D85B829C1AB6D5CE003F4FE2 /* libRCTVibration.a */; }; + /* End PBXBuildFile section */ + + /* Begin PBXContainerItemProxy section */ +@@ -78,6 +79,13 @@ + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RCTActionSheet; + }; ++ D85B829B1AB6D5CE003F4FE2 /* PBXContainerItemProxy */ = { ++ isa = PBXContainerItemProxy; ++ containerPortal = D85B82911AB6D5CE003F4FE2 /* RCTVibration.xcodeproj */; ++ proxyType = 2; ++ remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; ++ remoteInfo = RCTVibration; ++ }; + /* End PBXContainerItemProxy section */ + + /* Begin PBXFileReference section */ +@@ -98,6 +106,7 @@ + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 14E0EEC81AB118F7000DECC3 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = ../../Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj; sourceTree = ""; }; ++ D85B82911AB6D5CE003F4FE2 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = ../../Libraries/Vibration/RCTVibration.xcodeproj; sourceTree = ""; }; + /* End PBXFileReference section */ + + /* Begin PBXFrameworksBuildPhase section */ +@@ -112,6 +121,7 @@ + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( ++ D85B829E1AB6D5D7003F4FE2 /* libRCTVibration.a in Frameworks */, + 147CED4C1AB3532B00DA3E4C /* libRCTActionSheet.a in Frameworks */, + 134454601AAFCABD003F0779 /* libRCTAdSupport.a in Frameworks */, + 134A8A2A1AACED7A00945AAE /* libRCTGeolocation.a in Frameworks */, +@@ -145,6 +155,7 @@ + 1316A21D1AA397F400C0188E /* Libraries */ = { + isa = PBXGroup; + children = ( ++ D85B82911AB6D5CE003F4FE2 /* RCTVibration.xcodeproj */, + 14E0EEC81AB118F7000DECC3 /* RCTActionSheet.xcodeproj */, + 13417FFA1AA91531003F314A /* ReactKit.xcodeproj */, + 134454551AAFCAAE003F0779 /* RCTAdSupport.xcodeproj */, +@@ -334,6 +353,10 @@ + ProjectRef = 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */; + }, + { ++ ProductGroup = D85B82921AB6D5CE003F4FE2 /* Products */; ++ ProjectRef = D85B82911AB6D5CE003F4FE2 /* RCTVibration.xcodeproj */; ++ }, ++ { + ProductGroup = 13417FFB1AA91531003F314A /* Products */; + ProjectRef = 13417FFA1AA91531003F314A /* ReactKit.xcodeproj */; + }, +@@ -396,6 +419,13 @@ + remoteRef = 147CED4A1AB34F8C00DA3E4C /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; ++ D85B829C1AB6D5CE003F4FE2 /* libRCTVibration.a */ = { ++ isa = PBXReferenceProxy; ++ fileType = archive.ar; ++ path = libRCTVibration.a; ++ remoteRef = D85B829B1AB6D5CE003F4FE2 /* PBXContainerItemProxy */; ++ sourceTree = BUILT_PRODUCTS_DIR; ++ }; + /* End PBXReferenceProxy section */ + + /* Begin PBXResourcesBuildPhase section */ diff --git a/Examples/UIExplorer/UIExplorerList.js b/Examples/UIExplorer/UIExplorerList.js index bc46292fd..08558971f 100644 --- a/Examples/UIExplorer/UIExplorerList.js +++ b/Examples/UIExplorer/UIExplorerList.js @@ -20,8 +20,8 @@ var EXAMPLES = [ require('./ViewExample'), require('./LayoutExample'), require('./TextExample.ios'), + require('./TimerExample'), require('./TextInputExample'), - require('./ExpandingTextExample'), require('./ImageExample'), require('./ListViewSimpleExample'), require('./ListViewPagingExample'), @@ -36,7 +36,7 @@ var EXAMPLES = [ require('./GeolocationExample'), require('./TabBarExample'), require('./SwitchExample'), - require('./SliderExample'), + require('./SliderIOSExample'), require('./AsyncStorageExample'), require('./CameraRollExample.ios'), require('./MapViewExample'), diff --git a/Examples/UIExplorer/UIExplorerTests/UIExplorerTests.m b/Examples/UIExplorer/UIExplorerTests/UIExplorerTests.m index 237270f67..854ee445a 100644 --- a/Examples/UIExplorer/UIExplorerTests/UIExplorerTests.m +++ b/Examples/UIExplorer/UIExplorerTests/UIExplorerTests.m @@ -3,6 +3,8 @@ #import #import +#import "RCTRedBox.h" + #define TIMEOUT_SECONDS 240 @interface UIExplorerTests : XCTestCase @@ -29,11 +31,14 @@ NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; BOOL foundElement = NO; + NSString *redboxError = nil; - while ([date timeIntervalSinceNow] > 0 && !foundElement) { + while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:date]; [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:date]; + redboxError = [[RCTRedBox sharedInstance] currentErrorMessage]; + foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { if ([view respondsToSelector:@selector(attributedText)]) { NSString *text = [(id)view attributedText].string; @@ -45,6 +50,7 @@ }]; } + XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); XCTAssertTrue(foundElement, @"Cound't find element with '' text in %d seconds", TIMEOUT_SECONDS); } diff --git a/IntegrationTests/AsyncStorageTest.js b/IntegrationTests/AsyncStorageTest.js new file mode 100644 index 000000000..82fb348b2 --- /dev/null +++ b/IntegrationTests/AsyncStorageTest.js @@ -0,0 +1,148 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + */ +'use strict'; + +var RCTTestModule = require('NativeModules').TestModule; +var React = require('react-native'); +var { + AsyncStorage, + Text, + View, +} = React; + +var DEBUG = false; + +var KEY_1 = 'key_1'; +var VAL_1 = 'val_1'; +var KEY_2 = 'key_2'; +var VAL_2 = 'val_2'; + +// setup in componentDidMount +var done; +var updateMessage; + +function runTestCase(description, fn) { + updateMessage(description); + fn(); +} + +function expectTrue(condition, message) { + if (!condition) { + throw new Error(message); + } +} + +function expectEqual(lhs, rhs, testname) { + expectTrue( + lhs === rhs, + 'Error in test ' + testname + ': expected ' + rhs + ', got ' + lhs + ); +} + +function expectAsyncNoError(err) { + expectTrue(err === null, 'Unexpected Async error: ' + JSON.stringify(err)); +} + +function testSetAndGet() { + AsyncStorage.setItem(KEY_1, VAL_1, (err1) => { + expectAsyncNoError(err1); + AsyncStorage.getItem(KEY_1, (err2, result) => { + expectAsyncNoError(err2); + expectEqual(result, VAL_1, 'testSetAndGet setItem'); + updateMessage('get(key_1) correctly returned ' + result); + runTestCase('should get null for missing key', testMissingGet); + }); + }); +} + +function testMissingGet() { + AsyncStorage.getItem(KEY_2, (err, result) => { + expectAsyncNoError(err); + expectEqual(result, null, 'testMissingGet'); + updateMessage('missing get(key_2) correctly returned ' + result); + runTestCase('check set twice results in a single key', testSetTwice); + }); +} + +function testSetTwice() { + AsyncStorage.setItem(KEY_1, VAL_1, ()=>{ + AsyncStorage.setItem(KEY_1, VAL_1, ()=>{ + AsyncStorage.getItem(KEY_1, (err, result) => { + expectAsyncNoError(err); + expectEqual(result, VAL_1, 'testSetTwice'); + updateMessage('setTwice worked as expected'); + runTestCase('test removeItem', testRemoveItem); + }); + }); + }); +} + +function testRemoveItem() { + AsyncStorage.setItem(KEY_1, VAL_1, ()=>{ + AsyncStorage.setItem(KEY_2, VAL_2, ()=>{ + AsyncStorage.getAllKeys((err, result) => { + expectAsyncNoError(err); + expectTrue( + result.indexOf(KEY_1) >= 0 && result.indexOf(KEY_2) >= 0, + 'Missing KEY_1 or KEY_2 in ' + '(' + result + ')' + ); + updateMessage('testRemoveItem - add two items'); + AsyncStorage.removeItem(KEY_1, (err) => { + expectAsyncNoError(err); + updateMessage('delete successful '); + AsyncStorage.getItem(KEY_1, (err, result) => { + expectAsyncNoError(err); + expectEqual( + result, + null, + 'testRemoveItem: key_1 present after delete' + ); + updateMessage('key properly removed '); + AsyncStorage.getAllKeys((err, result2) => { + expectAsyncNoError(err); + expectTrue( + result2.indexOf(KEY_1) === -1, + 'Unexpected: KEY_1 present in ' + result2 + ); + updateMessage('proper length returned.\nDone!'); + done(); + }); + }); + }); + }); + }); + }); +} + +var AsyncStorageTest = React.createClass({ + getInitialState() { + return { + messages: 'Initializing...', + done: false, + }; + }, + + componentDidMount() { + done = () => this.setState({done: true}, RCTTestModule.markTestCompleted); + updateMessage = (msg) => { + this.setState({messages: this.state.messages.concat('\n' + msg)}); + DEBUG && console.log(msg); + }; + AsyncStorage.clear(testSetAndGet); + }, + + render() { + return ( + + + {this.constructor.displayName + ': '} + {this.state.done ? 'Done' : 'Testing...'} + {'\n\n' + this.state.messages} + + + ); + } +}); + +module.exports = AsyncStorageTest; diff --git a/IntegrationTests/IntegrationTestHarnessTest.js b/IntegrationTests/IntegrationTestHarnessTest.js index 5b6e78838..5ae78cf9c 100644 --- a/IntegrationTests/IntegrationTestHarnessTest.js +++ b/IntegrationTests/IntegrationTestHarnessTest.js @@ -3,7 +3,7 @@ */ 'use strict'; -var RCTTestModule = require('NativeModules').RCTTestModule; +var RCTTestModule = require('NativeModules').TestModule; var React = require('react-native'); var { Text, diff --git a/IntegrationTests/IntegrationTestsApp.js b/IntegrationTests/IntegrationTestsApp.js index ee60aa388..30464bbcc 100644 --- a/IntegrationTests/IntegrationTestsApp.js +++ b/IntegrationTests/IntegrationTestsApp.js @@ -18,6 +18,8 @@ var { var TESTS = [ require('./IntegrationTestHarnessTest'), + require('./TimersTest'), + require('./AsyncStorageTest'), ]; TESTS.forEach( diff --git a/IntegrationTests/IntegrationTestsTests/IntegrationTestsTests.m b/IntegrationTests/IntegrationTestsTests/IntegrationTestsTests.m index 9d9020f7d..4cb894480 100644 --- a/IntegrationTests/IntegrationTestsTests/IntegrationTestsTests.m +++ b/IntegrationTests/IntegrationTestsTests/IntegrationTestsTests.m @@ -37,4 +37,14 @@ expectErrorRegex:[NSRegularExpression regularExpressionWithPattern:@"because shouldThrow" options:0 error:nil]]; } +- (void)testTimers +{ + [_runner runTest:@"TimersTest"]; +} + +- (void)testAsyncStorage +{ + [_runner runTest:@"AsyncStorageTest"]; +} + @end diff --git a/IntegrationTests/TimersTest.js b/IntegrationTests/TimersTest.js new file mode 100644 index 000000000..db376304b --- /dev/null +++ b/IntegrationTests/TimersTest.js @@ -0,0 +1,150 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + */ +'use strict'; + +var RCTTestModule = require('NativeModules').TestModule; +var React = require('react-native'); +var { + StyleSheet, + Text, + TimerMixin, + View, +} = React; + +var TimersTest = React.createClass({ + mixins: [TimerMixin], + + getInitialState() { + return { + count: 0, + done: false, + }; + }, + + componentDidMount() { + this.testSetTimeout0(); + }, + + testSetTimeout0() { + this.setTimeout(this.testSetTimeout1, 0); + }, + + testSetTimeout1() { + this.setTimeout(this.testSetTimeout50, 1); + }, + + testSetTimeout50() { + this.setTimeout(this.testRequestAnimationFrame, 50); + }, + + testRequestAnimationFrame() { + this.requestAnimationFrame(this.testSetInterval0); + }, + + testSetInterval0() { + this._nextTest = this.testSetInterval20; + this._interval = this.setInterval(this._incrementInterval, 0); + }, + + testSetInterval20() { + this._nextTest = this.testSetImmediate; + this._interval = this.setInterval(this._incrementInterval, 20); + }, + + testSetImmediate() { + this.setImmediate(this.testClearTimeout0); + }, + + testClearTimeout0() { + var timeout = this.setTimeout(() => this._fail('testClearTimeout0'), 0); + this.clearTimeout(timeout); + this.testClearTimeout30(); + }, + + testClearTimeout30() { + var timeout = this.setTimeout(() => this._fail('testClearTimeout30'), 30); + this.clearTimeout(timeout); + this.setTimeout(this.testClearMulti, 50); + }, + + testClearMulti() { + var fails = [this.setTimeout(() => this._fail('testClearMulti-1'), 20)]; + fails.push(this.setTimeout(() => this._fail('testClearMulti-2'), 50)); + var delayClear = this.setTimeout(() => this._fail('testClearMulti-3'), 50); + fails.push(this.setTimeout(() => this._fail('testClearMulti-4'), 0)); + + this.setTimeout(this.testOrdering, 100); // Next test interleaved + + fails.push(this.setTimeout(() => this._fail('testClearMulti-5'), 10)); + + fails.forEach((timeout) => this.clearTimeout(timeout)); + this.setTimeout(() => this.clearTimeout(delayClear), 20); + }, + + testOrdering() { + // Clear timers are set first because it's more likely to uncover bugs. + var fail0; + this.setImmediate(() => this.clearTimeout(fail0)); + fail0 = this.setTimeout( + () => this._fail('testOrdering-t0, setImmediate should happen before ' + + 'setTimeout 0'), + 0 + ); + var failAnim; // This should fail without the t=0 fastpath feature. + this.setTimeout(() => this.cancelAnimationFrame(failAnim), 0); + failAnim = this.requestAnimationFrame( + () => this._fail('testOrdering-Anim, setTimeout 0 should happen before ' + + 'requestAnimationFrame') + ); + var fail50; + this.setTimeout(() => this.clearTimeout(fail50), 20); + fail50 = this.setTimeout( + () => this._fail('testOrdering-t50, setTimeout 20 should happen before ' + + 'setTimeout 50'), + 50 + ); + this.setTimeout(this.done, 75); + }, + + done() { + this.setState({done: true}, RCTTestModule.markTestCompleted); + }, + + render() { + return ( + + + {this.constructor.displayName + ': \n'} + Intervals: {this.state.count + '\n'} + {this.state.done ? 'Done' : 'Testing...'} + + + ); + }, + + _incrementInterval() { + if (this.state.count > 3) { + throw new Error('interval incremented past end.'); + } + if (this.state.count === 3) { + this.clearInterval(this._interval); + this.setState({count: 0}, this._nextTest); + return; + } + this.setState({count: this.state.count + 1}); + }, + + _fail(caller) { + throw new Error('_fail called by ' + caller); + }, +}); + +var styles = StyleSheet.create({ + container: { + backgroundColor: 'white', + padding: 40, + }, +}); + +module.exports = TimersTest; diff --git a/Libraries/ActionSheetIOS/ActionSheetIOS.js b/Libraries/ActionSheetIOS/ActionSheetIOS.js index 5a24f06b0..adbb8e3ab 100644 --- a/Libraries/ActionSheetIOS/ActionSheetIOS.js +++ b/Libraries/ActionSheetIOS/ActionSheetIOS.js @@ -5,7 +5,7 @@ */ 'use strict'; -var { RCTActionSheetManager } = require('NativeModules'); +var RCTActionSheetManager = require('NativeModules').ActionSheetManager; var invariant = require('invariant'); diff --git a/Libraries/AdSupport/AdSupportIOS.js b/Libraries/AdSupport/AdSupportIOS.js index c0a081aa4..a470f05cd 100644 --- a/Libraries/AdSupport/AdSupportIOS.js +++ b/Libraries/AdSupport/AdSupportIOS.js @@ -5,7 +5,7 @@ */ 'use strict'; -var AdSupport = require('NativeModules').RCTAdSupport; +var AdSupport = require('NativeModules').AdSupport; module.exports = { getAdvertisingId: function(onSuccess, onFailure) { diff --git a/Libraries/Animation/Animation.js b/Libraries/Animation/Animation.js index 30624266d..3fbfb757f 100644 --- a/Libraries/Animation/Animation.js +++ b/Libraries/Animation/Animation.js @@ -6,7 +6,7 @@ */ 'use strict'; -var { RCTAnimationManager } = require('NativeModules'); +var RCTAnimationManager = require('NativeModules').AnimationManager; var AnimationUtils = require('AnimationUtils'); type EasingFunction = (t: number) => number; diff --git a/Libraries/Animation/AnimationMixin.js b/Libraries/Animation/AnimationMixin.js index 56f63fb8e..c33d630a9 100644 --- a/Libraries/Animation/AnimationMixin.js +++ b/Libraries/Animation/AnimationMixin.js @@ -7,7 +7,7 @@ 'use strict'; var AnimationUtils = require('AnimationUtils'); -var { RCTAnimationManager } = require('NativeModules'); +var RCTAnimationManager = require('NativeModules').AnimationManager; var invariant = require('invariant'); diff --git a/Libraries/Animation/LayoutAnimation.js b/Libraries/Animation/LayoutAnimation.js index a5adc567b..16f737ba3 100644 --- a/Libraries/Animation/LayoutAnimation.js +++ b/Libraries/Animation/LayoutAnimation.js @@ -6,7 +6,7 @@ 'use strict'; var PropTypes = require('ReactPropTypes'); -var RCTUIManager = require('NativeModules').RCTUIManager; +var RCTUIManager = require('NativeModules').UIManager; var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker'); var keyMirror = require('keyMirror'); diff --git a/Libraries/Animation/POPAnimationMixin.js b/Libraries/Animation/POPAnimationMixin.js index a3f4b7def..49145ebd4 100644 --- a/Libraries/Animation/POPAnimationMixin.js +++ b/Libraries/Animation/POPAnimationMixin.js @@ -7,10 +7,11 @@ 'use strict'; var POPAnimation = require('POPAnimation'); + if (!POPAnimation) { // POP animation isn't available in the OSS fork - this is a temporary // workaround to enable its availability to be determined at runtime. - module.exports = null; + module.exports = (null : ?{}); } else { var invariant = require('invariant'); @@ -224,12 +225,10 @@ var POPAnimationMixin = { w: frame.width, h: frame.height }; - frame = undefined; - var velocity = velocity || [0, 0]; var posAnim = POPAnimation.createAnimation(type, { property: POPAnimation.Properties.position, toValue: [animFrame.x, animFrame.y], - velocity: velocity, + velocity: velocity || [0, 0], }); var sizeAnim = POPAnimation.createAnimation(type, { property: POPAnimation.Properties.size, diff --git a/Libraries/AppState/AppState.js b/Libraries/AppState/AppState.js index 47834936a..043cdba55 100644 --- a/Libraries/AppState/AppState.js +++ b/Libraries/AppState/AppState.js @@ -6,7 +6,7 @@ 'use strict'; var NativeModules = require('NativeModules'); -var RCTAppState = NativeModules.RCTAppState; +var RCTAppState = NativeModules.AppState; var AppState = { diff --git a/Libraries/AppStateIOS/AppStateIOS.ios.js b/Libraries/AppStateIOS/AppStateIOS.ios.js index 1f6bca95b..9b3e44472 100644 --- a/Libraries/AppStateIOS/AppStateIOS.ios.js +++ b/Libraries/AppStateIOS/AppStateIOS.ios.js @@ -7,7 +7,7 @@ var NativeModules = require('NativeModules'); var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); -var RCTAppState = NativeModules.RCTAppState; +var RCTAppState = NativeModules.AppState; var logError = require('logError'); diff --git a/Libraries/BatchedBridge/BatchedBridgedModules/NativeModules.js b/Libraries/BatchedBridge/BatchedBridgedModules/NativeModules.js index f8029f8b8..be36f8663 100644 --- a/Libraries/BatchedBridge/BatchedBridgedModules/NativeModules.js +++ b/Libraries/BatchedBridge/BatchedBridgedModules/NativeModules.js @@ -7,8 +7,8 @@ var NativeModules = require('BatchedBridge').RemoteModules; -var nativeModulePrefixDuplicator = require('nativeModulePrefixDuplicator'); +var nativeModulePrefixNormalizer = require('nativeModulePrefixNormalizer'); -nativeModulePrefixDuplicator(NativeModules); +nativeModulePrefixNormalizer(NativeModules); module.exports = NativeModules; diff --git a/Libraries/BatchedBridge/BatchedBridgedModules/POPAnimation.js b/Libraries/BatchedBridge/BatchedBridgedModules/POPAnimation.js index 3195e3ee1..97158ecfa 100644 --- a/Libraries/BatchedBridge/BatchedBridgedModules/POPAnimation.js +++ b/Libraries/BatchedBridge/BatchedBridgedModules/POPAnimation.js @@ -5,7 +5,7 @@ */ 'use strict'; -var RCTPOPAnimationManager = require('NativeModules').RCTPOPAnimationManager; +var RCTPOPAnimationManager = require('NativeModules').POPAnimationManager; if (!RCTPOPAnimationManager) { // POP animation isn't available in the OSS fork - this is a temporary // workaround to enable its availability to be determined at runtime. diff --git a/Libraries/BatchedBridge/BatchedBridgedModules/RCTAlertManager.ios.js b/Libraries/BatchedBridge/BatchedBridgedModules/RCTAlertManager.ios.js index 3621795da..e8b3bcd27 100644 --- a/Libraries/BatchedBridge/BatchedBridgedModules/RCTAlertManager.ios.js +++ b/Libraries/BatchedBridge/BatchedBridgedModules/RCTAlertManager.ios.js @@ -5,6 +5,6 @@ */ 'use strict'; -var { RCTAlertManager } = require('NativeModules'); +var RCTAlertManager = require('NativeModules').AlertManager; module.exports = RCTAlertManager; diff --git a/Libraries/CameraRoll/CameraRoll.js b/Libraries/CameraRoll/CameraRoll.js index d97fa8ce2..c8499fc97 100644 --- a/Libraries/CameraRoll/CameraRoll.js +++ b/Libraries/CameraRoll/CameraRoll.js @@ -6,7 +6,7 @@ 'use strict'; var ReactPropTypes = require('ReactPropTypes'); -var RCTCameraRollManager = require('NativeModules').RCTCameraRollManager; +var RCTCameraRollManager = require('NativeModules').CameraRollManager; var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker'); var deepFreezeAndThrowOnMutationInDev = diff --git a/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js b/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js index c494e031c..8c09ac551 100644 --- a/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js +++ b/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js @@ -37,8 +37,11 @@ var ActivityIndicatorIOS = React.createClass({ */ color: PropTypes.string, + /** + * Size of the indicator. Small has a height of 20, large has a height of 36. + */ size: PropTypes.oneOf([ - 'small', // default + 'small', 'large', ]), }, @@ -53,7 +56,7 @@ var ActivityIndicatorIOS = React.createClass({ render: function() { var style = styles.sizeSmall; - var NativeConstants = NativeModules.RCTUIManager.UIActivityIndicatorView.Constants; + var NativeConstants = NativeModules.UIManager.UIActivityIndicatorView.Constants; var activityIndicatorViewStyle = NativeConstants.StyleWhite; if (this.props.size === 'large') { style = styles.sizeLarge; diff --git a/Libraries/Components/DatePicker/DatePickerIOS.ios.js b/Libraries/Components/DatePicker/DatePickerIOS.ios.js index c45672d65..a010870b1 100644 --- a/Libraries/Components/DatePicker/DatePickerIOS.ios.js +++ b/Libraries/Components/DatePicker/DatePickerIOS.ios.js @@ -11,7 +11,7 @@ var NativeMethodsMixin = require('NativeMethodsMixin'); var PropTypes = require('ReactPropTypes'); var React = require('React'); var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); -var RCTDatePickerIOSConsts = require('NativeModules').RCTUIManager.RCTDatePicker.Constants; +var RCTDatePickerIOSConsts = require('NativeModules').UIManager.RCTDatePicker.Constants; var StyleSheet = require('StyleSheet'); var View = require('View'); @@ -62,10 +62,8 @@ var DatePickerIOS = React.createClass({ /** * The date picker mode. - * - * Valid modes on iOS are: 'date', 'time', 'datetime'. */ - mode: PropTypes.oneOf(Object.keys(RCTDatePickerIOSConsts.DatePickerModes)), + mode: PropTypes.oneOf(['date', 'time', 'datetime']), /** * The interval at which minutes can be selected. @@ -73,7 +71,7 @@ var DatePickerIOS = React.createClass({ minuteInterval: PropTypes.oneOf([1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30]), /** - * Timezone offset in seconds. + * Timezone offset in minutes. * * By default, the date picker will use the device's timezone. With this * parameter, it is possible to force a certain timezone offset. For diff --git a/Libraries/Components/ListView/ListView.js b/Libraries/Components/ListView/ListView.js index c6e0f5113..e0c067a18 100644 --- a/Libraries/Components/ListView/ListView.js +++ b/Libraries/Components/ListView/ListView.js @@ -7,7 +7,7 @@ var ListViewDataSource = require('ListViewDataSource'); var React = require('React'); -var RCTUIManager = require('NativeModules').RCTUIManager; +var RCTUIManager = require('NativeModules').UIManager; var ScrollView = require('ScrollView'); var ScrollResponder = require('ScrollResponder'); var StaticRenderer = require('StaticRenderer'); diff --git a/Libraries/Components/ListView/ListViewDataSource.js b/Libraries/Components/ListView/ListViewDataSource.js index 3be109443..b1916bc64 100644 --- a/Libraries/Components/ListView/ListViewDataSource.js +++ b/Libraries/Components/ListView/ListViewDataSource.js @@ -215,9 +215,10 @@ class ListViewDataSource { /** * @param {number} index * - * Gets the rowID at index provided if the dataSource arrays were flattened + * Gets the rowID at index provided if the dataSource arrays were flattened, + * or null of out of range indexes. */ - getRowIDForFlatIndex(index: number): string { + getRowIDForFlatIndex(index: number): ?string { var accessIndex = index; for (var ii = 0; ii < this.sectionIdentities.length; ii++) { if (accessIndex >= this.rowIdentities[ii].length) { @@ -226,14 +227,16 @@ class ListViewDataSource { return this.rowIdentities[ii][accessIndex]; } } + return null; } /** * @param {number} index * - * Gets the sectionID at index provided if the dataSource arrays were flattened + * Gets the sectionID at index provided if the dataSource arrays were flattened, + * or null for out of range indexes. */ - getSectionIDForFlatIndex(index: number): string { + getSectionIDForFlatIndex(index: number): ?string { var accessIndex = index; for (var ii = 0; ii < this.sectionIdentities.length; ii++) { if (accessIndex >= this.rowIdentities[ii].length) { @@ -242,6 +245,7 @@ class ListViewDataSource { return this.sectionIdentities[ii]; } } + return null; } /** diff --git a/Libraries/Components/Navigation/NavigatorIOS.ios.js b/Libraries/Components/Navigation/NavigatorIOS.ios.js index c09ce242a..30082cf21 100644 --- a/Libraries/Components/Navigation/NavigatorIOS.ios.js +++ b/Libraries/Components/Navigation/NavigatorIOS.ios.js @@ -8,7 +8,7 @@ var EventEmitter = require('EventEmitter'); var React = require('React'); var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); -var { RCTNavigatorManager } = require('NativeModules'); +var RCTNavigatorManager = require('NativeModules').NavigatorManager; var StyleSheet = require('StyleSheet'); var StaticContainer = require('StaticContainer.react'); var View = require('View'); diff --git a/Libraries/Components/ScrollResponder.js b/Libraries/Components/ScrollResponder.js index b8f4c96c6..b6e55e078 100644 --- a/Libraries/Components/ScrollResponder.js +++ b/Libraries/Components/ScrollResponder.js @@ -11,8 +11,8 @@ var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); var Subscribable = require('Subscribable'); var TextInputState = require('TextInputState'); -var RCTUIManager = NativeModules.RCTUIManager; -var RCTUIManagerDeprecated = NativeModules.RCTUIManager; +var RCTUIManager = NativeModules.UIManager; +var RCTUIManagerDeprecated = NativeModules.UIManager; var RCTScrollViewConsts = RCTUIManager.RCTScrollView.Constants; var warning = require('warning'); diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index 804b6f578..a069988ce 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -8,12 +8,12 @@ var EdgeInsetsPropType = require('EdgeInsetsPropType'); var Platform = require('Platform'); var PointPropType = require('PointPropType'); -var RCTScrollView = require('NativeModules').RCTUIManager.RCTScrollView; +var RCTScrollView = require('NativeModules').UIManager.RCTScrollView; var RCTScrollViewConsts = RCTScrollView.Constants; var React = require('React'); var ReactIOSTagHandles = require('ReactIOSTagHandles'); var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); -var RCTUIManager = require('NativeModules').RCTUIManager; +var RCTUIManager = require('NativeModules').UIManager; var ScrollResponder = require('ScrollResponder'); var StyleSheet = require('StyleSheet'); var StyleSheetPropType = require('StyleSheetPropType'); diff --git a/Libraries/Components/Slider/Slider.js b/Libraries/Components/SliderIOS/SliderIOS.js similarity index 95% rename from Libraries/Components/Slider/Slider.js rename to Libraries/Components/SliderIOS/SliderIOS.js index a0be43066..2e5f14bc1 100644 --- a/Libraries/Components/Slider/Slider.js +++ b/Libraries/Components/SliderIOS/SliderIOS.js @@ -1,7 +1,7 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. * - * @providesModule Slider + * @providesModule SliderIOS */ 'use strict'; @@ -16,7 +16,7 @@ var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass'); var merge = require('merge'); -var Slider = React.createClass({ +var SliderIOS = React.createClass({ mixins: [NativeMethodsMixin], propTypes: { @@ -80,4 +80,4 @@ var RCTSlider = createReactIOSNativeComponentClass({ uiViewClassName: 'RCTSlider', }); -module.exports = Slider; +module.exports = SliderIOS; diff --git a/Libraries/Components/StatusBar/StatusBarIOS.ios.js b/Libraries/Components/StatusBar/StatusBarIOS.ios.js index 50097f3dd..55cb1608c 100644 --- a/Libraries/Components/StatusBar/StatusBarIOS.ios.js +++ b/Libraries/Components/StatusBar/StatusBarIOS.ios.js @@ -6,7 +6,7 @@ */ 'use strict'; -var { RCTStatusBarManager } = require('NativeModules'); +var RCTStatusBarManager = require('NativeModules').StatusBarManager; var StatusBarIOS = { diff --git a/Libraries/Components/TextInput/TextInput.ios.js b/Libraries/Components/TextInput/TextInput.ios.js index 21ad49f53..2f2b24dd6 100644 --- a/Libraries/Components/TextInput/TextInput.ios.js +++ b/Libraries/Components/TextInput/TextInput.ios.js @@ -8,7 +8,7 @@ var DocumentSelectionState = require('DocumentSelectionState'); var EventEmitter = require('EventEmitter'); var NativeMethodsMixin = require('NativeMethodsMixin'); -var RCTUIManager = require('NativeModules').RCTUIManager; +var RCTUIManager = require('NativeModules').UIManager; var PropTypes = require('ReactPropTypes'); var React = require('React'); var ReactChildren = require('ReactChildren'); diff --git a/Libraries/Components/TextInput/TextInputState.js b/Libraries/Components/TextInput/TextInputState.js index 6d22e3e77..2bbe8a3d0 100644 --- a/Libraries/Components/TextInput/TextInputState.js +++ b/Libraries/Components/TextInput/TextInputState.js @@ -9,7 +9,7 @@ */ 'use strict'; -var RCTUIManager = require('NativeModules').RCTUIManager; +var RCTUIManager = require('NativeModules').UIManager; var TextInputState = { /** diff --git a/Libraries/Components/Touchable/TouchableFeedbackPropType.js b/Libraries/Components/Touchable/TouchableFeedbackPropType.js deleted file mode 100644 index 336b091c6..000000000 --- a/Libraries/Components/Touchable/TouchableFeedbackPropType.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule TouchableFeedbackPropType - * @flow - */ -'use strict'; - -var { PropTypes } = require('React'); - -var TouchableFeedbackPropType = { - /** - * Called when the touch is released, but not if cancelled (e.g. by a scroll - * that steals the responder lock). - */ - onPress: PropTypes.func, - onPressIn: PropTypes.func, - onPressOut: PropTypes.func, - onLongPress: PropTypes.func, -}; - -module.exports = TouchableFeedbackPropType; diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index e00b847e8..9bb539ceb 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -11,7 +11,7 @@ var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); var StyleSheet = require('StyleSheet'); var TimerMixin = require('TimerMixin'); var Touchable = require('Touchable'); -var TouchableFeedbackPropType = require('TouchableFeedbackPropType'); +var TouchableWithoutFeedback = require('TouchableWithoutFeedback'); var View = require('View'); var cloneWithProps = require('cloneWithProps'); @@ -51,12 +51,7 @@ var DEFAULT_PROPS = { var TouchableHighlight = React.createClass({ propTypes: { - ...TouchableFeedbackPropType, - /** - * Called when the touch is released, but not if cancelled (e.g. by - * a scroll that steals the responder lock). - */ - onPress: React.PropTypes.func.isRequired, + ...TouchableWithoutFeedback.propTypes, /** * Determines what the opacity of the wrapped view should be when touch is * active. @@ -164,7 +159,10 @@ var TouchableHighlight = React.createClass({ this._hideTimeout = null; if (this.refs[UNDERLAY_REF]) { this.refs[CHILD_REF].setNativeProps(INACTIVE_CHILD_PROPS); - this.refs[UNDERLAY_REF].setNativeProps(INACTIVE_UNDERLAY_PROPS); + this.refs[UNDERLAY_REF].setNativeProps({ + ...INACTIVE_UNDERLAY_PROPS, + style: this.state.underlayStyle, + }); } }, diff --git a/Libraries/Components/Touchable/TouchableOpacity.js b/Libraries/Components/Touchable/TouchableOpacity.js index 1b2f3898f..549df36a8 100644 --- a/Libraries/Components/Touchable/TouchableOpacity.js +++ b/Libraries/Components/Touchable/TouchableOpacity.js @@ -9,7 +9,7 @@ var NativeMethodsMixin = require('NativeMethodsMixin'); var POPAnimationMixin = require('POPAnimationMixin'); var React = require('React'); var Touchable = require('Touchable'); -var TouchableFeedbackPropType = require('TouchableFeedbackPropType'); +var TouchableWithoutFeedback = require('TouchableWithoutFeedback'); var cloneWithProps = require('cloneWithProps'); var ensureComponentIsNative = require('ensureComponentIsNative'); @@ -42,7 +42,7 @@ var TouchableOpacity = React.createClass({ mixins: [Touchable.Mixin, NativeMethodsMixin, POPAnimationMixin], propTypes: { - ...TouchableFeedbackPropType, + ...TouchableWithoutFeedback.propTypes, /** * Determines what the opacity of the wrapped view should be when touch is * active. diff --git a/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/Libraries/Components/Touchable/TouchableWithoutFeedback.js index ccc784e6a..78544dbc6 100644 --- a/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -7,7 +7,6 @@ var React = require('React'); var Touchable = require('Touchable'); -var TouchableFeedbackPropType = require('TouchableFeedbackPropType'); var onlyChild = require('onlyChild'); @@ -28,7 +27,16 @@ var PRESS_RECT_OFFSET = {top: 20, left: 20, right: 20, bottom: 30}; var TouchableWithoutFeedback = React.createClass({ mixins: [Touchable.Mixin], - propTypes: TouchableFeedbackPropType, + propTypes: { + /** + * Called when the touch is released, but not if cancelled (e.g. by a scroll + * that steals the responder lock). + */ + onPress: React.PropTypes.func, + onPressIn: React.PropTypes.func, + onPressOut: React.PropTypes.func, + onLongPress: React.PropTypes.func, + }, getInitialState: function() { return this.touchableGetInitialState(); diff --git a/Libraries/Components/WebView/WebView.android.js b/Libraries/Components/WebView/WebView.android.js index d153ebe92..43e6f2c5a 100644 --- a/Libraries/Components/WebView/WebView.android.js +++ b/Libraries/Components/WebView/WebView.android.js @@ -16,7 +16,7 @@ var keyMirror = require('keyMirror'); var merge = require('merge'); var PropTypes = React.PropTypes; -var RCTUIManager = require('NativeModules').RCTUIManager; +var RCTUIManager = require('NativeModules').UIManager; var RCT_WEBVIEW_REF = 'webview'; diff --git a/Libraries/Components/WebView/WebView.ios.js b/Libraries/Components/WebView/WebView.ios.js index e7d483fc4..213f887ac 100644 --- a/Libraries/Components/WebView/WebView.ios.js +++ b/Libraries/Components/WebView/WebView.ios.js @@ -17,7 +17,7 @@ var insetsDiffer = require('insetsDiffer'); var merge = require('merge'); var PropTypes = React.PropTypes; -var { RCTWebViewManager } = require('NativeModules'); +var RCTWebViewManager = require('NativeModules').WebViewManager; var RCT_WEBVIEW_REF = 'webview'; diff --git a/Libraries/Geolocation/Geolocation.ios.js b/Libraries/Geolocation/Geolocation.ios.js index 0e8015335..37134dd31 100644 --- a/Libraries/Geolocation/Geolocation.ios.js +++ b/Libraries/Geolocation/Geolocation.ios.js @@ -6,7 +6,7 @@ 'use strict'; var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); -var RCTLocationObserver = require('NativeModules').RCTLocationObserver; +var RCTLocationObserver = require('NativeModules').LocationObserver; var invariant = require('invariant'); var logError = require('logError'); diff --git a/Libraries/Image/Image.ios.js b/Libraries/Image/Image.ios.js index 771a27543..315667d25 100644 --- a/Libraries/Image/Image.ios.js +++ b/Libraries/Image/Image.ios.js @@ -114,7 +114,7 @@ var Image = React.createClass({ warning(RawImage === RCTStaticImage, 'tintColor style only supported on static images.'); } - var contentModes = NativeModules.RCTUIManager.UIView.ContentMode; + var contentModes = NativeModules.UIManager.UIView.ContentMode; var resizeMode; if (style.resizeMode === ImageResizeMode.stretch) { resizeMode = contentModes.ScaleToFill; diff --git a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js index 6d4d762bd..92c9d27ed 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js +++ b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js @@ -60,7 +60,7 @@ function setupDocumentShim() { var sourceMapPromise; function handleErrorWithRedBox(e) { - var RCTExceptionsManager = require('NativeModules').RCTExceptionsManager; + var RCTExceptionsManager = require('NativeModules').ExceptionsManager; var errorToString = require('errorToString'); var loadSourceMap = require('loadSourceMap'); @@ -115,7 +115,7 @@ function setupTimers() { } function setupAlert() { - var { RCTAlertManager } = require('NativeModules'); + var RCTAlertManager = require('NativeModules').AlertManager; if (!GLOBAL.alert) { GLOBAL.alert = function(text) { var alertOpts = { diff --git a/Libraries/JavaScriptAppEngine/Initialization/loadSourceMap.js b/Libraries/JavaScriptAppEngine/Initialization/loadSourceMap.js index 48fd9d1bf..0af19b27e 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/loadSourceMap.js +++ b/Libraries/JavaScriptAppEngine/Initialization/loadSourceMap.js @@ -8,7 +8,7 @@ 'use strict'; var Promise = require('Promise'); -var RCTSourceCode = require('NativeModules').RCTSourceCode; +var RCTSourceCode = require('NativeModules').SourceCode; var SourceMapConsumer = require('SourceMap').SourceMapConsumer; var SourceMapURL = require('./source-map-url'); diff --git a/Libraries/JavaScriptAppEngine/System/JSTimers/JSTimers.js b/Libraries/JavaScriptAppEngine/System/JSTimers/JSTimers.js index 1b25e00c1..4fa4b8587 100644 --- a/Libraries/JavaScriptAppEngine/System/JSTimers/JSTimers.js +++ b/Libraries/JavaScriptAppEngine/System/JSTimers/JSTimers.js @@ -7,7 +7,7 @@ // Note that the module JSTimers is split into two in order to solve a cycle // in dependencies. NativeModules > BatchedBridge > MessageQueue > JSTimersExecution -var RCTTiming = require('NativeModules').RCTTiming; +var RCTTiming = require('NativeModules').Timing; var JSTimersExecution = require('JSTimersExecution'); /** @@ -90,7 +90,7 @@ var JSTimers = { JSTimersExecution.timerIDs[freeIndex] = newID; JSTimersExecution.callbacks[freeIndex] = func; JSTimersExecution.types[freeIndex] = JSTimersExecution.Type.requestAnimationFrame; - RCTTiming.createTimer(newID, 0, Date.now(), /** recurring */ false); + RCTTiming.createTimer(newID, 1, Date.now(), /** recurring */ false); return newID; }, diff --git a/Libraries/Network/NetInfo.js b/Libraries/Network/NetInfo.js index 671b064a2..b228547a6 100644 --- a/Libraries/Network/NetInfo.js +++ b/Libraries/Network/NetInfo.js @@ -8,7 +8,7 @@ var NativeModules = require('NativeModules'); var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); -var RCTReachability = NativeModules.RCTReachability; +var RCTReachability = NativeModules.Reachability; var DEVICE_REACHABILITY_EVENT = 'reachabilityDidChange'; diff --git a/Libraries/Network/XMLHttpRequest.ios.js b/Libraries/Network/XMLHttpRequest.ios.js index b747d0bed..d1e2e92e8 100644 --- a/Libraries/Network/XMLHttpRequest.ios.js +++ b/Libraries/Network/XMLHttpRequest.ios.js @@ -6,7 +6,7 @@ */ 'use strict'; -var RCTDataManager = require('NativeModules').RCTDataManager; +var RCTDataManager = require('NativeModules').DataManager; var crc32 = require('crc32'); diff --git a/Libraries/Picker/PickerIOS.ios.js b/Libraries/Picker/PickerIOS.ios.js index c2d1c2241..69d163cf5 100644 --- a/Libraries/Picker/PickerIOS.ios.js +++ b/Libraries/Picker/PickerIOS.ios.js @@ -11,7 +11,7 @@ var NativeMethodsMixin = require('NativeMethodsMixin'); var React = require('React'); var ReactChildren = require('ReactChildren'); var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); -var RCTPickerIOSConsts = require('NativeModules').RCTUIManager.RCTPicker.Constants; +var RCTPickerIOSConsts = require('NativeModules').UIManager.RCTPicker.Constants; var StyleSheet = require('StyleSheet'); var View = require('View'); diff --git a/Libraries/RKBackendNode/queryLayoutByID.js b/Libraries/RKBackendNode/queryLayoutByID.js index a93130e89..0d8893eb6 100644 --- a/Libraries/RKBackendNode/queryLayoutByID.js +++ b/Libraries/RKBackendNode/queryLayoutByID.js @@ -6,7 +6,7 @@ 'use strict'; var ReactIOSTagHandles = require('ReactIOSTagHandles'); -var RCTUIManager = require('NativeModules').RCTUIManager; +var RCTUIManager = require('NativeModules').UIManager; /** * Queries the layout of a view. The layout does not reflect the element as diff --git a/Libraries/ReactIOS/IOSNativeBridgeEventPlugin.js b/Libraries/ReactIOS/IOSNativeBridgeEventPlugin.js index 16446f85d..fea12db6c 100644 --- a/Libraries/ReactIOS/IOSNativeBridgeEventPlugin.js +++ b/Libraries/ReactIOS/IOSNativeBridgeEventPlugin.js @@ -13,7 +13,7 @@ var SyntheticEvent = require('SyntheticEvent'); var merge = require('merge'); var warning = require('warning'); -var RCTUIManager = NativeModules.RCTUIManager; +var RCTUIManager = NativeModules.UIManager; var customBubblingEventTypes = RCTUIManager.customBubblingEventTypes; var customDirectEventTypes = RCTUIManager.customDirectEventTypes; diff --git a/Libraries/ReactIOS/NativeMethodsMixin.js b/Libraries/ReactIOS/NativeMethodsMixin.js index 767264fae..9edc06413 100644 --- a/Libraries/ReactIOS/NativeMethodsMixin.js +++ b/Libraries/ReactIOS/NativeMethodsMixin.js @@ -7,8 +7,8 @@ var NativeModules = require('NativeModules'); var NativeModules = require('NativeModules'); -var RCTPOPAnimationManager = NativeModules.RCTPOPAnimationManager; -var RCTUIManager = NativeModules.RCTUIManager; +var RCTPOPAnimationManager = NativeModules.POPAnimationManager; +var RCTUIManager = NativeModules.UIManager; var TextInputState = require('TextInputState'); var flattenStyle = require('flattenStyle'); diff --git a/Libraries/ReactIOS/ReactIOSDOMIDOperations.js b/Libraries/ReactIOS/ReactIOSDOMIDOperations.js index 771b58110..dfb96f8cb 100644 --- a/Libraries/ReactIOS/ReactIOSDOMIDOperations.js +++ b/Libraries/ReactIOS/ReactIOSDOMIDOperations.js @@ -9,7 +9,7 @@ var ReactIOSTagHandles = require('ReactIOSTagHandles'); var ReactMultiChildUpdateTypes = require('ReactMultiChildUpdateTypes'); -var RCTUIManager = require('NativeModules').RCTUIManager; +var RCTUIManager = require('NativeModules').UIManager; var ReactPerf = require('ReactPerf'); /** diff --git a/Libraries/ReactIOS/ReactIOSGlobalResponderHandler.js b/Libraries/ReactIOS/ReactIOSGlobalResponderHandler.js index 9c9e64db5..d22f98489 100644 --- a/Libraries/ReactIOS/ReactIOSGlobalResponderHandler.js +++ b/Libraries/ReactIOS/ReactIOSGlobalResponderHandler.js @@ -3,7 +3,7 @@ */ 'use strict'; -var RCTUIManager = require('NativeModules').RCTUIManager; +var RCTUIManager = require('NativeModules').UIManager; var ReactIOSTagHandles = require('ReactIOSTagHandles'); var ReactIOSGlobalResponderHandler = { diff --git a/Libraries/ReactIOS/ReactIOSMount.js b/Libraries/ReactIOS/ReactIOSMount.js index 7226159cc..e26e9934e 100644 --- a/Libraries/ReactIOS/ReactIOSMount.js +++ b/Libraries/ReactIOS/ReactIOSMount.js @@ -5,7 +5,7 @@ */ 'use strict'; -var RCTUIManager = require('NativeModules').RCTUIManager; +var RCTUIManager = require('NativeModules').UIManager; var ReactIOSTagHandles = require('ReactIOSTagHandles'); var ReactPerf = require('ReactPerf'); diff --git a/Libraries/ReactIOS/ReactIOSNativeComponent.js b/Libraries/ReactIOS/ReactIOSNativeComponent.js index 39c2f294a..3bbec560c 100644 --- a/Libraries/ReactIOS/ReactIOSNativeComponent.js +++ b/Libraries/ReactIOS/ReactIOSNativeComponent.js @@ -11,7 +11,7 @@ var ReactIOSEventEmitter = require('ReactIOSEventEmitter'); var ReactIOSStyleAttributes = require('ReactIOSStyleAttributes'); var ReactIOSTagHandles = require('ReactIOSTagHandles'); var ReactMultiChild = require('ReactMultiChild'); -var RCTUIManager = require('NativeModules').RCTUIManager; +var RCTUIManager = require('NativeModules').UIManager; var styleDiffer = require('styleDiffer'); var deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev'); diff --git a/Libraries/ReactIOS/ReactIOSTextComponent.js b/Libraries/ReactIOS/ReactIOSTextComponent.js index ca8417ddf..ef53b2968 100644 --- a/Libraries/ReactIOS/ReactIOSTextComponent.js +++ b/Libraries/ReactIOS/ReactIOSTextComponent.js @@ -7,7 +7,7 @@ 'use strict'; var ReactIOSTagHandles = require('ReactIOSTagHandles'); -var RCTUIManager = require('NativeModules').RCTUIManager; +var RCTUIManager = require('NativeModules').UIManager; var assign = require('Object.assign'); diff --git a/Libraries/Storage/AsyncStorage.ios.js b/Libraries/Storage/AsyncStorage.ios.js index 754e59cb1..b1a68c40b 100644 --- a/Libraries/Storage/AsyncStorage.ios.js +++ b/Libraries/Storage/AsyncStorage.ios.js @@ -7,8 +7,8 @@ 'use strict'; var NativeModules = require('NativeModules'); -var RCTAsyncLocalStorage = NativeModules.RCTAsyncLocalStorage; -var RCTAsyncRocksDBStorage = NativeModules.RCTAsyncRocksDBStorage; +var RCTAsyncLocalStorage = NativeModules.AsyncLocalStorage; +var RCTAsyncRocksDBStorage = NativeModules.AsyncRocksDBStorage; // We use RocksDB if available. var RCTAsyncStorage = RCTAsyncRocksDBStorage || RCTAsyncLocalStorage; diff --git a/Libraries/Text/ExpandingText.js b/Libraries/Text/ExpandingText.js deleted file mode 100644 index 181e0a2b8..000000000 --- a/Libraries/Text/ExpandingText.js +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule ExpandingText - */ -'use strict'; - -var React = require('React'); -var StyleSheet = require('StyleSheet'); -var Text = require('Text'); -var TouchableWithoutFeedback = require('TouchableWithoutFeedback'); -var View = require('View'); - -var truncate = require('truncate'); - -var styles = StyleSheet.create({ - boldText: { - fontWeight: 'bold', - }, -}); - -/** - * A react component for displaying text which supports truncating - * based on a set truncLength. - * - * In the following example, the text will truncate - * to show only the first 17 characters plus '...' with a See More button to - * expand the text to its full length. - * - * ``` - * render: function() { - * return ; - * }, - * ``` - */ -var ExpandingText = React.createClass({ - propTypes: { - /** - * Text to be displayed. It will be truncated if the character length - * is greater than the `truncLength` property. - */ - text: React.PropTypes.string, - /** - * The styles that will be applied to the text (both truncated and - * expanded). - */ - textStyle: Text.propTypes.style, - /** - * The styles that will be applied to the See More button. Default - * is bold. - */ - seeMoreStyle: Text.propTypes.style, - /** - * The caption that will be appended at the end, by default it is - * `'See More'`. - */ - seeMoreText: React.PropTypes.string, - /** - * The maximum character length for the text that will - * be displayed by default. Note that ... will be - * appended to the truncated text which is counted towards - * the total truncLength of the default displayed string. - * The default is 130. - */ - truncLength: React.PropTypes.number, - }, - - getDefaultProps: function() { - return { - truncLength: 130, - seeMoreText: 'See More', - seeMoreStyle: styles.boldText, - }; - }, - - getInitialState: function() { - return { - truncated: true, - }; - }, - - onTapSeeMore: function() { - this.setState({ - truncated: !this.state.truncated, - }); - }, - - isTruncated: function() { - return ( - this.props.text.length > this.props.truncLength && - this.state.truncated - ); - }, - - getText: function() { - var text = this.props.text; - if (!this.isTruncated()) { - return text; - } - - return truncate(text, this.props.truncLength) + ' '; - }, - - renderSeeMore: function() { - if (!this.isTruncated()) { - return null; - } - - return ( - - {this.props.seeMoreText} - - ); - }, - - render: function() { - return ( - - - - {this.getText()} - {this.renderSeeMore()} - - - - ); - } -}); - -module.exports = ExpandingText; diff --git a/Libraries/Utilities/AlertIOS.js b/Libraries/Utilities/AlertIOS.js index bbbdc8981..8a342004c 100644 --- a/Libraries/Utilities/AlertIOS.js +++ b/Libraries/Utilities/AlertIOS.js @@ -6,7 +6,7 @@ */ 'use strict'; -var { RCTAlertManager } = require('NativeModules'); +var RCTAlertManager = require('NativeModules').AlertManager; var DEFAULT_BUTTON_TEXT = 'OK'; var DEFAULT_BUTTON = { diff --git a/Libraries/Utilities/Dimensions.js b/Libraries/Utilities/Dimensions.js index d33515799..5cbf8cb87 100644 --- a/Libraries/Utilities/Dimensions.js +++ b/Libraries/Utilities/Dimensions.js @@ -9,7 +9,7 @@ var NativeModules = require('NativeModules'); var invariant = require('invariant'); -var dimensions = NativeModules.RCTUIManager.Dimensions; +var dimensions = NativeModules.UIManager.Dimensions; class Dimensions { /** diff --git a/Libraries/Utilities/PushNotificationIOS.js b/Libraries/Utilities/PushNotificationIOS.js index 86733bde3..cb40e6dec 100644 --- a/Libraries/Utilities/PushNotificationIOS.js +++ b/Libraries/Utilities/PushNotificationIOS.js @@ -8,7 +8,7 @@ var NativeModules = require('NativeModules'); var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); -var RCTPushNotificationManager = NativeModules.RCTPushNotificationManager; +var RCTPushNotificationManager = NativeModules.PushNotificationManager; if (RCTPushNotificationManager) { var _initialNotification = RCTPushNotificationManager.initialNotification; } diff --git a/Libraries/Utilities/RCTRenderingPerf.js b/Libraries/Utilities/RCTRenderingPerf.js index cdc44aaa6..9df484bff 100644 --- a/Libraries/Utilities/RCTRenderingPerf.js +++ b/Libraries/Utilities/RCTRenderingPerf.js @@ -37,6 +37,19 @@ var RCTRenderingPerf = { ReactDefaultPerf.stop(); ReactDefaultPerf.printInclusive(); ReactDefaultPerf.printWasted(); + + var totalRender = 0; + var totalTime = 0; + var measurements = ReactDefaultPerf.getLastMeasurements(); + for (var ii = 0; ii < measurements.length; ii++) { + var render = measurements[ii].render; + for (var nodeName in render) { + totalRender += render[nodeName]; + } + totalTime += measurements[ii].totalTime; + } + console.log('Total time spent in render(): ' + totalRender + 'ms'); + perfModules.forEach((module) => module.stop()); }, diff --git a/Libraries/Utilities/nativeModulePrefixDuplicator.js b/Libraries/Utilities/nativeModulePrefixDuplicator.js deleted file mode 100644 index fb2951612..000000000 --- a/Libraries/Utilities/nativeModulePrefixDuplicator.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule nativeModulePrefixDuplicator - */ -'use strict'; - -// Dirty hack to support old (RK) and new (RCT) native module name conventions -function nativeModulePrefixDuplicator(modules) { - Object.keys(modules).forEach((moduleName) => { - var rkModuleName = moduleName.replace(/^RCT/, 'RK'); - var rctModuleName = moduleName.replace(/^RK/, 'RCT'); - if (rkModuleName !== rctModuleName) { - if (modules[rkModuleName] && modules[rctModuleName]) { - throw new Error( - 'Module cannot be registered as both RCT and RK: ' + moduleName - ); - } - modules[rkModuleName] = modules[moduleName]; - modules[rctModuleName] = modules[moduleName]; - } - }); -} - -module.exports = nativeModulePrefixDuplicator; diff --git a/Libraries/Utilities/nativeModulePrefixNormalizer.js b/Libraries/Utilities/nativeModulePrefixNormalizer.js new file mode 100644 index 000000000..1c4807553 --- /dev/null +++ b/Libraries/Utilities/nativeModulePrefixNormalizer.js @@ -0,0 +1,24 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule nativeModulePrefixNormalizer + */ +'use strict'; + +// Dirty hack to support old (RK) and new (RCT) native module name conventions +function nativeModulePrefixNormalizer(modules) { + Object.keys(modules).forEach((moduleName) => { + var strippedName = moduleName.replace(/^(RCT|RK)/, ''); + if (modules['RCT' + strippedName] && modules['RK' + strippedName]) { + throw new Error( + 'Module cannot be registered as both RCT and RK: ' + moduleName + ); + } + if (strippedName !== moduleName) { + modules[strippedName] = modules[moduleName]; + delete modules[moduleName]; + } + }); +} + +module.exports = nativeModulePrefixNormalizer; diff --git a/Libraries/Vibration/VibrationIOS.ios.js b/Libraries/Vibration/VibrationIOS.ios.js index 054d6c81e..11b09f989 100644 --- a/Libraries/Vibration/VibrationIOS.ios.js +++ b/Libraries/Vibration/VibrationIOS.ios.js @@ -5,7 +5,8 @@ */ 'use strict'; -var {RCTVibration} = require('NativeModules'); +var RCTVibration = require('NativeModules').Vibration; + var invariant = require('invariant'); /** diff --git a/Libraries/react-native/addons.js b/Libraries/react-native/addons.js index fcef285e2..864d8906d 100644 --- a/Libraries/react-native/addons.js +++ b/Libraries/react-native/addons.js @@ -19,6 +19,8 @@ var addons = { batchedUpdates: ReactUpdates.batchedUpdates, cloneWithProps: cloneWithProps, update: update, + Perf: undefined, + TestUtils: undefined, }; if (__DEV__) { diff --git a/Libraries/react-native/react-native-interface.js b/Libraries/react-native/react-native-interface.js index c37bbe685..82ceeb77e 100644 --- a/Libraries/react-native/react-native-interface.js +++ b/Libraries/react-native/react-native-interface.js @@ -4,7 +4,6 @@ declare module "react-native" { } declare var AppRegistry: ReactClass; - declare var ExpandingText: ReactClass; declare var Image: ReactClass; declare var ListView: ReactClass; declare var NavigatorIOS: ReactClass; diff --git a/Libraries/react-native/react-native.js b/Libraries/react-native/react-native.js index cda4a3014..63690c4fa 100644 --- a/Libraries/react-native/react-native.js +++ b/Libraries/react-native/react-native.js @@ -7,7 +7,29 @@ var ReactNative = { ...require('React'), + + // Components ActivityIndicatorIOS: require('ActivityIndicatorIOS'), + DatePickerIOS: require('DatePickerIOS'), + Image: require('Image'), + ListView: require('ListView'), + ListViewDataSource: require('ListViewDataSource'), + MapView: require('MapView'), + NavigatorIOS: require('NavigatorIOS'), + PickerIOS: require('PickerIOS'), + ScrollView: require('ScrollView'), + SliderIOS: require('SliderIOS'), + SwitchIOS: require('SwitchIOS'), + TabBarIOS: require('TabBarIOS'), + Text: require('Text'), + TextInput: require('TextInput'), + TouchableHighlight: require('TouchableHighlight'), + TouchableOpacity: require('TouchableOpacity'), + TouchableWithoutFeedback: require('TouchableWithoutFeedback'), + View: require('View'), + WebView: require('WebView'), + + // APIs AlertIOS: require('AlertIOS'), Animation: require('Animation'), AppRegistry: require('AppRegistry'), @@ -15,32 +37,15 @@ var ReactNative = { AppStateIOS: require('AppStateIOS'), AsyncStorage: require('AsyncStorage'), CameraRoll: require('CameraRoll'), - DatePickerIOS: require('DatePickerIOS'), - ExpandingText: require('ExpandingText'), - Image: require('Image'), InteractionManager: require('InteractionManager'), LayoutAnimation: require('LayoutAnimation'), - ListView: require('ListView'), - ListViewDataSource: require('ListViewDataSource'), - MapView: require('MapView'), - NavigatorIOS: require('NavigatorIOS'), NetInfo: require('NetInfo'), - PickerIOS: require('PickerIOS'), PixelRatio: require('PixelRatio'), - ScrollView: require('ScrollView'), - Slider: require('Slider'), StatusBarIOS: require('StatusBarIOS'), StyleSheet: require('StyleSheet'), - SwitchIOS: require('SwitchIOS'), - Text: require('Text'), - TextInput: require('TextInput'), TimerMixin: require('TimerMixin'), - TouchableHighlight: require('TouchableHighlight'), - TouchableOpacity: require('TouchableOpacity'), - TouchableWithoutFeedback: require('TouchableWithoutFeedback'), VibrationIOS: require('VibrationIOS'), - View: require('View'), - WebView: require('WebView'), + invariant: require('invariant'), ix: require('ix'), }; diff --git a/ReactKit/Modules/RCTTiming.m b/ReactKit/Modules/RCTTiming.m index d008178b2..c1d2ceeb5 100644 --- a/ReactKit/Modules/RCTTiming.m +++ b/ReactKit/Modules/RCTTiming.m @@ -166,6 +166,12 @@ { RCT_EXPORT(); + if (jsDuration == 0 && repeats == NO) { + // For super fast, one-off timers, just enqueue them immediately rather than waiting a frame. + [_bridge enqueueJSCall:@"RCTJSTimers.callTimers" args:@[@[callbackID]]]; + return; + } + NSTimeInterval interval = jsDuration / 1000; NSTimeInterval jsCreationTimeSinceUnixEpoch = jsSchedulingTime / 1000; NSTimeInterval currentTimeSinceUnixEpoch = [[NSDate date] timeIntervalSince1970]; diff --git a/packager/react-packager/src/DependencyResolver/haste/polyfills/console.js b/packager/react-packager/src/DependencyResolver/haste/polyfills/console.js index bb83822d5..1b2604e3a 100644 --- a/packager/react-packager/src/DependencyResolver/haste/polyfills/console.js +++ b/packager/react-packager/src/DependencyResolver/haste/polyfills/console.js @@ -25,6 +25,13 @@ 'use strict'; var OBJECT_COLUMN_NAME = '(index)'; + var LOG_LEVELS = { + trace: 0, + log: 1, + info: 2, + warn: 3, + error: 4 + }; function setupConsole(global) { @@ -32,29 +39,31 @@ return; } - function doNativeLog() { - var str = Array.prototype.map.call(arguments, function(arg) { - if (arg == null) { - return arg === null ? 'null' : 'undefined'; - } else if (typeof arg === 'string') { - return '"' + arg + '"'; - } else { - // Perform a try catch, just in case the object has a circular - // reference or stringify throws for some other reason. - try { - return JSON.stringify(arg); - } catch (e) { - if (typeof arg.toString === 'function') { - try { - return arg.toString(); - } catch (E) { - return 'unknown'; + function getNativeLogFunction(level) { + return function() { + var str = Array.prototype.map.call(arguments, function(arg) { + if (arg == null) { + return arg === null ? 'null' : 'undefined'; + } else if (typeof arg === 'string') { + return '"' + arg + '"'; + } else { + // Perform a try catch, just in case the object has a circular + // reference or stringify throws for some other reason. + try { + return JSON.stringify(arg); + } catch (e) { + if (typeof arg.toString === 'function') { + try { + return arg.toString(); + } catch (E) { + return 'unknown'; + } } } } - } - }).join(', '); - global.nativeLoggingHook(str); + }).join(', '); + global.nativeLoggingHook(str, level); + }; } var repeat = function(element, n) { @@ -75,7 +84,7 @@ } } if (rows.length === 0) { - global.nativeLoggingHook(''); + global.nativeLoggingHook('', LOG_LEVELS.log); return; } @@ -121,14 +130,15 @@ // Native logging hook adds "RCTLog >" at the front of every // logged string, which would shift the header and screw up // the table - global.nativeLoggingHook('\n' + table.join('\n')); + global.nativeLoggingHook('\n' + table.join('\n'), LOG_LEVELS.log); } global.console = { - error: doNativeLog, - info: doNativeLog, - log: doNativeLog, - warn: doNativeLog, + error: getNativeLogFunction(LOG_LEVELS.error), + info: getNativeLogFunction(LOG_LEVELS.info), + log: getNativeLogFunction(LOG_LEVELS.log), + warn: getNativeLogFunction(LOG_LEVELS.warn), + trace: getNativeLogFunction(LOG_LEVELS.trace), table: consoleTablePolyfill }; From b66424ebe4fc12417039fe1eaf137d70049834de Mon Sep 17 00:00:00 2001 From: Andrew Imm Date: Thu, 19 Mar 2015 02:02:51 -0700 Subject: [PATCH 61/79] Return the appropriate status code from XHR --- Libraries/Network/RCTDataManager.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/Network/RCTDataManager.m b/Libraries/Network/RCTDataManager.m index 4ffe5f975..9bfd9824b 100644 --- a/Libraries/Network/RCTDataManager.m +++ b/Libraries/Network/RCTDataManager.m @@ -50,8 +50,9 @@ } else { encoding = NSUTF8StringEncoding; } + int responseCode = (int)[((NSHTTPURLResponse *)response) statusCode]; NSString *returnData = [[NSString alloc] initWithData:data encoding:encoding]; - responseJSON = @{@"status": @200, @"responseText": returnData}; + responseJSON = @{@"status": @(responseCode), @"responseText": returnData}; } else { responseJSON = @{@"status": @0, @"responseText": [connectionError localizedDescription]}; } From e2e123c2ab1bfd24cbd144f3808b8046ab3df64a Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Thu, 19 Mar 2015 13:55:42 -0700 Subject: [PATCH 62/79] Random changes in the website --- website/layout/AutodocsLayout.js | 14 ++++++++++---- website/server/extractDocs.js | 3 +-- website/src/react-native/css/react-native.css | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/website/layout/AutodocsLayout.js b/website/layout/AutodocsLayout.js index 3b8ea2ce5..79d992c4e 100644 --- a/website/layout/AutodocsLayout.js +++ b/website/layout/AutodocsLayout.js @@ -34,9 +34,16 @@ var ComponentDoc = React.createClass({ } if (type.name === 'custom') { + if (type.raw === 'EdgeInsetsPropType') { + return '{top: number, left: number, bottom: number, right: number}'; + } return type.raw; } + if (type.name === 'func') { + return 'function'; + } + return type.name; }, @@ -135,9 +142,9 @@ var APIDoc = React.createClass({ {method.modifiers.length && {method.modifiers.join(' ') + ' '} } - {method.name}( + {method.name} - {method.params + ({method.params .map((param) => { var res = param.name; if (param.typehint) { @@ -145,9 +152,8 @@ var APIDoc = React.createClass({ } return res; }) - .join(', ')} + .join(', ')}) - ) {method.docblock && {this.removeCommentsFromDocblock(method.docblock)} diff --git a/website/server/extractDocs.js b/website/server/extractDocs.js index cf3c9e75c..b8aa3e6cf 100644 --- a/website/server/extractDocs.js +++ b/website/server/extractDocs.js @@ -38,14 +38,13 @@ function componentsToMarkdown(type, json, filepath, i) { var components = [ '../Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js', '../Libraries/Components/DatePicker/DatePickerIOS.ios.js', - '../Libraries/Text/ExpandingText.js', '../Libraries/Image/Image.ios.js', '../Libraries/Components/ListView/ListView.js', '../Libraries/Components/MapView/MapView.js', '../Libraries/Components/Navigation/NavigatorIOS.ios.js', '../Libraries/Picker/PickerIOS.ios.js', '../Libraries/Components/ScrollView/ScrollView.js', - '../Libraries/Components/Slider/Slider.js', + '../Libraries/Components/SliderIOS/SliderIOS.js', '../Libraries/Components/SwitchIOS/SwitchIOS.ios.js', '../Libraries/Components/TabBarIOS/TabBarIOS.ios.js', '../Libraries/Text/Text.js', diff --git a/website/src/react-native/css/react-native.css b/website/src/react-native/css/react-native.css index b7bb73ada..f04b8d74a 100644 --- a/website/src/react-native/css/react-native.css +++ b/website/src/react-native/css/react-native.css @@ -906,6 +906,7 @@ div[data-twttr-id] iframe { .propTitle { font-weight: bold; + font-size: 16px; } .prop { From 98097caa6f6e9967c64cdaa3c750d14ac0761710 Mon Sep 17 00:00:00 2001 From: Amjad Masad Date: Thu, 19 Mar 2015 17:46:43 -0700 Subject: [PATCH 63/79] react-native-cli initial commit A cli package that is responsible for: * starting a new react-native project * forwarding all other commands to a cli module in react-native * currently cli.js knows how to start the webserver, in the future it may do things like build the app etc. --- cli.js | 48 ++++++++++++++++++++ react-native-cli/index.js | 82 +++++++++++++++++++++++++++++++++++ react-native-cli/package.json | 9 ++++ 3 files changed, 139 insertions(+) create mode 100644 cli.js create mode 100755 react-native-cli/index.js create mode 100644 react-native-cli/package.json diff --git a/cli.js b/cli.js new file mode 100644 index 000000000..8a1a306b6 --- /dev/null +++ b/cli.js @@ -0,0 +1,48 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + */ + +'use strict'; + +var spawn = require('child_process').spawn; +var path = require('path'); + +function printUsage() { + console.log([ + 'Usage: react-native ', + '', + 'Commands:', + ' start: starts the webserver', + ].join('\n')); + process.exit(1); +} + +function run() { + var args = process.argv.slice(2); + if (args.length === 0) { + printUsage(); + } + + switch (args[0]) { + case 'start': + spawn('sh', [ + path.resolve(__dirname, 'packager', 'packager.sh'), + '--projectRoots', + process.cwd(), + ], {stdio: 'inherit'}); + break; + default: + console.error('Command `%s` unrecognized', args[0]); + printUsage(); + } + // Here goes any cli commands we need to +} + +function init() { + spawn('sh', [path.resolve(__dirname, 'init.sh')], {stdio:'inherit'}); +} + +module.exports = { + run: run, + init: init, +}; diff --git a/react-native-cli/index.js b/react-native-cli/index.js new file mode 100755 index 000000000..cc69da9d5 --- /dev/null +++ b/react-native-cli/index.js @@ -0,0 +1,82 @@ +#!/usr/bin/env node + +/** + * Copyright 2004-present Facebook. All Rights Reserved. + */ + +var spawn = require('child_process').spawn; +var path = require('path'); + +var CLI_MODULE_PATH = path.resolve( + process.cwd(), + 'node_modules', + 'react-native', + 'cli' +); + +var cli; +try { + cli = require(CLI_MODULE_PATH); +} catch(e) {} + +if (cli) { + cli.run(); +} else { + var args = process.argv.slice(2); + if (args.length === 0) { + console.error( + 'You did not pass any commands, did you mean to run init?' + ); + process.exit(1); + } + + if (args[0] === 'init') { + init(); + } else { + console.error( + 'Command `%s` unrecognized.' + + 'Did you mean to run this inside a react-native project?', + args[0] + ); + process.exit(1); + } +} + +function init() { + console.log( + 'This will walk you through creating a new react-native project', + 'in the current directory' + ); + + console.log('Running npm init'); + run('npm init', function(e) { + if (e) { + console.error('npm init failed'); + process.exit(1); + } + + run('npm install --save react-native', function(e) { + if (e) { + console.error('`npm install --save react-native` failed'); + process.exit(1); + } + + var cli = require(CLI_MODULE_PATH); + cli.init(); + }); + }); +} + +function run(command, cb) { + var parts = command.split(/\s+/); + var cmd = parts[0]; + var args = parts.slice(1); + var proc = spawn(cmd, args, {stdio: 'inherit'}); + proc.on('close', function(code) { + if (code !== 0) { + cb(new Error('Command exited with a non-zero status')); + } else { + cb(null); + } + }); +} diff --git a/react-native-cli/package.json b/react-native-cli/package.json new file mode 100644 index 000000000..e0e19dd72 --- /dev/null +++ b/react-native-cli/package.json @@ -0,0 +1,9 @@ +{ + "name": "react-native-cli", + "version": "0.0.0", + "description": "The ReactNative cli tools", + "main": "index.js", + "bin": { + "react-native": "index.js" + } +} From 6f727bc811aa5f96919baca9af2704e5d847e614 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Fri, 20 Mar 2015 14:34:34 -0700 Subject: [PATCH 64/79] Manually start packager and print logs when tests fail --- .travis.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4d290f162..a3b4ab195 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,12 +4,24 @@ before_install: - brew reinstall xctool install: - npm install +before_script: - npm test -env: - - secure: "g8Xjbslq4R+3oLVgBvXM5QhiJ+7q+H+dH4+sXReyyZ64M5gf32U7oOjQNVkdx79dnGFc6a619otGsX4RiEkQlkiR+4uCgJUIgPwN4YFCIgYu4Z/0FnbbRu5yyywh5zv4WwGmAtMkgGztoMBnps5gCiPUM/RGIqwVk0Ghbmh5c2k=" + - (npm start > packager.log 2>&1 &) && echo $! > packager.pid + script: ./build.sh 8.1 + +after_script: + - pkill -9 `cat packager.pid` + - cat packager.log + - rm packager.log + - rm packager.pid + # Automatically publish the website after_success: '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && (cd website; npm install; ./setup.sh; ./publish.sh; echo) || echo' + +env: + - secure: "g8Xjbslq4R+3oLVgBvXM5QhiJ+7q+H+dH4+sXReyyZ64M5gf32U7oOjQNVkdx79dnGFc6a619otGsX4RiEkQlkiR+4uCgJUIgPwN4YFCIgYu4Z/0FnbbRu5yyywh5zv4WwGmAtMkgGztoMBnps5gCiPUM/RGIqwVk0Ghbmh5c2k=" + branches: only: - master From aa4520345b33e9aadf818014eb12d9e0f4060854 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Fri, 20 Mar 2015 14:52:23 -0700 Subject: [PATCH 65/79] Use watchman on Travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a3b4ab195..bb48245fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ before_install: - brew update - brew reinstall xctool install: + - brew install watchman - npm install before_script: - npm test From 61d40c04a2767f4f2efce5132a138fd84d9d8155 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Fri, 20 Mar 2015 15:05:54 -0700 Subject: [PATCH 66/79] Use -F instead of cat --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bb48245fb..4af3669f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ before_script: script: ./build.sh 8.1 after_script: - - pkill -9 `cat packager.pid` + - pkill -9 -F packager.pid - cat packager.log - rm packager.log - rm packager.pid From 031266fbdfcd31c4bb5f116cacbd41d3a9b11334 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Fri, 20 Mar 2015 08:43:51 -0700 Subject: [PATCH 67/79] Updates from Thu 19 Mar - [ReactNative] Add root package.json name back | Tadeu Zagallo - [react-packager] Make sure projectRoots is converted to an array | Amjad Masad - [ReactNative] Init script that bootstraps new Xcode project | Alex Kotliarskyi - [ReactNative] New SampleApp | Alex Kotliarskyi - [ReactNative] Touchable invoke press on longPress when longPress handler missing | Eric Vicenti - [ReactNative] Commit missing RCTWebSocketDebugger.xcodeproj | Alex Kotliarskyi - [ReactNative] Add Custom Components folder | Christopher Chedeau - [react-packager] Hash cache file name information to avoid long names | Amjad Masad - [ReactNative] Put all iOS-related files in a subfolder | Alex Kotliarskyi - [react-packager] Fix OOM | Amjad Masad - [ReactNative] Bring Chrome debugger to OSS. Part 2 | Alex Kotliarskyi - [ReactNative] Add search to UIExplorer | Tadeu Zagallo - [ReactNative][RFC] Bring Chrome debugger to OSS. Part 1 | Alex Kotliarskyi - [ReactNative] Return the appropriate status code from XHR | Tadeu Zagallo - [ReactNative] Make JS stack traces in Xcode prettier | Alex Kotliarskyi - [ReactNative] Remove duplicate package.json with the same name | Christopher Chedeau - [ReactNative] Remove invariant from require('react-native') | Christopher Chedeau - [ReactNative] Remove ListViewDataSource from require('react-native') | Christopher Chedeau - [react-packager] Add assetRoots option | Amjad Masad - Convert UIExplorer to ListView | Christopher Chedeau - purge rni | Basil Hosmer - [ReactNative] s/render*View/render/ in | Christopher Chedeau --- Examples/2048/2048.xcodeproj/project.pbxproj | 15 +- Examples/2048/{ => 2048}/AppDelegate.h | 0 Examples/2048/{ => 2048}/AppDelegate.m | 0 .../{ => 2048}/Base.lproj/LaunchScreen.xib | 0 .../AppIcon.appiconset/Contents.json | 0 Examples/2048/{ => 2048}/Info.plist | 0 Examples/2048/{ => 2048}/main.m | 0 .../Movies/Movies.xcodeproj/project.pbxproj | 15 +- Examples/Movies/{ => Movies}/AppDelegate.h | 0 Examples/Movies/{ => Movies}/AppDelegate.m | 0 .../{ => Movies}/Base.lproj/LaunchScreen.xib | 0 .../AppIcon.appiconset/Contents.json | 0 Examples/Movies/{ => Movies}/Info.plist | 0 Examples/Movies/{ => Movies}/main.m | 0 .../SampleApp.xcodeproj/project.pbxproj | 538 +++++ .../xcshareddata/xcschemes/SampleApp.xcscheme | 88 + .../SampleApp}/AppDelegate.h | 0 Examples/SampleApp/SampleApp/AppDelegate.m | 44 + .../SampleApp/Base.lproj/LaunchScreen.xib | 41 + .../AppIcon.appiconset/Contents.json | 0 Examples/SampleApp/SampleApp/Info.plist | 38 + Examples/SampleApp/SampleApp/main.m | 11 + Examples/SampleApp/index.ios.js | 49 + .../TicTacToe.xcodeproj/project.pbxproj | 15 +- Examples/TicTacToe/TicTacToe/AppDelegate.h | 9 + .../TicTacToe/{ => TicTacToe}/AppDelegate.m | 0 .../Base.lproj/LaunchScreen.xib | 0 .../AppIcon.appiconset/Contents.json | 38 + Examples/TicTacToe/{ => TicTacToe}/Info.plist | 0 Examples/TicTacToe/{ => TicTacToe}/main.m | 0 Examples/UIExplorer/CameraRollView.ios.js | 5 +- .../UIExplorer.xcodeproj/project.pbxproj | 49 +- .../UIExplorer/{ => UIExplorer}/AppDelegate.h | 0 .../UIExplorer/{ => UIExplorer}/AppDelegate.m | 0 .../Base.lproj/LaunchScreen.xib | 0 .../AppIcon.appiconset/Contents.json | 0 .../AppIcon.appiconset/uie_icon@2x-1.png | Bin .../AppIcon.appiconset/uie_icon@2x-2.png | Bin .../AppIcon.appiconset/uie_icon@2x-3.png | Bin .../AppIcon.appiconset/uie_icon@2x-4.png | Bin .../AppIcon.appiconset/uie_icon@2x-5.png | Bin .../AppIcon.appiconset/uie_icon@2x.png | Bin .../story-background.imageset/Contents.json | 0 .../story-background.png | Bin .../story-background@2x.png | Bin .../Contents.json | 0 .../uie_comment_highlighted@2x.png | Bin .../uie_comment_normal.imageset/Contents.json | 0 .../uie_comment_normal@2x.png | Bin .../uie_thumb_normal.imageset/Contents.json | 0 .../uie_thumb_normal@2x.png | Bin .../uie_thumb_selected.imageset/Contents.json | 0 .../uie_thumb_selected@2x.png | Bin .../UIExplorer/{ => UIExplorer}/Info.plist | 0 Examples/UIExplorer/{ => UIExplorer}/main.m | 0 Examples/UIExplorer/UIExplorerList.js | 169 +- Examples/UIExplorer/WebViewExample.js | 8 +- .../Components/WebView/WebView.android.js | 8 +- Libraries/Components/WebView/WebView.ios.js | 8 +- Libraries/CustomComponents/LICENSE | 9 + .../ListView/ListView.js | 0 .../ListView/ListViewDataSource.js | 0 .../Initialization/ExceptionsManager.js | 71 + .../InitializeJavaScriptAppEngine.js | 30 +- .../{errorToString.js => parseErrorStack.js} | 22 +- .../project.pbxproj | 260 +++ .../RCTWebSocketExecutor.h | 9 + .../RCTWebSocketExecutor.m | 179 ++ Libraries/RCTWebSocketDebugger/SRWebSocket.h | 132 ++ Libraries/RCTWebSocketDebugger/SRWebSocket.m | 1761 +++++++++++++++++ .../react-native/react-native-interface.js | 38 +- Libraries/react-native/react-native.js | 2 - .../interactions/Touchable/Touchable.js | 2 +- ReactKit/Base/RCTRedBox.m | 11 +- ReactKit/Base/RCTRootView.m | 5 +- ReactKit/ReactKit.xcodeproj/project.pbxproj | 5 +- package.json | 3 +- packager/debugger.html | 112 ++ packager/init.sh | 44 + packager/launchChromeDevTools.applescript | 41 + packager/package.json | 4 +- packager/packager.js | 42 +- .../haste/DependencyGraph/index.js | 3 +- .../react-packager/src/JSTransformer/Cache.js | 29 +- .../src/JSTransformer/__tests__/Cache-test.js | 3 +- .../react-packager/src/JSTransformer/index.js | 2 +- packager/react-packager/src/Server/index.js | 25 +- packager/webSocketProxy.js | 41 + 88 files changed, 3824 insertions(+), 209 deletions(-) rename Examples/2048/{ => 2048}/AppDelegate.h (100%) rename Examples/2048/{ => 2048}/AppDelegate.m (100%) rename Examples/2048/{ => 2048}/Base.lproj/LaunchScreen.xib (100%) rename Examples/2048/{ => 2048}/Images.xcassets/AppIcon.appiconset/Contents.json (100%) rename Examples/2048/{ => 2048}/Info.plist (100%) rename Examples/2048/{ => 2048}/main.m (100%) rename Examples/Movies/{ => Movies}/AppDelegate.h (100%) rename Examples/Movies/{ => Movies}/AppDelegate.m (100%) rename Examples/Movies/{ => Movies}/Base.lproj/LaunchScreen.xib (100%) rename Examples/Movies/{ => Movies}/Images.xcassets/AppIcon.appiconset/Contents.json (100%) rename Examples/Movies/{ => Movies}/Info.plist (100%) rename Examples/Movies/{ => Movies}/main.m (100%) create mode 100644 Examples/SampleApp/SampleApp.xcodeproj/project.pbxproj create mode 100644 Examples/SampleApp/SampleApp.xcodeproj/xcshareddata/xcschemes/SampleApp.xcscheme rename Examples/{TicTacToe => SampleApp/SampleApp}/AppDelegate.h (100%) create mode 100644 Examples/SampleApp/SampleApp/AppDelegate.m create mode 100644 Examples/SampleApp/SampleApp/Base.lproj/LaunchScreen.xib rename Examples/{TicTacToe => SampleApp/SampleApp}/Images.xcassets/AppIcon.appiconset/Contents.json (100%) create mode 100644 Examples/SampleApp/SampleApp/Info.plist create mode 100644 Examples/SampleApp/SampleApp/main.m create mode 100644 Examples/SampleApp/index.ios.js create mode 100644 Examples/TicTacToe/TicTacToe/AppDelegate.h rename Examples/TicTacToe/{ => TicTacToe}/AppDelegate.m (100%) rename Examples/TicTacToe/{ => TicTacToe}/Base.lproj/LaunchScreen.xib (100%) create mode 100644 Examples/TicTacToe/TicTacToe/Images.xcassets/AppIcon.appiconset/Contents.json rename Examples/TicTacToe/{ => TicTacToe}/Info.plist (100%) rename Examples/TicTacToe/{ => TicTacToe}/main.m (100%) rename Examples/UIExplorer/{ => UIExplorer}/AppDelegate.h (100%) rename Examples/UIExplorer/{ => UIExplorer}/AppDelegate.m (100%) rename Examples/UIExplorer/{ => UIExplorer}/Base.lproj/LaunchScreen.xib (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/AppIcon.appiconset/Contents.json (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/AppIcon.appiconset/uie_icon@2x-1.png (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/AppIcon.appiconset/uie_icon@2x-2.png (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/AppIcon.appiconset/uie_icon@2x-3.png (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/AppIcon.appiconset/uie_icon@2x-4.png (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/AppIcon.appiconset/uie_icon@2x-5.png (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/AppIcon.appiconset/uie_icon@2x.png (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/story-background.imageset/Contents.json (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/story-background.imageset/story-background.png (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/story-background.imageset/story-background@2x.png (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/uie_comment_highlighted.imageset/Contents.json (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/uie_comment_highlighted.imageset/uie_comment_highlighted@2x.png (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/uie_comment_normal.imageset/Contents.json (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/uie_comment_normal.imageset/uie_comment_normal@2x.png (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/uie_thumb_normal.imageset/Contents.json (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/uie_thumb_normal.imageset/uie_thumb_normal@2x.png (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/uie_thumb_selected.imageset/Contents.json (100%) rename Examples/UIExplorer/{ => UIExplorer}/Images.xcassets/uie_thumb_selected.imageset/uie_thumb_selected@2x.png (100%) rename Examples/UIExplorer/{ => UIExplorer}/Info.plist (100%) rename Examples/UIExplorer/{ => UIExplorer}/main.m (100%) create mode 100644 Libraries/CustomComponents/LICENSE rename Libraries/{Components => CustomComponents}/ListView/ListView.js (100%) rename Libraries/{Components => CustomComponents}/ListView/ListViewDataSource.js (100%) create mode 100644 Libraries/JavaScriptAppEngine/Initialization/ExceptionsManager.js rename Libraries/JavaScriptAppEngine/Initialization/{errorToString.js => parseErrorStack.js} (55%) create mode 100644 Libraries/RCTWebSocketDebugger/RCTWebSocketDebugger.xcodeproj/project.pbxproj create mode 100644 Libraries/RCTWebSocketDebugger/RCTWebSocketExecutor.h create mode 100644 Libraries/RCTWebSocketDebugger/RCTWebSocketExecutor.m create mode 100644 Libraries/RCTWebSocketDebugger/SRWebSocket.h create mode 100644 Libraries/RCTWebSocketDebugger/SRWebSocket.m create mode 100644 packager/debugger.html create mode 100755 packager/init.sh create mode 100755 packager/launchChromeDevTools.applescript create mode 100644 packager/webSocketProxy.js diff --git a/Examples/2048/2048.xcodeproj/project.pbxproj b/Examples/2048/2048.xcodeproj/project.pbxproj index 256cd7aef..ba1907ff1 100644 --- a/Examples/2048/2048.xcodeproj/project.pbxproj +++ b/Examples/2048/2048.xcodeproj/project.pbxproj @@ -34,12 +34,12 @@ /* Begin PBXFileReference section */ 13B07F961A680F5B00A75B9A /* 2048.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 2048.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = 2048/AppDelegate.h; sourceTree = ""; }; + 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = 2048/AppDelegate.m; sourceTree = ""; }; 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = 2048/Images.xcassets; sourceTree = ""; }; + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = 2048/Info.plist; sourceTree = ""; }; + 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = 2048/main.m; sourceTree = ""; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; 834D32361A76971A00F38302 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ @@ -217,6 +217,7 @@ 13B07FB21A68108700A75B9A /* Base */, ); name = LaunchScreen.xib; + path = 2048; sourceTree = ""; }; /* End PBXVariantGroup section */ @@ -226,7 +227,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/2048/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = 2048; @@ -237,7 +238,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/2048/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = 2048; diff --git a/Examples/2048/AppDelegate.h b/Examples/2048/2048/AppDelegate.h similarity index 100% rename from Examples/2048/AppDelegate.h rename to Examples/2048/2048/AppDelegate.h diff --git a/Examples/2048/AppDelegate.m b/Examples/2048/2048/AppDelegate.m similarity index 100% rename from Examples/2048/AppDelegate.m rename to Examples/2048/2048/AppDelegate.m diff --git a/Examples/2048/Base.lproj/LaunchScreen.xib b/Examples/2048/2048/Base.lproj/LaunchScreen.xib similarity index 100% rename from Examples/2048/Base.lproj/LaunchScreen.xib rename to Examples/2048/2048/Base.lproj/LaunchScreen.xib diff --git a/Examples/2048/Images.xcassets/AppIcon.appiconset/Contents.json b/Examples/2048/2048/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Examples/2048/Images.xcassets/AppIcon.appiconset/Contents.json rename to Examples/2048/2048/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/Examples/2048/Info.plist b/Examples/2048/2048/Info.plist similarity index 100% rename from Examples/2048/Info.plist rename to Examples/2048/2048/Info.plist diff --git a/Examples/2048/main.m b/Examples/2048/2048/main.m similarity index 100% rename from Examples/2048/main.m rename to Examples/2048/2048/main.m diff --git a/Examples/Movies/Movies.xcodeproj/project.pbxproj b/Examples/Movies/Movies.xcodeproj/project.pbxproj index 5d450af8b..3d22844d8 100644 --- a/Examples/Movies/Movies.xcodeproj/project.pbxproj +++ b/Examples/Movies/Movies.xcodeproj/project.pbxproj @@ -52,12 +52,12 @@ 134180151AA91740003F314A /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = ../../Libraries/Network/RCTNetwork.xcodeproj; sourceTree = ""; }; 13442C001AA90E7D0037E5B0 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = ../../Libraries/Image/RCTImage.xcodeproj; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* Movies.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Movies.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Movies/AppDelegate.h; sourceTree = ""; }; + 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Movies/AppDelegate.m; sourceTree = ""; }; 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Movies/Images.xcassets; sourceTree = ""; }; + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Movies/Info.plist; sourceTree = ""; }; + 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Movies/main.m; sourceTree = ""; }; 587650F61A9EB120008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = SOURCE_ROOT; }; 587650F91A9EB120008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ @@ -277,6 +277,7 @@ 13B07FB21A68108700A75B9A /* Base */, ); name = LaunchScreen.xib; + path = Movies; sourceTree = ""; }; /* End PBXVariantGroup section */ @@ -291,7 +292,7 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../ReactKit/**", ); - INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Movies/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -311,7 +312,7 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../ReactKit/**", ); - INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Movies/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", diff --git a/Examples/Movies/AppDelegate.h b/Examples/Movies/Movies/AppDelegate.h similarity index 100% rename from Examples/Movies/AppDelegate.h rename to Examples/Movies/Movies/AppDelegate.h diff --git a/Examples/Movies/AppDelegate.m b/Examples/Movies/Movies/AppDelegate.m similarity index 100% rename from Examples/Movies/AppDelegate.m rename to Examples/Movies/Movies/AppDelegate.m diff --git a/Examples/Movies/Base.lproj/LaunchScreen.xib b/Examples/Movies/Movies/Base.lproj/LaunchScreen.xib similarity index 100% rename from Examples/Movies/Base.lproj/LaunchScreen.xib rename to Examples/Movies/Movies/Base.lproj/LaunchScreen.xib diff --git a/Examples/Movies/Images.xcassets/AppIcon.appiconset/Contents.json b/Examples/Movies/Movies/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Examples/Movies/Images.xcassets/AppIcon.appiconset/Contents.json rename to Examples/Movies/Movies/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/Examples/Movies/Info.plist b/Examples/Movies/Movies/Info.plist similarity index 100% rename from Examples/Movies/Info.plist rename to Examples/Movies/Movies/Info.plist diff --git a/Examples/Movies/main.m b/Examples/Movies/Movies/main.m similarity index 100% rename from Examples/Movies/main.m rename to Examples/Movies/Movies/main.m diff --git a/Examples/SampleApp/SampleApp.xcodeproj/project.pbxproj b/Examples/SampleApp/SampleApp.xcodeproj/project.pbxproj new file mode 100644 index 000000000..377c66ab2 --- /dev/null +++ b/Examples/SampleApp/SampleApp.xcodeproj/project.pbxproj @@ -0,0 +1,538 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; + 00C302E61ABCBA2D00DB3ED1 /* libRCTAdSupport.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302B41ABCB8E700DB3ED1 /* libRCTAdSupport.a */; }; + 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; + 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; + 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; + 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; + 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; + 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; + 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; + 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; + 8323482C1A77B59500B55238 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832348291A77B50100B55238 /* libReactKit.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RCTActionSheet; + }; + 00C302B31ABCB8E700DB3ED1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; + remoteInfo = RCTAdSupport; + }; + 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RCTGeolocation; + }; + 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B5115D1A9E6B3D00147676; + remoteInfo = RCTImage; + }; + 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B511DB1A9E6C8500147676; + remoteInfo = RCTNetwork; + }; + 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; + remoteInfo = RCTVibration; + }; + 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 58B5119B1A9E6C1200147676; + remoteInfo = RCTText; + }; + 832348281A77B50100B55238 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 834D32361A76971A00F38302 /* ReactKit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; + remoteInfo = ReactKit; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../../Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; + 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAdSupport.xcodeproj; path = ../../Libraries/AdSupport/RCTAdSupport.xcodeproj; sourceTree = ""; }; + 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = ../../Libraries/Geolocation/RCTGeolocation.xcodeproj; sourceTree = ""; }; + 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = ../../Libraries/Image/RCTImage.xcodeproj; sourceTree = ""; }; + 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = ../../Libraries/Network/RCTNetwork.xcodeproj; sourceTree = ""; }; + 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = ../../Libraries/Vibration/RCTVibration.xcodeproj; sourceTree = ""; }; + 13B07F961A680F5B00A75B9A /* SampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = SampleApp/AppDelegate.h; sourceTree = ""; }; + 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = SampleApp/AppDelegate.m; sourceTree = ""; }; + 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; + 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SampleApp/Images.xcassets; sourceTree = ""; }; + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = SampleApp/Info.plist; sourceTree = ""; }; + 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = SampleApp/main.m; sourceTree = ""; }; + 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; + 834D32361A76971A00F38302 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, + 00C302E61ABCBA2D00DB3ED1 /* libRCTAdSupport.a in Frameworks */, + 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, + 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, + 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, + 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, + 8323482C1A77B59500B55238 /* libReactKit.a in Frameworks */, + 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 00C302A81ABCB8CE00DB3ED1 /* Products */ = { + isa = PBXGroup; + children = ( + 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, + ); + name = Products; + sourceTree = ""; + }; + 00C302B01ABCB8E700DB3ED1 /* Products */ = { + isa = PBXGroup; + children = ( + 00C302B41ABCB8E700DB3ED1 /* libRCTAdSupport.a */, + ); + name = Products; + sourceTree = ""; + }; + 00C302B61ABCB90400DB3ED1 /* Products */ = { + isa = PBXGroup; + children = ( + 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, + ); + name = Products; + sourceTree = ""; + }; + 00C302BC1ABCB91800DB3ED1 /* Products */ = { + isa = PBXGroup; + children = ( + 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, + ); + name = Products; + sourceTree = ""; + }; + 00C302D41ABCB9D200DB3ED1 /* Products */ = { + isa = PBXGroup; + children = ( + 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, + ); + name = Products; + sourceTree = ""; + }; + 00C302E01ABCB9EE00DB3ED1 /* Products */ = { + isa = PBXGroup; + children = ( + 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, + ); + name = Products; + sourceTree = ""; + }; + 13B07FAE1A68108700A75B9A /* SampleApp */ = { + isa = PBXGroup; + children = ( + 13B07FAF1A68108700A75B9A /* AppDelegate.h */, + 13B07FB01A68108700A75B9A /* AppDelegate.m */, + 13B07FB51A68108700A75B9A /* Images.xcassets */, + 13B07FB61A68108700A75B9A /* Info.plist */, + 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, + 13B07FB71A68108700A75B9A /* main.m */, + ); + name = SampleApp; + sourceTree = ""; + }; + 832341AE1AAA6A7D00B99B32 /* Libraries */ = { + isa = PBXGroup; + children = ( + 834D32361A76971A00F38302 /* ReactKit.xcodeproj */, + 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, + 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, + 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */, + 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, + 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, + 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, + 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, + ); + name = Libraries; + sourceTree = ""; + }; + 832341B11AAA6A8300B99B32 /* Products */ = { + isa = PBXGroup; + children = ( + 832341B51AAA6A8300B99B32 /* libRCTText.a */, + ); + name = Products; + sourceTree = ""; + }; + 832348241A77B50100B55238 /* Products */ = { + isa = PBXGroup; + children = ( + 832348291A77B50100B55238 /* libReactKit.a */, + ); + name = Products; + sourceTree = ""; + }; + 83CBB9F61A601CBA00E9B192 = { + isa = PBXGroup; + children = ( + 13B07FAE1A68108700A75B9A /* SampleApp */, + 832341AE1AAA6A7D00B99B32 /* Libraries */, + 83CBBA001A601CBA00E9B192 /* Products */, + ); + sourceTree = ""; + }; + 83CBBA001A601CBA00E9B192 /* Products */ = { + isa = PBXGroup; + children = ( + 13B07F961A680F5B00A75B9A /* SampleApp.app */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 13B07F861A680F5B00A75B9A /* SampleApp */ = { + isa = PBXNativeTarget; + buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "SampleApp" */; + buildPhases = ( + 13B07F871A680F5B00A75B9A /* Sources */, + 13B07F8C1A680F5B00A75B9A /* Frameworks */, + 13B07F8E1A680F5B00A75B9A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SampleApp; + productName = "Hello World"; + productReference = 13B07F961A680F5B00A75B9A /* SampleApp.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 83CBB9F71A601CBA00E9B192 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = Facebook; + }; + buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "SampleApp" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 83CBB9F61A601CBA00E9B192; + productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; + ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; + }, + { + ProductGroup = 00C302B01ABCB8E700DB3ED1 /* Products */; + ProjectRef = 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */; + }, + { + ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; + ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; + }, + { + ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; + ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; + }, + { + ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; + ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; + }, + { + ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; + ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; + }, + { + ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; + ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; + }, + { + ProductGroup = 832348241A77B50100B55238 /* Products */; + ProjectRef = 834D32361A76971A00F38302 /* ReactKit.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 13B07F861A680F5B00A75B9A /* SampleApp */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTActionSheet.a; + remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 00C302B41ABCB8E700DB3ED1 /* libRCTAdSupport.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTAdSupport.a; + remoteRef = 00C302B31ABCB8E700DB3ED1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTGeolocation.a; + remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTImage.a; + remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTNetwork.a; + remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTVibration.a; + remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTText.a; + remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 832348291A77B50100B55238 /* libReactKit.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libReactKit.a; + remoteRef = 832348281A77B50100B55238 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 13B07F8E1A680F5B00A75B9A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, + 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 13B07F871A680F5B00A75B9A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, + 13B07FC11A68108700A75B9A /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + 13B07FB21A68108700A75B9A /* Base */, + ); + name = LaunchScreen.xib; + path = SampleApp; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 13B07F941A680F5B00A75B9A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = "$(SRCROOT)/SampleApp/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = SampleApp; + }; + name = Debug; + }; + 13B07F951A680F5B00A75B9A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = "$(SRCROOT)/SampleApp/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = SampleApp; + }; + name = Release; + }; + 83CBBA201A601CBA00E9B192 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 83CBBA211A601CBA00E9B192 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "SampleApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 13B07F941A680F5B00A75B9A /* Debug */, + 13B07F951A680F5B00A75B9A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "SampleApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 83CBBA201A601CBA00E9B192 /* Debug */, + 83CBBA211A601CBA00E9B192 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; +} diff --git a/Examples/SampleApp/SampleApp.xcodeproj/xcshareddata/xcschemes/SampleApp.xcscheme b/Examples/SampleApp/SampleApp.xcodeproj/xcshareddata/xcschemes/SampleApp.xcscheme new file mode 100644 index 000000000..a3375a020 --- /dev/null +++ b/Examples/SampleApp/SampleApp.xcodeproj/xcshareddata/xcschemes/SampleApp.xcscheme @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/TicTacToe/AppDelegate.h b/Examples/SampleApp/SampleApp/AppDelegate.h similarity index 100% rename from Examples/TicTacToe/AppDelegate.h rename to Examples/SampleApp/SampleApp/AppDelegate.h diff --git a/Examples/SampleApp/SampleApp/AppDelegate.m b/Examples/SampleApp/SampleApp/AppDelegate.m new file mode 100644 index 000000000..3fbc77902 --- /dev/null +++ b/Examples/SampleApp/SampleApp/AppDelegate.m @@ -0,0 +1,44 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "AppDelegate.h" + +#import "RCTRootView.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + NSURL *jsCodeLocation; + RCTRootView *rootView = [[RCTRootView alloc] init]; + + // Loading JavaScript code - uncomment the one you want. + + // OPTION 1 + // Load from development server. Start the server from the repository root: + // + // $ npm start + // + // To run on device, change `localhost` to the IP address of your computer, and make sure your computer and + // iOS device are on the same Wi-Fi network. + jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/SampleApp/index.ios.runModule.bundle"]; + + // OPTION 2 + // Load from pre-bundled file on disk. To re-generate the static bundle, run + // + // $ curl http://localhost:8081/Examples/SampleApp/index.ios.runModule.bundle -o main.jsbundle + // + // and uncomment the next following line + // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; + + rootView.scriptURL = jsCodeLocation; + rootView.moduleName = @"SampleApp"; + + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + UIViewController *rootViewController = [[UIViewController alloc] init]; + rootViewController.view = rootView; + self.window.rootViewController = rootViewController; + [self.window makeKeyAndVisible]; + return YES; +} + +@end diff --git a/Examples/SampleApp/SampleApp/Base.lproj/LaunchScreen.xib b/Examples/SampleApp/SampleApp/Base.lproj/LaunchScreen.xib new file mode 100644 index 000000000..9821f97e4 --- /dev/null +++ b/Examples/SampleApp/SampleApp/Base.lproj/LaunchScreen.xib @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/TicTacToe/Images.xcassets/AppIcon.appiconset/Contents.json b/Examples/SampleApp/SampleApp/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Examples/TicTacToe/Images.xcassets/AppIcon.appiconset/Contents.json rename to Examples/SampleApp/SampleApp/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/Examples/SampleApp/SampleApp/Info.plist b/Examples/SampleApp/SampleApp/Info.plist new file mode 100644 index 000000000..15c0472c4 --- /dev/null +++ b/Examples/SampleApp/SampleApp/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + org.react.native.example.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/SampleApp/SampleApp/main.m b/Examples/SampleApp/SampleApp/main.m new file mode 100644 index 000000000..3c8987ce3 --- /dev/null +++ b/Examples/SampleApp/SampleApp/main.m @@ -0,0 +1,11 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/Examples/SampleApp/index.ios.js b/Examples/SampleApp/index.ios.js new file mode 100644 index 000000000..97ff012e7 --- /dev/null +++ b/Examples/SampleApp/index.ios.js @@ -0,0 +1,49 @@ +/** + * Sample React Native App + * https://github.com/facebook/react-native + */ +'use strict'; + +var React = require('react-native'); +var { + AppRegistry, + StyleSheet, + Text, + View, +} = React; + +var SampleApp = React.createClass({ + render: function() { + return ( + + + Welcome to React Native! + + + To get started, edit index.ios.js{'\n'} + Press Cmd+R to reload + + + ); + } +}); + +var styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + backgroundColor: '#F5FCFF', + }, + welcome: { + fontSize: 20, + textAlign: 'center', + margin: 10, + }, + instructions: { + textAlign: 'center', + color: '#333333', + }, +}); + +AppRegistry.registerComponent('SampleApp', () => SampleApp); diff --git a/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj b/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj index 7cc9c357b..48b484437 100644 --- a/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj +++ b/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj @@ -43,12 +43,12 @@ /* Begin PBXFileReference section */ 134180381AA917ED003F314A /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = ../../Libraries/Image/RCTImage.xcodeproj; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* TicTacToe.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TicTacToe.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = TicTacToe/AppDelegate.h; sourceTree = ""; }; + 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = TicTacToe/AppDelegate.m; sourceTree = ""; }; 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = TicTacToe/Images.xcassets; sourceTree = ""; }; + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = TicTacToe/Info.plist; sourceTree = ""; }; + 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = TicTacToe/main.m; sourceTree = ""; }; 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; 587650E31A9EB0DF008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ @@ -247,6 +247,7 @@ 13B07FB21A68108700A75B9A /* Base */, ); name = LaunchScreen.xib; + path = TicTacToe; sourceTree = ""; }; /* End PBXVariantGroup section */ @@ -256,7 +257,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/TicTacToe/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = "-ObjC"; @@ -268,7 +269,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/TicTacToe/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = "-ObjC"; diff --git a/Examples/TicTacToe/TicTacToe/AppDelegate.h b/Examples/TicTacToe/TicTacToe/AppDelegate.h new file mode 100644 index 000000000..062fb99c0 --- /dev/null +++ b/Examples/TicTacToe/TicTacToe/AppDelegate.h @@ -0,0 +1,9 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import + +@interface AppDelegate : UIResponder + +@property (nonatomic, strong) UIWindow *window; + +@end diff --git a/Examples/TicTacToe/AppDelegate.m b/Examples/TicTacToe/TicTacToe/AppDelegate.m similarity index 100% rename from Examples/TicTacToe/AppDelegate.m rename to Examples/TicTacToe/TicTacToe/AppDelegate.m diff --git a/Examples/TicTacToe/Base.lproj/LaunchScreen.xib b/Examples/TicTacToe/TicTacToe/Base.lproj/LaunchScreen.xib similarity index 100% rename from Examples/TicTacToe/Base.lproj/LaunchScreen.xib rename to Examples/TicTacToe/TicTacToe/Base.lproj/LaunchScreen.xib diff --git a/Examples/TicTacToe/TicTacToe/Images.xcassets/AppIcon.appiconset/Contents.json b/Examples/TicTacToe/TicTacToe/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..118c98f74 --- /dev/null +++ b/Examples/TicTacToe/TicTacToe/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,38 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/TicTacToe/Info.plist b/Examples/TicTacToe/TicTacToe/Info.plist similarity index 100% rename from Examples/TicTacToe/Info.plist rename to Examples/TicTacToe/TicTacToe/Info.plist diff --git a/Examples/TicTacToe/main.m b/Examples/TicTacToe/TicTacToe/main.m similarity index 100% rename from Examples/TicTacToe/main.m rename to Examples/TicTacToe/TicTacToe/main.m diff --git a/Examples/UIExplorer/CameraRollView.ios.js b/Examples/UIExplorer/CameraRollView.ios.js index f0ee92afc..c8a9a2829 100644 --- a/Examples/UIExplorer/CameraRollView.ios.js +++ b/Examples/UIExplorer/CameraRollView.ios.js @@ -11,7 +11,6 @@ var { CameraRoll, Image, ListView, - ListViewDataSource, StyleSheet, View, } = React; @@ -73,7 +72,7 @@ var CameraRollView = React.createClass({ }, getInitialState: function() { - var ds = new ListViewDataSource({rowHasChanged: this._rowHasChanged}); + var ds = new ListView.DataSource({rowHasChanged: this._rowHasChanged}); return { assets: [], @@ -90,7 +89,7 @@ var CameraRollView = React.createClass({ * component to re-render its assets. */ rendererChanged: function() { - var ds = new ListViewDataSource({rowHasChanged: this._rowHasChanged}); + var ds = new ListView.DataSource({rowHasChanged: this._rowHasChanged}); this.state.dataSource = ds.cloneWithRows( groupByEveryN(this.state.assets, this.props.imagesPerRow) ); diff --git a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj index 6e214d3b9..59adccff3 100644 --- a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj +++ b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj @@ -8,6 +8,8 @@ /* Begin PBXBuildFile section */ 004D28A31AAF61C70097A701 /* UIExplorerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 004D28A21AAF61C70097A701 /* UIExplorerTests.m */; }; + 00D2771A1AB8C3E100DC1E48 /* libRCTWebSocketDebugger.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00D277131AB8C2C700DC1E48 /* libRCTWebSocketDebugger.a */; }; + 00D2771C1AB8C55500DC1E48 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 00D2771B1AB8C55500DC1E48 /* libicucore.dylib */; }; 13417FE91AA91432003F314A /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FE81AA91428003F314A /* libRCTImage.a */; }; 134180011AA9153C003F314A /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FEF1AA914B8003F314A /* libRCTText.a */; }; 134180021AA9153C003F314A /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FFF1AA91531003F314A /* libReactKit.a */; }; @@ -30,6 +32,13 @@ remoteGlobalIDString = 13B07F861A680F5B00A75B9A; remoteInfo = UIExplorer; }; + 00D277121AB8C2C700DC1E48 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00D2770E1AB8C2C700DC1E48 /* RCTWebSocketDebugger.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; + remoteInfo = RCTWebSocketDebugger; + }; 13417FE71AA91428003F314A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 13417FE31AA91428003F314A /* RCTImage.xcodeproj */; @@ -92,6 +101,8 @@ 004D289E1AAF61C70097A701 /* UIExplorerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UIExplorerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 004D28A11AAF61C70097A701 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 004D28A21AAF61C70097A701 /* UIExplorerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UIExplorerTests.m; sourceTree = ""; }; + 00D2770E1AB8C2C700DC1E48 /* RCTWebSocketDebugger.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocketDebugger.xcodeproj; path = ../../Libraries/RCTWebSocketDebugger/RCTWebSocketDebugger.xcodeproj; sourceTree = ""; }; + 00D2771B1AB8C55500DC1E48 /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = usr/lib/libicucore.dylib; sourceTree = SDKROOT; }; 13417FE31AA91428003F314A /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = ../../Libraries/Image/RCTImage.xcodeproj; sourceTree = ""; }; 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; 13417FFA1AA91531003F314A /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = ""; }; @@ -99,12 +110,12 @@ 134454551AAFCAAE003F0779 /* RCTAdSupport.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAdSupport.xcodeproj; path = ../../Libraries/AdSupport/RCTAdSupport.xcodeproj; sourceTree = ""; }; 134A8A201AACED6A00945AAE /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = ../../Libraries/Geolocation/RCTGeolocation.xcodeproj; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* UIExplorer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UIExplorer.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = UIExplorer/AppDelegate.h; sourceTree = ""; }; + 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = UIExplorer/AppDelegate.m; sourceTree = ""; }; 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = UIExplorer/Images.xcassets; sourceTree = ""; }; + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = UIExplorer/Info.plist; sourceTree = ""; }; + 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = UIExplorer/main.m; sourceTree = ""; }; 14E0EEC81AB118F7000DECC3 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = ../../Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj; sourceTree = ""; }; D85B82911AB6D5CE003F4FE2 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = ../../Libraries/Vibration/RCTVibration.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ @@ -121,6 +132,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 00D2771C1AB8C55500DC1E48 /* libicucore.dylib in Frameworks */, + 00D2771A1AB8C3E100DC1E48 /* libRCTWebSocketDebugger.a in Frameworks */, D85B829E1AB6D5D7003F4FE2 /* libRCTVibration.a in Frameworks */, 147CED4C1AB3532B00DA3E4C /* libRCTActionSheet.a in Frameworks */, 134454601AAFCABD003F0779 /* libRCTAdSupport.a in Frameworks */, @@ -152,6 +165,14 @@ name = "Supporting Files"; sourceTree = ""; }; + 00D2770F1AB8C2C700DC1E48 /* Products */ = { + isa = PBXGroup; + children = ( + 00D277131AB8C2C700DC1E48 /* libRCTWebSocketDebugger.a */, + ); + name = Products; + sourceTree = ""; + }; 1316A21D1AA397F400C0188E /* Libraries */ = { isa = PBXGroup; children = ( @@ -163,6 +184,8 @@ 13417FE31AA91428003F314A /* RCTImage.xcodeproj */, 134180261AA91779003F314A /* RCTNetwork.xcodeproj */, 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */, + 00D2770E1AB8C2C700DC1E48 /* RCTWebSocketDebugger.xcodeproj */, + 00D2771B1AB8C55500DC1E48 /* libicucore.dylib */, ); name = Libraries; sourceTree = ""; @@ -356,6 +379,10 @@ ProductGroup = D85B82921AB6D5CE003F4FE2 /* Products */; ProjectRef = D85B82911AB6D5CE003F4FE2 /* RCTVibration.xcodeproj */; }, + { + ProductGroup = 00D2770F1AB8C2C700DC1E48 /* Products */; + ProjectRef = 00D2770E1AB8C2C700DC1E48 /* RCTWebSocketDebugger.xcodeproj */; + }, { ProductGroup = 13417FFB1AA91531003F314A /* Products */; ProjectRef = 13417FFA1AA91531003F314A /* ReactKit.xcodeproj */; @@ -370,6 +397,13 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ + 00D277131AB8C2C700DC1E48 /* libRCTWebSocketDebugger.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTWebSocketDebugger.a; + remoteRef = 00D277121AB8C2C700DC1E48 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 13417FE81AA91428003F314A /* libRCTImage.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -482,6 +516,7 @@ 13B07FB21A68108700A75B9A /* Base */, ); name = LaunchScreen.xib; + path = UIExplorer; sourceTree = ""; }; /* End PBXVariantGroup section */ @@ -532,7 +567,7 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../ReactKit/**", ); - INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/UIExplorer/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = "-ObjC"; @@ -549,7 +584,7 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../ReactKit/**", ); - INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/UIExplorer/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = "-ObjC"; diff --git a/Examples/UIExplorer/AppDelegate.h b/Examples/UIExplorer/UIExplorer/AppDelegate.h similarity index 100% rename from Examples/UIExplorer/AppDelegate.h rename to Examples/UIExplorer/UIExplorer/AppDelegate.h diff --git a/Examples/UIExplorer/AppDelegate.m b/Examples/UIExplorer/UIExplorer/AppDelegate.m similarity index 100% rename from Examples/UIExplorer/AppDelegate.m rename to Examples/UIExplorer/UIExplorer/AppDelegate.m diff --git a/Examples/UIExplorer/Base.lproj/LaunchScreen.xib b/Examples/UIExplorer/UIExplorer/Base.lproj/LaunchScreen.xib similarity index 100% rename from Examples/UIExplorer/Base.lproj/LaunchScreen.xib rename to Examples/UIExplorer/UIExplorer/Base.lproj/LaunchScreen.xib diff --git a/Examples/UIExplorer/Images.xcassets/AppIcon.appiconset/Contents.json b/Examples/UIExplorer/UIExplorer/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Examples/UIExplorer/Images.xcassets/AppIcon.appiconset/Contents.json rename to Examples/UIExplorer/UIExplorer/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/Examples/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-1.png b/Examples/UIExplorer/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-1.png similarity index 100% rename from Examples/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-1.png rename to Examples/UIExplorer/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-1.png diff --git a/Examples/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-2.png b/Examples/UIExplorer/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-2.png similarity index 100% rename from Examples/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-2.png rename to Examples/UIExplorer/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-2.png diff --git a/Examples/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-3.png b/Examples/UIExplorer/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-3.png similarity index 100% rename from Examples/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-3.png rename to Examples/UIExplorer/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-3.png diff --git a/Examples/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-4.png b/Examples/UIExplorer/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-4.png similarity index 100% rename from Examples/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-4.png rename to Examples/UIExplorer/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-4.png diff --git a/Examples/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-5.png b/Examples/UIExplorer/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-5.png similarity index 100% rename from Examples/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-5.png rename to Examples/UIExplorer/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x-5.png diff --git a/Examples/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x.png b/Examples/UIExplorer/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x.png similarity index 100% rename from Examples/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x.png rename to Examples/UIExplorer/UIExplorer/Images.xcassets/AppIcon.appiconset/uie_icon@2x.png diff --git a/Examples/UIExplorer/Images.xcassets/story-background.imageset/Contents.json b/Examples/UIExplorer/UIExplorer/Images.xcassets/story-background.imageset/Contents.json similarity index 100% rename from Examples/UIExplorer/Images.xcassets/story-background.imageset/Contents.json rename to Examples/UIExplorer/UIExplorer/Images.xcassets/story-background.imageset/Contents.json diff --git a/Examples/UIExplorer/Images.xcassets/story-background.imageset/story-background.png b/Examples/UIExplorer/UIExplorer/Images.xcassets/story-background.imageset/story-background.png similarity index 100% rename from Examples/UIExplorer/Images.xcassets/story-background.imageset/story-background.png rename to Examples/UIExplorer/UIExplorer/Images.xcassets/story-background.imageset/story-background.png diff --git a/Examples/UIExplorer/Images.xcassets/story-background.imageset/story-background@2x.png b/Examples/UIExplorer/UIExplorer/Images.xcassets/story-background.imageset/story-background@2x.png similarity index 100% rename from Examples/UIExplorer/Images.xcassets/story-background.imageset/story-background@2x.png rename to Examples/UIExplorer/UIExplorer/Images.xcassets/story-background.imageset/story-background@2x.png diff --git a/Examples/UIExplorer/Images.xcassets/uie_comment_highlighted.imageset/Contents.json b/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_highlighted.imageset/Contents.json similarity index 100% rename from Examples/UIExplorer/Images.xcassets/uie_comment_highlighted.imageset/Contents.json rename to Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_highlighted.imageset/Contents.json diff --git a/Examples/UIExplorer/Images.xcassets/uie_comment_highlighted.imageset/uie_comment_highlighted@2x.png b/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_highlighted.imageset/uie_comment_highlighted@2x.png similarity index 100% rename from Examples/UIExplorer/Images.xcassets/uie_comment_highlighted.imageset/uie_comment_highlighted@2x.png rename to Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_highlighted.imageset/uie_comment_highlighted@2x.png diff --git a/Examples/UIExplorer/Images.xcassets/uie_comment_normal.imageset/Contents.json b/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_normal.imageset/Contents.json similarity index 100% rename from Examples/UIExplorer/Images.xcassets/uie_comment_normal.imageset/Contents.json rename to Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_normal.imageset/Contents.json diff --git a/Examples/UIExplorer/Images.xcassets/uie_comment_normal.imageset/uie_comment_normal@2x.png b/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_normal.imageset/uie_comment_normal@2x.png similarity index 100% rename from Examples/UIExplorer/Images.xcassets/uie_comment_normal.imageset/uie_comment_normal@2x.png rename to Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_normal.imageset/uie_comment_normal@2x.png diff --git a/Examples/UIExplorer/Images.xcassets/uie_thumb_normal.imageset/Contents.json b/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_normal.imageset/Contents.json similarity index 100% rename from Examples/UIExplorer/Images.xcassets/uie_thumb_normal.imageset/Contents.json rename to Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_normal.imageset/Contents.json diff --git a/Examples/UIExplorer/Images.xcassets/uie_thumb_normal.imageset/uie_thumb_normal@2x.png b/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_normal.imageset/uie_thumb_normal@2x.png similarity index 100% rename from Examples/UIExplorer/Images.xcassets/uie_thumb_normal.imageset/uie_thumb_normal@2x.png rename to Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_normal.imageset/uie_thumb_normal@2x.png diff --git a/Examples/UIExplorer/Images.xcassets/uie_thumb_selected.imageset/Contents.json b/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_selected.imageset/Contents.json similarity index 100% rename from Examples/UIExplorer/Images.xcassets/uie_thumb_selected.imageset/Contents.json rename to Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_selected.imageset/Contents.json diff --git a/Examples/UIExplorer/Images.xcassets/uie_thumb_selected.imageset/uie_thumb_selected@2x.png b/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_selected.imageset/uie_thumb_selected@2x.png similarity index 100% rename from Examples/UIExplorer/Images.xcassets/uie_thumb_selected.imageset/uie_thumb_selected@2x.png rename to Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_selected.imageset/uie_thumb_selected@2x.png diff --git a/Examples/UIExplorer/Info.plist b/Examples/UIExplorer/UIExplorer/Info.plist similarity index 100% rename from Examples/UIExplorer/Info.plist rename to Examples/UIExplorer/UIExplorer/Info.plist diff --git a/Examples/UIExplorer/main.m b/Examples/UIExplorer/UIExplorer/main.m similarity index 100% rename from Examples/UIExplorer/main.m rename to Examples/UIExplorer/UIExplorer/main.m diff --git a/Examples/UIExplorer/UIExplorerList.js b/Examples/UIExplorer/UIExplorerList.js index 08558971f..97dddacb7 100644 --- a/Examples/UIExplorer/UIExplorerList.js +++ b/Examples/UIExplorer/UIExplorerList.js @@ -5,66 +5,107 @@ var React = require('react-native/addons'); var { + ListView, PixelRatio, ScrollView, StyleSheet, Text, + TextInput, TouchableHighlight, View, - invariant, } = React; var createExamplePage = require('./createExamplePage'); -var EXAMPLES = [ - require('./ViewExample'), - require('./LayoutExample'), - require('./TextExample.ios'), - require('./TimerExample'), - require('./TextInputExample'), - require('./ImageExample'), - require('./ListViewSimpleExample'), - require('./ListViewPagingExample'), - require('./NavigatorIOSExample'), - require('./StatusBarIOSExample'), - require('./PointerEventsExample'), - require('./TouchableExample'), +var COMPONENTS = [ require('./ActivityIndicatorExample'), - require('./ScrollViewExample'), - require('./PickerExample'), require('./DatePickerExample'), - require('./GeolocationExample'), - require('./TabBarExample'), - require('./SwitchExample'), + require('./ImageExample'), + require('./ListViewPagingExample'), + require('./ListViewSimpleExample'), + require('./MapViewExample'), + require('./NavigatorIOSExample'), + require('./PickerExample'), + require('./ScrollViewExample'), require('./SliderIOSExample'), + require('./SwitchExample'), + require('./TabBarExample'), + require('./TextExample.ios'), + require('./TextInputExample'), + require('./TouchableExample'), + require('./ViewExample'), + require('./WebViewExample'), +]; + +var APIS = [ + require('./ActionSheetIOSExample'), + require('./AdSupportIOSExample'), + require('./AlertIOSExample'), + require('./AppStateExample'), + require('./AppStateIOSExample'), require('./AsyncStorageExample'), require('./CameraRollExample.ios'), - require('./MapViewExample'), - require('./WebViewExample'), - require('./AppStateIOSExample'), + require('./GeolocationExample'), + require('./LayoutExample'), require('./NetInfoExample'), - require('./AlertIOSExample'), - require('./AdSupportIOSExample'), - require('./AppStateExample'), - require('./ActionSheetIOSExample'), + require('./PointerEventsExample'), + require('./StatusBarIOSExample'), + require('./TimerExample'), require('./VibrationIOSExample'), ]; -var UIExplorerList = React.createClass({ - render: function() { - return ( - - - - {EXAMPLES.map(this._renderRow)} - - - - ); - }, +var ds = new ListView.DataSource({ + rowHasChanged: (r1, r2) => r1 !== r2, + sectionHeaderHasChanged: (h1, h2) => h1 !== h2, +}); - _renderRow: function(example, i) { - invariant(example.title, 'Example must provide a title.'); +class UIExplorerList extends React.Component { + + constructor(props) { + super(props); + this.state = { + dataSource: ds.cloneWithRowsAndSections({ + components: COMPONENTS, + apis: APIS, + }), + }; + } + + render() { + return ( + + + + + + + ); + } + + _renderSectionHeader(data, section) { + return ( + + + {section.toUpperCase()} + + + ); + } + + _renderRow(example, i) { return ( this._onPressRow(example)}> @@ -80,9 +121,21 @@ var UIExplorerList = React.createClass({ ); - }, + } - _onPressRow: function(example) { + _search(text) { + var regex = new RegExp(text, 'i'); + var filter = (component) => regex.test(component.title); + + this.setState({ + dataSource: ds.cloneWithRowsAndSections({ + components: COMPONENTS.filter(filter), + apis: APIS.filter(filter), + }) + }); + } + + _onPressRow(example) { var Component = example.examples ? createExamplePage(null, example) : example; @@ -90,20 +143,25 @@ var UIExplorerList = React.createClass({ title: Component.title, component: Component, }); - }, -}); + } +} var styles = StyleSheet.create({ + listContainer: { + flex: 1, + }, list: { backgroundColor: '#eeeeee', }, + sectionHeader: { + padding: 5, + }, group: { backgroundColor: 'white', - marginVertical: 25, }, - line: { - backgroundColor: '#bbbbbb', - height: 1 / PixelRatio.get(), + sectionHeaderTitle: { + fontWeight: 'bold', + fontSize: 11, }, row: { backgroundColor: 'white', @@ -125,6 +183,21 @@ var styles = StyleSheet.create({ color: '#888888', lineHeight: 20, }, + searchRow: { + backgroundColor: '#eeeeee', + paddingTop: 75, + paddingLeft: 10, + paddingRight: 10, + paddingBottom: 10, + }, + searchTextInput: { + backgroundColor: 'white', + borderColor: '#cccccc', + borderRadius: 3, + borderWidth: 1, + height: 30, + paddingLeft: 8, + }, }); module.exports = UIExplorerList; diff --git a/Examples/UIExplorer/WebViewExample.js b/Examples/UIExplorer/WebViewExample.js index 4b7a1513d..28246cdc3 100644 --- a/Examples/UIExplorer/WebViewExample.js +++ b/Examples/UIExplorer/WebViewExample.js @@ -81,8 +81,8 @@ var WebViewExample = React.createClass({ automaticallyAdjustContentInsets={false} style={styles.webView} url={this.state.url} - renderErrorView={this.renderErrorView} - renderLoadingView={this.renderLoadingView} + renderError={this.renderError} + renderLoading={this.renderLoading} onNavigationStateChange={this.onNavigationStateChange} startInLoadingState={true} /> @@ -115,7 +115,7 @@ var WebViewExample = React.createClass({ }); }, - renderErrorView: function(errorDomain, errorCode, errorDesc) { + renderError: function(errorDomain, errorCode, errorDesc) { return ( @@ -134,7 +134,7 @@ var WebViewExample = React.createClass({ ); }, - renderLoadingView: function() { + renderLoading: function() { return ( diff --git a/Libraries/Components/WebView/WebView.android.js b/Libraries/Components/WebView/WebView.android.js index 43e6f2c5a..9eab4e1cb 100644 --- a/Libraries/Components/WebView/WebView.android.js +++ b/Libraries/Components/WebView/WebView.android.js @@ -29,8 +29,8 @@ var WebViewState = keyMirror({ var WebView = React.createClass({ propTypes: { - renderErrorView: PropTypes.func.isRequired, // view to show if there's an error - renderLoadingView: PropTypes.func.isRequired, // loading indicator to show + renderError: PropTypes.func.isRequired, // view to show if there's an error + renderLoading: PropTypes.func.isRequired, // loading indicator to show url: PropTypes.string.isRequired, automaticallyAdjustContentInsets: PropTypes.bool, contentInset: EdgeInsetsPropType, @@ -61,10 +61,10 @@ var WebView = React.createClass({ var otherView = null; if (this.state.viewState === WebViewState.LOADING) { - otherView = this.props.renderLoadingView(); + otherView = this.props.renderLoading(); } else if (this.state.viewState === WebViewState.ERROR) { var errorEvent = this.state.lastErrorEvent; - otherView = this.props.renderErrorView( + otherView = this.props.renderError( errorEvent.domain, errorEvent.code, errorEvent.description); diff --git a/Libraries/Components/WebView/WebView.ios.js b/Libraries/Components/WebView/WebView.ios.js index 213f887ac..be6457e01 100644 --- a/Libraries/Components/WebView/WebView.ios.js +++ b/Libraries/Components/WebView/WebView.ios.js @@ -42,8 +42,8 @@ var WebView = React.createClass({ }, propTypes: { - renderErrorView: PropTypes.func.isRequired, // view to show if there's an error - renderLoadingView: PropTypes.func.isRequired, // loading indicator to show + renderError: PropTypes.func.isRequired, // view to show if there's an error + renderLoading: PropTypes.func.isRequired, // loading indicator to show url: PropTypes.string.isRequired, automaticallyAdjustContentInsets: PropTypes.bool, shouldInjectAJAXHandler: PropTypes.bool, @@ -71,10 +71,10 @@ var WebView = React.createClass({ var otherView = null; if (this.state.viewState === WebViewState.LOADING) { - otherView = this.props.renderLoadingView(); + otherView = this.props.renderLoading(); } else if (this.state.viewState === WebViewState.ERROR) { var errorEvent = this.state.lastErrorEvent; - otherView = this.props.renderErrorView( + otherView = this.props.renderError( errorEvent.domain, errorEvent.code, errorEvent.description); diff --git a/Libraries/CustomComponents/LICENSE b/Libraries/CustomComponents/LICENSE new file mode 100644 index 000000000..01f2fbc02 --- /dev/null +++ b/Libraries/CustomComponents/LICENSE @@ -0,0 +1,9 @@ +LICENSE AGREEMENT + +For React Native Custom Components software + +Copyright (c) 2015, Facebook, Inc. All rights reserved. + +Facebook, Inc. (“Facebook”) owns all right, title and interest, including all intellectual property and other proprietary rights, in and to the React Native Custom Components software (the “Software”). Subject to your compliance with these terms, you are hereby granted a non-exclusive, worldwide, royalty-free copyright license to (1) use and copy the Software; and (2) reproduce and distribute the Software as part of your own software (“Your Software”). Facebook reserves all rights not expressly granted to you in this license agreement. + +THE SOFTWARE AND DOCUMENTATION, IF ANY, ARE PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES (INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE) ARE DISCLAIMED. IN NO EVENT SHALL FACEBOOK OR ITS AFFILIATES, OFFICERS, DIRECTORS OR EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Libraries/Components/ListView/ListView.js b/Libraries/CustomComponents/ListView/ListView.js similarity index 100% rename from Libraries/Components/ListView/ListView.js rename to Libraries/CustomComponents/ListView/ListView.js diff --git a/Libraries/Components/ListView/ListViewDataSource.js b/Libraries/CustomComponents/ListView/ListViewDataSource.js similarity index 100% rename from Libraries/Components/ListView/ListViewDataSource.js rename to Libraries/CustomComponents/ListView/ListViewDataSource.js diff --git a/Libraries/JavaScriptAppEngine/Initialization/ExceptionsManager.js b/Libraries/JavaScriptAppEngine/Initialization/ExceptionsManager.js new file mode 100644 index 000000000..3b3a20e4e --- /dev/null +++ b/Libraries/JavaScriptAppEngine/Initialization/ExceptionsManager.js @@ -0,0 +1,71 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @providesModule ExceptionsManager + */ +'use strict'; + +var Platform = require('Platform'); +var RCTExceptionsManager = require('NativeModules').ExceptionsManager; + +var loadSourceMap = require('loadSourceMap'); +var parseErrorStack = require('parseErrorStack'); + +var sourceMapPromise; + +function handleException(e) { + var stack = parseErrorStack(e); + console.error( + 'Error: ' + + '\n stack: \n' + stackToString(stack) + + '\n URL: ' + e.sourceURL + + '\n line: ' + e.line + + '\n message: ' + e.message + ); + + if (RCTExceptionsManager) { + RCTExceptionsManager.reportUnhandledException(e.message, format(stack)); + if (__DEV__) { + (sourceMapPromise = sourceMapPromise || loadSourceMap()) + .then(map => { + var prettyStack = parseErrorStack(e, map); + RCTExceptionsManager.updateExceptionMessage(e.message, format(prettyStack)); + }) + .then(null, error => { + console.error('#CLOWNTOWN (error while displaying error): ' + error.message); + }); + } + } +} + +function stackToString(stack) { + var maxLength = Math.max.apply(null, stack.map(frame => frame.methodName.length)); + return stack.map(frame => stackFrameToString(frame, maxLength)).join('\n'); +} + +function stackFrameToString(stackFrame, maxLength) { + var fileNameParts = stackFrame.file.split('/'); + var fileName = fileNameParts[fileNameParts.length - 1]; + + if (fileName.length > 18) { + fileName = fileName.substr(0, 17) + '\u2026' /* ... */; + } + + var spaces = fillSpaces(maxLength - stackFrame.methodName.length); + return ' ' + stackFrame.methodName + spaces + ' ' + fileName + ':' + stackFrame.lineNumber; +} + +function fillSpaces(n) { + return new Array(n + 1).join(' '); +} + +// HACK(frantic) Android currently expects stack trace to be a string #5920439 +function format(stack) { + if (Platform.OS === 'android') { + return stackToString(stack); + } else { + return stack; + } +} + +module.exports = { handleException }; diff --git a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js index 92c9d27ed..e011ac089 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js +++ b/Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js @@ -57,33 +57,11 @@ function setupDocumentShim() { } } -var sourceMapPromise; - function handleErrorWithRedBox(e) { - var RCTExceptionsManager = require('NativeModules').ExceptionsManager; - var errorToString = require('errorToString'); - var loadSourceMap = require('loadSourceMap'); - - GLOBAL.console.error( - 'Error: ' + - '\n stack: \n' + e.stack + - '\n URL: ' + e.sourceURL + - '\n line: ' + e.line + - '\n message: ' + e.message - ); - - if (RCTExceptionsManager) { - RCTExceptionsManager.reportUnhandledException(e.message, errorToString(e)); - if (__DEV__) { - (sourceMapPromise = sourceMapPromise || loadSourceMap()) - .then(map => { - var prettyStack = errorToString(e, map); - RCTExceptionsManager.updateExceptionMessage(e.message, prettyStack); - }) - .then(null, error => { - GLOBAL.console.error('#CLOWNTOWN (error while displaying error): ' + error.message); - }); - } + try { + require('ExceptionsManager').handleException(e); + } catch(ee) { + console.log('Failed to print error: ', ee.message); } } diff --git a/Libraries/JavaScriptAppEngine/Initialization/errorToString.js b/Libraries/JavaScriptAppEngine/Initialization/parseErrorStack.js similarity index 55% rename from Libraries/JavaScriptAppEngine/Initialization/errorToString.js rename to Libraries/JavaScriptAppEngine/Initialization/parseErrorStack.js index 652d6c2af..85a836705 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/errorToString.js +++ b/Libraries/JavaScriptAppEngine/Initialization/parseErrorStack.js @@ -1,21 +1,12 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. * - * @providesModule errorToString + * @providesModule parseErrorStack */ 'use strict'; -var Platform = require('Platform'); - var stacktraceParser = require('stacktrace-parser'); -function stackFrameToString(stackFrame) { - var fileNameParts = stackFrame.file.split('/'); - var fileName = fileNameParts[fileNameParts.length - 1]; - - return stackFrame.methodName + '\n in ' + fileName + ':' + stackFrame.lineNumber + '\n'; -} - function resolveSourceMaps(sourceMapInstance, stackFrame) { try { var orig = sourceMapInstance.originalPositionFor({ @@ -31,7 +22,7 @@ function resolveSourceMaps(sourceMapInstance, stackFrame) { } } -function errorToString(e, sourceMapInstance) { +function parseErrorStack(e, sourceMapInstance) { var stack = stacktraceParser.parse(e.stack); var framesToPop = e.framesToPop || 0; @@ -43,12 +34,7 @@ function errorToString(e, sourceMapInstance) { stack.forEach(resolveSourceMaps.bind(null, sourceMapInstance)); } - // HACK(frantic) Android currently expects stack trace to be a string #5920439 - if (Platform.OS === 'android') { - return stack.map(stackFrameToString).join('\n'); - } else { - return stack; - } + return stack; } -module.exports = errorToString; +module.exports = parseErrorStack; diff --git a/Libraries/RCTWebSocketDebugger/RCTWebSocketDebugger.xcodeproj/project.pbxproj b/Libraries/RCTWebSocketDebugger/RCTWebSocketDebugger.xcodeproj/project.pbxproj new file mode 100644 index 000000000..07d24eb36 --- /dev/null +++ b/Libraries/RCTWebSocketDebugger/RCTWebSocketDebugger.xcodeproj/project.pbxproj @@ -0,0 +1,260 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 00D277161AB8C32C00DC1E48 /* RCTWebSocketExecutor.m in Sources */ = {isa = PBXBuildFile; fileRef = 00D277151AB8C32C00DC1E48 /* RCTWebSocketExecutor.m */; }; + 00D277191AB8C35800DC1E48 /* SRWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 00D277181AB8C35800DC1E48 /* SRWebSocket.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 832C817E1AAF6DEF007FA2F7 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 00D277141AB8C32C00DC1E48 /* RCTWebSocketExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebSocketExecutor.h; sourceTree = ""; }; + 00D277151AB8C32C00DC1E48 /* RCTWebSocketExecutor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWebSocketExecutor.m; sourceTree = ""; }; + 00D277171AB8C35800DC1E48 /* SRWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SRWebSocket.h; sourceTree = ""; }; + 00D277181AB8C35800DC1E48 /* SRWebSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SRWebSocket.m; sourceTree = ""; }; + 832C81801AAF6DEF007FA2F7 /* libRCTWebSocketDebugger.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTWebSocketDebugger.a; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 832C817D1AAF6DEF007FA2F7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 832C81771AAF6DEF007FA2F7 = { + isa = PBXGroup; + children = ( + 00D277171AB8C35800DC1E48 /* SRWebSocket.h */, + 00D277181AB8C35800DC1E48 /* SRWebSocket.m */, + 00D277141AB8C32C00DC1E48 /* RCTWebSocketExecutor.h */, + 00D277151AB8C32C00DC1E48 /* RCTWebSocketExecutor.m */, + 832C81811AAF6DEF007FA2F7 /* Products */, + ); + sourceTree = ""; + }; + 832C81811AAF6DEF007FA2F7 /* Products */ = { + isa = PBXGroup; + children = ( + 832C81801AAF6DEF007FA2F7 /* libRCTWebSocketDebugger.a */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 832C817F1AAF6DEF007FA2F7 /* RCTWebSocketDebugger */ = { + isa = PBXNativeTarget; + buildConfigurationList = 832C81941AAF6DF0007FA2F7 /* Build configuration list for PBXNativeTarget "RCTWebSocketDebugger" */; + buildPhases = ( + 832C817C1AAF6DEF007FA2F7 /* Sources */, + 832C817D1AAF6DEF007FA2F7 /* Frameworks */, + 832C817E1AAF6DEF007FA2F7 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RCTWebSocketDebugger; + productName = RCTWebSocketDebugger; + productReference = 832C81801AAF6DEF007FA2F7 /* libRCTWebSocketDebugger.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 832C81781AAF6DEF007FA2F7 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0620; + ORGANIZATIONNAME = Facebook; + TargetAttributes = { + 832C817F1AAF6DEF007FA2F7 = { + CreatedOnToolsVersion = 6.2; + }; + }; + }; + buildConfigurationList = 832C817B1AAF6DEF007FA2F7 /* Build configuration list for PBXProject "RCTWebSocketDebugger" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 832C81771AAF6DEF007FA2F7; + productRefGroup = 832C81811AAF6DEF007FA2F7 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 832C817F1AAF6DEF007FA2F7 /* RCTWebSocketDebugger */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 832C817C1AAF6DEF007FA2F7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 00D277191AB8C35800DC1E48 /* SRWebSocket.m in Sources */, + 00D277161AB8C32C00DC1E48 /* RCTWebSocketExecutor.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 832C81921AAF6DF0007FA2F7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 832C81931AAF6DF0007FA2F7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../ReactKit/**", + ); + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 832C81951AAF6DF0007FA2F7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + OTHER_LDFLAGS = ( + "-ObjC", + "-llibicucore", + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 832C81961AAF6DF0007FA2F7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + OTHER_LDFLAGS = ( + "-ObjC", + "-llibicucore", + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 832C817B1AAF6DEF007FA2F7 /* Build configuration list for PBXProject "RCTWebSocketDebugger" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 832C81921AAF6DF0007FA2F7 /* Debug */, + 832C81931AAF6DF0007FA2F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 832C81941AAF6DF0007FA2F7 /* Build configuration list for PBXNativeTarget "RCTWebSocketDebugger" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 832C81951AAF6DF0007FA2F7 /* Debug */, + 832C81961AAF6DF0007FA2F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 832C81781AAF6DEF007FA2F7 /* Project object */; +} diff --git a/Libraries/RCTWebSocketDebugger/RCTWebSocketExecutor.h b/Libraries/RCTWebSocketDebugger/RCTWebSocketExecutor.h new file mode 100644 index 000000000..15f8f32e1 --- /dev/null +++ b/Libraries/RCTWebSocketDebugger/RCTWebSocketExecutor.h @@ -0,0 +1,9 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTJavaScriptExecutor.h" + +@interface RCTWebSocketExecutor : NSObject + +- (instancetype)initWithURL:(NSURL *)url; + +@end diff --git a/Libraries/RCTWebSocketDebugger/RCTWebSocketExecutor.m b/Libraries/RCTWebSocketDebugger/RCTWebSocketExecutor.m new file mode 100644 index 000000000..d40713ee3 --- /dev/null +++ b/Libraries/RCTWebSocketDebugger/RCTWebSocketExecutor.m @@ -0,0 +1,179 @@ +// Copyright 2004-present Facebook. All Rights Reserved. + +#import "RCTWebSocketExecutor.h" + +#import "RCTLog.h" +#import "RCTUtils.h" +#import "SRWebSocket.h" + +typedef void (^WSMessageCallback)(NSError *error, NSDictionary *reply); + +@interface RCTWebSocketExecutor () +@end + +@implementation RCTWebSocketExecutor { + SRWebSocket *_socket; + NSOperationQueue *_jsQueue; + NSMutableDictionary *_callbacks; + dispatch_semaphore_t _socketOpenSemaphore; + NSMutableDictionary *_injectedObjects; +} + +- (instancetype)init +{ + return [self initWithURL:[NSURL URLWithString:@"http://localhost:8081/debugger-proxy"]]; +} + +- (instancetype)initWithURL:(NSURL *)url +{ + if (self = [super init]) { + _jsQueue = [[NSOperationQueue alloc] init]; + _jsQueue.maxConcurrentOperationCount = 1; + _socket = [[SRWebSocket alloc] initWithURL:url]; + _socket.delegate = self; + _callbacks = [NSMutableDictionary dictionary]; + _injectedObjects = [NSMutableDictionary dictionary]; + [_socket setDelegateOperationQueue:_jsQueue]; + + + NSURL *startDevToolsURL = [NSURL URLWithString:@"/launch-chrome-devtools" relativeToURL:url]; + [NSURLConnection connectionWithRequest:[NSURLRequest requestWithURL:startDevToolsURL] delegate:nil]; + + if (![self connectToProxy]) { + RCTLogError(@"Connection to %@ timed out. Are you running node proxy?", url); + [self invalidate]; + return nil; + } + + NSInteger retries = 3; + BOOL runtimeIsReady = [self prepareJSRuntime]; + while (!runtimeIsReady && retries > 0) { + runtimeIsReady = [self prepareJSRuntime]; + retries--; + } + if (!runtimeIsReady) { + RCTLogError(@"Runtime is not ready. Do you have Chrome open?"); + [self invalidate]; + return nil; + } + } + return self; +} + +- (BOOL)connectToProxy +{ + _socketOpenSemaphore = dispatch_semaphore_create(0); + [_socket open]; + long connected = dispatch_semaphore_wait(_socketOpenSemaphore, dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * 2)); + return connected == 0; +} + +- (BOOL)prepareJSRuntime +{ + __block NSError *initError; + dispatch_semaphore_t s = dispatch_semaphore_create(0); + [self sendMessage:@{@"method": @"prepareJSRuntime"} waitForReply:^(NSError *error, NSDictionary *reply) { + initError = error; + dispatch_semaphore_signal(s); + }]; + long runtimeIsReady = dispatch_semaphore_wait(s, dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC)); + return runtimeIsReady == 0 && initError == nil; +} + +- (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message +{ + NSError *error = nil; + NSDictionary *reply = RCTJSONParse(message, &error); + NSUInteger messageID = [reply[@"replyID"] integerValue]; + WSMessageCallback callback = [_callbacks objectForKey:@(messageID)]; + if (callback) { + callback(error, reply); + } +} + +- (void)webSocketDidOpen:(SRWebSocket *)webSocket +{ + dispatch_semaphore_signal(_socketOpenSemaphore); +} + +- (void)webSocket:(SRWebSocket *)webSocket didFailWithError:(NSError *)error +{ + RCTLogError(@"WebSocket connection failed with error %@", error); +} + +- (void)webSocket:(SRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean +{ + +} + +- (void)sendMessage:(NSDictionary *)message waitForReply:(WSMessageCallback)callback +{ + static NSUInteger lastID = 10000; + + [_jsQueue addOperationWithBlock:^{ + if (!self.valid) { + NSError *error = [NSError errorWithDomain:@"WS" code:1 userInfo:@{NSLocalizedDescriptionKey:@"socket closed"}]; + callback(error, nil); + return; + } + + NSUInteger expectedID = lastID++; + + _callbacks[@(expectedID)] = [callback copy]; + + NSMutableDictionary *messageWithID = [message mutableCopy]; + messageWithID[@"id"] = @(expectedID); + [_socket send:RCTJSONStringify(messageWithID, NULL)]; + }]; +} + +- (void)executeApplicationScript:(NSString *)script sourceURL:(NSURL *)url onComplete:(RCTJavaScriptCompleteBlock)onComplete +{ + NSDictionary *message = @{@"method": NSStringFromSelector(_cmd), @"url": [url absoluteString], @"inject": _injectedObjects}; + [self sendMessage:message waitForReply:^(NSError *error, NSDictionary *reply) { + onComplete(error); + }]; +} + +- (void)executeJSCall:(NSString *)name method:(NSString *)method arguments:(NSArray *)arguments callback:(RCTJavaScriptCallback)onComplete +{ + RCTAssert(onComplete != nil, @"callback was missing for exec JS call"); + NSDictionary *message = @{@"method": NSStringFromSelector(_cmd), @"moduleName": name, @"moduleMethod": method, @"arguments": arguments}; + [self sendMessage:message waitForReply:^(NSError *socketError, NSDictionary *reply) { + if (socketError) { + onComplete(nil, socketError); + return; + } + + NSString *result = reply[@"result"]; + id objcValue = RCTJSONParse(result, NULL); + onComplete(objcValue, nil); + }]; +} + +- (void)injectJSONText:(NSString *)script asGlobalObjectNamed:(NSString *)objectName callback:(RCTJavaScriptCompleteBlock)onComplete +{ + [_jsQueue addOperationWithBlock:^{ + [_injectedObjects setObject:script forKey:objectName]; + onComplete(nil); + }]; +} + +- (void)invalidate +{ + _socket.delegate = nil; + [_socket closeWithCode:1000 reason:@"Invalidated"]; + _socket = nil; +} + +- (BOOL)isValid +{ + return _socket != nil && _socket.readyState == SR_OPEN; +} + +- (void)dealloc +{ + RCTAssert(!self.valid, @"-invalidate must be called before -dealloc"); +} + +@end diff --git a/Libraries/RCTWebSocketDebugger/SRWebSocket.h b/Libraries/RCTWebSocketDebugger/SRWebSocket.h new file mode 100644 index 000000000..5cce725a3 --- /dev/null +++ b/Libraries/RCTWebSocketDebugger/SRWebSocket.h @@ -0,0 +1,132 @@ +// +// Copyright 2012 Square Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#import +#import + +typedef enum { + SR_CONNECTING = 0, + SR_OPEN = 1, + SR_CLOSING = 2, + SR_CLOSED = 3, +} SRReadyState; + +typedef enum SRStatusCode : NSInteger { + SRStatusCodeNormal = 1000, + SRStatusCodeGoingAway = 1001, + SRStatusCodeProtocolError = 1002, + SRStatusCodeUnhandledType = 1003, + // 1004 reserved. + SRStatusNoStatusReceived = 1005, + // 1004-1006 reserved. + SRStatusCodeInvalidUTF8 = 1007, + SRStatusCodePolicyViolated = 1008, + SRStatusCodeMessageTooBig = 1009, +} SRStatusCode; + +@class SRWebSocket; + +extern NSString *const SRWebSocketErrorDomain; +extern NSString *const SRHTTPResponseErrorKey; + +#pragma mark - SRWebSocketDelegate + +@protocol SRWebSocketDelegate; + +#pragma mark - SRWebSocket + +@interface SRWebSocket : NSObject + +@property (nonatomic, weak) id delegate; + +@property (nonatomic, readonly) SRReadyState readyState; +@property (nonatomic, readonly, retain) NSURL *url; + +// This returns the negotiated protocol. +// It will be nil until after the handshake completes. +@property (nonatomic, readonly, copy) NSString *protocol; + +// Protocols should be an array of strings that turn into Sec-WebSocket-Protocol. +- (id)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray *)protocols; +- (id)initWithURLRequest:(NSURLRequest *)request; + +// Some helper constructors. +- (id)initWithURL:(NSURL *)url protocols:(NSArray *)protocols; +- (id)initWithURL:(NSURL *)url; + +// Delegate queue will be dispatch_main_queue by default. +// You cannot set both OperationQueue and dispatch_queue. +- (void)setDelegateOperationQueue:(NSOperationQueue*) queue; +- (void)setDelegateDispatchQueue:(dispatch_queue_t) queue; + +// By default, it will schedule itself on +[NSRunLoop SR_networkRunLoop] using defaultModes. +- (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode; +- (void)unscheduleFromRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode; + +// SRWebSockets are intended for one-time-use only. Open should be called once and only once. +- (void)open; + +- (void)close; +- (void)closeWithCode:(NSInteger)code reason:(NSString *)reason; + +// Send a UTF8 String or Data. +- (void)send:(id)data; + +// Send Data (can be nil) in a ping message. +- (void)sendPing:(NSData *)data; + +@end + +#pragma mark - SRWebSocketDelegate + +@protocol SRWebSocketDelegate + +// message will either be an NSString if the server is using text +// or NSData if the server is using binary. +- (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message; + +@optional + +- (void)webSocketDidOpen:(SRWebSocket *)webSocket; +- (void)webSocket:(SRWebSocket *)webSocket didFailWithError:(NSError *)error; +- (void)webSocket:(SRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean; +- (void)webSocket:(SRWebSocket *)webSocket didReceivePong:(NSData *)pongPayload; + +@end + +#pragma mark - NSURLRequest (CertificateAdditions) + +@interface NSURLRequest (CertificateAdditions) + +@property (nonatomic, retain, readonly) NSArray *SR_SSLPinnedCertificates; + +@end + +#pragma mark - NSMutableURLRequest (CertificateAdditions) + +@interface NSMutableURLRequest (CertificateAdditions) + +@property (nonatomic, retain) NSArray *SR_SSLPinnedCertificates; + +@end + +#pragma mark - NSRunLoop (SRWebSocket) + +@interface NSRunLoop (SRWebSocket) + ++ (NSRunLoop *)SR_networkRunLoop; + +@end diff --git a/Libraries/RCTWebSocketDebugger/SRWebSocket.m b/Libraries/RCTWebSocketDebugger/SRWebSocket.m new file mode 100644 index 000000000..d643d63b9 --- /dev/null +++ b/Libraries/RCTWebSocketDebugger/SRWebSocket.m @@ -0,0 +1,1761 @@ +// +// Copyright 2012 Square Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + + +#import "SRWebSocket.h" + +#if TARGET_OS_IPHONE +#define HAS_ICU +#endif + +#ifdef HAS_ICU +#import +#endif + +#if TARGET_OS_IPHONE +#import +#else +#import +#endif + +#import +#import + +#if OS_OBJECT_USE_OBJC_RETAIN_RELEASE +#define sr_dispatch_retain(x) +#define sr_dispatch_release(x) +#define maybe_bridge(x) ((__bridge void *) x) +#else +#define sr_dispatch_retain(x) dispatch_retain(x) +#define sr_dispatch_release(x) dispatch_release(x) +#define maybe_bridge(x) (x) +#endif + +#if !__has_feature(objc_arc) +#error SocketRocket must be compiled with ARC enabled +#endif + + +typedef enum { + SROpCodeTextFrame = 0x1, + SROpCodeBinaryFrame = 0x2, + // 3-7 reserved. + SROpCodeConnectionClose = 0x8, + SROpCodePing = 0x9, + SROpCodePong = 0xA, + // B-F reserved. +} SROpCode; + +typedef struct { + BOOL fin; +// BOOL rsv1; +// BOOL rsv2; +// BOOL rsv3; + uint8_t opcode; + BOOL masked; + uint64_t payload_length; +} frame_header; + +static NSString *const SRWebSocketAppendToSecKeyString = @"258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; + +static inline int32_t validate_dispatch_data_partial_string(NSData *data); +static inline void SRFastLog(NSString *format, ...); + +@interface NSData (SRWebSocket) + +- (NSString *)stringBySHA1ThenBase64Encoding; + +@end + + +@interface NSString (SRWebSocket) + +- (NSString *)stringBySHA1ThenBase64Encoding; + +@end + + +@interface NSURL (SRWebSocket) + +// The origin isn't really applicable for a native application. +// So instead, just map ws -> http and wss -> https. +- (NSString *)SR_origin; + +@end + + +@interface _SRRunLoopThread : NSThread + +@property (nonatomic, readonly) NSRunLoop *runLoop; + +@end + + +static NSString *newSHA1String(const char *bytes, size_t length) { + uint8_t md[CC_SHA1_DIGEST_LENGTH]; + + assert(length >= 0); + assert(length <= UINT32_MAX); + CC_SHA1(bytes, (CC_LONG)length, md); + + NSData *data = [NSData dataWithBytes:md length:CC_SHA1_DIGEST_LENGTH]; + + if ([data respondsToSelector:@selector(base64EncodedStringWithOptions:)]) { + return [data base64EncodedStringWithOptions:0]; + } + + return [data base64Encoding]; +} + +@implementation NSData (SRWebSocket) + +- (NSString *)stringBySHA1ThenBase64Encoding; +{ + return newSHA1String(self.bytes, self.length); +} + +@end + + +@implementation NSString (SRWebSocket) + +- (NSString *)stringBySHA1ThenBase64Encoding; +{ + return newSHA1String(self.UTF8String, self.length); +} + +@end + +NSString *const SRWebSocketErrorDomain = @"SRWebSocketErrorDomain"; +NSString *const SRHTTPResponseErrorKey = @"HTTPResponseStatusCode"; + +// Returns number of bytes consumed. Returning 0 means you didn't match. +// Sends bytes to callback handler; +typedef size_t (^stream_scanner)(NSData *collected_data); + +typedef void (^data_callback)(SRWebSocket *webSocket, NSData *data); + +@interface SRIOConsumer : NSObject { + stream_scanner _scanner; + data_callback _handler; + size_t _bytesNeeded; + BOOL _readToCurrentFrame; + BOOL _unmaskBytes; +} +@property (nonatomic, copy, readonly) stream_scanner consumer; +@property (nonatomic, copy, readonly) data_callback handler; +@property (nonatomic, assign) size_t bytesNeeded; +@property (nonatomic, assign, readonly) BOOL readToCurrentFrame; +@property (nonatomic, assign, readonly) BOOL unmaskBytes; + +@end + +// This class is not thread-safe, and is expected to always be run on the same queue. +@interface SRIOConsumerPool : NSObject + +- (id)initWithBufferCapacity:(NSUInteger)poolSize; + +- (SRIOConsumer *)consumerWithScanner:(stream_scanner)scanner handler:(data_callback)handler bytesNeeded:(size_t)bytesNeeded readToCurrentFrame:(BOOL)readToCurrentFrame unmaskBytes:(BOOL)unmaskBytes; +- (void)returnConsumer:(SRIOConsumer *)consumer; + +@end + +@interface SRWebSocket () + +- (void)_writeData:(NSData *)data; +- (void)_closeWithProtocolError:(NSString *)message; +- (void)_failWithError:(NSError *)error; + +- (void)_disconnect; + +- (void)_readFrameNew; +- (void)_readFrameContinue; + +- (void)_pumpScanner; + +- (void)_pumpWriting; + +- (void)_addConsumerWithScanner:(stream_scanner)consumer callback:(data_callback)callback; +- (void)_addConsumerWithDataLength:(size_t)dataLength callback:(data_callback)callback readToCurrentFrame:(BOOL)readToCurrentFrame unmaskBytes:(BOOL)unmaskBytes; +- (void)_addConsumerWithScanner:(stream_scanner)consumer callback:(data_callback)callback dataLength:(size_t)dataLength; +- (void)_readUntilBytes:(const void *)bytes length:(size_t)length callback:(data_callback)dataHandler; +- (void)_readUntilHeaderCompleteWithCallback:(data_callback)dataHandler; + +- (void)_sendFrameWithOpcode:(SROpCode)opcode data:(id)data; + +- (BOOL)_checkHandshake:(CFHTTPMessageRef)httpMessage; +- (void)_SR_commonInit; + +- (void)_initializeStreams; +- (void)_connect; + +@property (nonatomic) SRReadyState readyState; + +@property (nonatomic) NSOperationQueue *delegateOperationQueue; +@property (nonatomic) dispatch_queue_t delegateDispatchQueue; + +@end + + +@implementation SRWebSocket { + NSInteger _webSocketVersion; + + NSOperationQueue *_delegateOperationQueue; + dispatch_queue_t _delegateDispatchQueue; + + dispatch_queue_t _workQueue; + NSMutableArray *_consumers; + + NSInputStream *_inputStream; + NSOutputStream *_outputStream; + + NSMutableData *_readBuffer; + NSUInteger _readBufferOffset; + + NSMutableData *_outputBuffer; + NSUInteger _outputBufferOffset; + + uint8_t _currentFrameOpcode; + size_t _currentFrameCount; + size_t _readOpCount; + uint32_t _currentStringScanPosition; + NSMutableData *_currentFrameData; + + NSString *_closeReason; + + NSString *_secKey; + + BOOL _pinnedCertFound; + + uint8_t _currentReadMaskKey[4]; + size_t _currentReadMaskOffset; + + BOOL _consumerStopped; + + BOOL _closeWhenFinishedWriting; + BOOL _failed; + + BOOL _secure; + NSURLRequest *_urlRequest; + + CFHTTPMessageRef _receivedHTTPHeaders; + + BOOL _sentClose; + BOOL _didFail; + int _closeCode; + + BOOL _isPumping; + + NSMutableSet *_scheduledRunloops; + + // We use this to retain ourselves. + __strong SRWebSocket *_selfRetain; + + NSArray *_requestedProtocols; + SRIOConsumerPool *_consumerPool; +} + +@synthesize delegate = _delegate; +@synthesize url = _url; +@synthesize readyState = _readyState; +@synthesize protocol = _protocol; + +static __strong NSData *CRLFCRLF; + ++ (void)initialize; +{ + CRLFCRLF = [[NSData alloc] initWithBytes:"\r\n\r\n" length:4]; +} + +- (id)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray *)protocols; +{ + self = [super init]; + if (self) { + assert(request.URL); + _url = request.URL; + _urlRequest = request; + + _requestedProtocols = [protocols copy]; + + [self _SR_commonInit]; + } + + return self; +} + +- (id)initWithURLRequest:(NSURLRequest *)request; +{ + return [self initWithURLRequest:request protocols:nil]; +} + +- (id)initWithURL:(NSURL *)url; +{ + return [self initWithURL:url protocols:nil]; +} + +- (id)initWithURL:(NSURL *)url protocols:(NSArray *)protocols; +{ + NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url]; + return [self initWithURLRequest:request protocols:protocols]; +} + +- (void)_SR_commonInit; +{ + + NSString *scheme = _url.scheme.lowercaseString; + assert([scheme isEqualToString:@"ws"] || [scheme isEqualToString:@"http"] || [scheme isEqualToString:@"wss"] || [scheme isEqualToString:@"https"]); + + if ([scheme isEqualToString:@"wss"] || [scheme isEqualToString:@"https"]) { + _secure = YES; + } + + _readyState = SR_CONNECTING; + _consumerStopped = YES; + _webSocketVersion = 13; + + _workQueue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL); + + // Going to set a specific on the queue so we can validate we're on the work queue + dispatch_queue_set_specific(_workQueue, (__bridge void *)self, maybe_bridge(_workQueue), NULL); + + _delegateDispatchQueue = dispatch_get_main_queue(); + sr_dispatch_retain(_delegateDispatchQueue); + + _readBuffer = [[NSMutableData alloc] init]; + _outputBuffer = [[NSMutableData alloc] init]; + + _currentFrameData = [[NSMutableData alloc] init]; + + _consumers = [[NSMutableArray alloc] init]; + + _consumerPool = [[SRIOConsumerPool alloc] init]; + + _scheduledRunloops = [[NSMutableSet alloc] init]; + + [self _initializeStreams]; + + // default handlers +} + +- (void)assertOnWorkQueue; +{ + assert(dispatch_get_specific((__bridge void *)self) == maybe_bridge(_workQueue)); +} + +- (void)dealloc +{ + _inputStream.delegate = nil; + _outputStream.delegate = nil; + + [_inputStream close]; + [_outputStream close]; + + sr_dispatch_release(_workQueue); + _workQueue = NULL; + + if (_receivedHTTPHeaders) { + CFRelease(_receivedHTTPHeaders); + _receivedHTTPHeaders = NULL; + } + + if (_delegateDispatchQueue) { + sr_dispatch_release(_delegateDispatchQueue); + _delegateDispatchQueue = NULL; + } +} + +#ifndef NDEBUG + +- (void)setReadyState:(SRReadyState)aReadyState; +{ + [self willChangeValueForKey:@"readyState"]; + assert(aReadyState > _readyState); + _readyState = aReadyState; + [self didChangeValueForKey:@"readyState"]; +} + +#endif + +- (void)open; +{ + assert(_url); + NSAssert(_readyState == SR_CONNECTING, @"Cannot call -(void)open on SRWebSocket more than once"); + + _selfRetain = self; + + [self _connect]; +} + +// Calls block on delegate queue +- (void)_performDelegateBlock:(dispatch_block_t)block; +{ + if (_delegateOperationQueue) { + [_delegateOperationQueue addOperationWithBlock:block]; + } else { + assert(_delegateDispatchQueue); + dispatch_async(_delegateDispatchQueue, block); + } +} + +- (void)setDelegateDispatchQueue:(dispatch_queue_t)queue; +{ + if (queue) { + sr_dispatch_retain(queue); + } + + if (_delegateDispatchQueue) { + sr_dispatch_release(_delegateDispatchQueue); + } + + _delegateDispatchQueue = queue; +} + +- (BOOL)_checkHandshake:(CFHTTPMessageRef)httpMessage; +{ + NSString *acceptHeader = CFBridgingRelease(CFHTTPMessageCopyHeaderFieldValue(httpMessage, CFSTR("Sec-WebSocket-Accept"))); + + if (acceptHeader == nil) { + return NO; + } + + NSString *concattedString = [_secKey stringByAppendingString:SRWebSocketAppendToSecKeyString]; + NSString *expectedAccept = [concattedString stringBySHA1ThenBase64Encoding]; + + return [acceptHeader isEqualToString:expectedAccept]; +} + +- (void)_HTTPHeadersDidFinish; +{ + NSInteger responseCode = CFHTTPMessageGetResponseStatusCode(_receivedHTTPHeaders); + + if (responseCode >= 400) { + SRFastLog(@"Request failed with response code %d", responseCode); + [self _failWithError:[NSError errorWithDomain:SRWebSocketErrorDomain code:2132 userInfo:@{NSLocalizedDescriptionKey:[NSString stringWithFormat:@"received bad response code from server %ld", (long)responseCode], SRHTTPResponseErrorKey:@(responseCode)}]]; + return; + } + + if(![self _checkHandshake:_receivedHTTPHeaders]) { + [self _failWithError:[NSError errorWithDomain:SRWebSocketErrorDomain code:2133 userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Invalid Sec-WebSocket-Accept response"] forKey:NSLocalizedDescriptionKey]]]; + return; + } + + NSString *negotiatedProtocol = CFBridgingRelease(CFHTTPMessageCopyHeaderFieldValue(_receivedHTTPHeaders, CFSTR("Sec-WebSocket-Protocol"))); + if (negotiatedProtocol) { + // Make sure we requested the protocol + if ([_requestedProtocols indexOfObject:negotiatedProtocol] == NSNotFound) { + [self _failWithError:[NSError errorWithDomain:SRWebSocketErrorDomain code:2133 userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Server specified Sec-WebSocket-Protocol that wasn't requested"] forKey:NSLocalizedDescriptionKey]]]; + return; + } + + _protocol = negotiatedProtocol; + } + + self.readyState = SR_OPEN; + + if (!_didFail) { + [self _readFrameNew]; + } + + [self _performDelegateBlock:^{ + if ([self.delegate respondsToSelector:@selector(webSocketDidOpen:)]) { + [self.delegate webSocketDidOpen:self]; + }; + }]; +} + + +- (void)_readHTTPHeader; +{ + if (_receivedHTTPHeaders == NULL) { + _receivedHTTPHeaders = CFHTTPMessageCreateEmpty(NULL, NO); + } + + [self _readUntilHeaderCompleteWithCallback:^(SRWebSocket *self, NSData *data) { + CFHTTPMessageAppendBytes(_receivedHTTPHeaders, (const UInt8 *)data.bytes, data.length); + + if (CFHTTPMessageIsHeaderComplete(_receivedHTTPHeaders)) { + SRFastLog(@"Finished reading headers %@", CFBridgingRelease(CFHTTPMessageCopyAllHeaderFields(_receivedHTTPHeaders))); + [self _HTTPHeadersDidFinish]; + } else { + [self _readHTTPHeader]; + } + }]; +} + +- (void)didConnect +{ + SRFastLog(@"Connected"); + CFHTTPMessageRef request = CFHTTPMessageCreateRequest(NULL, CFSTR("GET"), (__bridge CFURLRef)_url, kCFHTTPVersion1_1); + + // Set host first so it defaults + CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Host"), (__bridge CFStringRef)(_url.port ? [NSString stringWithFormat:@"%@:%@", _url.host, _url.port] : _url.host)); + + NSMutableData *keyBytes = [[NSMutableData alloc] initWithLength:16]; + SecRandomCopyBytes(kSecRandomDefault, keyBytes.length, keyBytes.mutableBytes); + + if ([keyBytes respondsToSelector:@selector(base64EncodedStringWithOptions:)]) { + _secKey = [keyBytes base64EncodedStringWithOptions:0]; + } else { + _secKey = [keyBytes base64Encoding]; + } + + assert([_secKey length] == 24); + + CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Upgrade"), CFSTR("websocket")); + CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Connection"), CFSTR("Upgrade")); + CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Sec-WebSocket-Key"), (__bridge CFStringRef)_secKey); + CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Sec-WebSocket-Version"), (__bridge CFStringRef)[NSString stringWithFormat:@"%ld", (long)_webSocketVersion]); + + CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Origin"), (__bridge CFStringRef)_url.SR_origin); + + if (_requestedProtocols) { + CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Sec-WebSocket-Protocol"), (__bridge CFStringRef)[_requestedProtocols componentsJoinedByString:@", "]); + } + + [_urlRequest.allHTTPHeaderFields enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + CFHTTPMessageSetHeaderFieldValue(request, (__bridge CFStringRef)key, (__bridge CFStringRef)obj); + }]; + + NSData *message = CFBridgingRelease(CFHTTPMessageCopySerializedMessage(request)); + + CFRelease(request); + + [self _writeData:message]; + [self _readHTTPHeader]; +} + +- (void)_initializeStreams; +{ + assert(_url.port.unsignedIntValue <= UINT32_MAX); + uint32_t port = _url.port.unsignedIntValue; + if (port == 0) { + if (!_secure) { + port = 80; + } else { + port = 443; + } + } + NSString *host = _url.host; + + CFReadStreamRef readStream = NULL; + CFWriteStreamRef writeStream = NULL; + + CFStreamCreatePairWithSocketToHost(NULL, (__bridge CFStringRef)host, port, &readStream, &writeStream); + + _outputStream = CFBridgingRelease(writeStream); + _inputStream = CFBridgingRelease(readStream); + + + if (_secure) { + NSMutableDictionary *SSLOptions = [[NSMutableDictionary alloc] init]; + + [_outputStream setProperty:(__bridge id)kCFStreamSocketSecurityLevelNegotiatedSSL forKey:(__bridge id)kCFStreamPropertySocketSecurityLevel]; + + // If we're using pinned certs, don't validate the certificate chain + if ([_urlRequest SR_SSLPinnedCertificates].count) { + [SSLOptions setValue:[NSNumber numberWithBool:NO] forKey:(__bridge id)kCFStreamSSLValidatesCertificateChain]; + } + +#if DEBUG + [SSLOptions setValue:[NSNumber numberWithBool:NO] forKey:(__bridge id)kCFStreamSSLValidatesCertificateChain]; + NSLog(@"SocketRocket: In debug mode. Allowing connection to any root cert"); +#endif + + [_outputStream setProperty:SSLOptions + forKey:(__bridge id)kCFStreamPropertySSLSettings]; + } + + _inputStream.delegate = self; + _outputStream.delegate = self; +} + +- (void)_connect; +{ + if (!_scheduledRunloops.count) { + [self scheduleInRunLoop:[NSRunLoop SR_networkRunLoop] forMode:NSDefaultRunLoopMode]; + } + + + [_outputStream open]; + [_inputStream open]; +} + +- (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode; +{ + [_outputStream scheduleInRunLoop:aRunLoop forMode:mode]; + [_inputStream scheduleInRunLoop:aRunLoop forMode:mode]; + + [_scheduledRunloops addObject:@[aRunLoop, mode]]; +} + +- (void)unscheduleFromRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode; +{ + [_outputStream removeFromRunLoop:aRunLoop forMode:mode]; + [_inputStream removeFromRunLoop:aRunLoop forMode:mode]; + + [_scheduledRunloops removeObject:@[aRunLoop, mode]]; +} + +- (void)close; +{ + [self closeWithCode:SRStatusCodeNormal reason:nil]; +} + +- (void)closeWithCode:(NSInteger)code reason:(NSString *)reason; +{ + assert(code); + dispatch_async(_workQueue, ^{ + if (self.readyState == SR_CLOSING || self.readyState == SR_CLOSED) { + return; + } + + BOOL wasConnecting = self.readyState == SR_CONNECTING; + + self.readyState = SR_CLOSING; + + SRFastLog(@"Closing with code %d reason %@", code, reason); + + if (wasConnecting) { + [self _disconnect]; + return; + } + + size_t maxMsgSize = [reason maximumLengthOfBytesUsingEncoding:NSUTF8StringEncoding]; + NSMutableData *mutablePayload = [[NSMutableData alloc] initWithLength:sizeof(uint16_t) + maxMsgSize]; + NSData *payload = mutablePayload; + + ((uint16_t *)mutablePayload.mutableBytes)[0] = EndianU16_BtoN(code); + + if (reason) { + NSRange remainingRange = {0}; + + NSUInteger usedLength = 0; + + BOOL success = [reason getBytes:(char *)mutablePayload.mutableBytes + sizeof(uint16_t) maxLength:payload.length - sizeof(uint16_t) usedLength:&usedLength encoding:NSUTF8StringEncoding options:NSStringEncodingConversionExternalRepresentation range:NSMakeRange(0, reason.length) remainingRange:&remainingRange]; + + assert(success); + assert(remainingRange.length == 0); + + if (usedLength != maxMsgSize) { + payload = [payload subdataWithRange:NSMakeRange(0, usedLength + sizeof(uint16_t))]; + } + } + + + [self _sendFrameWithOpcode:SROpCodeConnectionClose data:payload]; + }); +} + +- (void)_closeWithProtocolError:(NSString *)message; +{ + // Need to shunt this on the _callbackQueue first to see if they received any messages + [self _performDelegateBlock:^{ + [self closeWithCode:SRStatusCodeProtocolError reason:message]; + dispatch_async(_workQueue, ^{ + [self _disconnect]; + }); + }]; +} + +- (void)_failWithError:(NSError *)error; +{ + dispatch_async(_workQueue, ^{ + if (self.readyState != SR_CLOSED) { + _failed = YES; + [self _performDelegateBlock:^{ + if ([self.delegate respondsToSelector:@selector(webSocket:didFailWithError:)]) { + [self.delegate webSocket:self didFailWithError:error]; + } + }]; + + self.readyState = SR_CLOSED; + _selfRetain = nil; + + SRFastLog(@"Failing with error %@", error.localizedDescription); + + [self _disconnect]; + } + }); +} + +- (void)_writeData:(NSData *)data; +{ + [self assertOnWorkQueue]; + + if (_closeWhenFinishedWriting) { + return; + } + [_outputBuffer appendData:data]; + [self _pumpWriting]; +} + +- (void)send:(id)data; +{ + NSAssert(self.readyState != SR_CONNECTING, @"Invalid State: Cannot call send: until connection is open"); + // TODO: maybe not copy this for performance + data = [data copy]; + dispatch_async(_workQueue, ^{ + if ([data isKindOfClass:[NSString class]]) { + [self _sendFrameWithOpcode:SROpCodeTextFrame data:[(NSString *)data dataUsingEncoding:NSUTF8StringEncoding]]; + } else if ([data isKindOfClass:[NSData class]]) { + [self _sendFrameWithOpcode:SROpCodeBinaryFrame data:data]; + } else if (data == nil) { + [self _sendFrameWithOpcode:SROpCodeTextFrame data:data]; + } else { + assert(NO); + } + }); +} + +- (void)sendPing:(NSData *)data; +{ + NSAssert(self.readyState == SR_OPEN, @"Invalid State: Cannot call send: until connection is open"); + // TODO: maybe not copy this for performance + data = [data copy] ?: [NSData data]; // It's okay for a ping to be empty + dispatch_async(_workQueue, ^{ + [self _sendFrameWithOpcode:SROpCodePing data:data]; + }); +} + +- (void)handlePing:(NSData *)pingData; +{ + // Need to pingpong this off _callbackQueue first to make sure messages happen in order + [self _performDelegateBlock:^{ + dispatch_async(_workQueue, ^{ + [self _sendFrameWithOpcode:SROpCodePong data:pingData]; + }); + }]; +} + +- (void)handlePong:(NSData *)pongData; +{ + SRFastLog(@"Received pong"); + [self _performDelegateBlock:^{ + if ([self.delegate respondsToSelector:@selector(webSocket:didReceivePong:)]) { + [self.delegate webSocket:self didReceivePong:pongData]; + } + }]; +} + +- (void)_handleMessage:(id)message +{ + SRFastLog(@"Received message"); + [self _performDelegateBlock:^{ + [self.delegate webSocket:self didReceiveMessage:message]; + }]; +} + + +static inline BOOL closeCodeIsValid(int closeCode) { + if (closeCode < 1000) { + return NO; + } + + if (closeCode >= 1000 && closeCode <= 1011) { + if (closeCode == 1004 || + closeCode == 1005 || + closeCode == 1006) { + return NO; + } + return YES; + } + + if (closeCode >= 3000 && closeCode <= 3999) { + return YES; + } + + if (closeCode >= 4000 && closeCode <= 4999) { + return YES; + } + + return NO; +} + +// Note from RFC: +// +// If there is a body, the first two +// bytes of the body MUST be a 2-byte unsigned integer (in network byte +// order) representing a status code with value /code/ defined in +// Section 7.4. Following the 2-byte integer the body MAY contain UTF-8 +// encoded data with value /reason/, the interpretation of which is not +// defined by this specification. + +- (void)handleCloseWithData:(NSData *)data; +{ + size_t dataSize = data.length; + __block uint16_t closeCode = 0; + + SRFastLog(@"Received close frame"); + + if (dataSize == 1) { + // TODO handle error + [self _closeWithProtocolError:@"Payload for close must be larger than 2 bytes"]; + return; + } else if (dataSize >= 2) { + [data getBytes:&closeCode length:sizeof(closeCode)]; + _closeCode = EndianU16_BtoN(closeCode); + if (!closeCodeIsValid(_closeCode)) { + [self _closeWithProtocolError:[NSString stringWithFormat:@"Cannot have close code of %d", _closeCode]]; + return; + } + if (dataSize > 2) { + _closeReason = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(2, dataSize - 2)] encoding:NSUTF8StringEncoding]; + if (!_closeReason) { + [self _closeWithProtocolError:@"Close reason MUST be valid UTF-8"]; + return; + } + } + } else { + _closeCode = SRStatusNoStatusReceived; + } + + [self assertOnWorkQueue]; + + if (self.readyState == SR_OPEN) { + [self closeWithCode:1000 reason:nil]; + } + dispatch_async(_workQueue, ^{ + [self _disconnect]; + }); +} + +- (void)_disconnect; +{ + [self assertOnWorkQueue]; + SRFastLog(@"Trying to disconnect"); + _closeWhenFinishedWriting = YES; + [self _pumpWriting]; +} + +- (void)_handleFrameWithData:(NSData *)frameData opCode:(NSInteger)opcode; +{ + // Check that the current data is valid UTF8 + + BOOL isControlFrame = (opcode == SROpCodePing || opcode == SROpCodePong || opcode == SROpCodeConnectionClose); + if (!isControlFrame) { + [self _readFrameNew]; + } else { + dispatch_async(_workQueue, ^{ + [self _readFrameContinue]; + }); + } + + switch (opcode) { + case SROpCodeTextFrame: { + NSString *str = [[NSString alloc] initWithData:frameData encoding:NSUTF8StringEncoding]; + if (str == nil && frameData) { + [self closeWithCode:SRStatusCodeInvalidUTF8 reason:@"Text frames must be valid UTF-8"]; + dispatch_async(_workQueue, ^{ + [self _disconnect]; + }); + + return; + } + [self _handleMessage:str]; + break; + } + case SROpCodeBinaryFrame: + [self _handleMessage:[frameData copy]]; + break; + case SROpCodeConnectionClose: + [self handleCloseWithData:frameData]; + break; + case SROpCodePing: + [self handlePing:frameData]; + break; + case SROpCodePong: + [self handlePong:frameData]; + break; + default: + [self _closeWithProtocolError:[NSString stringWithFormat:@"Unknown opcode %ld", (long)opcode]]; + // TODO: Handle invalid opcode + break; + } +} + +- (void)_handleFrameHeader:(frame_header)frame_header curData:(NSData *)curData; +{ + assert(frame_header.opcode != 0); + + if (self.readyState != SR_OPEN) { + return; + } + + + BOOL isControlFrame = (frame_header.opcode == SROpCodePing || frame_header.opcode == SROpCodePong || frame_header.opcode == SROpCodeConnectionClose); + + if (isControlFrame && !frame_header.fin) { + [self _closeWithProtocolError:@"Fragmented control frames not allowed"]; + return; + } + + if (isControlFrame && frame_header.payload_length >= 126) { + [self _closeWithProtocolError:@"Control frames cannot have payloads larger than 126 bytes"]; + return; + } + + if (!isControlFrame) { + _currentFrameOpcode = frame_header.opcode; + _currentFrameCount += 1; + } + + if (frame_header.payload_length == 0) { + if (isControlFrame) { + [self _handleFrameWithData:curData opCode:frame_header.opcode]; + } else { + if (frame_header.fin) { + [self _handleFrameWithData:_currentFrameData opCode:frame_header.opcode]; + } else { + // TODO add assert that opcode is not a control; + [self _readFrameContinue]; + } + } + } else { + assert(frame_header.payload_length <= SIZE_T_MAX); + [self _addConsumerWithDataLength:(size_t)frame_header.payload_length callback:^(SRWebSocket *self, NSData *newData) { + if (isControlFrame) { + [self _handleFrameWithData:newData opCode:frame_header.opcode]; + } else { + if (frame_header.fin) { + [self _handleFrameWithData:self->_currentFrameData opCode:frame_header.opcode]; + } else { + // TODO add assert that opcode is not a control; + [self _readFrameContinue]; + } + + } + } readToCurrentFrame:!isControlFrame unmaskBytes:frame_header.masked]; + } +} + +/* From RFC: + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-------+-+-------------+-------------------------------+ + |F|R|R|R| opcode|M| Payload len | Extended payload length | + |I|S|S|S| (4) |A| (7) | (16/64) | + |N|V|V|V| |S| | (if payload len==126/127) | + | |1|2|3| |K| | | + +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - + + | Extended payload length continued, if payload len == 127 | + + - - - - - - - - - - - - - - - +-------------------------------+ + | |Masking-key, if MASK set to 1 | + +-------------------------------+-------------------------------+ + | Masking-key (continued) | Payload Data | + +-------------------------------- - - - - - - - - - - - - - - - + + : Payload Data continued ... : + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + | Payload Data continued ... | + +---------------------------------------------------------------+ + */ + +static const uint8_t SRFinMask = 0x80; +static const uint8_t SROpCodeMask = 0x0F; +static const uint8_t SRRsvMask = 0x70; +static const uint8_t SRMaskMask = 0x80; +static const uint8_t SRPayloadLenMask = 0x7F; + + +- (void)_readFrameContinue; +{ + assert((_currentFrameCount == 0 && _currentFrameOpcode == 0) || (_currentFrameCount > 0 && _currentFrameOpcode > 0)); + + [self _addConsumerWithDataLength:2 callback:^(SRWebSocket *self, NSData *data) { + __block frame_header header = {0}; + + const uint8_t *headerBuffer = data.bytes; + assert(data.length >= 2); + + if (headerBuffer[0] & SRRsvMask) { + [self _closeWithProtocolError:@"Server used RSV bits"]; + return; + } + + uint8_t receivedOpcode = (SROpCodeMask & headerBuffer[0]); + + BOOL isControlFrame = (receivedOpcode == SROpCodePing || receivedOpcode == SROpCodePong || receivedOpcode == SROpCodeConnectionClose); + + if (!isControlFrame && receivedOpcode != 0 && self->_currentFrameCount > 0) { + [self _closeWithProtocolError:@"all data frames after the initial data frame must have opcode 0"]; + return; + } + + if (receivedOpcode == 0 && self->_currentFrameCount == 0) { + [self _closeWithProtocolError:@"cannot continue a message"]; + return; + } + + header.opcode = receivedOpcode == 0 ? self->_currentFrameOpcode : receivedOpcode; + + header.fin = !!(SRFinMask & headerBuffer[0]); + + + header.masked = !!(SRMaskMask & headerBuffer[1]); + header.payload_length = SRPayloadLenMask & headerBuffer[1]; + + headerBuffer = NULL; + + if (header.masked) { + [self _closeWithProtocolError:@"Client must receive unmasked data"]; + } + + size_t extra_bytes_needed = header.masked ? sizeof(_currentReadMaskKey) : 0; + + if (header.payload_length == 126) { + extra_bytes_needed += sizeof(uint16_t); + } else if (header.payload_length == 127) { + extra_bytes_needed += sizeof(uint64_t); + } + + if (extra_bytes_needed == 0) { + [self _handleFrameHeader:header curData:self->_currentFrameData]; + } else { + [self _addConsumerWithDataLength:extra_bytes_needed callback:^(SRWebSocket *self, NSData *data) { + size_t mapped_size = data.length; + const void *mapped_buffer = data.bytes; + size_t offset = 0; + + if (header.payload_length == 126) { + assert(mapped_size >= sizeof(uint16_t)); + uint16_t newLen = EndianU16_BtoN(*(uint16_t *)(mapped_buffer)); + header.payload_length = newLen; + offset += sizeof(uint16_t); + } else if (header.payload_length == 127) { + assert(mapped_size >= sizeof(uint64_t)); + header.payload_length = EndianU64_BtoN(*(uint64_t *)(mapped_buffer)); + offset += sizeof(uint64_t); + } else { + assert(header.payload_length < 126 && header.payload_length >= 0); + } + + + if (header.masked) { + assert(mapped_size >= sizeof(_currentReadMaskOffset) + offset); + memcpy(self->_currentReadMaskKey, ((uint8_t *)mapped_buffer) + offset, sizeof(self->_currentReadMaskKey)); + } + + [self _handleFrameHeader:header curData:self->_currentFrameData]; + } readToCurrentFrame:NO unmaskBytes:NO]; + } + } readToCurrentFrame:NO unmaskBytes:NO]; +} + +- (void)_readFrameNew; +{ + dispatch_async(_workQueue, ^{ + [_currentFrameData setLength:0]; + + _currentFrameOpcode = 0; + _currentFrameCount = 0; + _readOpCount = 0; + _currentStringScanPosition = 0; + + [self _readFrameContinue]; + }); +} + +- (void)_pumpWriting; +{ + [self assertOnWorkQueue]; + + NSUInteger dataLength = _outputBuffer.length; + if (dataLength - _outputBufferOffset > 0 && _outputStream.hasSpaceAvailable) { + NSInteger bytesWritten = [_outputStream write:_outputBuffer.bytes + _outputBufferOffset maxLength:dataLength - _outputBufferOffset]; + if (bytesWritten == -1) { + [self _failWithError:[NSError errorWithDomain:SRWebSocketErrorDomain code:2145 userInfo:[NSDictionary dictionaryWithObject:@"Error writing to stream" forKey:NSLocalizedDescriptionKey]]]; + return; + } + + _outputBufferOffset += bytesWritten; + + if (_outputBufferOffset > 4096 && _outputBufferOffset > (_outputBuffer.length >> 1)) { + _outputBuffer = [[NSMutableData alloc] initWithBytes:(char *)_outputBuffer.bytes + _outputBufferOffset length:_outputBuffer.length - _outputBufferOffset]; + _outputBufferOffset = 0; + } + } + + if (_closeWhenFinishedWriting && + _outputBuffer.length - _outputBufferOffset == 0 && + (_inputStream.streamStatus != NSStreamStatusNotOpen && + _inputStream.streamStatus != NSStreamStatusClosed) && + !_sentClose) { + _sentClose = YES; + + [_outputStream close]; + [_inputStream close]; + + + for (NSArray *runLoop in [_scheduledRunloops copy]) { + [self unscheduleFromRunLoop:[runLoop objectAtIndex:0] forMode:[runLoop objectAtIndex:1]]; + } + + if (!_failed) { + [self _performDelegateBlock:^{ + if ([self.delegate respondsToSelector:@selector(webSocket:didCloseWithCode:reason:wasClean:)]) { + [self.delegate webSocket:self didCloseWithCode:_closeCode reason:_closeReason wasClean:YES]; + } + }]; + } + + _selfRetain = nil; + } +} + +- (void)_addConsumerWithScanner:(stream_scanner)consumer callback:(data_callback)callback; +{ + [self assertOnWorkQueue]; + [self _addConsumerWithScanner:consumer callback:callback dataLength:0]; +} + +- (void)_addConsumerWithDataLength:(size_t)dataLength callback:(data_callback)callback readToCurrentFrame:(BOOL)readToCurrentFrame unmaskBytes:(BOOL)unmaskBytes; +{ + [self assertOnWorkQueue]; + assert(dataLength); + + [_consumers addObject:[_consumerPool consumerWithScanner:nil handler:callback bytesNeeded:dataLength readToCurrentFrame:readToCurrentFrame unmaskBytes:unmaskBytes]]; + [self _pumpScanner]; +} + +- (void)_addConsumerWithScanner:(stream_scanner)consumer callback:(data_callback)callback dataLength:(size_t)dataLength; +{ + [self assertOnWorkQueue]; + [_consumers addObject:[_consumerPool consumerWithScanner:consumer handler:callback bytesNeeded:dataLength readToCurrentFrame:NO unmaskBytes:NO]]; + [self _pumpScanner]; +} + + +static const char CRLFCRLFBytes[] = {'\r', '\n', '\r', '\n'}; + +- (void)_readUntilHeaderCompleteWithCallback:(data_callback)dataHandler; +{ + [self _readUntilBytes:CRLFCRLFBytes length:sizeof(CRLFCRLFBytes) callback:dataHandler]; +} + +- (void)_readUntilBytes:(const void *)bytes length:(size_t)length callback:(data_callback)dataHandler; +{ + // TODO optimize so this can continue from where we last searched + stream_scanner consumer = ^size_t(NSData *data) { + __block size_t found_size = 0; + __block size_t match_count = 0; + + size_t size = data.length; + const unsigned char *buffer = data.bytes; + for (size_t i = 0; i < size; i++ ) { + if (((const unsigned char *)buffer)[i] == ((const unsigned char *)bytes)[match_count]) { + match_count += 1; + if (match_count == length) { + found_size = i + 1; + break; + } + } else { + match_count = 0; + } + } + return found_size; + }; + [self _addConsumerWithScanner:consumer callback:dataHandler]; +} + + +// Returns true if did work +- (BOOL)_innerPumpScanner { + + BOOL didWork = NO; + + if (self.readyState >= SR_CLOSING) { + return didWork; + } + + if (!_consumers.count) { + return didWork; + } + + size_t curSize = _readBuffer.length - _readBufferOffset; + if (!curSize) { + return didWork; + } + + SRIOConsumer *consumer = [_consumers objectAtIndex:0]; + + size_t bytesNeeded = consumer.bytesNeeded; + + size_t foundSize = 0; + if (consumer.consumer) { + NSData *tempView = [NSData dataWithBytesNoCopy:(char *)_readBuffer.bytes + _readBufferOffset length:_readBuffer.length - _readBufferOffset freeWhenDone:NO]; + foundSize = consumer.consumer(tempView); + } else { + assert(consumer.bytesNeeded); + if (curSize >= bytesNeeded) { + foundSize = bytesNeeded; + } else if (consumer.readToCurrentFrame) { + foundSize = curSize; + } + } + + NSData *slice = nil; + if (consumer.readToCurrentFrame || foundSize) { + NSRange sliceRange = NSMakeRange(_readBufferOffset, foundSize); + slice = [_readBuffer subdataWithRange:sliceRange]; + + _readBufferOffset += foundSize; + + if (_readBufferOffset > 4096 && _readBufferOffset > (_readBuffer.length >> 1)) { + _readBuffer = [[NSMutableData alloc] initWithBytes:(char *)_readBuffer.bytes + _readBufferOffset length:_readBuffer.length - _readBufferOffset]; _readBufferOffset = 0; + } + + if (consumer.unmaskBytes) { + NSMutableData *mutableSlice = [slice mutableCopy]; + + NSUInteger len = mutableSlice.length; + uint8_t *bytes = mutableSlice.mutableBytes; + + for (NSUInteger i = 0; i < len; i++) { + bytes[i] = bytes[i] ^ _currentReadMaskKey[_currentReadMaskOffset % sizeof(_currentReadMaskKey)]; + _currentReadMaskOffset += 1; + } + + slice = mutableSlice; + } + + if (consumer.readToCurrentFrame) { + [_currentFrameData appendData:slice]; + + _readOpCount += 1; + + if (_currentFrameOpcode == SROpCodeTextFrame) { + // Validate UTF8 stuff. + size_t currentDataSize = _currentFrameData.length; + if (_currentFrameOpcode == SROpCodeTextFrame && currentDataSize > 0) { + // TODO: Optimize the crap out of this. Don't really have to copy all the data each time + + size_t scanSize = currentDataSize - _currentStringScanPosition; + + NSData *scan_data = [_currentFrameData subdataWithRange:NSMakeRange(_currentStringScanPosition, scanSize)]; + int32_t valid_utf8_size = validate_dispatch_data_partial_string(scan_data); + + if (valid_utf8_size == -1) { + [self closeWithCode:SRStatusCodeInvalidUTF8 reason:@"Text frames must be valid UTF-8"]; + dispatch_async(_workQueue, ^{ + [self _disconnect]; + }); + return didWork; + } else { + _currentStringScanPosition += valid_utf8_size; + } + } + + } + + consumer.bytesNeeded -= foundSize; + + if (consumer.bytesNeeded == 0) { + [_consumers removeObjectAtIndex:0]; + consumer.handler(self, nil); + [_consumerPool returnConsumer:consumer]; + didWork = YES; + } + } else if (foundSize) { + [_consumers removeObjectAtIndex:0]; + consumer.handler(self, slice); + [_consumerPool returnConsumer:consumer]; + didWork = YES; + } + } + return didWork; +} + +-(void)_pumpScanner; +{ + [self assertOnWorkQueue]; + + if (!_isPumping) { + _isPumping = YES; + } else { + return; + } + + while ([self _innerPumpScanner]) { + + } + + _isPumping = NO; +} + +//#define NOMASK + +static const size_t SRFrameHeaderOverhead = 32; + +- (void)_sendFrameWithOpcode:(SROpCode)opcode data:(id)data; +{ + [self assertOnWorkQueue]; + + if (nil == data) { + return; + } + + NSAssert([data isKindOfClass:[NSData class]] || [data isKindOfClass:[NSString class]], @"NSString or NSData"); + + size_t payloadLength = [data isKindOfClass:[NSString class]] ? [(NSString *)data lengthOfBytesUsingEncoding:NSUTF8StringEncoding] : [data length]; + + NSMutableData *frame = [[NSMutableData alloc] initWithLength:payloadLength + SRFrameHeaderOverhead]; + if (!frame) { + [self closeWithCode:SRStatusCodeMessageTooBig reason:@"Message too big"]; + return; + } + uint8_t *frame_buffer = (uint8_t *)[frame mutableBytes]; + + // set fin + frame_buffer[0] = SRFinMask | opcode; + + BOOL useMask = YES; +#ifdef NOMASK + useMask = NO; +#endif + + if (useMask) { + // set the mask and header + frame_buffer[1] |= SRMaskMask; + } + + size_t frame_buffer_size = 2; + + const uint8_t *unmasked_payload = NULL; + if ([data isKindOfClass:[NSData class]]) { + unmasked_payload = (uint8_t *)[data bytes]; + } else if ([data isKindOfClass:[NSString class]]) { + unmasked_payload = (const uint8_t *)[data UTF8String]; + } else { + return; + } + + if (payloadLength < 126) { + frame_buffer[1] |= payloadLength; + } else if (payloadLength <= UINT16_MAX) { + frame_buffer[1] |= 126; + *((uint16_t *)(frame_buffer + frame_buffer_size)) = EndianU16_BtoN((uint16_t)payloadLength); + frame_buffer_size += sizeof(uint16_t); + } else { + frame_buffer[1] |= 127; + *((uint64_t *)(frame_buffer + frame_buffer_size)) = EndianU64_BtoN((uint64_t)payloadLength); + frame_buffer_size += sizeof(uint64_t); + } + + if (!useMask) { + for (size_t i = 0; i < payloadLength; i++) { + frame_buffer[frame_buffer_size] = unmasked_payload[i]; + frame_buffer_size += 1; + } + } else { + uint8_t *mask_key = frame_buffer + frame_buffer_size; + SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key); + frame_buffer_size += sizeof(uint32_t); + + // TODO: could probably optimize this with SIMD + for (size_t i = 0; i < payloadLength; i++) { + frame_buffer[frame_buffer_size] = unmasked_payload[i] ^ mask_key[i % sizeof(uint32_t)]; + frame_buffer_size += 1; + } + } + + assert(frame_buffer_size <= [frame length]); + frame.length = frame_buffer_size; + + [self _writeData:frame]; +} + +- (void)stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode; +{ + if (_secure && !_pinnedCertFound && (eventCode == NSStreamEventHasBytesAvailable || eventCode == NSStreamEventHasSpaceAvailable)) { + + NSArray *sslCerts = [_urlRequest SR_SSLPinnedCertificates]; + if (sslCerts) { + SecTrustRef secTrust = (__bridge SecTrustRef)[aStream propertyForKey:(__bridge id)kCFStreamPropertySSLPeerTrust]; + if (secTrust) { + NSInteger numCerts = SecTrustGetCertificateCount(secTrust); + for (NSInteger i = 0; i < numCerts && !_pinnedCertFound; i++) { + SecCertificateRef cert = SecTrustGetCertificateAtIndex(secTrust, i); + NSData *certData = CFBridgingRelease(SecCertificateCopyData(cert)); + + for (id ref in sslCerts) { + SecCertificateRef trustedCert = (__bridge SecCertificateRef)ref; + NSData *trustedCertData = CFBridgingRelease(SecCertificateCopyData(trustedCert)); + + if ([trustedCertData isEqualToData:certData]) { + _pinnedCertFound = YES; + break; + } + } + } + } + + if (!_pinnedCertFound) { + dispatch_async(_workQueue, ^{ + [self _failWithError:[NSError errorWithDomain:SRWebSocketErrorDomain code:23556 userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Invalid server cert"] forKey:NSLocalizedDescriptionKey]]]; + }); + return; + } + } + } + + dispatch_async(_workQueue, ^{ + switch (eventCode) { + case NSStreamEventOpenCompleted: { + SRFastLog(@"NSStreamEventOpenCompleted %@", aStream); + if (self.readyState >= SR_CLOSING) { + return; + } + assert(_readBuffer); + + if (self.readyState == SR_CONNECTING && aStream == _inputStream) { + [self didConnect]; + } + [self _pumpWriting]; + [self _pumpScanner]; + break; + } + + case NSStreamEventErrorOccurred: { + SRFastLog(@"NSStreamEventErrorOccurred %@ %@", aStream, [[aStream streamError] copy]); + /// TODO specify error better! + [self _failWithError:aStream.streamError]; + _readBufferOffset = 0; + [_readBuffer setLength:0]; + break; + + } + + case NSStreamEventEndEncountered: { + [self _pumpScanner]; + SRFastLog(@"NSStreamEventEndEncountered %@", aStream); + if (aStream.streamError) { + [self _failWithError:aStream.streamError]; + } else { + if (self.readyState != SR_CLOSED) { + self.readyState = SR_CLOSED; + _selfRetain = nil; + } + + if (!_sentClose && !_failed) { + _sentClose = YES; + // If we get closed in this state it's probably not clean because we should be sending this when we send messages + [self _performDelegateBlock:^{ + if ([self.delegate respondsToSelector:@selector(webSocket:didCloseWithCode:reason:wasClean:)]) { + [self.delegate webSocket:self didCloseWithCode:SRStatusCodeGoingAway reason:@"Stream end encountered" wasClean:NO]; + } + }]; + } + } + + break; + } + + case NSStreamEventHasBytesAvailable: { + SRFastLog(@"NSStreamEventHasBytesAvailable %@", aStream); + const int bufferSize = 2048; + uint8_t buffer[bufferSize]; + + while (_inputStream.hasBytesAvailable) { + NSInteger bytes_read = [_inputStream read:buffer maxLength:bufferSize]; + + if (bytes_read > 0) { + [_readBuffer appendBytes:buffer length:bytes_read]; + } else if (bytes_read < 0) { + [self _failWithError:_inputStream.streamError]; + } + + if (bytes_read != bufferSize) { + break; + } + }; + [self _pumpScanner]; + break; + } + + case NSStreamEventHasSpaceAvailable: { + SRFastLog(@"NSStreamEventHasSpaceAvailable %@", aStream); + [self _pumpWriting]; + break; + } + + default: + SRFastLog(@"(default) %@", aStream); + break; + } + }); +} + +@end + + +@implementation SRIOConsumer + +@synthesize bytesNeeded = _bytesNeeded; +@synthesize consumer = _scanner; +@synthesize handler = _handler; +@synthesize readToCurrentFrame = _readToCurrentFrame; +@synthesize unmaskBytes = _unmaskBytes; + +- (void)setupWithScanner:(stream_scanner)scanner handler:(data_callback)handler bytesNeeded:(size_t)bytesNeeded readToCurrentFrame:(BOOL)readToCurrentFrame unmaskBytes:(BOOL)unmaskBytes; +{ + _scanner = [scanner copy]; + _handler = [handler copy]; + _bytesNeeded = bytesNeeded; + _readToCurrentFrame = readToCurrentFrame; + _unmaskBytes = unmaskBytes; + assert(_scanner || _bytesNeeded); +} + + +@end + + +@implementation SRIOConsumerPool { + NSUInteger _poolSize; + NSMutableArray *_bufferedConsumers; +} + +- (id)initWithBufferCapacity:(NSUInteger)poolSize; +{ + self = [super init]; + if (self) { + _poolSize = poolSize; + _bufferedConsumers = [[NSMutableArray alloc] initWithCapacity:poolSize]; + } + return self; +} + +- (id)init +{ + return [self initWithBufferCapacity:8]; +} + +- (SRIOConsumer *)consumerWithScanner:(stream_scanner)scanner handler:(data_callback)handler bytesNeeded:(size_t)bytesNeeded readToCurrentFrame:(BOOL)readToCurrentFrame unmaskBytes:(BOOL)unmaskBytes; +{ + SRIOConsumer *consumer = nil; + if (_bufferedConsumers.count) { + consumer = [_bufferedConsumers lastObject]; + [_bufferedConsumers removeLastObject]; + } else { + consumer = [[SRIOConsumer alloc] init]; + } + + [consumer setupWithScanner:scanner handler:handler bytesNeeded:bytesNeeded readToCurrentFrame:readToCurrentFrame unmaskBytes:unmaskBytes]; + + return consumer; +} + +- (void)returnConsumer:(SRIOConsumer *)consumer; +{ + if (_bufferedConsumers.count < _poolSize) { + [_bufferedConsumers addObject:consumer]; + } +} + +@end + + +@implementation NSURLRequest (CertificateAdditions) + +- (NSArray *)SR_SSLPinnedCertificates; +{ + return [NSURLProtocol propertyForKey:@"SR_SSLPinnedCertificates" inRequest:self]; +} + +@end + +@implementation NSMutableURLRequest (CertificateAdditions) + +- (NSArray *)SR_SSLPinnedCertificates; +{ + return [NSURLProtocol propertyForKey:@"SR_SSLPinnedCertificates" inRequest:self]; +} + +- (void)setSR_SSLPinnedCertificates:(NSArray *)SR_SSLPinnedCertificates; +{ + [NSURLProtocol setProperty:SR_SSLPinnedCertificates forKey:@"SR_SSLPinnedCertificates" inRequest:self]; +} + +@end + +@implementation NSURL (SRWebSocket) + +- (NSString *)SR_origin; +{ + NSString *scheme = [self.scheme lowercaseString]; + + if ([scheme isEqualToString:@"wss"]) { + scheme = @"https"; + } else if ([scheme isEqualToString:@"ws"]) { + scheme = @"http"; + } + + if (self.port) { + return [NSString stringWithFormat:@"%@://%@:%@/", scheme, self.host, self.port]; + } else { + return [NSString stringWithFormat:@"%@://%@/", scheme, self.host]; + } +} + +@end + +//#define SR_ENABLE_LOG + +static inline void SRFastLog(NSString *format, ...) { +#ifdef SR_ENABLE_LOG + __block va_list arg_list; + va_start (arg_list, format); + + NSString *formattedString = [[NSString alloc] initWithFormat:format arguments:arg_list]; + + va_end(arg_list); + + NSLog(@"[SR] %@", formattedString); +#endif +} + + +#ifdef HAS_ICU + +static inline int32_t validate_dispatch_data_partial_string(NSData *data) { + if ([data length] > INT32_MAX) { + // INT32_MAX is the limit so long as this Framework is using 32 bit ints everywhere. + return -1; + } + + int32_t size = (int32_t)[data length]; + + const void * contents = [data bytes]; + const uint8_t *str = (const uint8_t *)contents; + + UChar32 codepoint = 1; + int32_t offset = 0; + int32_t lastOffset = 0; + while(offset < size && codepoint > 0) { + lastOffset = offset; + U8_NEXT(str, offset, size, codepoint); + } + + if (codepoint == -1) { + // Check to see if the last byte is valid or whether it was just continuing + if (!U8_IS_LEAD(str[lastOffset]) || U8_COUNT_TRAIL_BYTES(str[lastOffset]) + lastOffset < (int32_t)size) { + + size = -1; + } else { + uint8_t leadByte = str[lastOffset]; + U8_MASK_LEAD_BYTE(leadByte, U8_COUNT_TRAIL_BYTES(leadByte)); + + for (int i = lastOffset + 1; i < offset; i++) { + if (U8_IS_SINGLE(str[i]) || U8_IS_LEAD(str[i]) || !U8_IS_TRAIL(str[i])) { + size = -1; + } + } + + if (size != -1) { + size = lastOffset; + } + } + } + + if (size != -1 && ![[NSString alloc] initWithBytesNoCopy:(char *)[data bytes] length:size encoding:NSUTF8StringEncoding freeWhenDone:NO]) { + size = -1; + } + + return size; +} + +#else + +// This is a hack, and probably not optimal +static inline int32_t validate_dispatch_data_partial_string(NSData *data) { + static const int maxCodepointSize = 3; + + for (int i = 0; i < maxCodepointSize; i++) { + NSString *str = [[NSString alloc] initWithBytesNoCopy:(char *)data.bytes length:data.length - i encoding:NSUTF8StringEncoding freeWhenDone:NO]; + if (str) { + return data.length - i; + } + } + + return -1; +} + +#endif + +static _SRRunLoopThread *networkThread = nil; +static NSRunLoop *networkRunLoop = nil; + +@implementation NSRunLoop (SRWebSocket) + ++ (NSRunLoop *)SR_networkRunLoop { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + networkThread = [[_SRRunLoopThread alloc] init]; + networkThread.name = @"com.squareup.SocketRocket.NetworkThread"; + [networkThread start]; + networkRunLoop = networkThread.runLoop; + }); + + return networkRunLoop; +} + +@end + + +@implementation _SRRunLoopThread { + dispatch_group_t _waitGroup; +} + +@synthesize runLoop = _runLoop; + +- (void)dealloc +{ + sr_dispatch_release(_waitGroup); +} + +- (id)init +{ + self = [super init]; + if (self) { + _waitGroup = dispatch_group_create(); + dispatch_group_enter(_waitGroup); + } + return self; +} + +- (void)main; +{ + @autoreleasepool { + _runLoop = [NSRunLoop currentRunLoop]; + dispatch_group_leave(_waitGroup); + + NSTimer *timer = [[NSTimer alloc] initWithFireDate:[NSDate distantFuture] interval:0.0 target:nil selector:nil userInfo:nil repeats:NO]; + [_runLoop addTimer:timer forMode:NSDefaultRunLoopMode]; + + while ([_runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]) { + + } + assert(NO); + } +} + +- (NSRunLoop *)runLoop; +{ + dispatch_group_wait(_waitGroup, DISPATCH_TIME_FOREVER); + return _runLoop; +} + +@end diff --git a/Libraries/react-native/react-native-interface.js b/Libraries/react-native/react-native-interface.js index 82ceeb77e..e62d5f576 100644 --- a/Libraries/react-native/react-native-interface.js +++ b/Libraries/react-native/react-native-interface.js @@ -1,35 +1,9 @@ -declare module "react-native" { - declare class ListViewDataSource { - constructor(params: Object): void; - } +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @flow + */ - declare var AppRegistry: ReactClass; - declare var Image: ReactClass; - declare var ListView: ReactClass; - declare var NavigatorIOS: ReactClass; - declare var NavigatorItemIOS: ReactClass; - declare var PixelRatio: ReactClass; - declare var ScrollView: ReactClass; - declare var ActivityIndicatorIOS: ReactClass; - declare var StyleSheet: ReactClass; - declare var Text: ReactClass; - declare var TextInput: ReactClass; - declare var TimerMixin: ReactClass; - declare var TouchableHighlight: ReactClass; - declare var TouchableWithoutFeedback: ReactClass; - declare var View: ReactClass; - declare var invariant: Function; - declare var ix: Function; -} - -declare module "addons" { - declare var NavigatorIOS: ReactClass; - declare var NavigatorItemIOS: ReactClass; - declare var StyleSheet: ReactClass; -} +// see also react-native.js declare var __DEV__: boolean; - -declare module "fetch" { - declare function exports(url: string, options?: Object): Object; -} diff --git a/Libraries/react-native/react-native.js b/Libraries/react-native/react-native.js index 63690c4fa..59c82ef72 100644 --- a/Libraries/react-native/react-native.js +++ b/Libraries/react-native/react-native.js @@ -13,7 +13,6 @@ var ReactNative = { DatePickerIOS: require('DatePickerIOS'), Image: require('Image'), ListView: require('ListView'), - ListViewDataSource: require('ListViewDataSource'), MapView: require('MapView'), NavigatorIOS: require('NavigatorIOS'), PickerIOS: require('PickerIOS'), @@ -46,7 +45,6 @@ var ReactNative = { TimerMixin: require('TimerMixin'), VibrationIOS: require('VibrationIOS'), - invariant: require('invariant'), ix: require('ix'), }; diff --git a/Libraries/vendor/react_contrib/interactions/Touchable/Touchable.js b/Libraries/vendor/react_contrib/interactions/Touchable/Touchable.js index 5df94697e..020731fde 100644 --- a/Libraries/vendor/react_contrib/interactions/Touchable/Touchable.js +++ b/Libraries/vendor/react_contrib/interactions/Touchable/Touchable.js @@ -636,7 +636,7 @@ var TouchableMixin = { } if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) { - var hasLongPressHandler = !!this.touchableHandleLongPress; + var hasLongPressHandler = !!this.props.onLongPress; var pressIsLongButStillCallOnPress = IsLongPressingIn[curState] && ( // We *are* long pressing.. !hasLongPressHandler || // But either has no long handler diff --git a/ReactKit/Base/RCTRedBox.m b/ReactKit/Base/RCTRedBox.m index 1c70394fd..d36202650 100644 --- a/ReactKit/Base/RCTRedBox.m +++ b/ReactKit/Base/RCTRedBox.m @@ -85,7 +85,7 @@ - (void)showErrorMessage:(NSString *)message withStack:(NSArray *)stack showIfHidden:(BOOL)shouldShow { - if (self.hidden && shouldShow) { + if ((self.hidden && shouldShow) || (!self.hidden && [_lastErrorMessage isEqualToString:message])) { _lastStackTrace = stack; _lastErrorMessage = message; @@ -93,9 +93,12 @@ [_stackTraceTableView reloadData]; [_stackTraceTableView setNeedsLayout]; - [_stackTraceTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] - atScrollPosition:UITableViewScrollPositionTop - animated:NO]; + if (self.hidden) { + [_stackTraceTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] + atScrollPosition:UITableViewScrollPositionTop + animated:NO]; + } + [self makeKeyAndVisible]; [self becomeFirstResponder]; } diff --git a/ReactKit/Base/RCTRootView.m b/ReactKit/Base/RCTRootView.m index c62793d50..bc9a0972a 100644 --- a/ReactKit/Base/RCTRootView.m +++ b/ReactKit/Base/RCTRootView.m @@ -42,7 +42,10 @@ static Class _globalExecutorClass; [[RCTKeyCommands sharedInstance] registerKeyCommandWithInput:@"d" modifierFlags:UIKeyModifierCommand action:^(UIKeyCommand *command) { - _globalExecutorClass = [RCTWebViewExecutor class]; + _globalExecutorClass = NSClassFromString(@"RCTWebSocketExecutor"); + if (!_globalExecutorClass) { + RCTLogWarn(@"WebSocket debugger is not available. Did you forget to include RCTWebSocketExecutor?"); + } [self reloadAll]; }]; diff --git a/ReactKit/ReactKit.xcodeproj/project.pbxproj b/ReactKit/ReactKit.xcodeproj/project.pbxproj index 3e9607e25..d00c6b2c8 100644 --- a/ReactKit/ReactKit.xcodeproj/project.pbxproj +++ b/ReactKit/ReactKit.xcodeproj/project.pbxproj @@ -387,7 +387,7 @@ isa = PBXNativeTarget; buildConfigurationList = 83CBBA3F1A601D0F00E9B192 /* Build configuration list for PBXNativeTarget "ReactKit" */; buildPhases = ( - 006B79A01A781F38006873D1 /* Launch Packager */, + 006B79A01A781F38006873D1 /* ShellScript */, 83CBBA2A1A601D0E00E9B192 /* Sources */, 83CBBA2B1A601D0E00E9B192 /* Frameworks */, 83CBBA2C1A601D0E00E9B192 /* Copy Files */, @@ -434,14 +434,13 @@ /* End PBXProject section */ /* Begin PBXShellScriptBuildPhase section */ - 006B79A01A781F38006873D1 /* Launch Packager */ = { + 006B79A01A781F38006873D1 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Launch Packager"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; diff --git a/package.json b/package.json index 534a9691a..7c1e940e9 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "react-native", + "name": "react-native-github", "version": "0.1.0", "description": "Build native apps with React!", "repository": { @@ -34,6 +34,7 @@ "react-tools": "0.13.0-rc2" }, "devDependencies": { + "ws": "0.4.31", "jest-cli": "0.2.1", "eslint": "0.9.2" } diff --git a/packager/debugger.html b/packager/debugger.html new file mode 100644 index 000000000..f7cabc5f8 --- /dev/null +++ b/packager/debugger.html @@ -0,0 +1,112 @@ + + + + + + +React Native Debugger + + + + +

+ React Native JS code runs inside this Chrome tab +

+

Press ⌘⌥J to open Developer Tools. Enable Pause On Caught Exceptions for a better debugging experience.

+

Status: Loading

+ + diff --git a/packager/init.sh b/packager/init.sh new file mode 100755 index 000000000..6a42b9aeb --- /dev/null +++ b/packager/init.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env ruby + +def cp(src, dest, app_name) + if File.directory?(src) + Dir.mkdir(dest) unless Dir.exists?(dest) + else + content = File.read(src) + .gsub("SampleApp", app_name) + .gsub("Examples/#{app_name}/", "") + .gsub("../../Libraries/", "node_modules/react-native/Libraries/") + .gsub("../../ReactKit/", "node_modules/react-native/ReactKit/") + File.write(dest, content) + end +end + +def main(dest, app_name) + source = File.expand_path("../../Examples/SampleApp", __FILE__) + files = Dir.chdir(source) { Dir["**/*"] } + .reject { |file| file["project.xcworkspace"] || file["xcuserdata"] } + .each { |file| + new_file = file.gsub("SampleApp", app_name) + cp File.join(source, file), File.join(dest, new_file), app_name + } +end + +if ARGV.count == 0 + puts "Usage: #{__FILE__} " + puts "" + puts "This script will bootstrap new React Native app in current folder" +else + app_name = ARGV.first + dest = Dir.pwd + puts "Setting up new React Native app in #{dest}" + puts "" + + main(dest, app_name) + + puts "Next steps:" + puts "" + puts " Open #{app_name}.xcproject in Xcode" + puts " Hit Run button" + puts "" +end + diff --git a/packager/launchChromeDevTools.applescript b/packager/launchChromeDevTools.applescript new file mode 100755 index 000000000..4384b3ae0 --- /dev/null +++ b/packager/launchChromeDevTools.applescript @@ -0,0 +1,41 @@ +#!/usr/bin/env osascript + + +on run argv + set theURL to item 1 of argv + + tell application "Google Chrome" + activate + + if (count every window) = 0 then + make new window + end if + + -- Find a tab currently running the debugger + set found to false + set theTabIndex to -1 + repeat with theWindow in every window + set theTabIndex to 0 + repeat with theTab in every tab of theWindow + set theTabIndex to theTabIndex + 1 + if theTab's URL is theURL then + set found to true + exit repeat + end if + end repeat + + if found then + exit repeat + end if + end repeat + + if found then + set index of theWindow to 1 + set theWindow's active tab index to theTabIndex + else + tell window 1 + make new tab with properties {URL:theURL} + end tell + end if + end tell +end run diff --git a/packager/package.json b/packager/package.json index 6033c216a..0afcd3c3c 100644 --- a/packager/package.json +++ b/packager/package.json @@ -1,6 +1,6 @@ { - "name": "react-native", - "version": "0.1.0", + "name": "react-native-cli", + "version": "0.1.1", "description": "Build native apps with React!", "repository": { "type": "git", diff --git a/packager/packager.js b/packager/packager.js index ca4e5c675..26917237d 100644 --- a/packager/packager.js +++ b/packager/packager.js @@ -16,12 +16,14 @@ if (!fs.existsSync(path.resolve(__dirname, '..', 'node_modules'))) { process.exit(); } +var exec = require('child_process').exec; var ReactPackager = require('./react-packager'); var blacklist = require('./blacklist.js'); var connect = require('connect'); var http = require('http'); var launchEditor = require('./launchEditor.js'); var parseCommandLine = require('./parseCommandLine.js'); +var webSocketProxy = require('./webSocketProxy.js'); var options = parseCommandLine([{ command: 'port', @@ -31,7 +33,11 @@ var options = parseCommandLine([{ description: 'add another root(s) to be used by the packager in this project', }]); -if (!options.projectRoots) { +if (options.projectRoots) { + if (!Array.isArray(options.projectRoots)) { + options.projectRoots = options.projectRoots.split(','); + } +} else { options.projectRoots = [path.resolve(__dirname, '..')]; } @@ -45,6 +51,10 @@ if (options.root) { } } +if (!options.assetRoots) { + options.assetRoots = [path.resolve(__dirname, '..')]; +} + console.log('\n' + ' ===============================================================\n' + ' | Running packager on port ' + options.port + '. \n' + @@ -64,10 +74,12 @@ process.on('uncaughtException', function(e) { 'any existing instances that are already running.\n\n'); }); -runServer(options, function() { +var server = runServer(options, function() { console.log('\nReact packager ready.\n'); }); +webSocketProxy.attachToServer(server, '/debugger-proxy'); + function loadRawBody(req, res, next) { req.rawBody = ''; req.setEncoding('utf8'); @@ -91,12 +103,37 @@ function openStackFrameInEditor(req, res, next) { } } +function getDevToolsLauncher(options) { + return function(req, res, next) { + if (req.url === '/debugger-ui') { + var debuggerPath = path.join(__dirname, 'debugger.html'); + res.writeHead(200, {'Content-Type': 'text/html'}); + fs.createReadStream(debuggerPath).pipe(res); + } else if (req.url === '/launch-chrome-devtools') { + var debuggerURL = 'http://localhost:' + options.port + '/debugger-ui'; + var script = 'launchChromeDevTools.applescript'; + console.log('Launching Dev Tools...'); + exec(path.join(__dirname, script) + ' ' + debuggerURL, function(err, stdout, stderr) { + if (err) { + console.log('Failed to run ' + script, err); + } + console.log(stdout); + console.warn(stderr); + }); + res.end('OK'); + } else { + next(); + } + }; +} + function getAppMiddleware(options) { return ReactPackager.middleware({ projectRoots: options.projectRoots, blacklistRE: blacklist(false), cacheVersion: '2', transformModulePath: require.resolve('./transformer.js'), + assetRoots: options.assetRoots, }); } @@ -107,6 +144,7 @@ function runServer( var app = connect() .use(loadRawBody) .use(openStackFrameInEditor) + .use(getDevToolsLauncher(options)) .use(getAppMiddleware(options)); options.projectRoots.forEach(function(root) { diff --git a/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js b/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js index a7bf1f533..918b1e064 100644 --- a/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js +++ b/packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js @@ -134,13 +134,12 @@ DependecyGraph.prototype.resolveDependency = function( fromModule, depModuleId ) { - if (this._assetMap != null) { // Process asset requires. var assetMatch = depModuleId.match(/^image!(.+)/); if (assetMatch && assetMatch[1]) { if (!this._assetMap[assetMatch[1]]) { - console.warn('Cannot find asset: ' + assetMatch[1]); + debug('WARINING: Cannot find asset:', assetMatch[1]); return null; } return this._assetMap[assetMatch[1]]; diff --git a/packager/react-packager/src/JSTransformer/Cache.js b/packager/react-packager/src/JSTransformer/Cache.js index b9c5b8c14..bad0dadb3 100644 --- a/packager/react-packager/src/JSTransformer/Cache.js +++ b/packager/react-packager/src/JSTransformer/Cache.js @@ -1,13 +1,14 @@ 'use strict'; -var path = require('path'); -var version = require('../../../../package.json').version; -var tmpdir = require('os').tmpDir(); -var isAbsolutePath = require('absolute-path'); +var _ = require('underscore'); +var crypto = require('crypto'); var declareOpts = require('../lib/declareOpts'); var fs = require('fs'); -var _ = require('underscore'); +var isAbsolutePath = require('absolute-path'); +var path = require('path'); var q = require('q'); +var tmpdir = require('os').tmpDir(); +var version = require('../../../../package.json').version; var Promise = q.Promise; @@ -146,15 +147,15 @@ function loadCacheSync(cachePath) { } function cacheFilePath(options) { + var hash = crypto.createHash('md5'); + hash.update(version); + var roots = options.projectRoots.join(',').split(path.sep).join('-'); + hash.update(roots); + var cacheVersion = options.cacheVersion || '0'; - return path.join( - tmpdir, - [ - 'react-packager-cache', - version, - cacheVersion, - roots, - ].join('-') - ); + hash.update(cacheVersion); + + var name = 'react-packager-cache-' + hash.digest('hex'); + return path.join(tmpdir, name); } diff --git a/packager/react-packager/src/JSTransformer/__tests__/Cache-test.js b/packager/react-packager/src/JSTransformer/__tests__/Cache-test.js index 97a500973..f5b55f056 100644 --- a/packager/react-packager/src/JSTransformer/__tests__/Cache-test.js +++ b/packager/react-packager/src/JSTransformer/__tests__/Cache-test.js @@ -4,6 +4,7 @@ jest .dontMock('underscore') .dontMock('path') .dontMock('absolute-path') + .dontMock('crypto') .dontMock('../Cache'); var q = require('q'); @@ -19,7 +20,7 @@ describe('JSTransformer Cache', function() { Cache = require('../Cache'); }); - describe('getting/settig', function() { + describe('getting/setting', function() { it('calls loader callback for uncached file', function() { var cache = new Cache({projectRoots: ['/rootDir']}); var loaderCb = jest.genMockFn().mockImpl(function() { diff --git a/packager/react-packager/src/JSTransformer/index.js b/packager/react-packager/src/JSTransformer/index.js index 35785e6ee..00e49d5d7 100644 --- a/packager/react-packager/src/JSTransformer/index.js +++ b/packager/react-packager/src/JSTransformer/index.js @@ -59,7 +59,7 @@ function Transformer(options) { this._failedToStart = q.Promise.reject(new Error('No transfrom module')); } else { this._workers = workerFarm( - {autoStart: true}, + {autoStart: true, maxConcurrentCallsPerWorker: 1}, options.transformModulePath ); } diff --git a/packager/react-packager/src/Server/index.js b/packager/react-packager/src/Server/index.js index 7df686ad2..09a3c6400 100644 --- a/packager/react-packager/src/Server/index.js +++ b/packager/react-packager/src/Server/index.js @@ -8,6 +8,7 @@ var Packager = require('../Packager'); var Activity = require('../Activity'); var setImmediate = require('timers').setImmediate; var q = require('q'); +var _ = require('underscore'); module.exports = Server; @@ -62,6 +63,12 @@ function Server(options) { var onFileChange = this._onFileChange.bind(this); this._fileWatcher.on('all', onFileChange); + + var self = this; + this._debouncedFileChangeHandler = _.debounce(function(filePath) { + self._rebuildPackages(filePath); + self._informChangeWatchers(); + }, 50, true); } Server.prototype._onFileChange = function(type, filepath, root) { @@ -69,8 +76,7 @@ Server.prototype._onFileChange = function(type, filepath, root) { this._packager.invalidateFile(absPath); // Make sure the file watcher event runs through the system before // we rebuild the packages. - setImmediate(this._rebuildPackages.bind(this, absPath)); - setImmediate(this._informChangeWatchers.bind(this)); + this._debouncedFileChangeHandler(absPath); }; Server.prototype._rebuildPackages = function() { @@ -78,13 +84,16 @@ Server.prototype._rebuildPackages = function() { var packages = this._packages; Object.keys(packages).forEach(function(key) { var options = getOptionsFromUrl(key); - packages[key] = buildPackage(options).then(function(p) { - // Make a throwaway call to getSource to cache the source string. - p.getSource({ - inlineSourceMap: options.dev, - minify: options.minify, + // Wait for a previous build (if exists) to finish. + packages[key] = (packages[key] || q()).then(function() { + return buildPackage(options).then(function(p) { + // Make a throwaway call to getSource to cache the source string. + p.getSource({ + inlineSourceMap: options.dev, + minify: options.minify, + }); + return p; }); - return p; }); }); }; diff --git a/packager/webSocketProxy.js b/packager/webSocketProxy.js new file mode 100644 index 000000000..dada059a8 --- /dev/null +++ b/packager/webSocketProxy.js @@ -0,0 +1,41 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + */ + +'use strict'; + +var WebSocketServer = require('ws').Server; + +function attachToServer(server, path) { + var wss = new WebSocketServer({ + server: server, + path: path + }); + var clients = []; + + wss.on('connection', function(ws) { + clients.push(ws); + + var allClientsExcept = function(ws) { + return clients.filter(function(cn) { return cn !== ws; }); + }; + + ws.onerror = function() { + clients = allClientsExcept(ws); + }; + + ws.onclose = function() { + clients = allClientsExcept(ws); + }; + + ws.on('message', function(message) { + allClientsExcept(ws).forEach(function(cn) { + cn.send(message); + }); + }); + }); +} + +module.exports = { + attachToServer: attachToServer +}; From a66fad52b65874abcfc1ac79da81057279dd5dac Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sat, 21 Mar 2015 10:07:45 -0700 Subject: [PATCH 68/79] Updates from Fri 20 Mar - declare timeoutID | Basil Hosmer - [react-packager] Allow entry point extensions like .ios.js | Amjad Masad - [react-native] Use SpreadProperty to make react-docgen happy | Felix Kling - clean Examples/2048 | Basil Hosmer - [ReactNative] Adjust packager default root when running from within node_modules | Alex Kotliarskyi - [ReactNative] Add missing websocket dependency | Alex Kotliarskyi - [react-packager] change all but one `ix` to `require` | Amjad Masad --- Examples/2048/GameBoard.js | 14 ++++---- Examples/Movies/SearchScreen.js | 2 ++ Examples/UIExplorer/ImageCapInsetsExample.js | 5 ++- Examples/UIExplorer/ImageExample.js | 21 ++++++----- Examples/UIExplorer/TabBarExample.js | 7 ++-- .../Touchable/TouchableHighlight.js | 2 +- .../Components/Touchable/TouchableOpacity.js | 2 +- .../Components/View/ViewStylePropTypes.js | 8 ++--- Libraries/Image/Image.ios.js | 2 +- Libraries/Image/ImageStylePropTypes.js | 28 +++++++-------- Libraries/Image/ix.js | 26 -------------- Libraries/Text/TextStylePropTypes.js | 35 +++++++++---------- Libraries/react-native/react-native.js | 2 +- packager/packager.js | 7 +++- .../src/Server/__tests__/Server-test.js | 19 ++++++++-- packager/react-packager/src/Server/index.js | 26 +++++++------- website/server/extractDocs.js | 2 +- 17 files changed, 97 insertions(+), 111 deletions(-) delete mode 100644 Libraries/Image/ix.js diff --git a/Examples/2048/GameBoard.js b/Examples/2048/GameBoard.js index 8db899116..39b72141a 100644 --- a/Examples/2048/GameBoard.js +++ b/Examples/2048/GameBoard.js @@ -2,11 +2,12 @@ * Copyright 2004-present Facebook. All Rights Reserved. * * @providesModule GameBoard + * @flow */ 'use strict'; // NB: Taken straight from: https://github.com/IvanVergiliev/2048-react/blob/master/src/board.js -// with no modificiation except to format it for CommonJS and fix lint errors +// with no modificiation except to format it for CommonJS and fix lint/flow errors var rotateLeft = function (matrix) { var rows = matrix.length; @@ -21,9 +22,10 @@ var rotateLeft = function (matrix) { return res; }; -var Tile = function (value, row, column) { +var Tile = function (value?: number, row?: number, column?: number) { this.value = value || 0; this.row = row || -1; + this.column = column || -1; this.oldRow = -1; this.oldColumn = -1; @@ -102,8 +104,8 @@ Board.prototype.moveLeft = function () { targetTile.value += tile2.value; } resultRow[target] = targetTile; - this.won |= (targetTile.value === 2048); - hasChanged |= (targetTile.value !== this.cells[row][target].value); + this.won = this.won || (targetTile.value === 2048); + hasChanged = hasChanged || (targetTile.value !== this.cells[row][target].value); } this.cells[row] = resultRow; } @@ -172,14 +174,14 @@ Board.prototype.hasLost = function () { var canMove = false; for (var row = 0; row < Board.size; ++row) { for (var column = 0; column < Board.size; ++column) { - canMove |= (this.cells[row][column].value === 0); + canMove = canMove || (this.cells[row][column].value === 0); for (var dir = 0; dir < 4; ++dir) { var newRow = row + Board.deltaX[dir]; var newColumn = column + Board.deltaY[dir]; if (newRow < 0 || newRow >= Board.size || newColumn < 0 || newColumn >= Board.size) { continue; } - canMove |= (this.cells[row][column].value === this.cells[newRow][newColumn].value); + canMove = canMove || (this.cells[row][column].value === this.cells[newRow][newColumn].value); } } } diff --git a/Examples/Movies/SearchScreen.js b/Examples/Movies/SearchScreen.js index 822147516..700be18a1 100644 --- a/Examples/Movies/SearchScreen.js +++ b/Examples/Movies/SearchScreen.js @@ -39,6 +39,8 @@ var LOADING = {}; var SearchScreen = React.createClass({ mixins: [TimerMixin], + timeoutID: (null: any), + getInitialState: function() { return { isLoading: false, diff --git a/Examples/UIExplorer/ImageCapInsetsExample.js b/Examples/UIExplorer/ImageCapInsetsExample.js index 20fea43c7..d1efbdf2f 100644 --- a/Examples/UIExplorer/ImageCapInsetsExample.js +++ b/Examples/UIExplorer/ImageCapInsetsExample.js @@ -11,7 +11,6 @@ var { StyleSheet, Text, View, - ix, } = React; var ImageCapInsetsExample = React.createClass({ @@ -23,7 +22,7 @@ var ImageCapInsetsExample = React.createClass({ capInsets: none
@@ -33,7 +32,7 @@ var ImageCapInsetsExample = React.createClass({ capInsets: 15 diff --git a/Examples/UIExplorer/ImageExample.js b/Examples/UIExplorer/ImageExample.js index 12b4d8843..7daf53791 100644 --- a/Examples/UIExplorer/ImageExample.js +++ b/Examples/UIExplorer/ImageExample.js @@ -9,7 +9,6 @@ var { StyleSheet, Text, View, - ix, } = React; var ImageCapInsetsExample = require('./ImageCapInsetsExample'); @@ -34,15 +33,15 @@ exports.examples = [ }, { title: 'Plain Static Image', - description: 'Static assets must be referenced with the `ix` wrapper and ' + - 'located in the app bundle.', + description: 'Static assets should be required by prefixing with `image!` ' + + 'and are located in the app bundle.', render: function() { return ( - - - - + + + + ); }, @@ -184,19 +183,19 @@ exports.examples = [ return ( diff --git a/Examples/UIExplorer/TabBarExample.js b/Examples/UIExplorer/TabBarExample.js index 34518284d..cd116b3e7 100644 --- a/Examples/UIExplorer/TabBarExample.js +++ b/Examples/UIExplorer/TabBarExample.js @@ -10,7 +10,6 @@ var StyleSheet = require('StyleSheet'); var Text = require('Text'); var View = require('View'); -var ix = require('ix'); var TabBarExample = React.createClass({ @@ -42,7 +41,7 @@ var TabBarExample = React.createClass({ selectedTab={this.state.selectedTab}> { @@ -55,7 +54,7 @@ var TabBarExample = React.createClass({ { @@ -68,7 +67,7 @@ var TabBarExample = React.createClass({ { diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index 9bb539ceb..0794e19ae 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -41,7 +41,7 @@ var DEFAULT_PROPS = { * * *
* ); diff --git a/Libraries/Components/Touchable/TouchableOpacity.js b/Libraries/Components/Touchable/TouchableOpacity.js index 549df36a8..680fc87f5 100644 --- a/Libraries/Components/Touchable/TouchableOpacity.js +++ b/Libraries/Components/Touchable/TouchableOpacity.js @@ -30,7 +30,7 @@ var onlyChild = require('onlyChild'); * * *
* ); diff --git a/Libraries/Components/View/ViewStylePropTypes.js b/Libraries/Components/View/ViewStylePropTypes.js index c049c3d53..3c226bcde 100644 --- a/Libraries/Components/View/ViewStylePropTypes.js +++ b/Libraries/Components/View/ViewStylePropTypes.js @@ -8,13 +8,11 @@ var LayoutPropTypes = require('LayoutPropTypes'); var ReactPropTypes = require('ReactPropTypes'); -var merge = require('merge'); - /** * Warning: Some of these properties may not be supported in all releases. */ -var ViewStylePropTypes = merge( - LayoutPropTypes, { +var ViewStylePropTypes = { + ...LayoutPropTypes, backgroundColor: ReactPropTypes.string, borderColor: ReactPropTypes.string, borderTopColor: ReactPropTypes.string, @@ -36,6 +34,6 @@ var ViewStylePropTypes = merge( scaleY: ReactPropTypes.number, translateX: ReactPropTypes.number, translateY: ReactPropTypes.number, -}); +}; module.exports = ViewStylePropTypes; diff --git a/Libraries/Image/Image.ios.js b/Libraries/Image/Image.ios.js index 315667d25..c25e92654 100644 --- a/Libraries/Image/Image.ios.js +++ b/Libraries/Image/Image.ios.js @@ -36,7 +36,7 @@ var warning = require('warning'); * * * Date: Sat, 21 Mar 2015 10:59:41 -0700 Subject: [PATCH 69/79] Website tweaks --- docs/GettingStarted.md | 2 +- docs/Network.md | 4 ++-- docs/Style.md | 2 +- docs/Timers.md | 5 ++--- website/server/extractDocs.js | 4 +++- website/src/react-native/css/react-native.css | 11 ++++++----- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 9b88919aa..3c6776397 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -4,7 +4,7 @@ title: Getting Started layout: docs category: Quick Start permalink: docs/getting-started.html -next: network +next: pixels --- Our first React Native implementation is `ReactKit`, targeting iOS. We are also diff --git a/docs/Network.md b/docs/Network.md index 70ecb10e8..0dee55298 100644 --- a/docs/Network.md +++ b/docs/Network.md @@ -2,9 +2,9 @@ id: network title: Network layout: docs -category: Guides +category: Polyfills permalink: docs/network.html -next: pixels +next: timers --- One of React Native goal is to be a playground where we can experiment with different architectures and crazy ideas. Since browsers are not flexible enough, we had no choice but to reimplement the entire stack. In the places that we did not intend to change, we tried to be as faithful as possible to the browser APIs. The networking stack is a great example. diff --git a/docs/Style.md b/docs/Style.md index 1d035ff5f..d3f4734a6 100644 --- a/docs/Style.md +++ b/docs/Style.md @@ -4,7 +4,7 @@ title: Style layout: docs category: Guides permalink: docs/style.html -next: timers +next: activityindicatorios --- ## Declaring Styles diff --git a/docs/Timers.md b/docs/Timers.md index ecca4290c..b7cfbb8b0 100644 --- a/docs/Timers.md +++ b/docs/Timers.md @@ -2,9 +2,8 @@ id: timers title: Timers layout: docs -category: Guides +category: Polyfills permalink: docs/timers.html -next: activityindicatorios --- Timers are an important part of an application and React Native implements the [browser timers](https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Timers). @@ -59,7 +58,7 @@ InteractionManager.clearInteractionHandle(handle); We found out that the primary cause of fatals in apps created with React Native was due to timers firing after a component was unmounted. To solve this recurring issue, we introduced `TimerMixin`. If you include `TimerMixin`, then you can replace your calls to `setTimeout(fn, 500)` with `this.setTimeout(fn, 500)` (just prepend `this.`) and everything will be properly cleaned up for you when the component unmounts. ```javascript -var { TimerMixin } = React; +var TimerMixin = require('react-timer-mixin'); var Component = React.createClass({ mixins: [TimerMixin], diff --git a/website/server/extractDocs.js b/website/server/extractDocs.js index b6c4114f1..1c7f19063 100644 --- a/website/server/extractDocs.js +++ b/website/server/extractDocs.js @@ -28,7 +28,9 @@ function componentsToMarkdown(type, json, filepath, i) { 'layout: autodocs', 'category: ' + type + 's', 'permalink: docs/' + slugify(componentName) + '.html', - all[i + 1] && ('next: ' + slugify(getNameFromPath(all[i + 1]))), + 'next: ' + (all[i + 1] ? + slugify(getNameFromPath(all[i + 1])) : + 'network'), '---', JSON.stringify(json, null, 2), ].filter(function(line) { return line; }).join('\n'); diff --git a/website/src/react-native/css/react-native.css b/website/src/react-native/css/react-native.css index f04b8d74a..35906a652 100644 --- a/website/src/react-native/css/react-native.css +++ b/website/src/react-native/css/react-native.css @@ -345,15 +345,16 @@ h1:hover .hash-link, h2:hover .hash-link, h3:hover .hash-link, h4:hover .hash-li } .nav-docs { - color: #2d2d2d; font-size: 14px; float: left; width: 210px; + margin-top: 5px; } .nav-docs ul { list-style: none; margin: 0; + margin-left: 10px; } .nav-docs ul ul { @@ -383,10 +384,10 @@ h1:hover .hash-link, h2:hover .hash-link, h3:hover .hash-link, h4:hover .hash-li color: #0485A9; } -.nav-docs .nav-docs-section { - border-bottom: 1px solid #ccc; - border-top: 1px solid #eee; - padding: 12px 0; +.nav-docs h3 { + margin: 0; + line-height: 25px; + margin-top: 5px; } .nav-docs .nav-docs-section:first-child { From 1899516a523abfe2237a5db718cceb5e99f2c423 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sat, 21 Mar 2015 11:04:05 -0700 Subject: [PATCH 70/79] Update Image.md s/ix/require('image!')/ --- docs/Image.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/Image.md b/docs/Image.md index 867bbaae7..2ccc915d1 100644 --- a/docs/Image.md +++ b/docs/Image.md @@ -24,20 +24,18 @@ Image decoding can take more than a frame-worth of time. This is one of the majo ## Static Assets -In the course of a project, it is not uncommon to add and remove many images and accidentally end up shipping images you are no longer using in the app. In order to fight this, we need to find a way to know statically which images are being used in the app. To do that, we introduced a marker called `ix`. The only allowed way to refer to an image in the bundle is to literally write `ix('name-of-the-asset')` in the source. +In the course of a project, it is not uncommon to add and remove many images and accidentally end up shipping images you are no longer using in the app. In order to fight this, we need to find a way to know statically which images are being used in the app. To do that, we introduced a marker on require. The only allowed way to refer to an image in the bundle is to literally write `require('image!name-of-the-asset')` in the source. ```javascript -var { ix } = React; - // GOOD - + // BAD var icon = this.props.active ? 'my-icon-active' : 'my-icon-inactive'; - + // GOOD -var icon = this.props.active ? ix('my-icon-active') : ix('my-icon-inactive'); +var icon = this.props.active ? require('image!my-icon-active') : require('image!my-icon-inactive'); ``` @@ -55,6 +53,6 @@ In React Native, one interesting decision is that the `src` attribute is named ` ``` -On the infrastructure side, the reason is that it allows to attach metadata to this object. For example if you are using `ix`, then we add an `isStatic` attribute to flag it as a local file (don't rely on this fact, it's likely to change in the future!). This is also future proofing, for example we may want to support sprites at some point, instead of outputting `{uri: ...}`, we can output `{uri: ..., crop: {left: 10, top: 50, width: 20, height: 40}}` and transparently support spriting on all the existing call sites. +On the infrastructure side, the reason is that it allows to attach metadata to this object. For example if you are using `require('image!icon')`, then we add an `isStatic` attribute to flag it as a local file (don't rely on this fact, it's likely to change in the future!). This is also future proofing, for example we may want to support sprites at some point, instead of outputting `{uri: ...}`, we can output `{uri: ..., crop: {left: 10, top: 50, width: 20, height: 40}}` and transparently support spriting on all the existing call sites. On the user side, this lets you annotate the object with useful attributes such as the dimension of the image in order to compute the size it's going to be displayed in. Feel free to use it as your data structure to store more information about your image. From 822e6591778a9151c5ba08bd78b255b09918a81c Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Sat, 21 Mar 2015 11:39:34 -0700 Subject: [PATCH 71/79] Add Native Modules (iOS) guide --- docs/NativeModulesIOS.md | 194 +++++++++++++++++++++++++++++++++++++++ docs/Style.md | 2 +- 2 files changed, 195 insertions(+), 1 deletion(-) create mode 100644 docs/NativeModulesIOS.md diff --git a/docs/NativeModulesIOS.md b/docs/NativeModulesIOS.md new file mode 100644 index 000000000..f88d0427b --- /dev/null +++ b/docs/NativeModulesIOS.md @@ -0,0 +1,194 @@ +--- +id: nativemodulesios +title: Native Modules (iOS) +layout: docs +category: Guides +permalink: docs/nativemodulesios.html +next: activityindicatorios +--- + +Sometimes an app needs access to platform API, and React Native doesn't have a corresponding wrapper yet. This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C (Swift is not supported yet) and core libraries (Foundation, UIKit). + +## iOS Calendar module example + +This guide will use iOS Calendar API example. Let's say we would like to be able to access iOS calendar from JavaScript. + +Native module is just an Objectve-C class that implements `RCTBridgeModule` protocol. + +```objective-c +// RCTCalendarManager.h +#import "RCTBridgeModule.h" + +@interface RCTCalendarManager : NSObject +@end +``` + +React Native will not expose any methods of `RCTCalendarManager` to JavaScript unless explicitly asked. Fortunately this is pretty easy with `RCT_EXPORT`: + +```objective-c +// RCTCalendarManager.m +@implementation RCTCalendarManager + +- (void)addEventWithName:(NSString *)name location:(NSString *)location +{ + RCT_EXPORT(); + RCTLogInfo(@"Pretending to create an event %@ at @%@", name, location); +} + +@end +``` + +Now from your JavaScript file you can call the method like this: + +```javascript +var CalendarManager = require('NativeModules').CalendarManager; +CalendarManager.addEventWithName('Birthday Party', '4 Privet Drive, Surrey'); +``` + +Notice that the module name doesn't have `RCT` prefix. Exported method name was generated from first part of Objective-C selector. Sometimes it results in a non-idiomatic JavaScript name (like the one in our example). You can change the name by supplying an optional argument to `RCT_EXPORT`, e.g. `RCT_EXPORT("addEvent")`. + +The return type of the method should always be `void`. React Native bridge is asynchronous, so the only way to pass result to JavaScript is by using callbacks or emitting events (see below). + +## Argument types + +React Native supports several types of arguments that can be passed from JavaScript code to native module: + +- string (`NSString`) +- number (`NSInteger`, `float`, `NSNumber`) +- boolean (`BOOL`, `NSNumber`) +- array (`NSArray`) of any types from this list +- map (`NSDictionary`) with string keys and values of any type from this list +- function (`RCTResponseSenderBlock`) + +In our `CalendarManager` example, if we want to pass event date to native, we have to convert it to a string or a number: + +```objective-c +- (void)addEventWithName:(NSString *)name location:(NSString *)location date:(NSInteger)secondsSinceUnixEpoch +{ + RCT_EXPORT("addEvent"); + NSDate *date = [NSDate dateWithTimeIntervalSince1970:secondsSinceUnixEpoch]; +} +``` + +As `CalendarManager.addEvent` method gets more and more complex, the number of arguments will grow. Some of them might be optional. In this case it's worth considering changing the API a little bit to accept a dictionary of event attributes, like this: + +```objective-c +- (void)addEventWithName:(NSString *)name details:(NSDictionary *)details +{ + RCT_EXPORT("addEvent"); + NSString *location = details[@"location"]; + if ([location isKindOfClass:[NSString class]]) { + ... + } +} +``` + +and call it from JavaScript: + +```javascript +CalendarManager.addEvent('Birthday Party', { + location: '4 Privet Drive, Surrey', + time: date.toTime(), + description: '...' +}) +``` + +NOTE about array and map - React Native doesn't provide any guarantees about the types of values in these structures. Your native module might expect array of strings, but if JavaScript calls your method with an array that contains number and string you'll get `NSArray` with `NSNumber` and `NSString`. It's developer's responsibility to check array/map values types. + +# Callbacks + +WARNING: This section is even more experimental than others, we don't have a set of best practices around callbacks yet. + +Native module also supports a special kind of argument - callback. In most cases it is used to provide function call result to JavaScript. + +```objective-c +- (void)findEvents:(RCTResponseSenderBlock)callback +{ + RCT_EXPORT(); + NSArray *events = ... + callback(@[[NSNull null], events]); +} +``` + +`RCTResponseSenderBlock` accepts only one argument - array of arguments to pass to JavaScript callback. In this case we use node's convention to set first argument to error and the rest - to the result of the function. + +```javascript +CalendarManager.findEvents((error, events) => { + if (error) { + console.error(error); + } else { + this.setState({events: events}); + } +}) +``` + +Native module is supposed to invoke callback only once. It can, however, store the callback as an ivar and invoke it later. This pattern is often used to wrap iOS APIs that require delegate. See `RCTAlertManager`. + +If you want to pass error-like object to JavaScript, use `RCTMakeError` from `RCTUtils.h`. + +## Implementing native module + +The native module should not have any assumptions about what thread it is being called on. React Native invokes native modules methods on a separate serial GCD queue, but this is an implementation detail and might change. If the native module needs to call main-thread-only iOS API, it should schedule the operation on the main queue: + + +```objective-c +- (void)addEventWithName:(NSString *)name callback:(RCTResponseSenderBlock)callback +{ + RCT_EXPORT("addEvent"); + dispatch_async(dispatch_get_main_queue(), ^{ + // Call iOS API on main thread + ... + // You can invoke callback from any thread/queue + callback(@[...]); + }); +} +``` + +The same way if the operation can take a long time to complete, the native module should not block. It is a good idea to use `dispatch_async` to schedule expensive work on background queue. + +## Exporting constants + +Native module can export constants that are instantly available to JavaScript at runtime. This is useful to export some initial data that would otherwise require a bridge round-trip. + +```objective-c +- (NSDictionary *)constantsToExport +{ + return @{ @"firstDayOfTheWeek": @"Monday" }; +} +``` + +JavaScript can use this value right away: + +```javascript +console.log(CalendarManager.firstDayOfTheWeek); +``` + +Note that the constants are exported only at initialization time, so if you change `constantsToExport` value at runtime it won't affect JavaScript environment. + + +## Sending events to JavaScript + +The native module can signal events to JavaScript without being invoked directly. The easiest way to do this is to use `eventDispatcher`: + +```objective-c +- (void)calendarEventReminderReceived:(NSNotification *)notification +{ + NSString *eventName = notification.userInfo[@"name"]; + [self.bridge.eventDispatcher sendAppEventWithName:@"EventReminder" + body:@{@"name": eventName}]; +} +``` + +JavaScript code can subscribe to these events: + +```javascript +var subscription = RCTDeviceEventEmitter.addListener( + 'EventReminder', + (reminder) => console.log(reminder.name) +); +... +// Don't forget to unsubscribe +subscription.remove(); +``` + +For more examples of sending events to JavaScript, see `RCTLocationObserver`. diff --git a/docs/Style.md b/docs/Style.md index d3f4734a6..f4bfdf286 100644 --- a/docs/Style.md +++ b/docs/Style.md @@ -4,7 +4,7 @@ title: Style layout: docs category: Guides permalink: docs/style.html -next: activityindicatorios +next: nativemodulesios --- ## Declaring Styles From e1d629c2eb1680148686b3f17977f8298d132b26 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Sat, 21 Mar 2015 17:41:38 -0700 Subject: [PATCH 72/79] Native Modules Guide: address feedback from #176 --- docs/NativeModulesIOS.md | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/docs/NativeModulesIOS.md b/docs/NativeModulesIOS.md index f88d0427b..d32ec0c87 100644 --- a/docs/NativeModulesIOS.md +++ b/docs/NativeModulesIOS.md @@ -16,23 +16,23 @@ This guide will use iOS Calendar API example. Let's say we would like to be able Native module is just an Objectve-C class that implements `RCTBridgeModule` protocol. ```objective-c -// RCTCalendarManager.h +// CalendarManager.h #import "RCTBridgeModule.h" -@interface RCTCalendarManager : NSObject +@interface CalendarManager : NSObject @end ``` -React Native will not expose any methods of `RCTCalendarManager` to JavaScript unless explicitly asked. Fortunately this is pretty easy with `RCT_EXPORT`: +React Native will not expose any methods of `CalendarManager` to JavaScript unless explicitly asked. Fortunately this is pretty easy with `RCT_EXPORT`: ```objective-c -// RCTCalendarManager.m -@implementation RCTCalendarManager +// CalendarManager.m +@implementation CalendarManager - (void)addEventWithName:(NSString *)name location:(NSString *)location { RCT_EXPORT(); - RCTLogInfo(@"Pretending to create an event %@ at @%@", name, location); + RCTLogInfo(@"Pretending to create an event %@ at %@", name, location); } @end @@ -45,7 +45,7 @@ var CalendarManager = require('NativeModules').CalendarManager; CalendarManager.addEventWithName('Birthday Party', '4 Privet Drive, Surrey'); ``` -Notice that the module name doesn't have `RCT` prefix. Exported method name was generated from first part of Objective-C selector. Sometimes it results in a non-idiomatic JavaScript name (like the one in our example). You can change the name by supplying an optional argument to `RCT_EXPORT`, e.g. `RCT_EXPORT("addEvent")`. +Notice that the exported method name was generated from first part of Objective-C selector. Sometimes it results in a non-idiomatic JavaScript name (like the one in our example). You can change the name by supplying an optional argument to `RCT_EXPORT`, e.g. `RCT_EXPORT(addEvent)`. The return type of the method should always be `void`. React Native bridge is asynchronous, so the only way to pass result to JavaScript is by using callbacks or emitting events (see below). @@ -54,7 +54,7 @@ The return type of the method should always be `void`. React Native bridge is as React Native supports several types of arguments that can be passed from JavaScript code to native module: - string (`NSString`) -- number (`NSInteger`, `float`, `NSNumber`) +- number (`NSInteger`, `float`, double, CGFloat, `NSNumber`) - boolean (`BOOL`, `NSNumber`) - array (`NSArray`) of any types from this list - map (`NSDictionary`) with string keys and values of any type from this list @@ -65,7 +65,7 @@ In our `CalendarManager` example, if we want to pass event date to native, we ha ```objective-c - (void)addEventWithName:(NSString *)name location:(NSString *)location date:(NSInteger)secondsSinceUnixEpoch { - RCT_EXPORT("addEvent"); + RCT_EXPORT(addEvent); NSDate *date = [NSDate dateWithTimeIntervalSince1970:secondsSinceUnixEpoch]; } ``` @@ -75,11 +75,9 @@ As `CalendarManager.addEvent` method gets more and more complex, the number of a ```objective-c - (void)addEventWithName:(NSString *)name details:(NSDictionary *)details { - RCT_EXPORT("addEvent"); - NSString *location = details[@"location"]; - if ([location isKindOfClass:[NSString class]]) { - ... - } + RCT_EXPORT(addEvent); + NSString *location = [RCTConvert NSString:details[@"location"]]; // ensure location is a string + ... } ``` @@ -93,7 +91,7 @@ CalendarManager.addEvent('Birthday Party', { }) ``` -NOTE about array and map - React Native doesn't provide any guarantees about the types of values in these structures. Your native module might expect array of strings, but if JavaScript calls your method with an array that contains number and string you'll get `NSArray` with `NSNumber` and `NSString`. It's developer's responsibility to check array/map values types. +NOTE about array and map - React Native doesn't provide any guarantees about the types of values in these structures. Your native module might expect array of strings, but if JavaScript calls your method with an array that contains number and string you'll get `NSArray` with `NSNumber` and `NSString`. It's developer's responsibility to check array/map values types (see `RCTConvert` for helper methods). # Callbacks @@ -134,7 +132,7 @@ The native module should not have any assumptions about what thread it is being ```objective-c - (void)addEventWithName:(NSString *)name callback:(RCTResponseSenderBlock)callback { - RCT_EXPORT("addEvent"); + RCT_EXPORT(addEvent); dispatch_async(dispatch_get_main_queue(), ^{ // Call iOS API on main thread ... @@ -182,7 +180,7 @@ The native module can signal events to JavaScript without being invoked directly JavaScript code can subscribe to these events: ```javascript -var subscription = RCTDeviceEventEmitter.addListener( +var subscription = DeviceEventEmitter.addListener( 'EventReminder', (reminder) => console.log(reminder.name) ); From bc5181e96e2a41d02636dc9d3911c62870713d57 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sat, 21 Mar 2015 18:16:49 -0700 Subject: [PATCH 73/79] Update NativeModulesIOS.md --- docs/NativeModulesIOS.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/NativeModulesIOS.md b/docs/NativeModulesIOS.md index d32ec0c87..0f0bfe916 100644 --- a/docs/NativeModulesIOS.md +++ b/docs/NativeModulesIOS.md @@ -7,13 +7,17 @@ permalink: docs/nativemodulesios.html next: activityindicatorios --- -Sometimes an app needs access to platform API, and React Native doesn't have a corresponding wrapper yet. This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C (Swift is not supported yet) and core libraries (Foundation, UIKit). +Sometimes an app needs access to platform API, and React Native doesn't have a corresponding wrapper yet. Maybe you want to reuse some existing Objective-C or C++ code without having to reimplement it in JavaScript. Or write some high performance, multi-threaded code such as image processing, network stack, database or rendering. + +We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself. + +This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C (Swift is not supported yet) and core libraries (Foundation, UIKit). ## iOS Calendar module example -This guide will use iOS Calendar API example. Let's say we would like to be able to access iOS calendar from JavaScript. +This guide will use [iOS Calendar API](https://developer.apple.com/library/mac/documentation/DataManagement/Conceptual/EventKitProgGuide/Introduction/Introduction.html) example. Let's say we would like to be able to access iOS calendar from JavaScript. -Native module is just an Objectve-C class that implements `RCTBridgeModule` protocol. +Native module is just an Objectve-C class that implements `RCTBridgeModule` protocol. If you are wondering, RCT is a shorthand for ReaCT. ```objective-c // CalendarManager.h @@ -54,7 +58,7 @@ The return type of the method should always be `void`. React Native bridge is as React Native supports several types of arguments that can be passed from JavaScript code to native module: - string (`NSString`) -- number (`NSInteger`, `float`, double, CGFloat, `NSNumber`) +- number (`NSInteger`, `float`, `double`, `CGFloat`, `NSNumber`) - boolean (`BOOL`, `NSNumber`) - array (`NSArray`) of any types from this list - map (`NSDictionary`) with string keys and values of any type from this list @@ -188,5 +192,5 @@ var subscription = DeviceEventEmitter.addListener( // Don't forget to unsubscribe subscription.remove(); ``` - For more examples of sending events to JavaScript, see `RCTLocationObserver`. + From 136d9691c95dc8aa2253341dc38493780a5c6e3f Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sat, 21 Mar 2015 19:12:09 -0700 Subject: [PATCH 74/79] Update NativeModulesIOS.md Linkify code and better warning/note formatting --- docs/NativeModulesIOS.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/NativeModulesIOS.md b/docs/NativeModulesIOS.md index 0f0bfe916..d0b0fdf84 100644 --- a/docs/NativeModulesIOS.md +++ b/docs/NativeModulesIOS.md @@ -95,11 +95,15 @@ CalendarManager.addEvent('Birthday Party', { }) ``` -NOTE about array and map - React Native doesn't provide any guarantees about the types of values in these structures. Your native module might expect array of strings, but if JavaScript calls your method with an array that contains number and string you'll get `NSArray` with `NSNumber` and `NSString`. It's developer's responsibility to check array/map values types (see `RCTConvert` for helper methods). +> **NOTE**: About array and map +> +> React Native doesn't provide any guarantees about the types of values in these structures. Your native module might expect array of strings, but if JavaScript calls your method with an array that contains number and string you'll get `NSArray` with `NSNumber` and `NSString`. It's developer's responsibility to check array/map values types (see [`RCTConvert`](https://github.com/facebook/react-native/blob/master/ReactKit/Base/RCTConvert.h) for helper methods). # Callbacks -WARNING: This section is even more experimental than others, we don't have a set of best practices around callbacks yet. +> **WARNING** +> +> This section is even more experimental than others, we don't have a set of best practices around callbacks yet. Native module also supports a special kind of argument - callback. In most cases it is used to provide function call result to JavaScript. @@ -124,9 +128,9 @@ CalendarManager.findEvents((error, events) => { }) ``` -Native module is supposed to invoke callback only once. It can, however, store the callback as an ivar and invoke it later. This pattern is often used to wrap iOS APIs that require delegate. See `RCTAlertManager`. +Native module is supposed to invoke callback only once. It can, however, store the callback as an ivar and invoke it later. This pattern is often used to wrap iOS APIs that require delegate. See [`RCTAlertManager`](https://github.com/facebook/react-native/blob/master/ReactKit/Modules/RCTAlertManager.m). -If you want to pass error-like object to JavaScript, use `RCTMakeError` from `RCTUtils.h`. +If you want to pass error-like object to JavaScript, use `RCTMakeError` from [`RCTUtils.h`](https://github.com/facebook/react-native/blob/master/ReactKit/Base/RCTUtils.h). ## Implementing native module @@ -192,5 +196,5 @@ var subscription = DeviceEventEmitter.addListener( // Don't forget to unsubscribe subscription.remove(); ``` -For more examples of sending events to JavaScript, see `RCTLocationObserver`. +For more examples of sending events to JavaScript, see [`RCTLocationObserver`](https://github.com/facebook/react-native/blob/master/Libraries/Geolocation/RCTLocationObserver.m). From 616e29f723d4e7505ff5379acc43fd5a0054923e Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Sun, 22 Mar 2015 09:33:24 -0700 Subject: [PATCH 75/79] Update Network.md --- docs/Network.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Network.md b/docs/Network.md index 0dee55298..f2e8da23e 100644 --- a/docs/Network.md +++ b/docs/Network.md @@ -33,7 +33,7 @@ request.send(); Please follow the [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) for a complete description of the API. -As a developer, you're probably not going to use XMLHttpRequest directly as its API is very tedious to work with. But the fact that it is implemented and compatible with the browser API gives you the ability to use third-party libraries such as [Parse JS SDK](https://parse.com/docs/js_guide) or [super-agent](https://github.com/visionmedia/superagent) directly from npm. +As a developer, you're probably not going to use XMLHttpRequest directly as its API is very tedious to work with. But the fact that it is implemented and compatible with the browser API gives you the ability to use third-party libraries such as [Parse]( https://parse.com/products/javascript) or [super-agent](https://github.com/visionmedia/superagent) directly from npm. ## Fetch From df73a485cc910ea229faf63a86ead60bd0e7dea3 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Sun, 22 Mar 2015 13:27:32 -0700 Subject: [PATCH 76/79] Allow react-native init --- react-native-cli/index.js | 51 +++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/react-native-cli/index.js b/react-native-cli/index.js index cc69da9d5..7c8b82b9a 100755 --- a/react-native-cli/index.js +++ b/react-native-cli/index.js @@ -4,8 +4,9 @@ * Copyright 2004-present Facebook. All Rights Reserved. */ -var spawn = require('child_process').spawn; +var fs = require('fs'); var path = require('path'); +var spawn = require('child_process').spawn; var CLI_MODULE_PATH = path.resolve( process.cwd(), @@ -25,13 +26,20 @@ if (cli) { var args = process.argv.slice(2); if (args.length === 0) { console.error( - 'You did not pass any commands, did you mean to run init?' + 'You did not pass any commands, did you mean to run `react-native init`?' ); process.exit(1); } if (args[0] === 'init') { - init(); + if (args[1]) { + init(args[1]); + } else { + console.error( + 'Usage: react-native init ' + ); + process.exit(1); + } } else { console.error( 'Command `%s` unrecognized.' + @@ -42,28 +50,35 @@ if (cli) { } } -function init() { +function init(name) { + var root = path.resolve(name); + var projectName = path.basename(root); + console.log( - 'This will walk you through creating a new react-native project', - 'in the current directory' + 'This will walk you through creating a new React Native project in', + root ); - console.log('Running npm init'); - run('npm init', function(e) { + if (!fs.existsSync(root)) { + fs.mkdirSync(root); + } + + var packageJson = { + name: projectName, + version: '0.0.1', + private: true + }; + fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify(packageJson)); + process.chdir(root); + + run('npm install --save react-native', function(e) { if (e) { - console.error('npm init failed'); + console.error('`npm install --save react-native` failed'); process.exit(1); } - run('npm install --save react-native', function(e) { - if (e) { - console.error('`npm install --save react-native` failed'); - process.exit(1); - } - - var cli = require(CLI_MODULE_PATH); - cli.init(); - }); + var cli = require(CLI_MODULE_PATH); + cli.init(root, projectName); }); } From 4d077f4ee81b783f84bef5b985b02900cd92b045 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Sun, 22 Mar 2015 14:04:55 -0700 Subject: [PATCH 77/79] Fix few paths for react-native cli scripts --- cli.js | 4 ++-- packager/init.sh => init.sh | 2 +- react-native-cli/index.js | 23 ++++++++++++++--------- 3 files changed, 17 insertions(+), 12 deletions(-) rename packager/init.sh => init.sh (94%) diff --git a/cli.js b/cli.js index 8a1a306b6..99a3b24e0 100644 --- a/cli.js +++ b/cli.js @@ -38,8 +38,8 @@ function run() { // Here goes any cli commands we need to } -function init() { - spawn('sh', [path.resolve(__dirname, 'init.sh')], {stdio:'inherit'}); +function init(root, projectName) { + spawn(path.resolve(__dirname, 'init.sh'), [projectName], {stdio:'inherit'}); } module.exports = { diff --git a/packager/init.sh b/init.sh similarity index 94% rename from packager/init.sh rename to init.sh index 6a42b9aeb..f74850d57 100755 --- a/packager/init.sh +++ b/init.sh @@ -14,7 +14,7 @@ def cp(src, dest, app_name) end def main(dest, app_name) - source = File.expand_path("../../Examples/SampleApp", __FILE__) + source = File.expand_path("../Examples/SampleApp", __FILE__) files = Dir.chdir(source) { Dir["**/*"] } .reject { |file| file["project.xcworkspace"] || file["xcuserdata"] } .each { |file| diff --git a/react-native-cli/index.js b/react-native-cli/index.js index 7c8b82b9a..49ee50013 100755 --- a/react-native-cli/index.js +++ b/react-native-cli/index.js @@ -8,16 +8,18 @@ var fs = require('fs'); var path = require('path'); var spawn = require('child_process').spawn; -var CLI_MODULE_PATH = path.resolve( - process.cwd(), - 'node_modules', - 'react-native', - 'cli' -); +var CLI_MODULE_PATH = function() { + return path.resolve( + process.cwd(), + 'node_modules', + 'react-native', + 'cli' + ); +}; var cli; try { - cli = require(CLI_MODULE_PATH); + cli = require(CLI_MODULE_PATH()); } catch(e) {} if (cli) { @@ -66,7 +68,10 @@ function init(name) { var packageJson = { name: projectName, version: '0.0.1', - private: true + private: true, + scripts: { + start: "react-native start" + } }; fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify(packageJson)); process.chdir(root); @@ -77,7 +82,7 @@ function init(name) { process.exit(1); } - var cli = require(CLI_MODULE_PATH); + var cli = require(CLI_MODULE_PATH()); cli.init(root, projectName); }); } From a738b49ae2f0e55e3dfe1ffdfc83cc222baaa6a0 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Mon, 23 Mar 2015 09:47:28 -0700 Subject: [PATCH 78/79] Website: initial page for videos --- docs/GettingStarted.md | 2 +- docs/Videos.md | 12 ++++++++++++ website/core/Marked.js | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 docs/Videos.md diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 3c6776397..5ff207167 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -4,7 +4,7 @@ title: Getting Started layout: docs category: Quick Start permalink: docs/getting-started.html -next: pixels +next: videos --- Our first React Native implementation is `ReactKit`, targeting iOS. We are also diff --git a/docs/Videos.md b/docs/Videos.md new file mode 100644 index 000000000..b236b7daf --- /dev/null +++ b/docs/Videos.md @@ -0,0 +1,12 @@ +--- +id: videos +title: Videos +layout: docs +category: Community Resources +permalink: docs/videos.html +next: pixels +--- + + + + diff --git a/website/core/Marked.js b/website/core/Marked.js index f7f6c5007..13eaab841 100644 --- a/website/core/Marked.js +++ b/website/core/Marked.js @@ -900,7 +900,7 @@ Parser.prototype.tok = function() { } case 'html': { return !this.token.pre && !this.options.pedantic - ? this.inline.output(this.token.text) + ? React.DOM.span({dangerouslySetInnerHTML: {__html: this.token.text}}) : this.token.text; } case 'paragraph': { From 82461e04ab42ea6fbf10443d2771f681e252cc32 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Mon, 23 Mar 2015 10:06:16 -0700 Subject: [PATCH 79/79] Updates from Mon 23 Mar - [React Native] Fix iOS 7 crashes b/c missing Photos.fmwk | Alex Akers - UIExplorer flowification | Basil Hosmer - Add clearImmediate module | Marshall Roch - [ReactNative] Print directories packager is serving files from | Alex Kotliarskyi - Work around flow bug with exports | Marshall Roch - [ReactNative] Move packager/init.sh to GitHub | Alex Kotliarskyi - [ReactNative] Remove react-native/package.json | Christopher Chedeau - [ReactNative] Returning actual contentSize for RCTScrollViewManager | Henry Lung --- Examples/Movies/MoviesApp.js | 2 +- Examples/UIExplorer/ActionSheetIOSExample.js | 9 ++--- .../UIExplorer/ActivityIndicatorExample.js | 3 +- Examples/UIExplorer/AdSupportIOSExample.js | 3 +- Examples/UIExplorer/AlertIOSExample.js | 1 + Examples/UIExplorer/AppStateExample.js | 1 + Examples/UIExplorer/AppStateIOSExample.js | 5 +-- Examples/UIExplorer/AsyncStorageExample.js | 3 +- Examples/UIExplorer/CameraRollExample.ios.js | 3 +- Examples/UIExplorer/CameraRollView.ios.js | 25 ++++++------- Examples/UIExplorer/DatePickerExample.js | 3 +- Examples/UIExplorer/GeolocationExample.js | 5 ++- Examples/UIExplorer/LayoutExample.js | 1 + Examples/UIExplorer/ListViewSimpleExample.js | 9 +++-- Examples/UIExplorer/NavigatorIOSExample.js | 2 +- Examples/UIExplorer/UIExplorerApp.js | 2 +- Examples/UIExplorer/UIExplorerList.js | 2 +- .../RCTActionSheet.xcodeproj/project.pbxproj | 4 +-- .../RCTAdSupport.xcodeproj/project.pbxproj | 4 +-- .../RCTGeolocation.xcodeproj/project.pbxproj | 4 +-- .../Image/RCTImage.xcodeproj/project.pbxproj | 4 +-- .../RCTNetwork.xcodeproj/project.pbxproj | 4 +-- .../Text/RCTText.xcodeproj/project.pbxproj | 4 +-- Libraries/Utilities/AlertIOS.js | 2 +- .../RCTVibration.xcodeproj/project.pbxproj | 4 +-- Libraries/react-native/addons.js | 36 ------------------- Libraries/react-native/package.json | 5 --- Libraries/react-native/react-native.js | 28 ++++++++++++--- Libraries/vendor/core/clearImmediate.js | 19 ++++++++++ ReactKit/ReactKit.xcodeproj/project.pbxproj | 4 +-- ReactKit/Views/RCTScrollViewManager.m | 2 +- package.json | 3 +- packager/packager.js | 2 ++ 33 files changed, 112 insertions(+), 96 deletions(-) delete mode 100644 Libraries/react-native/addons.js delete mode 100644 Libraries/react-native/package.json create mode 100644 Libraries/vendor/core/clearImmediate.js diff --git a/Examples/Movies/MoviesApp.js b/Examples/Movies/MoviesApp.js index 768ad895a..6c74c45b5 100644 --- a/Examples/Movies/MoviesApp.js +++ b/Examples/Movies/MoviesApp.js @@ -6,7 +6,7 @@ */ 'use strict'; -var React = require('react-native/addons'); +var React = require('react-native'); var { AppRegistry, NavigatorIOS, diff --git a/Examples/UIExplorer/ActionSheetIOSExample.js b/Examples/UIExplorer/ActionSheetIOSExample.js index 9b164de14..1ee487ed5 100644 --- a/Examples/UIExplorer/ActionSheetIOSExample.js +++ b/Examples/UIExplorer/ActionSheetIOSExample.js @@ -1,6 +1,7 @@ /** -* * Copyright 2004-present Facebook. All Rights Reserved. -* */ + * Copyright 2004-present Facebook. All Rights Reserved. + * @flow + */ 'use strict'; var React = require('react-native'); @@ -103,10 +104,10 @@ exports.description = 'Interface to show iOS\' action sheets'; exports.examples = [ { title: 'Show Action Sheet', - render() { return ; } + render(): ReactElement { return ; } }, { title: 'Show Share Action Sheet', - render() { return ; } + render(): ReactElement { return ; } } ]; diff --git a/Examples/UIExplorer/ActivityIndicatorExample.js b/Examples/UIExplorer/ActivityIndicatorExample.js index 3371551a0..60f69843c 100644 --- a/Examples/UIExplorer/ActivityIndicatorExample.js +++ b/Examples/UIExplorer/ActivityIndicatorExample.js @@ -1,5 +1,6 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. + * @flow */ 'use strict'; @@ -128,7 +129,7 @@ exports.examples = [ }, { title: 'Start/stop', - render: function() { + render: function(): ReactElement { return ; } }, diff --git a/Examples/UIExplorer/AdSupportIOSExample.js b/Examples/UIExplorer/AdSupportIOSExample.js index a3d720f01..4047dd43a 100644 --- a/Examples/UIExplorer/AdSupportIOSExample.js +++ b/Examples/UIExplorer/AdSupportIOSExample.js @@ -1,5 +1,6 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. + * @flow */ 'use strict'; @@ -19,7 +20,7 @@ exports.description = 'Example of using the ad support API.'; exports.examples = [ { title: 'Ad Support IOS', - render: function() { + render: function(): ReactElement { return ; }, } diff --git a/Examples/UIExplorer/AlertIOSExample.js b/Examples/UIExplorer/AlertIOSExample.js index a2b92d975..6897007fc 100644 --- a/Examples/UIExplorer/AlertIOSExample.js +++ b/Examples/UIExplorer/AlertIOSExample.js @@ -1,5 +1,6 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. + * @flow */ 'use strict'; diff --git a/Examples/UIExplorer/AppStateExample.js b/Examples/UIExplorer/AppStateExample.js index ea6400b91..9e93a57fc 100644 --- a/Examples/UIExplorer/AppStateExample.js +++ b/Examples/UIExplorer/AppStateExample.js @@ -1,5 +1,6 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. + * @flow */ 'use strict'; diff --git a/Examples/UIExplorer/AppStateIOSExample.js b/Examples/UIExplorer/AppStateIOSExample.js index 845b2e049..e28857fc8 100644 --- a/Examples/UIExplorer/AppStateIOSExample.js +++ b/Examples/UIExplorer/AppStateIOSExample.js @@ -2,6 +2,7 @@ * Copyright 2004-present Facebook. All Rights Reserved. * * @providesModule AppStateIOSExample + * @flow */ 'use strict'; @@ -60,10 +61,10 @@ exports.examples = [ { title: 'Subscribed AppStateIOS:', description: 'This changes according to the current state, so you can only ever see it rendered as "active"', - render() { return ; } + render(): ReactElement { return ; } }, { title: 'Previous states:', - render() { return ; } + render(): ReactElement { return ; } }, ]; diff --git a/Examples/UIExplorer/AsyncStorageExample.js b/Examples/UIExplorer/AsyncStorageExample.js index 3a2579fa7..6064147fd 100644 --- a/Examples/UIExplorer/AsyncStorageExample.js +++ b/Examples/UIExplorer/AsyncStorageExample.js @@ -1,5 +1,6 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. + * @flow */ 'use strict'; @@ -98,6 +99,6 @@ exports.description = 'Asynchronous local disk storage.'; exports.examples = [ { title: 'Basics - getItem, setItem, removeItem', - render() { return ; } + render(): ReactElement { return ; } }, ]; diff --git a/Examples/UIExplorer/CameraRollExample.ios.js b/Examples/UIExplorer/CameraRollExample.ios.js index 7be014a33..dbc817bf5 100644 --- a/Examples/UIExplorer/CameraRollExample.ios.js +++ b/Examples/UIExplorer/CameraRollExample.ios.js @@ -1,5 +1,6 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. + * @flow */ 'use strict'; @@ -108,6 +109,6 @@ exports.description = 'Example component that uses CameraRoll to list user\'s ph exports.examples = [ { title: 'Photos', - render() { return ; } + render(): ReactElement { return ; } } ]; diff --git a/Examples/UIExplorer/CameraRollView.ios.js b/Examples/UIExplorer/CameraRollView.ios.js index c8a9a2829..2e1364eed 100644 --- a/Examples/UIExplorer/CameraRollView.ios.js +++ b/Examples/UIExplorer/CameraRollView.ios.js @@ -2,6 +2,7 @@ * Copyright 2004-present Facebook. All Rights Reserved. * * @providesModule CameraRollView + * @flow */ 'use strict'; @@ -53,7 +54,7 @@ var propTypes = { var CameraRollView = React.createClass({ propTypes: propTypes, - getDefaultProps: function() { + getDefaultProps: function(): Object { return { groupTypes: 'SavedPhotos', batchSize: 5, @@ -75,9 +76,9 @@ var CameraRollView = React.createClass({ var ds = new ListView.DataSource({rowHasChanged: this._rowHasChanged}); return { - assets: [], + assets: ([]: Array), groupTypes: this.props.groupTypes, - lastCursor: null, + lastCursor: (null : ?string), noMore: false, loadingMore: false, dataSource: ds, @@ -99,21 +100,21 @@ var CameraRollView = React.createClass({ this.fetch(); }, - componentWillReceiveProps: function(nextProps) { + componentWillReceiveProps: function(nextProps: {groupTypes?: string}) { if (this.props.groupTypes !== nextProps.groupTypes) { this.fetch(true); } }, - _fetch: function(clear) { + _fetch: function(clear?: boolean) { if (clear) { this.setState(this.getInitialState(), this.fetch); return; } - var fetchParams = { + var fetchParams: Object = { first: this.props.batchSize, - groupTypes: this.props.groupTypes, + groupTypes: this.props.groupTypes }; if (this.state.lastCursor) { fetchParams.after = this.state.lastCursor; @@ -126,7 +127,7 @@ var CameraRollView = React.createClass({ * Fetches more images from the camera roll. If clear is set to true, it will * set the component to its initial state and re-fetch the images. */ - fetch: function(clear) { + fetch: function(clear?: boolean) { if (!this.state.loadingMore) { this.setState({loadingMore: true}, () => { this._fetch(clear); }); } @@ -144,7 +145,7 @@ var CameraRollView = React.createClass({ ); }, - _rowHasChanged: function(r1, r2) { + _rowHasChanged: function(r1: Array, r2: Array): boolean { if (r1.length !== r2.length) { return true; } @@ -166,7 +167,7 @@ var CameraRollView = React.createClass({ }, // rowData is an array of images - _renderRow: function(rowData, sectionID, rowID) { + _renderRow: function(rowData: Array, sectionID: string, rowID: string) { var images = rowData.map((image) => { if (image === null) { return null; @@ -181,9 +182,9 @@ var CameraRollView = React.createClass({ ); }, - _appendAssets: function(data) { + _appendAssets: function(data: Object) { var assets = data.edges; - var newState = { loadingMore: false }; + var newState: Object = { loadingMore: false }; if (!data.page_info.has_next_page) { newState.noMore = true; diff --git a/Examples/UIExplorer/DatePickerExample.js b/Examples/UIExplorer/DatePickerExample.js index ab8b17625..4382f929f 100644 --- a/Examples/UIExplorer/DatePickerExample.js +++ b/Examples/UIExplorer/DatePickerExample.js @@ -1,5 +1,6 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. + * @flow */ 'use strict'; @@ -118,7 +119,7 @@ exports.description = 'Select dates and times using the native UIDatePicker.'; exports.examples = [ { title: '', - render: function() { + render: function(): ReactElement { return ; }, }]; diff --git a/Examples/UIExplorer/GeolocationExample.js b/Examples/UIExplorer/GeolocationExample.js index 78ba29b9d..38d720ba7 100644 --- a/Examples/UIExplorer/GeolocationExample.js +++ b/Examples/UIExplorer/GeolocationExample.js @@ -1,5 +1,6 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. + * @flow */ /* eslint no-console: 0 */ 'use strict'; @@ -19,13 +20,15 @@ exports.description = 'Examples of using the Geolocation API.'; exports.examples = [ { title: 'navigator.geolocation', - render: function() { + render: function(): ReactElement { return ; }, } ]; var GeolocationExample = React.createClass({ + watchID: (null: ?number), + getInitialState: function() { return { initialPosition: 'unknown', diff --git a/Examples/UIExplorer/LayoutExample.js b/Examples/UIExplorer/LayoutExample.js index 2586694ec..ab8b3dc65 100644 --- a/Examples/UIExplorer/LayoutExample.js +++ b/Examples/UIExplorer/LayoutExample.js @@ -1,5 +1,6 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. + * @flow */ 'use strict'; diff --git a/Examples/UIExplorer/ListViewSimpleExample.js b/Examples/UIExplorer/ListViewSimpleExample.js index c0a84fc54..b3f0f8c96 100644 --- a/Examples/UIExplorer/ListViewSimpleExample.js +++ b/Examples/UIExplorer/ListViewSimpleExample.js @@ -1,5 +1,6 @@ /** * Copyright 2004-present Facebook. All Rights Reserved. +* @flow */ 'use strict'; @@ -28,6 +29,8 @@ var ListViewSimpleExample = React.createClass({ }; }, + _pressData: ({}: {[key: number]: boolean}), + componentWillMount: function() { this._pressData = {}; }, @@ -46,7 +49,7 @@ var ListViewSimpleExample = React.createClass({ ); }, - _renderRow: function(rowData, sectionID, rowID) { + _renderRow: function(rowData: string, sectionID: number, rowID: number) { var rowHash = Math.abs(hashCode(rowData)); var imgSource = { uri: THUMB_URLS[rowHash % THUMB_URLS.length], @@ -66,7 +69,7 @@ var ListViewSimpleExample = React.createClass({ ); }, - _genRows: function(pressData) { + _genRows: function(pressData: {[key: number]: boolean}): Array { var dataBlob = []; for (var ii = 0; ii < 100; ii++) { var pressedText = pressData[ii] ? ' (pressed)' : ''; @@ -75,7 +78,7 @@ var ListViewSimpleExample = React.createClass({ return dataBlob; }, - _pressRow: function(rowID) { + _pressRow: function(rowID: number) { this._pressData[rowID] = !this._pressData[rowID]; this.setState({dataSource: this.state.dataSource.cloneWithRows( this._genRows(this._pressData) diff --git a/Examples/UIExplorer/NavigatorIOSExample.js b/Examples/UIExplorer/NavigatorIOSExample.js index 1d09d32a3..7b9234605 100644 --- a/Examples/UIExplorer/NavigatorIOSExample.js +++ b/Examples/UIExplorer/NavigatorIOSExample.js @@ -3,7 +3,7 @@ */ 'use strict'; -var React = require('react-native/addons'); +var React = require('react-native'); var ViewExample = require('./ViewExample'); var { PixelRatio, diff --git a/Examples/UIExplorer/UIExplorerApp.js b/Examples/UIExplorer/UIExplorerApp.js index 95d02347e..c234d54b6 100644 --- a/Examples/UIExplorer/UIExplorerApp.js +++ b/Examples/UIExplorer/UIExplorerApp.js @@ -5,7 +5,7 @@ */ 'use strict'; -var React = require('react-native/addons'); +var React = require('react-native'); var UIExplorerList = require('./UIExplorerList'); var { diff --git a/Examples/UIExplorer/UIExplorerList.js b/Examples/UIExplorer/UIExplorerList.js index 97dddacb7..5ca5254ec 100644 --- a/Examples/UIExplorer/UIExplorerList.js +++ b/Examples/UIExplorer/UIExplorerList.js @@ -3,7 +3,7 @@ */ 'use strict'; -var React = require('react-native/addons'); +var React = require('react-native'); var { ListView, PixelRatio, diff --git a/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj/project.pbxproj b/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj/project.pbxproj index 095c4de35..4b05e5f43 100644 --- a/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj/project.pbxproj +++ b/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj/project.pbxproj @@ -152,7 +152,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -186,7 +186,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; diff --git a/Libraries/AdSupport/RCTAdSupport.xcodeproj/project.pbxproj b/Libraries/AdSupport/RCTAdSupport.xcodeproj/project.pbxproj index 92576cd45..dc1f0393b 100644 --- a/Libraries/AdSupport/RCTAdSupport.xcodeproj/project.pbxproj +++ b/Libraries/AdSupport/RCTAdSupport.xcodeproj/project.pbxproj @@ -157,7 +157,7 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../ReactKit/**", ); - IPHONEOS_DEPLOYMENT_TARGET = 8.2; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -196,7 +196,7 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../ReactKit/**", ); - IPHONEOS_DEPLOYMENT_TARGET = 8.2; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; diff --git a/Libraries/Geolocation/RCTGeolocation.xcodeproj/project.pbxproj b/Libraries/Geolocation/RCTGeolocation.xcodeproj/project.pbxproj index 94f9c3f91..96545a34c 100644 --- a/Libraries/Geolocation/RCTGeolocation.xcodeproj/project.pbxproj +++ b/Libraries/Geolocation/RCTGeolocation.xcodeproj/project.pbxproj @@ -152,7 +152,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -186,7 +186,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; diff --git a/Libraries/Image/RCTImage.xcodeproj/project.pbxproj b/Libraries/Image/RCTImage.xcodeproj/project.pbxproj index dea9cb419..fa6c8c084 100644 --- a/Libraries/Image/RCTImage.xcodeproj/project.pbxproj +++ b/Libraries/Image/RCTImage.xcodeproj/project.pbxproj @@ -194,7 +194,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -228,7 +228,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; diff --git a/Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj b/Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj index 252d73cda..f2f3f6a33 100644 --- a/Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj +++ b/Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj @@ -158,7 +158,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -192,7 +192,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; diff --git a/Libraries/Text/RCTText.xcodeproj/project.pbxproj b/Libraries/Text/RCTText.xcodeproj/project.pbxproj index 240d7c51b..22eafac25 100644 --- a/Libraries/Text/RCTText.xcodeproj/project.pbxproj +++ b/Libraries/Text/RCTText.xcodeproj/project.pbxproj @@ -176,7 +176,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -210,7 +210,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; diff --git a/Libraries/Utilities/AlertIOS.js b/Libraries/Utilities/AlertIOS.js index 8a342004c..3b2530f18 100644 --- a/Libraries/Utilities/AlertIOS.js +++ b/Libraries/Utilities/AlertIOS.js @@ -44,7 +44,7 @@ class AlertIOS { static alert( title: ?string, message: ?string, - buttons: ?Array<{ + buttons?: Array<{ text: ?string; onPress: ?Function; }> diff --git a/Libraries/Vibration/RCTVibration.xcodeproj/project.pbxproj b/Libraries/Vibration/RCTVibration.xcodeproj/project.pbxproj index efd86976e..8de930901 100644 --- a/Libraries/Vibration/RCTVibration.xcodeproj/project.pbxproj +++ b/Libraries/Vibration/RCTVibration.xcodeproj/project.pbxproj @@ -157,7 +157,7 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../ReactKit/**", ); - IPHONEOS_DEPLOYMENT_TARGET = 8.2; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -196,7 +196,7 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../ReactKit/**", ); - IPHONEOS_DEPLOYMENT_TARGET = 8.2; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; diff --git a/Libraries/react-native/addons.js b/Libraries/react-native/addons.js deleted file mode 100644 index 864d8906d..000000000 --- a/Libraries/react-native/addons.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright 2004-present Facebook. All Rights Reserved. - * - * @flow - */ -'use strict'; - -var LinkedStateMixin = require('LinkedStateMixin'); -var ReactComponentWithPureRenderMixin = require('ReactComponentWithPureRenderMixin'); -var ReactNative = require('react-native'); -var ReactUpdates = require('ReactUpdates'); - -var cloneWithProps = require('cloneWithProps'); -var update = require('update'); - -var addons = { - LinkedStateMixin: LinkedStateMixin, - PureRenderMixin: ReactComponentWithPureRenderMixin, - batchedUpdates: ReactUpdates.batchedUpdates, - cloneWithProps: cloneWithProps, - update: update, - Perf: undefined, - TestUtils: undefined, -}; - -if (__DEV__) { - addons.Perf = require('ReactDefaultPerf'); - addons.TestUtils = require('ReactTestUtils'); -} - -var ReactNativeWithAddons = { - ...ReactNative, - addons: addons, -}; - -module.exports = ReactNativeWithAddons; diff --git a/Libraries/react-native/package.json b/Libraries/react-native/package.json deleted file mode 100644 index e8306d485..000000000 --- a/Libraries/react-native/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "react-native", - "main": "react-native.js", - "directories": {".": ""} -} diff --git a/Libraries/react-native/react-native.js b/Libraries/react-native/react-native.js index 8c53abd53..4642c5b9b 100644 --- a/Libraries/react-native/react-native.js +++ b/Libraries/react-native/react-native.js @@ -5,9 +5,14 @@ */ 'use strict'; -var ReactNative = { - ...require('React'), - +// Export React, plus some native additions. +// +// The use of Object.create/assign is to work around a Flow bug (#6560135). +// Once that is fixed, change this back to +// +// var ReactNative = {...require('React'), /* additions */} +// +var ReactNative = Object.assign(Object.create(require('React')), { // Components ActivityIndicatorIOS: require('ActivityIndicatorIOS'), DatePickerIOS: require('DatePickerIOS'), @@ -45,7 +50,20 @@ var ReactNative = { TimerMixin: require('TimerMixin'), VibrationIOS: require('VibrationIOS'), - invariant: require('invariant'), -}; + addons: { + batchedUpdates: require('ReactUpdates').batchedUpdates, + LinkedStateMixin: require('LinkedStateMixin'), + Perf: undefined, + PureRenderMixin: require('ReactComponentWithPureRenderMixin'), + TestUtils: undefined, + cloneWithProps: require('cloneWithProps'), + update: require('update'), + }, +}); + +if (__DEV__) { + ReactNative.addons.Perf = require('ReactDefaultPerf'); + ReactNative.addons.TestUtils = require('ReactTestUtils'); +} module.exports = ReactNative; diff --git a/Libraries/vendor/core/clearImmediate.js b/Libraries/vendor/core/clearImmediate.js new file mode 100644 index 000000000..060147458 --- /dev/null +++ b/Libraries/vendor/core/clearImmediate.js @@ -0,0 +1,19 @@ +/** + * @generated SignedSource<<4595f3986407fd02332cf9f5fc12e70f>> + * + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * !! This file is a check-in of a static_upstream project! !! + * !! !! + * !! You should not modify this file directly. Instead: !! + * !! 1) Use `fjs use-upstream` to temporarily replace this with !! + * !! the latest version from upstream. !! + * !! 2) Make your changes, test them, etc. !! + * !! 3) Use `fjs push-upstream` to copy your changes back to !! + * !! static_upstream. !! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * + * @providesModule clearImmediate + */ + +module.exports = global.clearImmediate || + require('ImmediateImplementation').clearImmediate; diff --git a/ReactKit/ReactKit.xcodeproj/project.pbxproj b/ReactKit/ReactKit.xcodeproj/project.pbxproj index d00c6b2c8..7cd218891 100644 --- a/ReactKit/ReactKit.xcodeproj/project.pbxproj +++ b/ReactKit/ReactKit.xcodeproj/project.pbxproj @@ -546,7 +546,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -581,7 +581,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; diff --git a/ReactKit/Views/RCTScrollViewManager.m b/ReactKit/Views/RCTScrollViewManager.m index 799d4b83c..620cfcaf4 100644 --- a/ReactKit/Views/RCTScrollViewManager.m +++ b/ReactKit/Views/RCTScrollViewManager.m @@ -67,7 +67,7 @@ RCT_REMAP_VIEW_PROPERTY(contentOffset, scrollView.contentOffset); return; } - CGSize size = ((id)view).contentSize; + CGSize size = ((RCTScrollView *)view).scrollView.contentSize; callback(@[@{ @"width" : @(size.width), @"height" : @(size.height) diff --git a/package.json b/package.json index 7c1e940e9..38ac7fd4b 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "react-native-github", + "name": "react-native", "version": "0.1.0", "description": "Build native apps with React!", "repository": { @@ -20,6 +20,7 @@ "source-map" ] }, + "main": "Libraries/react-native/react-native.js", "scripts": { "test": "jest", "lint": "node linter.js Examples/", diff --git a/packager/packager.js b/packager/packager.js index ce4dbd25f..7214aaafd 100644 --- a/packager/packager.js +++ b/packager/packager.js @@ -72,6 +72,8 @@ console.log('\n' + ' ===============================================================\n' ); +console.log('Looking for JS files in\n ', options.projectRoots.join('\n ')); + process.on('uncaughtException', function(e) { console.error(e); console.error(e.stack);