Commit Graph

207 Commits

Author SHA1 Message Date
Dan Abramov
80989c9f29 Prepack 0.2.50-alpha.0
Summary: New alpha version for master.

Reviewed By: trueadm

Differential Revision: D9457284

fbshipit-source-id: 6b67e1095dc9bcd9545e88dcfa9a7d714434a9db
2018-08-22 09:58:46 -07:00
Dan Abramov
cfe8213b46 Update Flow to 0.79.1 (#2463)
Summary:
What it says on the tin
Pull Request resolved: https://github.com/facebook/prepack/pull/2463

Differential Revision: D9456926

Pulled By: gaearon

fbshipit-source-id: fef96d4e0843662ff90eb4b0b06410f3b3bac83c
2018-08-22 09:09:26 -07:00
Dan Abramov
a5061a65a3 Weekly release v0.2.49
Summary:
Fixes #2419 #2386 #2439 #2447 #2432 #2437 #2442

* Fix havoced binding not in optimized function
* Allow arrays with widened numeric properties to update index properties
* Fix nested for statement bailout with nested for-in
* Don’t record modified bindings for immutable bindings when havocing

Reviewed By: trueadm, sebmarkbage

Differential Revision: D9456957

fbshipit-source-id: f266b8cc73012b9c721f0f9eebd48347bf0e37ae
2018-08-22 09:09:26 -07:00
Herman Venter
6a938efac1 New Prepack alpha
Summary: 0.2.49-alpha.0

Reviewed By: cblappert

Differential Revision: D9349878

fbshipit-source-id: b351b44ff3400a64ec19e8eaa0778ba718e525ef
2018-08-15 16:24:55 -07:00
Herman Venter
90c3aa28cc Weekly release v0.2.48: Fuzz tester and join logic refactor
Summary:
Fixes #2151 #2222 #2279 #2393 #2399 #2404 #2411 #2414 #2415
Added a fuzz testing tool
Added test cases
Turn crash in JSON.stringify into a diagnostic
Adds a `arrayNestedOptimizedFunctionsEnabled` flag to enable nested optimized functions derived from Array.prototype methods (like `map`) and Array.from
Refactor assignment on partial or possibly deleted property
Rewrote the joining logic to always do a full join at every join point
Removed last remnants of delayUnsupportedRequires

Reviewed By: cblappert

Differential Revision: D9349841

fbshipit-source-id: 74a16dbb015777d59d23fdfde77abbe2489c292a
2018-08-15 16:24:54 -07:00
Nikolai Tillmann
55c55f70c9 Removing last remnants of delayUnsupportedRequires
Summary:
The previous changes on "Do full joins" didn't remove all
uses of the delayUnsupportedRequires feature. This does it.

In particular, this fixes the internal prepack-test.

Reviewed By: hermanventer

Differential Revision: D9287509

fbshipit-source-id: f810f5e08a10cbd14272d776799a2a8f1442d1c8
2018-08-12 17:54:27 -07:00
Herman Venter
7157849a44 Do full joins (#2402)
Summary:
Release note: Rewrote the joining logic to always do a full join at every join point

Closes #2151 #2222 #2279

I've spent a lot of time in the last few months trying to sort out problems that arise from effects being applied too many or too few times. Fixing these feel a bit like playing wack a mole and in the end no fix goes unpunished.

Stepping back a bit from the fray, it seems to me that the root cause of all this pain is the fact that joins of different kinds of completions get delayed.

Before we had path conditions and the simplifier this seemed like a rather good thing since exceptional paths did not contribute values to the normal paths and we thus had fewer abstract values to deal with and fewer places where Prepack would grind to a halt.

In the current state of things, however, it seems perfectly possible to join in all branches at every join point. I've had to decrease some limits, in particular the number of times we go around a loop with conditional exits. I've also had to make the test runner impose a limit on how many times the simplifier can invoke Path.implies.

Nevertheless, the tests seem to pass and hopefully this will also fix quite a lot of bugs that have been unresolved for many months already.
Pull Request resolved: https://github.com/facebook/prepack/pull/2402

Differential Revision: D9236263

Pulled By: hermanventer

fbshipit-source-id: 92a25b591591297afeba536429226c5a0291f451
2018-08-11 20:53:43 -07:00
Nikolai Tillmann
829bec26bf Updating Flow to .78 (#2400)
Summary:
Release notes: None
Pull Request resolved: https://github.com/facebook/prepack/pull/2400

Reviewed By: hermanventer

Differential Revision: D9244528

Pulled By: NTillmann

fbshipit-source-id: 159f38a0a7faa8e52ce87e489f66d940297c568d
2018-08-09 12:24:34 -07:00
Caleb Meredith
4319298f88 Fuzzer (#2374)
Summary:
This PR adds the fuzzer I’ve been working on to the Prepack codebase so other people can contribute, provide feedback, and run it against their changes. The new commands added are:

- `yarn fuzz`: Starts generating tests in the foreground and logs progress. If it finds an error it will try and shrink it before returning the shrunken program to you with the invalid results.
- `yarn fuzz-sample`: See a selection of the programs generated by the fuzzer.
- `yarn fuzz-overnight`: Spin up a worker for each CPU and try to find failing test cases. Your computer will be basically unusable while you run this, so leave it running overnight. Failed test cases will be saved in `fuzzer/overnight.sqlite` so in the morning you can use `sqlite3` to inspect the errors the fuzzer found.

The fuzzer generates programs with an optimized function and executes them twice:

1. In Node.js
2. In Node.js after running Prepack

Then compares the results. If the results are different then the fuzzer will attempt to shrink the program to something easier to debug and return this to you. See [this gist for a sample of generated programs](https://gist.github.com/calebmer/6a727c1f4aa8c08d51940e60d29d336a). Here’s an example of a function you might see:

```js
function f3(a1, a2, a3, a4, a5, a6) {
  2;
  var x2;

  if (0) {
    return a1 ? false : a2;
  } else {
    var x1 = a3;
    x2 = x1;
  }

  var x6;

  if (x2) {
    var x3;

    if (x2) {
      x3 = x2;
    } else {
      x3 = a4;
    }

    var x4 = x3;
    x6 = x4;
  } else {
    var x5;

    if (a5) {
      x5 = x2;
    } else {
      x5 = a6;
    }

    x6 = f2(x5);
  }

  return x6;
}
```

So far I’ve reported four bugs reduced from test cases found by this version of the fuzzer. I’ve reported a couple more from old fuzzers I used, but these four from the current version. The shrinking process is not that good and it takes a while as the generated program can get large, so you’ll usually have to do some manual shrinking to get good bug reports. I only ran `yarn fuzz-overnight` for about an hour. It found 28 failures and I reduced those down to these 4.

- #2354
- #2355
- #2361
- #2363

I expect I’ll find more bugs as these get fixed and I add more JavaScript features to the fuzzer. The features I currently have are:

- Scalar primitives (number, string, boolean, null/undefined)
- Functions
- Conditional expressions
- If statements
- Variable declarations

Not too many features, but enough to catch a handful of bugs.

> **Note:** If this PR is too much to review, I’ve created [`calebmer/prepack-fuzzer`](https://github.com/calebmer/prepack-fuzzer) in which my work is broken up into commits as I made them. I then copied these files over to the Prepack repo.

The fuzzer in this PR is a rewrite from the [fuzzer I started with](https://gist.github.com/calebmer/75dd75ebe556681d3a628e75eaffc403). The main lessons I learned from that one are that I should start with a general JS fuzzer instead of a React fuzzer (since adding JS features after the fact to fuzzer designed for React is difficult) and that all nested structures need to be generated with one recursive generator from the generator library I’m using.

To generate programs I use [`leebyron/testcheck`](https://github.com/leebyron/testcheck-js) which is actually a JS compiled version of the official Clojure library [`clojure/test.check`](https://github.com/clojure/test.check). `testcheck` is designed for generative property testing at a much smaller scale then program fuzzing. So I am abusing the library a bit to use it as a fuzzer. My reasoning is that I wanted to write the fuzzer in JS (to have access to the Babel AST) and I didn’t want to write my own case generating framework. If we outgrow `testcheck` then we can keep the DSL, but rewrite the generation/shrinking logic. Although its been working fine for me so far. (Yet I am using a forked version which simply uses some unpublished features in the `testcheck` repo.)

The generator code in `fuzzer/src/gen.js` may look odd to you. It uses immutable.js and a **state monad** implemented with a JS generator so the code looks imperative. I need state since generating various program components depends on things like “what variables are declared at a given point in time,” but because I’m limited to only using a single recursive generator (based on performance lessons I learned from my first fuzzer) I can’t pass around state at the generator level and must instead maintain state at the result level. At first I tried hacking together some imperative state, but when shrinking programs `testcheck` replays some generators to get new programs. So what do you do when you need a stateful process that needs to be replayed? You use a monad.

I could try to fix the bugs I found, but I’d like to find more bugs. I need to add back support for React components and I need to add more language features.

_Which JS language features are the most interesting to fuzz?_

I ranked all the kinds of AST nodes in our internal React bundle [and got this](https://gist.github.com/calebmer/be5e2bad4b12af683522096544fc9568). I’ll be starting with that, but the Prepack team has a better intuition around what’s good for fuzzing. I know there’s been a discussion around temporals recently that I haven’t really been following. What would be good ways to trigger this behavior?
Pull Request resolved: https://github.com/facebook/prepack/pull/2374

Differential Revision: D9180836

Pulled By: calebmer

fbshipit-source-id: 59d3fb59ecc1026a865672e2833f7482ed72139a
2018-08-09 10:39:23 -07:00
Nikolai Tillmann
93d2026019 Alpha version bump
Summary: Alpha version bump

Reviewed By: cblappert

Differential Revision: D9230712

fbshipit-source-id: 0d0f8ad2ac27ef7bd7a3144a40b14ce1462b80b8
2018-08-08 16:09:37 -07:00
Nikolai Tillmann
13a5eeb30b Weekly release v0.2.47
Summary:
Weekly release v0.2.47:
- Many bug fixes
- Progress in support for nested optimized functions
- Fixing source map support
- Improved support for abstract behavior in switch statements
- Reduced memory usage of Prepack

Reviewed By: cblappert

Differential Revision: D9230689

fbshipit-source-id: 2094183fe4183089dfa584b865c9997147475e45
2018-08-08 16:09:37 -07:00
Chris Blappert
429852165d New alpha version for Prepack
Reviewed By: NTillmann

Differential Revision: D9101751

fbshipit-source-id: fedb51548f2a702c563e75ee256536651e3aba7c
2018-07-31 19:08:50 -07:00
Chris Blappert
78ee2be428 Prepack weekly release v0.2.46
Summary:
- Bugfixes, refactors
- extended use of simplification to prepack more code
- improved shape modeling
- Added ability to materialize objects without havocing
- new `--reproUnconditionally` and `--reproOnFatal` options in Prepack
  - creates zip file with all files needed to debug the failure
  - creates `repro.sh` script that can open Nuclide debugger, pre-populating the original arguments causing the failure

Reviewed By: NTillmann

Differential Revision: D9101750

fbshipit-source-id: c7a2a7fc1c7814f02937f786df01ec3cb8effe4e
2018-07-31 19:08:50 -07:00
Chris Blappert
5ac71c3c24 Fix issue in isDefinedInsideFunction (#2339)
Summary:
Release Notes: None

 The original issue here was that `nested` is defined inside of `fn2` which is a non-optimized function called by `fn` (an optimized function). That caused Prepack to not detect that `nested` was nested in `fn2`.

The fix is to use `CreatedObjects` to test for nesting instead of the environment lookup. The environment lookup fails because `nested` is evaluated with `fn2`'s effects applied but _not in `fn2`'s environment_.

This PR also adds a command I use frequently to test a single failing `test-runner` test as well as a way to skip lint because some tests can't pass lint.

Addresses the first test case of #2337.
Pull Request resolved: https://github.com/facebook/prepack/pull/2339

Differential Revision: D9074916

Pulled By: cblappert

fbshipit-source-id: 720003b965d9a9a6842d512ea41cd6402361342e
2018-07-30 18:28:27 -07:00
David Cai
bfe8cd26af Repro option creates package with sourcefiles, debugger startup script (#2289)
Summary:
Release Notes:

- Created DebugReproManager to capture all sourcefiles touched by Prepack (to include minimal subset of useful sourcefiles in the debug package)
- `--repro` splits into two: `--reproUnconditionally` which will create a debug package _regardless_ of Prepack's success/failure, and `--reproOnFatal`, which will _only_ create a debug package if Prepack outputs a `FatalError`.
- The debug package now includes all relevant sourcefiles (except for node modules), a copy of the version of Prepack (lib) that was used when the package was created, and a script to `yarn install` the relevant modules for the included version of Prepack, then start the Nuclide Prepack debugger with the proper parameters for files in the debug package (including original prepack arguments). This is in addition to the original input files.
- The impact of having the `DebugReproManager` on in `--reproOnFatal` mode all the time is negligible, as show in the table below. This flag will be always be enabled on Sandcastle builds so that failures are more easily debugged.
    - The time difference between no repro flag and `--reproOnFatal` seems like it can be written off as simple variance between runs. The larger increase when actually creating the zip comes from reading and zipping the files, which takes time proportional how many files are touched.
- SourceMapManager was refactored to not use `Invariant` or `SourceFile`s. This is so that `DebugReproManager` import it without increasing the flow cycle, and allows the `DebugReproManager` to be passed from Prepack to the CLI to create the repro package.
- The repro option introduces a potential for a subtle race condition that is addressed as follows:
    - The last `if (!success && reproMode === "none") process.exit(1);` must check reproMode because `generateDebugRepro` involves an async process (directory zipping). If there is an ongoing repro and the process exits, the repro may terminate prematurely, causing no repro to be generated. Instead, this only triggers if there is no repro -- if there is, the `generateDebugRepro` function will handle process exiting if it needs to.

Usage:
```node [prepack] [files to prepack] --reproOnFatal /Absolute/path/to/repro/bundle.zip --debugBuckRoot /buck/root```
or
```node [prepack] [files to prepack] --reproUnconditionally /Absolute/path/to/repro/bundle.zip --debugBuckRoot /buck/root```

Demo: https://www.dropbox.com/s/p62ves2p55fyyl7/--repro%20annotated%20demo.mp4?dl=0
Pull Request resolved: https://github.com/facebook/prepack/pull/2289

Differential Revision: D9002841

Pulled By: caiismyname

fbshipit-source-id: 623b362f963095f1cd8163684fd6e76596e7c4fc
2018-07-26 14:55:16 -07:00
Jeffrey Tan
9dd47ce775 New alpha release
Summary: New alpha release

Reviewed By: simonhj

Differential Revision: D9004307

fbshipit-source-id: c17fd72c847cffd088835a22d95c1103ee0d7165
2018-07-25 16:25:55 -07:00
Jeffrey Tan
6bf4c49713 Weekly release v0.2.45
Summary:
* Enhanced dead code elimination for optimized functions
* Much of the buildNode and inline Babel logic has been moved to a dedicated ResidualOperationSerializer class
* Provide a way to temporarily disable effects tracking
* Simplified forked completion constructors
* React components can have their props modelled via `__optimizeReactComponentTree`

Reviewed By: simonhj

Differential Revision: D9004189

fbshipit-source-id: 80936cbc66ad9dc350bbf0dcf0f1ff228a147f43
2018-07-25 16:25:55 -07:00
Sapan Bhatia
6cdf42f9e1 Bump version for next alpha
Summary: Bump version of alpha version of Prepack.

Reviewed By: gaearon

Differential Revision: D8892572

fbshipit-source-id: 129a265b5c8a725d4a09daa6811c0cc1a7ba2249
2018-07-18 07:24:17 -07:00
Sapan Bhatia
1d51aed47b Weekly release v0.2.44: Function argument modeling
Summary:
- Support modeling of shapes of optimized function arguments
- fix test262 to fail CircleCI test if not enough tests pass
- upgrades Prepack to use Babel 7.0.0-beta.53
- Nuclide compatibility fix

Reviewed By: gaearon

Differential Revision: D8892151

fbshipit-source-id: 8f1397d25d26e822709ed53c8e6d37055fe396ec
2018-07-18 07:24:17 -07:00
Dan Abramov
bdbce00f53 Use Flow server for local development (#2245)
Summary:
`flow check` runs a complete Flow check.
This is good for CI, but it means every re-check after edit is as slow as first check.

I'm changing local `yarn flow` to use a Flow server instead. This should speed up rechecks locally somewhat. Still won't save us from large recheck cycles, but at least we're not starting from a clean slate every time.

I'm adding `yarn flow-ci` with old behavior for the CI.

Finally, I replaced `--merge-timeout` with an equivalent recently added config option. This ensures it's respected both for the server and for the full check. Without it, the server dies.
Pull Request resolved: https://github.com/facebook/prepack/pull/2245

Differential Revision: D8891234

Pulled By: gaearon

fbshipit-source-id: 2c309a1718ed00ca5839cb3a586386e3e779f029
2018-07-18 06:40:25 -07:00
Herman Venter
bad3985f54 Clone completions when they complete composed effects (#2258)
Summary:
Release note: none

The main part of this PR is to ensure that completions and the effects they complete are always 1-1.

Along the way some bugs got fixed #2241.

This also includes a little side project: limiting the console spew when doing "yarn test-serializer --fast", which is something I do all the time and I'm much happier this way.
Pull Request resolved: https://github.com/facebook/prepack/pull/2258

Differential Revision: D8864448

Pulled By: hermanventer

fbshipit-source-id: a7f257a7e07211ecd6069b84330aa3305609c5d2
2018-07-16 13:56:10 -07:00
Sebastian Markbage
81bc21fad8 Delete node-cli Option and all the Node.js intrinsics (#2267)
Summary:
Since I'm adding a new experiment I figured I'd delete an equivalent sized one.

Last year I added an option that runs the Prepack program by invoking Node.js JS runtime which lets us prepack the whole module system and initialization. It's essentially a packager with perfect Node.js module resolution semantics. It did this by modeling Node's native environment as Prepack bindings.

This PR removes that whole option.

There's a few reasons why I don't think that worked out as a good idea.

- It's not solving a real need. It is hard to keep different module systems in tact. There is always something in the ecosystem that breaks down and using the canonical one solves that. However, in practice, if there is a need for bundling the ecosystem itself adapts to the toolchain. So it's not actually that hard to bundle up a CLI even with Webpack, even if it's strictly not 100% compatible, by tweaking a few downstream depenencies.

- Running the resulting bundle is tricky. The resulting bundle includes the JS parts of Node. This overlaps with what Node.js adds at runtime so it runs it twice. The ideal is actually to build a custom distribution of Node.js but this is generally overkill for what people want.

- Bindings change a lot. While Node.js's API notoriously doesn't change much. The internals do change a lot. By picking the API boundary in the middle of the internals of Node.js, it risks changing with any version. While technically observable changes, nobody else relies on these details. If this option was worth its weight, someone could probably maintain it but so far that has not been the case so we had to disable this option in CI to upgrade Node.

However, going forward I think there are alternative approaches we can explore.

- First class module system. This is something we really need at some point. A first class module system would be able to load Node.js module files from disk and package them up while excluding others. It doesn't have to be literally Node.js's module system. Close enough is ok. Especially as standards compliant ECMAScript modules get more popular. This lets us target compiling output that runs after Node's initialization.

- By introducing havocing and membranes in the boundaries, it becomes possible to initialize Node.js modules without actually knowing the internal of the boundaries.

- We've started optimizing residual functions which is much more interesting. However, this requires that code puts some constraints on how it works with its environment. It's not designed to be fully backwards compatible. That's probably a good thing but that also means that we can put constraints on the modules being Prepacked.

This removes the ability to prepack Prepack itself which is unfortunate but already wasn't being tested. To speed up Prepack itself, the [LLVM backend](https://github.com/facebook/prepack/pull/2264) seems much more useful if it can ever work on Prepack itself.
Pull Request resolved: https://github.com/facebook/prepack/pull/2267

Differential Revision: D8863788

Pulled By: sebmarkbage

fbshipit-source-id: d777ec9a95c8523b3386cfad553d9f691ec59074
2018-07-16 13:09:59 -07:00
Dominic Gannaway
e170c37aaa Upgrade Prepack to Babel 7 (#2256)
Summary:
Release notes: upgrades Prepack to use Babel 7.0.0-beta.53

This is a big PR that updates all of Prepack to Babel 7. Babylon is now `babel/parser` and pretty much all of the the previous Babel packages are now located in scoped packages. I had to make a bunch of changes around Jest/Flow/Webpack to get this all working. The build times of building Prepack itself seem considerably faster (easily twice as fast locally). I followed most of the Babel 6 -> 7 upgrade guide from the Babel site in terms of changing nodes and type definitions to match the new ones.
Pull Request resolved: https://github.com/facebook/prepack/pull/2256

Differential Revision: D8850583

Pulled By: trueadm

fbshipit-source-id: 2d2aaec25c6a1ccd1ec0c08c5e7e2a71f78ac2d8
2018-07-14 09:55:18 -07:00
Simon Jensen
ba9b2281fd Bump version for next alpha.
Reviewed By: cblappert

Differential Revision: D8837067

fbshipit-source-id: 683ea91e266a7c3a7c2d683c08efd1fed97c03e0
2018-07-13 10:09:27 -07:00
Simon Jensen
8251fe7fc1 Weekly release v0.2.43: Testing improvements and various optimizations.
Summary:
stop abstract loops from getting stuck in infinite loops when body contains a return, throw or break completion
Object.assign should no longer lose values when snapshotting in certain cases
Allow __optimize to work in conditional contexts
Move abstract Object.assign temporals into a helper function
new color scheme for the website
Add ability to rewrite generated code via global.__output
adds an optimization to Object.assign that attempts to merge calls together where possible
Added --expectedCounts parameter to test262-runner so that success can depend on the value of the time-out and the version of the test suite that is used.
Updated the test262 submodule to latest version

Reviewed By: cblappert

Differential Revision: D8837068

fbshipit-source-id: 218879046dbb0e307cbf3a13ba9a66d11e99a3f0
2018-07-13 10:09:27 -07:00
Dan Abramov
66351887d3 Run Prettier checks on CI (#2212)
Summary:
This will fail CI if we forgot to run `yarn prettier` before committing.
We do the same in React repo. It prevents committing stale files that later cause unexpected changes.
Pull Request resolved: https://github.com/facebook/prepack/pull/2212

Differential Revision: D8784406

Pulled By: gaearon

fbshipit-source-id: ca948b8e088be8886c8ba865f280ba8d72750f69
2018-07-10 09:55:23 -07:00
Nikolai Tillmann
9f7d1bd425 Updating Flow to .76 (#2229)
Summary:
Release notes: None

Also removed timeout limit as we routinely exceed the default.
Pull Request resolved: https://github.com/facebook/prepack/pull/2229

Differential Revision: D8775206

Pulled By: NTillmann

fbshipit-source-id: 70f8521c7cd3c4de9b97bc9cb3c2c6694d7e1616
2018-07-09 17:25:15 -07:00
Herman Venter
1034e4a5cf New Alpha
Summary: 0.2.43-alpha.0

Reviewed By: simonhj

Differential Revision: D8739217

fbshipit-source-id: eeb42cfb6741aa14fde21f806a39fbaca4335153
2018-07-05 14:39:38 -07:00
Herman Venter
244f2525f8 Weekly release v0.2.42: Debugability, speed, bug fixes
Summary:
Improved source location information
Only havoc abstract value args when really necessary
Debugger recognizes sourcemaps and opens the correct file/line when debugging in Nuclide.
Make React tests fast
Special case an expression simplification for Instant Render
Fix temporal assignments to intrinsics that happen inside non deterministic loops
Enhanced handling of Array.map applied to abstract arrays
Support dynamic invariants via __assume
We got a logo!
Add React Native mocks to Prepack

Reviewed By: simonhj

Differential Revision: D8739156

fbshipit-source-id: d535dfe0c5bcbee4aaed28f75d45cbedcc51344b
2018-07-05 14:39:38 -07:00
Dominic Gannaway
8b6307a121 Add fb-www Jest testing config/dependencies to do local snapshot testing (#2202)
Summary:
Release notes: none

Make it easier to do local development testing of our internal bundle without having to hack the settings each time.
Closes https://github.com/facebook/prepack/pull/2202

Differential Revision: D8731922

Pulled By: trueadm

fbshipit-source-id: 71d92c3b90f448667c4a9ada1f1b0848ece5003b
2018-07-04 05:38:38 -07:00
Dominic Gannaway
5f444abbda @allow-large-files [prepack][PR] Adds React native mocks (#2096)
Summary:
Release notes: adds React Native mocks to Prepack

This adds React Native mocks to Prepack and a few basic tests to demonstrate inlining of `View` and `Text`.
Closes https://github.com/facebook/prepack/pull/2096

Differential Revision: D8723932

Pulled By: NTillmann

fbshipit-source-id: 38bd265cd8935ebdf30266ec337378b4ea5b09d6
2018-07-03 14:44:41 -07:00
Dan Abramov
5159b0d832 Make React tests fast (#2187)
Summary:
Currently we have a single giant file with all tests, and a giant snapshot. This is both slow, and hard to work with and iterate on.

In this PR I will refactor our test setup.

- [x] Split it up into multiple files (gets the test running from 45s to 27s)
- [x] Run Prettier on test files
- [x] Split tests further for better performance
- [x] Make it possible to run one test file
- [x] Fix the issue with double test re-runs in watch mode on changes in the test file
- [x] Refactor error handling
- [x] Run Prettier on fixtures
- [x] Add a fast mode with `yarn test-react-fast <Filename>`
- [x] Fix double reruns on failure

Potential followups:
- [x] Figure out why test interruption broke (need https://github.com/facebook/jest/issues/6599 and https://github.com/facebook/jest/issues/6598 fixed)
- [x] Revisit weird things like `this['React']` assignment with a funny comment in every test
Closes https://github.com/facebook/prepack/pull/2187

Differential Revision: D8713639

Pulled By: gaearon

fbshipit-source-id: 5edbfa4e61610ecafff17c0e5e7f84d44cd51168
2018-07-02 11:25:58 -07:00
Dan Abramov
0e09f6f986 Increasing version number
Summary: The usual.

Reviewed By: trueadm

Differential Revision: D8694035

fbshipit-source-id: 7ceb3359f3a6729a7d08f3e2fd4841121b163edd
2018-06-29 07:24:14 -07:00
Dan Abramov
03cd572617 Weekly release v0.2.41
Summary:
- Bugfixes
- Improve `switch` evaluation performance
- Don't emit unnecessary calls

Reviewed By: trueadm

Differential Revision: D8694028

fbshipit-source-id: f43138b799905f98c11af1ebeaf82ff0216ab30b
2018-06-29 07:24:14 -07:00
Peter van der Zee
30f07ead22 Upgrade Prettier to 1.13.6 on fbsource
Reviewed By: zertosh

Differential Revision: D8638504

fbshipit-source-id: c6991b2e884e14868ddc1d9047a78191219d673f
2018-06-27 03:40:12 -07:00
Herman Venter
cc1e081854 Update Flow version and fix newly reported Flow errors. (#2150)
Summary:
Release note: update Flow version

Require latest Flow version and fix newly reported type errors.
Closes https://github.com/facebook/prepack/pull/2150

Differential Revision: D8592311

Pulled By: hermanventer

fbshipit-source-id: 98b7a7de81a1aae18973ccc858cacfaa02d43f8e
2018-06-22 11:25:50 -07:00
Nikolai Tillmann
5af00f1ed0 Increasing version number
Summary: Increasing Prepack version number

Reviewed By: hermanventer

Differential Revision: D8548827

fbshipit-source-id: 159697dd0bbbe37fc72665aedd2c38c31172b025
2018-06-20 18:17:34 -07:00
Nikolai Tillmann
4435ec0d8b Weekly Prepack release 0.40
Summary: Lots of bug fixes.

Reviewed By: hermanventer

Differential Revision: D8548728

fbshipit-source-id: a03ae279b5c0448abf3043d2aec7c3a8c98038f1
2018-06-20 18:17:32 -07:00
Nikolai Tillmann
722a31a01c Upgrading flow to 0.74 (#2131)
Summary:
Release notes: None
Closes https://github.com/facebook/prepack/pull/2131

Differential Revision: D8521992

Pulled By: NTillmann

fbshipit-source-id: 719f6f14d9bee982ddca3299bd24b16579292fbc
2018-06-19 18:24:48 -07:00
Chris Blappert
9732112204 Prepack alpha v0.2.40-alpha.0
Summary: New Prepack alpha

Reviewed By: yinghuitan

Differential Revision: D8399256

fbshipit-source-id: 7ab82f179442dc5d3f6da3a822f87601eee4a999
2018-06-13 21:56:52 -07:00
Chris Blappert
261257f464 Prepack weekly release v0.2.39
Summary:
- Perf improvements
- Bugfixes
- Rest syntax support (abstract interpreter support pending)
- Debugger improvements
- Migrate to CircleCI 2.0
- Added support for `&&` and `||` logical abstract value unfolding

Reviewed By: yinghuitan

Differential Revision: D8399257

fbshipit-source-id: 7570fb8a73027de63b96c04e94f03fa4bca353fb
2018-06-13 21:56:49 -07:00
Andres Suarez
9964f35014 Remove kcheck and dedupe yarn.lock deps
Reviewed By: trueadm

Differential Revision: D8327228

fbshipit-source-id: 1e27d6fbc70cd2a55aa819ab4f7f555ea7e76d91
2018-06-08 07:39:42 -07:00
Peter van der Zee
ab6dd11806 Back out "Drop eslint-plugin-babel from xplat/prepack"
Summary: Original commit changeset: c8b1f94086e0

Reviewed By: mjesun

Differential Revision: D8330860

fbshipit-source-id: 61015dda2c20d112c7d603cca42bf14417100471
2018-06-08 04:23:38 -07:00
Peter van der Zee
fa5fe49c74 Drop eslint-plugin-babel from xplat/prepack
Summary: Drop eslint-plugin-babel because the plugin doesn't appear to be used at all in this project.

Reviewed By: mjesun

Differential Revision: D8298145

fbshipit-source-id: 4c81abc838cdc6619e8f900d032057ec7008c623
2018-06-07 01:23:54 -07:00
Jeffrey Tan
0f1384aabd New alpha release v0.2.39-alpha.0
Summary: New alpha release v0.2.39-alpha.0

Reviewed By: hermanventer

Differential Revision: D8305539

fbshipit-source-id: 19e8aa014e5ebd047bbe154b29d311d2f78f2198
2018-06-06 21:58:21 -07:00
Jeffrey Tan
3a24fc596c Weekly release v0.2.38
Summary:
* Adds __describe that can pretty print abstract values to assist debugging
* Implemented step out feature in debugger

Reviewed By: hermanventer

Differential Revision: D8305566

fbshipit-source-id: 7e0765fa49d82e784abad199dd65c32cd9b1e7f2
2018-06-06 21:58:21 -07:00
Peter van der Zee
5c507bc847 Bump Prettier to 1.13.4 on xplat
Summary:
@public

Bump Prettier to use version 1.13.4
All code changes are caused by running Prettier and should only affect files that have an `format` header.
All other changes caused by yarn.

Reviewed By: ryanmce

Differential Revision: D8251255

fbshipit-source-id: 0b4445c35f1269d72730f2000002a27c1bc35914
2018-06-06 05:38:59 -07:00
Sapan Bhatia
0dd23e364a Weekly release v0.2.37
Summary:
For reference, the commit with the release version can be seen here: 7e9e713b3a
Closes https://github.com/facebook/prepack/pull/2079

Differential Revision: D8248778

Pulled By: sb98052

fbshipit-source-id: 3f6533e8e083adfb0b964a5d4e7657964f93da96
2018-06-03 08:28:15 -07:00
Dominic Gannaway
8bf0e78a58 Move fbjs to deps
Summary:
Release notes: adds fbjs as a dependency

Should fix https://github.com/facebook/prepack/issues/2081
Closes https://github.com/facebook/prepack/pull/2082

Differential Revision: D8247436

Pulled By: trueadm

fbshipit-source-id: 52c9b9374f8a5762ea8262e539222f4f20c88ce1
2018-06-02 12:46:36 -07:00
Sapan Bhatia
ba701ade59 Updated to Flow v0.73.0
Summary:
Updated version of Flow to 0.73.0.
Closes https://github.com/facebook/prepack/pull/2075

Differential Revision: D8245928

Pulled By: sb98052

fbshipit-source-id: 42f1d394c88789802ee8b9290a0f53d0a59abc2a
2018-06-01 19:38:50 -07:00