Commit Graph

26 Commits

Author SHA1 Message Date
Nick Lockwood c5b990f65f Added lightweight generic annotations
Summary: public

Added lightweight genarics annotations to make the code more readable and help the compiler catch bugs.

Fixed some type bugs and improved bridge validation in a few places.

Reviewed By: javache

Differential Revision: D2600189

fb-gh-sync-id: f81e22f2cdc107bf8d0b15deec6d5b83aacc5b56
2015-11-03 14:49:30 -08:00
Alexey Lang 8ad09987e5 Log bundle size.
Reviewed By: javache

Differential Revision: D2564757

fb-gh-sync-id: c4429b735482ee6405b936e2dcdf610e9c6ad35f
2015-10-21 10:55:25 -07:00
Frédéric Sagnes 4a3857ef1d Use JSStringCreateWithUTF8CString and skip NSString decoding when loading the bundle
Summary: public

Benchmarking our startup path has shown we spend a lot of time decoding strings (iPhone 4S / iPhone 5):

* reading a 2MB JS bundle: 35ms / 15ms
* decoding is to an `NSString`: 186ms / 78ms
* transforming that to a `JSString`: 29ms / 10ms

Instead of going through an `NSString` transformation, we generate a null-terminated bundle (0.1ms / 0.05ms to copy the data) and use `JSStringCreateWithUTF8CString` (121ms / 53ms) to generate the string. That makes decoding 70% faster.

Reviewed By: javache

Differential Revision: D2541140

fb-gh-sync-id: 09a016b8edfd46a9b62682c76705564d2024e75e
2015-10-16 08:11:25 -07:00
Uri Baghin f52cd5dc1e Use path instead of resourceSpecifier so it unescapes.
Reviewed By: @nicklockwood

Differential Revision: D2526217

fb-gh-sync-id: c48af71402927b0aa4e9942e1825068af5334ab9
2015-10-09 06:39:43 -07:00
Nick Lockwood 7fe7a2a26b Improved JS bundle loading performance
Summary: @​public

RCTJavaScriptLoader was using an NSURLSessionDataTask to load local bundle.js files. While this works, it was non-optimal from a performance point of view.

Reviewed By: @tadeuzagallo

Differential Revision: D2522598

fb-gh-sync-id: b32981b3be4c336512d1462d3f4943b5aad34ae0
2015-10-08 12:39:52 -07:00
futbalguy 3bef953f77 Added clarifying language to error for not finding development server
Summary:
Added additional check to make if seeing error message on not finding development server:
Node server URL is correctly set in AppDelegate.

Should make it easier for a developer that is not running on localhost for the first time.

Screenshot of updated error message:
![img_0015 1](https://cloud.githubusercontent.com/assets/7111607/9553286/d7081c30-4d72-11e5-8c24-e3e5c83281d0.PNG)

Closes https://github.com/facebook/react-native/pull/2484
Github Author: futbalguy <kyle.rokita@gmail.com>
2015-09-01 05:25:56 -08:00
Nick Lockwood 88e0bbc469 Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
Nick Lockwood 8d1e02b8bd Convert alloc/init to new to please linter 2015-08-17 08:46:00 -07:00
Tadeu Zagallo 127f7095dc [ReactNative] Add RCTBridgeDelegate
Summary:
Add a new bridge delegate protocol to allow a more flexible bridge configuration.

For now it just support the pre-existent configurations + providing the JavaScript
source to the bridge, that should allow pre-loading sources.
2015-07-28 15:57:02 -08:00
Nick Lockwood 1b7699f671 Migrate unit tests from FBReactKitModules to FBReactKit 2015-07-07 16:39:35 -08:00
Nick Lockwood 650fc9de4c Increased warning levels to -Wall -Wextra, and fixed Xcode 7 beta issues
Summary:
@public

I've increased the warning levels in the OSS frameworks, which caught a bunch of minor issues. I also fixed some new errors in Xcode 7 relating to designated initializers and TLS security.

Test Plan:
* Test the sample apps and make sure they still work.
* Run tests.
2015-06-15 07:52:50 -08:00
Tadeu Zagallo 132a9170f1 [ReactNative] Create private underlying bridge to prevent retain cycles 2015-05-04 10:36:20 -08:00
Nick Lockwood 8a3b0fa9e8 Fix edge cases and add tests for +[RCTConvert NSURL:] 2015-04-25 15:11:23 -08:00
Kevin Gozali 34a5aa1d0a [ReactNative][madman] Revert D2001353 2015-04-23 13:39:56 -08:00
Herman Schaaf 4242bd9c83 Replace percent escapes in file URL before using as path
Summary:
This is to fix a bug that prevents bundling of projects that contain spaces (or other special characters) in their names.

#### Reproduction steps before the fix
 1. Create a project with a space in the name:
    ![screen shot 2015-04-16 at 17 23 46](https://cloud.githubusercontent.com/assets/1121616/7176887/63af36de-e45d-11e4-9aa9-40586560b716.png)

 2. Follow the steps in `OPTION 2` for running from a bundled file, i.e. create the `main.bundle` file, add it to the project if is not there already, and uncomment `jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];`
 3. Run the application. This is what happens:

![screen shot 2015-04-16 at 17 27 48](https://cloud.githubusercontent.com/assets/1121616/7176955/f139764a-e45d-11e4-8dc8-3c13aab70828.png)

To prove that it has to do with a space in the name, refactor the project name to not contain a space:

![screen shot 2015-04-16 at 17 28 27](https://cloud.githubusercontent.com/assets/1121616/7176966/056b6c9a
Closes https://github.com/facebook/react-native/pull/876
Github Author: Herman Schaaf <hermanschaaf@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-23 11:01:18 -08:00
Spencer Ahrens 27252e611c [FBRhinos] add sms cmd for device configuration 2015-04-22 16:10:40 -08:00
Tadeu Zagallo 0e67e33534 [ReactNative] Ensure JS calls scheduled by a deallocated context don't fire 2015-04-20 02:03:22 -08:00
Nick Lockwood 0b21df4a34 Improved logging and dev menu 2015-04-19 12:56:22 -08:00
Nick Lockwood 26fd24dc50 Cleanup 2015-04-11 14:19:49 -08:00
Tadeu Zagallo f5f80da80c [ReactNative] Remove bridge retaining cycles 2015-04-10 07:20:37 -08:00
Nick Lockwood bf4868edda Added non-class-scanning-based approach fror registering js methods 2015-04-08 05:45:20 -08:00
Spencer Ahrens a1ec752019 [ReactNative] Do flow check when running packager 2015-04-07 21:40:05 -08:00
Ben Hiller 220e116dce [fbobjc] revert rFBOBJCdba3daf9a595f452d069f2a74a9a11f251999b2e 2015-04-07 20:44:11 -08:00
Tadeu Zagallo 6854da9b86 [ReactNative] Remove bridge retaining cycles 2015-04-07 19:42:46 -08:00
Tadeu Zagallo 9df3e889ad [ReactNative] Fix script load from local files 2015-04-02 15:57:01 -08:00
Tadeu Zagallo f370f9cbc4 [ReactNative] Unfork RKRootView 2015-04-02 07:12:42 -08:00