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

55 minutes ago

Patch Changes

  • #4634 589dda1 Thanks @DylanPiercey! - A static nullish valueChange written as the first attribute of an attribute-backed <input> (type="checkbox", "radio", "hidden", …) now compiles the same as one written anywhere else among its attributes.

  • #4626 cd3c1bc Thanks @DylanPiercey! - Fix a client crash ($…_content__setup is not defined) when a <define> in a <for> body reads only the loop's key and its own params, and is rendered statically (<D/>) or dynamically (<${D}/>).

  • #4641 37b12d1 Thanks @DylanPiercey! - Build an attribute tag or input object once when the child only spreads it onto an element or invokes the functions in it, instead of rebuilding it whenever state its handlers read changes.

  • #4645 4ff0791 Thanks @DylanPiercey! - A keyed <for> inside an <if>, <await>, <try>, another <for> or tag content now keeps its O(1) row selection: when the loop compares its key to a value declared further out (class=(selected === row.id && "danger")), a change updates only the previous and next selected rows instead of every row subscribing to the value.

  • #4643 6cfc211 Thanks @DylanPiercey! - Skip the escape scan for numbers in server-rendered text, which renders numeric-heavy pages faster.

  • #4603 7183eb4 Thanks @DylanPiercey! - Shrink client code for <for to> and <for until> loops: a loop whose from and step are constants uses the unkeyed loop, which needs no reordering, and an omitted or default from (0) or step (1) is no longer passed to the loop.

  • #4644 33e9ebf Thanks @DylanPiercey! - Write compiler-generated change handlers (:=) and attribute tag <for> callbacks, and a few runtime closures, as expression-bodied arrows, which minify smaller.

  • #4618 6f6f929 Thanks @DylanPiercey! - Fix a resumed <define> body or <for> row that combines a value of the template its parent always writes (such as input.p1 a <script> also reads) with one of its own (a param or <let>): when its own value changed on the client, it threw reading the template's value, since the link to its owner scope was not written.

  • #4637 fce28ac Thanks @DylanPiercey! - Fix the wording of compile errors: <return> names its control-flow parent without quotes, <style>'s html-attribute error links the <style> and html-style docs like <script>'s, and a range <for> suggests by=(num) => ... for a string by.

  • #4617 066f9a3 Thanks @DylanPiercey! - Fix a <for> whose bound or list reads several values, or a child tag's returned value, updating its rows before it adds or removes them: rows it was about to remove were updated with the new values first, which threw where a row read by index (${input.items[i].name} after input.items shrank) and rewrote a removed row's selected state. Rows now update after the loop settles them.

  • #4632 7048535 Thanks @DylanPiercey! - Fix a resumed <for> whose bound or list reads a child tag's returned value that cannot change in the browser (one computed from server-only input), together with state the browser changes: the child's scope offset is not written for it, so the rows' update was ordered NaN and could run before the loop removed rows, throwing where a row read by index or leaving a removed row's selection behind. A loop's rows update now queues like the loop's value does, in its own slot after the owner's renders, so it falls back to the owner's order the same way.

  • #4640 f4fc401 Thanks @DylanPiercey! - Fix Cannot drop a merged reference when a recursive tag call passes content the tag never renders and that content holds control flow such as <if> or <for>.

  • #4642 e2c7630 Thanks @DylanPiercey! - Resolve a branch's parsed markup from its content instead of rebuilding a cache key from the whole template on every clone, which speeds up creating loop rows and conditional branches.

  • #4634 589dda1 Thanks @DylanPiercey! - In a Tags template compiled alongside Marko 5, out["global"] now reads $global like out.global, and out[global] (a variable named global) is now the "Only out.global is supported" compile error instead of silently reading $global.

  • #4635 adc765e Thanks @DylanPiercey! - A binding used as a computed member key on an assignment, such as obj[key] = 1, is now only read: a <const> rest binding there no longer fails to compile, and other keys keep their per-property updates.

  • #4610 13f8aa1 Thanks @DylanPiercey! - Fix cleanup on a resumed page when a <for> or <if> removes content that has no resume marker of its own, such as a child tag's static <for> rows, or a tag whose content is only another tag: removing it now aborts its $signal, runs its onDestroy and stops its updates, as a client render does.

  • #4638 fb05fb1 Thanks @DylanPiercey! - Attribute tag content whose only client code is a <return> of its <for> param no longer throws Cannot set properties of undefined (setting 'returns') as its module loads in a debug build.

  • #4620 23aed68 Thanks @DylanPiercey! - When a migrator or transform builds a node without a source location, compile errors and diagnostics about it now mark the nearest part of the template that has one (the node's first located part, its attribute or its tag) instead of failing with "Cannot read properties of undefined", pointing at the start of the file, or pointing at an unrelated await.

  • #4631 94223f7 Thanks @DylanPiercey! - Drop the undefined argument a <let> without an initial value passed to its signal in client output.

  • #4611 81b2751 Thanks @DylanPiercey! - Migrate Marko 5's out.global to $global only in Tags templates that the interop translator (marko) compiles, so a Tags-only project no longer rewrites out, and leave the scope crawl after migration to the compiler. Also skip binding lookups for identifiers the translator never rewrites.

  • #4636 fdf683d Thanks @DylanPiercey! - A tag named like a JavaScript built-in (<Map/>, <Date/>) with no tag file now reports "Unable to find entry point" instead of "Local variables must be in a dynamic tag", since nothing declares that name.

  • #4602 e5c5bcd Thanks @DylanPiercey! - Write a native tag's object literal spread (<div ...{ id: "x", onClick() {} }>) as the attributes it names, so static ones join the markup and the tag no longer resumes for the spread alone.

  • #4607 68efc83 Thanks @DylanPiercey! - Skip creating an AbortController for an expression that only uses $signal to set onabort; its cleanup runs directly on teardown.

  • #4613 fd9b1e0 Thanks @DylanPiercey! - Write a single-use derived value's client update where it is computed, dropping a function and a call for each (a <for> item's property, a one-use <const>).

  • Updated dependencies [4a5e758, ff3cec9, fce28ac, f52e0bd, 23aed68, 81b2751, eab0534]:

    • @marko/compiler@5.42.17

Don't miss a new marko release

NewReleases is sending notifications on new releases.