diff --git a/compiler/apps/playground/babel.config.js b/compiler/apps/playground/babel.config.js index 2e3c95919f..4db481cbec 100644 --- a/compiler/apps/playground/babel.config.js +++ b/compiler/apps/playground/babel.config.js @@ -18,6 +18,7 @@ module.exports = function (api) { { compilationMode: "infer", panicThreshold: "NONE", + enableUseMemoCachePolyfill: true, }, ], ], diff --git a/compiler/apps/playground/next.config.js b/compiler/apps/playground/next.config.js index 90c462e522..158fd80753 100644 --- a/compiler/apps/playground/next.config.js +++ b/compiler/apps/playground/next.config.js @@ -6,6 +6,7 @@ */ const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin"); +const path = require("path"); const nextConfig = { reactStrictMode: true, @@ -25,13 +26,18 @@ const nextConfig = { }), ); } + + config.resolve.alias = { + ...config.resolve.alias, + "react-forget-runtime": path.resolve( + __dirname, + "../../packages/react-forget-runtime", + ), + }; + return config; }, - // These aren't used by the playground, but turning it on forces nextjs to use - // experimental react which has the useMemoCache hook. - experimental: { - serverActions: true, - }, + transpilePackages: ["monaco-editor"], }; diff --git a/compiler/apps/playground/package.json b/compiler/apps/playground/package.json index d81b217d77..af316e4b9e 100644 --- a/compiler/apps/playground/package.json +++ b/compiler/apps/playground/package.json @@ -32,7 +32,8 @@ "prettier": "3.0.3", "pretty-format": "^29.3.1", "react": "18.2.0", - "react-dom": "18.2.0" + "react-dom": "18.2.0", + "react-forget-runtime": "*" }, "devDependencies": { "@types/node": "18.11.9", diff --git a/compiler/package.json b/compiler/package.json index 73e6e41e3f..a6eb7bc1d9 100644 --- a/compiler/package.json +++ b/compiler/package.json @@ -22,7 +22,7 @@ "start": "yarn workspace playground run start", "next": "yarn workspace playground run dev", "build": "yarn workspaces run build", - "dev": "concurrently --kill-others -n compiler,playground \"yarn workspace babel-plugin-react-forget run build --watch\" \"yarn workspace playground run dev\"", + "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\"", "test": "yarn workspaces run test", "snap": "yarn workspace babel-plugin-react-forget run snap", "snap:build": "yarn workspace snap run build" diff --git a/compiler/packages/react-forget-runtime/package.json b/compiler/packages/react-forget-runtime/package.json index abe5098822..ec34a800ac 100644 --- a/compiler/packages/react-forget-runtime/package.json +++ b/compiler/packages/react-forget-runtime/package.json @@ -3,6 +3,7 @@ "version": "0.0.1", "description": "Runtime for React Forget", "license": "MIT", + "main": "dist/index.js", "files": [ "src" ],