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

Fix missing integrity hash on preload #161

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

arnaud-ritti
Copy link

Has mentioned in issue #101 , integrity hash is missing into the link headers.

Update test case to be cohérent with the case
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.

Sorry for the slow review! Thanks for this - there is just one minor backwards-compatibility concern we need to address!

@@ -91,7 +91,7 @@ public function renderWebpackScriptTags(string $entryName, string $packageName =
$this->convertArrayToAttributes($attributes)
);

$this->renderedFiles['scripts'][] = $attributes['src'];
$this->renderedFiles['scripts'][] = $attributes;
Copy link
Member

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.

Copy link
Author

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.

Copy link

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.

@mustanggb
Copy link

Needs a reroll.

@ToshY
Copy link

ToshY commented Feb 16, 2024

@weaverryan @jrushlow please take a look at this.

@ToshY
Copy link

ToshY commented Feb 23, 2024

@weaverryan @jrushlow please take a look at this.

1 similar comment
@ToshY
Copy link

ToshY commented Mar 3, 2024

@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"];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
$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"];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
$this->renderedFiles['styles'][] = $attributes["href"];
$this->renderedFiles['styles'][] = $attributes['href'];

@jrushlow jrushlow added the Status: Needs Work Additional work is needed label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug Fix Status: Needs Work Additional work is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants