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
Fix missing integrity hash on preload #161
base: main
Are you sure you want to change the base?
Conversation
Update test case to be cohérent with the case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the slow review! Thanks for this - there is just one minor backwards-compatibility concern we need to address!
src/Asset/TagRenderer.php
Outdated
@@ -91,7 +91,7 @@ public function renderWebpackScriptTags(string $entryName, string $packageName = | |||
$this->convertArrayToAttributes($attributes) | |||
); | |||
|
|||
$this->renderedFiles['scripts'][] = $attributes['src']; | |||
$this->renderedFiles['scripts'][] = $attributes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, this is a BC break, as it changes the structure of what's returned from getRenderedScripts()
and getRenderedStyles()
.
Probably we need to add and maintain a second property - e.g. $this->renderedFilesWithAttributes()
. Then, in getRenderedScripts()
(and also for styles), we could add a new bool $includeAttributes = false
argument. If that's true, then we return the renderedFilesWithAttributes
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @weaverryan , Sorry for the delay. Thanks for your comment.
I fixed the BC break according your recommendations, if you want to check again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weaverryan @jrushlow This PR has been open for almost 2 years now, could either one spare some time to review it further and merge it? Thanks in advance.
Needs a reroll. |
@weaverryan @jrushlow please take a look at this. |
@weaverryan @jrushlow please take a look at this. |
1 similar comment
@weaverryan @jrushlow please take a look at this. |
@@ -91,13 +92,14 @@ public function renderWebpackScriptTags(string $entryName, string $packageName = | |||
$this->convertArrayToAttributes($attributes) | |||
); | |||
|
|||
$this->renderedFiles['scripts'][] = $attributes['src']; | |||
$this->renderedFiles['scripts'][] = $attributes["src"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$this->renderedFiles['scripts'][] = $attributes["src"]; | |
$this->renderedFiles['scripts'][] = $attributes['src']; |
@@ -129,7 +131,8 @@ public function renderWebpackLinkTags(string $entryName, string $packageName = n | |||
$this->convertArrayToAttributes($attributes) | |||
); | |||
|
|||
$this->renderedFiles['styles'][] = $attributes['href']; | |||
$this->renderedFiles['styles'][] = $attributes["href"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$this->renderedFiles['styles'][] = $attributes["href"]; | |
$this->renderedFiles['styles'][] = $attributes['href']; |
Has mentioned in issue #101 , integrity hash is missing into the link headers.