Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
[ghstack-poisoned]
  • Loading branch information
poteto committed Jul 30, 2024
2 parents eebb531 + 32ac928 commit ebbe22b
Show file tree
Hide file tree
Showing 58 changed files with 426 additions and 1,369 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/devtools_regression_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Download react-devtools artifacts for base revision
run: |
git fetch origin main
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build-ghaction.js --commit=$(git rev-parse origin/main)
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=$(git rev-parse origin/main)
- name: Display structure of build
run: ls -R build
- name: Archive build
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
with:
name: build
path: build
- run: ./scripts/circleci/pack_and_store_devtools_artifacts.sh
- run: ./scripts/ci/pack_and_store_devtools_artifacts.sh
env:
RELEASE_CHANNEL: experimental
- name: Display structure of build
Expand Down Expand Up @@ -122,8 +122,8 @@ jobs:
uses: actions/download-artifact@v4
- name: Display structure of build
run: ls -R build
- run: ./scripts/circleci/download_devtools_regression_build.js ${{ matrix.version }} --replaceBuild
- run: node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental --reactVersion ${{ matrix.version }} --ci=github
- run: ./scripts/ci/download_devtools_regression_build.js ${{ matrix.version }} --replaceBuild
- run: node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental --reactVersion ${{ matrix.version }} --ci

run_devtools_e2e_tests_for_versions:
name: Run DevTools e2e tests for versions
Expand Down Expand Up @@ -160,9 +160,9 @@ jobs:
run: |
npx playwright install
sudo npx playwright install-deps
- run: ./scripts/circleci/download_devtools_regression_build.js ${{ matrix.version }}
- run: ./scripts/ci/download_devtools_regression_build.js ${{ matrix.version }}
- run: ls -R build-regression
- run: ./scripts/circleci/run_devtools_e2e_tests.js ${{ matrix.version }}
- run: ./scripts/ci/run_devtools_e2e_tests.js ${{ matrix.version }}
env:
RELEASE_CHANNEL: experimental
- name: Cleanup build regression folder
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/runtime_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
path: "**/node_modules"
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn test ${{ matrix.params }} --ci=github --shard=${{ matrix.shard }}
- run: yarn test ${{ matrix.params }} --ci --shard=${{ matrix.shard }}

# ----- BUILD -----
build_and_lint:
Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
path: "**/node_modules"
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn build --index=${{ matrix.worker_id }} --total=20 --r=${{ matrix.release_channel }} --ci=github
- run: yarn build --index=${{ matrix.worker_id }} --total=20 --r=${{ matrix.release_channel }} --ci
env:
CI: github
RELEASE_CHANNEL: ${{ matrix.release_channel }}
Expand Down Expand Up @@ -248,7 +248,7 @@ jobs:
merge-multiple: true
- name: Display structure of build
run: ls -R build
- run: yarn test --build ${{ matrix.test_params }} --shard=${{ matrix.shard }} --ci=github
- run: yarn test --build ${{ matrix.test_params }} --shard=${{ matrix.shard }} --ci

process_artifacts_combined:
name: Process artifacts combined
Expand Down Expand Up @@ -472,7 +472,7 @@ jobs:
pattern: _build_*
path: build
merge-multiple: true
- run: ./scripts/circleci/pack_and_store_devtools_artifacts.sh
- run: ./scripts/ci/pack_and_store_devtools_artifacts.sh
env:
RELEASE_CHANNEL: experimental
- name: Display structure of build
Expand Down Expand Up @@ -521,7 +521,7 @@ jobs:
- run: |
npx playwright install
sudo npx playwright install-deps
- run: ./scripts/circleci/run_devtools_e2e_tests.js
- run: ./scripts/ci/run_devtools_e2e_tests.js
env:
RELEASE_CHANNEL: experimental

Expand Down Expand Up @@ -549,7 +549,7 @@ jobs:
- name: Download artifacts for base revision
run: |
git fetch origin main
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build-ghaction.js --commit=$(git rev-parse origin/main)
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=$(git rev-parse origin/main)
mv ./build ./base-build
# TODO: The `download-experimental-build` script copies the npm
# packages into the `node_modules` directory. This is a historical
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/runtime_commit_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
working-directory: scripts/release
- name: Download artifacts for base revision
run: |
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build-ghaction.js --commit=${{ github.event.workflow_run.head_sha }}
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=${{ github.event.workflow_run.head_sha }}
- name: Display structure of build
run: ls -R build
- name: Strip @license from eslint plugin and react-refresh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/runtime_fuzz_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:
shell: bash
- name: Run fuzz tests
run: |-
FUZZ_TEST_SEED=$RANDOM yarn test fuzz --ci=github
FUZZ_TEST_SEED=$RANDOM yarn test --prod fuzz --ci=github
FUZZ_TEST_SEED=$RANDOM yarn test fuzz --ci
FUZZ_TEST_SEED=$RANDOM yarn test --prod fuzz --ci
4 changes: 2 additions & 2 deletions .github/workflows/shared_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
path: "**/node_modules"
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: ./scripts/circleci/check_license.sh
- run: ./scripts/ci/check_license.sh

