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.
Showing
This diff is collapsed.
This diff is collapsed.
... | ... | @@ -25,6 +25,7 @@ |
"dom-seek": "^1.0.1", | ||
"es6-promise": "^2.1.0", | ||
"extend": "^2.0.0", | ||
"frame-rpc": "^1.3.1", | ||
"hammerjs": "^2.0.4", | ||
"jquery": "1.11.1", | ||
"jstimezonedetect": "1.0.5", | ||
... | ... | @@ -82,8 +83,7 @@ |
"es6-promise": "./node_modules/es6-promise/dist/es6-promise.js", | ||
"hammerjs": "./node_modules/hammerjs/hammer.js", | ||
"jquery": "./node_modules/jquery/dist/jquery.js", | ||
"jquery-scrollintoview": "./h/static/scripts/vendor/jquery.scrollintoview.js", | ||
"jschannel": "./h/static/scripts/vendor/jschannel.js" | ||
"jquery-scrollintoview": "./h/static/scripts/vendor/jquery.scrollintoview.js" | ||
}, | ||
"browserify-shim": { | ||
"annotator": { | ||
... | ... | @@ -111,7 +111,6 @@ |
"depends": [ | ||
"jquery" | ||
] | ||
}, | ||
"jschannel": "Channel" | ||
} | ||
} | ||
} |
Please register or sign in to comment