Commit Graph

34 Commits

Author SHA1 Message Date
Lauren Tan
5bd9642578 [feedback] Combine bundle scripts and don't commit dist
This combines our scripts and makes it so we no longer need to create a separate 
commit to add the forget-feedback/dist directory into the react-forget repo. I 
originally did that so I could run tests here, but now that the external repo is 
created and has its test suite hooked up to CI, this is now unnecessary friction 
to run a sync
2023-11-02 11:58:11 -04:00
Lauren Tan
847a6f0a09 [feedback] Make babel/types a dep not a peerDep 2023-10-31 12:16:33 -04:00
Lauren Tan
5ebc9fe388 [feedback] Add github action to run e2e test 2023-10-31 12:16:33 -04:00
Sathya Gunasekaran
f648e4ce85 [test/react] Turn on react tests in CI 2023-10-25 12:39:20 +01:00
Sathya Gunasekaran
51baf5807e [test/react] Fix github workflow
The flattening broke the shell script because the directory structure changed. 

Instead of depending on a flaky shell script, this PR encodes the commands as 
part of the github workflow.
2023-10-25 12:36:55 +01:00
Joe Savona
cee08ba750 [rfc] Dont convert ArrowFunction to FunctionDecl
This PR changes the way we compile ArrowFunctionExpression to allow compiling 
more cases, such as within `React.forwardRef()`. We no longer convert arrow 
functions to function declarations. Instead, CodeGenerator emits a generic 
`CodegenFunction` type, and `Program.ts` is responsible for converting that to 
the appropriate type. The rule is basically: 

* Retain the original node type by default. Function declaration in, function 
declaration out. Arrow function in, arrow function out. 

* When gating is enabled, we emit a ConditionalExpression instead of creating a 
temporary variable. If the original (and hence compiled) functions are function 
declarations, we force them into FunctionExpressions only here, since we need an 
expression for each branch of the conditional. Then the rules are: 

* If this is a `export function Foo` ie a named export, replace it with a 
variable declaration with the conditional expression as the initializer, and the 
function name as the variable name. 

* Else, just replace the original function node with the conditional. This works 
for all other cases. 

I'm open to feedback but this seems like a pretty robust approach and will allow 
us to support a lot of real-world cases that we didn't yet, so i think we need 
_something_ in this direction.
2023-08-29 22:09:41 +01:00
Lauren Tan
ce82a56fa6 [ci] Fix output of parser benchmark
yarn adds some other output, so just run the script directly
2023-08-24 10:14:28 -04:00
Lauren Tan
80efd75b8e [ci] Add benchmark comparison
Updates the parser-benchmark script to use a benchmarking framework, and 

also brings in yargs to make it easier to handle parsing arguments. 

Non-CI usage: 

``` 

$ cd bench/parser-benchmark 

$ yarn bench --help 

Options: 

--help        Show help                                              [boolean] 

--ci                                                [boolean] [default: false] 

--sampleSize                                             [number] [default: 1] 

$ yarn bench --sampleSize=3 

[ISOBENCH ENDED] Parser Benchmark (3 times) 

OXC           - 32 op/s. 3 samples in 9518 ms. 5.288x (BEST) 

SWC           - 20 op/s. 3 samples in 9487 ms. 3.256x 

HermesParser  - 6 op/s. 3 samples in 9124 ms. 1.000x (WORST) 

Forget (Rust) - 15 op/s. 3 samples in 9749 ms. 2.499x 

``` 

In CI this outputs JSON instead of logging to stdout. The results are 

stored in github's action cache and used as a point of comparison when 

new commits are pushed to main. The comparison should be shown on 

workflow [summary 
pages](https://github.com/facebook/react-forget/actions/runs/5956421081), but 
nothing will be populated until we merge this PR. 

We intentionally only run this workflow on main as any run would 

override the last cached result, so a PR with multiple pushes would then 

start having comparisons with itself.
2023-08-23 17:58:23 -04:00
Lauren Tan
aeae3ba0a7 [ci] Add rust-cache 2023-08-23 17:16:40 -04:00
Lauren Tan
fc506b5fed [ci] Run parser benchmark on ci
Example: 

![Screenshot 2023-08-23 at 11 22 55 
AM](https://github.com/facebook/react-forget/assets/1390709/158fa9f1-32f6-444e-8ea8-75f4f1475ee0)
2023-08-23 17:16:40 -04:00
lauren
a0dc166991 [rfc] Remove top level forget directory
Sorry about the thrash in advance! This removes the top level `forget` directory 
which adds unnecessary nesting to our repo 

Hopefully everything still works
2023-08-22 15:04:54 -04:00
Lauren Tan
6be03b681e [ci] Split out babel-plugin-react-forget jest to its own job 2023-08-18 17:06:52 -04:00
Lauren Tan
e426cb553d [ci] Split out babel-plugin-react-forget prettier/eslint to its own job 2023-08-18 15:22:09 -04:00
Lauren Tan
c4d000ce49 [ci] Rename TS ci to be consistent with other workflows 2023-08-18 14:16:21 -04:00
Lauren Tan
9e332ee05a [ci] Run yarn workspace tests in parallel 2023-08-18 14:10:41 -04:00
Joe Savona
d5a8e80157 [rust][ci] Run cargo check/fmt
Formats the codebase, fixes some clippy lints, and updates CI to check that code 
is formatted.
2023-08-17 12:59:29 -07:00
Joe Savona
514916d9ce [rust][ci] Only run Rust actions when relevant files change 2023-08-17 10:10:44 -07:00
Lauren Tan
6b242c12a9 [ci] Don't run yarn build in ci
Can't recall why we added this, but it shouldn't be necessary and should shave 
off ~2 mins from ci
2023-08-16 12:16:51 -04:00
Lauren Tan
a59e15d40f [ci] Try to cache node_modules to speed up ci 2023-08-16 11:04:53 -04:00
Lauren Tan
20b175fcd5 [ci] Pass correct flags to yarn install
Turns out `--immutable` and `--immutable-cache` are for yarn 2, yarn 1.x needs 
to use the `--frozen-lockfile` flag instead
2023-07-27 11:06:29 -04:00
Lauren Tan
f45a4611e7 [ci] Don't run build on react
Building artifacts shouldn't be required for the tests, this should shave off a 
few minutes from CI
2023-07-27 11:06:27 -04:00
Joseph Savona
6912c31056 [CI] Run cargo build/test
Adds GitHub actions to build and test the Rust version of Forget on every commit 
to main. I didn't enable this on PRs for now just to avoid slowing down other 
folks, this seemed like a reasonable compromise while we're still in the 
experimentation phase. I test locally, and CI will catch if I or anyone else 
slips up.
2023-07-26 14:01:57 -07:00
Sathya Gunasekaran
82e426e229 [CI] Run react test suite on every PR
Add a new workflow to run test suite to run on every PR. 

Updates the build step to just build the UMD variant of react & react-dom for 
the tests.
2023-07-25 13:34:50 +01:00
Lauren Tan
daa23543ef [ci] Run all tests
CI will now run tests for all packages
2023-06-16 14:05:45 -04:00
Lauren Tan
4e22fa6451 Try to fix test262 in ci 2023-06-06 15:25:20 -04:00
Lauren Tan
40d1459115 Scaffold workspaces
![image](https://github.com/facebook/react-forget/assets/1390709/bb27e33f-6a88-4b71-8ce2-aeb8db0372f7) 

This is an attempt to scaffold yarn workspaces into our repo with as minimal as 
possible changes to our current setup and directory structure. Essentially this 
PR moves current `src` into `packages/babel-plugin-react-forget` as a first step 
to keep everything working. Later on when we're ready we can split out a 
`react-compiler` package that is decoupled from Babel, but it's too early for 
that now
2023-06-05 13:35:39 -04:00
Lauren Tan
b40de89805 Run snap in ci 2023-04-21 15:22:56 -04:00
Lauren Tan
faa8eef0a8 [be] Fix remaining lints and enable lint in CI 2023-03-10 16:21:01 -05:00
lauren
7ee40764e6 Revert "[nocommit] Run test262 on this PR to verify it works for real…
…-realsies" 

This reverts commit 3c8700cbc7502e56cca8d4bb77a08e1ee747c166. 

I'm not sure how this happened but I accidentally hit up + enter on a previous 
`ghstack land` command for a different stack and it landed this one. 
Infuriating.
2022-12-22 17:53:59 -05:00
Lauren Tan
2d4c2094d8 [@nocommit] Run test262 on this PR to verify it works for real-realsies
final v2
2022-12-22 17:40:20 -05:00
Lauren Tan
cf7176d3f2 Add prettier script
Copies over the prettier script from the React repo with a few tiny tweaks for a 
nicer experience running prettier on changed files
2022-11-17 10:31:34 -05:00
Lauren Tan
188c1501be Condense test262 output in ci
There's no option to output the results of the test262 harness in silent mode so 
every pass and failure outputs multiple lines to stdout. Since there are many 
thousands of tests this results in unusable log files that are over 200k lines 
long. This PR redirects stdout to a tmp file and then we reformat the result 
into a small JSON object, grouped by the failure message with count. 

Example: 

```json [   {     "pass": false,     "data": {       "message": "Expected no 
error, got Error: TODO: Support complex object assignment",       "count": 66    
 }   },   {     "pass": false,     "data": {       "message": "Expected no 
error, got Error: TODO: lowerExpression(FunctionExpression)",       "count": 4   
  }   },   {     "pass": false,     "data": {       "message": "Expected no 
error, got Error: TODO: lowerExpression(UnaryExpression)",       "count": 6     
}   },   {     "pass": false,     "data": {       "message": "Expected no error, 
got Error: todo: lower initializer in ForStatement",       "count": 28     }   
},   {     "pass": false,     "data": {       "message": "Expected no error, got 
Invariant Violation: Expected value for identifier `15` to be initialized.",     
  "count": 14     }   },   {     "pass": false,     "data": {       "message": 
"Expected no error, got Invariant Violation: `var` declarations are not 
supported, use let or const",       "count": 76     }   },   {     "pass": true, 
    "data": {       "message": null,       "count": 1     }   } ] ```
2022-11-16 18:24:07 -05:00
Lauren Tan
9058797e6a Add test262 github action
Add a new workflow to run the test262 tests on commits to main but not in pull 
requests. This is to keep this test non-blocking on PRs but lets us track pass 
rates over time
2022-11-16 10:45:36 -05:00
Xuan Huang (黄玄)
a33c0b897c Initial commit 2024-03-25 10:39:47 +00:00