Skip to content

fix(module): avoid unhead v2-only hookOnce in colors plugin#234

Merged
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-e4ca579
Jun 29, 2026
Merged

fix(module): avoid unhead v2-only hookOnce in colors plugin#234
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-e4ca579

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Upstream

e4ca579fix(module): avoid unhead v2-only hookOnce in colors plugin (#6658)

Arrived upstream during the #227#233 sync batch — the first commit past the previous v4 HEAD (a84de85), now the new v4 HEAD.

Change — direct 1:1

In src/runtime/plugins/colors.ts, the SPA-hydration branch removed its temporary colors <style> via injectHead().hooks.hookOnce('dom:rendered', …). hookOnce only exists on unhead v2's Hookable; under unhead v3, hooks is a HookableCore exposing only hook. Replaced with a self-unhooking hook:

const head = injectHead()
const unhook = head.hooks?.hook('dom:rendered', () => {
  removeTemporaryColorsStyle()
  unhook?.()
})

b24ui had the identical pre-change line; applied verbatim (the data-bitrix24-ui-colors attribute and surrounding logic are untouched).

Tests

Client-only SPA-hydration plugin path; no component/markup change → no snapshot churn. Full suite unchanged (225 files, 5145 passed / 6 skipped).

Verify (CI=true)

dev:prepare · lint · typecheck · test · build — all green.

Ledger

🤖 Generated with Claude Code


Generated by Claude Code

Port of upstream nuxt/ui e4ca579 (#6658).

In the colors plugin's SPA-hydration branch, `hookOnce` only exists on unhead
v2's `Hookable`; under unhead v3 `hooks` is a `HookableCore` exposing only
`hook`. Replace it with a self-unhooking `hook` so the once-semantics work on
both versions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb
@IgorShevchik IgorShevchik merged commit acb5c96 into main Jun 29, 2026
1 check passed
@IgorShevchik IgorShevchik deleted the sync/nuxt-e4ca579 branch June 29, 2026 16:44
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