Commit Graph

405 Commits

Author SHA1 Message Date
Tadeu Zagallo c6a3052c73 Fix launchCommand
Summary: public

Fixes #4055

Babel is failing to find the plugins when running scripts with the full path,
cd into the folder before starting the packager as a workaround.

Reviewed By: vjeux

Differential Revision: D2638529

fb-gh-sync-id: b57151d3091d56a2c070692fb6296184a8fc62de
2015-11-11 04:39:28 -08:00
Tadeu Zagallo b907f40957 Fix breakages when upgrading to babel 6
Reviewed By: vjeux

Differential Revision: D2628092

fb-gh-sync-id: 077a3572fe8b261d390be2bdc32d9d06c2b80a01
2015-11-10 10:56:48 -08:00
Tadeu Zagallo 6eec446106 Use the previously upgraded transforms
Summary: public

Move all the transforms that had been previously upgraded to be the default now.

Reviewed By: vjeux

Differential Revision: D2631308

fb-gh-sync-id: a2120a9850c98ce65784b77598baa123121246ab
2015-11-10 10:55:32 -08:00
Tadeu Zagallo b48964717e Upgrade transformers to be compatible babel 6
Reviewed By: vjeux

Differential Revision: D2626155

fb-gh-sync-id: e919c8fb8bbf139bcd979ee2738c7ec4fc9eba74
2015-11-10 10:55:23 -08:00
Christoph Pojer cbaf58a47d 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 6f57766d21 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 c16574a0b4 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 9a64f17de8 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 666706b0da 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 44b051d98d 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 8c59866b69 Fix lint errors
Reviewed By: davidaurelio

Differential Revision: D2628366

fb-gh-sync-id: 8d849e2deb038842475e66ef641fa1d4f7b78d8f
2015-11-09 13:34:45 -08:00
Christoph Pojer b4fb6c2f61 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 34f8a6e56f 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 145a72df80 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 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
Joe Savona 1ae7a77934 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 c4739746ba 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 d9b4c57e12 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 f5670f8ab5 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 7f93548489 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 d3599d0a88 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 7041a22bd0 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 70c9ee8b1b 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 441995fa6a 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 47b124436f 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 44af0d3dec 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 d23e622426 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 bcf762af60 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 725de1d236 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 271de0f9b6 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 c1faabcdf6 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 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
Martín Bigio 32aeeea313 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 be70e32de2 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 3a8f9e1080 split transformers
Reviewed By: martinbigio

Differential Revision: D2567545

fb-gh-sync-id: 2e6a341885c701c6a7da35830227dbff7705255c
2015-10-21 16:28:27 -07:00
Thomas Parslow 394dfae868 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 8e7cfcd053 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 088c193a22 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 523769faa7 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 93c56a0e90 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 fb46e39cad 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 5977f494fc 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 256f69f4e6 fix HasteDependencyResolver
Reviewed By: javache

Differential Revision: D2550444

fb-gh-sync-id: f978efdd73c09e58bcdbc4711ee2a7662a0b1bf3
2015-10-16 11:16:25 -07:00
Adam Miskiewicz 24bfdda499 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 15054ade7d 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 0788e0b683 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 83b8a30beb 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 d96b750e56 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 793c3564ff 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