-
Notifications
You must be signed in to change notification settings - Fork 25.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(core): Use the early event contract instead of the event contract in the bootstrap. #55587
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
13cb6e5
refactor(core): Export some more symbols and check for truthiness on …
iteriani c6914bf
refactor(core): Use early event contract instead of the event contrac…
iteriani 4fb0361
fixup! refactor(core): Use early event contract instead of the event …
iteriani 4cace25
fixup! refactor(core): Use early event contract instead of the event …
iteriani abf2b97
fixup! refactor(core): Use early event contract instead of the event …
iteriani 188d19f
fixup! refactor(core): Use early event contract instead of the event …
iteriani bdc3d5c
fixup! refactor(core): Use early event contract instead of the event …
iteriani a640be8
fixup! refactor(core): Use early event contract instead of the event …
iteriani ab76cdb
fixup! refactor(core): Use early event contract instead of the event …
iteriani f101720
fixup! refactor(core): Use early event contract instead of the event …
iteriani b833f50
fixup! refactor(core): Use early event contract instead of the event …
iteriani e1a0460
fixup! refactor(core): Use early event contract instead of the event …
iteriani e8666a1
fixup! refactor(core): Use early event contract instead of the event …
iteriani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1328,9 +1328,6 @@ | |
{ | ||
"name": "init_discovery_utils" | ||
}, | ||
{ | ||
"name": "init_dispatcher" | ||
}, | ||
{ | ||
"name": "init_document" | ||
}, | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -142,10 +142,33 @@ function insertEventRecordScript( | |||||||||||||||||||||||||||||||||||||||||||||||
const eventDispatchScript = findEventDispatchScript(doc); | ||||||||||||||||||||||||||||||||||||||||||||||||
if (eventDispatchScript) { | ||||||||||||||||||||||||||||||||||||||||||||||||
const events = Array.from(eventTypesToBeReplayed); | ||||||||||||||||||||||||||||||||||||||||||||||||
const captureEventTypes = []; | ||||||||||||||||||||||||||||||||||||||||||||||||
const eventTypes = []; | ||||||||||||||||||||||||||||||||||||||||||||||||
for (const eventType of events) { | ||||||||||||||||||||||||||||||||||||||||||||||||
iteriani marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||
if ( | ||||||||||||||||||||||||||||||||||||||||||||||||
eventType === 'mouseenter' || | ||||||||||||||||||||||||||||||||||||||||||||||||
eventType === 'mouseleave' || | ||||||||||||||||||||||||||||||||||||||||||||||||
eventType === 'pointerenter' || | ||||||||||||||||||||||||||||||||||||||||||||||||
eventType === 'pointerleave' | ||||||||||||||||||||||||||||||||||||||||||||||||
) { | ||||||||||||||||||||||||||||||||||||||||||||||||
continue; | ||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||
if ( | ||||||||||||||||||||||||||||||||||||||||||||||||
eventType === 'focus' || | ||||||||||||||||||||||||||||||||||||||||||||||||
eventType === 'blur' || | ||||||||||||||||||||||||||||||||||||||||||||||||
eventType === 'error' || | ||||||||||||||||||||||||||||||||||||||||||||||||
eventType === 'load' || | ||||||||||||||||||||||||||||||||||||||||||||||||
eventType === 'toggle' | ||||||||||||||||||||||||||||||||||||||||||||||||
) { | ||||||||||||||||||||||||||||||||||||||||||||||||
captureEventTypes.push(eventType); | ||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+147
to
+163
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: just as an idea: we can have a couple helper functions from JSAction code, so that we can keep those lists in sync with how JSAction uses them internally.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||||||||||||||||||||||||||
eventTypes.push(eventType); | ||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||
// This is defined in packages/core/primitives/event-dispatch/contract_binary.ts | ||||||||||||||||||||||||||||||||||||||||||||||||
const replayScriptContents = `window.__jsaction_bootstrap('ngContracts', document.body, ${JSON.stringify( | ||||||||||||||||||||||||||||||||||||||||||||||||
appId, | ||||||||||||||||||||||||||||||||||||||||||||||||
)}, ${JSON.stringify(events)});`; | ||||||||||||||||||||||||||||||||||||||||||||||||
)}, ${JSON.stringify(eventTypes)}${captureEventTypes.length ? ',' + JSON.stringify(captureEventTypes) : ''});`; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
const replayScript = createScript(doc, replayScriptContents, nonce); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused why main jumped so much. I would have thought this only would impact the event-dispatch size. Any idea what's up there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we moved logic that was in the event contract to the main bundle.