Skip to content

feat: modern event subsystem - #1945

Draft
mdjastrzebski wants to merge 11 commits into
mainfrom
next/event-system
Draft

mdjastrzebski wants to merge 11 commits into
mainfrom
next/event-system

Conversation

@mdjastrzebski

@mdjastrzebski mdjastrzebski commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Resolves #1957

Merges the next/event-system feature branch (#1944, #1946) into main.

Adds an 'modern' event system for fireEvent and userEvent, opt-in with configure({ unstable_eventSystem: 'modern' }). It follows React Native's event dispatch: handlers receive a SyntheticEvent, and events bubble or go direct like on a device.

  • Adds modern fireEvent, including fireEvent.press(), which calls the press callback of the element that becomes the touch responder (Pressable, Touchable*).
  • Aligns modern userEvent.press() / longPress() with it, so both press the same element.
  • 'legacy' stays the default and behaves as before. Its code moves to src/events/legacy/, with code used by both systems in src/events/shared/.
  • Jest runs every test in both event systems (legacy and modern projects) against shared snapshots.

Test plan

  • yarn validate (typecheck, tests in both Jest projects, lint, format check): 184 suites, 2278 tests, 518 snapshots passed.

if (Object.hasOwn(target, key) && isObject(sourceValue) && isObject(targetValue)) {
mergeInto(targetValue, sourceValue);
} else {
target[key] = sourceValue;
@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.11%. Comparing base (07df7ea) to head (082c4db).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1945      +/-   ##
==========================================
+ Coverage   98.60%   99.11%   +0.51%     
==========================================
  Files          88      108      +20     
  Lines        1786     2476     +690     
  Branches      485      656     +171     
==========================================
+ Hits         1761     2454     +693     
+ Misses         24       22       -2     
+ Partials        1        0       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
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.

fireEvent doesn't deliver raw touch events to an ancestor when a view below declines the responder

2 participants