When you add an external script attr of defer or async to a slot, if there is an inline script in that slot, it wraps the code in a DOMContentLoaded listener so that it will not execute before any other deferred js in the slot.
Alternatively, we could go off of the internal script attr of defer, but since an inline script cannot be deferred, we would then need to filter that attr out, or be ok with telling users to add an attr to the dom that is not valid, which may be confusing.
I'm open to suggestions here, will update docs once a direction is finalized.
When you add an external script attr of defer or async to a slot, if there is an inline script in that slot, it wraps the code in a DOMContentLoaded listener so that it will not execute before any other deferred js in the slot.
Alternatively, we could go off of the internal script attr of defer, but since an inline script cannot be deferred, we would then need to filter that attr out, or be ok with telling users to add an attr to the dom that is not valid, which may be confusing.
I'm open to suggestions here, will update docs once a direction is finalized.