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

Force re-execution of Partytown's head snippet on view transitions #9666

Merged
merged 3 commits into from
Jan 11, 2024

Conversation

martrapp
Copy link
Member

Changes

Just before the view transition swap(), remove the Partytown <head> snippet.
This forces a re-execution on the target page.

Testing

Manually tested

Docs

n.a. / bug fix

Copy link

changeset-bot bot commented Jan 11, 2024

🦋 Changeset detected

Latest commit: 90302ea

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Jan 11, 2024
@martrapp martrapp requested review from matthewp and lilnasy and removed request for matthewp January 11, 2024 15:59
@matthewp
Copy link
Contributor

Looks good!

@matthewp
Copy link
Contributor

Does this fix an open issue?

@martrapp
Copy link
Member Author

Does this fix an open issue?

@OliverSpeir had an inspiring (pun intended) example which got stuck in view transitions or didn't work at all once view transitions were enabled. This, and the discussions with him, helped a lot as minimal reproduction, but to my knowledge, we currently do not have an official issue.

Copy link
Contributor

@lilnasy lilnasy left a comment

Choose a reason for hiding this comment

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

Bit of a hack but that's okay because that's what partytown itself is.
Looks great to me!

@martrapp
Copy link
Member Author

Bit of a hack but that's okay because that's what partytown itself is.

I have not yet found another part for Code Golf in the codebase.
In the end, we all prefer to have maintainable code ;-)

@martrapp martrapp merged commit cdf8ce0 into main Jan 11, 2024
13 checks passed
@martrapp martrapp deleted the mt/self_destruct branch January 11, 2024 18:26
@astrobot-houston astrobot-houston mentioned this pull request Jan 11, 2024
ematipico pushed a commit that referenced this pull request Jan 12, 2024
…9666)

* Remove the header script before a view transition takes place to force a reload on the next page

* Add changeset

* Save another char
ematipico added a commit that referenced this pull request Jan 17, 2024
* feat(i18n): disable redirect

* feat(i18n): add option to disable redirect to default language

* chore: add schema validation

* docs

* changeset

* Update packages/astro/src/core/config/schema.ts

Co-authored-by: Bjorn Lu <[email protected]>

* chore: address feedback

* fix test

* Update .changeset/cyan-grapes-suffer.md

Co-authored-by: Sarah Rainsberger <[email protected]>

* Update packages/astro/src/@types/astro.ts

Co-authored-by: Sarah Rainsberger <[email protected]>

* Fix discord fetch code (#9663)

* Force re-execution of Partytown's head snippet on view transitions (#9666)

* Remove the header script before a view transition takes place to force a reload on the next page

* Add changeset

* Save another char

* [ci] format

* fix(assets): Implement all hooks in the passthrough image service (#9668)

* fix(assets): Implement all hooks in the passthrough image service

* chore: changeset

* refactor(toolbar): Rename every internal reference of overlay/plugins to toolbar/apps (#9647)

* refactor(toolbar): Rename every internal reference of overlay/plugins to toolbar/apps

* refactor: rename vite plugin

* fix: update import

* nit: add setting fallback

* Disable file watcher for internal one-off vite servers (#9665)

* Use node:test and node:assert/strict (#9649)

* [ci] format

* fix(i18n): emit an error when the index isn't found (#9678)

* fix(i18n): emit an error when the index isn't found

* changeset

* Update .changeset/proud-guests-bake.md

Co-authored-by: Sarah Rainsberger <[email protected]>

* rename

* Update packages/astro/src/core/errors/errors-data.ts

Co-authored-by: Florian Lefebvre <[email protected]>

---------

Co-authored-by: Sarah Rainsberger <[email protected]>
Co-authored-by: Florian Lefebvre <[email protected]>

* feat(i18n): add option to disable redirect to default language

* chore: rebase

* Update packages/astro/src/@types/astro.ts

Co-authored-by: Bjorn Lu <[email protected]>

* lock file update

---------

Co-authored-by: Bjorn Lu <[email protected]>
Co-authored-by: Sarah Rainsberger <[email protected]>
Co-authored-by: Martin Trapp <[email protected]>
Co-authored-by: Martin Trapp <[email protected]>
Co-authored-by: Erika <[email protected]>
Co-authored-by: Bjorn Lu <[email protected]>
Co-authored-by: Florian Lefebvre <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants