Skip to content

fix(astro): Avoid importing transition functions when View Transitions is disabled - #4521

Merged
wobsoriano merged 3 commits into
mainfrom
rob/sdk-1976-fix-page-reloads-on-custom-csr
Nov 8, 2024
Merged

fix(astro): Avoid importing transition functions when View Transitions is disabled#4521
wobsoriano merged 3 commits into
mainfrom
rob/sdk-1976-fix-page-reloads-on-custom-csr

Conversation

@wobsoriano

@wobsoriano wobsoriano commented Nov 7, 2024

Copy link
Copy Markdown
Member

Description

This PR fixes an issue where custom client-side routing (using History API's pushState) triggers unexpected full page reloads due to conflicts with Astro's internal popstate event handlers

Resolves SDK-1976

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot

changeset-bot Bot commented Nov 7, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 75852fe

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

This PR includes changesets to release 1 package
Name Type
@clerk/astro Patch

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

@wobsoriano wobsoriano changed the title fix(astro): Import transition functions only when View Transitions is enabled fix(astro): Avoid importing transition functions when View Transitions is disabled Nov 7, 2024

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We need to avoid importing functions from astro:transitions as there is a code that gets initialized and configures the popstate event which causes full page reload when doing custom client-side routing

@wobsoriano
wobsoriano marked this pull request as ready for review November 7, 2024 23:32
@wobsoriano
wobsoriano merged commit 0d96132 into main Nov 8, 2024
@wobsoriano
wobsoriano deleted the rob/sdk-1976-fix-page-reloads-on-custom-csr branch November 8, 2024 15:27
wobsoriano added a commit that referenced this pull request Feb 8, 2025
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.

4 participants