Skip to content
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

Support HTTP/2 Server Push #11946

Open
kimamula opened this issue Aug 20, 2018 · 6 comments
Open

Support HTTP/2 Server Push #11946

kimamula opened this issue Aug 20, 2018 · 6 comments
Assignees
Labels
area: angular/pwa feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors feature Issue that requests a new feature needs: investigation Requires some digging to determine if action is needed
Milestone

Comments

@kimamula
Copy link

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Desired functionality

polymer-cli and preact-cli generate push-manifest.json which maps incoming request paths to the additional resources that should be pushed with it and is to be interpreted by a tool like prpl-server-node.

It would be great if angular-cli provide the similar functionality.

@ngbot ngbot bot added this to the needsTriage milestone Aug 20, 2018
@clydin clydin added the feature Issue that requests a new feature label Aug 20, 2018
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Aug 20, 2018
@kimamula
Copy link
Author

kimamula commented Sep 3, 2018

It may not be easy to create push-manifest.json as Angular currently probably does not analyze which resources are required in each path in build time.

An alternative solution would be:

  1. Create a webpack plugin that generates a file that maps module paths to resources
// An example output of the webpack plugin
{
  // Resources which are always required are included in ""
  "": {
    "runtime.3e827d1a10b9047735bc.js": "script",
    "main.e8725b5004466c1664e1.js": "script",
    "polyfills.43f2535cedd6fe44b10e.js": "script",
    "styles.34c57ab7888ec1573f9c.css": "style"
  },
  "./lazy/lazy.module": {
    "0.8c6a7127511b5f2ffe40.js": "script"
  }
}
  1. require the file created above and pass it to ngExpressEngine function in an Angular Universal app.
  2. Provide LinkPreloadHeadersSetter, which creates link preload headers based on paths of required modules using the map, in Universal engines (express-engine, for example), and call its onLoad method in ModuleMapNgFactoryLoader#load.

Demo: https://angular-prpl.appspot.com/

angular-push-demo

(Chrome users may have to disable Experimental QUIC protocol in about:flags to make HTTP/2 Server Push work)

Diffs:

An apparent drawback of this approach is that you can use HTTP/2 Server Push only in Angular Universal apps.

@kimamula kimamula changed the title Generate push-manifest.json to support PRPL pattern Support PRPL pattern Sep 4, 2018
@kimamula
Copy link
Author

kimamula commented Sep 6, 2018

I have created a library based on the above idea, though I have not tested it thoroughly.

https://github.com/kimamula/ngx-server-push

@kimamula kimamula changed the title Support PRPL pattern Support HTTP/2 Server Push Nov 23, 2018
@bogomips
Copy link

I was looking for the possibility of enabling push on an angular 9 / ionic app.
Any news?

@SchnWalter
Copy link
Contributor

I would say that this is out of scope for the Angular CLI.

Because, for a proper configuration, besides the JavaScript and styles, each project also requires various static resources to properly bootstrap and render the application. If you really want to generate that file, you can use a 3rd party builder or write what that allows you to generates that file with the appropriate content.

And server push in Ionic applications isn't supported, they use a local web server. This would be useful if you are serving them on the web, which already requires you to tweak the application depending on the platform (you need to disable preloadingStrategy: PreloadAllModules on the web), so this calls for more custom configurations. And I think that these things shouldn't be maintained by the Angular CLI team, they should focus on maintaining other features.

@clydin clydin added the needs: discussion On the agenda for team meeting to determine next steps label May 27, 2020
@dgp1130 dgp1130 added needs: investigation Requires some digging to determine if action is needed triage #1 and removed needs: discussion On the agenda for team meeting to determine next steps labels May 27, 2020
@angular-robot angular-robot bot added the feature: votes required Feature request which is currently still in the voting phase label Feb 1, 2022
@angular-robot
Copy link
Contributor

angular-robot bot commented Feb 1, 2022

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

@ngbot ngbot bot modified the milestones: Backlog, needsTriage Feb 1, 2022
@angular-robot
Copy link
Contributor

angular-robot bot commented Feb 21, 2022

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

@angular-robot angular-robot bot added feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors and removed feature: votes required Feature request which is currently still in the voting phase labels Feb 21, 2022
@alan-agius4 alan-agius4 self-assigned this Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: angular/pwa feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors feature Issue that requests a new feature needs: investigation Requires some digging to determine if action is needed
Projects
None yet
Development

No branches or pull requests

6 participants