Skip to content

Add developer debugging support to Location Hooks system#357

Merged
scottyzen merged 3 commits intofeature/hooksfrom
copilot/sub-pr-354
Feb 17, 2026
Merged

Add developer debugging support to Location Hooks system#357
scottyzen merged 3 commits intofeature/hooksfrom
copilot/sub-pr-354

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 16, 2026

Addresses 5 review comments to improve debugging experience for developers using the Location Hooks system.

Error Logging

Added development-mode error logging for hook failures:

// Hook rendering errors now log to console in dev mode
catch (error) {
  if (process.env.NODE_ENV !== 'production') {
    console.error(`[HookOutlet] Error rendering hook "${entry.id}" at outlet "${props.name}":`, error);
  }
  return null;
}
  • HookOutlet.vue: Logs rendering errors and conditional evaluation failures with hook ID and outlet context
  • useHooks.ts: Warns on duplicate hook ID registrations with source information

Required Outlet Implementation

Implemented the previously-unused required prop on HookOutlet:

  • Warns when required outlets have no registered hooks
  • WatchEffect only created when required is true (avoids unnecessary reactive watchers)

Type Correction

CartCard.vue: Fixed cart context type mismatch by passing actual cart object instead of null, matching HookContextMap['cart.lineItem.afterName'] type definition.

All logging scoped to development mode via process.env.NODE_ENV checks.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 16, 2026 23:51
- Add dev mode logging for hook rendering errors (HookOutlet.vue:48-50)
- Add dev mode logging for condition evaluation errors (HookOutlet.vue:33-34)
- Implement 'required' prop functionality to warn when no hooks registered
- Fix cart context type mismatch in CartCard.vue (pass actual cart object)
- Add dev mode warning for duplicate hook IDs (useHooks.ts:107)

Co-authored-by: scottyzen <5116925+scottyzen@users.noreply.github.com>
…or logging

Co-authored-by: scottyzen <5116925+scottyzen@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Feb 16, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/woonuxt/woonuxt/node_modules/.bin/nuxt prepare (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add location hooks for improved extensibility Add developer debugging support to Location Hooks system Feb 16, 2026
Copilot AI requested a review from scottyzen February 16, 2026 23:54
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Feb 16, 2026

Deploying woo with  Cloudflare Pages  Cloudflare Pages

Latest commit: edcb188
Status: ✅  Deploy successful!
Preview URL: https://d2cf0d97.woo-ijf.pages.dev
Branch Preview URL: https://copilot-sub-pr-354.woo-ijf.pages.dev

View logs

@scottyzen scottyzen marked this pull request as ready for review February 16, 2026 23:56
@scottyzen scottyzen merged commit 27c2575 into feature/hooks Feb 17, 2026
2 checks passed
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