mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore(recorder): update to React 18 (#32101)
Part of https://github.com/microsoft/playwright/issues/31863. Updates `recorder` to use React 18.
This commit is contained in:
parent
e8d845be64
commit
45c2e8a3ed
@ -17,11 +17,10 @@
|
|||||||
import '@web/common.css';
|
import '@web/common.css';
|
||||||
import { applyTheme } from '@web/theme';
|
import { applyTheme } from '@web/theme';
|
||||||
import '@web/third_party/vscode/codicon.css';
|
import '@web/third_party/vscode/codicon.css';
|
||||||
import * as React from 'react';
|
import * as ReactDOM from 'react-dom/client';
|
||||||
import * as ReactDOM from 'react-dom';
|
|
||||||
import { Main } from './main';
|
import { Main } from './main';
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
applyTheme();
|
applyTheme();
|
||||||
ReactDOM.render(<Main/>, document.querySelector('#root'));
|
ReactDOM.createRoot(document.querySelector('#root')!).render(<Main/>);
|
||||||
})();
|
})();
|
||||||
|
|||||||
@ -30,12 +30,14 @@ export const Main: React.FC = ({
|
|||||||
window.playwrightSetSources = setSources;
|
window.playwrightSetSources = setSources;
|
||||||
window.playwrightSetPaused = setPaused;
|
window.playwrightSetPaused = setPaused;
|
||||||
window.playwrightUpdateLogs = callLogs => {
|
window.playwrightUpdateLogs = callLogs => {
|
||||||
|
setLog(log => {
|
||||||
const newLog = new Map<string, CallLog>(log);
|
const newLog = new Map<string, CallLog>(log);
|
||||||
for (const callLog of callLogs) {
|
for (const callLog of callLogs) {
|
||||||
callLog.reveal = !log.has(callLog.id);
|
callLog.reveal = !log.has(callLog.id);
|
||||||
newLog.set(callLog.id, callLog);
|
newLog.set(callLog.id, callLog);
|
||||||
}
|
}
|
||||||
setLog(newLog);
|
return newLog;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
window.playwrightSourcesEchoForTest = sources;
|
window.playwrightSourcesEchoForTest = sources;
|
||||||
|
|||||||
@ -31,7 +31,7 @@ packages.set('injected', packagesDir + '/playwright-core/src/server/injected/');
|
|||||||
packages.set('isomorphic', packagesDir + '/playwright-core/src/utils/isomorphic/');
|
packages.set('isomorphic', packagesDir + '/playwright-core/src/utils/isomorphic/');
|
||||||
packages.set('testIsomorphic', packagesDir + '/playwright/src/isomorphic/');
|
packages.set('testIsomorphic', packagesDir + '/playwright/src/isomorphic/');
|
||||||
|
|
||||||
const peerDependencies = ['electron', 'react', 'react-dom', '@zip.js/zip.js'];
|
const peerDependencies = ['electron', 'react', 'react-dom', 'react-dom/client', '@zip.js/zip.js'];
|
||||||
|
|
||||||
const depsCache = {};
|
const depsCache = {};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user