Skip to content

fix(vite): the @qwik-handlers aren't properly handled in dev mode for library projects - #7608

Merged
wmertens merged 8 commits into
QwikDev:build/v2from
JerryWu1234:7600_fix_a_bug
Jun 14, 2025
Merged

wmertens merged 8 commits into
QwikDev:build/v2from
JerryWu1234:7600_fix_a_bug

Conversation

@JerryWu1234

@JerryWu1234 JerryWu1234 commented May 17, 2025 •

Copy link
Copy Markdown
Contributor

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests / types / typos
  • Infra

Description

an http source request will be blocked by middleware in Qwikcore when project is the library mode.
this is because library mode's plugin function in configureServer will be executed immediately, in contrast, in a normal project that has a router Vite plugin will be deferred.

#7600

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

@JerryWu1234

Copy link
Copy Markdown
Contributor Author
image image

@pkg-pr-new

pkg-pr-new Bot commented May 17, 2025 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@7608
npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@7608
npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@7608
npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@7608

commit: 4377da0

@github-actions

github-actions Bot commented May 17, 2025 •

Copy link
Copy Markdown
Contributor
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview 0c3d024

@JerryWu1234
JerryWu1234 marked this pull request as ready for review May 19, 2025 05:20
@JerryWu1234
JerryWu1234 requested a review from a team as a code owner May 19, 2025 05:20
@JerryWu1234 JerryWu1234 changed the title fix(vite): simplify plugin return logic by removing unnecessary condi… fix(vite): the @qwik-handlers aren't properly handled in dev mode for library projects May 19, 2025
@JerryWu1234 JerryWu1234 self-assigned this May 19, 2025
@JerryWu1234 JerryWu1234 moved this from Backlog to In progress in Qwik Development May 19, 2025
@JerryWu1234 JerryWu1234 moved this from In progress to Waiting For Review in Qwik Development May 19, 2025
@changeset-bot

changeset-bot Bot commented May 19, 2025 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2aaa772

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

Comment thread packages/qwik/src/optimizer/src/plugins/vite.ts Outdated
Update the version bump in the changeset file from 'major' to 'patch' to reflect the correct severity of the fix for @qwik-handlers in dev mode for library projects.
Comment thread packages/qwik/src/optimizer/src/plugins/vite.ts Outdated
Comment thread packages/qwik/src/optimizer/src/plugins/vite.ts
The opts initialization was moved inside the async plugin function to ensure proper handling of options during dev mode. This fixes an issue where @qwik-handlers weren't properly handled in dev mode for library projects, as referenced in issue QwikDev#7600.
@maiieul maiieul moved this from Waiting For Review to Upcoming in Qwik Development Jun 3, 2025
@maiieul maiieul moved this from Upcoming to Waiting For Review in Qwik Development Jun 12, 2025
@maiieul

maiieul commented Jun 12, 2025

Copy link
Copy Markdown
Member

This is blocking Jerry. We should merge ASAP if good.

@shairez

shairez commented Jun 13, 2025

Copy link
Copy Markdown
Contributor

@wmertens can you please take a look if all good when you have a minute? (thanks 🙏 )

@wmertens wmertens left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure I quite understand how this works but LGTM

@wmertens
wmertens merged commit 2aa49d9 into QwikDev:build/v2 Jun 14, 2025
@github-project-automation github-project-automation Bot moved this from Waiting For Review to Done in Qwik Development Jun 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants