Skip to content

IBX-12891: Upgraded @symfony/webpack-encore to 7.2 and dropped the webpack pin in the 6.0 encore recipes - #273

Open
pawlakadrian wants to merge 2 commits into
masterfrom
IBX-12891
Open

pawlakadrian wants to merge 2 commits into
masterfrom
IBX-12891

Conversation

@pawlakadrian

@pawlakadrian pawlakadrian commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-12891

Before merging:

Related PRs:

Description:

Fixes the webpack 5.112.0 build failure (IBX-12890) on 6.0 properly, by upgrading @symfony/webpack-encore from ^5.1.0 to ^7.2.0 in the encore recipes of oss, headless, experience and commerce, and drops the temporary webpack <5.112.0 pin from #272 there. 4.6 and 5.0 are not changed and keep the pin.

package.json:

  • @symfony/webpack-encore: ^5.1.0 → ^7.2.0
  • Babel 8 is a peer dependency of encore 7: added @babel/core and @babel/preset-env ^8.0.0, @babel/preset-react ^7.0.0 → ^8.0.0
  • added babel-plugin-polyfill-corejs3 ^1.0.0
  • @symfony/stimulus-bridge: ^3.0.0 → ^4.0.2, the first version whose loader does not require webpack/lib/dependencies/LoaderDependency (3.x still does, so enableStimulusBridge() fails with webpack 5.112.0)
  • webpack: >=5.99.7 <5.112.0 → ^5.99.7 and its resolutions entry removed (the sass <1.106.0 pin from IBX-12962, IBX-12962: Pinned sass below 1.106.0 in the encore recipes #276, stays)

webpack.config.js:

  • encore 7 is an ES module: require('@symfony/webpack-encore').default
  • Babel 8 removed useBuiltIns/corejs from @babel/preset-env (encore 7 throws on them): the core-js polyfills are now added with babel-plugin-polyfill-corejs3 (usage-global) through configureBabel()
  • getWebpackConfig() returns a Promise: the app config name is set once it resolves (otherwise --config-name app, used by ibexa:encore:compile, fails with Configuration with the name "app" was not found)

Not changed on purpose:

⚠️ Before merging: @ibexa/frontend-config points to the IBX-12891 branch only to test this in CI. Switch it back to a tag range (#^v5.0.3) once ibexa/frontend-config#13 is released; the recipes do not work with encore 7 and an older frontend-config.

For QA:

  • Verified earlier locally on a commerce 6.0 project (with the related PRs): all six ibexa:encore:compile steps from CI plus encore production compile. Differences in the output compared to encore 5 are expected: Babel 8 targets modern browsers by default (no ES5 transpilation, smaller JS) and no longer injects regenerator-runtime, so its *.LICENSE.txt files are gone.
  • Without the pin (yarn 1.22.22, Node 22) on a minimal project from the oss 6.0 recipe with copyFiles() and enableStimulusBridge(): resolves webpack 5.112.0, encore 7.2.0, stimulus-bridge 4.0.2 and compiles; with stimulus-bridge 3.x the same build fails with Cannot find module 'webpack/lib/dependencies/LoaderDependency'.

Not verified on a full 6.0 project without the pin or in a browser yet; browser-tests regression run on 6.0: ibexa/commerce#2074.

Documentation:

Projects upgrading to these recipes on 6.0 need to apply the same package.json / webpack.config.js changes; custom encore configs that modify the result of Encore.getWebpackConfig() synchronously have to wait for the Promise with encore 7.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

Thanks for contribution! 🎉

To test the changes please execute:

composer config extra.symfony.endpoint https://api.github.com/repos/ibexa/recipes-dev/contents/index.json?ref=flex/pull-273

before executing the recipes.

@pawlakadrian

Copy link
Copy Markdown
Contributor Author

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

All eight manifests must replace the temporary frontend-config branch with the compatible release range before merging.

1 open finding
What changed in this PR

Upgrades the 5.0 and 6.0 frontend recipes to Encore 7.2 to address the copy-files-loader compatibility regression.

Changes:

  • Updates Encore, Babel and polyfill dependencies across four products.
  • Adapts webpack configurations for Encore’s default export, asynchronous configuration and Babel 8 polyfills.
  • Temporarily points frontend-config dependencies to the integration branch.
File Description
ibexa/​oss/​6.0/​encore/​webpack.config.js Adapts configuration to Encore 7.
ibexa/​oss/​6.0/​encore/​package.json Updates build dependencies.
ibexa/​oss/​5.0/​encore/​webpack.config.js Adapts configuration to Encore 7.
ibexa/​oss/​5.0/​encore/​package.json Updates build dependencies.
ibexa/​headless/​6.0/​encore/​webpack.config.js Adapts configuration to Encore 7.
ibexa/​headless/​6.0/​encore/​package.json Updates build dependencies.
ibexa/​headless/​5.0/​encore/​webpack.config.js Adapts configuration to Encore 7.
ibexa/​headless/​5.0/​encore/​package.json Updates build dependencies.
ibexa/​experience/​6.0/​encore/​webpack.config.js Adapts configuration to Encore 7.
ibexa/​experience/​6.0/​encore/​package.json Updates build dependencies.
ibexa/​experience/​5.0/​encore/​webpack.config.js Adapts configuration to Encore 7.
ibexa/​experience/​5.0/​encore/​package.json Updates build dependencies.
ibexa/​commerce/​6.0/​encore/​webpack.config.js Adapts configuration to Encore 7.
ibexa/​commerce/​6.0/​encore/​package.json Updates build dependencies.
ibexa/​commerce/​5.0/​encore/​webpack.config.js Adapts configuration to Encore 7.
ibexa/​commerce/​5.0/​encore/​package.json Updates build dependencies.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

"@ckeditor/ckeditor5-dev-utils": "^47.0.0",
"@hotwired/stimulus": "^3.0.0",
"@ibexa/frontend-config": "https://github.com/ibexa/frontend-config#^v5.0.0",
"@ibexa/frontend-config": "https://github.com/ibexa/frontend-config#IBX-12891",
@pawlakadrian pawlakadrian changed the title IBX-12891: Upgraded @symfony/webpack-encore to 7.2 in the 5.0 and 6.0 encore recipes IBX-12891: Upgraded @symfony/webpack-encore to 7.2 and dropped the webpack pin in the 6.0 encore recipes Oct 20, 2026
pawlakadrian and others added 2 commits October 21, 2026 13:31
…recipes

- @symfony/webpack-encore 7 is an ES module: webpack.config.js takes its default export
- Babel 8 dropped the useBuiltIns/corejs options of @babel/preset-env: core-js polyfills
  are now added with babel-plugin-polyfill-corejs3, and Babel 8 is required explicitly
- getWebpackConfig() returns a Promise: the "app" config name is set once it resolves

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With @symfony/webpack-encore 7 the 6.0 recipes no longer need the pin from
IBX-12890. @symfony/stimulus-bridge is bumped to ^4.0.2, the first version
whose loader does not require webpack/lib/dependencies/LoaderDependency
(removed in webpack 5.112.0). The pin stays on 4.6 and 5.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
37.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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