Skip to content

fix(qwik-city): Link onQVisible$ handling #7612

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

Merged
merged 2 commits into from
May 20, 2025

Conversation

maiieul
Copy link
Contributor

@maiieul maiieul commented May 19, 2025

What is it?

  • Bug

Description

the onQVisible$ would only be fired once on first SPA load. Now it is fired on all subsequent route changes with the Link component.

Checklist

  • My code follows the developer guidelines of this project
  • I performed a self-review of my own code
  • I added a changeset with pnpm change
  • I made corresponding changes to the Qwik docs
  • I added new tests to cover the fix / functionality

@maiieul maiieul requested a review from a team as a code owner May 19, 2025 15:04
Copy link

changeset-bot bot commented May 19, 2025

🦋 Changeset detected

Latest commit: 27c7bda

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

This PR includes changesets to release 4 packages
Name Type
@builder.io/qwik-city Patch
eslint-plugin-qwik Patch
@builder.io/qwik Patch
create-qwik 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

Copy link

pkg-pr-new bot commented May 19, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@builder.io/qwik@7612
npm i https://pkg.pr.new/@builder.io/qwik-city@7612
npm i https://pkg.pr.new/eslint-plugin-qwik@7612
npm i https://pkg.pr.new/create-qwik@7612

commit: 27c7bda

Copy link
Contributor

github-actions bot commented May 19, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview 27c7bda

@maiieul
Copy link
Contributor Author

maiieul commented May 19, 2025

@jordanw66 do you see anything that's bothering you / that could be improved?

Copy link
Member

@wmertens wmertens left a comment

Choose a reason for hiding this comment

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

LGTM

@shairez shairez merged commit 274d038 into QwikDev:main May 20, 2025
19 checks passed
@jordanw66
Copy link
Contributor

@jordanw66 do you see anything that's bothering you / that could be improved?

It's good, the only thing I wonder is if custom onQVisible$ props should be called on each route change vs just doing prefetch.

The onQVisible$ props already works a certain way on every component, with this change it means it would work different only on Link. Should it re-run all of the props handlers on each change or should it keep the default behavior and instead only run prefetch on route changes?

@github-actions github-actions bot mentioned this pull request May 21, 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