Commit Graph

23 Commits

Author SHA1 Message Date
Ahmed Abdelbaset
f7ee804c22 [compiler] Add git info to package.json files in compiler packages (#30475)
This PR adds the repository field to `compiler/packages/*/package.json`

| eslint-plugin-react-compiler | eslint-plugin-react-hooks |
| --- | --- |
|
![image](https://github.com/user-attachments/assets/3392a496-1ff1-4f36-ab96-cfbe1ed88693)
|
![image](https://github.com/user-attachments/assets/b0605dba-eef7-44fe-9484-979b4814d9fb)
|
2024-07-26 12:56:39 -04:00
Lauren Tan
83035ee299 Bump version to 0.0.0-experimental-9ed098e-20240725 2024-07-25 15:46:46 -04:00
Lauren Tan
9f04494b8e Bump version to 0.0.0-experimental-47e15aa-20240725 2024-07-25 12:27:05 -04:00
Lauren Tan
bdb355f349 Bump version to 0.0.0-experimental-0998c1e-20240625 2024-06-25 12:42:06 -04:00
Lauren Tan
d46985282d Bump version to 0.0.0-experimental-8ae29d2-20240614 2024-06-14 17:21:59 -04:00
Lauren Tan
c6b651bee0 Bump version to 0.0.0-experimental-51a85ea-20240601 2024-06-01 08:15:27 +09:00
Lauren Tan
bd30dc3ae2 Bump version to 0.0.0-experimental-a97cca1-20240529 2024-05-29 12:01:35 +09:00
Lauren Tan
630c6fb89b Bump version to 0.0.0-experimental-c8b3f72-20240517 2024-05-17 15:17:05 -07:00
Lauren Tan
c912057093 Bump version to 0.0.0-experimental-53bb89e-20240515 2024-05-15 17:43:41 -07:00
Christoph Nakazawa
cfeb491ee7 Add a main field to eslint-plugin-react-compiler, fixes #29068. (#29072)
## Summary

The main field is missing, this fixes it.

Fixes #29068.

## How did you test this change?

Manually patched the package and tried it in my codebase.
2024-05-15 17:02:20 -04:00
Lauren Tan
5501ebceec Bump version to 0.0.0-experimental-e04a001-20240515 2024-05-15 08:05:02 -07:00
Lauren Tan
67ea821e5f [publish] Fix files field for packages, invalid version range
The [`files` field](https://docs.npmjs.com/cli/v10/commands/npm-publish#files-included-in-package)
controls what files get included in the published package.

This PR specifies the `files` field on our publishable packages to only
include the `dist` directory, since we don't need to ship any types or
sourcemaps with 3 of them.

react-compiler-runtime is a runtime package which has sourcemaps, so we
also include the `src` directory in the published package.

Also fixes an invalid version range for the react peer dependency in
react-compiler-runtime, tested that it works via https://semver.npmjs.com/

ghstack-source-id: 12b36c203fc9fd8d72a1995fb3fba2312de4aa51
Pull Request resolved: https://github.com/facebook/react-forget/pull/2965
2024-05-14 11:02:29 -04:00
Lauren Tan
fddc0151fe Remove duplicated hermes-parser
ghstack-source-id: 79f3319d87909d05731ef821d0ffe86cb01b0432
Pull Request resolved: https://github.com/facebook/react-forget/pull/2920
2024-04-30 21:34:36 -04:00
Sathya Gunsasekaran
8d234c64eb [hir] Remove hermes parser
Exporting the hermes parser breaks the playground
as the hermes parser can not work in the browser.

No one is using this directly anyway -- snap and
others bundle hermes parser on their own, so,
let's remove it.

ghstack-source-id: d448c346eb137f8ba6ada4ad113e41a90b29baff
Pull Request resolved: https://github.com/facebook/react-forget/pull/2890
2024-04-23 12:28:42 +01:00
Jan Kassens
76bb13cd26 First attempt at making the linter work with advanced TypeScript syntax
First attempt at making the linter work with advanced TypeScript syntax 

Falls back to the babel parser for some advanced syntax like string template 
syntax. 

This is pretty hacky as it doesn't take in any parsing options that are 
configured for the outer ESLint parser, not sure how that could be handled.
2024-04-04 18:31:31 -04:00
Lauren Tan
b4eeae6f5d Share rollup packages across workspace 2024-04-02 12:13:39 -04:00
Lauren Tan
91826d4924 Configure rollup to strip comments and whitespace
For now this configures rollup to strip out comments in DEV builds and 
whitespace. Unfortunately there's no easy way to do this in just terser alone or 
other minifiers/manglers, so I had to add prettier as well to re-format the 
minified code. This does make the build a little bit slower: 

``` before: yarn build  118.96s user 12.38s system 185% cpu 1:10.81 total after: 
 yarn build  121.55s user 12.90s system 183% cpu 1:13.17 total ``` 

Eventually I would like to have a similar setup to React's rollup config where 
we can have DEV and prod builds. After the repo merge we could probably share or 
reuse bits of React's rollup config.
2024-04-02 12:13:38 -04:00
Lauren Tan
e6ce5e4922 [eslint] Update devDep to match types 2024-03-25 15:00:34 -04:00
Lauren Tan
15abd38911 Cleanup unused eslint-browser and js-fuzzer packages
These were never used, so let's clean them up
2024-03-25 15:00:31 -04:00
Jan Kassens
d7d82e7bee Correct eslint-plugin-react-compiler dependencies
Correct eslint-plugin-react-compiler dependencies 

- The eslint plugin doesn't actually depend on the babel plugin as it compiles 
in the dependencies. - `zod` and `zod-validation-error` were missing, but 
required to run the plugin. - Update to the `hermes-parser` dependency just to 
keep it updated.
2024-03-22 17:03:30 -04:00
Joe Savona
ca3d16c5ef Enable hook syntax support
Updates the compiler to understand Flow hook syntax. Like component syntax, in 
infer mode hooks are compiled by default unless opted out. 

Looking ahead, i can imagine splitting up our compilation modes as follows: 

* Annotations: opt-in explicitly 

* Declarations: annotations + component/hook declarations 

* Infer: annotations, component/hook declarations, + component/hook-like 
functions 

This also suggest an alternative annotation strategy: "use react" (or "use 
component" / "use hook") as a general way to tell the compiler that a function 
is intended for React. Then opting out of memoization could do "use 
react(nomemo)".
2024-02-17 17:31:47 -08:00
Lauren Tan
6b49c4f2d5 [eslint-plugin] Cleanup package.json
Removes some unused packages and unused package.json fields
2024-01-25 10:29:32 -05:00
Jan Kassens
da7c466f07 Rename eslint-plugin-react-forget to eslint-plugin-react-compiler
Rename eslint-plugin-react-forget to eslint-plugin-react-compiler
2024-01-16 17:36:37 -05:00