🎥 Make videos programmatically with React
Fix Browser Studio CI regressions
JonnyBurger36b26b3b6c5d
diff --git a/packages/browser-studio/e2e/browser-studio.test.ts b/packages/browser-studio/e2e/browser-studio.test.tsindex 3cf49b9190..5fd386d3aa 100644--- a/packages/browser-studio/e2e/browser-studio.test.ts+++ b/packages/browser-studio/e2e/browser-studio.test.ts@@ -335,7 +335,9 @@ test('loads Browser Studio, opens external links, and can add, delete, and dupliawait expect(inspector).toBeVisible();await inspector.click();await studio.getByRole('button', {name: 'Add Solid'}).click();- const solid = studio.getByText('<Solid>', {exact: true});+ const solid = studio.locator(+ '[data-timeline-marquee-item][title="<Solid>"]',+ );await expect(solid).toBeVisible();await expect(studio.locator('svg[viewBox="0 0 24 16"]')).toBeVisible();await solid.click();@@ -1113,7 +1115,9 @@ export const BrowserElement = () => <Rect width={320} height={180} fill="red" />};});expect(versions.installed).toBe(versions.remotion);- await expect(studio.getByText('Browser Element')).toBeVisible();+ await expect(+ studio.getByText('Browser Element', {exact: true}),+ ).toBeVisible();});test('confirms and imports an Element payload from the URL fragment', async ({diff --git a/packages/browser-studio/src/virtual-files.ts b/packages/browser-studio/src/virtual-files.tsindex 41829ee4a6..fe1d9a5faa 100644--- a/packages/browser-studio/src/virtual-files.ts+++ b/packages/browser-studio/src/virtual-files.ts@@ -1,3 +1,5 @@+import {REACT_REFRESH_FINISHED_EVENT} from '@remotion/studio-shared';+export const browserStudioVirtualFilePaths = {browserRequireShim: '/__remotion_browser_studio__/browser-require-shim.js',reactRefreshEntry: '/__remotion_browser_studio__/react-refresh-entry.js',@@ -38,9 +40,7 @@ const getInjectedReactRefreshFiles = () => {return __BROWSER_STUDIO_REACT_REFRESH_FILES__;};-const notifyOnRefresh = `import {REACT_REFRESH_FINISHED_EVENT} from '@remotion/studio-shared';--const RemotionRefreshRuntime = require('react-refresh/runtime');+const notifyOnRefresh = `const RemotionRefreshRuntime = require('react-refresh/runtime');RemotionRefreshRuntime.__remotionReactRefreshWrapped ??= null;if (RemotionRefreshRuntime.__remotionReactRefreshWrapped === null) {@@ -49,7 +49,7 @@ if (RemotionRefreshRuntime.__remotionReactRefreshWrapped === null) {RemotionRefreshRuntime.performReactRefresh = () => {const result = originalPerformReactRefresh();if (result !== null) {- window.dispatchEvent(new Event(REACT_REFRESH_FINISHED_EVENT));+ window.dispatchEvent(new Event(${JSON.stringify(REACT_REFRESH_FINISHED_EVENT)}));}return result;