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(gatsby): Make <script> in Head behave correctly (#36212) #36299

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

gatsbybot
Copy link
Collaborator

Backporting #36212 to the 4.20 release branch

(cherry picked from commit 6612f69)

* use innerHTML since since text is unesacaped

* make scripts run

* eliminate multiple append calls

* dev inline script test

* fix problematic multiple appending

* test that script run and get called once

* diff nodes before reappending

* add new elements and remove stale ones

* remove element in prev loop

* move node diffind to separate function, add unit test

* slightly more performant diffing

* don't init array if we will bail early anyway

Co-authored-by: pieh <misiek.piechowiak@gmail.com>
(cherry picked from commit 6612f69)
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 2, 2022
@pieh pieh removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 2, 2022
@pieh pieh merged commit 6c0316e into release/4.20 Aug 2, 2022
@pieh pieh deleted the backport-4.20-36212 branch August 2, 2022 09:33
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.

None yet

3 participants