Skip to content

fix: export synthetic and change event types - #180

Merged
tannerlinsley merged 1 commit into
mainfrom
factory/export-change-event-types
Nov 20, 2026
Merged

tannerlinsley merged 1 commit into
mainfrom
factory/export-change-event-types

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Typed handlers that import ChangeEvent or SyntheticEvent from React fail to compile when React resolves to Redact. Export BaseSyntheticEvent, SyntheticEvent and ChangeEvent from the React entry so input and select handlers can name their event types.

This adds declarations and a patch changeset. It does not change event dispatch.

Validation on main f61f721 with Node 24.22.0:

  • All 2,127 tests passed, with 91 skipped, and project types and build verification passed.
  • All 38 fixed size checks passed. All 36 React 18/19 compatibility comparisons were zero bytes for minified, gzip and Brotli.
  • A consumer of the actual packed package compiled all three exported types with strict checks. Removing the exports from the packed declaration made that consumer fail.
  • Reviewed the complete four-file diff. No dependencies, scripts or workflows changed.

Summary by CodeRabbit

  • New Features
    • Added exported TypeScript types for base synthetic events, synthetic events, and change events in React integrations. These types help provide event-aware typing for handlers, including access to input values and checked state, select options, event targets, and common event methods.

@changeset-bot

changeset-bot Bot commented Nov 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b3c0bb0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tanstack/redact Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The package adds exported TypeScript interfaces for base synthetic events, synthetic events, and change events. Type examples cover input and select targets, and a changeset declares a patch release.

Changes: React change-event types

Layer / File(s) Summary
Define and expose event types
packages/redact/src/react/events.ts, packages/redact/src/react/index.ts, tests/types/change-events.ts, .changeset/change-event-types.md
The new interfaces define event properties, methods, and target types. The React entry point exports the types. Examples check input and select event members and target-specific typing. The changeset declares a patch release.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to b3c0b

This adds TypeScript event type exports for typed handlers without changing runtime behavior. No merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix: export synthetic and change event types" matches the main change. The PR adds exported BaseSyntheticEvent, SyntheticEvent, and ChangeEvent interfaces in packages/redact/src/react/event…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix: export synthetic and change event types" matches the main change. The PR adds exported BaseSyntheticEvent, SyntheticEvent, and ChangeEvent interfaces in packages/redact/src/react/events.ts, re-exports them from packages/redact/src/react/index.ts, and adds a patch changeset and type tests. The title is short, specific, and does not describe unrelated work. The "fix:" prefix is a conventional-commit label; the change adds exports and does not alter event dispatch, which the title does not claim.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6d27e53e-9bd9-46f7-8c32-c0d75c5add81
Commits

Reviewing files that changed from the base of the PR and between f61f721 and b3c0bb0.

Files selected for processing: 4

  • .changeset/change-event-types.md
  • packages/redact/src/react/events.ts
  • packages/redact/src/react/index.ts
  • tests/types/change-events.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@tannerlinsley
tannerlinsley merged commit 6d3e2af into main Nov 20, 2026
66 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 15, 2026
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