Skip to content

Commit a14bc88

Browse files
committed
[playground] Decouple playground from compiler
Currently the playground is setup as a linked workspace for the compiler which complicates our yarn workspace setup and means that snap can sometimes pull in a different version of react than was otherwise specified. There's no real reason to have these workspaces combined so let's split them up. ghstack-source-id: 7f4eca0 Pull Request resolved: #31081
1 parent 3edc000 commit a14bc88

File tree

6 files changed

+5452
-5280
lines changed

6 files changed

+5452
-5280
lines changed

.github/workflows/compiler_playground.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515

1616
defaults:
1717
run:
18-
working-directory: compiler
18+
working-directory: compiler/apps/playground
1919

2020
jobs:
2121
playground:
@@ -27,13 +27,17 @@ jobs:
2727
with:
2828
node-version-file: '.nvmrc'
2929
cache: yarn
30-
cache-dependency-path: compiler/yarn.lock
30+
cache-dependency-path: compiler/**/yarn.lock
3131
- name: Restore cached node_modules
3232
uses: actions/cache@v4
3333
id: node_modules
3434
with:
3535
path: "**/node_modules"
3636
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('compiler/**/yarn.lock') }}
37-
- run: yarn install --frozen-lockfile
37+
- name: yarn install compiler
38+
run: yarn install --frozen-lockfile
39+
working-directory: compiler
40+
- name: yarn install playground
41+
run: yarn install --frozen-lockfile
3842
- run: npx playwright install --with-deps chromium
39-
- run: yarn workspace playground test
43+
- run: yarn test

compiler/apps/playground/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"private": true,
55
"scripts": {
66
"dev": "NODE_ENV=development next dev",
7-
"build": "next build && node ./scripts/downloadFonts.js",
8-
"vercel-build": "yarn workspaces run build",
7+
"build": "./scripts/link-react-compiler-runtime.sh && next build && node ./scripts/downloadFonts.js",
8+
"vercel-build": "yarn build",
99
"start": "next start",
1010
"lint": "next lint",
1111
"test": "playwright test"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
#
4+
# This source code is licensed under the MIT license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
set -eo pipefail
8+
9+
HERE=$(pwd)
10+
11+
cd ../../packages/react-compiler-runtime && yarn --silent link
12+
cd $HERE && yarn --silent link react-compiler-runtime

0 commit comments

Comments
 (0)