test_print_warnings:
name: Test print warnings
Expand All @@ -81,4 +81,4 @@ jobs:
path: "**/node_modules"
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: ./scripts/circleci/test_print_warnings.sh
- run: ./scripts/ci/test_print_warnings.sh
2 changes: 1 addition & 1 deletion ReactVersions.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ReactVersion = '19.0.0';
// choose to change it to "alpha", "beta", "rc", etc.
//
// It only affects the label used in the version string. To customize the
// npm dist tags used during publish, refer to .circleci/config.yml.
// npm dist tags used during publish, refer to .github/workflows/runtime_prereleases_*.yml.
const canaryChannelLabel = 'rc';

// If the canaryChannelLabel is "rc", the build pipeline will use this to build
Expand Down
2 changes: 1 addition & 1 deletion dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ ${significantResults.join('\n')}
writeFileSync('sizebot-message.md', message);
markdown(
'The size diff is too large to display in a single comment. ' +
`The [CircleCI job](${process.env.CIRCLE_BUILD_URL}) contains an artifact called 'sizebot-message.md' with the full message.`
`The GitHub action for this pull request contains an artifact called 'sizebot-message.md' with the full message.`
);
} else {
markdown(message);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"prettier-all": "node ./scripts/prettier/index.js write",
"prettier-check": "node ./scripts/prettier/index.js",
"version-check": "node ./scripts/tasks/version-check.js",
"publish-prereleases": "node ./scripts/release/publish-using-ci-workflow.js",
"publish-prereleases": "echo 'This command has been deprecated. Please refer to https://github.com/facebook/react/tree/main/scripts/release#trigger-an-automated-prerelease'",
"download-build": "node ./scripts/release/download-experimental-build.js",
"download-build-for-head": "node ./scripts/release/download-experimental-build.js --commit=$(git rev-parse HEAD)",
"download-build-in-codesandbox-ci": "yarn build --type=node react/index react-dom/index react-dom/src/server react-dom/test-utils scheduler/index react/jsx-runtime react/jsx-dev-runtime",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function setReactSelectionFromBrowser(bridge) {
}

// Remember to sync the selection next time we show Components tab.
bridge.send('syncSelectionFromNativeElementsPanel');
bridge.send('syncSelectionFromBuiltinElementsPanel');
}
},
);
Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function createBridge() {
});

bridge.addListener(
'syncSelectionToNativeElementsPanel',
'syncSelectionToBuiltinElementsPanel',
setBrowserSelectionFromReact,
);

