Skip to content

[Framework][Assets] Set assets manifest strict by default on debug #43517

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

Closed
wants to merge 1 commit into from

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Oct 14, 2021

Q A
Branch? 6.0
Bug fix? no
New feature? yes
Deprecations? no
Tickets -
License MIT
Doc PR symfony/symfony-docs#...

assets.strict_mode make it easier to debug when an asset is missing from the manifest. Using kernel.debug as default value would release developers from configuring this option (symfony/demo#1168).

This is consistent with Twig environment that is strict on debug by default.

@@ -79,7 +79,7 @@
->args([
abstract_arg('manifest path'),
service('http_client')->nullOnInvalid(),
false,
Copy link
Member Author

Choose a reason for hiding this comment

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

This default value was discussed with @weaverryan in #38495 (comment)

Copy link
Member

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

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

Hmm, this may makes sense. However, it's a BC break: on 5.4 if I have a path that isn't included, then on 6.0, I'll suddenly have an error. Also, there may be people who are putting some of their files directly public/ and, for those files, they won't be in manifest.json and that's ok. I think we probably can't make this change

@GromNaN
Copy link
Member Author

GromNaN commented Oct 17, 2021

That's a good point. People may rely on this fallback behaviour to mix assets listed and not listed in the manifest.json, using a single asset package. Should it be considered as a good practice? This use-case will still be supported, but require the option strict_mode to be set to false explicitly.

I could add a deprecation in 5.4?

@weaverryan
Copy link
Member

Hmm, the question is: is strict mode such a better default that it’s worth the pain of deprecating it and forcing people to turn it to true. I’m not convinced that it is. So I’m 👎 for making this the default.

@stof
Copy link
Member

stof commented Oct 18, 2021

In particular, I don't think that the strict mode should be related to kernel.debug, as it is about whether your manifest is exhaustive or no.

@GromNaN GromNaN closed this Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants