Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ module.exports = {
{
files: [
'packages/react-devtools-extensions/**/*.js',
'packages/react-devtools-shared/src/devtools/views/**/*.js',
'packages/react-devtools-shared/src/hook.js',
'packages/react-devtools-shared/src/backend/console.js',
'packages/react-devtools-shared/src/backend/shared/DevToolsComponentStackFrame.js',
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/compiler_discord_notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: (Compiler) Discord Notify

on:
pull_request_target:
types: [labeled]
paths:
- compiler/**
- .github/workflows/compiler_**.yml

jobs:
notify:
if: ${{ github.event.label.name == 'React Core Team' }}
runs-on: ubuntu-latest
steps:
- name: Discord Webhook Action
uses: tsickert/discord-webhook@v6.0.0
with:
webhook-url: ${{ secrets.COMPILER_DISCORD_WEBHOOK_URL }}
embed-author-name: ${{ github.event.pull_request.user.login }}
embed-author-url: ${{ github.event.pull_request.user.html_url }}
embed-author-icon-url: ${{ github.event.pull_request.user.avatar_url }}
embed-title: '#${{ github.event.number }} (+${{github.event.pull_request.additions}} -${{github.event.pull_request.deletions}}): ${{ github.event.pull_request.title }}'
embed-description: ${{ github.event.pull_request.body }}
embed-url: ${{ github.event.pull_request.html_url }}
1 change: 0 additions & 1 deletion .github/workflows/runtime_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ jobs:
- name: Ensure clean build directory
run: rm -rf build
- run: yarn install --frozen-lockfile
- run: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
working-directory: fixtures/dom
- name: Restore archived build
uses: actions/download-artifact@v4
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/runtime_discord_notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: (Runtime) Discord Notify

on:
pull_request_target:
types: [labeled]
paths-ignore:
- compiler/**
- .github/workflows/compiler_**.yml

jobs:
notify:
if: ${{ github.event.label.name == 'React Core Team' }}
runs-on: ubuntu-latest
steps:
- name: Discord Webhook Action
uses: tsickert/discord-webhook@v6.0.0
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
embed-author-name: ${{ github.event.pull_request.user.login }}
embed-author-url: ${{ github.event.pull_request.user.html_url }}
embed-author-icon-url: ${{ github.event.pull_request.user.avatar_url }}
embed-title: '#${{ github.event.number }} (+${{github.event.pull_request.additions}} -${{github.event.pull_request.deletions}}): ${{ github.event.pull_request.title }}'
embed-description: ${{ github.event.pull_request.body }}
embed-url: ${{ github.event.pull_request.html_url }}
35 changes: 0 additions & 35 deletions .github/workflows/shared_discord_notify.yml

This file was deleted.

7 changes: 1 addition & 6 deletions compiler/packages/react-compiler-runtime/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ const path = require('path');
const {Generator} = require('npm-dts');

const argv = yargs(process.argv.slice(2))
.options('p', {
alias: 'platform',
default: 'browser',
choices: ['browser', 'node'],
})
.options('w', {
alias: 'watch',
default: false,
Expand All @@ -31,7 +26,7 @@ const config = {
bundle: true,
external: ['react'],
format: 'cjs',
platform: argv.p,
platform: 'node',
target: 'es6',
banner: {
js: `/**
Expand Down
2 changes: 1 addition & 1 deletion compiler/packages/snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"scripts": {
"postinstall": "./scripts/link-react-compiler-runtime.sh && perl -p -i -e 's/react\\.element/react.transitional.element/' ../../node_modules/fbt/lib/FbtReactUtil.js && perl -p -i -e 's/didWarnAboutUsingAct = false;/didWarnAboutUsingAct = true;/' ../../node_modules/react-dom/cjs/react-dom-test-utils.development.js",
"build": "rimraf dist && concurrently -n snap,runtime \"tsc --build\" \"yarn --silent workspace react-compiler-runtime build -p node\"",
"build": "rimraf dist && concurrently -n snap,runtime \"tsc --build\" \"yarn --silent workspace react-compiler-runtime build\"",
"test": "echo 'no tests'",
"prettier": "prettier --write 'src/**/*.ts'"
},
Expand Down
6 changes: 3 additions & 3 deletions fixtures/dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"jest-diff": "^29.4.1",
"prop-types": "^15.6.0",
"query-string": "^4.2.3",
"react": "^15.4.1",
"react-dom": "^15.4.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"semver": "^5.5.0"
},
"scripts": {
"dev": "react-scripts start",
"predev": "cp -a ../../build/oss-stable/. node_modules",
"predev": "cp -a ../../build/oss-experimental/. node_modules",
"build": "react-scripts build && cp build/index.html build/200.html",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
Expand Down
57 changes: 39 additions & 18 deletions fixtures/dom/src/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,42 @@
import './polyfills';
import loadReact from './react-loader';
import loadReact, {isLocal} from './react-loader';

loadReact()
.then(() => import('./components/App'))
.then(App => {
const {React, ReactDOM} = window;

if (typeof window.ReactDOMClient !== 'undefined') {
// we are in a React that only supports modern roots

ReactDOM.createRoot(document.getElementById('root')).render(
React.createElement(App.default)
if (isLocal()) {
Promise.all([import('react'), import('react-dom/client')])
.then(([React, ReactDOMClient]) => {
if (React === undefined || ReactDOMClient === undefined) {
throw new Error(
'Unable to load React. Build experimental and then run `yarn dev` again'
);
}
window.React = React;
window.ReactDOMClient = ReactDOMClient;
})
.then(() => import('./components/App'))
.then(App => {
window.ReactDOMClient.createRoot(document.getElementById('root')).render(
window.React.createElement(App.default)
);
} else {
ReactDOM.render(
React.createElement(App.default),
document.getElementById('root')
);
}
});
});
} else {
loadReact()
.then(() => import('./components/App'))
.then(App => {
const {React, ReactDOM} = window;
if (
typeof window.ReactDOMClient !== 'undefined' &&
typeof window.ReactDOMClient.createRoot !== 'undefined'
) {
// we are in a React that only supports modern roots

window.ReactDOMClient.createRoot(
document.getElementById('root')
).render(React.createElement(App.default));
} else {
ReactDOM.render(
React.createElement(App.default),
document.getElementById('root')
);
}
});
}
4 changes: 4 additions & 0 deletions fixtures/dom/src/react-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ function getVersion() {
return query.version || 'local';
}

export function isLocal() {
return getVersion() === 'local';
}

export function reactPaths(version = getVersion()) {
let query = parseQuery(window.location.search);
let isProduction = query.production === 'true';
Expand Down
Loading
Loading