Skip to content

v2: QRL optimizations#8388

Merged
wmertens merged 8 commits intobuild/v2from
v2-move-module-scope
Mar 5, 2026
Merged

v2: QRL optimizations#8388
wmertens merged 8 commits intobuild/v2from
v2-move-module-scope

Conversation

@wmertens
Copy link
Member

@wmertens wmertens commented Feb 25, 2026

  • move module-scoped identifiers into QRL segments if only one segment is using them
  • move QRL creation to module scope if no captures
  • try to move captures into string tag q:ps properties whenever possible
  • add // to separate imports / qrls / code, for readability during debugging
  • fix a bug that would lose some expressions

This should result in smaller dependency trees and faster loops

@changeset-bot
Copy link

changeset-bot bot commented Feb 25, 2026

🦋 Changeset detected

Latest commit: 91f299c

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

@maiieul maiieul moved this to In progress in Qwik Development Feb 25, 2026
@wmertens wmertens changed the base branch from main to build/v2 February 25, 2026 07:50
@wmertens wmertens force-pushed the v2-move-module-scope branch from c6aab68 to 9200b9c Compare February 25, 2026 07:51
@promptless-for-oss
Copy link

@wmertens ℹ️ Promptless reviewed this request and did not find a docs change to propose.

@wmertens wmertens force-pushed the v2-move-module-scope branch 3 times, most recently from 27d233d to 339702f Compare February 25, 2026 13:56
Copy link
Member

@maiieul maiieul left a comment

Choose a reason for hiding this comment

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

Does this fix a bug? Please add a bit of context 🙏

@wmertens
Copy link
Member Author

@maiieul it's a perf change, moving the qrl creation as far up the scope as possible. That way, we create less objects and everything is faster

@wmertens wmertens force-pushed the v2-move-module-scope branch 2 times, most recently from 6e605a4 to 1f43813 Compare March 2, 2026 20:10
@wmertens wmertens changed the title v2: move module scoped vars to segments when appropriate v2: QRL optimizations Mar 2, 2026
@wmertens wmertens marked this pull request as ready for review March 2, 2026 20:12
@wmertens wmertens requested review from a team as code owners March 2, 2026 20:12
@maiieul maiieul moved this from In progress to Waiting For Review in Qwik Development Mar 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview 91f299c

@wmertens wmertens force-pushed the v2-move-module-scope branch from 1f43813 to db53b9e Compare March 3, 2026 12:50
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 3, 2026

Open in StackBlitz

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

commit: 91f299c

@wmertens wmertens force-pushed the v2-move-module-scope branch 3 times, most recently from 16ba102 to fd1010e Compare March 4, 2026 15:55
Comment on lines +37 to +40
import css1 from "./global.css";
import css2 from "./style.css";
//
export const App_component_useStyles_t35nSa5UV7U = `${css1}${css2}`;
Copy link
Member Author

Choose a reason for hiding this comment

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

BTW notice this, it was a bug, now it keeps the css.

@wmertens wmertens force-pushed the v2-move-module-scope branch from b5e4b52 to c97d9b7 Compare March 4, 2026 21:54
wmertens added 2 commits March 5, 2026 12:15
- self references: `const foo = $(() => console.log(foo))` works now
- QRL hoisting: if a QRL doesn't capture anything, it's moved to module
  scope
@wmertens wmertens force-pushed the v2-move-module-scope branch 2 times, most recently from 902b4d7 to d0197f1 Compare March 5, 2026 13:32
@wmertens wmertens force-pushed the v2-move-module-scope branch 2 times, most recently from 1d6fcdf to da1c8c5 Compare March 5, 2026 13:47
this will cause many handlers to move to module scope, using less memory.
@wmertens wmertens force-pushed the v2-move-module-scope branch from da1c8c5 to 91f299c Compare March 5, 2026 14:27
@wmertens wmertens merged commit cfed116 into build/v2 Mar 5, 2026
23 checks passed
@wmertens wmertens deleted the v2-move-module-scope branch March 5, 2026 14:51
@github-project-automation github-project-automation bot moved this from Waiting For Review to Done in Qwik Development Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants