Commit Graph
1203 Commits
Author SHA1 Message Date
Alexandre Kirszenberg e776b4ba8f DeltaClient: split DeltaBundle's modules into added and modified
Summary:
The reasoning behind this change is that right now, having both added and modified modules inside of a single `modules` field doesn't allow for basic operations like combining two deltas.

For instance, say I have three different bundle revisions: A, B and C.

Module 42 was added in B, and then removed in C.

A->B = `{modules: [42, "..."], deleted: []}`
B->C = `{modules: [], deleted: [42]}`
A->C = `{modules: [], deleted: []}`

However, were we to compute A->C as the combination of A->B and B->C, it would result in `{modules: [], deleted: [42]}` because we have no way of knowing that module 42 was only just added in B.

This means that the `deleted` field of delta X->Y might eventually contain module ids that were never present in revision X, because they were added and then removed between revisions X and Y.

The last time I changed the delta format, we had a few bug reports pop out from people who had desync issues between their version of React Native and their version of Metro. As such, I've tried to make this change backwards compatible in at least one direction (new RN, old Metro). However, this will still break if someone is using a newer version of Metro and an older version of RN. I created T37123645 to follow up on this.

Reviewed By: rafeca, fromcelticpark

Differential Revision: D13156514

fbshipit-source-id: 4a4ee3b6cc0cdff5dca7368a46d7bf663769e281
2018-11-28 02:50:56 -08:00
Tim Yung 0588970767 flow-typed: Define minimist
Summary: Fixes a minor Flow type error when `minimist` is typed via `flow-typed`.

Reviewed By: TheSavior

Differential Revision: D13188680

fbshipit-source-id: 9ad35a3222c8937163a998a2751efd95945af3c7
2018-11-27 23:33:56 -08:00
Rubén Norte f4f84408ca eslint: Disable jasmine env and only enable jest env for test files
Summary:
Modified the ESLint configuration to only enable the Jest environment for files we consider now tests, which are files with the `-test.js` suffix under `__tests__`. Also enabled some globals for test helpers (any file under `__tests__`).

This will allow us to catch misspelled tests, while allowing test helpers to use most Jest APIs.

Also disabled the Jasmine environment so people stop using Jasmine APIs and we can rollout Circus soon.

Reviewed By: aaronabramov

Differential Revision: D13199591

fbshipit-source-id: 12a32cf5835630b9987452b0c33d3f8085001689
2018-11-27 03:51:02 -08:00
Rubén Norte 872d65d472 jest: rename tests to follow the new convention
Summary:
Renamed test files to match `-test.js`, so people can add test helpers without blacklisting.

Codemod code: P60365841

Script executed:

```
cd xplat/js
./scripts/node/node rename-script.js > result.txt
```

Reviewed By: mjesun

Differential Revision: D13185673

