@samitouri / QOS-React / commits / 82137ec184

Rename react-compiler-runtime

ghstack-source-id: c6c825f5efdb4f9c413050b22b7713966871338c Pull Request resolved: https://github.com/facebook/react-forget/pull/2931

Joe Savona committed May 2, 2024 at 17:14 UTC 82137ec1846c2074c3f94a8baa85fcbd125bc015
19 files changed +24 -24
compiler/apps/playground/babel.config.js
+1 -1
@@ -18,7 +18,7 @@ module.exports = function (api) {
18 {
19 compilationMode: "infer",
20 panicThreshold: "NONE",
21 - runtimeModule: "react-forget-runtime",
21 + runtimeModule: "react-compiler-runtime",
22 },
23 ],
24 ],
compiler/apps/playground/next.config.js
+2 -2
@@ -29,9 +29,9 @@ const nextConfig = {
29
30 config.resolve.alias = {
31 ...config.resolve.alias,
32 - "react-forget-runtime": path.resolve(
32 + "react-compiler-runtime": path.resolve(
33 __dirname,
34 - "../../packages/react-forget-runtime",
34 + "../../packages/react-compiler-runtime",
35 ),
36 };
37
compiler/apps/playground/package.json
+1 -1
@@ -36,7 +36,7 @@
36 "pretty-format": "^29.3.1",
37 "react": "18.2.0",
38 "react-dom": "18.2.0",
39 - "react-forget-runtime": "*"
39 + "react-compiler-runtime": "*"
40 },
41 "devDependencies": {
42 "@types/node": "18.11.9",
compiler/apps/playground/playwright.config.js
+1 -1
@@ -31,7 +31,7 @@ export default defineConfig({
31 // https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests
32 webServer: {
33 command:
34 - "yarn workspace babel-plugin-react-compiler build && yarn workspace react-forget-runtime build && yarn dev",
34 + "yarn workspace babel-plugin-react-compiler build && yarn workspace react-compiler-runtime build && yarn dev",
35 url: baseURL,
36 timeout: 300 * 1000,
37 reuseExistingServer: !process.env.CI,
compiler/package.json
+1 -1
@@ -22,7 +22,7 @@
22 "start": "yarn workspace playground run start",
23 "next": "yarn workspace playground run dev",
24 "build": "yarn workspaces run build",
25 - "dev": "concurrently --kill-others -n compiler,runtime,playground \"yarn workspace babel-plugin-react-compiler run build --watch\" \"yarn workspace react-forget-runtime run build --watch\" \"yarn workspace playground run dev\"",
25 + "dev": "concurrently --kill-others -n compiler,runtime,playground \"yarn workspace babel-plugin-react-compiler run build --watch\" \"yarn workspace react-compiler-runtime run build --watch\" \"yarn workspace playground run dev\"",
26 "test": "yarn workspaces run test",
27 "snap": "yarn workspace babel-plugin-react-compiler run snap",
28 "snap:build": "yarn workspace snap run build"
compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts
+2 -2
@@ -87,8 +87,8 @@ export type PluginOptions = {
87 * instead of `react/compiler-runtime`.
88 *
89 * ```
90 - * // If set to "react-forget-runtime"
91 - * import {c as useMemoCache} from 'react-forget-runtime';
90 + * // If set to "react-compiler-runtime"
91 + * import {c as useMemoCache} from 'react-compiler-runtime';
92 * ```
93 */
94 runtimeModule?: string | null | undefined;
compiler/packages/babel-plugin-react-compiler/src/HIR/Environment.ts
+2 -2
@@ -257,13 +257,13 @@ const EnvironmentConfigSchema = z.object({
257 * For example:
258 * instrumentForget: {
259 * import: {
260 - * source: 'react-forget-runtime',
260 + * source: 'react-compiler-runtime',
261 * importSpecifierName: 'useRenderCounter',
262 * }
263 * }
264 *
265 * produces:
266 - * import {useRenderCounter} from 'react-forget-runtime';
266 + * import {useRenderCounter} from 'react-compiler-runtime';
267 *
268 * function Component(props) {
269 * if (__DEV__) {
compiler/packages/babel-plugin-react-compiler/src/Utils/RuntimeDiagnosticConstants.ts
+1 -1
@@ -5,7 +5,7 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -// WARNING: ensure this is synced with enum values in react-forget-runtime:GuardKind
8 +// WARNING: ensure this is synced with enum values in react-compiler-runtime:GuardKind
9 export enum GuardKind {
10 PushHookGuard = 0,
11 PopHookGuard = 1,
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/codegen-emit-imports-same-source.expect.md
+1 -1
@@ -17,7 +17,7 @@ import {
17 useRenderCounter,
18 shouldInstrument,
19 makeReadOnly,
20 -} from "react-forget-runtime";
20 +} from "react-compiler-runtime";
21 import { c as useMemoCache } from "react"; // @enableEmitFreeze @instrumentForget
22
23 function useFoo(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/codegen-emit-make-read-only.expect.md
+1 -1
@@ -19,7 +19,7 @@ function MyComponentName(props) {
19 ## Code
20
21 ```javascript
22 -import { makeReadOnly } from "react-forget-runtime";
22 +import { makeReadOnly } from "react-compiler-runtime";
23 import { c as useMemoCache } from "react"; // @enableEmitFreeze true
24
25 function MyComponentName(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/codegen-instrument-forget-gating-test.expect.md
+1 -1
@@ -24,7 +24,7 @@ function Foo(props) {
24
25 ```javascript
26 import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";
27 -import { useRenderCounter, shouldInstrument } from "react-forget-runtime";
27 +import { useRenderCounter, shouldInstrument } from "react-compiler-runtime";
28 import { c as useMemoCache } from "react"; // @instrumentForget @compilationMode(annotation) @gating
29 const Bar = isForgetEnabled_Fixtures()
30 ? function Bar(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/codegen-instrument-forget-test.expect.md
+1 -1
@@ -23,7 +23,7 @@ function Foo(props) {
23 ## Code
24
25 ```javascript
26 -import { useRenderCounter, shouldInstrument } from "react-forget-runtime";
26 +import { useRenderCounter, shouldInstrument } from "react-compiler-runtime";
27 import { c as useMemoCache } from "react"; // @instrumentForget @compilationMode(annotation)
28
29 function Bar(props) {
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/flag-enable-emit-hook-guards.expect.md
+1 -1
@@ -36,7 +36,7 @@ export const FIXTURE_ENTRYPOINT = {
36 ## Code
37
38 ```javascript
39 -import { $dispatcherGuard } from "react-forget-runtime"; // @enableEmitHookGuards
39 +import { $dispatcherGuard } from "react-compiler-runtime"; // @enableEmitHookGuards
40 import {
41 createContext,
42 useContext,
compiler/packages/react-compiler-runtime/package.json renamed
+2 -2
@@ -1,7 +1,7 @@
1 {
2 - "name": "react-forget-runtime",
2 + "name": "react-compiler-runtime",
3 "version": "0.0.1",
4 - "description": "Runtime for React Forget",
4 + "description": "Runtime for React Compiler",
5 "license": "MIT",
6 "main": "dist/index.js",
7 "files": [
compiler/packages/react-compiler-runtime/rollup.config.js renamed
compiler/packages/react-compiler-runtime/src/index.ts renamed
+1 -1
@@ -195,7 +195,7 @@ export function $reset($: MemoCache) {
195 }
196
197 export function $makeReadOnly() {
198 - throw new Error("TODO: implement $makeReadOnly in react-forget-runtime");
198 + throw new Error("TODO: implement $makeReadOnly in react-compiler-runtime");
199 }
200
201 /**
compiler/packages/react-compiler-runtime/tsconfig.json renamed
compiler/packages/snap/src/SproutTodoFilter.ts
+1 -1
@@ -491,7 +491,7 @@ const skipFilter = new Set([
491 "original-reactive-scopes-fork/bug-nonmutating-capture-in-unsplittable-memo-block",
492 "original-reactive-scopes-fork/bug-hoisted-declaration-with-scope",
493
494 - // 'react-forget-runtime' not yet supported
494 + // 'react-compiler-runtime' not yet supported
495 "flag-enable-emit-hook-guards",
496 ]);
497
compiler/packages/snap/src/compiler.ts
+4 -4
@@ -69,11 +69,11 @@ function makePluginOptions(
69 if (firstLine.includes("@instrumentForget")) {
70 enableEmitInstrumentForget = {
71 fn: {
72 - source: "react-forget-runtime",
72 + source: "react-compiler-runtime",
73 importSpecifierName: "useRenderCounter",
74 },
75 gating: {
76 - source: "react-forget-runtime",
76 + source: "react-compiler-runtime",
77 importSpecifierName: "shouldInstrument",
78 },
79 globalGating: "__DEV__",
@@ -81,13 +81,13 @@ function makePluginOptions(
81 }
82 if (firstLine.includes("@enableEmitFreeze")) {
83 enableEmitFreeze = {
84 - source: "react-forget-runtime",
84 + source: "react-compiler-runtime",
85 importSpecifierName: "makeReadOnly",
86 };
87 }
88 if (firstLine.includes("@enableEmitHookGuards")) {
89 enableEmitHookGuards = {
90 - source: "react-forget-runtime",
90 + source: "react-compiler-runtime",
91 importSpecifierName: "$dispatcherGuard",
92 };
93 }