Commit Graph

7859 Commits

Author SHA1 Message Date
Andrew Nicolaou 25e048ba3a Add .mm to RCTNetwork subspec
Summary:
Without this, `Libraries/Network/RCTNetworking.mm` is not matched,
causing a "Native module cannot be null" error when integrating into
an existing Swift iOS project.

I've tested this fix with an iOS Swift project following the
"Integration With Existing Apps" [1] tutorial and the error does
not appear.

[1] https://facebook.github.io/react-native/docs/integration-with-existing-apps.html
Closes https://github.com/facebook/react-native/pull/9904

Differential Revision: D3873011

fbshipit-source-id: d69395190d3865aa1fc87966a37981b53beea115
2016-09-15 14:58:51 -07:00
Janic Duplessis d0d1712851 Reverted commit D3827366
Summary:
This adds support for sticky headers on Android. The implementation if based primarily on the iOS one (https://github.com/facebook/react-native/blob/master/React/Views/RCTScrollView.m#L272) and adds some stuff that was missing to be able to handle z-index, view clipping, view hierarchy optimization and touch handling properly.

Some notable changes:
- Add `ChildDrawingOrderDelegate` interface to allow changing the `ViewGroup` drawing order using `ViewGroup#getChildDrawingOrder`. This is used to change the content view drawing order to make sure headers are drawn over the other cells. Right now I'm only reversing the drawing order as drawing only the header views last added a lot of complexity especially because of view clipping and I don't think it should cause issues.

- Add `collapsableChildren` prop that works like `collapsable` but applies to every child of the view. This is needed to be able to reference sticky headers by their indices otherwise some subviews can get optimized out and break indexes.
Closes https://github.com/facebook/react-native/pull/9456

Differential Revision: D3827366

Pulled By: fred2028

fbshipit-source-id: d346068734c5b987518794ab23e13914ed13b5c4
2016-09-15 12:13:39 -07:00
Neo c1ed6ab4ed add missing uiexplorer examples on android
Summary:
since #9456 has been landed, it's the time to add ListViewPagingExample to the example list for Android
Closes https://github.com/facebook/react-native/pull/9930

Differential Revision: D3871517

fbshipit-source-id: dafa8ab2d704bcc5e7bc25b5fcec18a1a6cfa28a
2016-09-15 11:58:36 -07:00
Fred Liu b7ee6adade Reverted commit D3870895
Reviewed By: foghina

Differential Revision: D3870895

fbshipit-source-id: 305534c752d1041bf03e27f28d6b5bf0a66a5a61
2016-09-15 11:58:36 -07:00
Andy Street 5c3f9547c6 Unbreak nodes that use ScrollViews
Reviewed By: foghina

Differential Revision: D3870895

fbshipit-source-id: e01130f19cca96ae1bcd0b8040e78552727fd6dc
2016-09-15 11:13:51 -07:00
Andy Street 6f42603d0e Add Dependency Injection, nodes support for RN/Components integration
Reviewed By: lexs, emilsjolander

Differential Revision: D3863226

fbshipit-source-id: f7528a9ff69697dd51fc7f7496a1c46110a42bed
2016-09-15 09:28:46 -07:00
Joshua May 5d57368bb0 Docs fix: link for releases points to react-native repo
Summary:
Both of the links were pointing to the same (`react`) repo, but shouldn't have.

Obvious enough :)
Closes https://github.com/facebook/react-native/pull/9923

Differential Revision: D3870481

Pulled By: JoelMarcey

fbshipit-source-id: b35c963c65fd0b253d076d83a4a1276c134b81d2
2016-09-15 09:13:39 -07:00
Charles Dick d2c333acaf name functions in JSC cpu profiles
Reviewed By: bestander

Differential Revision: D3835094

fbshipit-source-id: 164afb7878dde528ee2573e1d499b5e0911662ed
2016-09-15 07:13:37 -07:00
Charles Dick e6bec9cb80 Add option to bundle server to generate full sourcemaps from babel
Reviewed By: bestander

Differential Revision: D3863894

