Add support for custom timestamps in Event via EVENT_INIT_TIMESTAMP_KEY (#56304)#56304
Closed
rubennorte wants to merge 1 commit intofacebook:mainfrom
Closed
Add support for custom timestamps in Event via EVENT_INIT_TIMESTAMP_KEY (#56304)#56304rubennorte wants to merge 1 commit intofacebook:mainfrom
rubennorte wants to merge 1 commit intofacebook:mainfrom
Conversation
|
@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D99076591. |
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Apr 1, 2026
…EY (facebook#56304) Summary: Add support for specifying a custom `timeStamp` in the `Event` constructor options via a private symbol key (`EVENT_INIT_TIMESTAMP_KEY`) defined in `EventInternals`. This is for internal construction of events using a custom timestamp (instead of event object creation), for use cases like dispatching events from the host platform using the original timestamps. - Added `EVENT_INIT_TIMESTAMP_KEY` symbol to `EventInternals` - Added `setEventInitTimeStamp(eventInit, timeStamp)` helper function in `EventInternals` that validates the type and sets the symbol-keyed property on the event init object - Updated the `Event` constructor to read the custom timestamp from options if present, falling back to `performance.now()` - Added Fantom tests for custom timestamp and zero as a valid timestamp Changelog: [Internal] Differential Revision: D99076591
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Apr 1, 2026
…EY (facebook#56304) Summary: Add support for specifying a custom `timeStamp` in the `Event` constructor options via a private symbol key (`EVENT_INIT_TIMESTAMP_KEY`) defined in `EventInternals`. This is for internal construction of events using a custom timestamp (instead of event object creation), for use cases like dispatching events from the host platform using the original timestamps. - Added `EVENT_INIT_TIMESTAMP_KEY` symbol to `EventInternals` - Added `setEventInitTimeStamp(eventInit, timeStamp)` helper function in `EventInternals` that validates the type and sets the symbol-keyed property on the event init object - Updated the `Event` constructor to read the custom timestamp from options if present, falling back to `performance.now()` - Added Fantom tests for custom timestamp and zero as a valid timestamp Changelog: [Internal] Differential Revision: D99076591
…EY (facebook#56304) Summary: Add support for specifying a custom `timeStamp` in the `Event` constructor options via a private symbol key (`EVENT_INIT_TIMESTAMP_KEY`) defined in `EventInternals`. This is for internal construction of events using a custom timestamp (instead of event object creation), for use cases like dispatching events from the host platform using the original timestamps. - Added `EVENT_INIT_TIMESTAMP_KEY` symbol to `EventInternals` - Added `setEventInitTimeStamp(eventInit, timeStamp)` helper function in `EventInternals` that validates the type and sets the symbol-keyed property on the event init object - Updated the `Event` constructor to read the custom timestamp from options if present, falling back to `performance.now()` - Added Fantom tests for custom timestamp and zero as a valid timestamp Changelog: [Internal] Reviewed By: huntie Differential Revision: D99076591
d9beec3 to
fbd7654
Compare
|
This pull request has been merged in e7564d6. |
Collaborator
|
This pull request was successfully merged by @rubennorte in e7564d6 When will my fix make it into a release? | How to file a pick request? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Add support for specifying a custom
timeStampin theEventconstructor options via a private symbol key (EVENT_INIT_TIMESTAMP_KEY) defined inEventInternals. This is for internal construction of events using a custom timestamp (instead of event object creation), for use cases like dispatching events from the host platform using the original timestamps.EVENT_INIT_TIMESTAMP_KEYsymbol toEventInternalssetEventInitTimeStamp(eventInit, timeStamp)helper function inEventInternalsthat validates the type and sets the symbol-keyed property on the event init objectEventconstructor to read the custom timestamp from options if present, falling back toperformance.now()Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D99076591