Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Support fetching dynamic modules via HTTP POST requests. #9384
Ever since Meteor 1.5 first shipped, dynamic modules have been fetched over a WebSocket, which is appealing because sockets have very little latency and metadata overhead per round-trip.
However, using a WebSocket requires first establishing a socket connection to the server, which takes time and may require a WebSocket polyfill.
An even more subtle problem is that we cannot use dynamic imports in any of the code that implements the
By switching from WebSockets to HTTP POST requests, this commit radically reduces the dependencies of the
I wish I had appreciated the advantages of an HTTP-based implementation sooner, but I think the transition will be pretty seamless, since the new implementation is completely backwards compatible with the old.
This is super exciting @benjamn - everything looks great!
I've never really noticed how similar the
httpcall_server.js code is (when it comes to things like parameter verification, callback wrapping, setting headers, etc.). At some point it might be worth moving that shared code up into
httpcall_common.js, but I think that's outside the scope of this PR.