Skip to content

feat: modern event subsystem - #1944

Merged
mdjastrzebski merged 28 commits into
next/event-systemfrom
feat/modern-event-subsystem
Oct 9, 2026
Merged

mdjastrzebski merged 28 commits into
next/event-systemfrom
feat/modern-event-subsystem

Conversation

@mdjastrzebski

@mdjastrzebski mdjastrzebski commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds an experimental modern event system that follows React Native's own dispatch (capture and bubble phases, direct events). Turn it on with configure({ unstable_eventSystem: 'modern' }). The default stays 'legacy'.

  • Moves the current implementation to src/events/legacy/ and adds the new one in src/events/modern/.
  • fireEvent and userEvent choose the system on each call. fireEvent.press stays legacy for now.
  • The whole test suite runs in both systems.

Test plan

yarn test:ci, yarn typecheck, yarn lint and yarn format:check pass in both systems. I haven't run it locally against older React Native versions.

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.55556% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.70%. Comparing base (5519b24) to head (ecccf77).

Files with missing lines Patch % Lines
src/events/modern/fire-event.ts 97.50% 1 Missing ⚠️
src/events/shared/update-native-state.ts 93.33% 1 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           next/event-system    #1944      +/-   ##
=====================================================
+ Coverage              98.56%   98.70%   +0.13%     
=====================================================
  Files                     87       95       +8     
  Lines                   1744     2080     +336     
  Branches                 459      550      +91     
=====================================================
+ Hits                    1719     2053     +334     
- Misses                    24       26       +2     
  Partials                   1        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.

if (isObject(sourceValue) && isObject(targetValue)) {
mergeInto(targetValue, sourceValue);
} else {
target[key] = sourceValue;
@mdjastrzebski
mdjastrzebski marked this pull request as ready for review October 9, 2026 13:55
@mdjastrzebski
mdjastrzebski changed the base branch from main to next/event-system October 9, 2026 13:56
@mdjastrzebski
mdjastrzebski merged commit 0b69f6b into next/event-system Oct 9, 2026
38 checks passed
@mdjastrzebski
mdjastrzebski deleted the feat/modern-event-subsystem branch October 9, 2026 13:57
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