Commit Graph

31 Commits

Author SHA1 Message Date
Andres Suarez
98d33f9f5e Text lint all .gitignore files
Reviewed By: scottrice, pallotron

Differential Revision: D15353820

fbshipit-source-id: 74f9eaadc90363a958692259f5cb66cef91ac8ef
2019-05-15 11:36:48 -07:00
Adrian Zgorzalek
1b39b402e1 Upgrade prettier to 1.17.0
Summary:
Run `js1 upgrade prettier 1.17.0` and `xplat/js/scripts/update-oss-yarn-lockfile.sh` and `hg revert -r .^ xplat/js/rome`

allow-large-files

Reviewed By: zackargyle, pvdz

Differential Revision: D15164375

fbshipit-source-id: 2fe68733dfa93ea64a67d170ba2f80c5af086917
2019-05-07 14:33:51 -07:00
Peter van der Zee
e8475936ec Bump Prettier to 1.16.4
Summary:
@public
This bumps Prettier to v1.16.4
Only format source files were updated.

Reviewed By: mjesun

Differential Revision: D14454893

fbshipit-source-id: 72f9872fe764a79dbf0d9fab9bebb1456b039f2f
2019-03-14 08:31:22 -07:00
Henrik Nilsson
3ceb537dca Fix typo
Summary: Pull Request resolved: https://github.com/facebook/prepack/pull/2618

Differential Revision: D13025895

Pulled By: NTillmann

