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

feat(gatsby-script): Duplicate script callbacks if no injected script callbacks #35717

Merged

Conversation

tyhopp
Copy link
Contributor

@tyhopp tyhopp commented May 23, 2022

Description

  • Refactor script key caching slightly to only add to cache if id or src exists
  • Ensure duplicate script callbacks are executed even if the first script does not have callbacks
  • Adds waitForRouteChange to all cy.visit calls in script component tests because it seems to help reduce flakes when Cypress moves too fast before the page finishes loading

Documentation

N/A

Related issues

[sc-50935]

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label May 23, 2022
@tyhopp tyhopp removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label May 23, 2022
@tyhopp tyhopp changed the title feat(gatsby-script): Duplicate script callback behavior if no first script callbacks feat(gatsby-script): Duplicate script callbacks if no injected script callbacks May 23, 2022
@tyhopp tyhopp requested a review from pieh May 23, 2022 04:07
@tyhopp tyhopp added this to the Script Component milestone May 23, 2022
@pieh pieh merged commit f91f477 into master May 23, 2022
@pieh pieh deleted the feat-script-component-duplicate-script-callbacks-no-first branch May 23, 2022 09:28
pieh pushed a commit that referenced this pull request May 23, 2022
… callbacks (#35717)

* refactor(gatsby-script): Only dedupe if id or src exists

* test(gatsby-script): Add waitForRouteChange on visits

* feat(gatsby-script): Execute duplicate script callbacks even if first script has no callbacks

* chore(gatsby-script): Add comment about listener behavior

* feat(gatsby-script): Adjust remove event listener logic

(cherry picked from commit f91f477)
pieh pushed a commit that referenced this pull request May 23, 2022
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