Commit Graph

916 Commits

Author SHA1 Message Date
Christoph Pojer 7e89bb9920 Use `debug` instead of `console.warn`
Reviewed By: voideanvalue

Differential Revision: D2636111

fb-gh-sync-id: d21ec56045461353317348c4da14c92be8015bd3
2015-11-10 02:30:34 -08:00
Christoph Pojer a724cfde2d Defualts for platforms and assetExts
Reviewed By: voideanvalue

Differential Revision: D2635446

fb-gh-sync-id: 57e628cf5f917c7e2511d0c8bde696310ab0fc7a
2015-11-09 19:48:29 -08:00
Bhuwan Khattar 839de43d3a Don't special case performanceNow
Summary: The previous version of `performanceNow` used to reassign to a `require(...)` alias, which our inline requires transform guarded against. Before the update to React 0.14, we were pulling `performanceNow` from a hardcoded `react-tools` version (b4e74e38e4/src/shared/vendor/performance/performanceNow.js), so we couldn't just fix the file and had to special case it. Now that we've updated to React 0.14, `performanceNow` is pulled from fbjs and no longer needs to be special cased.

public

Reviewed By: cpojer

Differential Revision: D2634940

fb-gh-sync-id: 7085cde3179c04f9ecfd87bdd472b19e370ee73c
2015-11-09 18:31:29 -08:00
James Ide 9d88303586 Source nvm.sh (best effort) when running react-native-xcode.sh
Summary: When Node is installed with nvm, scripts invoked from Xcode need to set up nvm. This can be done either by sourcing .profile/.bash_profile/.bashrc/etc... or by sourcing nvm.sh directly -- this diff does the latter and handles the case where nvm may have been installed the official way (under ~/.nvm/nvm.sh AFAIK) or via homebrew.
Closes https://github.com/facebook/react-native/pull/4015

Reviewed By: svcscm

Differential Revision: D2633301

Pulled By: frantic

fb-gh-sync-id: 3c2b9b0d21887ba21d6f85f5d279314d50c1db28
2015-11-09 16:42:30 -08:00
Christoph Pojer 391e4c8236 Inline cache mock for DependencyGraph-test
Reviewed By: davidaurelio

Differential Revision: D2629211

fb-gh-sync-id: ade0bf4e486b58ecbc9a29eb3bdb61286eebb3d5
2015-11-09 13:34:55 -08:00
Christoph Pojer de981ecccd Use a mock for FileWatcher
Reviewed By: davidaurelio

Differential Revision: D2628885

fb-gh-sync-id: f8b96c483eb7deb52a7ca4897801e2d0ef9e4f4c
2015-11-09 13:34:50 -08:00
Christoph Pojer 8ff93e65d2 Fix lint errors
Reviewed By: davidaurelio

Differential Revision: D2628366

fb-gh-sync-id: 8d849e2deb038842475e66ef641fa1d4f7b78d8f
2015-11-09 13:34:45 -08:00
Christoph Pojer 120bdae3f6 Remove usage of declareOpts
Reviewed By: martinbigio

Differential Revision: D2619798

fb-gh-sync-id: ddc58233c06899017dbb98b3d8258eb0fe61cda3
2015-11-09 13:34:38 -08:00
Christoph Pojer 57fed218a8 Move `getPlatformExtension` and `getAssetDataFromName` into `DependencyResolver`
Reviewed By: martinbigio

Differential Revision: D2619690

fb-gh-sync-id: 04ca68a1fa2dc7b77a49c38ea1515d7afbdee603
2015-11-09 13:34:32 -08:00
Christoph Pojer 0d1a442cff Don't require Activity inside of DependencyResolver
Reviewed By: martinbigio

Differential Revision: D2619364

fb-gh-sync-id: 7947388c8041e5d6cbc1e20c8eb9fc7325dc46e0
2015-11-09 13:33:29 -08:00
Ben Alpert 24bac5ee05 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 1d1006449e 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
Joe Savona ef0b3e9338 Add polyfills to jest setup scripts
Reviewed By: cpojer

Differential Revision: D2627866

fb-gh-sync-id: 6d2c95ebc1fe05da3a90f8f6df3287bdbac870bd
2015-11-06 17:20:35 -08:00
Joe Savona 9373eb73ac Polyfill Array.from
Reviewed By: cpojer

Differential Revision: D2627437

fb-gh-sync-id: 6a7c94e13db772d96cbd8ebab37eccb0826963bc
2015-11-06 14:14:28 -08:00
Pieter De Baets 48a2a5ccc7 Remove log level 'log' from JS
Summary: Log level 'log' from JS should be equivalent to 'info'. Also added knowledge of 'trace' log level in RCTLog.

public

Reviewed By: vjeux

Differential Revision: D2615500

fb-gh-sync-id: 7a02f49bf7953c1a075741c21e984470c44b5551
2015-11-05 12:51:41 -08:00
Frédéric Sagnes 8ecac28100 Set ASCII as the default bundle encoding
Reviewed By: davidaurelio

Differential Revision: D2596387

fb-gh-sync-id: deadb8e9a44bbe7b12ce9e6bb5e3c96d4f646074
2015-11-05 07:31:55 -08:00
Christoph Pojer bc9a3eb159 Remove dependency on underscore
Reviewed By: davidaurelio

Differential Revision: D2614853

fb-gh-sync-id: 706fb0db6852f599a1b3dd022dbc22aabb76539a
2015-11-04 19:02:47 -08:00
Christoph Pojer c731001864 Start pulling DependencyResolver apart
Summary: I'm planning to split up `DependencyResolver` into the react-native specific implementation of it and a new, generic resolver that is going to replace `node-haste` for jest and other places where we might need JS dependency resolution.

The plan is to split the two folders up so that:

* `Resolver` is the folder for all the react-native specific resolver code
* `DependencyResolver` will become a standalone library, eventually moving into a package called `node-haste`.

There is still a lot to be figured out. This is just the first diff of likely many. The current goal is to make `DependencyResolver` standalone to be able to create an instance of a resolver and resolve all dependencies for a file. This is when I can start integrating it more seriously with jest.

This diff simply moves a bunch of things around and turns `HasteModuleResolver` into an ES2015 class ( :) ).

bypass-lint
public

Reviewed By: davidaurelio

Differential Revision: D2614151

fb-gh-sync-id: ff4e434c4747d2fb032d34dc19fb85e0b0c553ac
2015-11-04 16:59:30 -08:00
Christoph Pojer 29befc8d1c Update jest to 0.7.1
Reviewed By: frantic

Differential Revision: D2614935

fb-gh-sync-id: 64cc4fb439f0c53f0eb0588c22e0291813a7e334
2015-11-04 14:42:13 -08:00
Tadeu Zagallo e93b1f8411 Convert System.import transform to babel 6
Reviewed By: martinbigio

Differential Revision: D2615286

fb-gh-sync-id: 4f0e8e3359413d972ab4d0da291870768a77e361
2015-11-04 08:53:26 -08:00
Tadeu Zagallo a0dd08e26c Log minification time
Summary: public

Add an activity to log minification time.

Reviewed By: vjeux

Differential Revision: D2604863

fb-gh-sync-id: cbdf0297f0611c87b589b87928af235f9ba81172
2015-11-03 01:20:26 -08:00
Bhuwan Khattar 02c3c465f8 require InitializeJavaScriptAppEngine in bundle
Reviewed By: martinbigio

Differential Revision: D2582794

fb-gh-sync-id: d6cfdda81f556ef0cefb2e9dc58f5978b651bd5b
2015-10-28 21:09:24 -07:00
Martín Bigio c5c4dc94b1 Infer platform from extension
Summary: public
Aparently this used to work on 0.11, lets fix it :)

Reviewed By: foghina

Differential Revision: D2557719

fb-gh-sync-id: dcbca077431c1356c89dfc55b71eecff64c7ad3d
2015-10-27 17:47:28 -07:00
Martín Bigio abeaa5bc9b Improve error logging when rebuild fails
Summary: public

We're seeing intermittent errors on the packager when rebasing. Since this is very hard to repro lets add more logging to the warning we show just before starting to rebuild the entire haste map again

Reviewed By: frantic

Differential Revision: D2585427

fb-gh-sync-id: fbfa953f6c8ae78cbee2f3ab19ad494b084165c8
2015-10-27 10:33:29 -07:00
Martín Bigio 213c18d221 Move files from `packager/` to `local-cli`
Summary: public

This is not only to put the files on a place where it makes more sense but also to allow to use ES6 features on them as `/packager` is not whitelisted on `babel`.

Reviewed By: mkonicek

Differential Revision: D2577267

fb-gh-sync-id: b69a17c0aad349a3eda987e33d1778d97a8e1549
2015-10-26 15:38:14 -07:00
Christoph Pojer bb7fd5ffa3 Update to 0.6.1
Summary: This version should be more stable and has the `moduleNameMapper` feature that frantic was asking for - I will send a follow-up diff for that. I also fixed an issue with `module.parent` and a module inside of yeoman that thought it was owning the universe.

See https://github.com/facebook/jest/blob/master/CHANGELOG.md#061 for a changelog since 0.5.6.

public

allow-crlf-text

Reviewed By: javache

Differential Revision: D2579041

fb-gh-sync-id: cb918875557f219239f49fc0ad49ac61d0884173
2015-10-26 15:37:23 -07:00
Martin Bigio 3b77b206c3 Fix webSocketProxy.js
Summary: cc mkonicek ide
Closes https://github.com/facebook/react-native/pull/3638

Reviewed By: svcscm

Differential Revision: D2576536

Pulled By: martinbigio

