Skip to content
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

Send a MessagePort to host on frame startup #2072

Merged
merged 3 commits into from
Aug 9, 2023

Conversation

natebosch
Copy link
Member

Towards #2065

All host implementations are updated to allow either the legacy format,
or this new format.

Simplify the communication and avoid a listener on the frame window
message events. Upon startup replace the {'ready': true} message with
a 'port' message and the MessagePort for a channel created on the
frame side. Omit the manual 'href' field, no host implementations would
read it.

Towards #2065

All host implementations are updated to allow either the legacy format,
or this new format.

Simplify the communication and avoid a listener on the frame window
message events. Upon startup replace the `{'ready': true}` message with
a `'port'` message and the `MessagePort` for a channel created on the
frame side. Omit the manual 'href' field, no host implementations would
read it.
@natebosch natebosch marked this pull request as ready for review August 9, 2023 20:03
Copy link
Contributor

@jakemac53 jakemac53 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check this with package:build (or by just passing -O2 to dart2js in this package)?

@natebosch
Copy link
Member Author

Can you check this with package:build (or by just passing -O2 to dart2js in this package)?

I recompiled host.js with -O2 and dart test -p chrome still works. I also overrode the dep to this version in build/_test and ran dart run build_runner test -- -p chrome and that worked too.

@natebosch natebosch merged commit 9b1828f into master Aug 9, 2023
32 checks passed
@natebosch natebosch deleted the send-channel-from-frame branch August 9, 2023 22:01
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.

None yet

2 participants