fbshipit-source-id: 5bb64de1599d24826bea7fc7f100f74b0fecf64d
2018-11-12 10:06:49 -08:00
Enzo Ferey
ee291d19dc Website code and warnings (#2528)
Summary:
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.
Pull Request resolved: https://github.com/facebook/prepack/pull/2528

Differential Revision: D9882040

Pulled By: NTillmann

fbshipit-source-id: bc8266a673e6def023bfa65b93b94ea9c7ad5b1d
2018-09-17 14:01:43 -07:00
Jonathan Wieben
52d4513841 Fix: Indentation in EliminationOfAbstractionTax example (#2496)
Summary:
Release Note: none

Fixes indentation in REPL of EliminationOfAbstractionTax example.
Pull Request resolved: https://github.com/facebook/prepack/pull/2496

Differential Revision: D9528783

Pulled By: trueadm

fbshipit-source-id: 9c01f0783c6299d2577d7ac17ff2b39db9e5cca0
2018-08-28 04:26:39 -07:00
Tim Welch
df2e1f56cf Fix website typo (#2487)
Summary:
Release Note: none
Pull Request resolved: https://github.com/facebook/prepack/pull/2487

Differential Revision: D9505468

Pulled By: trueadm

fbshipit-source-id: 561b8c8e33c81c5224baf066859463d0c8e31c06
2018-08-28 04:26:39 -07:00
Nikolai Tillmann
55c55f70c9 Removing last remnants of delayUnsupportedRequires
Summary:
The previous changes on "Do full joins" didn't remove all
uses of the delayUnsupportedRequires feature. This does it.

In particular, this fixes the internal prepack-test.

Reviewed By: hermanventer

Differential Revision: D9287509

fbshipit-source-id: f810f5e08a10cbd14272d776799a2a8f1442d1c8
2018-08-12 17:54:27 -07:00
Sebastian Markbage
81bc21fad8 Delete node-cli Option and all the Node.js intrinsics (#2267)
Summary:
Since I'm adding a new experiment I figured I'd delete an equivalent sized one.

Last year I added an option that runs the Prepack program by invoking Node.js JS runtime which lets us prepack the whole module system and initialization. It's essentially a packager with perfect Node.js module resolution semantics. It did this by modeling Node's native environment as Prepack bindings.

This PR removes that whole option.

There's a few reasons why I don't think that worked out as a good idea.

- It's not solving a real need. It is hard to keep different module systems in tact. There is always something in the ecosystem that breaks down and using the canonical one solves that. However, in practice, if there is a need for bundling the ecosystem itself adapts to the toolchain. So it's not actually that hard to bundle up a CLI even with Webpack, even if it's strictly not 100% compatible, by tweaking a few downstream depenencies.

- Running the resulting bundle is tricky. The resulting bundle includes the JS parts of Node. This overlaps with what Node.js adds at runtime so it runs it twice. The ideal is actually to build a custom distribution of Node.js but this is generally overkill for what people want.

- Bindings change a lot. While Node.js's API notoriously doesn't change much. The internals do change a lot. By picking the API boundary in the middle of the internals of Node.js, it risks changing with any version. While technically observable changes, nobody else relies on these details. If this option was worth its weight, someone could probably maintain it but so far that has not been the case so we had to disable this option in CI to upgrade Node.

However, going forward I think there are alternative approaches we can explore.

- First class module system. This is something we really need at some point. A first class module system would be able to load Node.js module files from disk and package them up while excluding others. It doesn't have to be literally Node.js's module system. Close enough is ok. Especially as standards compliant ECMAScript modules get more popular. This lets us target compiling output that runs after Node's initialization.

- By introducing havocing and membranes in the boundaries, it becomes possible to initialize Node.js modules without actually knowing the internal of the boundaries.

- We've started optimizing residual functions which is much more interesting. However, this requires that code puts some constraints on how it works with its environment. It's not designed to be fully backwards compatible. That's probably a good thing but that also means that we can put constraints on the modules being Prepacked.

This removes the ability to prepack Prepack itself which is unfortunate but already wasn't being tested. To speed up Prepack itself, the [LLVM backend](https://github.com/facebook/prepack/pull/2264) seems much more useful if it can ever work on Prepack itself.
Pull Request resolved: https://github.com/facebook/prepack/pull/2267

Differential Revision: D8863788

Pulled By: sebmarkbage

fbshipit-source-id: d777ec9a95c8523b3386cfad553d9f691ec59074
2018-07-16 13:09:59 -07:00
Guru107
7273bacc51 New color scheme for the website (#2225)
Summary:
Release note: new color scheme for the website 🔥
Pull Request resolved: https://github.com/facebook/prepack/pull/2225

Differential Revision: D8779444

Pulled By: NTillmann

fbshipit-source-id: 2c713d3a0a98dfc62f0a7cdf4e695a32c568fa05
2018-07-09 22:29:57 -07:00
Peter van der Zee
30f07ead22 Upgrade Prettier to 1.13.6 on fbsource
Reviewed By: zertosh

Differential Revision: D8638504

fbshipit-source-id: c6991b2e884e14868ddc1d9047a78191219d673f
2018-06-27 03:40:12 -07:00
Dan Abramov
6c16a53fa2 Link to Prepack introduction from website (#2147)
Summary:
I haven't written the next parts yet but I figured let's put a link on the website so this doesn't get lost.
I think even the details there are useful enough for users and new contributors.

<img width="1513" alt="screen shot 2018-06-21 at 3 57 52 pm" src="https://user-images.githubusercontent.com/810438/41727325-f9ba32da-756b-11e8-94f0-c83b71df859b.png">

I put it at the top of Getting Started because IMO you'll want to read this (or at least see it) before trying to run Prepack.

I initially planned to put it in the docs themselves but only today realized there's no build process. I don't want to convert the guide to HTML so I'd rather keep it as a gist (and update it if necessary) in the meantime.
Closes https://github.com/facebook/prepack/pull/2147

Differential Revision: D8577403

Pulled By: gaearon

fbshipit-source-id: 2f7f64a0a4413066739b12c50b4d21779a16a568
2018-06-21 13:12:22 -07:00
Peter van der Zee
5c507bc847 Bump Prettier to 1.13.4 on xplat
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
2018-06-06 05:38:59 -07:00
David Cai
d96eaf45c4 Show callstack in browser upon REPL crashes
Summary:
Fixing some incompatibility between heapGraph and `__optimize()`.
Essence of the issue was an implicit assumption that only one visitor would visit certain entries.

Original Issue: https://github.com/facebook/prepack/issues/1732
Closes https://github.com/facebook/prepack/pull/2021

Reviewed By: trueadm

Differential Revision: D8248761

Pulled By: caiismyname

fbshipit-source-id: dd27487b490e3924fdc0fe6aaca7f1c103e137cb
2018-06-03 07:38:28 -07:00
saigowthamr
f720dab2a5 Matching end tags Errors fixed
Summary:
Corrected matching end tags  div and p tags  fixed
Closes https://github.com/facebook/prepack/pull/1907

Differential Revision: D7925198

Pulled By: NTillmann

fbshipit-source-id: b92c2dbaada71e9afdd0193692b1ec2e401999e4
2018-05-13 09:38:09 -07:00
Victor Hom
7e3209b701 add reading wiki link to places
Summary:
Release Note: none

I just wanted to add the reading links as suggested in #1887

arrived to the wiki from Twitter -> the issue -> to the Wiki :)

Let me know if you want the copy updated and shifted around anywhere.
Closes https://github.com/facebook/prepack/pull/1948

Differential Revision: D7985678

Pulled By: NTillmann

fbshipit-source-id: 22cd999bf4ff8dd26618b06d94f751834533b726
2018-05-13 09:25:59 -07:00
Bernard Lin
98b78dcfba fix typo
Summary:
Release Note: none
Closes https://github.com/facebook/prepack/pull/1909

Differential Revision: D7925196

Pulled By: trueadm

fbshipit-source-id: 3461e2f75f7d207e7b6e04cf9b319f15612b1945
2018-05-09 03:18:20 -07:00
Peter van der Zee
a0703ec2a0 Upgrade Prettier to v1.12.1 on fbsource
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
2018-04-19 02:37:00 -07:00
Nikolai Tillmann
6ac4691295 Updating website to list most relevant information and no outdated (wrong) information.
Summary:
Release notes: Website update
Closes https://github.com/facebook/prepack/pull/1740

Differential Revision: D7603811

Pulled By: NTillmann

fbshipit-source-id: c905aa7d5d89b6ead13936442afb68e1f4dc6e85
2018-04-12 12:53:38 -07:00
Nikolai Tillmann
7579c5fc0b Introducting new option --invariantLevel NUMBER and dropping --omitInvariants
Summary:
Release notes: Introducting new option --invariantLevel NUMBER and dropping --omitInvariants

The new default is invariant level 0, which corresponds to the old --omitInvariants.
Level 1 is roughly what we used to do: Check invariants on (derived) abstract values.
Level 2 implements #1180: Checking that all accesses to built-ins do what Prepack expects them to do, including checks for when properties on built-ins are absent.
Level 3 adds checks for internal consistency, basically an internal debug level.

The serializer tests now run with the highest invariant level by default. The added invariants found a few issues that got addressed, including:
- Prepack exposes a TypedArray prototype, which is not a real thing. It's now marked as `__refuseSerialization`, and no invariants are emitted for such things.
- Global variables / properties on the global object are special. Those are not yet handled at level 2.
- Accesses to Prepack magic functions that generally start with `__` should not produce invariant checks.
- Magic code generation for loops should not take into account objects that are `__refuseSerialization`.
- All invariant statements get a unique id to make it easier to locate them.
- I marked some test cases which depend on counting occurrences in the output as "// omit invariants", as the additional invariants increased some such counts.

As part of testing, I also found it necessary to make the --invariantMode more useful; it now also allows specifying nativeLoggingHook which is the preferred way of logging in React Native.

To reduce the number of checks by a few orders of magnitude in practice, each property is only checked on first access. This is tracked by a global variable `__checkedBindings`.

This pull requests incorporates all aspects of the #1709 (which I abandoned).
Closes https://github.com/facebook/prepack/pull/1724

Reviewed By: simonhj

Differential Revision: D7575091

Pulled By: NTillmann

fbshipit-source-id: 585cd224ce66882f8e5f27d88c1ad08afeb96ee1
2018-04-12 11:58:25 -07:00
Nikolai Tillmann
032f71403f Removing --abstractEffectsInAdditionalFunctions option
Summary:
Release notes: Removing --abstractEffectsInAdditionalFunctions option

It is now the new default, as nothing seems to depend on the old behavior.
Closes https://github.com/facebook/prepack/pull/1623

Differential Revision: D7342083

Pulled By: NTillmann

fbshipit-source-id: c02d13bddd0ff3d8a113a6a5a83c1bf35c96ba4d
2018-03-20 15:04:24 -07:00
Dominic Gannaway
2eeaf722a4 Add abstractEffectsInAdditionalFunctions to REPL
Summary:
Release notes: none

Add `abstractEffectsInAdditionalFunctions` to be `true` for the REPL so we can demo cool features :)
Closes https://github.com/facebook/prepack/pull/1591

Differential Revision: D7272579

Pulled By: trueadm

fbshipit-source-id: e91a2665b50150213d3656956c673ec1efc15971
2018-03-14 09:20:22 -07:00
Dominic Gannaway
245a7ad7c9 Add "node-react" compatibility mode
Summary:
Release notes: adds "node-react" compatibility mode

Adds the "node-react" compatibility mode, which is like "fb-www", but doesn't contain the internal FB mocks. This mode is ideal for library authors who might want to experiment with the features of the React compiler in an environment that has basic React/Relay mocks as well as `require` and `module.exports` partial support.

I'll be adding relevant documentation for this on the wiki too.
Closes https://github.com/facebook/prepack/pull/1528

Differential Revision: D7149660

Pulled By: trueadm

fbshipit-source-id: 3f00fa01bb881722b270393a27f817911c5a5256
2018-03-04 12:24:33 -08:00
Phani Pattapu
2afe2c51f1 Adding lazyObjectsRuntime option to the Prepack Website
Summary:
This addresses the issue https://github.com/facebook/prepack/issues/1282 although the issue also requests for --additionalFunctions option which is not part of this commit. User should now be able to see --lazyObjectsRuntime option in the options list on https://prepack.io/repl.html. Ideally this should be an enum but this will accept a freeform string in this revision.
Closes https://github.com/facebook/prepack/pull/1475

Differential Revision: D7059756

Pulled By: phanipattapu

fbshipit-source-id: 588f688a52e81d065cf19ac1fbd358a9332b81a0
2018-02-22 14:10:34 -08:00
Dominic Gannaway
414cc67b93 Re-adds Flow parsing and stripping when option is enabled
Summary:
Release notes: adds option to parse and strip Flow annotations

In a [tweet I made at the end of last year](https://twitter.com/trueadm/status/944908776896978946) I linked to a REPL example that contained Flow type annotations. The example is now broken as we removed Flow type annotation parsing. :(

This PR adds this back behind the option `stripFlow` which is now enabled by default on the REPL and for React tests. I've also added a test to match the REPL for regression checking so this doesn't happen.
Closes https://github.com/facebook/prepack/pull/1439

Differential Revision: D6976663

Pulled By: trueadm

fbshipit-source-id: 47e28bc0986f1a1a252180f26200ce32314a4e5b
2018-02-13 08:48:24 -08:00
Dominic Gannaway
b891ee1166 Changes to React mocks for internal testing
Summary:
Release notes: none

This PR changes `react-mocks` -> `fb-www` and adds some `RelayModern` mocks. This is mainly for internal testing to unblock work.
Closes https://github.com/facebook/prepack/pull/1347

Differential Revision: D6798242

Pulled By: trueadm

fbshipit-source-id: 9c8a4aeef074e2a29e44fdd26352633f47bbc862
2018-01-24 11:42:07 -08:00
Jeffrey Tan
50d9168dfc Fix duplicate edges issue in Prepack heap visualization
Summary:
Release Note: Fix duplicate edges issue in Prepack heap visualization.

This PR did two things:
1. Fix duplicate edges issue in Prepack heap visualization by using unique identifier for edge id field.(#1300)
2. Prepack heap visualization supports two formats: 1. Dot language formatted used by CLI. 2. JSON format used by Vis.js library to visualize in website REPL. This PR allows both.
Closes https://github.com/facebook/prepack/pull/1308

Differential Revision: D6656452

Pulled By: yinghuitan

fbshipit-source-id: 123ec5c9a031bc43e0d71c1b0510956ef1463143
2018-01-03 15:13:05 -08:00
Dominic Gannaway
1e1d94517b Extract out website changes for REPL.js
Summary:
Release notes: none

Extracted our website changes from commit: 1dbefcbd83

This was done as suggested in 1dbefcbd83 (commitcomment-26606024).
Closes https://github.com/facebook/prepack/pull/1310

Differential Revision: D6655550

Pulled By: trueadm

fbshipit-source-id: b603657a056ee5124bab7fa85ea277a19509268e
2018-01-03 05:53:23 -08:00
artiebits
7b3d0dba83 Fix website dropdowns
Summary:
Issue https://github.com/facebook/prepack/issues/1296.

The previous version of Tether Select that was used in the website had `z-index: 100;` (still can check it in `gh-pages` branch) but in the version that we use from CDN, in order to reduce the size of Prepack repo, there is no `z-index`. So I've added it to the website styles.
Closes https://github.com/facebook/prepack/pull/1298

Differential Revision: D6638548

Pulled By: NTillmann

fbshipit-source-id: 1fb05a37d7bd83a71936ac4aa4ed9a138825f032
2017-12-27 09:58:58 -08:00
Wuhan Zhou
45383c8785 Display heap graph in website
Summary:
Release note: add heap graph visualization to website
Moved from #1243

- read in the heap graph data from prepackSources result
- display the graph using [visjs](http://visjs.org/)
Closes https://github.com/facebook/prepack/pull/1265

Differential Revision: D6571860

Pulled By: JWZ2018

fbshipit-source-id: 4c2d9bae91eaffff58df8909214d4c7bc56d1359
2017-12-14 15:03:35 -08:00
James Nolan
3c9c6ac2a5 Make master/docs a single source of truth for gh-pages
Summary:
Release note: none

To address issue #956 .

The idea is to have all documentation (aka "the website") in a single `docs/` directory on the `master` branch like [Jest](https://github.com/facebook/jest/tree/master/docs) and [Relay](https://github.com/facebook/relay/tree/master/docs) do. This directory then serves as a single source of truth to publish the `gh-pages` branch.

This PR:
- Moves the current content of the `gh-pages` branch to a `docs/` directory in `master`
- Provides a bash script for maintainers to easily publish the `gh-pages` branch from the `docs/` directory. The script also builds `prepack.min.js` from master to make sure gh-pages always has the latest version of prepack.

Additionally, I noticed the `gh-pages` branch had two `prepack.min.js` files (one in `./` and one in `./js/`). I removed the first one because it is apparently not used but it may break other websites if they references that file.

0. Fork the repo to avoid modifying the real website

1. Change the site
`> git checkout master`
`> echo ".nav { background-color: chartreuse; }" >> docs/css/style.css`
`> git add docs/css/style.css`
`> commit -m "The navigation bar looks better in green"`
`> git push`

2. Run the publication script:
`> ./scripts/publish-gh-pages.sh`

3. Verify that the gh-pages has been updated:
`> git checkout gh-pages`
`> git pull`
`> git diff HEAD~ # should show the line you added`
Closes https://github.com/facebook/prepack/pull/1223

Differential Revision: D6547395

Pulled By: j-nolan

fbshipit-source-id: 6e6d3aec97c0bcc2555c421d6f4a889bcd8df208
2017-12-12 12:10:05 -08:00