A JavaScript bundle optimizer.

Overview

Prepack Circle CI

Prepack is a partial evaluator for JavaScript. Prepack rewrites a JavaScript bundle, resulting in JavaScript code that executes more efficiently. For initialization-heavy code, Prepack works best in an environment where JavaScript parsing is effectively cached.

See the official prepack.io website for an introduction and an interactive REPL playground.

Status

We, the Prepack team at Facebook, have temporarily set down work on Prepack including the React compiler project. You won't see many Prepack PRs while we are currently prioritizing some other projects.

How to use Prepack

Install the CLI via npm,

$ npm install -g prepack

Or if you prefer yarn, make sure you get yarn first,

$ npm install -g yarn

and then install the Prepack CLI via yarn:

$ yarn global add prepack

You may need to prepend (pun intended!) the command with sudo in some cases.

Let the party begin

To compile a file and print the output to the console:

$ prepack script.js

If you want to compile a file and output to another file:

$ prepack script.js --out script-processed.js

Detailed instructions and the API can be found at Prepack CLI: Getting Started

Plugins to other tools

The following are a few plugins to other tools. They have been created and are maintained separately from Prepack itself. If you run into any issues with those plugins, please ask the plugin maintainers for support.

Test Results and Code Coverage

How to get the code

  1. Clone repository and make it your current directory.
  2. git submodule init
  3. git submodule update --init
  4. Get yarn and node, then do yarn

Note: For development work you really need yarn, as many scripts require it.

How to build, lint, type check

  1. Get the code
  2. yarn build
    You can later run yarn watch in the background to just compile changed files on the fly.
  3. yarn lint
  4. yarn flow

How to run tests

  1. Get the code
  2. Make sure the code is built, either by running yarn build or yarn watch
  3. yarn test

You can run individual test suites as follows:

  • yarn test-serializer
    This tests the interpreter and serializer. All tests should pass.
  • yarn test-test262
    This tests conformance against the test262 suite. Not all will pass, increasing conformance is work in progress.

How to run the interpreter

  1. Get the code
  2. Make sure the code is built, either by running yarn build or yarn watch
  3. yarn repl
    This starts an interactive interpreter session.

How to run Prepack

  1. Get the code

  2. Make sure the code is built, either by running yarn build or yarn watch.

  3. Have a JavaScript file handy that you want to prepack, for example:
    echo "function hello() { return 'hello'; } function world() { return 'world'; } s = hello() + ' ' + world();" >/tmp/sample.js

  4. cat /tmp/sample.js | yarn prepack-cli
    Try --help for more options.

How to validate changes

Instead of building, linting, type checking, testing separately, the following does everything together:
yarn validate

How to edit the website

The content for prepack.io resides in the website directory of this repository. To make changes, submit a pull request, just like for any code changes.

In order to run the website locally at localhost:8000:

  1. Build prepack into the website: yarn build && mv prepack.min.js website/js
  2. Run python -m SimpleHTTPServer (Python 2) or python -m http.server (Python 3) from the website/ directory

How to contribute

To read more about the project, check out this suggested reading wiki

For more information about contributing pull requests and issues, see our Contribution Guidelines.

License

Prepack is BSD-licensed. We also provide an additional patent grant.

