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

one hour ago

Patch Changes

  • #4761 7f75778 Thanks @DylanPiercey! - A $signal read in a native tag's attribute or spread now aborts when that attribute re-runs or its tag is removed, rather than right after every render.

  • #4757 5607497 Thanks @DylanPiercey! - Generated names learn which names a template already uses from Babel's scope, which has recorded them, instead of walking the whole template again.

  • #4769 1cc46df Thanks @DylanPiercey! - An element reference read as a value by a <script> above its tag and again as a value the server writes below it no longer fails the server render with an undefined getter.

  • #4762 5631611 Thanks @DylanPiercey! - A hoisted tag variable read only by code the server never runs (an event handler or <script>, or a function only event handlers read) no longer registers its getter for resume or creates one on the server, which never writes it.

  • #4789 bc5b704 Thanks @DylanPiercey! - The translator keeps each analysis's and output's state on the analysis or output it belongs to, instead of in module-level WeakMaps whose entries for finished compiles slowed garbage collection in long-running processes such as dev servers.

  • #4756 fc26b52 Thanks @DylanPiercey! - Drop the stubs of debug-only helpers from the optimized runtime: only the debug runtime exports the helpers that debug output alone calls.

  • #4772 c3af14e Thanks @DylanPiercey! - An array or object literal as a native tag's event or change handler, written in place (onClick=[input.action]) or named through a <const>, is now a compile error, instead of throwing when rendered in debug builds and when the event fires in optimized ones. A <let> valueChange= that names such a <const> is now a compile error too.

  • #4770 7dec312 Thanks @DylanPiercey! - Assigning a destructured tag parameter (<define/Tag|{ value }|> given value:=count, or <for|{ value }|>) no longer makes the server render throw a ReferenceError for its change handler.

  • #4774 025bbe3 Thanks @DylanPiercey! - A lazy tag or template the client renders after a resumed page's load trigger fired now loads without waiting for that trigger again, including while the module the trigger started is still loading.

  • #4767 e8f1c9a Thanks @DylanPiercey! - A tag imported with a load trigger and rendered through a dynamic tag (<${show ? Child : null}/>) now waits for its trigger on a client render, as the tag written directly does, instead of loading as soon as it renders.

  • #4765 302a509 Thanks @DylanPiercey! - A <let> valueChange= that is certainly not a function, such as an array or object literal, a string built from input or a number, is now a compile error, as a literal constant already was. A value only known at run time that is not a function now throws a debug error naming valueChange when the <let> is assigned, instead of scope[valueChangeAccessor] is not a function.

  • #4777 977ae4d Thanks @DylanPiercey! - Checking whether a lazy module has loaded no longer converts the load triggers still waiting on it to a string each time.

  • #4783 f69bc0b Thanks @DylanPiercey! - Update a dynamic <title>, <style>, or <script> body by changing its text node in place instead of replacing it.

  • #4766 6fab332 Thanks @DylanPiercey! - Assigning a tag variable in a function invoked where it is written while rendering (${(() => { count = 1 })()}) is now the same compile error as assigning it outside a function, and a debug build throws when a <let> is assigned while its scope first renders in the browser.

  • #4768 4d46a2a Thanks @DylanPiercey! - A class name may now appear only once in a class value, and debug builds no longer write a class or style value's parts out again in a separate check on every render. The compiler rejects a repeated literal name, such as class=["a", "b a"], and in development the server throws as it writes a class with a repeated name, which checks every combination of a few toggles as the template's module loads. The server also checks in development that a style property appears in only one part of a style value.

  • #4764 4351da0 Thanks @DylanPiercey! - A toggled class's names must be one space apart, as the client splits them: a literal key spaced otherwise ({ "a b": on }) is a compile error, and debug builds throw for a style import read spaced otherwise. The debug class check no longer reports an empty class name for literal parts with extra whitespace, and the client adds or removes a toggled class's several names in one call.

  • #4760 bb54d4b Thanks @DylanPiercey! - A destructuring assignment to tag variables in a function nested in a render value (such as a handler an inline function returns) no longer writes them again with undefined on the client.

  • #4771 d790870 Thanks @DylanPiercey! - A native tag attribute whose whole value is $signal (as a class object's value, a controlled attribute, or beside a spread) no longer compiles to an unbound $signal, which threw a ReferenceError.

  • #4776 6abd02f Thanks @DylanPiercey! - Trim the client runtime: values that are never null are tested with == null, and a resume payload's scopes are applied by their truthiness rather than Array.isArray.

  • #4778 fa6b530 Thanks @DylanPiercey! - Stop reporting a lazy tag's failed input chunk as an unhandled rejection when its setup chunk failed too and <try> already caught the failure.

  • #4786 a0fd64e Thanks @DylanPiercey! - A server render keeps the registrations bound to its scopes (functions, tag variables, element getters) in a map of its own instead of a global WeakMap, and a registered function that reads nothing from the render is created and registered once when its template loads. This reduces garbage collection on pages with many such registrations.

  • #4775 90fc0cf Thanks @DylanPiercey! - Assigning a destructured value whose change handler the same pattern names after it (<child/{ value, valueChange }/>, |{ value, valueChange }|) now calls that handler by the author's name instead of a second, generated one. A renamed handler ({ valueChange: onValue, value }) no longer makes the server output declare it twice, which failed to compile. An assignment in a function a render-time value creates ([1].map((valueChange) => () => { value = 1 })) now calls the handler even where an inner name shadows it, instead of throwing that it is not a function.

  • #4773 a582c89 Thanks @DylanPiercey! - An element reference read as a value only by code the server never runs (an event handler or <script>, or a function only event handlers read) no longer registers its getter for resume or creates one on the server.

  • Updated dependencies [bc5b704, f019ff6, f019ff6, 19d3136]:

    • @marko/compiler@5.44.0

Don't miss a new marko release

NewReleases is sending notifications on new releases.