-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add pinghub handler to wpcom-xhr-wrapper #45863
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~1265 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
Thanks for putting this PR together! Overall makes sense and looks reasonable. Couple quick clarifications for my own education:
|
Yes, it will intercept all requests to
Yes, the patch is not finished yet. I didn't add the token to URL, because I have no way to test it. Also, I think the format of responses sent to the |
An alternative solution to the issue was merged in #46070. This one can be closed. |
Add pinghub support for WebSocket connections to
wpcom-xhr-wrapper
, thewpcom
handler used by Desktop app. The Desktop app uses OAuth and doesn't use the REST proxy iframe.The pinghub handler intercepts requests to
/pinghub/*
paths and instead of making HTTP requests (XHR or fetch), handles them specially with WebSockets. In the web version of Calypso, this is done by the REST proxy provider loaded in the iframe.This code doesn't fully work yet, it's just a proof of concept that shows what needs to be done to make Pinghub WebSockets work in Desktop app.