Commit Graph

1105 Commits

Author SHA1 Message Date
Jean Lauliac 1afa045dea packager: DependencyGraph-test: mock child_process
Reviewed By: cpojer

Differential Revision: D4182064

fbshipit-source-id: e645e6d952e3aeaadaf35e29d6fcaf6395e590a7
2016-11-15 03:43:42 -08:00
Martin Hernan Giachetti 170ae0a520 Update error-guard.js
Summary:
This vars should be let instead of const because they are reassigned.
Closes https://github.com/facebook/react-native/pull/10818

Differential Revision: D4179219

Pulled By: javache

fbshipit-source-id: b09959c5ff31ad1a896d454011dffd915a0a44c4
2016-11-15 00:13:42 -08:00
Gabe Levi 4fafef79cb Deploy v0.35.0
Reviewed By: davidaurelio

Differential Revision: D4177391

fbshipit-source-id: c02cf98ed275b7032103b11eab6d0e189f8d8f24
2016-11-14 20:45:17 -08:00
Konstantin Raev b64f892210 Revert D4149694: [RN] Update Jest + jest-haste-map
Differential Revision: D4149694

fbshipit-source-id: 65a39bc1d0a0f9e7094ebc8dec9233e432a5e14d
2016-11-14 12:43:51 -08:00
Alexander Paterson 475a0c20f6 Decode URI in asset server
Summary:
Solving this issue https://github.com/facebook/react-native/issues/10364

In development when assets are requested from AssetServer, it tries to find them with URI-friendly filenames. I added a single line to decode these filenames.

Tests are passing. Couldn't find any discussion regarding whether this is a good idea. This was causing some members of my team a bit of grief earlier.
Closes https://github.com/facebook/react-native/pull/10365

Differential Revision: D4168401

Pulled By: hramos

fbshipit-source-id: 9ed3606392d8a6f170998caaf0f9254ba4879b49
2016-11-14 11:43:49 -08:00
benjaminhughes d79372a56f Making babel to use the babelrc file if we find it
Summary:
This PR tells babel where the babelrc file is if it has been found in the project root. I know you guys are relying on babel to find it when you tell babel the filename and sourceFilename, this works fine in normal js/node projects, here is an example where this will not work.

