github marko-js/marko @marko/runtime-tags@6.3.54

latest release: @marko/compiler@5.42.7
3 hours ago

Patch Changes

  • #3313 8e03f4a Thanks @LuLaValva! - Add the native <search> tag.

  • #4232 daeeb0e Thanks @DylanPiercey! - An attribute tag <for> nested within an attribute tag <if>, <else-if> or <else> now passes every attribute tag it repeats, instead of only the last.
    An attribute tag <if> chain whose branches hold different attribute tags now passes each branch's attribute tags on the client, instead of dropping them or failing to compile when the child reads only some of them.
    <@catch> and <@placeholder> content created by an attribute tag <for> now receives the loop's params when a <try> renders it on the client, instead of rendering without them.
    Content an attribute tag <for> creates now keeps the loop's params when the client first renders it after resume (a child opening a list, rendering a saved item or showing a <@catch>), instead of rendering them empty.

  • #4256 4be1b92 Thanks @DylanPiercey! - A section nested within content an attribute tag <for> creates (an <if>, <for>, dynamic tag body, or another tag's attribute tags inside <@item>) now receives the loop's params when rendered on the client, instead of rendering without them or throwing. The loop's params also keep their defaults, spreads and lazy reads there, and a static loop no longer resumes its content.

  • #4288 2426fa5 Thanks @DylanPiercey! - Trim a few bytes from the client runtime of every page that uses <await>.

  • #4258 b8f1014 Thanks @DylanPiercey! - Changing an <await> value while its server-rendered content is still streaming no longer throws, and the content shows the latest value once it arrives.

  • #4263 a90c855 Thanks @DylanPiercey! - Note in the cheat sheet that $!{} and <html-script>/<html-style> contents are written as-is and must not receive user-provided content.

  • #4235 8544424 Thanks @DylanPiercey! - A derived <const> whose property is read elsewhere (xs.length) is no longer inlined into a collapsed intersection, so the client runs the signal that feeds that property instead of leaving dependent values undefined.

  • #4243 96ef015 Thanks @DylanPiercey! - Content a parent builds again on the client after resume, such as a new item of an attribute tag <for> over changing input, now receives the values it reads from its parent (including a constant input or a never-assigned <let>) instead of rendering without them.

  • #4236 5b7b719 Thanks @DylanPiercey! - A variable or param named _ no longer collides with the owner scope in debug builds.

  • #4291 a63532b Thanks @DylanPiercey! - The body and attribute tag content of a dynamic tag whose name the compiler cannot resolve, such as <${input.as}>, keep the values they read after resume when a component passed as that name renders them later, for example behind its own <if>. Those values reach the browser only when the component sends the content there, so attribute tag content no longer serializes everything it reads on every render.

  • #4261 a9d8a07 Thanks @DylanPiercey! - Let a tag variable inside a dynamic tag's body be read from outside it when the tag name is falsy, including after the name is toggled on a resumed page.

  • #4281 1c142cd Thanks @DylanPiercey! - Assigning to a property destructured from a dynamic tag's variable (<${tag}/{ value }/> with value++ in a handler) no longer throws ReferenceError: $valueChange is not defined on every server render. The assignment now calls the tag's returned valueChange, as it already did for a custom tag.

  • #4266 67d0215 Thanks @DylanPiercey! - Point an <effect> with body content at its replacement, <script>, which runs its body as code, instead of reporting that <effect> does not support body content.

  • #4284 6d721cb Thanks @DylanPiercey! - Server rendering checks whether a flushed scope has values to send without allocating an array of its keys.

  • #4254 b419872 Thanks @DylanPiercey! - A <for by> key (row.id with by="id") is read as a constant within its branch, like an index key, since a branch is keyed by it. Its reads no longer create signals or per-branch state, a keyed selector comparison drops the key from its intersection, and resumed HTML no longer writes the key twice.

  • #4254 b419872 Thanks @DylanPiercey! - A property of a <for> loop key (${key.length} in <for|key| in=obj>) now renders in branches created in the browser.

  • #4272 d52fa58 Thanks @DylanPiercey! - Content that streams in out of order (a <try> with a @placeholder) or loads lazily (load) no longer becomes interactive while in-order content, such as an <await> without a placeholder, is still streaming. Its effects now wait with the rest of the page's, so a value changed meanwhile can no longer leave the in-order content showing the server's stale value.

  • #4240 cb7a14c Thanks @DylanPiercey! - A derived value that the server skipped because its intersection partner's changes recompute it is now serialized when a serialized value on that recompute path (such as list.length) can stop the recompute after resume. Previously a same-length update left it undefined and rendered the wrong branch.

  • #4264 ca8bfdd Thanks @DylanPiercey! - Content streamed in order after the page resumed is walked even when its chunk carries no resume data, so later client updates reach it.

  • #4279 27ca957 Thanks @DylanPiercey! - A custom tag whose content reads input or contains an <if> now keeps what its import declares: a load import stays lazy on the client instead of being bundled into the page, and a name import (import Wrap from "<wrap>") no longer compiles to a browser import of the unresolvable "<wrap>". Using a load import above the import statement is now a compile error instead of a silent eager load.

  • #4271 aeb74ea Thanks @DylanPiercey! - Fix a resume error for a <for> loop's key read inside an <await> body whose content streams in after the loop, and stop sending a subscriber set for it: the key never changes within its row.

  • #4275 7cd2056 Thanks @DylanPiercey! - A tag with more than fifteen params no longer serializes resume markers and values for its later params when the caller passes them constants.

  • #4249 aa8dbcb Thanks @DylanPiercey! - A value spread onto one element and passed through a function in another element's spread (<div ...attrs/> with <div ...withCount(attrs, count)/>) is now serialized, so that spread keeps the value when it re-runs after resume.

  • #4249 aa8dbcb Thanks @DylanPiercey! - Content rendered only through a native tag spread (<div ...attrs> with attrs.content, including attribute tag items spread in a <for of> or <for in>, forwarded to a child that spreads them, or spread into a custom tag that spreads its input) is no longer registered for resume, so its renderer, and anything only it keeps, tree-shakes out of the client bundle. Content spread directly also no longer writes the closures it would need to be rebuilt when nothing can rebuild it.

  • #4282 36126db Thanks @DylanPiercey! - A <define> tag declared and rendered inside another <define> body no longer makes the client module throw ReferenceError: Cannot access '…__walks' before initialization when it loads.

  • #4274 e6fb8b8 Thanks @DylanPiercey! - A tag named by a <const> that may be a template or nullish, such as <const/x=show ? Tag : null> then <${x}>, renders its body in place while the value is nullish instead of always rendering the template.

  • #4286 2e530b9 Thanks @DylanPiercey! - A template whose only $global reads are unused values (<const/unused=$global.foo/>) no longer looks up $global in its server render.

  • #4233 52cf5d7 Thanks @DylanPiercey! - A server render no longer reads the wrong value, or throws, through a member of a tag variable renamed for sharing its name (<div><const/x/>${x.n}</div><div><const/x/>${x.n}</div>).

  • #4234 fc3bd9f Thanks @DylanPiercey! - A value read through a destructured rest param (|{ id, ...rest }| then rest.extra, or |{ ...all }| then all) no longer throws when the server serializes it.

  • #4239 5ebc005 Thanks @DylanPiercey! - Fix an "Unable to serialize" server error when a <define> renders its content conditionally (including through another or the same <define>) and that content reads values from where it is called.

    Fix a _ is not a function client error when a <define> with client-side setup is both rendered as a tag and passed as a dynamic tag value.

  • #4269 329f770 Thanks @DylanPiercey! - Share one lazy loader between every tag that loads the same template with the same trigger, instead of creating one per tag.

  • #4270 91cbc80 Thanks @DylanPiercey! - A value spread onto a native tag inside a nested branch, or beside an attribute that changes on its own, keeps its attributes when the tag re-renders after resume. Content that streams in after the page resumed now shows values changed while it was pending, including behind a <try> placeholder in another component, and no longer blanks one that never changed. A <define> body called inside a branch the client re-creates keeps the values it closes over, and one that is both called directly and rendered as a dynamic tag no longer throws when it closes over a value. Fewer values reach the browser: a native tag with a spread sends its attribute values only when a client render reads them, and a value read inside a branch is not sent when every change that re-creates the branch recomputes it.

  • #4265 4f1c727 Thanks @DylanPiercey! - Suggest static for interface X { ... } and enum X { ... } written at the template root, instead of reporting an invalid attribute name.

  • #4229 ec77d73 Thanks @DylanPiercey! - A tag param's default (<child|y = fallback|>) now applies on the client, and a tag with no body no longer fails to compile when its params have defaults.

  • #4277 f467422 Thanks @DylanPiercey! - A tag name that may be a <define> or another tag's variable, such as <${show ? Foo : "div"}>, registers its body for the client, so that tag can still render the body after resume.

  • #4231 2298b9d Thanks @DylanPiercey! - A <for> without by= (of=, or to=/until= counting from 0 by 1) keys its branches by index, so it now compiles to a loop that only appends and removes at the end, and ships without the keyed move planner.

  • #4285 441e5b8 Thanks @DylanPiercey! - An <await|result|=promise> whose result is never read no longer reads a variable that was never declared, which threw is not defined in the browser, or in the server render when promise came from a <let>. An <id/unused=value/> whose variable is never read no longer breaks the browser compile, or throws is not defined in the browser when it sits beside other setup content or inside a <for>.

  • Updated dependencies [8e03f4a, d36b447, 8af26eb, 6485a1f, 0bde97c, 413c8f3, 348266e, 1c73664, 0848d17, 1c73664, 4c04d1d, 710a6f2]:

    • @marko/compiler@5.42.7

Don't miss a new marko release

NewReleases is sending notifications on new releases.