fb-gh-sync-id: 27f53eedf2bd94f71f4e405d3d4bb193eaabc918
2015-10-23 13:58:31 -07:00
Spencer Elliott a0b60b1434 Replace applescript with https://github.com/sindresorhus/opn
Summary: This allows opening the Chrome debugger on OS X, Linux, and Windows, and succeeds the previous PR which used [browser-launcher2](https://github.com/benderjs/browser-launcher2) and included a `--dangerouslyDisableChromeDebuggerWebSecurity` option: https://github.com/facebook/react-native/pull/2406

[opn](https://github.com/sindresorhus/opn) is cross-platform and much simpler than browser-launcher2 (since we don't have to manage the opened Chrome instance; the OS will just use the default instance).
Closes https://github.com/facebook/react-native/pull/3394

Reviewed By: mkonicek

Differential Revision: D2550996

Pulled By: frantic

fb-gh-sync-id: fa4cbe55542562f30f77e0a6ab4bc53980ee13aa
2015-10-23 11:32:35 -07:00
Martín Bigio 05c282f251 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
Martín Bigio a55fc77f82 Fix cli entry points
Reviewed By: frantic

Differential Revision: D2565954

fb-gh-sync-id: 6fde9e1dbefd71944e8f857e9a40619bf599ef75
2015-10-22 10:13:13 -07:00
Alex Kotliarskyi cf61ca9002 Generate bundle and assets when building via Xcode
Summary: This integrates React Native into Xcode's build process, which lets us automatically handle bundling and packaging image assets.

Tested the script via https://github.com/frantic/ReactNativeAssetsExample

Loaded from packager:
<img width="432" alt="screen shot 2015-10-19 at 3 11 12 pm" src="https://cloud.githubusercontent.com/assets/192222/10593447/be5bc7e8-7678-11e5-8c70-ecc2a1ee24fc.png">

Loaded from offline bundle:
<img width="432" alt="screen shot 2015-10-19 at 3 10 58 pm" src="https://cloud.githubusercontent.com/assets/192222/10593448/be5d5194-7678-11e5-8b02-d492a26cfb81.png">

Android:
<img width="639" alt="screen shot 2015-10-19 at 3 11 20 pm" src="https://cloud.githubusercontent.com/assets/192222/10593449/be5de2d0-7678-11e5-8d3c-0378fc447f15.png">
Closes https://github.com/facebook/react-native/pull/3523

Reviewed By: mkonicek

Differential Revision: D2557923

Pulled By: frantic

fb-gh-sync-id: 19957e255993696e793b0162662772efd89f5c1a
2015-10-21 18:44:27 -07:00
Bhuwan Khattar c9510765a4 split transformers
Reviewed By: martinbigio

Differential Revision: D2567545

fb-gh-sync-id: 2e6a341885c701c6a7da35830227dbff7705255c
2015-10-21 16:28:27 -07:00
Thomas Parslow 9f60a1bcc6 Support line number arguments for Emacs when using emacsclient
Summary: Many emacs users will want to use the `emacsclient` command to launch emacs. This opens the file in an existing emacs session rather than opening up a new instance.
Closes https://github.com/facebook/react-native/pull/3536

Reviewed By: svcscm

Differential Revision: D2565189

Pulled By: pcottle

fb-gh-sync-id: be12782aa92281eb649710ac22db2ffa1486a08a
2015-10-21 09:57:40 -07:00
Martín Bigio 689156a228 Kill unused files
Reviewed By: frantic

Differential Revision: D2561113

fb-gh-sync-id: a81fece0a948485e12bff7ec146e39d890664887
2015-10-21 03:04:01 -07:00
Martín Bigio e5cc117beb Start packager through cli
Reviewed By: frantic

Differential Revision: D2561066

fb-gh-sync-id: 1743153a84947da5d0e54aca7e1919cf5df3a965
2015-10-21 03:03:59 -07:00
David Aurelio 8c4c679f09 Add `--verbose` flag to react native packager cli
Reviewed By: martinbigio

Differential Revision: D2517347

fb-gh-sync-id: 02e64f99120b6636d6e7649deb11d0b2f58d9285
2015-10-20 11:52:25 -07:00
James Ide d4d1608ee6 Expose the projectRoots option
Summary: This was already implemented -- just documenting it in the CLI.
Closes https://github.com/facebook/react-native/pull/3246

Reviewed By: svcscm

Differential Revision: D2560211

Pulled By: martinbigio

fb-gh-sync-id: c4e4d974db28d6251636ff38bfcb0afdf5148de7
2015-10-20 09:49:27 -07:00
David Aurelio 8b7342325a Make the modification time of the transformer file relevant for the cache.
Reviewed By: amasad

Differential Revision: D2554956

fb-gh-sync-id: cc76f083594aac04c74a4ef271305238b06710eb
2015-10-20 09:46:23 -07:00
Martín Bigio aff65ba875 Allow user to configure transformer through cl argument
Reviewed By: frantic

Differential Revision: D2547435

fb-gh-sync-id: 77016ee5beba854a4cb58e9ac04b91a7dd76cf3e
2015-10-16 13:26:22 -07:00
Bhuwan Khattar 897c651fbe fix HasteDependencyResolver
Reviewed By: javache

Differential Revision: D2550444

fb-gh-sync-id: f978efdd73c09e58bcdbc4711ee2a7662a0b1bf3
2015-10-16 11:16:25 -07:00
Adam Miskiewicz d5436af6d8 Adds support for ES6 export syntax to the packager's DependencyResolver.
Summary: This PR includes:
- A regex that allows for the `export` syntax.
- Updated tests.
Closes https://github.com/facebook/react-native/pull/3465

Reviewed By: svcscm

Differential Revision: D2550322

Pulled By: vjeux

fb-gh-sync-id: 7d35f436af13cf5b6b1287835a18a9693ec1be8a
2015-10-16 10:57:32 -07:00
Bhuwan Khattar f58dabc989 Support cyclic dependencies in require polyfill
Reviewed By: @martinbigio

Differential Revision: D2548506

fb-gh-sync-id: fca534179a5f8fcf407917137cdd71d964f145e5
2015-10-16 03:41:08 -07:00
Jared Forsyth 4a1ae23e4c Devtools websocket
Summary: I thought this was already in here, but then it wasn't. It's connected to by RN [here](https://github.com/facebook/react-native/blob/master/Libraries/Devtools/setupDevtools.js#L17).
Closes https://github.com/facebook/react-native/pull/3431

Reviewed By: @​svcscm

Differential Revision: D2548286

Pulled By: @frantic

fb-gh-sync-id: ffd74426949196ca538c897c1a0d07d08b204630
2015-10-16 03:41:05 -07:00
Bhuwan Khattar 87d2c1d95c Simplify require polyfill
Reviewed By: @vjeux

Differential Revision: D2544415

fb-gh-sync-id: ab48b5fba169c43c68dd24dc95ea1d0322ed67c4
2015-10-16 03:40:58 -07:00
Martín Bigio 034b1851e4 Fix bundle command with --dev
Reviewed By: @vjeux

Differential Revision: D2538070

fb-gh-sync-id: 3720de8e60d20d6becc60035095e29b3a480a017
2015-10-16 03:40:51 -07:00
Martín Bigio 0a6c851613 Fail loud when module is not resolved correctly
Summary: @​public
We've been forgiving unresolved modules errors in the past but we've realized that doing so makes the codebase a bit unstable as people don't make sure to fix these errors. From now on we'll early fail and stop the packager when any module cannot be resolved (including assets)

Reviewed By: @amasad

Differential Revision: D2518076

fb-gh-sync-id: e170d95b905cc29afbe46e24b65425ddd887f77c
2015-10-13 11:48:23 -07:00
Nick Lockwood 44429dc4f4 Removed references to isStatic from the codebase
Summary: @​public

The legacy 'isStatic' property for image sources is no longer used anywhere in our codebase, but was still being generated by the packager and referenced in the JS in various places.

This diff removes all the remaining references.

Reviewed By: @frantic

Differential Revision: D2531263

fb-gh-sync-id: 0bba0bb8473b1baa908ef7507cbf6d83efb0d9ee
2015-10-13 06:44:30 -07:00
Martín Bigio 67ab9dadb9 Move oss server to cli
Summary: @​public We're moving all the operation from `local-cli` to the `private-cli` and improving the code in the process. On this diff we introduce the `server` command which will be use to start the packager server. On follow up diffs we'll make changes to start using it from `local-cli`.

Reviewed By: @vjeux

Differential Revision: D2531443

fb-gh-sync-id: 5f7f12a250895265d83d1b076f6bbddb5cbdc257
2015-10-13 06:44:12 -07:00
James Ide 5a5ecf5cd1 Add Node >= 4 requirement to package.json and packager/package.json
Summary: When you try to install these with old Node you'll now get a message from npm telling you that your version of Node is old. This makes it more obvious what's going on and hopefully reduces the number of issues we get due to people using an old version of Node.
Closes https://github.com/facebook/react-native/pull/3296

Reviewed By: @​svcscm

Differential Revision: D2526500

Pulled By: @vjeux

fb-gh-sync-id: 036e10a8d1819ea082e419cd328a458202f0e071
2015-10-09 14:44:23 -07:00
Martín Bigio fc7d01e2ab fix E2E tests
Reviewed By: @mkonicek

Differential Revision: D2526310

fb-gh-sync-id: 1c04f56073dc5b393a36b258c039fdfd85ab83a2
2015-10-09 07:59:02 -07:00