We have a big repo that can contain a few react-native / js projects. Our build system is similar to BUCK and we keep our third party dependencies in a separate folder (having a global package.json at the project route is not feasible as everyone will have to install every apps dependencies even when they don't need them), the structure looks a bit like this:

`third_party/js/.` packages from node_modules
`common/js/` common code used by numerous apps, common components, services etc.
`my_app/native` the app

What's happening is something from `my_app/native` (where the .babelrc file is) is requiring something from `common/js` which is then requiring something from `third_party/js` and so babel has no idea what .babelrc file to use and
Closes https://github.com/facebook/react-native/pull/8131

Differential Revision: D4167844

Pulled By: hramos

fbshipit-source-id: 3569981e26ff8f8c632d8ae365a1f43a3483b13b
2016-11-11 11:28:48 -08:00
Jean Lauliac 6e3e0ff6d7 packager ModuleTransport.js: @flow
Reviewed By: cpojer

Differential Revision: D4166900

fbshipit-source-id: 0b8c1730f00f9a9d4a17586967edae8cbd4f296b
2016-11-11 09:43:48 -08:00
Jean Lauliac 2bf0c037ec packager worker: enable possibility to add Flow annotations
Reviewed By: matryoshcow

Differential Revision: D4160456

fbshipit-source-id: bbc2420126d8e8b725c0b7b359b35f09dfe8c8d6
2016-11-11 05:29:30 -08:00
Jean Lauliac cedf70f702 packager: fix lint
Reviewed By: matryoshcow

Differential Revision: D4160163

fbshipit-source-id: 8eeb7dd83c0d80c1c62b760039615ce97782bd3e
2016-11-11 05:29:30 -08:00
Jean Lauliac f13c4e3d78 packager TransformCache.js: use directory specific to project
Reviewed By: davidaurelio

Differential Revision: D4159761

fbshipit-source-id: 1f4b1bbcf4c4fbb834a672e38cb2cf55f425b28b
2016-11-11 05:13:42 -08:00
Jean Lauliac ee637ee0eb packager worker/index.js: do not write to cache directly
Reviewed By: davidaurelio

Differential Revision: D4159970

fbshipit-source-id: 133ce5797e94a39fe60cbb9983edd561ce7d818e
2016-11-10 09:13:54 -08:00
Jean Lauliac ea8c7ec385 packager Module.js: make transformCode function required
Reviewed By: davidaurelio

Differential Revision: D4147343

fbshipit-source-id: 4c00a5905e698a9d257a632f3b02b63587b4644a
2016-11-10 09:13:54 -08:00
Jean Lauliac 163633a0b6 packager Module.js: remove extractRequires
Reviewed By: davidaurelio

Differential Revision: D4147275

fbshipit-source-id: 7c1d7d16f6b8164d7031963618aeab2857f5d497
2016-11-10 09:13:54 -08:00
David Aurelio 0493002fa3 Various cleanups around polyfill transformation
Summary:
- Put `isPolyfill` parameter into `options` object
- Save information whether a file is a polyfill
- Sort properties alphabetically
- Rename parameters

Reviewed By: cpojer

Differential Revision: D4153203

fbshipit-source-id: 67da97546a15c899112b74da6072acdea18d10e8
2016-11-10 08:13:57 -08:00
Christoph Pojer 5dab7599d3 Update Jest + jest-haste-map
Reviewed By: matryoshcow

Differential Revision: D4149694

fbshipit-source-id: 4f8378c419ddc7978e05dfcf2112e833775391be
2016-11-10 06:28:38 -08:00
Jean Lauliac 31c7108806 packager Module.js: fix concurrency issues
Reviewed By: matryoshcow

Differential Revision: D4159743

fbshipit-source-id: 41515f2a29344b648c4c52100056d2054e3edff7
2016-11-10 05:58:41 -08:00
Wojciech Ogrodowczyk 9773229227 Disallow object assign explanation
Summary:
> Explain the **motivation** for making this change. What existing problem does the pull request solve?

Provides better documentation for a confusing (and common) error message. Solves https://github.com/facebook/react-native/issues/3634

> **Test plan (required)**

This is just an error message shown in dev environment. I ran the tests and they pass.
Closes https://github.com/facebook/react-native/pull/10472

Differential Revision: D4053818

Pulled By: hramos

fbshipit-source-id: e80dc6ab787a8d8cabbcb442c438c07269401ff7
2016-11-10 00:28:31 -08:00
Tim Yung 1fdb99efac RN: Fix Broken Symbolication
Reviewed By: fkgozali

Differential Revision: D4159009

fbshipit-source-id: 6f91428a769db820c49d7300138a06350f52e63e
2016-11-09 22:58:45 -08:00
Ovidiu Viorel Iepure b75dc61a46 Fix lint warnings in JSTransformer
Summary: Fix lint warnings throughout JSTransformer.

Reviewed By: bestander

Differential Revision: D4148161

fbshipit-source-id: ac73a9e3919b1c66fef0e447083b44039900f963
2016-11-09 09:31:12 -08:00
David Aurelio ef448d4fa1 Add support for wrapping polyfills
Summary: This adds support to wrap polyfills differently from regular modules (`(function(global){ ... }(this))` instead of `__d(function...)`.

Reviewed By: cpojer

Differential Revision: D4147031

fbshipit-source-id: c19e968c1498cac653ab2649e3089d8c29571926
2016-11-09 07:43:30 -08:00
Ovidiu Viorel Iepure 3064549bca Fix lint warnings in Bundler index
Summary: Fix lint warnings starting at Bundler index

Reviewed By: davidaurelio

Differential Revision: D4147587

fbshipit-source-id: 6d86bdd4d43a08661498c2bf8b6b21c8c3573d88
2016-11-08 12:28:47 -08:00
Ovidiu Viorel Iepure 5a6d3f99e2 Use native Promises
Summary: Use native Promises in React Native Packager. Remove all the non-standard `Promise.done()` calls throughout the codebase & replace `Promise.denodeify` with the stand-alone `denodeify` module.

Reviewed By: davidaurelio

Differential Revision: D4146965

fbshipit-source-id: 1730531c914863ac3c52626801d9f91c28eed717
2016-11-08 12:28:47 -08:00
Ovidiu Viorel Iepure 5c47289e92 Fix lint warning in Logger
Summary: Fix a lint warning in the Logger.

Reviewed By: davidaurelio

Differential Revision: D4147924

fbshipit-source-id: cd874ebd5f67d85e54c7dc3d9435df9ad672e9fe
2016-11-08 12:13:43 -08:00
Ovidiu Viorel Iepure 159c5d1afb Fix lint warnings in Server implementation
Reviewed By: davidaurelio

Differential Revision: D4148018

fbshipit-source-id: 051cba96b2c4ac74709d45c2b388632122009c84
2016-11-08 11:58:50 -08:00
David Aurelio 101977eb19 improve options parser
Reviewed By: jeanlauliac

Differential Revision: D4146832

fbshipit-source-id: a54284ccc3fa4d6e1628886b748b21b9b9af2cff
2016-11-08 10:13:40 -08:00
Jean Lauliac 3ae8e44f34 packager ResolutionResponse: @flow
Reviewed By: davidaurelio

Differential Revision: D4146739

fbshipit-source-id: 0b8e65dfaa2f28c4498fb17b8d980da9271fe8d6
2016-11-08 04:58:44 -08:00
Jean Lauliac d25047ebf1 declareOpts: @flow
Reviewed By: cpojer

Differential Revision: D4146711

fbshipit-source-id: edd360b3dd8444c7ec5be5c69db97e1e0906a730
2016-11-08 04:58:44 -08:00
Jean Lauliac f1aba3f63b react-packager/src/Bundler/index.js: @flow
Reviewed By: davidaurelio

Differential Revision: D4139968

fbshipit-source-id: dc77ea6f0971b5d378883d89290a773205f97c18
2016-11-08 04:58:44 -08:00
Jean Lauliac c18d46bd03 JSTransformer/worker: cache transformed code as separate files
Reviewed By: davidaurelio, cpojer

Differential Revision: D4051477

fbshipit-source-id: 0179ce18dd20c00083ae05b5cf5f925659e7c056
2016-11-08 03:43:37 -08:00
Andres Suarez 6212c223ec Remove prepack bundle functionality
Reviewed By: davidaurelio

Differential Revision: D4138495

fbshipit-source-id: 52793fc1a8ef8b2fc461156607c360f34c4cb362
2016-11-07 03:43:37 -08:00
Jean Lauliac 403d4ed721 RM node-haste DependencyGraph: @flow
Summary: In addition to adding flow in that file, I also had to fix `Module.js` and others to make everything compatible together.

Reviewed By: davidaurelio

Differential Revision: D4118829

fbshipit-source-id: 4f6dbc515741c38817cc4c9757e981fabb03915a
2016-11-04 10:43:39 -07:00
David Aurelio dee58678c6 Prepare `__d` fn for Buck integration
Summary:
The new Packager/Buck integration passes module factory functions as first argument, so that the complete call can be amended at the end safely at a later point in time.
The call expression as a whole is covered perfectly by the created source map. Appending to that code later won’t break mappings.

`__d` now also accepts an additional `dependencyMap` parameter, which so far is only used by the new Packager/Buck integration. It enables module-local dependency IDs, thus eliminating the need to insert `correct` module IDs when building a bundle. Advantages are that source maps are no longer affected, and that builds can be quicker.

Reviewed By: cpojer

Differential Revision: D4124333

fbshipit-source-id: 12eba15d0b9d8c6624280a2ba1e7e4bc654bc83d
2016-11-04 05:13:44 -07:00
Jing Chen c296a3ee25 Silently fail for requires on Android again until we can fix loading image assets from both repos
Reviewed By: blairvanderhoof

Differential Revision: D4128218

fbshipit-source-id: d743cdb7a73efc2f46c42217a49c6094fcd3808a
2016-11-04 00:58:48 -07:00
mike qin 957ce4baca increase MAX_WAIT_TIME
Summary:
increase the `MAX_WAIT_TIME` in FileWatcher since live reloading doesn't work for a lot of users on windows when developing android. There may be a better timeout than arbitrarily tripling it, I'm sure the original developer would be able to pick out a good one, but many of us have used this change to finally be able to use RN here on windows.

fixes https://github.com/facebook/react-native/issues/8784 https://github.com/facebook/react-native/issues/7257
Closes https://github.com/facebook/react-native/pull/10690

Differential Revision: D4126110

Pulled By: mkonicek

fbshipit-source-id: 9b6f188fe9d39bcdcc2b38392dfc644a518296b2
2016-11-03 18:13:41 -07:00
David Aurelio b184c45275 Make sure that write streams are closed
Reviewed By: jeanlauliac

Differential Revision: D4117716

fbshipit-source-id: c12f07c6a0e016ac14543878491a8b4160099e21
2016-11-03 13:29:10 -07:00
Ovidiu Viorel Iepure 1ac86b2304 File transform events
Summary: Correctly generate log entries for file transforms and ping telemetry using the new Logger API.

Reviewed By: bestander, cpojer

Differential Revision: D4081325

fbshipit-source-id: 7d50d54eb673a0276512db6ad5ff21c344495612
2016-11-03 07:44:10 -07:00
Ovidiu Viorel Iepure 4d23c1f423 Instrumentation API
Reviewed By: cpojer

Differential Revision: D4074413

fbshipit-source-id: fd2dff17168f426680fd9dc8456f8b1ae3f55318
2016-11-03 07:44:10 -07:00
David Aurelio cda4129dd3 Add flow to require implementation, always warn when modules are accepted by name
Reviewed By: matryoshcow

Differential Revision: D4124228

fbshipit-source-id: 461087caf4add07db376bb71ae5ba42bf3536cd3
2016-11-03 05:58:30 -07:00
Jean Lauliac 4ce09ce88a RM Polyfill.js: @flow
Reviewed By: davidaurelio

Differential Revision: D4118256

fbshipit-source-id: b9d906cd94c0548c28a62fa636c6da7bcf894ba9
2016-11-03 04:58:46 -07:00
Jean Lauliac 4fe80636fb RM fastfs.js: @flow
Reviewed By: cpojer

Differential Revision: D4118175

fbshipit-source-id: ad9d1f98bcde0c1be17d36c74c3662e6e55165f8
2016-11-03 04:58:46 -07:00
Jean Lauliac d730928b0c RN Package.js: @flow
Reviewed By: davidaurelio

Differential Revision: D4118006

fbshipit-source-id: ad8fdcb67351a9e53af0a7acbf16f269daf31f50
2016-11-02 13:43:43 -07:00
Jean Lauliac 1baa2ab893 RN ModuleCache.js: @flow
Reviewed By: davidaurelio

Differential Revision: D4117759

fbshipit-source-id: 158f6e50cb9211f87acce17047ed3e959e6c271f
2016-11-02 13:43:43 -07:00
Alexander Blom 94929b717c Add Console agent
Summary: Adds the Console agent which we hook from our console polyfill. It captures the stack and strips the frames of the polyfill.

Reviewed By: davidaurelio

Differential Revision: D4021502

fbshipit-source-id: 49cb700a139270485b7595e85e52d50c9a620db6
2016-11-02 12:29:15 -07:00
Pieter De Baets 5af2bf17bc Stop silently failing for requires on Android
Reviewed By: bestander

Differential Revision: D4117128

fbshipit-source-id: a11996a322d38e884aad2f095342c1ea723b0d89
2016-11-02 08:58:42 -07:00
David Aurelio 05d53084c1 buck worker tool: catch errors thrown from commands, and respond with errors.
Reviewed By: cpojer

Differential Revision: D4057884

fbshipit-source-id: acfe0cc57b541a534dd640380c69f591c1fb83c6
2016-11-01 05:58:43 -07:00
Jean Lauliac d60ac14fd0 extract-dependencies.js: fix out-of-date comment
Summary: We actually use the AST, not regexes. Fix comment.

Reviewed By: davidaurelio

Differential Revision: D4104797

fbshipit-source-id: e37d168bd541d9d222667d0d168aa6b6099c1275
2016-10-31 11:43:37 -07:00
Jean Lauliac d8aab602b2 Module.js: add @flow
Reviewed By: cpojer

Differential Revision: D4095611

fbshipit-source-id: d87509153eab3d8dbcd65b8c6c6ffb3e5746685f
2016-10-31 04:28:29 -07:00
Pooya Parsa be244f3a72 os.tmpDir() is deprecated
Summary:
According to [5e5ec2cd1e](https://github.com/nodejs/node/commit/5e5ec2cd1e) os.tmpDir() is now deprecated in node.js 7 and `os.tmpdir()` is preferred :)

Current status:
Bundler shows annoying warning every time it runs :)
Closes https://github.com/facebook/react-native/pull/10620

Differential Revision: D4101498

fbshipit-source-id: 0de8cc30f684f1f22191c64fa2c7ce73c5abf9ea
2016-10-29 13:59:01 -07:00
Christine Abernathy 2a43487faa Fix Xcode build error on non-standard setup
Summary:
This change is related to https://github.com/facebook/react-native/issues/9677 that can happen when trying to get an Xcode release build, which in turn calls  `react-native-xcode.sh` and if one has a non-standard file setup, ex:

```
ios/
 |_ (iOS related code)
js/
 |
 |_ index.ios.js
     node_modules
     package.json
     (other React Native JS code)
```

The error output in this case is:

```
+ DEST=/Users/caabernathy/Library/Developer/Xcode/DerivedData/Mixer-ffglwypovddbciahtlducaeuqxqa/Build/Products/Release-iphonesimulator/Mixer.app
+ [[ Release = \D\e\b\u\g ]]
+ BUNDLE_FILE=/Users/caabernathy/Library/Developer/Xcode/DerivedData/Mixer-ffglwypovddbciahtlducaeuqxqa/Build/Products/Release-iphonesimulator/Mixer.app/main.jsbundle
+ node /Users/caabernathy/Facebook/OpenSource/Apps/RWMixer/Sample/Build/Mixer-Challenge/js/node_modules/react-native/local-cli/cli.js bundle --entry-file index.ios.js --platform ios --dev false --reset-cache --bundle-output /Users/caabernathy/Library/Developer/X
Closes https://github.com/facebook/react-native/pull/10262

Differential Revision: D4100083

Pulled By: lacker

fbshipit-source-id: 476f38990d09d5c26c22df77630b1a71b42959e2
2016-10-28 18:44:36 -07:00
Jean Lauliac 3b0d4f4c33 node-haste/Cache: @flow
Reviewed By: davidaurelio

Differential Revision: D4043681

fbshipit-source-id: 8c82b394f4df9bb0d580f405ce472c69224485f5
2016-10-24 10:29:06 -07:00