You want to globally manage all of applications runtime dependencies e.g. Ember, Handlebars, jQuery, Resolver, etc as a unit for many instances of Ember applications. This allows you to only have 1 vendor file across all of the application instances in your CDN. Currently each Ember CLI instance has it’s own version of Ember.
Potential Solution
Have Ember CLI instances depend on an addon that provides the framework files and use the customHash for fingerprinting that points to the same CDN hash across the applications. This allows you to have the cached vendor files across multiple applications.
Can this be done? What are the downsides of this? Does this seem reasonable?
the problem is each app has a slightly different vendor so they fingerprint differently, and the goal is to instead split the assets across multiple files that change/deviate infrequently ?
Yes so there are things that change infrequent but are required to run an app e.g. jQuery, Handlebars, Ember, etc. But each application instance with CLI pulls these from bower and builds them. This means you have N number of compiled framework files in CDN which is largely the same code. Ideally you have a baseline of things every application needs and they all point to the same files in the CDN.
Getting into more LinkedIn specific implementation, our CDN can take a url that looks like
http://scds.linkedin.com/h/#MD5,#MD5,#MD5
And concat the contents of those MD5 hashes. This means if something is already in the CDN all I need is to build a URL with the MD5 hashes and I get them. This is super cool for things like web components / UI addons because then I just need the hash to the thing I want and don’t have to worry about pulling the files in locally.
i think that your idea is interesting, but it seems like you would prefer to have dist/assets/ contain the groups you expect, which are then submitted to your CDN. if there exists such a group already you will join it, and share that asset entry.
If your group does not exists you will add a new entry.
The benefit of this is purely flexibility of the developer (say they need a custom build, they no longer need to coordinate with a CDN derived add-on to ensure there deps are in the cloud).
The cost is, if minor revisions exist between apps, they will not sure CDN resources.
In theory if vendor.js was split into more logic chunks that change in unison. With this, the solution seems relatively straight forward.
so it seems like the ideal solution is being able to declare vendor groups, dist include those groups as separate files. Then you can CDN those groups. (I suspect other people may also want this.
We have the same requirement. We have multiple ember apps built through ember CLI and we would like the framework files to be pulled from a common addon. Would ember CLI support the concept of “vendor groups” in the future? How do you stop an app from building the core dependencies into vendor(ember, handlebars et al)? At the moment, removing these dependencies from bower.json breaks the build process