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

Merged
merged 12 commits into from
Aug 1, 2022

Conversation

marvinjude
Copy link
Contributor

@marvinjude marvinjude commented Jul 22, 2022

Description

  • Make inline script run in develop
  • Eliminate multiple runs

Tests

[sc-53497]

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 22, 2022
@marvinjude marvinjude added type: bug An issue or pull request relating to a bug in Gatsby and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jul 22, 2022
@marvinjude marvinjude changed the title fix(gatsby): Make script in Head behave correctly fix(gatsby): Make <script> in Head behave correctly Jul 22, 2022
@LekoArts LekoArts added topic: DX Developer Experience (e.g. Fast Refresh, i18n, SSR, page creation, starters) and removed type: bug An issue or pull request relating to a bug in Gatsby labels Jul 22, 2022
@marvinjude marvinjude dismissed a stale review via ae3d0d6 July 27, 2022 16:42
@marvinjude marvinjude marked this pull request as ready for review July 27, 2022 16:53
@marvinjude marvinjude merged commit 6612f69 into master Aug 1, 2022
@marvinjude marvinjude deleted the tests-for-script-data-blocks branch August 1, 2022 18:54
pieh pushed a commit that referenced this pull request Aug 2, 2022
* 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)
pieh added a commit that referenced this pull request Aug 2, 2022
Co-authored-by: pieh <misiek.piechowiak@gmail.com>
Co-authored-by: Jude Agboola <marvinjudehk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: DX Developer Experience (e.g. Fast Refresh, i18n, SSR, page creation, starters)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants