Skip to content
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

Prevent HTML-escaping of module specifiers #562

Merged
merged 2 commits into from
Feb 3, 2023

Conversation

simonihmig
Copy link
Contributor

@simonihmig simonihmig commented Jan 26, 2023

Importing a file like image.jpg?widths=50,100,640&formats=original,webp,avif&responsive for consumption with a custom webpack loader failed, as what got written into the AMD shim was instead image.jpg?widths=50,100,640&formats=original,webp,avif&responsive, failing the webpack module rules and/or the parsing of the query in the loader.

It turned out this was due to the double curlies in the handlebars-based AMD shim generator HTML-escaping the module specifiers. With "normal" paths this would not have any effect, but here it breaks things obviously.


I haven't run tests locally, as I was expected this to not break anything, and I hoped Github would do that for me, but it seems CI setup is not working correctly (matrix scenarios not running, the discover_matrix fails here).

Also I didn't add any tests, as I wasn't sure how to do this, without replicating a whole e2e scenario with a webpack plugin reproducing the failure...

@ef4
Copy link
Collaborator

ef4 commented Jan 27, 2023

CI looks good now, the IE11 test is flaky and I'm not concerned about it here.

@simonihmig
Copy link
Contributor Author

@ef4 what do you think about this? Can we merge? Or do we need a test?

@ef4 ef4 merged commit 29eab60 into embroider-build:main Feb 3, 2023
@ef4
Copy link
Collaborator

ef4 commented Feb 3, 2023

Looks good, thanks.

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.

2 participants