-
Notifications
You must be signed in to change notification settings - Fork 442
Switch out jschannel for frame-rpc #2425
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
Conversation
Okay. This is verified manually. The tests all pass. I just re-forced with having removed the 'notify' calls. I did a grep for "method: " to make sure I hadn't missed any calls somehow. I'm pretty confident this is good to go, unless there are objections. |
Nice! |
The frame-rpc module is a proper CommonJS module and it's footprint is really tiny. Its protocol is simpler. It doesn't handle connection and buffering, but with our onConnect callback we don't need buffering. The connection handshake that jschannel did was so trivial it's been re-implemented here (each side tries to connect to the other once). We have to handle timeouts ourselves, but that's all hidden in the bridge code. In exchange, we get a simpler API, we get rid of the call/notify distinction in favor of just passing a callback or not and we avoid the excess overhead of the recursion guard in the serialization code that was giving us false positive issues with the document title. This is one step toward removing all the browserify-shim requiring libraries from the injected bundle, which will eventually fix #2397.
|
||
# Close the sidebar | ||
hideFrame: -> | ||
@crossframe?.notify method: 'back' | ||
@crossframe?.call('back') |
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.
"open"/"back" o_O
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.
(Not suggesting that's an issue with this PR. Just... o_O...)
LGTM. |
Switch out jschannel for frame-rpc
The frame-rpc module is a proper CommonJS module and it's footprint
is really tiny. Its protocol is simpler. It doesn't handle connection
and buffering, but with our onConnect callback we don't need buffering.
The connection handshake that jschannel did was so trivial it's been
re-implemented here (each side tries to connect to the other once).
We have to handle timeouts ourselves, but that's all hidden in the
bridge code. In exchange, we get a simpler API, we get rid of the
call/notify distinction in favor of just passing a callback or not
and we avoid the excess overhead of the recursion guard in the
serialization code that was giving us false positive issues with
the document title.
This is one step toward removing all the browserify-shim requiring
libraries from the injected bundle, which will eventually fix #2397.