prepack
prepack copied to clipboard
A JavaScript bundle optimizer.
Whilst working with React children, one of the operations we do is "flatten" arrays. This is a very common use-case in JS applications and it seems to be one that...
Prepacking this, with *--instantRender* (to trigger realm.arrayNestedOptimizedFunctionsEnabled, which is not otherwise directly exposed via the CLI)... ```js function f(a) { return Array.from(a).map(function() { function g() { return 21 + 21;...
Using ES2015 tagged template literals makes use of a `$TemplateMap` on the realm. When we `evaluateForEffects` and create a tagged template inside some effects, then revert the effects, it's expected...
## Input ```js "use strict"; var object = { *["a"]() { yield 1; yield 2; }, }; var x = Object.keys(object); ``` ## Output ```js "use strict"; var x, object;...
I need this to work: ```js let f = __abstract(":object", "(__f)"); global.result = f().p; ``` But it currently fails because the access to `.p` is not known to be safe....
The diagnostics message in #2566 was really not meant for an end-user, but for Prepack developers only. Similarly, to diagnose issues like in #2564, some extra internal information, here the...
This... ```js let x = __abstract("boolean", "(x)"); if (x) console.log("Hello"); if (x) console.log(" World"); ``` currently prepacks to ```js (function () { var _0 = x; if (_0) { console.log("Hello");...
![image](https://user-images.githubusercontent.com/13050025/44615639-8753ff80-a871-11e8-8066-942fdf765039.png)
Flow doesn't support optional field in classes. Internally, we transpile using the class fields transform which turns all Flow annotated fields into field initializers with `undefined`. So ObjectValue turns into...
This triggers an invariant violation. ``` node lib/prepack-cli.js --debugDiagnosticSeverity foo ``` It shouldn't. The command-line argument processing should rather print a user-friendly error message in such cases and exit, like...