Skip to content

🎥 Make videos programmatically with React

global wait for root

Jonny Burgerf887198ea6f2
diff --git a/packages/bundler/src/renderEntry.tsx b/packages/bundler/src/renderEntry.tsx
index cc3880ef95..e1e874733e 100644
--- a/packages/bundler/src/renderEntry.tsx
+++ b/packages/bundler/src/renderEntry.tsx
@@ -108,17 +108,14 @@ let cleanupExplainerContainer = () => {
explainerContainer.innerHTML = '';
};
+const waitForRootHandle = delayRender('Loading root component');
+
const WaitForRoot: React.FC = () => {
- const [handle] = useState(() => delayRender('Loading root component'));
const [Root, setRoot] = useState<React.FC | null>(() => Internals.getRoot());
- useEffect(() => {
- return () => continueRender(handle);
- }, [handle]);
-
useEffect(() => {
if (Root) {
- continueRender(handle);
+ continueRender(waitForRootHandle);
return;
}
@@ -127,7 +124,7 @@ const WaitForRoot: React.FC = () => {
});
return () => cleanup();
- }, [Root, handle]);
+ }, [Root]);
if (Root === null) {
return null;
diff --git a/packages/renderer/src/open-browser.ts b/packages/renderer/src/open-browser.ts
index 98e54ff0cc..8ed2516a52 100644
--- a/packages/renderer/src/open-browser.ts
+++ b/packages/renderer/src/open-browser.ts
@@ -92,7 +92,6 @@ export const openBrowser = async (
'--proxy-bypass-list=*',
// TODO: remove AvoidUnnecessaryBeforeUnloadCheckSync below
// once crbug.com/1324138 is fixed and released.
- '--disable-features=Translate,BackForwardCache,AvoidUnnecessaryBeforeUnloadCheckSync',
'--disable-hang-monitor',
'--disable-ipc-flooding-protection',
'--disable-popup-blocking',
@@ -120,7 +119,7 @@ export const openBrowser = async (
'--allow-running-insecure-content', // https://source.chromium.org/search?q=lang:cpp+symbol:kAllowRunningInsecureContent&ss=chromium
'--disable-component-update', // https://source.chromium.org/search?q=lang:cpp+symbol:kDisableComponentUpdate&ss=chromium
'--disable-domain-reliability', // https://source.chromium.org/search?q=lang:cpp+symbol:kDisableDomainReliability&ss=chromium
- '--disable-features=AudioServiceOutOfProcess,IsolateOrigins,site-per-process', // https://source.chromium.org/search?q=file:content_features.cc&ss=chromium
+ '--disable-features=AudioServiceOutOfProcess,IsolateOrigins,site-per-process,Translate,BackForwardCache,AvoidUnnecessaryBeforeUnloadCheckSync,IntensiveWakeUpThrottling', // https://source.chromium.org/search?q=file:content_features.cc&ss=chromium
'--disable-print-preview', // https://source.chromium.org/search?q=lang:cpp+symbol:kDisablePrintPreview&ss=chromium
'--disable-site-isolation-trials', // https://source.chromium.org/search?q=lang:cpp+symbol:kDisableSiteIsolation&ss=chromium
'--disk-cache-size=268435456', // https://source.chromium.org/search?q=lang:cpp+symbol:kDiskCacheSize&ss=chromium