Граф коммитов

10466 Коммитов

Автор SHA1 Сообщение Дата
Marc Horowitz 38f5b84734 Make ModuleHolder usable from C++
Reviewed By: AaaChiuuu

Differential Revision: D4924286

fbshipit-source-id: f4d86603cf241ab21f931fed4798acd805d0b5aa
2017-04-20 15:01:20 -07:00
Pieter De Baets 17020ff9af Add API to reset CxxModuleWrapper's module pointer
Reviewed By: mhorowitz

Differential Revision: D4914335

fbshipit-source-id: f28f57c2e74d590dacfb85d8027747837f768fdc
2017-04-20 11:00:33 -07:00
Pieter De Baets db8efd9c4b Split off websocket related items to RCTPackagerConnection
Reviewed By: cwdick

Differential Revision: D4588557

fbshipit-source-id: 3f4176b9bab2b06cacbb06f1ff514a5f99a76d73
2017-04-20 08:32:10 -07:00
Jean Lauliac 2403b42cf9 packager: getAssetDataFromName: @flow
Reviewed By: davidaurelio

Differential Revision: D4921247

fbshipit-source-id: 47c516257cde5de6b69604d714e45310d00afe19
2017-04-20 07:35:15 -07:00
wenzhao.yin 47f834a76d fix RCTMultipartDataTask Memory leaks
Summary:
In the Docs of `NSURLSession` ,

>IMPORTANT

>The session object keeps a strong reference to the delegate until your app exits or explicitly >invalidates the session. If you do not invalidate the session, your app leaks memory until it exits.

The RCTMultipartDataTask will cause memory leaks, it will make `RCTBatchedBridge` and ` RCTMultipartDataTask` will not release.

So call `[session finishTasksAndInvalidate];` at the end of `startTask` function.
Closes https://github.com/facebook/react-native/pull/12673

Reviewed By: shergin

Differential Revision: D4896497

Pulled By: javache

fbshipit-source-id: eb5f8761f67ad33a7de081a68a9a7e1d4329bfc0
2017-04-20 03:45:25 -07:00
Pieter De Baets 366cb5a00a Remove unused PersistentDirectory JSC config
Reviewed By: amnn

Differential Revision: D4921075

fbshipit-source-id: 8e0a0caadc882a0e3ffb6f66c2bc7336c7d64849
2017-04-20 03:15:26 -07:00
Jean Lauliac 79d9fd8f83 packager: correct transform for assets to avoid string
Reviewed By: davidaurelio

Differential Revision: D4913509

fbshipit-source-id: 9997da819483056d896fedecdc47510ecd381c03
2017-04-20 03:00:10 -07:00
Aaron Chiu 350b6c6d7f don't run setupReactContext() on UI thread
Reviewed By: achen1

Differential Revision: D4816125

fbshipit-source-id: e1da5de166bc29d635ffa22e8747a5b61eaf1491
2017-04-20 01:30:59 -07:00
Brian Vaughn 5fa33d4936 Add create-react-class package
Reviewed By: sebmarkbage

Differential Revision: D4917270

fbshipit-source-id: 3a490eaaa31cb0f4a4f39065bf09a1f30f43c4e1
2017-04-19 20:05:33 -07:00
Marc Horowitz 325228d6cf Remove RCTBatchedBridge rule and all uses from the tree
Reviewed By: AaaChiuuu, javache

Differential Revision: D4889438

fbshipit-source-id: ba103ace8802f0976e09af6b491442e9aa723f49
2017-04-19 17:00:43 -07:00
Connor McEwen 3122328023 Enable dev menu in tvOS simulator
Summary:
There was no easy way to pull up the dev menu in the tvOS simulator

Run the UIExplorer demo and press cmd+d to bring up the menu
Closes https://github.com/facebook/react-native/pull/13584

Differential Revision: D4916967

Pulled By: javache

fbshipit-source-id: 27f50031f65f35dad46ad5ade7b52c7d350b31a2
2017-04-19 15:29:56 -07:00
Georgiy Kassabli 6b0c72fa82 Correcting Flex fix within Experimental feature
Reviewed By: emilsjolander

Differential Revision: D4915189

fbshipit-source-id: efccee2fe39ed0f474a41dc3250d24c546f3f5d9
2017-04-19 13:29:59 -07:00
Emily Janzer bd0f9fbacb Only start observing in requestPermissions() if not already observing
Reviewed By: javache

Differential Revision: D4903744

