-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
3 tasks
0ebc0a2
to
a46e0a6
Compare
973798b
to
3ab23be
Compare
OskarStark
reviewed
Feb 17, 2021
OskarStark
reviewed
Feb 17, 2021
maxhelias
reviewed
Feb 17, 2021
5118d09
to
dfdb6eb
Compare
fabpot
added a commit
to symfony/symfony
that referenced
this pull request
Jul 25, 2021
…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#14414 In 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.yaml framework: 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] Documentation symfony/symfony-docs#14414 - [x] Demo symfony/demo#1168 - [x] ~Update recipe ?~ Commits ------- 4cdb921 Option to make asset manifests strict on missing item
This been pending for too long. Apart from the rebase, is there anything else to be done to make this mergeable? Thanks! |
dfdb6eb
to
f58de54
Compare
I rebased an updated the doc according to the version it was merged. |
f58de54
to
c4e19eb
Compare
maxhelias
approved these changes
Dec 13, 2021
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.
Documentation for symfony/symfony#38495