This release brings additional polish to the new <Script>
component introduced in 0.33.0
, focused on ergonomic inlining and dynamic parent binding.
Improved
- feat:
<Script>
now strips out__name(...)
tooling artifact wrapper.
Build tools like SWC
, Terser
, or esbuild
(especially with React Fast Refresh or dev mode optimizations) may inject metadata helpers like:
const load = /* @__PURE__ */ __name(async () => {
// your logic
}, "load");
These wrappers are not defined in the browser and will throw ReferenceError: __name is not defined
if not removed.
The <Script>
component now automatically sanitizes them from inline function bodies to ensure clean, executable output:
<Script>{(el: HTMLElement) => {
const load = async () => {
// safe even if tooling added __name()
console.log('loading...');
};
el.addEventListener('click', load);
}}</Script>