Dogfood uMC polyfill in playground
Lauren Tan committed
Apr 3, 2024 at 18:12 UTC
ee24e3fc16ee2482c76e22bef85e9e6f5a4b08f0
5 files changed
+16
-7
compiler/apps/playground/babel.config.js
+1
@@ -18,6 +18,7 @@ module.exports = function (api) {
18
{
19
compilationMode: "infer",
20
panicThreshold: "NONE",
21
+ enableUseMemoCachePolyfill: true,
22
},
23
],
24
],
compiler/apps/playground/next.config.js
+11
-5
@@ -6,6 +6,7 @@
6
*/
7
8
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
9
+const path = require("path");
10
11
const nextConfig = {
12
reactStrictMode: true,
@@ -25,13 +26,18 @@ const nextConfig = {
26
}),
27
);
28
}
29
+
30
+ config.resolve.alias = {
31
+ ...config.resolve.alias,
32
+ "react-forget-runtime": path.resolve(
33
+ __dirname,
34
+ "../../packages/react-forget-runtime",
35
+ ),
36
+ };
37
+
38
return config;
39
},
30
- // These aren't used by the playground, but turning it on forces nextjs to use
31
- // experimental react which has the useMemoCache hook.
32
- experimental: {
33
- serverActions: true,
34
- },
40
+
41
transpilePackages: ["monaco-editor"],
42
};
43
compiler/apps/playground/package.json
+2
-1
@@ -32,7 +32,8 @@
32
"prettier": "3.0.3",
33
"pretty-format": "^29.3.1",
34
"react": "18.2.0",
35
- "react-dom": "18.2.0"
35
+ "react-dom": "18.2.0",
36
+ "react-forget-runtime": "*"
37
},
38
"devDependencies": {
39
"@types/node": "18.11.9",
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,playground \"yarn workspace babel-plugin-react-forget run build --watch\" \"yarn workspace playground run dev\"",
25
+ "dev": "concurrently --kill-others -n compiler,runtime,playground \"yarn workspace babel-plugin-react-forget run build --watch\" \"yarn workspace react-forget-runtime run build --watch\" \"yarn workspace playground run dev\"",
26
"test": "yarn workspaces run test",
27
"snap": "yarn workspace babel-plugin-react-forget run snap",
28
"snap:build": "yarn workspace snap run build"
compiler/packages/react-forget-runtime/package.json
+1
@@ -3,6 +3,7 @@
3
"version": "0.0.1",
4
"description": "Runtime for React Forget",
5
"license": "MIT",
6
+ "main": "dist/index.js",
7
"files": [
8
"src"
9
],