Skip to content

chore(shared): strict migration batch 3b (feed, log hooks)#5581

Open
rebelchris wants to merge 4 commits intomainfrom
codex/eng-803-batch3-feed-log
Open

chore(shared): strict migration batch 3b (feed, log hooks)#5581
rebelchris wants to merge 4 commits intomainfrom
codex/eng-803-batch3-feed-log

Conversation

@rebelchris
Copy link
Contributor

@rebelchris rebelchris commented Feb 25, 2026

Summary

  • continue ENG-803 strict migration in packages/shared
  • fix strict typing in hooks/feed/* and hooks/log/*
  • tighten callback/ref typing and query updater shapes without runtime behavior changes

Files

  • src/hooks/feed/*
  • src/hooks/log/*

Validation

  • pnpm --filter shared lint:fix
  • pnpm --filter shared lint
  • pnpm --filter shared typecheck:strict (batch-3 target scope clean in combined validation)
  • pnpm --filter extension typecheck
  • pnpm --filter shared test -- --testPathPattern="src/hooks/(contentPreference|feed|log|notifications|search|squads|translation)"

Notes

  • pnpm --filter shared typecheck and pnpm --filter webapp typecheck fail on existing repo-wide baseline issues unrelated to this batch in the current environment.
  • pnpm --filter webapp build fails at prerender with TLS cert error (UNABLE_TO_GET_ISSUER_CERT_LOCALLY) after successful compile.

Preview domain

https://codex-eng-803-batch3-feed-log.preview.app.daily.dev

@vercel
Copy link

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
daily-webapp Ready Ready Preview Feb 25, 2026 1:34pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
storybook Ignored Ignored Feb 25, 2026 1:34pm

Request Review

Comment on lines 58 to 61
const callback = (event: Event) => {
if (!(event instanceof CustomEvent)) {
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure event will really be instanceOf CustomEvent every time, I would use as here for now even though its not ideal

const handleLifecycle = (event: CustomEvent) =>
lifecycleCallbackRef.current(event);
const handleLifecycle = (event: Event) => {
if (!(event instanceof CustomEvent)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

@rebelchris
Copy link
Contributor Author

@claude see ante's feedback please adjust

@claude
Copy link
Contributor

claude bot commented Feb 25, 2026

Claude finished @rebelchris's task in 52s —— View job


Adjusted as casting per ante's feedback

  • Gather context
  • Read useLogLifecycleEvents.ts and useLogPageView.ts
  • Replace instanceof CustomEvent with as casting
  • Commit and push

Both files had the same pattern — an instanceof CustomEvent guard before passing the event to the callback ref. Replaced with as CustomEvent cast in both:

useLogLifecycleEvents.ts (line ~59):

// Before
const callback = (event: Event) => {
  if (!(event instanceof CustomEvent)) {
    return;
  }
  lifecycleCallbackRef.current?.(event);
};

// After
const callback = (event: Event) => {
  lifecycleCallbackRef.current?.(event as CustomEvent);
};

useLogPageView.ts (line ~31) — same change applied.
|

Co-authored-by: Chris Bongers <rebelchris@users.noreply.github.com>
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