Skip to content

Enable strict mode on assets #1278

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
merged 1 commit into from
Dec 2, 2021
Merged

Enable strict mode on assets #1278

merged 1 commit into from
Dec 2, 2021

Conversation

@javiereguiluz
Copy link
Member

Nice idea! Thanks Jérôme.

@javiereguiluz javiereguiluz merged commit 9d1e61c into symfony:main Dec 2, 2021
@javiereguiluz
Copy link
Member

@GromNaN I'm seeing this error after merging this PR. Am I doing something wrong?

error

If I uncomment this option, the app works again 🤔

@GromNaN
Copy link
Member Author

GromNaN commented Dec 2, 2021

Oups, I should have tested locally first. I was expecting the CI to fail if there was an error. I check.

@GromNaN GromNaN deleted the patch-3 branch December 2, 2021 16:32
@GromNaN
Copy link
Member Author

GromNaN commented Dec 2, 2021

The manifest is not necessary. The whole assets config can be removed or replaced by:

framework:
    assets:
        base_path: '/'

@javiereguiluz
Copy link
Member

javiereguiluz commented Dec 2, 2021

Yes, this fixed the problem for me. See a118c41 Thanks!

@stof
Copy link
Member

stof commented Dec 2, 2021

@javiereguiluz encore_link_tags does not rely on the manifest strategy, because the entrypoints file already contains the full path AFAIR

@GromNaN
Copy link
Member Author

GromNaN commented Dec 2, 2021

The strict_mode is useless when the manifest is not set.

javiereguiluz added a commit that referenced this pull request Dec 7, 2021
This PR was merged into the main branch.

Discussion
----------

Assets manifest is not necessary with Webpack Encore

Fix breaking changes introduced by #1278

Asset urls generated in `entrypoints.json` https://github.com/symfony/demo/blob/a7a975e2938b0568b493406ce914ac0866b6dd58/public/build/entrypoints.json#L13  are not meant to be mapped with `manifest.json`
https://github.com/symfony/demo/blob/a7a975e2938b0568b493406ce914ac0866b6dd58/public/build/manifest.json#L2

The only place where the twig `asset` function is used, is for a file that is not in the manifest: https://github.com/symfony/demo/blob/a7a975e2938b0568b493406ce914ac0866b6dd58/templates/base.html.twig#L17

Commits
-------

8e9facc Assets manifest is not necessary with Webpack Encore
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.

3 participants