Skip to content

Conversation

wmertens
Copy link
Member

This brings our Vite plugins more inline with dev mode in the regular Vite ecosystem:

  • qwikVite dev mode only does index.html transforms
  • qwikRouter dev mode runs the renderer with the node middleware and patches the SSR stream for dev mode while streaming
  • fix router build so it doesn't import core
  • dev can now hot reload routes
  • q-manifest is now read only if and when needed
  • ...

@wmertens wmertens requested review from a team as code owners August 31, 2025 10:30
Copy link

changeset-bot bot commented Aug 31, 2025

🦋 Changeset detected

Latest commit: 0a1c70e

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

Copy link
Contributor

github-actions bot commented Aug 31, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

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

@wmertens wmertens force-pushed the router-dev-improvements branch from 37f7283 to 6129d83 Compare August 31, 2025 11:02
@maiieul maiieul moved this from Backlog to In progress in Qwik Development Aug 31, 2025
@wmertens wmertens force-pushed the router-dev-improvements branch from 6129d83 to 5235122 Compare August 31, 2025 20:56
@wmertens wmertens force-pushed the router-dev-improvements branch from 5235122 to 1f72e73 Compare September 2, 2025 21:17
Copy link

pkg-pr-new bot commented Sep 2, 2025

Open in StackBlitz

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

commit: 0a1c70e

@wmertens wmertens marked this pull request as draft September 3, 2025 06:27
@wmertens
Copy link
Member Author

wmertens commented Sep 3, 2025

for some reason, dev mode fails on the docs docs/ pages, it can't resume properly due to vnode mismatch

Copy link
Member

@gioboa gioboa left a comment

Choose a reason for hiding this comment

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

I tested the docs with dev env and it's working fine.

@wmertens
Copy link
Member Author

wmertens commented Sep 6, 2025

@gioboa
I did pnpm build.full to be sure, but when I do pnpm docs.dev and then visit the playground, I get

core.prod.mjs:4183 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0')
    at vnode_isElementVNode (core.prod.mjs:4183:24)
    at ensureElementVNode (core.prod.mjs:4218:49)
    at vnode_getVNodeForChildNode (core.prod.mjs:4469:12)
    at vnode_locate (core.prod.mjs:4425:21)
    at newInvokeContextFromTuple (core.prod.mjs:518:25)
    at tryGetInvokeContext (core.prod.mjs:468:60)
    at qrl.resolve (core.prod.mjs:6422:21)
    at inflate (core.prod.mjs:5294:35)
    at DeserializationHandler.get (core.prod.mjs:5164:45)
    at getObjectById (core.prod.mjs:6087:14)

Which means that the DOM doesn't look like what Core expected, which must mean that element that have a : attribute have been added or removed.

Copy link
Member

@gioboa gioboa left a comment

Choose a reason for hiding this comment

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

I see, let me double check it

this applies to CSR projects. It makes the code simpler and along with Vite's expectations.

It is done with the transformIndexHtml hook.

Also:

- build the optimizer using vite
- compile the dev helper scripts
- make CSR projects start at /index.html. A starter is provided for this
- remove mentions of entry.dev.tsx
- remove separate dev-server which duplicated route processing logic, instead use node adapter
- watch routes for changes and reload when needed
-  make route imports always dynamic (optionally static). This limits the amount of code to load when not all paths are visited, and reduces startup time.
- remove .testing condition on double import, the reason was the dev-server importing core separately from the test code

Still missing:
- transformindexhtml handling
- entry.ts support
- serviceworker support
also, intercept the writes to the response and transform it as soon as the html head was processed
@wmertens wmertens force-pushed the router-dev-improvements branch from 1f72e73 to 4355c6a Compare September 10, 2025 06:51
@wmertens wmertens force-pushed the router-dev-improvements branch from d40efd8 to 826b120 Compare September 15, 2025 16:41
@wmertens wmertens marked this pull request as ready for review September 15, 2025 16:41
@wmertens wmertens force-pushed the router-dev-improvements branch from 826b120 to 60ffa2e Compare September 15, 2025 16:57
@wmertens wmertens enabled auto-merge September 15, 2025 16:58
@wmertens wmertens disabled auto-merge September 15, 2025 17:12
Copy link
Member

@gioboa gioboa left a comment

Choose a reason for hiding this comment

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

🔥

@wmertens wmertens merged commit 11bcf73 into build/v2 Sep 15, 2025
20 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Qwik Development Sep 15, 2025
@wmertens wmertens deleted the router-dev-improvements branch September 15, 2025 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants