Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[Asset] Add option $strictMode to JsonManifestVersionStrategy#14414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
973798b to3ab23beCompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
…missing item (GromNaN)This PR was merged into the 5.4 branch.Discussion----------[Asset] [DX] Option to make asset manifests strict on missing item| Q | A| ------------- | ---| Branch? | 5.x| Bug fix? | no| New feature? | yes| Deprecations? | no| Tickets | -| License | MIT| Doc PR |symfony/symfony-docs#14414In all the projects I use a JSON manifest, when an asset is not listed in manifest.json, the asset file is not generated. The current behavior is permissive as it returns the unmodified path of the asset. Which ends with a 404 when the browser tries to load the asset.With the option `strict_mode: true`, an exception is thrown when we try to use an asset that is not listed in `manifest.json`. Thereby we don't have to check that asset urls are actually working in tests (manual or automated).**Usage:**The option `strict_mode` is optional for backward compatibility. Using the `%kernel.debug%` value is safe to flush bugs on dev or test mode but keep the application working on production.```yaml# config/packages/assets.yamlframework: assets: packages: app: # Uses a JSON manifest (can be a local path or an url remote file) json_manifest_path: '%kernel.project_dir%/public/build/manifest.json' # Throws an exception when an expected entry is missing in the manifest strict_mode: '%kernel.debug%'```Todo:- [x] Documentationsymfony/symfony-docs#14414- [x] Demosymfony/demo#1168- [x] ~Update recipe ?~Commits-------4cdb921 Option to make asset manifests strict on missing item
javiereguiluz commentedJul 27, 2021
This been pending for too long. Apart from the rebase, is there anything else to be done to make this mergeable? Thanks! |
GromNaN commentedDec 13, 2021
I rebased an updated the doc according to the version it was merged. |
Uh oh!
There was an error while loading.Please reload this page.
Documentation forsymfony/symfony#38495