Is the binding of my anti JS / TS project template?

I am working on a project in Angular 2 using TypeScript and trying to minimize my workflow.

Yesterday I saw this video from Guy Bedford about package management. In it, he mentions that he considers binding to be anti-shaped.

I saw a similar mention of moving away from binding in an angular-lowering guide .

From what I read after watching the video, it seems to me that the reason for linking is the anti-pattern: HTTP2 allows several responses to the request sent in parallel. This seems very useful since a single request to your server can return the whole Angular application to separate files.

Is HTTP2 support currently sufficient to migrate to unrelated applications? What are the pros and cons?

EDIT 2: tried to make the question more focused

+7
javascript angular typescript
source share
1 answer

Anti-pattern is a strong term. Its also a little fuzzy: we all have this intuitive understanding of what this means, but of course it's easy to get lost in the weeds, claiming whether dubious practice x or not is essentially an anti-pattern.

Therefore, instead of trying to read too much in the comments during a conversation from the author of the library, I would like to present a case against unification. These points should be fairly certain (if someone disagrees, let me know in the comments and I will edit).

Important warning before we begin: I will contact. I am a fan of the association as a whole, it makes sense for the work that I do, and this, as a rule, was a step forward. This has many positive aspects, my favorite is the best drive closing / compression compiler. But for the rest of this answer, I only reflect on potential flaws.

  • Linking can lead to minor cache misses. Any change to any part of your application invalidates the browser cache.

  • Linking can make it harder to use the shared library cache. If you use the same version of jquery from the same cdn as everyone else, you have a chance that your users will not even be able to attack your servers.

  • Combining means that you usually load all of your JavaScript at once. There are exceptions, such as splitting webpack code, but this complicates your build assembly and files for storage.

  • Binding means that HTTP / 2 is not able to handle multiple resource requests in parallel. This may or may not be relevant to your use case. If you create an internal asset in FooCorp, where everything is still blocked for IE 8 IT, because the reasons for this argument are unacceptable. Also, most of your customer base is Chinese for the same reason. For most of the world, HTTP / 2 is now widely supported (chrome, firefox, edge, iOS safari). This means that you are suppressing most of your users, perhaps a sub-pairing experience.

+2
source share

All Articles