fbshipit-source-id: 87451635aa538c2c1d1886e75574d0e5c889596e
2018-11-26 10:30:12 -08:00
Radovan Šmitala d1fe0688b6 Fix allocating Buffer in early commit (#22379)
Summary:
Commit https://github.com/facebook/react-native/commit/d9c2cdae41f41d879351516eeadd1fb608210242 brings compatibility with Node 10, but replaced allocating buffer incorrectly.
dulmandakh made two comments and shows how to do it based on NodeJS documentation https://nodejs.org/api/buffer.html#buffer_new_buffer_size

This PR just fixes that commit.
Pull Request resolved: https://github.com/facebook/react-native/pull/22379

Differential Revision: D13166867

Pulled By: hramos

fbshipit-source-id: 207528739889c044021a4b97ef94c33d56de3e89
2018-11-22 00:50:03 -08:00
Kacper Wiszczuk 2ed7b80096 fix: Fix opening dev tools (#28)
* fix: Fix opening dev tools

* fix: fix argument typo

* fix: fix nits
2018-11-19 04:47:00 -08:00
Panagiotis Vekris b20a7c8940 Flow v0.86.0 in xplat/js
Summary:
allow-large-files
bypass-lint
ignore-conflict-markers
ignore-signed-source
ignore-nocommit

drop-conflicts

Reviewed By: yungsters

Differential Revision: D13081129

fbshipit-source-id: fbb0ccaf3c0a2f224a56f6f6ac6c26811ebba583
2018-11-16 10:43:16 -08:00
Tim Yung 240736ef32 JS: Switch from new Buffer to Buffer.from
Summary:
Constructing `Buffer` using the constructor [[https://nodesource.com/blog/understanding-the-buffer-deprecation-in-node-js-10/ | has been deprecated in Node 10 due to security considerations]].

This is a simple and straightforward conversion.

Reviewed By: mjesun

Differential Revision: D13080655

fbshipit-source-id: 100d8f28c3b255422b26e820aaadcc4f32f41e0d
2018-11-15 12:13:05 -08:00
Stephy Ma b2ed45d6d4 Revert D12994045: Flow v0.86.0 in xplat/js [3/n]
Differential Revision:
D12994045

Original commit changeset: 04552bf081ba

fbshipit-source-id: 062b367b88a966a6efc895c99e9911f0ec0fe8ff
2018-11-14 23:04:04 -08:00
Panagiotis Vekris caeef8162a Flow v0.86.0 in xplat/js [3/n]
Summary:
allow-large-files
bypass-lint
ignore-conflict-markers
ignore-signed-source
ignore-nocommit

drop-conflicts

Reviewed By: avikchaudhuri

Differential Revision: D12994045

fbshipit-source-id: 04552bf081ba742de58e80fba08f8280cb86b1c3
2018-11-14 22:13:27 -08:00
Alexandre Kirszenberg 716f37ea94 DeltaPatcher: better support for the new Delta format
Summary: Adds support for the `deleted` key to remove modules from the bundle. Without this, source maps would break after removing a module, since it would still end up in the patched bundle but not in the source map.

Reviewed By: mjesun

Differential Revision: D12874011

fbshipit-source-id: 79239756854cb2c02f14ec8b0bb2b649766393fe
2018-11-12 08:41:06 -08:00
Michał Pierzchała 32c34e9051 fix: move @babel/core to deps (#23) 2018-11-09 06:50:16 -08:00
Mike Grabowski 3865818503 Bump version 2018-11-09 15:35:30 +01:00
Mike Grabowski 42feb5259f Fix Babel issues on the CI 2018-11-09 15:35:14 +01:00
Mike Grabowski 45439393c3 Bump dependency 2018-11-09 14:17:43 +01:00
Mike Grabowski d5040321fa Fix Babel Require not firing 2018-11-09 14:17:32 +01:00
Mike Grabowski a3ffb3ad32 Release new version for review 2018-11-09 11:46:47 +01:00
Mike Grabowski 8c6198781f Refactor MiddlewareManager to not use class properties 2018-11-09 11:42:52 +01:00
Mike Grabowski c9828efeb3 Remove extraneous plugins 2018-11-09 11:37:27 +01:00
Mike Grabowski 1ced430e73 Add status badge to the repository 2018-11-09 11:32:55 +01:00
Mike Grabowski d40e62b3c3 Merge pull request #20 from thymikee/chore/circleci
chore: setup CircleCI
2018-11-09 02:27:33 -08:00
Michał Pierzchała 40a073a758 simplify cd 2018-11-09 11:24:39 +01:00
Mike Grabowski 24afeda0d6 Small clean up and fix main start up script 2018-11-09 11:20:48 +01:00
Michał Pierzchała f5cb71ffde go back to root after test/typecheck 2018-11-09 11:20:38 +01:00
Michał Pierzchała b4b9d077ea chore: setup CircleCI 2018-11-09 11:17:06 +01:00
Mike Grabowski 2beef9f25a Merge pull request #18 from thymikee/jest-babel-7
feat: use @babel/register instead of metro-babel-register
2018-11-09 02:15:07 -08:00
Michał Pierzchała ca2653ac33 add class properties transform 2018-11-08 23:58:45 +01:00
Michał Pierzchała bd10d94316 use @babel/register instead of metro-babel-register 2018-11-08 23:49:49 +01:00
Michał Pierzchała 3396cf8a7d chore: use babel7 for tests 2018-11-08 23:47:48 +01:00
Mike Grabowski dc20ec46c1 Fix typo 2018-11-08 15:45:11 +01:00
Mike Grabowski d63276a1a5 Release new version 2018-11-08 15:42:08 +01:00
Mike Grabowski b354d4f515 Make Flow pass 2018-11-08 15:41:07 +01:00
Mike Grabowski 55a4323960 Simplify Jest transformer 2018-11-08 15:35:47 +01:00
Mike Grabowski 11471680b0 Release a new version 2018-11-08 11:15:52 +01:00
Mike Grabowski c391af5f80 Small clean up 2018-11-08 11:06:33 +01:00
Mike Grabowski 09150a1270 Add bin property to the CLI 2018-11-08 11:02:09 +01:00
Mike Grabowski daa70be368 Fix test ignore paths 2018-11-07 14:48:27 +01:00
Mike Grabowski 9e6d069677 Make Jest tests run 2018-11-07 14:46:26 +01:00
Mike Grabowski c7b2b3d0b0 Make CLI run detached from React Native 2018-11-07 14:35:07 +01:00
Mike Grabowski cddfd756ae Merge pull request #15 from react-native-community/feat/reb
Feat/reb
2018-11-06 08:02:46 -08:00
Mike Grabowski 4e24d3287b Use resolve 2018-11-06 17:01:08 +01:00
Mike Grabowski be9e6c139d Replace paths to correctly point to a template folder 2018-11-06 17:01:01 +01:00
Mike Grabowski d8fb550f60 Fix init command lookup of package.json 2018-11-06 17:00:54 +01:00
Mike Grabowski 38e6c2ef68 Fix small issue related to the detection of RN folder 2018-11-06 17:00:33 +01:00
Mike Grabowski 2623bf1a82 Support requring React Native paths outside of the CLI 2018-11-06 17:00:27 +01:00
Kacper Wiszczuk 46b128ca43 Make local-cli run 2018-11-06 17:00:04 +01:00
Mike Grabowski 23218bb1b1 Add 'packages/local-cli/' from commit '0cae21561a14af6a8aecce7527e2cf252f053417'
git-subtree-dir: packages/local-cli
git-subtree-mainline: 62e07d1dc0
git-subtree-split: 0cae21561a
2018-11-06 16:46:00 +01:00
Mike Grabowski 62e07d1dc0 Remove local-cli 2018-11-06 16:45:48 +01:00
Mike Grabowski b73159b229 Use resolve 2018-11-06 15:43:46 +01:00
Mike Grabowski e370f8fce2 Replace paths to correctly point to a template folder 2018-11-06 15:42:22 +01:00