We recently added Svelte 5 compatibility to Bolt UXP in v1.1.0
however there were several polyfills needed to get a basic app building properly.
Polyfilling these basic HTML DOM functions is never ideal and may cause more issues down the road, it would be great if UXP could implement these features natively:
queueMicrotask()
Doesn’t exist at all, a full polyfill is required. (more info)
HTMLTemplateElement
Core for many Svelte 5 functions, a full polyfill is required. (more info)
HTMLMediaElement
Doesn’t exist at all. For the time being a blank class works but likely the tags won’t. (more info)
JavaScript Modules
Additionally, Svelte 5 expect the Script tag to be a module with:
<script type="module" crossorigin />
But UXP does not allow this as the load fails. We can work around this by removing type="module" crossorigin
however the build then fails in the browser. So a conditional statement is needed to render immediately if in UXP or after DOM load in the browser:
The lack of type="module"
native support in UXP is going to become more of an issue over time if it isn’t implemented.