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
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
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
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
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
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
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
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
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
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
Summary: Bump PrePack version to new alpha
Reviewed By: NTillmann
Differential Revision: D8162723
fbshipit-source-id: 13b374d62bfba4fe628c3591c9fd4a4dabb47674
Summary:
Fixing havocing of bindings.
adds support for ReactDOM.createPortal inlining
Stop using joinEffectsAndPromoteNested
opt out of optimizing a React component in a tree with `__doNotRender`
if left and right in createFromConditionalOp are equal, do early return
all serializer tests now get linted via ESlint for correct output
all globals emitted reference the global identifier
Support for --delayInitializations for optimized functions
Fix abstract values not being coerced into strings for the Error constructor
Reviewed By: NTillmann
Differential Revision: D8162599
fbshipit-source-id: e28495eeb4445d99cb93afc2dce331af077c4faf
Summary:
Support switch statements where the switch value is abstract and one or more cases throw.
Fixed bug with implicitly converting unknown values to Object.
The React reconciler now throw a FatalError upon encountering side-effects in a render.
Fix while and for loops with unlabeled breaks
Removing --simpleClosures option.
Improve code generation in presence of exceptions.
Default to StrictMode when mixed StrictMode is serialized between function entries.
Better debug logging with --debugScopes
Allocate by using `new Array(n)`.
Fix problems with duplicated and missing statements.
Do not generate code for unreachable global code statements.
Simplify the ToObject serialization output.
Serialization outputFixes an issue with getOwnPropertyDescriptor when dealing with a native prototype function.
More compact code generation by avoiding introducing local variables for abstract values when possible.
Fixes problem with result of Array.filter (and similar) applied to arrays with unknown properties.
Adds support for spread syntax.
Speeding up Prepack by 22%, saving 8% memory.
Add reading wiki link to places.
Make some files flow strict.
Better crash logging.
Provide error feedback when timing out.
Implement const/let pattern declarations.
Adds support for more console methods.
More simplification rules.
Stop the prototype cycle check if an object (e.g. proxy) uses non-ordinary prototype methods.
Fix numerous problems with code ordering.
issues fixed
Reviewed By: simonhj
Differential Revision: D8048481
fbshipit-source-id: 36a464feb74233f68f3476c74f4070103e6a2584
Summary:
Release notes: adds experimental `react-dom/server` ahead-of-time rendering to string
This PR was part of a small 1-2 day hackathton to see the applicability of creating a server-side renderer based almost entirely to be a 1:1 of `ReactDOMServer` from `react-dom/server` package. This is by no means a full, complete server renderer but is the foundations for us to do further work on this path in the future. Currently, it consists of a single Jest test, to ensure the output of the Hacker News benchmark matches that of the current ReactDOMServer `renderToString` output.
The performance results look very promising (there are some `console.time` lines you can comment out in the test to see the performance for yourself). This implantation essentially compiles away `react` and `react-dom/server` and instead injects runtime helper functions that do things that cannot be statically determined ahead of time.
Lots of features are missing behind `invariant` TODOs. This was done intentionally.
Closes https://github.com/facebook/prepack/pull/1940
Differential Revision: D8075964
Pulled By: trueadm
fbshipit-source-id: 33b3c7ba26b41871ccd15ad8bde4ad257009fed6
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
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
Summary:
Allow break/continue to be guarded by abstract conditions inside loops
Collect fine-grained statistics on memory usage
Resolves issues with outer declarations moving into nested scopes
Fixes simplification bug involving comparisons with NaN
Support temporal assignment to object properties using unknown property names
Support multiple assignments to unknown properties in optimized functions
Adds ReactDOM mocks to fb-www compatibility mode
Adds pure scope support for abstract arguments with UpdateExpression
Fixed code duplication bug
10% memory savings when running Prepack
Lots of bug fixes, especially around optimized functions.
Reviewed By: yinghuitan
Differential Revision: D7855871
fbshipit-source-id: f0af26e08dda39a4b125120f9294f85d90e55186
Summary:
Release note: none
Enable test fb-www 12.
While I'm at it, also update package.json to get rid of deprecated -- option and thus shut up a warning about it in CircleCI.
Closes https://github.com/facebook/prepack/pull/1817
Differential Revision: D7824465
Pulled By: hermanventer
fbshipit-source-id: ed88bd1ed8b02c560faf58be24a6592b3e55b86b
Summary:
* `test-react` now gets run before `test-serializer-with-coverage` on the CI
* fixes a regression where on* events would not be stripped in React firstRender mode
* Use 66% less memory, run 42% faster
Reviewed By: NTillmann
Differential Revision: D7759044
fbshipit-source-id: ddb9bfdabf3c0c0ed34215ac3ad69e8bdd159e09
Summary:
This adds a React-specific internal test for Prepack to fbsource. It's meant to be land-blocking.
I checked in a manually edited bundle that has no dependencies except `react` and `react-dom` (so it's not too difficult to maintain). I also checked in a snapshot test for what it should render.
The test step consists of running the Jest test (to verify it works *before* Prepack), then using the existing `debug-fb-www` command to produce a bundle, and finally running the same Jest test again.
Currently this only checks the initialization path. When render path serializer bugs are fixed, we can run the same bundle in the render mode as well (and catch further regressions).
Reviewed By: NTillmann
Differential Revision: D7675812
fbshipit-source-id: 99fe3bd700ae3557ee6245f1e8e1e835399625b5
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
Summary: Bump PrePack alpha version in preperation for next release
Reviewed By: yinghuitan
Differential Revision: D7679290
fbshipit-source-id: 464ca03b4c0e92287bed6100082ae6cd1f658976
Summary:
Works on windows now
There was nothing that verified that our yarn.lock was up-to-date in our CI. Added the `--frozen-lockfile` option to CircleCI and `package.json` to make sure that we update the `yarn.lock` when we put up a commit.
Improved code generation in the presence of branching
CI uses Node 8.9.4 for better performance and prepublishOnly for NPM publishing
Execute Do/While loop condition in the proper place
Introducting new option --invariantLevel NUMBER and dropping --omitInvariants
Adds`createRef` and `forwardRef` to the React compiler
Diagnostic PP1001 for variable write conflict among optimized functions
Reviewed By: yinghuitan
Differential Revision: D7679206
fbshipit-source-id: e6f78c679e26b3827af47ff1d8ff320f242c62f1
Summary:
Release Notes: Works on windows now?
Solves #1695.
Since v8-profiler doesn't work properly on some platforms, make it a conditional dependency. If it fails to install, it won't stop the installation of Prepack entirely now. If the dependency is nonexistant, using the `--cpuprofile` option will throw an error.
Closes https://github.com/facebook/prepack/pull/1748
Differential Revision: D7675383
Pulled By: cblappert
fbshipit-source-id: db24ae153499e05d7ce8035b426bbe6954f1fb12
Summary:
There was nothing that verified that our yarn.lock was up-to-date in our CI. Added the `--frozen-lockfile` option to CircleCI and `package.json` to make sure that we update the `yarn.lock` when we put up a commit.
Closes https://github.com/facebook/prepack/pull/1739
Differential Revision: D7648314
Pulled By: cblappert
fbshipit-source-id: 5261fa57ee0d65754e8683dca211864d9ed4e8f2
Summary:
Release notes: CI uses Node 8.9.4 for better performance and prepublishOnly for NPM publishing
I found in local testing that Node 8.9.4 offers *much* better performance with Prepack, around 3-4x faster on large files. I also noticed we were using `prepublish` when causes `yarn` to call `yarn build`, which isn't really what we want from running `yarn`. Furthermore, `prepublish` has been deprecated in favor of `prepublishOnly` – meaning we save around 60 seconds on the CI build just from that.
Closes https://github.com/facebook/prepack/pull/1738
Differential Revision: D7615092
Pulled By: trueadm
fbshipit-source-id: 7d80212641d01f94c54a3ac7b3fbf9071a7737a5
Summary:
Release note: Diagnostic PP1001 for variable write conflict among optimized functions
Remove an erroneous invariant that asserts that a fatal error has been issued earlier for a variable write conflict among optimized functions.
Replaced with a recoverable error.
Closes https://github.com/facebook/prepack/pull/1729
Differential Revision: D7589858
Pulled By: hermanventer
fbshipit-source-id: 9a666c969c853b94dc7edcf9a08440ee14fc6d27