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
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
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
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
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
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
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
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
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
Summary: Change version number, yarn.lock in preparation of publishing new npm package
Reviewed By: NTillmann
Differential Revision: D5292317
fbshipit-source-id: d91edcbdbbcfe9a0e7ad2530700899e3ef3cfb60