-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates from Wed 3 Jun #1505
Updates from Wed 3 Jun #1505
Conversation
Summary: @public For some reason we were manually JSON-encoding the RCTDataManager responses, and then decoding them again on the JS side. Since all data sent over the bridge is JSON-encoded anyway, this is pretty pointless. Test Plan: * Test Movies app in OSS, which uses RCTDataManager * Test any code that uses RKHTTPQueryGenericExecutor to make network requests (e.g. Groups) * Test the Groups photo upload feature, which uses RKHTTPQueryWithImageUploadExecutor
Summary: Fixes #1371 Closes #1447 Github Author: Brent Vatne <[email protected]> Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary: Adds support for JS async methods and helps guide people writing native modules w.r.t. the callbacks. With this diff, on the native side you write: ```objc RCT_EXPORT_METHOD(getValueAsync:(NSString *)key resolver:(RCTPromiseResolver)resolve rejecter:(RCTPromiseRejecter)reject) { NSError *error = nil; id value = [_nativeDataStore valueForKey:key error:&error]; // "resolve" and "reject" are automatically defined blocks that take // any object (nil is OK) and an NSError, respectively if (!error) { resolve(value); } else { reject(error); } } ``` On the JS side, you can write: ```js var {DemoDataStore} = require('react-native').NativeModules; DemoDataStore.getValueAsync('sample-key').then((value) => { console.log('Got:', value); }, (error) => { console.error(error); // "error" is an Error object whose message is the NSError's description. // The NSError's code and domain are also set, and the native trace i Closes #1232 Github Author: James Ide <[email protected]> Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary: This adds a parameter for fetching videos from the camera roll. It also changes the default to fetch both videos and photos. Closes #774 Github Author: Joshua Sierles <[email protected]> Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary: Wraps the setImmediate handlers in a `batchUpdates` call before they are synchronously executed at the end of the JS execution loop. Closes #1242 Github Author: James Ide <[email protected]> Test Plan: Added two `setImmediate` calls to `componentDidMount` in UIExplorerApp. Each handler calls `setState`, and `componentWillUpdate` logs its state. With this diff, we can see the state updates are successfully batched. ```javascript componentDidMount() { setImmediate(() => { console.log('immediate 1'); this.setState({a: 1}); }); setImmediate(() => { console.log('immediate 2'); this.setState({a: 2}); }); }, componentWillUpdate(nextProps, nextState) { console.log('componentWillUpdate with next state.a =', nextState.a); }, ``` **Before:** "immediate 1" "componentWillUpdate with next state.a =", 1 "immediate 2" "componentWillUpdate with next state.a =", 2 **After:** "immediate 1" "immediate 2" "componentWillUpdate with next state.a =", 2 Addresses the batching issue in #1232. cc @vjeux @spicyj
Summary: Previously, if you were already inspecting an element, touching again would select a completely different element because the touch position was calculated relative to the current overlay. This fixes it. @public Test Plan: Open the inspector, click around, verify that every click selects the thing you clicked on.
Summary: @public On D2099270 event coalescing was implemented and the event key on the RCTSparseArray is an uint64_t, but it was declared as NSUInteger. On a 32 bits architecture it'll be clipped to 4 bits, meaning that just `reactTag` will be taken into account, e.g. different types of events can coalesce with each other if they target the same view Switching to use an NSMutableDictionary instead of RCTSparseArray and NSNumber as keys instead of uint64_t Test Plan: Fixed the previous tests and added a new test to RCTEventDispatcherTests
Summary: @public Use trace-viewer's flow events to link the bridge calls Test Plan: {F22498582}
…ints Summary: @public Right now the profiler shows how long the executor took on JS but doesn't show how long each of the batched calls took, this adds a *very* high level view of JS execution (still doesn't show properly calls dispatched with setImmediate) Also added a global property on JS to avoid trips to Native when profiling is disabled. Test Plan: Run the Profiler on any app {F22491690}
…ansform API on Android
…port(Fatal|Soft)Exception
Summary: Similar issue to #214. When I attempt to do command + D in the simulator, I get the following issue. ``` Launching Dev Tools... Failed to run launchChromeDevTools.applescript { [Error: Command failed: /bin/sh -c /Users/ricky/Dropbox (Personal)/Sites/AwesomeProject/node_modules/react-native/packager/launchChromeDevTools.applescript http://localhost:8081/debugger-ui /bin/sh: -c: line 0: syntax error near unexpected token `Personal' /bin/sh: -c: line 0: `/Users/ricky/Dropbox (Personal)/Sites/AwesomeProject/node_modules/react-native/packager/launchChromeDevTools.applescript http://localhost:8081/debugger-ui' ] killed: false, code: 2, signal: null, cmd: '/bin/sh -c /Users/ricky/Dropbox (Personal)/Sites/AwesomeProject/node_modules/react-native/packager/launchChromeDevTools.applescript http://localhost:8081/debugger-ui' } /bin/sh: -c: line 0: syntax error near unexpected token `Personal' /bin/sh: -c: line 0: `/Users/ricky/Dropbox (Personal)/Sites/AwesomeProject/node_modules/react-native/packa Closes #348 Github Author: rickyc <[email protected]> Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary: @public ErrorUtils.reportError is intended for reporting handled errors to the server, like timeouts, which means that we shouldn't shove them in the developer's face. Test Plan: add `require('ErrorUtils').reportError(new Error('error'))` and see a useful error message with stack but no redbox. Debugger confirms `reportSoftException` is called but it doesn't do anything yet. `reportFatalError` and throwing exceptions still show redboxes.
Summary: Closes #1465 Github Author: Caleb Brown <[email protected]> Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary: Closes #780 Github Author: Klein Lieu <[email protected]> Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary: @public Use trace-viewer's flow events to link the bridge calls Test Plan: {F22498582}
@ide: we also had to revert the batching of setImmediate handler for the same reason :( It turns out that android tests failing were not stopping the land. We're fixing this so that we don't have to revert diffs in the future like this anymore. Sorry about that |
@vjeux ok, thanks for the note. Tell me if there's something I should do to support my commits once the Android team has had a chance to look into things. |
No description provided.