libero / publisher-micro-frontend-experiment

https://github.com/libero/publisher/issues/371
MIT License
0 stars 0 forks source link

Assets and bundling #3

Closed thewilkybarkid closed 4 years ago

thewilkybarkid commented 4 years ago

Assets (CSS, JS, fonts etc) can't easily be shared between the services. Means that the assets for the homepage and for the article page, for example, are separate. The shared CSS is small, but things like fonts are a problem.

Deriving assets from a pattern library helps the versioning, but they might be a little out of sync.

Potential conflicts in class names, style scoping etc. [between page-level and component-level frontends]

thewilkybarkid commented 4 years ago

Had a good chat with @davidcmoulton, sounds like we're ok with having separate bundles for each service as the amount of shared styles is pretty small. And the conflicts between pages and components is a process problem rather than technical.

However, fonts (and possibly some other assets) should be shared somehow.

giorgiosironi commented 4 years ago

Does this mean the /head of a microfrontend could return a data structure rather than HTML to help with de-duplicating the <link> tags or whatever is used to bring in the assets?

A scenario that could put constraints with this is how to deal with different versions of this shared assets. Assume you wouldn't want two different fonts in use at the same time does it imply they need an atomic change across frontends that depend on them?

thewilkybarkid commented 4 years ago

Moving transclusion thoughts to https://github.com/libero/publisher-micro-frontend-experiment/issues/6.

thewilkybarkid commented 4 years ago

Good to close assuming #6 is fine? (So asset bundles per page frontend, and transclude assets from component frontends using ESIs.)

giorgiosironi commented 4 years ago

Hasn't addressed the sharing of e.g. fonts, but I'm happy with somehow.

thewilkybarkid commented 4 years ago

Just discussed with @davidcmoulton, and a Google Fonts approach might work. Details to be ironed out later, but since we're not styling for a while think it's ok.