Comments
  • Throw an error when side-effectful logic happens in a React component tree

    Throw an error when side-effectful logic happens in a React component tree

    Release notes: the React reconciler now throw a FatalError upon encountering side-effects in a render

    This PR revamps the current React system's restrictions for what you can and can't do during the React reconcilation phase. This is a pretty large update but provides much better boundaries between what is "safe" and not "safe", thus reducing the constraints.

    1. A new error ReconcilerRenderBailOut is thrown if something occurs in the React reconciliation that causes the render to fail and it's a hard fail – no recovering and continuing.
    2. If you mutate a binding/object outside the render phase, given the React component render phase is meant to be "pure", a ReconcilerRenderBailOut will be thrown.
    3. If you throw during the React reconciliation phase, again a ReconcilerRenderBailOut will be thrown.

    In the future, we should maybe loosen the constraints around all this and maybe allow throw, but right now it's causing too much friction. We should attempt to make React components render phase as pure as possible – as it results in much better optimizations by a compiler because we can assert far more without things tripping us up.

    Another point, regarding (1), is that we should ideally be able to recover from the error thrown in Prepack. The reason we can't and is something that might be a very deep issue in Prepack, is that effects don't properly restore when we have nested PossiblyNormalCompletions at work. Bindings get mutated on records from changes made within evaluateForEffects but never get reset when in nested PossiblyNormalCompletion. If I remove all the things that can cause PossiblyNormalCompletions then everything works fine and bindings do get restored. We can remove the constraint on (1) once we've found and fixed that issue.

    CLA Signed 
    opened by trueadm 22
  • Fix various issues in serializer and emitter around target body selection.

    Fix various issues in serializer and emitter around target body selection.

    Release notes: None

    This fixes #1821.

    Improve tracking of target bodies in Emitter, which is necessary now that generators can have effects and one should not attempt to emit into a body with the wrong effects in place; removed some dubious code there.

    It turned out that the exact placement of Object.freeze and similar statements was always a bit fragile; this issue came out after fixing the Emitter, and so this is made robust by keeping track of the emission of all other object property mutations, and only emitting the Object.freeze after they are all done.

    When visiting modified property bindings, re-visit object in case it was previously visited from a different scope.

    For objects visited (only) in scopes where additional generator effects have been applied, record additional information for serialization to ensure that these objects get serialized in their creation scopes, so that the initial values of the object properties are not polluted by the additional generator effects of some nested scope.

    Adding regression test.

    CLA Signed 
    opened by NTillmann 21
  • Can prepack run on itself?

    Can prepack run on itself?

    This is 100% not an issue but a question, so sorry for posting this here, but I don't see any other way to talk to the prepack community (any gitter/slack/etc channels?).

    I'm having too much fun using prepack with interpreters & compilers. Today I was able to turn my interpreter, which interprets high-level instructions, almost into a compiler by running prepack on it with a given source code: https://twitter.com/jlongster/status/948247424023322624

    I say "almost" because I don't really have a compiler yet. Prepack is running my VM and outputting the JS code itself. Evidently this is called Futamura projection. Since prepack isn't very fast though, this isn't extremely practical. I want just the raw compiler itself.

    What I learned from that wiki page is we can take this even further. Supposedly I can generate an actual compiler by "specializing the specializer for the interpreter" - meaning run prepack on a program that runs prepack on the interpreter.

    That would require prepack being able to run on itself. Is that possible? I'm going to try it tonight but given this is all blowing my mind, and I'm sure I'll run into problems, I'd like to know if anyone has tried that yet.

    question 
    opened by jlongster 21
  • Use integration api to run Test262 tests

    Use integration api to run Test262 tests

    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.

    CLA Signed 
    opened by leobalter 20
  • Thoughts about prepack

    Thoughts about prepack

    This is my initial thoughts when reading up on prepack.

    I heard about prepack on Twitter today and decided to figure out what it was. When browsing through the documentation as well as the examples, it felt like the main ideas of the tool was overshed by theory on the topic instead of how it could be used for a faster web.

    I really like the approach about backing up the documentation with details about what kind of Computer Science theories you've used in favor for the tool. The issue when trying to figure out how prepack worked on a lower level, was somewhat unclear to me. Even though you stated what it is, an evaluator..., Babel-Interpreter, these are hard topics to connect.

    I wanted to know how you managed to read the values, not only the tool you used for it. I wanted to know how the underlying logic of prepack were in synergy with each other; such as reading, evaluating and (replacing the code) in a general point of view. Lastly, I wanted to know how the tool is helping making the web a faster place and some demo files to download.

    Also, congrats on your release, the tool looks awesome! This Issue is optional feedback, but I feel like it could provide you with some insight about initial thoughts for the tool.

    Summary, fixes are optional! :

    1. More human-friendly documentation, with links to other README's that explain some concepts like static analysis
    2. Description of how the tool works from a middle/low level perspective
    3. Demo folders for users to download samples from/integrate the examples in the repo

    Cheers!

    question 
    opened by evenstensberg 17
  • [WIP] initial skipping tests

    [WIP] initial skipping tests

    My first take at: https://github.com/facebook/prepack/issues/472

    to have it only skip on circle I was thinking of checking for an environment variable:

    if(process.env.CIRCLECI)

    based on https://circleci.com/docs/1.0/environment-variables/

    If I'm way off base of what was expected, I'll be happy to rewrite if someone can point me in the correct direction.

    CLA Signed 
    opened by InTheCloudDan 16
  • Website code and warnings

    Website code and warnings

    cc @NTillmann

    Following up https://github.com/facebook/prepack/issues/2285, website shows the generated coded even when there are some warnings.

    Lot of changes because prettier wasn't applied to the files, but I basically only checked for the error buffer containing only items with severity === 'Warning' and create the warning result type to behave the same than success one.

    Next step would be to show the code AND warning messages. Either using the same display than error messages or creating a variation of it (changing text color to yellow for example). I can do it if you want.

    Let me know if this is what you were looking for.

    Have a nice day !

    P.S: not sure if this PR was supposed to be into gh-pages or master. Let me know if that needs to be changed.

    CLA Signed 
    opened by enzoferey 15
  •  Objects that are temporal should set _isScopedTemplate to true

    Objects that are temporal should set _isScopedTemplate to true

    Release note: Fixes problem with result of Array.filter (and similar) applied to arrays with unknown properties

    Closes: #1924

    Generator.deriveConcrete can result in temporal object values. These must be marked with _isScopedTemplate to prevent them from being hoisted.

    CLA Signed 
    opened by hermanventer 13
  • Adds createdAbstracts Set to effects/realm for tracking

    Adds createdAbstracts Set to effects/realm for tracking

    Release notes: adds createdAbstracts Set to both Effects and Realm.

    For a feature I'm working on, where we can optionally inline function calls depending on a bunch of pre-defined heuristics, I've run into the need for a feature for tracking abstract values. When we use evaluateForEffects we currently get quite a bit of information of what occurred, nicely packaged up in effects. One of those is createdObjects, which is super useful for many cases, but I believe we also need, is a way of knowing what AbstractValues were created in effects too. This PR adds that functionality.

    CLA Signed 
    opened by trueadm 12
  • Bug with simplifying abstract binary expressions

    Bug with simplifying abstract binary expressions

    Take the given example:

    function fn2(cond, obj) {
      if (cond) {
        return obj.x;
      }
      return false;
    }
    
    function fn(cond, obj1, obj2) {
      var res1 = fn2(cond, obj1);
      var res2 = fn2(cond, obj2);
    
      if (res1 > 0) {
        return res1.toString();
      }
      if (res2 > 0) {
        return res1.toString();
      }
      return null;
    }
    
    var cond = global.__abstract ? __abstract("boolean", "(false)") : false
    var obj1 = global.__abstract
      ? __abstract({ x: global.__abstract ? __abstract("boolean", "obj1.x") : false }, "({ x: false })")
      : { x: false };
    
    var obj2 = global.__abstract 
      ? __abstract({ x: global.__abstract ? __abstract("boolean", "obj2.x") : false }, "({ x: false  })")
      : { x: false };
    
    var result = fn(cond, obj1, obj2);
    

    In the output you can see that we're using _$0 even though it may not be used:

      var _2 = false;
      _$2.obj1 = {
        x: false
      };
      _$2.obj2 = {
        x: false
      };
    
      if (_2) {
        var _$0 = obj1.x;
      }
    
      if (_2) {
        var _$1 = obj2.x;
      }
    
      var _9 = _$0.toString();
    
      _$2.result = (_2 ? _$0 > 0 : false) ? _9 : (_2 ? _$1 > 0 : false) ? _9 : null;
    

    If I change the condition from if (res1 > 0) { to if (res1) {, the issue goes away. If I disable the simplifier entirely, this also fixes the problem.

    bug abstract priority: high react compiler 
    opened by trueadm 12
  • Allow for loops with abstract termination conditions to unroll

    Allow for loops with abstract termination conditions to unroll

    Release note: Certain for loops with abstract termination conditions can now be Prepacked

    Resolves issue: #2019

    If the termination condition involves an abstract value with a finite set of possibilities, such as in the test case, then it may be possible to unroll the loop a finite list of conditional executions of the loop body. Checking that this is possible is hard, so we speculatively unroll up to 10 times and give up if the termination condition does not become deterministically true during that time. Because such deep if trees cause the simplifier to do exponentially more work, we also limit the amount of simplification operations that can be done for a loop iteration before we give up.

    CLA Signed 
    opened by hermanventer 12
  • Bump chownr from 1.0.1 to 1.1.4 in /fuzzer

    Bump chownr from 1.0.1 to 1.1.4 in /fuzzer

    Bumps chownr from 1.0.1 to 1.1.4.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    CLA Signed dependencies 
    opened by dependabot[bot] 0
  • Bump chownr from 1.0.1 to 1.1.4

    Bump chownr from 1.0.1 to 1.1.4

    Bumps chownr from 1.0.1 to 1.1.4.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    CLA Signed dependencies 
    opened by dependabot[bot] 0
  • Bump ua-parser-js from 0.7.17 to 0.7.31

    Bump ua-parser-js from 0.7.17 to 0.7.31

    Bumps ua-parser-js from 0.7.17 to 0.7.31.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    CLA Signed dependencies 
    opened by dependabot[bot] 0
  • Bump tmpl from 1.0.4 to 1.0.5

    Bump tmpl from 1.0.4 to 1.0.5

    Bumps tmpl from 1.0.4 to 1.0.5.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    CLA Signed dependencies 
    opened by dependabot[bot] 0
  • Bump tar from 4.4.6 to 4.4.19 in /fuzzer

    Bump tar from 4.4.6 to 4.4.19 in /fuzzer

    Bumps tar from 4.4.6 to 4.4.19.

    Commits
    • 9a6faa0 4.4.19
    • 70ef812 drop dirCache for symlink on all platforms
    • 3e35515 4.4.18
    • 52b09e3 fix: prevent path escape using drive-relative paths
    • bb93ba2 fix: reserve paths properly for unicode, windows
    • 2f1bca0 fix: prune dirCache properly for unicode, windows
    • 9bf70a8 4.4.17
    • 6aafff0 fix: skip extract if linkpath is stripped entirely
    • 5c5059a fix: reserve paths case-insensitively
    • fd6accb 4.4.16
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    CLA Signed dependencies 
    opened by dependabot[bot] 0
  • Bump path-parse from 1.0.5 to 1.0.7

    Bump path-parse from 1.0.5 to 1.0.7

    Bumps path-parse from 1.0.5 to 1.0.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    CLA Signed dependencies 
    opened by dependabot[bot] 0
Releases(v0.2.54)
  • v0.2.54(Oct 8, 2018)

    • Fix referentialization of optimized functions
    • Fix serialization issues for nested optimized functions
    • Model aliasing effects for array loop operators
    • Fix dependency issues with cyclic prototype dependencies
    • Fix problem where a bind call can use a variable before its definition
    • Speed up visitor by skipping redundant generator scopes
    Source code(tar.gz)
    Source code(zip)
  • v0.2.52(Sep 20, 2018)

  • v0.2.51(Sep 5, 2018)

    • Fixed bugs that could cause generated code to throw
    • Improved evaluation of abstract conditionals
    • Added CLI options --warnaserror, --diagnosticaserror, --nodiagnostic
    • Added full support for React.Children.map mock
    Source code(tar.gz)
    Source code(zip)
  • v0.2.50(Aug 31, 2018)

    Highlights: Make simplification more robust when complexity limits are reached reduces loop iteration counter to 6 before bailing out We weren’t using the correct initializerAstNodeName in two places Tease apart expressions vs. statements for operation descriptors Simplify equality expressions where types are known Refactor AbstractObjectValue to use evaluateWithAbstractConditional Allow invalid render return values in the React reconciler update Babel 7 to stable release Speed up simplifier by using an implication cache per path branch Add basic support for throws in React

    Source code(tar.gz)
    Source code(zip)
  • v0.2.49(Aug 23, 2018)

    Fixes #2419 #2386 #2439 #2447 #2432 #2437 #2442

    • Fix havoced binding not in optimized function
    • Allow arrays with widened numeric properties to update index properties
    • Fix nested for statement bailout with nested for-in
    • Don’t record modified bindings for immutable bindings when havocing
    Source code(tar.gz)
    Source code(zip)
  • v0.2.48(Aug 16, 2018)

    Fixes #2151 #2222 #2279 #2393 #2399 #2404 #2411 #2414 #2415 Added a fuzz testing tool Added test cases Turn crash in JSON.stringify into a diagnostic Adds a arrayNestedOptimizedFunctionsEnabled flag to enable nested optimized functions derived from Array.prototype methods (like map) and Array.from Refactor assignment on partial or possibly deleted property Rewrote the joining logic to always do a full join at every join point Removed last remnants of delayUnsupportedRequires

    Source code(tar.gz)
    Source code(zip)
  • v0.2.47(Aug 10, 2018)

    - Many bug fixes
    - Progress in support for nested optimized functions
    - Fixing source map support
    - Improved support for abstract behavior in switch statements
    - Reduced memory usage of Prepack
    
    Source code(tar.gz)
    Source code(zip)
  • v0.2.46(Aug 1, 2018)

    • Bugfixes, refactors
    • extended use of simplification to prepack more code
    • improved shape modeling
    • Added ability to materialize objects without havocing
    • new --reproUnconditionally and --reproOnFatal options in Prepack
      • creates zip file with all files needed to debug the failure
      • creates repro.sh script that can open Nuclide debugger, pre-populating the original arguments causing the failure
    Source code(tar.gz)
    Source code(zip)
  • v0.2.45(Jul 27, 2018)

    • Enhanced dead code elimination for optimized functions
    • Much of the buildNode and inline Babel logic has been moved to a dedicated ResidualOperationSerializer class
    • Provide a way to temporarily disable effects tracking
    • Simplified forked completion constructors
    • React components can have their props modelled via __optimizeReactComponentTree
    Source code(tar.gz)
    Source code(zip)
  • v0.2.44(Jul 18, 2018)

    • Support modeling of shapes of optimized function arguments
    • fix test262 to fail CircleCI test if not enough tests pass
    • upgrades Prepack to use Babel 7.0.0-beta.53
    • Nuclide compatibility fix
    Source code(tar.gz)
    Source code(zip)
  • v0.2.43(Jul 13, 2018)

    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

    Source code(tar.gz)
    Source code(zip)
  • v0.2.42(Jul 5, 2018)

    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

    Source code(tar.gz)
    Source code(zip)
  • v0.2.41(Jun 29, 2018)

  • v0.2.40(Jun 21, 2018)

  • v0.2.39(Jun 14, 2018)

    • Perf improvements
    • Bugfixes
    • Rest syntax support (abstract interpreter support pending)
    • Debugger improvements
    • Migrate to CircleCI 2.0
    • Added support for && and || logical abstract value unfolding
    Source code(tar.gz)
    Source code(zip)
  • v0.2.38(Jun 7, 2018)

  • v0.2.36(May 25, 2018)

    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

    Source code(tar.gz)
    Source code(zip)
  • v0.2.35(May 21, 2018)

    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: #415 #927 #1017 #1285 #1765 #1812 #1821 #1830 #1838 #1841 #1842 #1845 #1856 #1857 #1865 #1866 #1869 #1870 #1871 #1883 #1890 #1906 #1914 #1924 #1930 #1931 #1935 #1952 #1953 #1957

    Source code(tar.gz)
    Source code(zip)
  • v0.2.34(May 3, 2018)

    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.

    Source code(tar.gz)
    Source code(zip)
  • v0.2.33(Apr 27, 2018)

    • 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
    Source code(tar.gz)
    Source code(zip)
  • 0.2.32(Apr 19, 2018)

    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 AddscreateRef and forwardRef to the React compiler Diagnostic PP1001 for variable write conflict among optimized functions

    Source code(tar.gz)
    Source code(zip)
  • 0.2.31(Apr 11, 2018)

    Fix problem where the results of To.ToObject were lost during serialization __optimize calls now search for newly registered functions. Statistics about abstract interpretation Better support for o[p] where p is unknown and the runtime value denotes a property on the prototype. Do not inline functions accessing mutable free variables #1058 Emitting informational diagnostics when Math.random() uses fixed random seed Using custom JSONTokenizer and streaming instead of JSON.stringify for cpuprofiles Option whether to throw or call console function on invariant violation. Dropped entries in WeakSet and WeakMap that are not referenced elsewhere from serialized output. #680. Aggregate common captured scope cases #995, #1707 adds React 16.3 getDerivedStateFromProps support to the React compiler

    Source code(tar.gz)
    Source code(zip)
  • v0.2.30(Apr 4, 2018)

    Weekly release 0.2.30:

    • Several improvements to simplifier, including more aggressive simplification of !e expressions, and better simplification in the presence of == and !=
    • For npm/yarn, prepack command renamed to prepack-cli
    • Many refactorings and bug fixes, including #1645, #1675, #1558, #1665 (crash in REPL on http://prepack.io), #1627 (Stop generator entries from being serialized twice), #1598
    Source code(tar.gz)
    Source code(zip)
  • v0.2.29(Mar 27, 2018)

  • 0.2.27(Mar 19, 2018)

    Adds React verbose mode Simplify conditions like c ? {} : null to just c if used in a condition context Fix delayed conversions of abstract values to objects in pure mode Allow additional functions to return PossiblyNormalCompletions. Make short-circuit logic similar to React Hoisting __registerAdditionalFunction is now __optimize Handles more implicit abstract conversions during binary ops

    Source code(tar.gz)
    Source code(zip)
  • v0.2.25(Mar 9, 2018)

    Make terminology more standard (Leak -> Havoc). Ensure React component tree roots are only evaluated once. New --repro command line option for easier bug reporting. Allow complex React class components to fold into simple class components. Fixing an ordering issue with generators + additional functions. Change how to signal React components for optimization. Added "node-react" compatibility mode. Enable hasOwnProperty for abstract objects in pure mode. Do not havoc leaked objects if they are frozen. Allow switch statements to have abstract switch expressions. Adds a new React reconciler rendering mode called firstRenderOnly. Allow simple object computed property access with abstract property keys. Prepack now ships Node 6.1+ compatible source. Better error message when base of a member expression is abstract and of unknown type. Adapted Prepack source code to latest Flow

    Source code(tar.gz)
    Source code(zip)
  • v0.2.24(Mar 1, 2018)

    Summary of changes: - Removing dependency on Base62 npm package which collects Google Analytics information at installation time - New option --stripFlow to parse and strip Flow annotations - Support for Object.freeze, Object.seal, and Object.preventExtensions - Better support for abstract values in Object.assign calls - Support for transitive simple objects - Basic support for arguments for additional functions - Improvements to partial evaluator - Lots of work on the React Compiler - Lots of bug fixes and little improvements

    Source code(tar.gz)
    Source code(zip)
  • v0.2.23(Feb 9, 2018)

    Weekly release v0.2.23: React improvements and several bug fixes

    Summary: * A lot of react native work * Fixes #1409 * add --emitConcreteModel option to emit concrete model from abstract model. * Fixes a bug in delayInitializations

    Source code(tar.gz)
    Source code(zip)
  • v0.2.22(Jan 30, 2018)

    Lots of work on React Native compiler. Added a --check option. Added --compatibility mobile option Fixed double reporting of diagnostics. Fixed #1235 and #979 Some refactoring

    Source code(tar.gz)
    Source code(zip)
  • v0.2.20(Jan 24, 2018)

Owner
Meta
We are working to build community through open source technology. NB: members must have two-factor auth.
Meta
A state management library for React, Vue.js, Angular and vanilla javascript

Diffx Introduction Diffx is a state management library that focuses on being easy to learn and use, and to offer a great development experience at any

Joachim Bjørge 50 May 14, 2022
React hook collections for JavaScript's Iterator/generator

use-iterator React hook collections for JavaScript's Iterator/generator. useGenerator(generator, deps) Creates a reactive state and a dispatcher from

Ryō Igarashi 7 Nov 7, 2021
All to-do lists made with Javascript will be shared here. (react vue angular etc.)

To-Do List All to-do lists made with Javascript will be shared here. (react vue angular etc.) Project To-Do List Responsive Design Write with react Im

dream 2 Aug 15, 2022
Pankod 1.4k Sep 26, 2022
Monitor your bundle size

BundleMon BundleMon helps you to monitor your bundle size. Your goal is to keep your bundle size as small as possible to reduce the amount of time it

null 57 Sep 1, 2022
React 17's automatic JSX runtime for your entire bundle

vite-react-jsx React 17's automatic JSX runtime for your entire bundle Features Replaces React.createElement calls in your entire bundle (even for pre

all oc 122 Aug 31, 2022
🦕 Deno, ESM + React: No build, no bundle, all streaming

Deno, ESM + React: No build, no bundle, all streaming Ultra is a web framework that leans hard into your browser's native features. Embrace the future

Exhibitionist 2.6k Sep 27, 2022
Use ESBuild to make your React Native code bundle faster.

metro-minify-esbuild Use ESBuild to make your React Native code bundle faster. Metro Bundler (used for React Native, Instagram, Internal Facebook) all

Evan Bacon 109 Sep 18, 2022
See what packages are increasing your react-native bundle size 📦

react-native-bundle-visualizer See what's inside of your react-native bundle ?? Uses the awesome source-map-explorer to visualize the output of the Me

Hein Rutjes 1k Sep 29, 2022
Opinionated Fullstack React SWC toolkits featuring project generation, dev server, build production bundle, and common devtools.

react-swc-kits Opinionated Fullstack React SWC toolkits featuring project generation, dev server, build production bundle, and common devtools. Inspir

Antony Budianto 6 Aug 15, 2022
React code splitting made easy. Reduce your bundle size without stress ✂️ ✨ .

React code splitting made easy. Reduce your bundle size without stress ✂️ ✨ . npm install @loadable/component Docs See the documentation at loadable-c

Greg Bergé 6.8k Sep 24, 2022
A lightweight production-ready Carousel that rocks supports multiple items and server-side rendering with no dependency. Bundle size 2kb.

react-multi-carousel ?? Production-ready, lightweight fully customizable React carousel component that rocks supports multiple items and SSR(Server-si

yi 961 Sep 26, 2022
Github action for bundle taro react native project

Github action for bundle taro react native project Use this action to package your Taro React Native project and generate bundles for Android and iOS.

tony chen 6 Aug 17, 2022
React-compress - This compress library was made with Brotli and Gzip help, for React users who want to make website more performance and reduce JS bundle code

React-compress - This compress library was made with Brotli and Gzip help, for React users who want to make website more performance and reduce JS bundle code

Koma Human 23 Sep 4, 2022
A react-native library to secure api credentials(URL, Key, Secret) from exposing to source control and bundle in apk files.

A react-native library to secure api credentials(URL, Key, Secret) from exposing to source control and bundle in apk files.

Samyak Agrawal 3 Jun 24, 2022
Demo of using Metro to bundle Expo apps for web

Metro web demo This is a weekend project, I have no plans to land this in Expo. metro-web.mp4 Demo of using Metro to bundle Expo apps for web. Try the

Evan Bacon 10 Jun 18, 2022
DeFi application with a custom ERC20 token and staking vault using vite to bundle a React.js application and ethers library to connect to the blockchain

In this workshop we will be building a DeFi application with a custom ERC20 token and staking vault using vite to bundle a React.js application and ethers library to connect to the blockchain.

Atahan Yorgancı 6 Sep 12, 2022
Encapsulated styling for your javascript components with all the power of javascript and CSS combined.

Stilr Encapsulated styling for your javascript components with all the power of javascript and CSS combined. Unique class names (Content Hash Based) U

kodyl 237 May 30, 2022
Encapsulated styling for your javascript components with all the power of javascript and CSS combined.

Stilr Encapsulated styling for your javascript components with all the power of javascript and CSS combined. Unique class names (Content Hash Based) U

kodyl 237 May 30, 2022
Javascript-testing-practical-approach-2021-course-v3 - Javascript Testing, a Practical Approach Course

Javascript Testing, a Practical Approach Description This is the reference repos

Stefano Magni 1 Jan 8, 2022