v0.7.0
A loader can start work the reader does not wait for, and the compiler refuses
one more thing the browser answers with silence.
Both packages move together: @transclude/core and @transclude/create are
0.7.0.
npm install @transclude/core@latestBefore you upgrade
A repeated element writing a fixed view-transition-name now fails the
build. A name has to be unique in the document. Two elements carrying one is
not an error the browser reports: it runs no transition at all and says nothing.
<!-- now a compile error -->
<li each="item of items" style="view-transition-name: card">Derive it from the loop instead.
<li each="item of items" style="view-transition-name: card-${item.id}">The build stopping is the change. A project that hits this had a transition that
was never running, so the fix is the one that was always needed. none is still
allowed, being the one value two elements can share.
Only the style attribute is read. A name applied through a class lives in a
stylesheet the compiler never sees.
New
ctx.after(work) is a promise the reader does not wait for. A view counted,
a webhook sent, a log written.
export const prerender = false;
export default async ({ after, url }) => {
after(recordView(url));
return { notes: await notes.all() };
};On workerd this is waitUntil, which is how a worker asks to stay up past the
response it just sent. Without it the isolate may stop and take the work with
it. Node, Bun and Deno keep running either way, so there it changes nothing about
when the work finishes.
It takes the promise, not a function that makes one. A function is refused rather
than wrapped, because wrapping one would resolve to the function and run nothing.
A rejection goes to onError with the request that started it. Nothing awaits
this work, so leaving it would end the process on Node. The response is already
sent and does not change.
Also
ctx.revalidateTag called from a page being prerendered now says so. It was
never on that context, so the build failed with revalidateTag is not a function, which named neither the mistake nor the fix. Both it and ctx.after
refuse by name there, and say to give the page prerender = false.
How a Cloudflare binding reaches a loader is written down, at
transclude.dev/docs/runtimes. There is no
ctx.env, on purpose: env means something different on each of the four
runtimes. worker.js belongs to the app and does receive it, so the answer is
ten lines the app owns and types itself.
Two things the framework already did are documented for the first time.
setValidity on a form-associated element, so it can block a submit and show the
browser's own message. <details name> and hidden="until-found" are on
recipes.
Full documentation at transclude.dev.
A note on the version
Below 1.0, a minor may break something. This one can, in one place: a repeated
element that writes a fixed view-transition-name. The section at the top says
what to do, and a project hitting it was already not getting the transition.
Full changelog: v0.6.0...v0.7.0