fbshipit-source-id: a282758e022d403743841bc59277196e6741ed18
2016-09-15 06:58:26 -07:00
aleclarsoniv fa6191f6ac Support symlinks-to-symlinks
Summary:
In response to [this comment](https://github.com/facebook/react-native/pull/9009#issuecomment-245322397).

I could be wrong here, but I think Watchman can't handle symlinks, so we need to make sure symlinks-to-symlinks are handled up front.
Closes https://github.com/facebook/react-native/pull/9792

Differential Revision: D3858349

Pulled By: bestander

fbshipit-source-id: f3a34dae90ed9a7004a03158288db5e1932bfc69
2016-09-15 05:28:34 -07:00
Pieter De Baets 00e7d46df3 Improve stability of RCTAllocationTests
Reviewed By: frantic

Differential Revision: D3862884

fbshipit-source-id: 52b168c62facd8e67d7047a087c843f3c477ca58
2016-09-15 04:28:47 -07:00
Janic Duplessis 0e8b75b22c Implement ScrollView sticky headers on Android
Summary:
This adds support for sticky headers on Android. The implementation if based primarily on the iOS one (https://github.com/facebook/react-native/blob/master/React/Views/RCTScrollView.m#L272) and adds some stuff that was missing to be able to handle z-index, view clipping, view hierarchy optimization and touch handling properly.

Some notable changes:
- Add `ChildDrawingOrderDelegate` interface to allow changing the `ViewGroup` drawing order using `ViewGroup#getChildDrawingOrder`. This is used to change the content view drawing order to make sure headers are drawn over the other cells. Right now I'm only reversing the drawing order as drawing only the header views last added a lot of complexity especially because of view clipping and I don't think it should cause issues.

- Add `collapsableChildren` prop that works like `collapsable` but applies to every child of the view. This is needed to be able to reference sticky headers by their indices otherwise some subviews can get optimized out and break indexes.
Closes https://github.com/facebook/react-native/pull/9456

Differential Revision: D3827366

fbshipit-source-id: cab044cfdbe2ccb98e1ecd3e02ed3ceaa253eb78
2016-09-14 20:43:29 -07:00
Chris Hopman 272d3ded4f RN: use consistent class/struct
Reviewed By: lexs

Differential Revision: D3858508

fbshipit-source-id: 6f49b09844cb70fae8078d650af69b200779c2f1
2016-09-14 14:44:15 -07:00
Kevin Lacker 857bae4ea3 Replace the deprecated esprima-fb parser with flow-parser, on the RN website
Summary:
(I changed a ton from when I previously submitted this PR so please take another look if you already did.)

PROBLEM: the no-longer-maintained `esprima-fb` parser does not support class properties, leading our website docgen to die if we use class properties, which we're gonna do real soon now
SOLUTION: use `flow-parser` instead, which the flow team is maintaining including all the fancy-pants ES? stuff that FB uses internally.

This removes the `esprima-fb` parser from jsdocs and replaces it with `flow-parser`. It's almost the same, I checked by diffing all the parser json output and it only had a few irrelevant differences. I had to add a file of constants so that we could remove esprima-fb altogether, too.

This also adds a couple unit tests, so that we can test that jsDocs works programmatically. They don't run if you run the regular RN tests, you have to run `npm test` from the `/website/` subdirectory.
Closes https://github.com/facebook/react-native/pull/9890

Differential Revision: D3865629

Pulled By: bestander

fbshipit-source-id: 8f561b78ca4a02f3f7b45e55904ec2fa911e3bb6
2016-09-14 14:28:44 -07:00
leeight 3182b608fc Fix invalid package name and Remove unsupported prop in Image.android.js
Summary:
1. `textfrescosupport` -> `text.frescosupport`
2. `defaultImageSrc`, `imageTag` and `progressHandlerRegistered` looks like never exists in `ReactImageManager.java`
Closes https://github.com/facebook/react-native/pull/9885

Differential Revision: D3864980

fbshipit-source-id: 48a85563c60b6853c505177558520f5e48f4eb03
2016-09-14 13:43:48 -07:00
aleclarsoniv d4dff25292 Protect against roots that are contained within other roots
Summary:
For example, I could have a root named `random` and another root named `randomColor`.
A child of `randomColor` would **incorrectly** pass as a descendant of `random`.

So this commit changes `isDescendant` to do 2 things:
- check for exact matches (eg: the path is a root)
- call `startsWith` like before, but append `path.sep` to avoid false positives
Closes https://github.com/facebook/react-native/pull/9831

Differential Revision: D3864968

fbshipit-source-id: 7fe04913579aa0741840fc925216283304ae3433
2016-09-14 13:43:47 -07:00
Eric Rozell 3dac49a4f5 Update getCommands.js
Summary:
Fixes issue with path for Windows. cc grabbou
Closes https://github.com/facebook/react-native/pull/9898

Differential Revision: D3864923

fbshipit-source-id: e785bfe0f01f9cf0c1964518fed03e2090300a31
2016-09-14 13:43:47 -07:00
Emil Sjolander a6e1e33a50 Reverted commit D3855801
Summary: Introduce `overflow:scroll` so that scrolling can be implemented without the current overflow:visible hackiness. Currently we use AT_MOST to measure in the cross axis but not in the main axis. This was done to enable scrolling containers where children are not constraint in the main axis by their parent. This caused problems for non-scrolling containers though as it meant that their children cannot be measured correctly in the main axis. Introducing `overflow:scroll` fixes this.

Reviewed By: astreet

Differential Revision: D3855801

fbshipit-source-id: 3c365f9e6ef612fd9d9caaaa8c650e9702176e77
2016-09-14 11:28:34 -07:00
Andy Street 2cf2fdbc04 Update ScrollView ctor's to take a ReactContext
Reviewed By: lexs

Differential Revision: D3863966

fbshipit-source-id: 8580f65663c58552304cfd6043794eae0190757d
2016-09-14 11:13:52 -07:00
David Aurelio 24736d1188 module graph
Summary:
This piece of code can assemble all transitive dependencies of a set of entry modules. It is supposed to replace `ResolutionRequest.getOrderedDependencies`.

It has the following advantages:
- has minimal API surface to other components of the system (uses two functions, exposes one function)
- allows to separate concerns into loading + transforming files, resolving dependencies, gathering all modules belonging to a bundle (this code), and bundling
- allows to specify multiple entry points
- allows to use any kind of dependency ID as entry point (haste IDs, node module IDs, relative paths, absolute paths – depends on the resolver)
- allows to skip files, which allows callers to incrementally update previously retrieved collections of modules

Reviewed By: cpojer

Differential Revision: D3627346

fbshipit-source-id: 84b7aa693ca6e89ba3c1ab2af9a004e2e0aaed3d
2016-09-14 10:28:34 -07:00
Emil Sjolander 1f9c9ecb4b BREAKING - Fix unconstraint sizing in main axis
Summary: Introduce `overflow:scroll` so that scrolling can be implemented without the current overflow:visible hackiness. Currently we use AT_MOST to measure in the cross axis but not in the main axis. This was done to enable scrolling containers where children are not constraint in the main axis by their parent. This caused problems for non-scrolling containers though as it meant that their children cannot be measured correctly in the main axis. Introducing `overflow:scroll` fixes this.

Reviewed By: astreet

Differential Revision: D3855801

fbshipit-source-id: 6077b0bcb68fe5ddd4aa22926acab40ff4d83949
2016-09-14 09:14:02 -07:00
Emil Sjolander 8eee79b5d1 Remove legacy test suite
Reviewed By: lucasr

Differential Revision: D3863095

fbshipit-source-id: a2c4f87cd2263b4cc1fcdec4f2a0964f0696472f
2016-09-14 08:58:35 -07:00
David Aurelio cacc31d759 Calculate asset hash from file contents, cache hashes
Summary: This makes the `hash` property of asset data depend on asset file contents rather than modification time of files. That means that bundles will be consistent across different checkouts.

Reviewed By: martinbigio

Differential Revision: D3856815

fbshipit-source-id: 8bfea4e0a714f48fc6a4ae5ed2a1426dc8d5868e
2016-09-14 04:28:46 -07:00
Satyajit Sahoo 3e153b2a5b Remove react-native.js.flow
Summary:
We've enabled getters in .flowconfig, so Flow will now understand react-native.js. We no longer need to maintain a separate file for Flow.

cc bestander
Closes https://github.com/facebook/react-native/pull/9892

Differential Revision: D3862560

Pulled By: bestander

fbshipit-source-id: 9efb66bc885dbac80c18b4b5e3cf5362495928a9
2016-09-14 02:58:40 -07:00
Damien f4e3e19f8c Add shorcuts for windows & linux to debugger.html
Summary:
Very simple PR to add the shorcuts for windows/linux to the web debuger interface so it's less mac-centric.

**Test plan**: Open the debugger and see the shorcuts for windows/linux/mac
Closes https://github.com/facebook/react-native/pull/9812

Differential Revision: D3862570

fbshipit-source-id: 54605af66b674d176b3cbbb9efcfa93f84fcd552
2016-09-14 02:58:40 -07:00
Janic Duplessis f3253c0f84 Fix UIExplorer search bar look on Android
Summary:
Remove the underline color of the TextInput so the search input looks the same as iOS. Also add a missing type import.

Before
![image](https://cloud.githubusercontent.com/assets/2677334/18487095/e91b8066-79c1-11e6-82c8-adb3f86bc278.png)

After:
![image](https://cloud.githubusercontent.com/assets/2677334/18487043/b457987e-79c1-11e6-9393-e98d78556ef2.png)
Closes https://github.com/facebook/react-native/pull/9889

Differential Revision: D3858957

fbshipit-source-id: 322fd391ef055c742f5dd8f324a9b45965eb278f
2016-09-13 17:28:34 -07:00
Andrew Y. Chen df83f05737 Remove ReactRootView's MeasureSpec assertion
Reviewed By: AaaChiuuu

Differential Revision: D3854737

fbshipit-source-id: d72975e49875049ed4411258e9a449b394ca7ece
2016-09-13 09:43:37 -07:00
Aaron Chiu 6f75591620 clean up
Reviewed By: andreicoman11

Differential Revision: D3855861

fbshipit-source-id: 810d1ea4e6a64231356a4b6953f97de2f54d2558
2016-09-13 08:13:39 -07:00
Pieter De Baets d6926c5468 Allow precreated JSC executor init without applicationScript
Reviewed By: mmmulani

Differential Revision: D3836643

fbshipit-source-id: 18937ef5b39ebe3b3fd743490f86e40ffa6ee015
2016-09-13 06:43:40 -07:00
Andy Street e2cf37a5a6 Breaking: Move ReactClippingViewGroup + Helper to uimanager package
Summary: This is to be able to depend on ReactClippingViewGroup from BaseViewManager. Devs using ReactClippingViewGroup may need to update their imports when updating past this commit.

Reviewed By: lexs

Differential Revision: D3835328

fbshipit-source-id: 290c08b130d837e553b68a90377bd9a30b7ec6dc
2016-09-13 06:13:40 -07:00
Aaron Chiu a4916b8c98 add a way to enable / disable lazy native modules
Reviewed By: lexs

Differential Revision: D3849947

fbshipit-source-id: 0a4a1cd5b9f165269a53b69de46c9cc1939d9d08
2016-09-13 04:43:34 -07:00
Andrei Coman 82c8c97898 Support orientation change on modals
Summary:
This automatically changes the size of the modal by listening to dialog size changes and propagating
those changes through UIManager.

In detail: I've looked into three ways of doing this:

1. Send `onSizeChanged` events/info from the View to the CSSNode directly. This is kinda hacky because you would need to hold a reference to the CSSNode somewhere, either in the View or in the ViewManager. But then you'll have to take care of the lifecycle of the CSSNode, so that you don't update it after it has been dismissed. Not great.
2. The version we went for, is to just update the size of the corresponding CSSNode in the same way we do it for root nodes: we inform the UIManager that the size of the root node has changed, and it will propagate that change, triggering a `dispatchViewUpdates` if none is underway, so that the layout is updated.
3. The other solution we thought of is to treat the Modal as a root view. This would mean rendering an application with the tag of the Modal as the root of the application. That tag would be received by calling some method into UIManager and ReactModalHostManager to create a new RootView, create a Dialog and plop the root view in it. The idea was to maintain the JS API that we now have, but make the implementation more correct (ie. since both RootView and the Modal must deal with touch handling), and could have other benefits (ie. no hacks necessary for making the inspector work on top of modals). However, the change is not trivial and I don't know just how much code would have to be changed to make this work correctly. We might revisit this at a later stage, after we've done more work on having several root views at the same time in the app.

Reviewed By: foghina

Differential Revision: D3841379

fbshipit-source-id: f5e363e27041b785cf44eb59da04bc789306ddb9
2016-09-13 04:28:52 -07:00
David Aurelio 178407da40 add missing method invocation
Reviewed By: bestander

Differential Revision: D3853357

fbshipit-source-id: 0c10b4162438aa8d670522dd1fe5392eb1e6d62f
2016-09-13 03:13:30 -07:00
Spike Brehm 157febcd54 Point to airbnb/react-native-maps
Summary:
We've moved https://github.com/lelandrichardson/react-native-maps to
https://github.com/airbnb/react-native-maps. Update the docs to reflect
the change.

to: lelandrichardson
Closes https://github.com/facebook/react-native/pull/9873

Differential Revision: D3855581

fbshipit-source-id: b4a2dd3a9125878694e9b7a7aecdc4c90961a185
2016-09-13 01:13:45 -07:00
zimeng 228abd4ff5 Add 手机百度 to the showcase page
Summary: Closes https://github.com/facebook/react-native/pull/9845

Differential Revision: D3854942

Pulled By: lacker

fbshipit-source-id: 26f6f9b362324383b9a1b7ac93c5d4eacff98817
2016-09-12 20:43:35 -07:00
Chris Hopman 77e533cb9f Fix value.cpp tests and add tests for bad utf8/16
Reviewed By: mhorowitz

Differential Revision: D3699086

fbshipit-source-id: f8e4628a324602c786d6dfeb8f55736f9fc757cd
2016-09-12 16:43:36 -07:00
Chris Hopman c507a05f70 Use c++1y for cxxreact
Reviewed By: mhorowitz

Differential Revision: D3852279

fbshipit-source-id: a7b80170d6b86428db47c15bbf02d68d293112fc
2016-09-12 16:43:36 -07:00
Philipp von Weitershausen 111ed8d180 Allow rn-cli.config.js to specify the default transformer, again
Summary:
Restores feature introduced in #7961 after it's been paved partially by #7899

**Test Plan:** ran example in https://github.com/philikon/ReactNativify against a React Native with and without this patch
Closes https://github.com/facebook/react-native/pull/9799

Differential Revision: D3852601

Pulled By: mkonicek

fbshipit-source-id: fc3c80bdb254145fefa870eea1828b4ef33f9297
2016-09-12 15:14:01 -07:00
Philipp von Weitershausen 4ab455b37d packager: dedupe symlinks if they point to already covered paths
Summary:
If the packager is already watching `/path/to/MyProject`, and it finds symlinks inside `/path/to/MyProject/node_modules` that point to `/path/to/MyProject/path/to/somewhere/else`, there's no need to add the latter to the project roots.

**Test Plan:** replicate an aforementioned project set-up, and verify that only `/path/to/MyProject` is a project root for the packager, while files in `/path/to/MyProject/path/to/somewhere/else` can still be imported so long as they're part of an npm-style package (e.g. `/path/to/MyProject/path/to/somewhere/else/package.json` exists).
Closes https://github.com/facebook/react-native/pull/9819

Differential Revision: D3852591

Pulled By: mkonicek

fbshipit-source-id: 558ab3f835ee3d2bf6174c31595e242992f75601
2016-09-12 15:14:01 -07:00
Yann Pringault d14eb2e38d Fix release Github link on website for latest RC version
Summary:
Each RC created ends with `rc.0` so the link on the website is broken. This PR fix this.

https://facebook.github.io/react-native/versions.html

But maybe it's the RC tag that is wrong and should be fixed instead of the website link.
Closes https://github.com/facebook/react-native/pull/9857

Differential Revision: D3852046

fbshipit-source-id: 122feaf81396c492c558eefe657915127eee7ffe
2016-09-12 14:13:49 -07:00
Jing Chen 2c0d44a902 Reverted commit D3841557
Reviewed By: davidaurelio

Differential Revision: D3841557

fbshipit-source-id: c6098f0d85aa5c56b4109cd4f1ffe622379ab457
2016-09-12 13:58:33 -07:00
Eric Sauter 5f7b2e4085 Update fixt logo in showcase
Summary:
At Fixt, we recently changed our logo. We would really appreciate it if the updated version was posted in the Showcase. Thanks!
Closes https://github.com/facebook/react-native/pull/9861

Differential Revision: D3851839

Pulled By: lacker

fbshipit-source-id: 2a9eca28635087139237c345e11344d7aa74672b
2016-09-12 13:43:51 -07:00
Charles Dick 2bd5b0b440 use babel sourcemaps in bundle server
Reviewed By: davidaurelio

Differential Revision: D3841557

fbshipit-source-id: a6d40cf224ba7c2fd0a8eb0f0e2f7cc4bf222bcb
2016-09-12 09:28:42 -07:00
Gant db870f8729 Adjust rnpm link to colorize skipped linking steps
Summary:
Sometimes when working with a team of developers, someone adds a library but does not link it. To identify if this required linking, you have to type react-native link and then read a wall of text to see if rnpm handled the issue. This can be sped up with a friendly logging level for previously linked messages.

Continuation of #9507

![image](https://cloud.githubusercontent.com/assets/997157/17908676/119884a2-6947-11e6-8297-818fefed26a0.png)

![image](https://cloud.githubusercontent.com/assets/997157/17908687/1bad1b56-6947-11e6-9cf5-b8eec1f2d6ef.png)
Closes https://github.com/facebook/react-native/pull/9551

Differential Revision: D3821468

Pulled By: bestander

fbshipit-source-id: 3e83bf46454519debdd95cf3d5e8561e3c77364a
2016-09-12 06:28:44 -07:00
Aaron Chiu 406a1b3ca2 move com.facebook.react.Lifecycle to com.facebook.react.common.Lifecycle
Reviewed By: lexs

Differential Revision: D3849487

fbshipit-source-id: 3f21969e092ccef9cad610ae86198de41b2f6552
2016-09-12 05:58:56 -07:00
Andrei Coman c79f617742 Fix Text incorrect line height
Summary:
Setting the line height with the help of Android-provided StaticLayout is incorrect. A
simple example app will display the following when `setLineSpacing(50.f, 0.f)`
is set: {F62987699}. You'll notice that the height of the first line is a few
pixels shorter than the other lines.
So we use a custom LineHeightSpan instead, which needs to be applied to the text
itself, and no height-related attributes need to be set on the TextView itself.

Reviewed By: lexs

Differential Revision: D3841658

fbshipit-source-id: 7257df4f1b2ce037554c7a7a5ca8f547a2056939
2016-09-12 05:13:43 -07:00
Felix Oghina 16bdbee165 Actually close packager websocket connection when destroying instance
Summary:
This is just D3835023 again since it got reverted, plus the fix from D3841918 baked in. Here's the old summary:

We never actually closed the websocket connection. Furthermore, upon calling `closeQuietly()`, `onClose()` is called, which does `reconnect()`. This results in ReactInstanceManager leaking after calling `destroy()` and nullifying all references to it.

To fix this I made sure `closeQuietly()` actually closes the connection for good, and made sure we actually call it when destroying an instance.

Reviewed By: AaaChiuuu

Differential Revision: D3849353

fbshipit-source-id: e1ce5e2d5840bfbd42a13043c3cc8c617e9fa64a
2016-09-12 03:59:03 -07:00
Charles Dick 84ce9d9aea add module categorization to jsc heap capture visualization
Reviewed By: bnham

Differential Revision: D3757536

fbshipit-source-id: 87e5d605f7490b00bde741dc5dc7a68428a25b50
2016-09-12 03:13:44 -07:00
Hugo Dozois 38354c4cbf Add: expose hot & live reload, remote debug, profiling
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?

- Being able to call these from JS is really useful in envs where action sheets are not available (eg: App Extensions). I made the functions act as explicit toggles, this way it's easy to set the wanted behavior.

**Test plan (required)**
- I tested the functions manually.

![Remote debug from an iMessage Application](https://cloud.githubusercontent.com/assets/4422516/17445198/976ebfe0-5af8-11e6-885f-1b40f9518aab.png)
Closes https://github.com/facebook/react-native/pull/9242

Differential Revision: D3749568

fbshipit-source-id: 2cea1d609dc792aec73d4bcf1eae07575725b4b7
2016-09-12 02:58:56 -07:00
William Liu 027a2706d2 Backed out changeset 31811805dd97
Reviewed By: hallucinogen

Differential Revision: D3847504

fbshipit-source-id: a84eae70568f3a4a50cb6fcaf5c6f5772270d4f2
2016-09-11 01:28:39 -07:00