Patch Changes
-
#4666
8719e0bThanks @DylanPiercey! - An<if>or<for>whose condition reads a tag variable its child's<return>changes in the browser now links each branch's owner from its resume marker instead of serializing it, as one reading client-assigned state already did. -
#4670
1885815Thanks @DylanPiercey! - A dynamic tag whose name computes a value from passed content, such as<${open && input.content}/>, or<${open ? content : undefined}/>in a<define>, now compiles and renders that value: its caller no longer imports a$input_content_directsignal the child never exports, nor renders the content in place of the computed name. -
#4649
0905a25Thanks @DylanPiercey! - Drop the range markers around content that starts or ends with a<define>call, such as a<for>row, an<if>branch or a template rendering a<define>declared above it: the client clones two fewer comment nodes per row (four for a template whose edge is a<define>call, rendered in a loop), and the server writes one fewer comment per row or branch. -
#4669
5c837edThanks @DylanPiercey! - Read members of a<define>or<id>tag variable without optional chaining, since neither is ever nullish. -
#4658
5567818Thanks @DylanPiercey! - A<define>param that every call passes as a constant no longer makes the server send what only that param's changes would read, such as a closure value or the<define>itself, a function nothing would send is no longer registered for resume, and a rest nothing would send is declared in the branch that renders it instead of outside it. -
#4665
5d9472eThanks @DylanPiercey! - A function whose readers' reasons name template params no write guard groups together compiles again, instead of failing with "cannot ask for a param reason group that was not analyzed". -
#4660
fd28acaThanks @DylanPiercey! - Class API content that a Tags template renders now updates in place on its Class parent's later rerenders, so Class components inside it keep their state, and it reads the realout.globalin a production build. A Class template that takes no input also renders as a native tag'scontent, as a Tags template does. -
#4672
f8ce4c7Thanks @DylanPiercey! - Fix lazily loaded tags nested in other lazily loaded tags staying inert on resume: one whose module loads before its parent's and renders content, a template or a function the parent passes it, and lazily loaded tags that import each other and each read a value the other passes. -
#4653
1b49ca4Thanks @DylanPiercey! - A dynamic tag rendering a native element writes its content as a static native tag does, without branch markers inside the element. -
#4671
49f6b7aThanks @DylanPiercey! - A<@content>attribute tag is now a compile error under any tag, since a tag'scontentis its body: write it as the tag's body, or pass it withcontent=. Attribute tags under a native tag are an error too: a compile error on a native tag or on a dynamic tag whose name only resolves to native tags, and an error in debug builds when a dynamic tag renders a native tag with an attribute tag in its input. A native tag's content, fromcontent=, a spread or a dynamic tag, is body content, a<define>tag variable or attribute tag holding it, or a falsy value; anything else is an error in debug builds. -
#4655
64835e1Thanks @DylanPiercey! - An attribute tag whose dynamic attributes or spread a child reads through a rest (<const/{ item: { content, ...attrs } }=input/>) updates on a resumed page instead of throwing. -
#4660
fd28acaThanks @DylanPiercey! - On a page with Class API components, a Tags<define>, attribute tag or template module namespace (import * as Child from "./child.marko") rendered through a dynamic tag no longer fails withInvalid dynamic tag valueor remounts on the first update after resume, and an attribute tag with no content renders the dynamic tag's body as it does without them. -
#4660
fd28acaThanks @DylanPiercey! - On a page with Class API components, a Tags template renders a Class parent's content or attribute tag body wherever it renders content, through a native tag spread (<div ...input.foo/>),content=or a dynamic tag; a dynamic tag also renders one forwarded through a Class component. These previously rendered nothing or failed withInvalid dynamic tag value. -
#4663
296f719Thanks @DylanPiercey! - The Class API interop layer loads from its own@marko/runtime-tags/dom/compat.featand@marko/runtime-tags/html/compat.featentries instead of the maindomandhtmlentries, so only pages that mix in Class API components load it, and the server and development runtimes of a Tags-only app no longer include it.markonow depends on the exact@marko/runtime-tagsversion it ships with; an earliermarkocannot load this layer from a newer@marko/runtime-tags, so upgrade both together. -
#4647
3bc26a9Thanks @DylanPiercey! - Fix content or attribute tags a recursive<define>renders with arguments failing every server render with "Unable to serialize". -
#4654
8289fb4Thanks @DylanPiercey! - Read a property of a rest element as the rest's, not the object it came from, when the same handler also reads that object (an excluded property read the object's value instead ofundefined). -
#4656
b3d8818Thanks @DylanPiercey! - A spread into a custom tag whose input rest leaves out a property named like the rest itself (<const/{ rest: x, ...rest }=input/>) no longer generates a duplicate parameter, which failed to build. -
#4666
8719e0bThanks @DylanPiercey! - Content that reads a tag variable and resumes after the tag that declares it, such as an<await>body behind a@placeholderor content in nested lazy tags, now shows the value the child's<return>changed it to on the client before that content arrived, where it showed the server's value and missed the change. In<for>rows inside nested lazy tags, a debug render no longer throws "Unable to serialize a value shared between independently lazy loaded content" and an optimized one no longer drops a later row's update. -
#4660
fd28acaThanks @DylanPiercey! - On a page with Class API components, a dynamic tag given data that has a renderer's key, such as anidproperty in a development build (a Class API attribute tag with anidattribute forwarded to a Tags child), no longer mistakes it for a template and fails; it renders the body as for any other non-template value. -
#4657
ea7bcc8Thanks @DylanPiercey! - Read a template's input and return types fromMarko.Templatealone, rather than also from a member that only the language tools' generated types define, and type the result of a Marko 5 template'smountwith its return type. -
Updated dependencies [
fcb6837]:- @marko/compiler@5.42.18