Expand Down
22 changes: 11 additions & 11 deletions packages/react-devtools-shared/src/backend/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {currentBridgeProtocol} from 'react-devtools-shared/src/bridge';
import type {BackendBridge} from 'react-devtools-shared/src/bridge';
import type {
InstanceAndStyle,
NativeType,
HostInstance,
OwnersList,
PathFrame,
PathMatch,
Expand Down Expand Up @@ -146,12 +146,12 @@ type PersistedSelection = {

export default class Agent extends EventEmitter<{
hideNativeHighlight: [],
showNativeHighlight: [NativeType],
showNativeHighlight: [HostInstance],
startInspectingNative: [],
stopInspectingNative: [],
shutdown: [],
traceUpdates: [Set<NativeType>],
drawTraceUpdates: [Array<NativeType>],
traceUpdates: [Set<HostInstance>],
drawTraceUpdates: [Array<HostInstance>],
disableTraceUpdates: [],
}> {
_bridge: BackendBridge;
Expand Down Expand Up @@ -212,8 +212,8 @@ export default class Agent extends EventEmitter<{
bridge.addListener('stopProfiling', this.stopProfiling);
bridge.addListener('storeAsGlobal', this.storeAsGlobal);
bridge.addListener(
'syncSelectionFromNativeElementsPanel',
this.syncSelectionFromNativeElementsPanel,
'syncSelectionFromBuiltinElementsPanel',
this.syncSelectionFromBuiltinElementsPanel,
);
bridge.addListener('shutdown', this.shutdown);
bridge.addListener(
Expand Down Expand Up @@ -367,7 +367,7 @@ export default class Agent extends EventEmitter<{
const rendererInterface = this.getBestMatchingRendererInterface(node);
if (rendererInterface != null) {
try {
return rendererInterface.getElementIDForNative(node, true);
return rendererInterface.getElementIDForHostInstance(node, true);
} catch (error) {
// Some old React versions might throw if they can't find a match.
// If so we should ignore it...
Expand Down Expand Up @@ -439,7 +439,7 @@ export default class Agent extends EventEmitter<{
}

// TODO: If there was a way to change the selected DOM element
// in native Elements tab without forcing a switch to it, we'd do it here.
// in built-in Elements tab without forcing a switch to it, we'd do it here.
// For now, it doesn't seem like there is a way to do that:
// https://github.com/bvaughn/react-devtools-experimental/issues/102
// (Setting $0 doesn't work, and calling inspect() switches the tab.)
Expand Down Expand Up @@ -658,7 +658,7 @@ export default class Agent extends EventEmitter<{
}
};

syncSelectionFromNativeElementsPanel: () => void = () => {
syncSelectionFromBuiltinElementsPanel: () => void = () => {
const target = window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0;
if (target == null) {
return;
Expand Down Expand Up @@ -697,7 +697,7 @@ export default class Agent extends EventEmitter<{
};

stopInspectingNative: (selected: boolean) => void = selected => {
this._bridge.send('stopInspectingNative', selected);
this._bridge.send('stopInspectingHost', selected);
};

storeAsGlobal: StoreAsGlobalParams => void = ({
Expand Down Expand Up @@ -768,7 +768,7 @@ export default class Agent extends EventEmitter<{
}
};

onTraceUpdates: (nodes: Set<NativeType>) => void = nodes => {
onTraceUpdates: (nodes: Set<HostInstance>) => void = nodes => {
this.emit('traceUpdates', nodes);
};

Expand Down
4 changes: 2 additions & 2 deletions packages/react-devtools-shared/src/backend/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
getStackByFiberInDevAndProd,
getOwnerStackByFiberInDev,
supportsOwnerStacks,
supportsNativeConsoleTasks,
supportsConsoleTasks,
} from './fiber/DevToolsFiberComponentStack';
import {formatOwnerStack} from './shared/DevToolsOwnerStack';
import {castBool, castBrowserTheme} from '../utils';
Expand Down Expand Up @@ -251,7 +251,7 @@ export function patch({

if (
consoleSettingsRef.appendComponentStack &&
!supportsNativeConsoleTasks(current)
!supportsConsoleTasks(current)
) {
const enableOwnerStacks = supportsOwnerStacks(current);
let componentStack = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function getStackByFiberInDevAndProd(
}
}

export function supportsNativeConsoleTasks(fiber: Fiber): boolean {
export function supportsConsoleTasks(fiber: Fiber): boolean {
// If this Fiber supports native console.createTask then we are already running
// inside a native async stack trace if it's active - meaning the DevTools is open.
// Ideally we'd detect if this task was created while the DevTools was open or not.
Expand Down
22 changes: 11 additions & 11 deletions packages/react-devtools-shared/src/backend/fiber/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ import type {
InspectedElement,
InspectedElementPayload,
InstanceAndStyle,
NativeType,
HostInstance,
PathFrame,
PathMatch,
ProfilingDataBackend,
Expand Down Expand Up @@ -937,7 +937,7 @@ export function attach(

// Highlight updates
let traceUpdatesEnabled: boolean = false;
const traceUpdatesForNodes: Set<NativeType> = new Set();
const traceUpdatesForNodes: Set<HostInstance> = new Set();

function applyComponentFilters(componentFilters: Array<ComponentFilter>) {
hideElementsWithTypes.clear();
Expand Down Expand Up @@ -2862,7 +2862,7 @@ export function attach(
return fibers;
}

function findNativeNodesForElementID(id: number) {
function findHostInstancesForElementID(id: number) {
try {
const fiber = findCurrentFiberUsingSlowPathById(id);
if (fiber === null) {
Expand All @@ -2882,12 +2882,12 @@ export function attach(
return fiber != null ? getDisplayNameForFiber(fiber) : null;
}

function getFiberForNative(hostInstance: NativeType) {
function getFiberForNative(hostInstance: HostInstance) {
return renderer.findFiberByHostInstance(hostInstance);
}

function getElementIDForNative(
hostInstance: NativeType,
function getElementIDForHostInstance(
hostInstance: HostInstance,
findNearestUnfilteredAncestor: boolean = false,
) {
let fiber = renderer.findFiberByHostInstance(hostInstance);
Expand Down Expand Up @@ -3870,9 +3870,9 @@ export function attach(
if (result.hooks !== null) {
console.log('Hooks:', result.hooks);
}
const nativeNodes = findNativeNodesForElementID(id);
if (nativeNodes !== null) {
console.log('Nodes:', nativeNodes);
const hostInstances = findHostInstancesForElementID(id);
if (hostInstances !== null) {
console.log('Nodes:', hostInstances);
}
if (window.chrome || /firefox/i.test(navigator.userAgent)) {
console.log(
Expand Down Expand Up @@ -4655,12 +4655,12 @@ export function attach(
clearWarningsForElementID,
getSerializedElementValueByPath,
deletePath,
findNativeNodesForElementID,
findHostInstancesForElementID,
flushInitialOperations,
getBestMatchForTrackedPath,
getDisplayNameForElementID,
getFiberForNative,
getElementIDForNative,
getElementIDForHostInstance,
getInstanceAndStyle,
getOwnersList,
getPathForElement,
Expand Down
Loading

0 comments on commit ebbe22b

Please sign in to comment.