Commit Graph

6 Commits

Author SHA1 Message Date
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
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
Sebastian Markbåge
111af14f61 Refactor the public API in a similar style to Babel API (#469)
* Refactor the public API

This refactors the public Node API to mimic the
[Babel API](http://babeljs.io/docs/usage/api/). This is a bit more
idiomatic than "run CLI" or instantiate the full serializer object.

I'm passing a single options object instead of individual arguments. This
is a bit more managable as the option list grows.

The prepack-node file is what is exposed in Node which has a file system
API. Both synchronous and asynchronous forms. prepack-standalone is a
module for environments without access to the file system such as browsers.
I configure this to be exposed by default for such environments.

That way we can also use this in the webpack build so that our own repl
on the website can just use this public API.

* Throw an error when serialization fails

This lets any compiler flow to terminate properly by default but the error
can safely be ignored if we've already printed error messages for it such
as in the CLI.

Turn internalDebug error messages off by default but allow it to be
configured.

* Added missing realm options

Not yet exposed in the cli but available through the API.
2017-04-27 00:30:00 -07:00
Nikolai Tillmann
4ff07e6685 Splitting up serializer into types/serializer/visitors. Adding Flow annotations as needed at module boundaries. 2017-04-11 10:30:46 -07:00
Nikolai Tillmann
dc166cbbf5 Mechanical search+replace renaming of everything relating to serializer. 2017-04-10 18:00:47 -07:00
Eli White
6a30cdb992 Create a webpack bundle entry point (#364) 2017-04-06 18:52:15 -07:00