Skip to content

chore: configure esbuildPlugin targets to esnext (#12101) (CP: 25.2) - #12102

Merged
web-padawan merged 1 commit into
25.2from
cherry-pick-12101-to-25.2-1783684286203
Jul 10, 2026
Merged

chore: configure esbuildPlugin targets to esnext (#12101) (CP: 25.2)#12102
web-padawan merged 1 commit into
25.2from
cherry-pick-12101-to-25.2-1783684286203

Conversation

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This PR cherry-picks changes from the original PR #12101 to branch 25.2.


Original PR description

Since the web-test-runner 1.0.0 update, @web/dev-server-esbuild 2.0.0 resolves esbuild to 0.28.x. esbuild 0.28 marks destructuring as broken in Safari < 14.1 and cannot compile it down, so it fails with an error for any code that uses destructuring when the target includes safari11.1.

With the default target: 'auto', the plugin picks the target from the request's user agent. When the user agent is not recognized as a recent browser (bots, tools like curl, IDE previews), it falls back to a hardcoded list that includes safari11.1, and the dev server responds with an error:

$ curl http://localhost:8000/dev/combo-box.html
Error while transforming dev/combo-box.html: Transforming destructuring to the
configured target environment ("chrome64", "edge79", "firefox67", "safari11.1")
is not supported yet

Setting the target to esnext explicitly skips the user agent detection. JS files and inline scripts in HTML pages are then served as-is, and .ts files are still compiled to JS without changing modern syntax. Both the dev server and tests only need to support recent browsers, so nothing is lost.

Follow-up to #12047


🤖 Generated with Claude Code

@sonarqubecloud

Copy link
Copy Markdown

@web-padawan
web-padawan merged commit fa51925 into 25.2 Jul 10, 2026
10 checks passed
@web-padawan
web-padawan deleted the cherry-pick-12101-to-25.2-1783684286203 branch July 10, 2026 11:57
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