fbshipit-source-id: d2700f59bae521de6c76f8a3d11d6d48f1c0e7d9
2017-04-19 11:30:36 -07:00
Paulus Esterhazy c58e19ef33 Fix run-ios when specifying a scheme as cli arg
Summary:
The cli arg `--scheme` allows you to override the inferred scheme.
The runOnDevice command takes this override into account, but run-ios
doesn't. This commit fixes this discrepancy.

Thanks for submitting a PR! Please read these instructions carefully:

- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.

Currently if a custom scheme is specified, `run-ios` will fail with the following message

```
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/AwesomeProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
```

This PR fixes this.

Tested manually from CLI.
Closes https://github.com/facebook/react-native/pull/13548

Differential Revision: D4914531

Pulled By: javache

fbshipit-source-id: 071710947e90e6194e0229751e33068565e010b2
2017-04-19 11:30:36 -07:00
Jean Lauliac f519f16180 packager: GlobalTransformCache: throat() the file fetching function
Reviewed By: cpojer

Differential Revision: D4914187

fbshipit-source-id: ae3b8aa4ed4dbd1896ca35cf498b7c02fd109f58
2017-04-19 11:00:41 -07:00
Jean Lauliac aef286791a packager: assetPathUtils: @flow
Reviewed By: cpojer

Differential Revision: D4913888

fbshipit-source-id: 31ddb4b9ede65e1b6caf740a245c3a11326d15d6
2017-04-19 10:41:08 -07:00
Jean Lauliac 0b339362ff packager: buck: fix messed up file types
Reviewed By: cpojer

Differential Revision: D4913706

fbshipit-source-id: 792d78e1baf7d9bea4eba90f791a1dc593087b55
2017-04-19 08:51:14 -07:00
Jean Lauliac 0001d3ce4e packager: worker: strenghten TransformOptions
Reviewed By: davidaurelio

Differential Revision: D4906499

fbshipit-source-id: e7948d09c678d3e270ddd9fd355597eb5d535781
2017-04-19 06:33:52 -07:00
Daniel Schmidt 625df661d5 Added documentation for additional fields of Image
Summary:
Hi there,

As ospfranco found there is some documentation for the code coming from #7338 missing, so I added it. It concerns the method, headers and bdoy field on the Image source object.

If you would like to have any changes made, please don't hesitate to comment, I will add them.

Have a nice day and thank you for maintaining React Native!
Closes https://github.com/facebook/react-native/pull/9304

Differential Revision: D4913262

Pulled By: javache

fbshipit-source-id: 922430ec3388560686e1cf53cb5dff7f30e4e31f
2017-04-19 05:02:12 -07:00
Steffen Forkmann a9ad81a085 Update documentation to use newer version of fresco - fixes #13345
Summary:
Thanks for submitting a PR! Please read these instructions carefully:

React Native crashes hard on fresco 0.11.0 - see #13345

Repro case in #13345
Closes https://github.com/facebook/react-native/pull/13419

Differential Revision: D4913258

Pulled By: javache

fbshipit-source-id: 8beb55102e0f2d362c77698a35ea7d57fdcba48d
2017-04-19 05:02:09 -07:00
Fran e974798656 Udpate scrollTo example
Summary:
This PR updates the example of scrollTo that uses `;` instead of `,` to separate x, y and animated values.
Closes https://github.com/facebook/react-native/pull/13318

Differential Revision: D4913285

Pulled By: javache

fbshipit-source-id: 02c219fbeae0f9e3b63f4b64eb4cca34868641c1
2017-04-19 04:36:09 -07:00
Emmanouil Konstantinidis 5121434262 Mock Linking - openURL & canOpenURL
Summary:
This PR brings 2 basic mocks for `Linking`'s `openURL` & `canOpenURL` methods. Below you can find 2 examples on how to it works.

