Commit Graph

30 Commits

Author SHA1 Message Date
David Aurelio 54b6b92520 Un-blacklist fbjs
Summary: Blacklisting is no longer necessary, as fbjs is not used for haste module resolution any longer

Reviewed By: yungsters

Differential Revision: D3014257

fb-gh-sync-id: 39a0397e6b07bdff3dba9d48d58f4254c43eb6b6
shipit-source-id: 39a0397e6b07bdff3dba9d48d58f4254c43eb6b6
2016-03-04 17:05:40 -08:00
David Aurelio 2708df49e3 Use `invariant` from fbjs everywhere
Reviewed By: yungsters

Differential Revision: D3002422

fb-gh-sync-id: c7d308e6cfc717726dbbc43a2462fdabb052b2fe
shipit-source-id: c7d308e6cfc717726dbbc43a2462fdabb052b2fe
2016-03-02 17:14:30 -08:00
David Aurelio c331d113dc Fix breakages caused by switch to fbjs
Summary: This fixes a couple of breakages introduced by the switch to fbjs

Reviewed By: bestander

Differential Revision: D3000078

fb-gh-sync-id: 2971d049030f754d5001f6729716373a64078ddf
shipit-source-id: 2971d049030f754d5001f6729716373a64078ddf
2016-03-02 08:26:33 -08:00
David Aurelio ad8a335864 Remove knowledge of fbjs from the packager
Summary:Follow-up to https://github.com/facebook/react-native/pull/5084

This…
- changes all requires within RN to `require('fbjs/lib/…')`
- updates `.flowconfig`
- updates `packager/blacklist.js`
- adapts tests
- removes things from `Libraries/vendor/{core,emitter}` that are also in fbjs
- removes knowledge of `fbjs` from the packager

Closes https://github.com/facebook/react-native/pull/5084

Reviewed By: bestander

Differential Revision: D2926835

fb-gh-sync-id: 2095e22b2f38e032599d1f2601722b3560e8b6e9
shipit-source-id: 2095e22b2f38e032599d1f2601722b3560e8b6e9
2016-03-02 04:28:38 -08:00
Adam Miskiewicz 28116ec3db Reverted commit D2803288
Summary:
As spicyj mentioned in commit 6a838a4, the ideal state of affairs when it comes to consuming `react` and `fbjs` from NPM is for the packager not to have knowledge of either package. This PR addresses the `fbjs` part of that, and relies on https://github.com/facebook/fbjs/pull/95. **DO NOT MERGE** until #95 (or a variation) is in `fbjs` and is released to npm.

This PR does several things:

1. Adds stub modules within RN that expose `fbjs` modules to be required using Haste. After discussing a few ideas with spicyj, this seemed like a good option to keep internal FB devs happy (and not make them change the way they write JS), but allow for removing packager complexity and fit in better with the NPM ecosystem. Note -- it skips stubbing `fetch`, `ExecutionEnvironment`, and `ErrorUtils`, due to the fact that these need to have Native specific implementations, and there's no reason for those implementations to exist in `fbjs`.
2. Removes the modules that were previously being used in lieu of their `fbjs` eq
Closes https://github.com/facebook/react-native/pull/5084

Reviewed By: bestander

Differential Revision: D2803288

Pulled By: javache

fb-gh-sync-id: 121ae811ce4cc30e6ea79246f85a1e4f65648ce1
shipit-source-id: 121ae811ce4cc30e6ea79246f85a1e4f65648ce1
2016-02-11 02:45:34 -08:00
Adam Miskiewicz 98e5e2b427 Remove knowledge of fbjs from the packager
Summary:
As spicyj mentioned in commit 6a838a4, the ideal state of affairs when it comes to consuming `react` and `fbjs` from NPM is for the packager not to have knowledge of either package. This PR addresses the `fbjs` part of that, and relies on https://github.com/facebook/fbjs/pull/95. **DO NOT MERGE** until #95 (or a variation) is in `fbjs` and is released to npm.

This PR does several things:

1. Adds stub modules within RN that expose `fbjs` modules to be required using Haste. After discussing a few ideas with spicyj, this seemed like a good option to keep internal FB devs happy (and not make them change the way they write JS), but allow for removing packager complexity and fit in better with the NPM ecosystem. Note -- it skips stubbing `fetch`, `ExecutionEnvironment`, and `ErrorUtils`, due to the fact that these need to have Native specific implementations, and there's no reason for those implementations to exist in `fbjs`.
2. Removes the modules that were previously being used in lieu of their `fbjs` eq
Closes https://github.com/facebook/react-native/pull/5084

Reviewed By: bestander

Differential Revision: D2803288

