Skip to content

feat(test-runner): experimental esbuild transpilation - #43320

Merged
Pavel Feldman (pavelfeldman) merged 2 commits into
microsoft:mainfrom
pavelfeldman:esbuild-transpilation
Oct 13, 2026
Merged

Pavel Feldman (pavelfeldman) merged 2 commits into
microsoft:mainfrom
pavelfeldman:esbuild-transpilation

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • PLAYWRIGHT_EXPERIMENTAL_ESBUILD=1 transpiles TS/JS with esbuild instead of Babel; the loader, tsconfig resolution and compilation cache are unchanged.
  • esbuild is an optional peer dependency (>=0.21.5) that users install themselves.
  • Class fields follow useDefineForClassFields the same way as Babel.
  • Known differences from Babel: assert import attributes are unsupported in ESM, PW_TEST_SOURCE_TRANSFORM is ignored, the module behavior pinned in babel.spec.ts differs, syntax error messages differ.
  • Replaces feat(test-runner): experimental esbuild transpilation #43177.

esbuild

real 0m4.392s
real 0m4.349s

babel

real 0m10.349s
real 0m10.255s

hot

real 0m2.637s

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

.update(pluginsEpilogue.map(p => p[0]).join(','))
.update(useDefineForClassFields ? 'define' : 'assign')
.update(jsx ? JSON.stringify(jsx) : '')
.update(esbuildVersion ? 'esbuild@' + esbuildVersion : '')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: should this also include the node version (see the process.versions.node.split('-')[0] above) so that if the developer switches node without updating playwright we wont attempt to reuse the same code?

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

6 flaky ⚠️ [chromium-library] › library/video.spec.ts:356 › screencast › should work for popups `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/beforeunload.spec.ts:130 › should support dismissing the dialog multiple times `@realtime-time-library-chromium-linux`
⚠️ [chromium-library] › library/tracing.spec.ts:565 › should produce screencast frames fit `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/webmcp.spec.ts:238 › should call same-name tools in their own frame `@chromium-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-ubuntu-22.04-node20`

53416 passed, 1267 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

2 failed
❌ [chromium] › mcp/files.spec.ts:201 › closing browser during download does not crash the server @mcp-windows-latest-chromium
❌ [firefox] › mcp/idle-timeout.spec.ts:19 › closes the browser after the idle timeout and relaunches it on the next call @mcp-windows-latest-firefox

9202 passed, 1495 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a first look at the CI failures.

🟢 The failures are pre-existing flakes; this PR is clear

Both final MCP failures have the same test and error signature on unrelated revisions. The main test workflow had no final failures.

Details

This PR changes the optional esbuild transform path and does not touch the MCP download or idle-timeout behavior. CI tested merge sha 82e79656.

Pre-existing flake / infra

  • [chromium] › mcp/files.spec.ts:201 › closing browser during download does not crash the server on Windows — the same 5-second timeout waiting for Downloading file test.txt ... occurred on unrelated main shas 6152cce6 and e41a93b0. In the recent test-results history for Windows Chromium, it failed 3 of 300 runs and passed 297.
  • [firefox] › mcp/idle-timeout.spec.ts:19 › closes the browser after the idle timeout and relaunches it on the next call on Windows — the same Target page, context or browser has been closed failure occurred on unrelated PR #43030 and main sha da087a92. In the recent test-results history for Windows Firefox, it failed 27 of 298 runs and passed 271.

Triaged by the Playwright bot - agent run

@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit 6284a53 into microsoft:main Oct 13, 2026
43 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants