podium-lib / issues

All podium issues, bugs, questions etc goes here. Documentation is to be found at https://podium-lib.io
1 stars 0 forks source link

enhancement: remove duplicate assets #60

Open mingfang opened 2 years ago

mingfang commented 2 years ago

When combining assets from podlets like this

const results = Promise.all([…])
incoming.podlets = results

there may be multiple assets with the same value. They will result in multiple identical script tags for the same asset. The duplicates should be removed

digitalsadhu commented 6 months ago

We could certainly consider this but since the asset objects are quite complex, we would need to check all properties for equivalence. If we were to just check the url value, we could end up with a situation where 2 podlets provide the same urls with slightly different options and having to decide which one wins. I suspect this might be better left to the layout creator to decide on deduping strategy perhaps.

What do you think @trygve-lie ?