```javascript

  it('presses the open website button', () => {
    const wrapper = shallow(<Info />);

    expect(wrapper).toBeDefined();

    wrapper.find('TouchableOpacity').simulate('press');

    expect(Linking.openURL).toHaveBeenCalledTimes(1);
    expect(Linking.openURL).toHaveBeenCalledWith('https://www.hello.world/');
  });

  it('presses the call button', () => {
    const wrapper = shallow(<MoreInfo />);

    expect(wrapper).toBeDefined();

    wrapper.find('TouchableOpacity').simulate('press');

    expect(Linking.canOpenURL).toHaveBeenCalledTimes(1);
    expect(Linking.canOpenURL).toHaveBeenCalledWith('tel:01273123123');
  });
````
Closes https://github.com/facebook/react-native/pull/12839

Differential Revision: D4908903

Pulled By: javache

fbshipit-source-id: 0b62e9c2a7f920dc8bf0a49c1973f65c473eb653
2017-04-19 04:20:12 -07:00
Jean Lauliac de3478c1b1 packager: GlobalTransformCache: cache the transform options digest
Reviewed By: davidaurelio

Differential Revision: D4906974

fbshipit-source-id: b6cf83ba6a072400685948329070e171f65c837d
2017-04-19 03:15:38 -07:00
Hector Ramos 9dc7654a6c Pin newly updated F8 2017 conference app in the showcase
Summary: Closes https://github.com/facebook/react-native/pull/13449

Differential Revision: D4895880

Pulled By: hramos

fbshipit-source-id: 12b0462131208d525df8725d981d3e9039c53472
2017-04-19 03:00:57 -07:00
Andrew Tokarev 460e77d47d Fixing Race condition that happens with _wasBatchActive
Summary:
Issue Fix: #13485

Yet another race condition that was found by XCode's Thread Sanitizer.
Happens because wasBatchActive is read/write from multiple threads at the same time

- opened UIExplorer and see it works
- npm run test pass
- tested on own project as well

Signed CLA
Closes https://github.com/facebook/react-native/pull/13505

Differential Revision: D4906096

Pulled By: javache

fbshipit-source-id: 5d4329aafcfe9491ce0188fa1e2dd71e09b31031
2017-04-19 03:00:53 -07:00
Ryan Leckey 9b882a3b44 Use uri instead of url in source property of Image
Summary:
https://github.com/facebook/react-native/issues/13478#issuecomment-294002694

Fix incorrect usage of `url` in the `source` property of `<Image />` in the example.
Closes https://github.com/facebook/react-native/pull/13496

Differential Revision: D4893299

Pulled By: hramos

fbshipit-source-id: 134f9100d16997627b14c145256818e05017bbe3
2017-04-19 03:00:47 -07:00
Aaron Chiu 3e866e0380 launch conversion from ASyncTask to Thread
Reviewed By: achen1

Differential Revision: D4900998

fbshipit-source-id: af2283525b4e9856d7ff3466096226c4c1209f6b
2017-04-18 20:32:02 -07:00
Aaron Chiu 3fda6a9a2b clear DraweeControllerBuilder after usage
Reviewed By: achen1

Differential Revision: D4908279

fbshipit-source-id: 8de9930a2160f3201f8b7a8a66415310fa2f41de
2017-04-18 20:07:05 -07:00
Ben Alpert 8f2d73d50b React Native Fiber: Fix errors in children management
Reviewed By: bvaughn

Differential Revision: D4905062

fbshipit-source-id: 43c24e7bcaf06eb4c7385b7022d0f20cf42d6f2f
2017-04-18 18:33:30 -07:00
Van der Auwermeulen Grégoire 23e8fcc68c ListItem JSX tag is not closed when used in SectionList
Summary:
Thanks for submitting a PR! Please read these instructions carefully:

- [ ] Explain the **motivation** for making this change.
- [ ] Provide a **test plan** demonstrating that the code is solid.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.

When copy pasting the SectionList, got an error with a non closing JSX tag
What existing problem does the pull request solve?
Closing the JSX tag in 2 files
no test required
A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more.

If you have added code that should be tested, add tests.

Sign the [CLA][2], if you haven't already.

Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
Closes https://github.com/facebook/react-native/pull/13525

Differential Revision: D4908495

Pulled By: javache

fbshipit-source-id: f2dc49c9238d1da8906f7daf144429a57ad725a3
2017-04-18 16:45:28 -07:00
Jonathan Kim be5a4609e6 Remove immutable-js
Summary:
Immutable doesn't seem to be used in react-native anymore so I've removed it as a dependency.

Ensure that all tests pass.
Closes https://github.com/facebook/react-native/pull/13471

Differential Revision: D4877659

Pulled By: javache

fbshipit-source-id: f06996d6d0af73e5bd0108cec75370eec66ca038
2017-04-18 16:45:28 -07:00
Marc Horowitz e7fe3b165b Explicitly cast to (bool) where needed on objc with folly::dynamic
Reviewed By: yfeldblum

Differential Revision: D4711054

fbshipit-source-id: 00897ca703f0f3a8cddaf170fef53f9851b631af
2017-04-18 15:36:20 -07:00
Mohamed Habib a5dea8d612 Fixed a typo in open function documentation
Summary:
Thanks for submitting a PR! Please read these instructions carefully:

- [ ] Explain the **motivation** for making this change.
- [ ] Provide a **test plan** demonstrating that the code is solid.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.

What existing problem does the pull request solve?

A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more.

If you have added code that should be tested, add tests.

Sign the [CLA][2], if you haven't already.

Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.
Closes https://github.com/facebook/react-native/pull/13556

Differential Revision: D4908506

Pulled By: javache

fbshipit-source-id: 17f6a57e31e68dc79ac9b5303bf56461663d7edd
2017-04-18 15:36:20 -07:00
Kevin Cooper e443b7379e More verbose error messages for iOS
Summary:
Output the reason for the error when failing to load source code. This was a big help when trying to diagnose https://github.com/facebook/react-native/issues/13299.

~~Unfortunately there still seems to be no way to get the offending line number (because `loadError.userInfo[RCTJSStackTraceKey]` is empty), but this is good enough.~~

Before:

```
[warn][tid:com.facebook.react.JavaScript][RCTBatchedBridge.m:510] Failed to execute source code. Unhandled JS Exception: SyntaxError
```

After:

```
[warn][tid:com.facebook.react.JavaScript][RCTJSCErrorHandling.mm:30] Couldn't get stack trace for http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:81886
[warn][tid:com.facebook.react.JavaScript][RCTBatchedBridge.m:510] Failed to execute source code. Unhandled JS Exception: SyntaxError Unexpected keyword 'var'
```
Closes https://github.com/facebook/react-native/pull/13561

Differential Revision: D4908501

Pulled By: javache

fbshipit-source-id: a316dc70739b917b3cc690309d0ff37a8bb5d412
2017-04-18 14:19:13 -07:00
Sue Ann Ioanis cc4648ba86 Omit units from zero values.
Summary:
It's recommended to remove units for all zero length values because
these units aren't being used and therefore can be safely removed to
save bytes.
Closes https://github.com/facebook/react-native/pull/13518

Differential Revision: D4905286

Pulled By: javache

fbshipit-source-id: 4119eb8034b4b5b864228316c5a450978d4328e9
2017-04-18 14:00:18 -07:00
Himanshu Pathak 5a5fd32acb Update Colors.md, removed duplicate colors
Summary:
removed duplicate colors

Thanks for submitting a PR! Please read these instructions carefully:

- [ ] Explain the **motivation** for making this change.
- [ ] Provide a **test plan** demonstrating that the code is solid.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.

What existing problem does the pull request solve?

A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more.

If you have added code that should be tested, add tests.

Sign the [CLA][2], if you haven't already.

Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests a
Closes https://github.com/facebook/react-native/pull/13555

Differential Revision: D4908510

Pulled By: javache

fbshipit-source-id: 819a3c2788232bc092cccc071f115853e7caddad
2017-04-18 13:41:22 -07:00
Marc Horowitz 5e09242e26 Rename JSCSamplingProfiler to RCTJSCSamplingProfiler
Reviewed By: javache

Differential Revision: D4889427

fbshipit-source-id: 1f74416b858134ec3682b1302021131114763881
2017-04-18 13:22:01 -07:00
David Aurelio 50f0ade13d `getTransformOptions` can only return promises
Summary: Changes the contract for `getTransformOptions` so that it has to return a promises. That allows call sites to get rid of special logic / wrapping.

Reviewed By: jeanlauliac

Differential Revision: D4905959

fbshipit-source-id: c7d434c0766984e25987de1d769594e7c922d691
2017-04-18 11:21:10 -07:00
Gabe Levi f47ed2b5b9 Bump the flow-bin version to ^0.44.2
Summary:
There's something wrong with the Linux binary in Flow v0.44.1. It doesn't work. Flow v0.44.2 fixes, however CircleCI may have cached Flow v0.44.1. Putting this PR up in case it's needed.

yarn install
yarn run flow
Closes https://github.com/facebook/react-native/pull/13549

Differential Revision: D4902838

Pulled By: gabelevi

fbshipit-source-id: 7f5223f7447dc0387955a94a0945915521a508c4
2017-04-18 10:18:58 -07:00
Jean Lauliac c6f5717d2b packager: ResolutionRequest: stronger option typing
Reviewed By: cpojer

Differential Revision: D4906382

fbshipit-source-id: 1696c3e7fe07c84a3a497740dc87a237d9b71d1e
2017-04-18 10:18:58 -07:00
Jean Lauliac 4ab4df07af packager: buck: transform-module: add support for assets
Reviewed By: davidaurelio

Differential Revision: D4868312

fbshipit-source-id: 44d20a5ed73637a9b3f43a99b5c82931f3e15dc6
2017-04-18 09:39:32 -07:00
Jean Lauliac 1c53c9b20f packager: Module: remove dead cacheTransformResults option
Reviewed By: davidaurelio

Differential Revision: D4884343

fbshipit-source-id: ae29757690d9b56d6f166bc86573aca9b1b6b65c
2017-04-18 09:39:32 -07:00
Jean Lauliac a6828f2127 packager: remove Cache
Summary: It seems we don't need that one much anymore, as we have a FS-based cache for files, and removing the last callsites doesn't really change perf, as we have to read these files eventually (plus some of these are read from `HasteMap`, that I believe is already dead code).

Reviewed By: davidaurelio

Differential Revision: D4884220

fbshipit-source-id: 4cf59f16a6f0bdf275abe81e9de2f34816866bae
2017-04-18 09:39:31 -07:00
Ben Roth 09e7dbc9cb Protect against fatal YellowBox error when stack frame has no file
Summary:
Motivation: When viewing a stack trace in YellowBox where one or more of the stack frames has no `file`, JS will encounter the fatal error `null is not an object (evaluating 'file.split')`. This can happen, for example, when running a bundle for which no source maps were generated.
Closes https://github.com/facebook/react-native/pull/13512

Differential Revision: D4896480

Pulled By: javache

fbshipit-source-id: 202c793a47abb83a4700a5778a92b0b5828b01a3
2017-04-18 09:39:31 -07:00
Pieter De Baets 54d8d10a6b Construct ModuleHolder from ReactModuleInfo
Reviewed By: AaaChiuuu

Differential Revision: D4883331

fbshipit-source-id: c901051d0aa5993142104126bbec5d76bd605e0b
2017-04-18 06:48:04 -07:00
Aaron Chiu 035f076594 move calls that need to be on the UI thread out of setupReactContext()
Reviewed By: achen1

Differential Revision: D4890541

fbshipit-source-id: 7fc87d3341a1cefd474481dcc1b7b6d02d92f445
2017-04-18 04:15:34 -07:00
Aaron Chiu b9eeaef243 make ReactInstanceManager safer threading wise
Reviewed By: achen1

Differential Revision: D4883219

fbshipit-source-id: 45671a6d51357fd51ca824a59f7b200c3df66b89
2017-04-18 04:15:34 -07:00
Tony Tan 3e7aa5f14e Fix bug - FlatList component did not render more items when content was filtered
Summary:
**Bug Description**

The FlatList component receives content items via the data prop, and renders an initial number of items on the app's view. When a user scrolls to the end of the list, the component will append and render more available items at the end of the list. There was a bug where when the content was filtered, there were more available items but the component did not append/render them. This is due to the current appending/rendering logic in VirtualizedList, which does not account for data changes as a condition for updating/rendering. VirtualizedList is a dependency of FlatList, so this issue affects FlatList as well.

**Approach to Fixing Bug**

(i) Reproduce bug on iOS view of FlatList.
(ii) For VirtualizedList component:
  # Isolate onEndReached function that appends more data to component UI.
  # Isolate _onContentSizeChange function that is called when list content changes.
  # Write snapshot tests using jest, based off existing test for FlatList.
  # Refactor logic to append more data to list into _maybeCallOnEndReached function.
  # Call _maybeCallOnEndReached in both _onContentSizeChange and _onScroll.
(iii) Run snapshot tests and observe jest output.
(iv) Bring up iOS view of FlatList and check that component now renders more items when content is filtered.

Many thanks to sahrens for guidance in developing this code!

Reviewed By: sahrens

Differential Revision: D4877388

fbshipit-source-id: c10c9eef1912f491450a62b81a9bc41f7f784203
2017-04-17 18:15:37 -07:00
Aaron Chiu ff056d22d9 update the infer-annotation jar for open source to unblock D4883219
Reviewed By: achen1

Differential Revision: D4890251

fbshipit-source-id: 3945c0e85fba15d588aa3b5760c64c5d81c6c516
2017-04-17 15:57:36 -07:00
Andrew Y. Chen 1dc0f7e994 Instrumentation tests for apps that provide a testPayload
Reviewed By: AaaChiuuu

Differential Revision: D4873849

fbshipit-source-id: b5235b952faea2e42fb4292fac4ca409e22ecb56
2017-04-17 15:00:44 -07:00