Skip to content

refactor(devtools): move qwik dom protocol constants into the shared kit - #8825

Open
Aejkatappaja wants to merge 3 commits into
QwikDev:mainfrom
Aejkatappaja:refactor/shared-dom-constants
Open

refactor(devtools): move qwik dom protocol constants into the shared kit#8825
Aejkatappaja wants to merge 3 commits into
QwikDev:mainfrom
Aejkatappaja:refactor/shared-dom-constants

Conversation

@Aejkatappaja

Copy link
Copy Markdown
Member

Problem

QWIK_CONTAINER_SELECTOR, V2_BINDING_ATTR, and QWIK_ATTR describe shared Qwik DOM / devtools protocol details, but they lived only in packages/browser-extension/src/shared/constants.ts. Any other devtools consumer would have to redeclare them.

Solution

  • Move the three constants into @qwik.dev/devtools/kit as protocol/dom.ts, exported through the kit barrel.
  • Import them in the extension content script from @qwik.dev/devtools/kit and delete the extension-local constants.ts (its only consumer).

They are kept as a standalone DOM/container protocol module rather than folded into QWIK_VNODE_PROTOCOL: the values are a different semantic layer (container attributes vs vnode serialization), and a couple of incidental value overlaps (:, q:id) are intentional.

Note: the Qwik framework declares most of these names internally (markers.ts: QContainerAttr, QBaseAttr, QManifestHash, QInstance), but they are not exported from @qwik.dev/core, so kit cannot import them; q:render/q:version and the exclusion selector have no core constant at all. The kit module is the devtools-side source of truth.

Verification

  • kit builds and its generated .d.mts exports all three constants.
  • tsc on the browser extension passes (only the pre-existing wxt TS2742 on the entrypoints remains), so content.ts resolves the kit imports.
  • No dangling shared/constants import remains; eslint passes on the touched files.

References

QwikDev project board, card "p2 Qwik DOM Constants Duplication Risk": https://github.com/orgs/QwikDev/projects/6/views/1

QWIK_CONTAINER_SELECTOR, V2_BINDING_ATTR, and QWIK_ATTR described shared
framework/devtools protocol details but lived only in the browser extension.

Move them into @qwik.dev/devtools/kit (protocol/dom.ts) and import them in the
extension content script from there, so the extension and future consumers share
one source of truth.
@Aejkatappaja
Aejkatappaja requested a review from a team as a code owner July 12, 2026 23:59
@changeset-bot

changeset-bot Bot commented Jul 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e1015cc

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

This PR includes changesets to release 1 package
Name Type
@qwik.dev/devtools 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

@pkg-pr-new

pkg-pr-new Bot commented Jul 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

@qwik.dev/core

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@8825

@qwik.dev/router

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@8825

eslint-plugin-qwik

npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@8825

create-qwik

npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@8825

@qwik.dev/optimizer

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/optimizer@8825

@qwik.dev/devtools

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/devtools@8825

commit: e1015cc

@github-actions

github-actions Bot commented Jul 13, 2026

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 682e16b

@wmertens
wmertens changed the base branch from build/v2 to main July 16, 2026 14:50
@JerryWu1234

Copy link
Copy Markdown
Contributor

done @wmertens

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.

2 participants