Skip to content

Commit

Permalink
Merge branch 'main' into fix/insertStylesheetIntoRoot-nodeName
Browse files Browse the repository at this point in the history
  • Loading branch information
sweetliquid authored Mar 6, 2024
2 parents 18cbcbf + c11b196 commit 56b1460
Show file tree
Hide file tree
Showing 447 changed files with 17,583 additions and 17,624 deletions.
65 changes: 65 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ jobs:
- setup_node_modules
- run: node ./scripts/tasks/flow-ci


yarn_flags:
docker: *docker
environment: *environment

steps:
- checkout
- setup_node_modules
- run: yarn flags

scrape_warning_messages:
docker: *docker
environment: *environment
Expand Down Expand Up @@ -236,6 +246,53 @@ jobs:
RELEASE_CHANNEL: experimental
command: ./scripts/circleci/run_devtools_e2e_tests.js

run_fixtures_flight_tests:
docker:
- image: cimg/openjdk:20.0-node
environment: *environment
steps:
- checkout
- attach_workspace:
at: .
# Fixture copies some built packages from the workroot after install.
# That means dependencies of the built packages are not installed.
# We need to install dependencies of the workroot to fulfill all dependency constraints
- setup_node_modules
- restore_cache:
name: Restore yarn cache of fixture
keys:
- v2-yarn_cache_fixtures_flight-{{ arch }}-{{ checksum "yarn.lock" }}
- run:
name: Install fixture dependencies
working_directory: fixtures/flight
command: |
yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
if [ $? -ne 0 ]; then
yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
fi
- save_cache:
name: Save yarn cache of fixture
key: v2-yarn_cache_fixtures_flight-{{ arch }}-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- run:
working_directory: fixtures/flight
name: Playwright install deps
command: |
npx playwright install
sudo npx playwright install-deps
- run:
name: Run tests
working_directory: fixtures/flight
command: yarn test
environment:
# Otherwise the webserver is a blackbox
DEBUG: pw:webserver
- store_artifacts:
path: fixtures/flight/playwright-report
- store_artifacts:
path: fixtures/flight/test-results

run_devtools_tests_for_versions:
docker: *docker
environment: *environment
Expand Down Expand Up @@ -400,6 +457,11 @@ workflows:
build_and_test:
unless: << pipeline.parameters.prerelease_commit_sha >>
jobs:
- yarn_flags:
filters:
branches:
ignore:
- builds/facebook-www
- yarn_flow:
filters:
branches:
Expand Down Expand Up @@ -516,6 +578,9 @@ workflows:
- run_devtools_e2e_tests:
requires:
- build_devtools_and_process_artifacts
- run_fixtures_flight_tests:
requires:
- yarn_build

devtools_regression_tests:
unless: << pipeline.parameters.prerelease_commit_sha >>
Expand Down
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,13 @@ module.exports = {
'jest/valid-expect-in-promise': ERROR,
},
},
{
// disable no focused tests for test setup helper files even if they are inside __tests__ directory
files: ['**/setupTests.js'],
rules: {
'jest/no-focused-tests': OFF,
},
},
{
files: [
'**/__tests__/**/*.js',
Expand Down Expand Up @@ -448,6 +455,13 @@ module.exports = {
__IS_CHROME__: 'readonly',
__IS_FIREFOX__: 'readonly',
__IS_EDGE__: 'readonly',
__IS_INTERNAL_VERSION__: 'readonly',
},
},
{
files: ['packages/react-devtools-shared/**/*.js'],
globals: {
__IS_INTERNAL_VERSION__: 'readonly',
},
},
],
Expand Down
107 changes: 107 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/fixtures/art"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/attribute-behavior"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/concurrent"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/devtools"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/dom"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/eslint"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/expiration"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/fiber-debugger"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/fiber-triangle"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/fizz"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/fizz-ssr-browser"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/flight"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/flight-browser"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/flight-esm"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/legacy-jsx-runtimes"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/nesting"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/packaging"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/scheduler"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/ssr"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/ssr-2"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: "npm"
directory: "/fixtures/stacks"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
6 changes: 3 additions & 3 deletions .github/workflows/commit_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
www_branch_count: ${{ steps.check_branches.outputs.www_branch_count }}
fbsource_branch_count: ${{ steps.check_branches.outputs.fbsource_branch_count }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: "Check branches"
id: check_branches
run: |
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:
if: ${{ (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.www_branch_count == '0') || github.ref == 'refs/heads/meta-www' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: builds/facebook-www
- name: Ensure clean directory
Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
runs-on: ubuntu-latest
if: ${{ (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.fbsource_branch_count == '0') || github.ref == 'refs/heads/meta-fbsource' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: main
repository: facebook/react-fbsource-import
Expand Down
2 changes: 1 addition & 1 deletion fixtures/dom/src/components/fixtures/suspense/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class TextInputFixtures extends React.Component {

<Fixture>
<SuspendyTree>
<img src="https://upload.wikimedia.org/wikipedia/commons/e/ee/Atom_%282%29.png" />
<img src="https://upload.wikimedia.org/wikipedia/commons/1/1b/Atom.png" />
React is cool
</SuspendyTree>
</Fixture>
Expand Down
2 changes: 2 additions & 0 deletions fixtures/flight/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

# testing
/coverage
/playwright-report
/test-results

# production
/build
Expand Down
20 changes: 20 additions & 0 deletions fixtures/flight/__tests__/__e2e__/smoke.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {test, expect} from '@playwright/test';

test('smoke test', async ({page}) => {
const consoleErrors = [];
page.on('console', msg => {
const type = msg.type();
if (type === 'warn' || type === 'error') {
consoleErrors.push({type: type, text: msg.text()});
}
});
const pageErrors = [];
page.on('pageerror', error => {
pageErrors.push(error.stack);
});
await page.goto('/');
await expect(page.locator('h1')).toHaveText('Hello World');

await expect(consoleErrors).toEqual([]);
await expect(pageErrors).toEqual([]);
});
10 changes: 8 additions & 2 deletions fixtures/flight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
"type": "module",
"version": "0.1.0",
"private": true,
"devEngines": {
"node": "20.x || 21.x"
},
"dependencies": {
"@babel/core": "^7.16.0",
"@babel/plugin-proposal-private-property-in-object": "^7.18.6",
"@babel/preset-react": "^7.22.5",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.7",
"@svgr/webpack": "^5.5.0",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^13.0.0",
Expand Down Expand Up @@ -60,6 +63,9 @@
"webpack-hot-middleware": "^2.25.3",
"webpack-manifest-plugin": "^4.0.2"
},
"devDependencies": {
"@playwright/test": "^1.41.2"
},
"scripts": {
"predev": "cp -r ../../build/oss-experimental/* ./node_modules/",
"prebuild": "cp -r ../../build/oss-experimental/* ./node_modules/",
Expand All @@ -70,7 +76,7 @@
"start:global": "NODE_ENV=production node --experimental-loader ./loader/global.js server/global",
"start:region": "NODE_ENV=production node --experimental-loader ./loader/region.js --conditions=react-server server/region",
"build": "node scripts/build.js",
"test": "node scripts/test.js --env=jsdom"
"test": "playwright test"
},
"browserslist": {
"production": [
Expand Down
31 changes: 31 additions & 0 deletions fixtures/flight/playwright.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import {defineConfig, devices} from '@playwright/test';

const isCI = Boolean(process.env.CI);

export default defineConfig({
// relative to this configuration file.
testDir: '__tests__/__e2e__',
fullyParallel: true,
// Fail the build on CI if you accidentally left test.only in the source code.
forbidOnly: !isCI,
retries: isCI ? 2 : 0,
// Opt out of parallel tests on CI.
workers: isCI ? 1 : undefined,
reporter: 'html',
use: {
baseURL: 'http://localhost:3000',

trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: {...devices['Desktop Chrome']},
},
],
webServer: {
command: 'FAST_REFRESH=false yarn dev',
url: 'http://localhost:3000',
reuseExistingServer: !isCI,
},
});
Loading

0 comments on commit 56b1460

Please sign in to comment.