Summary: Modified `node-haste` implementation to use the much faster `jest-haste-map` under the hood. The underlying `fastfs` now gets passed the entire file list from the `jest-haste-map` rather than crawl the filesystem.
Reviewed By: cpojer
Differential Revision: D3724387
fbshipit-source-id: 447d58ea0edf283662ec23d1e2deee992cf8d240
Summary: The newer versions of `source-map` fixed some bugs related to decoding mappings.
Reviewed By: bestander
Differential Revision: D3923727
fbshipit-source-id: cc1c87bbadeb128316965823d81ef5ca46a6845c
Summary:
**Motivation**
This is originally a follow up of PR #6327 by dewe and jeremyong
And mkonicek indicated this should split into a separate PR.
Now philikon takes over #6327 as #6961
**Test Plan:**
According to #6961 and #6889
Load WebSocketExample in UIExplorer app and start websocket test server script and test sending binary data on both iOS and Android
Closes https://github.com/facebook/react-native/pull/6937
Reviewed By: javache
Differential Revision: D3669596
Pulled By: mkonicek
fbshipit-source-id: 342e29eb34de882bcbd9f297aab71dd6bb236748
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
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
Summary:
Adding jest and its presets to the react-native init command
**Test plan (required)**
run react-native init foo (using `npm link` to use the local `react-native` version)
inside foo there are now a .babelrc file and the package.json is set up as described by
https://facebook.github.io/jest/docs/tutorial-react-native.html#setup
Closes https://github.com/facebook/react-native/pull/9719
Differential Revision: D3843037
Pulled By: bestander
fbshipit-source-id: 004e27ebd3f257a202ed43f378d6fe6cc23ced52
Summary:
Currently we just try to resolve a rn-cli.config.js file by walking up the tree from node_modules/react-native. In non-standard uses of RN, when your copy of RN may not live within node_modules, it's impossible to use rn-cli.config.js. This PR adds a "config" flag to the cli that let's you pass in a path to rn-cli.config.js.
cc ide
Closes https://github.com/facebook/react-native/pull/7883
Differential Revision: D3382823
Pulled By: bestander
fbshipit-source-id: b946f3bb355050fc2fe99273d0e99e441dbed111
Summary:
React 15.3.0 was officially released. We especially should try not depend on RCs in RN releases and npm doesn't handle RC versions well.
Closes https://github.com/facebook/react-native/pull/9279
Differential Revision: D3683587
fbshipit-source-id: fc4f8a030769232b7697434a419e1e07e482e308
Summary:
This is an initial step of rewriting the CLI interface to use `rnpm` one (commander, plugins etc.).
It's scope is to move all existing commands to use rnpm CLI interface, so that we get plugins, flags and our existing ecosystem working out of the box.
<s>This is still WIP and some of the commands are left commented out.</s>
For the `config` of `rnpm` (functions get info about project and dependency), <s>I am thinking we can merge them with</s> we decided to merge it with [`default.config.js`](e57683e420/local-cli/default.config.js (L33)), so they are available on the `new Config()` [instance](e57683e420/local-cli/cliEntry.js (L59)) (which means we don't have to change anything and current plugins, like runIOS and runAndroid can just start using it [w/o depending on any extra argument](https://github.com/grabbou/react-native/blob/e57683e420210749a5a6b802b4e
Closes https://github.com/facebook/react-native/pull/7899
Differential Revision: D3613193
Pulled By: bestander
fbshipit-source-id: 09a072f3b21e5239dfcd8da88a205bd28dc5d037
Summary:
Since jest stopped using node-haste a while ago, we are the only client left.
This brings back node-haste back to fbsource to allow us to iterate faster.
Reviewed By: bestander
Differential Revision: D3641341
fbshipit-source-id: a859f8834765723a3515e2cf265581b9dd83997c
Summary:
There were several fixes to how calls to propType checkers. This is to
account for the new deprecation warning - React.PropTypes will not be
part of production builds in the future.
Note: There is still a warning about an invalid argument to `React.PropTypes.oneOf` (React is running that validation sooner now). Specifically [both of these](b1e49832ef/Libraries/Components/Touchable/TouchableWithoutFeedback.js (L44-L45)) because `View.AccessibilityTraits` is actually undefined in tests (didn't look into why you conditionally set that).
**Test plan (required)**
`npm test` & fixed all warnings due to proptype secret
Closes https://github.com/facebook/react-native/pull/8758
Reviewed By: zpao
Differential Revision: D3564288
Pulled By: bestander
fbshipit-source-id: 1ff1f90907f41855e364048aa730ccd239c522b4
Summary:
Installing react-native gives a warning because of outdated version of yeoman-generator. The warning is ```npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue```.
This MR will update the yeoman-generator version to 0.21.0 to resolve this warning.
Closes https://github.com/facebook/react-native/pull/8859
Reviewed By: matryoshcow
Differential Revision: D3580087
Pulled By: bestander
fbshipit-source-id: 4daddd804679ab8e95e59cf0d0005f87d2f48e1c
Summary:
This PR solves a problem when video assets are used from third-party React Native components (e.g. [react-native-video](https://github.com/brentvatne/react-native-video). The video will not work while the assets are served from the react native packager because the used video component (iOS) relies on HTTP range requests.
I added a small fix that allows ranged requests (e.g. mp4) to be served in ranges.
To test this:
1. make new react native project
1. add [react-native-video](https://github.com/brentvatne/react-native-video) to xcode project
1. add video component to your project
```
import Video from 'react-native-video';
var resolveAssetSource = require('react-native/Libraries/Image/resolveAssetSource');
/* ... /*
render() {
let source = resolveAssetSource(require('./someVideoFile.mp4')) || {};
return <Video /*....*/ source={source} />;
}
```
That should not work (if video is smaller than a few megabytes, open app a few times). Then add my fix, that should do the trick.
Closes https://github.com/facebook/react-native/pull/8219
Reviewed By: davidaurelio
Differential Revision: D3542485
Pulled By: frantic
fbshipit-source-id: e4f2e4d3aaafa8445e965259bf04ad107dba8a4f
Summary: This removes `node_modules/react` from the list of directories that are used for haste module resolutions. Modules required from React are now imported with `require('react/lib/…')`.
Reviewed By: astreet
Differential Revision: D3509863
fbshipit-source-id: 32cd34e2b8496f0a6676dbe6bb1eacc18124c01e
Summary: This should have literally no changes from the RC that affect RN -- just a version bump.
Reviewed By: vjeux
Differential Revision: D3511116
fbshipit-source-id: 5bb3a330c0d2e78a2f3dfbb0e948c99607d2e66e
Summary:
Notable changes (excluding DOM-only things):
- Improved warning messages for propTypes and key warnings
- Production error codes
- Improved performance in DEV mode
- More accurate data in ReactPerf instrumentation
- Experimental JSON test renderer
- Minor bug fixes
Full changelog: fef495942a...c66f40f749.
Reviewed By: AaaChiuuu
Differential Revision: D3442002
fbshipit-source-id: 940fc65ba5d0b742417bbe2fcbd36eb9dc7443e1
Summary:
React has some internal code related only to React Native.
Some times React needs to update them which will result in a breaking change for React Native but it would not be a breaking change for React public API, so no major version bump will happen.
It means that a non breaking API bump may result in a break for React Native.
That is why React Native should not depend on a ^ of React version.
However React is a peer dependency to React Native and we want to give some flexibility to users to update React independently, so we don't fix the version strict and use ~ to allow patches.
This will be fixed once we extract RN specific code from React into an independent dependency.
Reviewed By: avaly
Differential Revision: D3398202
fbshipit-source-id: cca520f4b80c9ed5ae6fb1444f3d0bf7ffb9c9dd