magento / pwa-studio

šŸ› Development tools to build, optimize and deploy Progressive Web Applications for Magento 2.
https://developer.adobe.com/commerce/pwa-studio/
Open Software License 3.0
1.07k stars 683 forks source link

[bug]: Dev server and upward-js do not support HTTP2 #1271

Closed zetlen closed 5 years ago

zetlen commented 5 years ago

Describe the bug Our local server environments don't use HTTP2. This is a serious performance problem.

We use webpack-dev-server as our local development server, and upward-js as our local production staging server. Both of those use Express as their HTTP handling framework, and Express still does not support HTTP2, after promising it for years.

In this issue, Express maintainers say that Express is HTTP version-agnostic, but the maintainers of webpack-dev-server in this issue disagree; since Express claims compatibility only with the node-spdy module, and that module is basically unmaintained. It's a circle of pointing fingers and it suggests that we do not know when HTTP2 support will arrive as part of the natural update cycle.

To Reproduce Steps to reproduce the behavior:

  1. Check out the develop branch.
  2. Run yarn install && yarn build && yarn watch:venia
  3. Copy the dev server URL to your clipboard.
  4. Open a browser tab. While it is still blank, open the developer tools and go to the Network tab.
  5. Paste and load the dev server URL.
  6. Look at the Protocol column in the network request table.

Expected behavior -h2 should be the Protocol

Screenshots

Dev server loading with HTTP1 image

Dev server loading with HTTP2 (I hacked it just to make the screenshot) image

Additional context HTTP2 is very important for us to get right. Not only for the speed and concurrency it offers and the server push capability that enables outstanding prefetch, but also for less political, more marketing-related reasons:

The good news is that HTTP2 is working in all of our production environments.

So this is a high severity issue, but not a high priority one. We need to be "native HTTP2", and right now, the only reason that our production systems are issuing HTTP2 responses is that the deployment environments are wrapping our server in their own optimization.

Possible solutions First of all, we should be using native NodeJS http2, which has existed since Node 8. We shouldn't be using the spdy module, as express continues to do. Some ideas:

All of these would require, at the very least, that:

Please let us know what packages this bug is in regards to:

awilcoxa commented 5 years ago

Closing based on grooming review.