fix(module): avoid unhead v2-only hookOnce in colors plugin#234
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstream
e4ca579—fix(module): avoid unhead v2-only hookOnce in colors plugin (#6658)Change — direct 1:1
In
src/runtime/plugins/colors.ts, the SPA-hydration branch removed its temporary colors<style>viainjectHead().hooks.hookOnce('dom:rendered', …).hookOnceonly exists on unhead v2'sHookable; under unhead v3,hooksis aHookableCoreexposing onlyhook. Replaced with a self-unhookinghook:b24ui had the identical pre-change line; applied verbatim (the
data-bitrix24-ui-colorsattribute 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
.sync/log/e4ca579….md— port rationale.sync/nuxt-ui.json— adde4ca579asport, advance cursor (= new upstream v4 HEAD); reconcile priora84de85→ PR feat(ScrollArea): add getScrollElement virtualize option #233 /63fe722c. (e4ca579itself stayspending-merge, reconciled next port.)🤖 Generated with Claude Code
Generated by Claude Code