Skip to content

Plan: Modernize @tko/utils#335

Draft
brianmhunt wants to merge 2 commits intomainfrom
plan/modernize-utils
Draft

Plan: Modernize @tko/utils#335
brianmhunt wants to merge 2 commits intomainfrom
plan/modernize-utils

Conversation

@brianmhunt
Copy link
Copy Markdown
Member

Summary

Adds plans/modernize-utils.md — a phased modernization plan for @tko/utils that drops legacy polyfill probes, tightens types, and preserves the public API surface package-by-package.

This PR is just the plan, opened as a draft for discussion before implementation PRs land.

Phases

Phase Status Notes
A. Dead polyfill probes Ready (branch modernize/utils-dead-polyfills) symbol, function, string, css — net -40 lines, 2698 browser + 2671 happy-dom tests pass
B. tasks.ts microtask Not started Drop MutationObserver fallback; queueMicrotask is universal
C. object.ts Not started Object.hasOwn (ES2022); delete @deprecated clonePlainObjectDeep
D. memoization.ts Not started Map over {} dictionary
E. array.ts idioms Not started Drop arguments.length > 2 ? .bind(owner) pattern

Out of scope

  • @tko/lifecycle refactor (#322) — separate plan.
  • Any public API removal. Function names and signatures remain.
  • The deferError / options.onError swallowing bug — spawned to its own branch to keep this scope surgical.

Test plan

  • Review plan scope and phase ordering
  • Confirm Phase A branch is acceptable to land standalone once this plan is approved
  • Flag any public-API concerns for Phase E (arguments.length > 2 → drop thisArg third-arg pattern)

🤖 Generated with Claude Code

Phased modernization of @tko/utils — drop legacy polyfill probes,
tighten types, preserve public API surface. Five independently
shippable phases (A–E). Phase A is already implemented on
modernize/utils-dead-polyfills and green on both browser and
happy-dom projects.

Out of scope: @tko/lifecycle refactor (#322), public API removal,
the deferError/onError swallowing bug (separate branch).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 92f70278-06b6-457c-b539-8e54f79942a5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch plan/modernize-utils

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Existing onErrorBehaviors.ts spec explicitly codifies the current
behavior: when options.onError is installed, all TKO errors (including
deferred ones) flow through it rather than escaping to window.onerror.
That's the designed contract; my earlier flag was wrong.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.

1 participant