-
Notifications
You must be signed in to change notification settings - Fork 140
Fragment server with multiple fragment-script / stylesheet resources? #136
Comments
There is an example here - https://github.com/zalando/tailor/tree/master/examples/multiple-fragments-with-custom-amd |
I am talking about a different use case. I'd like to send something among the lines of the following:
The way the headers are parsed in lib/fragment.js, the last definition of a Header Link with |
@iilei Ahh, Got you. It was a conscious decision to not allow multiple link headers in the response for performance reasons. Fragment Devs could easily bloat the whole page by sending the libs and vendors and whatever chunked scripts as part of the headers. The proper way of doing this would be to do code splitting and send the only |
Thanks for your response. I get your point. I have made pretty good progress on my fork adding the desired behavior, so if you are interested anyways, I'd be happy to file a PR. The change would be non breaking and could also be controlled via some default config option (e.g. |
Thinking out loud - @vigneshshanmugam and @iilei please do tell me to keep quiet if not helpful - but here's a couple of observations:
Would welcome your thoughts on the above! |
just in case it's not clear as well - I'm a fan of this multiple resources feature :) |
@dazld Allowing it to be undefined would spoil the performance. Hence the config option. |
* first defined Link wins, while others are dropped (breaking change, before it was the last Link) * Allow opt-in for multiple Header Link-rels `{ maxAssetsLinks: 1 } * Add example for multiple Link Headers * issue #136 [feature]
Addressed via #140 |
@vigneshshanmugam This looks like a useful change, could this be released to the npm module? |
This breaks the performance hooks of fragments, Will release the new version this week after fixing the hooks. |
Would you appreciate a PR that enables multiple fragment-script / stylesheet resources?
possibly via "name" insted of "rel" property?
The text was updated successfully, but these errors were encountered: