Commit Graph

50 Commits

Author SHA1 Message Date
Chris Blappert
d3ca583d46 Bump flow version (#2557)
Summary:
Release Notes: None

Bump flow version to newest version to stop Nuclide and `yarn flow` from fighting locally.
Pull Request resolved: https://github.com/facebook/prepack/pull/2557

Reviewed By: QueryConnectionException

Differential Revision: D9952840

Pulled By: cblappert

fbshipit-source-id: 2b52c04abd79a645b772c3a45d6ec81c831a27d3
2018-09-20 13:58:44 -07:00
Rafael Oleza
781cae5b38 Use caret to depend on Babel@7
Summary: Now that babel 7 is stable we can use caret as we use from other tools (like Metro). `yarn.lock will make sure it does not get updated until we want

Reviewed By: pvdz

Differential Revision: D9861594

fbshipit-source-id: 9d27d9c91f2b4e28d8a3c914e9b578eb9f0dc90e
2018-09-18 04:24:39 -07:00
kdex
eef69b9463 Substitute v8-profiler with v8-profiler-node8 (#2525)
Summary:
This commit addresses issue #2520. In brief, `v8-profiler` fails to build on recent node versions.
Pull Request resolved: https://github.com/facebook/prepack/pull/2525

Reviewed By: hermanventer

Differential Revision: D9689106

Pulled By: NTillmann

fbshipit-source-id: 9169321bdc23dfbfdf24b50fe7885dab36c5322e
2018-09-07 16:39:23 -07:00
Herman Venter
ebab0a7015 Upgrade Flow and fix new warnings (#2526)
Summary:
Release note: Update to Flow v80

Fix new class of warnings.
Pull Request resolved: https://github.com/facebook/prepack/pull/2526

Differential Revision: D9621986

Pulled By: hermanventer

fbshipit-source-id: 365b73a0aaa68b0f509a1931345d8100ca52c94b
2018-08-31 16:29:56 -07:00
Dominic Gannaway
94babbbb9d Update Babel 7 to stable release (#2499)
Summary:
Release notes: update Babel 7 to stable release
Pull Request resolved: https://github.com/facebook/prepack/pull/2499

Differential Revision: D9540033

Pulled By: trueadm

fbshipit-source-id: 43c29ffa22693014e35e494b7127fedd1f5049c5
2018-08-28 12:55:27 -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
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
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
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
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
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
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
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
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
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
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
Xun Li
306ea4f625 Update Flow version
Summary:
Update to 72. Run yarn flow and verify it's all good
Closes https://github.com/facebook/prepack/pull/1939

Differential Revision: D7961902

Pulled By: lxfind

fbshipit-source-id: 246d8abef788685d4d6e57406e15f8f8e56650c2
2018-05-10 20:11:23 -07:00
Jeffrey Tan
c2e614182e Fix ESLint crash
Summary:
Release note: None
ESLint crashes with the flow fix I did earlier. Turns out updating ESLint to latest version fixed it.
Closes https://github.com/facebook/prepack/pull/1927

Reviewed By: NTillmann

Differential Revision: D7946856

Pulled By: yinghuitan

fbshipit-source-id: 44995ed89b516651d85918c6b08b6048916bbb09
2018-05-09 22:13:21 -07:00
Nikolai Tillmann
131d3db83a Upgrading flow to 0.71
Summary:
Release notes: None
Closes https://github.com/facebook/prepack/pull/1851

Differential Revision: D7855926

Pulled By: NTillmann

fbshipit-source-id: 491cf39e281acee7119aab8e7faf301f11cca008
2018-05-02 19:13:58 -07:00
Peter van der Zee
a0703ec2a0 Upgrade Prettier to v1.12.1 on fbsource
Summary:
Updates Prettier to v1.12.1, using `xplat/js/scripts/prettier-bump.js` based on the playbook by https://our.intern.facebook.com/intern/wiki/Prettier/upgrade-guide/

All changes related to upgrading or running Prettier

allow-many-files
allow-large-files
bypass-lint
drop-conflicts
ignore-conflict-markers
ignore-signed-source
ignore-nocommit

Reviewed By: benjaffe, ryanmce, yungsters

Differential Revision: D7652946

fbshipit-source-id: 396d45c675e93f2298cd2920d927630c81867447
2018-04-19 02:37:00 -07:00
Dominic Gannaway
6ec280b8c8 Adds getDerivedStateFromProps support and updates React version deps
Summary:
Release notes: adds React 16.3 `getDerivedStateFromProps` support to the React compiler

This PR adds support for the React 16.3 `getDerivedStateFromProps` lifecycle event on class components. I've also updated the React testing dependencies to 16.3.1. I also extended the `componentWillMount` logic to support `UNSAFE_componentWillMount` too.
Closes https://github.com/facebook/prepack/pull/1730

Differential Revision: D7586378

Pulled By: trueadm

fbshipit-source-id: 895e74ca86eb9ff9ad04aa93f021c107f08a7b9f
2018-04-11 10:11:33 -07:00
Nikolai Tillmann
4d8b90a94e Upgrading to Flow .69, starting @flow strict annotations
Summary:
Release notes: None

Upgraded to Flow .69
Added [strict] section to .flowconfig
Started going strict with a simple file

The Flow team suggests to do this on a file-by-file basis,
instead of doing it on a rule-by-rule basis.
Closes https://github.com/facebook/prepack/pull/1692

Differential Revision: D7478479

Pulled By: NTillmann

fbshipit-source-id: b279f6b3a350cc70c263b693522016a20fc8d5d7
2018-04-02 22:28:33 -07:00
Nikolai Tillmann
d025cd20b8 Adding --cpuprofile option to prepack-cli
Summary:
Release notes: None

Adding ability to record CPU profile traces from node/v8.
Closes https://github.com/facebook/prepack/pull/1624

Differential Revision: D7343153

Pulled By: NTillmann

fbshipit-source-id: 0e64d752aa230ab01ee991708b2b41dc414bec8a
2018-03-21 12:09:17 -07:00
Herman Venter
40c6e8ddb6 Fix Flow v68 errors
Summary:
Release note: Add source annotations to satisfy latest version of Flow

Flow now complains about missing properties in more situations.
Closes https://github.com/facebook/prepack/pull/1612

Differential Revision: D7324360

Pulled By: hermanventer

fbshipit-source-id: 0aa40f2442a13c87258179f2151864cf9c921215
2018-03-19 11:57:38 -07:00
Dominic Gannaway
21fcfb2a09 Adds React.createContext API support
Summary:
Release notes: none

Adds React.createContext support to the React compiler. Updates Yarn dependencies to use React 16.3 pre-release version so tests can validate new API works with the compiler.
Closes https://github.com/facebook/prepack/pull/1548

Differential Revision: D7209302

Pulled By: trueadm

fbshipit-source-id: fff360ee19d4d9fee6e27b738658d9076449da4b
2018-03-11 13:12:41 -07:00
Dominic Gannaway
8a61c0c929 Update webpack and change Babel settings
Summary:
Release notes: Prepack now ships Node 6.1+ compatible source

This PR does four things:

- updates webpack to v4
- changes our Babel presets so we now transpile far less code, in fact we now target node 6.1+ min (as we already specified in package.json). The bundle created for the REPL still targets ES5.
- updated eslint
- updated circleci node version to 9.7.1 (yarn says it doesn't support it, but there appears to be no issues)

This should improve runtime performance and make debugging easier. In fact, there's no real need for sourcemaps now, as the code looks almost identical minus module references.

Performance comparisons:

Before:
<img width="550" alt="screen shot 2018-03-04 at 8 34 10 pm" src="https://user-images.githubusercontent.com/1519870/36957766-9ddb8da4-1feb-11e8-89df-c5e6236fa502.png">
After:
<img width="550" alt="screen shot 2018-03-04 at 8 34 22 pm" src="https://user-images.githubusercontent.com/1519870/36957768-a0801cd2-1feb-11e8-8f4e-727ce7f38fb9.png">

Before:
<img width="554" alt="screen shot 2018-03-04 at 8 35 07 pm" src="https://user-images.githubusercontent.com/1519870/36957769-a21ded94-1feb-11e8-8362-b4faba66bc48.png">
After:
<img width="550" alt="screen shot 2018-03-04 at 8 35 13 pm" src="https://user-images.githubusercontent.com/1519870/36957771-a3e2f1ba-1feb-11e8-92dd-134c613f0282.png">

Before:
<img width="691" alt="screen shot 2018-03-04 at 8 43 23 pm" src="https://user-images.githubusercontent.com/1519870/36957902-bd66a266-1fec-11e8-84ee-0d1466c64e32.png">
After:
<img width="681" alt="screen shot 2018-03-04 at 8 43 16 pm" src="https://user-images.githubusercontent.com/1519870/36957904-c11aa75e-1fec-11e8-8036-c7ad17f5dafd.png">
Closes https://github.com/facebook/prepack/pull/1532

Reviewed By: sophiebits

Differential Revision: D7156411

Pulled By: trueadm

fbshipit-source-id: 94f5411e4e849d0577555788ddcd7982912f3176
2018-03-05 20:54:26 -08:00
Nikolai Tillmann
50243775b1 Adding --repro command line option for easy reproducibility
Summary:
Release notes: New --repro command line option for easier bug reporting

This new option creates a handy .zip file with everything in it to reproduce an issue.
Closes https://github.com/facebook/prepack/pull/1499

Differential Revision: D7086115

Pulled By: NTillmann

fbshipit-source-id: be9e84ea246689dd1073a2fd713ec2599c98350c
2018-03-03 10:31:33 -08:00
Nikolai Tillmann
691769970e Using a custom Base62 encoding function.
Summary:
Release notes: Removing dependency on Base62 npm package which collects Google Analytics information at installation time.

Addressing #1503.
Closes https://github.com/facebook/prepack/pull/1504

Differential Revision: D7102527

Pulled By: NTillmann

fbshipit-source-id: 4aaa9fe6f4517dac5f418e546e7015741c2e368e
2018-02-27 13:53:56 -08:00
Dominic Gannaway
f40972ddd3 Updated package.json and yarn.lock test dependencies
Summary:
Release notes: none

Updated package.json and yarn.lock test dependencies for internal updates.
Closes https://github.com/facebook/prepack/pull/1420

Differential Revision: D6937552

Pulled By: trueadm

fbshipit-source-id: c93e56e2dfdedea65bd1cd8ca231c6e3f53d7bb9
2018-02-08 09:25:01 -08:00
Herman Venter
0ea4c473b4 Update flow version
Summary: Update Flow to version 61 and deal with changes in the behavior of Flow.

Reviewed By: yinghuitan

Differential Revision: D6631584

fbshipit-source-id: f00c2707bcb991ffbdb3e2e74b6a49032f06a5e4
2017-12-22 17:39:16 -08:00
Leo Balter
df0f9e16ae Use integration api to run Test262 tests
Summary:
This method provides an alternative way to run Test262 through a
stream of compiled test contents for each scenario (default, strict
mode), including all the necessary harness contents.

The logic to capture an execution success or failure is similar to
the original one - from scripts/test262-runner.js - and improvements
should be done as follow ups.

The filtering system is now done through a configuration yaml file,
using tests metadata and path locations. This filter is used as an
object that can be extended with further logic, but still offers a
single point to check for filtering.

The report system requires some improvements and these should also
be done as follow-ups. For now they provide a report for each
folder and the total results. Although, the results data contain
enough information to highly expand the report.

Some further improvements are expected and planned, this work
should be at least ready for an initial round for feedback review.
Closes https://github.com/facebook/prepack/pull/1122

Reviewed By: cblappert

Differential Revision: D6456700

Pulled By: hermanventer

fbshipit-source-id: ba56efcaa4eab847594cb7c1fbc908cf1fc66a80
2017-12-01 17:46:29 -08:00
Dominic Gannaway
810056d1ec Add React functional component folding
Summary:
Release note: Adds experimental React functional component folding optimizations

This PR is stacked upon PRs #1118 and #1117. Thus, those PRs should be merged before this PR is merged to reduce noise in the diff.

This PR adds a new React Reconciler into Prepack's serialization process, so that React components trees can be folded/inlined into a single component at build time. To fold a component tree, it must be explicitly done via `__registerReactComponentRoot(nameOfComponent)`.

This PR only attempts to fold React functional components, not React ES2015 class components (that will come in another PR at a later date). Furthermore, the `props` parameter on a root component must contain Flow type annotations (otherwise we will have no idea what the values might be). Support flow `propTypes` might also be an addition, but not for this PR.

If the reconciler comes across a component that it cannot fold/inline, it will "bail-out" and try and continue the process without that particular component being folded into the tree.

An example of how this all works (input):

```jsx
function App(props: {title: string}) {
  return (
    <div>
      <ChildComponent title={props.title} />
    </div>
  );
}

function ChildComponent(props) {
  return (
    <span>
      <SubChildComponent {...props} />
    </span>
  );
}

function SubChildComponent(props) {
  return <span>{props.title.toString()}</span>
}

__registerReactComponentRoot(App);

global.App = App;
```

Output:
```jsx
(function () {
  "use strict";

  var _$1 = this;

  var _0 = function (props) {
    var _$0 = props.title;
    return <div><span><span>{_$0}</span></span></div>;
  };

  _$1.App = _0;
}).call(this);
```
Closes https://github.com/facebook/prepack/pull/1120

Differential Revision: D6237333

Pulled By: trueadm

fbshipit-source-id: b58c7d8979ca79a766bb2ee2eb01a380d37c3101
2017-11-06 05:07:36 -08:00
Herman Venter
4944f2e939 Fix flow errors
Summary:
Update Flow and fix errors found by new version.

I'm none to sure the changes to the code are desirable. Perhaps the flow types for babel-types need to be updated?
Closes https://github.com/facebook/prepack/pull/1127

Differential Revision: D6222475

Pulled By: hermanventer

fbshipit-source-id: 208b89787914fc7d1e322cb14a6ff2374cd24b9a
2017-11-03 00:10:03 -07:00
Dominic Gannaway
e63daa5585 Add React/Jest testing infrastructure
Summary:
Release note: none

This PR adds the React/Jest testing infrastructure to Prepack and is stacked on the PR https://github.com/facebook/prepack/pull/1117. Thus, that PR should be merged before this PR is merged to reduce noise in the diff.

This will allow us to test various runtime outputs of React 16 when running original source vs Prepacked source to see if there are any issues/differences that might have an impact on applications. The primary reason for this is to track regressions for the component folding PRs that will land in the future.

Please note, this PR does not contain any reconciler changes, thus `__registerReactComponentRoot(App);` has been commented out of tests to ensure they don't prematurely fail. A follow up PR will enable them once the other React functional component folding PRs get landed.

This PR also adds some mock React globals to be used within tests (and maybe to be further integrated into folding at a future point too). The mocks include `React.Component` and `React.cloneElement` for now.

Furthermore, a `utils/json.js` utility file exists to help normalize the results from the React test renderer so that adjacent JSON text nodes get merged, which is something that may exist because of how the reconciler (once the PR lands) handles inlining of child nodes.

The command to run React tests is `yarn test-react`.
Closes https://github.com/facebook/prepack/pull/1118

Reviewed By: cblappert

Differential Revision: D6208263

Pulled By: trueadm

fbshipit-source-id: d54f3b0e1cc3240e1f142d3da08bc279e4153889
2017-11-02 04:40:33 -07:00
Wuhan Zhou
f6279bd814 Framework for debug adapter and mock ui
Summary:
Release note: none
Issue: #907

- Mock UI as a CLI to communicate with the adapter
- Starter code for the debugger adapter with an initialize request
Closes https://github.com/facebook/prepack/pull/1088

Differential Revision: D6108024

Pulled By: JWZ2018

fbshipit-source-id: 506ec039dcb1ff540872cb2e1a87a165cfd22e4d
2017-10-20 11:08:33 -07:00
Dominic Gannaway
cfc6993e9c Basic JSX/ReactElement support
Summary:
Release notes: adds JSX and ReactElement evaluation/serialization support

This adds JSX/ReactElement support to the Prepack serializer so `ReactElement` "like" objects can correctly be converted back to JSX syntax. Example:

```jsx
'use strict';

const externalThing = __abstract('function', 'externalThing');

function Test() {
  return <div>{ externalThing() }</div>
}

global.test = Test;
```

Becomes:
```jsx
'use strict';

var _$0 = this;

var _0 = function () {
  return <div>{_1()}</div>;
};

var _1 = externalThing;
_$0.test = _0;
```

I've also added a JSXElement -> ReactElement evaluator.
Closes https://github.com/facebook/prepack/pull/1051

Differential Revision: D6053275

Pulled By: trueadm

fbshipit-source-id: 7c31545751ceedba55cdd4581bc6de51a98b412a
2017-10-13 12:18:35 -07:00
chico
1edb96ade2 Update Flow to 0.54.0
Summary:
Closes #905

Error mentioned in issue above was fixed in d145b375ed
Closes https://github.com/facebook/prepack/pull/947

Differential Revision: D5812790

Pulled By: yinghuitan

fbshipit-source-id: 00779dd18a334d6b15cacf8d98b05b780e6844ee
2017-09-11 22:54:02 -07:00
Andres Suarez
69f5d05ebc Upgrade to babylon@6.18.0
Summary: babylon@6.18.0 has support for "opaque type alias" syntax (https://github.com/babel/babylon/releases/tag/v6.18.0 and https://medium.com/flow-type/hiding-implementation-details-with-flows-new-opaque-type-aliases-feature-40e188c2a3f9).

Reviewed By: cblappert

Differential Revision: D5706930

fbshipit-source-id: 8cdaee77b838812ebb012a352f7e77b74838b536
2017-08-29 16:26:03 -07:00
Herman Venter
f8bf43f673 Update yarn.lock
Summary:
Update Babylon and adjust expected pass count to match what I see on my laptop.

The difference was due to my version of Babylon (which is the latest for some or other reason I don't understand) giving a syntax error that did not occur with the version on the CI machine. Updating the yarn lock file gets the CI machine in sync with my laptop with respect to those tests.

Note that some String.prototype tests only pass with recent versions of Node.
Closes https://github.com/facebook/prepack/pull/831

Differential Revision: D5489742

Pulled By: hermanventer

fbshipit-source-id: 5732e47718c53d9f20de04fd64c1389524f33309
2017-07-25 14:27:51 -07:00
Nikolai Tillmann
649834eae9 @allow-large-files [prepack][PR] Updating Flow, and removing no longer needed suppression.
Summary: Closes https://github.com/facebook/prepack/pull/827

Differential Revision: D5484313

Pulled By: NTillmann

fbshipit-source-id: 7832fc792d8964735fb598e09389fb48e495d541
2017-07-24 18:26:49 -07:00
Jeffrey Tan
3c0b057e1a Enable eslint prettier plugin
Summary:
After adding this plugin, you just need to install https://github.com/AtomLinter/linter-eslint Atom package to surface ESLint errors(including prettier errors) in Nuclide linter UI. You also got auto-fix support in the Nuclide UI. Similarly, in VSCode, you can install https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint plugin to surface ESLint error in VSCode UI.
One caveat is that, eslint-plugin-prettier uses its own version of prettier(1.3.1) which may diverge from what we want. If we really found a file that diverge in formatting, we may have to add it into .eslintignore to ignore from UI/linter.
Closes https://github.com/facebook/prepack/pull/816

Differential Revision: D5444642

Pulled By: yinghuitan

fbshipit-source-id: 1670129d62e5e799a50c53d78387b5ded4c2c964
2017-07-18 14:09:05 -07:00
wdhorton
7f5ec3b43f Making Prettier a check-in gate
Summary:
This supersedes #760.

Additional changes over #760:
Pinning Prettier version to get some formatting always. (Different prettier versions were responsible for the observed flip-flopping of StringPrototype.js.)
Print output of prettier in wrapper script for better diagnosis / experience. (TODO: How to just pipe through console output? Couldn't get it to work.)
Updating problematic .js file for the last time.
Closes https://github.com/facebook/prepack/pull/787

Differential Revision: D5382336

Pulled By: NTillmann

fbshipit-source-id: 95ed988ef3f091493d2fb509b5481753d56901cd
2017-07-07 11:35:32 -07:00
wdhorton
f909b69a74 Enable Prettier and remove conflicting eslint rules.
Summary:
Per discussion in #729, this sets up prettier but doesn't actually run it on the codebase.
Closes https://github.com/facebook/prepack/pull/759

Reviewed By: Kishore-B-Rao

Differential Revision: D5343135

Pulled By: NTillmann

fbshipit-source-id: 638740d48b6fa797fa79b8b5fd3c032497cb0132
2017-06-29 12:23:49 -07:00
Chris Blappert
bc8651356f Weekly release v0.2.4: node8, bugfixes, new optimization
Summary: Change version number, yarn.lock in preparation of publishing new npm package

Reviewed By: NTillmann

Differential Revision: D5292317

fbshipit-source-id: d91edcbdbbcfe9a0e7ad2530700899e3ef3cfb60
2017-06-21 08:23:07 -07:00
Henry Zhu
923dea7aa3 Use preset-env (#512) 2017-05-23 17:30:54 -04:00