Pulled By: davidaurelio

fb-gh-sync-id: fd257958ee2f8696eebe9048c1e7628c168bf4a2
shipit-source-id: fd257958ee2f8696eebe9048c1e7628c168bf4a2
2016-02-11 02:21:37 -08:00
Jan Kassens 80e1ca870b move Relay sources to unsigned directory
Reviewed By: yungsters

Differential Revision: D2887448

fb-gh-sync-id: 53e71be7fa875b3495991f2bf941c5eeb6ae1534
2016-02-01 20:12:19 -08:00
Jan Kassens 1bc03871f3 remove ReactDOM from Jest blacklist
Reviewed By: yungsters, spicyj

Differential Revision: D2875010

fb-gh-sync-id: d316d5befd0d978bded99f70b814dc133c85b40f
2016-01-29 18:18:33 -08:00
Christoph Pojer b84ad2ab0d Updates for haste2 inside of jest
Summary:
I'm working on deploying haste2 with jest. This updates all the files that require changes for this to work and they are backwards compatible with the current version of jest.

* package.json was just outdated. I think haste1's liberal handling with collisions made this a "non-issue"
* env.js didn't properly set up ErrorUtils, also unsure why that isn't a problem in jest right now already?
* some things were mocking things they shouldn't
* Because of the regex that matches against providesModule and System.import, it isn't possible to list module names more than once. We have multiple tests reusing the same providesModule ids and using System.import with modules that only exist virtually within that test. Splitting up the strings makes the regexes work (we do the same kind of splitting on www sometimes if we need to) and using different providesModule names in different test files fixes the problem. I think the BundlesLayoutIntegration-test is going to be deleted, so this doesn't even matter.

public

Reviewed By: voideanvalue

Differential Revision: D2809681

fb-gh-sync-id: 8fe6ed8b5a1be28ba141e9001de143e502693281
2016-01-08 06:52:29 -08:00
Janic Duplessis 2d50ac359c Fix issues running the website locally on windows with npm3 2016-01-02 03:56:32 -05:00
Ben Alpert 6a838a4201 Consume react, fbjs from npm
Summary:
We don't (yet) treat these the same as any other modules because we still have special resolution rules for them in the packager allowing the use of `providesModule`, but I believe this allows people to use npm react in their RN projects and not have duplicate copies of React. Fixes facebook/react-native#2985.

This relies on fbjs 0.6, which includes `.flow` files alongside the `.js` files to allow them to be typechecked without additional configuration. This also uses react 0.14.5, which shims a couple of files (as `.native.js`) to avoid DOM-specific bits. Once we fix these in React, we will use the same code on web and native. Hopefully we can also remove the packager support I'm adding here for `.native.js`.

This diff is not the desired end state for us – ideally the packager would know nothing of react or fbjs, and we'll get there eventually by not relying on `providesModule` in order to load react and fbjs modules. (fbjs change posted here but not merged yet: https://github.com/facebook/fbjs/pull/84.)

This should also allow relay to work seamlessly with RN, but I haven't verified this.

public

Reviewed By: sebmarkbage

Differential Revision: D2786197

fb-gh-sync-id: ff50f28445e949edc9501f4b599df7970813870d
2015-12-30 11:41:09 -08:00
Tim Yung 8457a46e43 RN: Install Updated `fbjs` Downstream
Reviewed By: cpojer

Differential Revision: D2754195

fb-gh-sync-id: 67b628fdfa34da379ab5fdad03b1baaf767c7f21
2015-12-16 01:49:15 -08:00
Ben Alpert 2db10e3e72 Fix open source
Summary: Unfortunately ReactTestUtils requires ReactDOM (for renderIntoDocument), and ReactTestUtils is required by ReactNative. This worked internally because we already shimmed ReactDOM for Relay; now we shim it externally too, at least until we figure out a better solution for this in React.

public

Reviewed By: vjeux

Differential Revision: D2629811

fb-gh-sync-id: 94aac2c4eda39d039fdcedd88295e7afb0f5c5b2
2015-11-07 11:41:20 -08:00
Ben Alpert bbee3c6f60 Update core libraries for React 0.14 final
Summary: All minor changes since we were already on the beta: most notable is that destructors are required in pooling to help prevent memory leaks.

public

Reviewed By: sebmarkbage

Differential Revision: D2608692

fb-gh-sync-id: acdad38768f7f48c0f0e7e44cbff6f0db316f4ca
2015-11-06 19:52:34 -08:00
Martín Bigio dee96fbedc Update blacklist.js
Summary: Since we rely on a non npm version of `react-tools` which includes docs and other unnecessary files we need to make sure we blacklist some of them as otherwise the packager fails
Closes https://github.com/facebook/react-native/pull/3616

