Repository navigation
build: replace Webpack Encore and AssetMapper with Symfony Reprise - #154
Merged
Merged
Conversation
Vite builds the admin and api-docs entries through @symfony/reprise, and EasyAdmin loads the admin entry with addRepriseEntry(). AssetMapper only built the unused assets/app.js, but EasyAdmin rendered its import map on every admin page. The unused base.html.twig goes with it, and the admin stylesheet is now styles/admin.css.
API Specification - Non-breaking changesNo changelog changes |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #154 +/- ##
=============================================
- Coverage 64.58% 64.55% -0.03%
+ Complexity 1270 1269 -1
=============================================
Files 167 167
Lines 3942 3939 -3
=============================================
- Hits 2546 2543 -3
Misses 1396 1396
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to ticket
TODO: no ticket linked yet — please add before review.
Description
Replace Webpack Encore, which is in maintenance mode, with Symfony Reprise and Vite, and remove the unused AssetMapper.
symfony/reprisereplacessymfony/webpack-encore-bundle, andvite.config.jsreplaceswebpack.config.js. Vite builds the same two entries topublic/build:admin(assets/admin.js, which importsassets/styles/admin.css) and the CSS-onlyapi-docs.addRepriseEntry('admin')(EasyAdmin docs), and the API docs template usesreprise_entry_link_tags('api-docs').package.jsondrops Webpack, Babel, core-js and the Stimulus packages (no Stimulus controllers exist) forviteand@symfony/reprise.yarn build,yarn watchand the coding standards scripts keep their names.reprise.yamlturnsstrict_modeoff in test, as the Encore config did, so tests run without a front-end build. In prod it renders nothing rather than a 500 whenentrypoints.jsonis missing.symfony/asset-mapper,importmap.php, its config and theimportmap:installscript. It only built the skeletonassets/app.js, but EasyAdmin rendered its import map on every admin page. The unusedtemplates/base.html.twiggoes too, andstyles/app.cssis nowstyles/admin.css.asset-map:compile; it still runsyarn installandyarn buildand shipspublic/build. The prod Woodpecker playbook deploys that archive and is unchanged.tom-select is kept: its only user is the
typefield of the deprecated service certificate form, which is out of the menu but still reachable.Staging
.woodpecker/stg.ymldeploys withgit pullandcomposer installand has never built front-end assets, with Encore either, and the server compose has no node service. Unchanged here.Verification
docker compose run --rm node yarn install docker compose run --rm node yarn build docker compose exec phpfpm bin/console cache:clearChecked in the browser: the admin loads
/build/admin-*.jsand.csson list, detail and form pages with the ITK styling, the copy button works, tom-select starts on a new service, and Swagger UI, ReDoc and Scalar load/build/api-docs-*.css. No import map is rendered any more.Checklist