diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 45e6e5ca28b..c0c199f88e6 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -903,7 +903,7 @@ jobs: - name: Install WebKit for the drawer check id: webkit background: true - run: pnpm exec playwright install --with-deps webkit + run: pnpm exec playwright-core install --with-deps webkit # The entry lives in mobile/ so one React resolves; without this every RN import is nothing. - uses: ./.github/actions/install-mobile-dependencies diff --git a/config/scripts/build-mobile-web-app-bundle.test.mjs b/config/scripts/build-mobile-web-app-bundle.test.mjs index 489599d7bf3..083a7f10a2c 100644 --- a/config/scripts/build-mobile-web-app-bundle.test.mjs +++ b/config/scripts/build-mobile-web-app-bundle.test.mjs @@ -11,19 +11,15 @@ import { import { MOBILE_WEB_APP_NATIVE_PARITY_STYLE, MOBILE_WEB_APP_ROOT_RESET, - MOBILE_WEB_APP_SHIMS, bundleMobileWebApp, buildMobileWebAppBundle, entryStaticClosure, - mobileWebAppBuildOptions, renameOutputsByContent, routeChunkNames } from './build-mobile-web-app-bundle.mjs' import { MOBILE_WEB_APP_ROUTE_ROOT, - ROUTE_SOURCE_LOADERS, - collectMobileWebAppRouteKeys, - collectMobileWebAppRoutes + collectMobileWebAppRouteKeys } from './mobile-web-app-route-manifest.mjs' import { MOBILE_WEB_APP_BUNDLE_MAX_ENTRY_BYTES, @@ -42,7 +38,6 @@ import { BINARY_SOURCE_EXTENSIONS, assertNoCarriageReturnsInSource } from './mobile-web-source-line-endings.mjs' -import { spelledCountsAgainstTables } from './spelled-count-census.mjs' import { hashedAsset, readDesktopVersion, @@ -87,34 +82,6 @@ describe('the CRLF pin', () => { }) describeBundling('the app bundle', () => { - it('isolates read-only fixture consumers from mutations in another assertion', async () => { - const first = await readAppBundle() - const original = first.script[0] - first.script[0] ^= 255 - first.chunks.length = 0 - first.routeKeys.length = 0 - const next = await readAppBundle() - expect(next.script[0]).toBe(original) - expect(next.chunks.length).toBeGreaterThan(0) - expect(next.routeKeys.length).toBeGreaterThan(0) - const written = await readWrittenBundle() - written.manifest.assets.length = 0 - expect((await readWrittenBundle()).manifest.assets.length).toBeGreaterThan(0) - const originalByte = written.files[0].bytes[0] - written.files[0].bytes[0] ^= 255 - expect((await readWrittenBundle()).files[0].bytes[0]).toBe(originalByte) - await withScratch(async (scratch) => { - const firstDir = join(scratch, 'first') - await copyWrittenBundle(firstDir) - await writeFile(join(firstDir, 'manifest.json'), 'corrupted') - const secondDir = join(scratch, 'second') - const second = await copyWrittenBundle(secondDir) - for (const { file, bytes } of second.files) { - expect((await readFile(join(secondDir, file))).equals(bytes), file).toBe(true) - } - }) - }, 120_000) - it('resolves react-native to react-native-web and leaves no require.context', async () => { const sources = allScriptSource(await readAppBundle()) for (const source of sources) { @@ -307,47 +274,6 @@ describeBundling('the app bundle', () => { } }, 120_000) - it('asks esbuild for the split the budgets assume', async () => { - const options = mobileWebAppBuildOptions(await collectMobileWebAppRoutes(appDir)) - // Each of these is load-bearing for a budget below: esm and splitting are what make a route a - // chunk, and the metafile is the only thing that says which imports are static. - expect(options.format).toBe('esm') - expect(options.splitting).toBe(true) - expect(options.chunkNames).toBe('[hash]') - expect(options.metafile).toBe(true) - }) - - it('reads a route source the same way the export guard does', async () => { - const options = mobileWebAppBuildOptions(await collectMobileWebAppRoutes(appDir)) - // The guard parses each route on its own, outside this build. Sharing the table is what stops - // a loader the bundle relies on from being missing there and reported as a syntax error. - for (const [extension, loader] of Object.entries(ROUTE_SOURCE_LOADERS)) { - expect(options.loader[extension], extension).toBe(loader) - } - }) - - it('applies every shim it names', async () => { - const options = mobileWebAppBuildOptions(await collectMobileWebAppRoutes(appDir)) - for (const shim of MOBILE_WEB_APP_SHIMS) { - expect(shim.appliesTo(options), `${shim.name} is named but not applied`).toBe(true) - } - }) - - it('fails the named shim, not the whole build, when its option goes missing', async () => { - const options = mobileWebAppBuildOptions(await collectMobileWebAppRoutes(appDir)) - // Each shim reads an option of its own (two read `banner.js`), so stripping every option - // leaves none applying. Without that, the list could name a shim the build stopped applying. - const stripped = { - ...options, - alias: {}, - loader: {}, - define: {}, - banner: {}, - plugins: [] - } - expect(MOBILE_WEB_APP_SHIMS.filter((shim) => shim.appliesTo(stripped))).toEqual([]) - }) - it('ships no haptic that reaches for the DOM', async () => { // expo-haptics' web build fakes an iOS haptic by appending a hidden // `