Reviewed By: svcscm

Differential Revision: D2572024

Pulled By: mkonicek

fb-gh-sync-id: 2082cd69e2ccddb275dfdc7db107d4ed6b826bbb
2015-10-22 14:20:26 -07:00
Amjad Masad 0ad05043f5 Fix more name collisions
Summary: @​public
Add more duplicate files to the blacklist.

Reviewed By: @vjeux

Differential Revision: D2493066
2015-09-29 22:01:21 -07:00
Christopher Chedeau 76846f7e33 Remove all the duplicate module warnings
Summary: @​public

@amasad added a warning when there are two @​providesModule with the same name. This removes all those warnings by blacklisting the internal version of those files. Once we get of the big react-tools/ hack, we'll be able to remove all those :)

Reviewed By: @amasad

Differential Revision: D2482521
2015-09-25 19:24:24 -07:00
Martin Konicek f1cf322c9e Fix blacklist
Reviewed By: @amasad

Differential Revision: D2432196
2015-09-11 17:01:43 -07:00
Ben Alpert e0ea046092 [ReactNative] Fix ResponderEventPlugin after React upgrade 2015-07-29 02:47:55 -08:00
Ben Alpert e01f90784f [ReactNative] Update core RN modules to work with React 0.14-beta1 2015-07-23 18:07:59 -08:00
Joe Wood 19e32399b0 [Packager] Windows support for Packager - Blacklist changes
Summary:
Another Pull Request implementing the changes in issue #468 - Enabled Packager to run on Windows
This change relates to the blacklist fixes. It includes the path conversion for blacklist and changes to the default watched directory.  It has no impact on Mac OSX.
Closes https://github.com/facebook/react-native/pull/893
Github Author: Joe Wood <joewood>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-06-26 16:27:12 -08:00
Amjad Masad de020b44c9 [react-packager] Enable watchman fs crawl
Summary:
@public
Now that watchman perf issue was fixed we can enable watchman-based fs crawling which is faster than node.
This showed an existing issue with some files missing from the blacklist which I addressed.

Test Plan:
./fbrnios.sh run
click around and scroll all the apps
2015-06-26 16:20:50 -08:00
Amjad Masad 2d4055e513 [react-packager] Rewrite dependency graph (support node_modules, speed, fix bugs etc)
Summary:
@public
Fixes #773, #1055
The resolver was getting a bit unwieldy because a lot has changed since the initial writing (porting node-haste).
This also splits up a large complex file into the following:

* Makes use of classes: Module, AssetModule, Package, and AssetModule_DEPRECATED (`image!` modules)
* DependencyGraph is lazy for everything that isn't haste modules and packages (need to read ahead of time)
* Lazy makes it fast, easier to reason about, and easier to add new loaders
* Has a centralized filesystem wrapper: fast-fs (ffs)
* ffs is async and lazy for any read operation and sync for directory/file lookup which makes it fast
* we can easily drop in different adapters for ffs to be able to build up the tree: watchman, git ls-files, etc
* use es6 for classes and easier to read promise-based code

Follow up diffs will include:
* Using new types (Module, AssetModule etc) in the rest of the codebase (currently we convert to plain object which is a bit of a hack)
* using watchman to build up the fs
* some caching at the object creation level (we are recreating Modules and Packages many times, we can cache them)
* A plugin system for loaders (e.g. @tadeuzagallo wants to add a native module loader)

Test Plan:
* ./runJestTests.sh react-packager
* ./runJestTests.sh PackagerIntegration
* Export open source and run the e2e test
* reset cache
* ./fbrnios.sh run and click around
2015-06-19 18:05:18 -08:00
Philipp von Weitershausen 62d7cd643d [ReactNative] allow running JS app server for Android from fbobjc 2015-04-14 10:28:07 -08:00
Christopher Chedeau f67a36733f [ReactNative] Expanded license on js packager files 2015-03-23 11:28:51 -08:00
Amjad Masad a6b154332b [react-packager] Pick up package changes while running 2015-03-23 11:15:52 -08:00
Christopher Chedeau 8694330d42 [ReactNative] Add website to blacklist 2015-03-15 19:24:56 -08:00
Amjad Masad eabe9f43c8 [react-packager] package.json cleanup (seperate packager into it's own package) 2015-03-11 17:42:46 -08:00
Ben Alpert b335f88efd [React Native] Update core modules for React 0.13 2015-03-06 17:12:53 -08:00
Spencer Ahrens efae175a8e [react-packager][streamline oss] Move open sourced JS source to react-native-github 2015-02-19 21:25:11 -08:00