Skip to content

Releases: marko-js/marko

@marko/runtime-tags@6.1.23

27 Jun 19:08
52f5ead

Choose a tag to compare

Patch Changes

  • #3306 bcbd992 Thanks @DylanPiercey! - Collapse pass-through signals for <for> and tag-body params that are only read by member access, shrinking the generated DOM bundle.

@marko/runtime-tags@6.1.22

27 Jun 12:58
6ab3c16

Choose a tag to compare

Patch Changes

  • #3281 802234e Thanks @DylanPiercey! - Render native attribute values at compile time. Conditional and logical attribute values are pushed down to their branches so the literal side is serialized at build time, and a shared name= prefix is hoisted out so only the differing value stays dynamic — e.g. title=x ? "a" : "b" compiles to title=${x ? "a" : "b"}, and aria-hidden=x && "true" serializes the "true" side without re-evaluating x. Because class/style omit a falsy value, class=x && "active" further simplifies to x ? " class=active" : "". A class object/array with a static base is resolved up front without re-evaluating any toggle: a single toggle picks a precomputed literal, a few index a hoisted table packed from the toggles, and more concatenate the string for _attr_class — in every case the class array/object is no longer allocated and the quoting is resolved at build time.

@marko/runtime-tags@6.1.21

26 Jun 22:41
99f6d19

Choose a tag to compare

Patch Changes

  • #3303 ccd2b37 Thanks @DylanPiercey! - Fix two resume bugs in control-flow branches: a client-created <if>/<for>/dynamic-tag branch could be orphaned from the branch tree (leaking effect/onDestroy cleanup) when its owner was driven only by input, and a bare <await> (no enclosing <try>) could throw a HierarchyRequestError when its promise re-resolved after resume.

    The closest branch for a control-flow owner is now derived during resume from the branch markers it already emits — nested under its enclosing stateful branch the same way branches link to their parents — so no extra closest-branch id is serialized.

@marko/runtime-tags@6.1.20

26 Jun 16:29
08ee74a

Choose a tag to compare

Patch Changes

  • #3298 c199491 Thanks @DylanPiercey! - Run a lazily-loaded branch's setup effects only after it is connected. When a lazy tag loads with pending input values its insertion is deferred until those values resolve, but its setup -- and the effects it queues, such as <script> content and event-attach effects -- previously ran before the branch's nodes were inserted. Setup now runs in that same deferred render, so its effects run only once the branch is connected, whether or not a <try> ancestor is present.

  • #3300 4f8f805 Thanks @DylanPiercey! - Fix a batch of runtime and translator bugs:

    • Sibling dynamic attribute tags first discovered within a single control-flow branch now share a group, so the DOM output no longer assigns to an undeclared variable (ReferenceError) and correctly delivers each tag's reactive value.
    • Multi-segment <style.module.css> shorthand extensions now compile instead of being rejected as unsupported html attributes.
    • Optimized builds no longer emit the dev-only _assert_init wrapper for derived own-variable reads (the guard read a stale config value instead of the active optimize option).
    • Known attribute lookups no longer resolve Object.prototype members for attribute names like constructor or toString.
    • $signal deduplication is keyed correctly for the first expression in a section, avoiding a duplicate abort controller and reset.
    • A serialized RegExp whose source contains < is now escaped so it cannot break out of the inline resume <script>.
    • An Error serialized with an explicitly falsy cause (0, "", false, null) now preserves the cause on resume instead of dropping it.
    • An uncontrolled <select> no longer force-selects an empty/falsy-value <option>.
    • A controlled-checked <input> (e.g. a radio button) no longer drops its static value attribute; the controlled-attribute skip is now scoped per branch consistently in both the server and client runtimes.
    • Rendering a Marko 5 class component as tags with null input no longer throws.

@marko/compiler@5.40.0

26 Jun 20:37
51ce08c

Choose a tag to compare

Minor Changes

  • #3301 ecc342c Thanks @DylanPiercey! - Discover custom tags grouped one level deep inside non-tag folders under a tags directory (e.g. tags/icons/icon-chevron.marko exposes <icon-chevron>).

@marko/runtime-tags@6.1.18

24 Jun 19:21
e142eb1

Choose a tag to compare

Patch Changes

  • #3289 45fb443 Thanks @DylanPiercey! - Improve dead code and serialization reductions when using the tags/class compat layer

  • 167712c Thanks @DylanPiercey! - Fix a crash when re-rendering an inert (server only) Class API child rendered by a Tags API parent.

@marko/runtime-tags@6.1.17

23 Jun 14:42
df12750

Choose a tag to compare

Patch Changes

  • #3282 0144550 Thanks @DylanPiercey! - Add the Scopable alias to MarkoTagBody. It was already treated as scopable by the runtime checks (isScopable/isScope, so it gets its own scope) but was missing from the Scopable alias group, so Babel's scope-crawl reset visitor — which is registered via that alias — never reset a tag body's bindings during an ancestor/program-level scope.crawl(); it appended freshly-collected references on top of stale ones. Combined with an AST mutation that moves a reference out of a removed subtree (e.g. flattening a text-only <if>), a tag-body parameter (<await> value, <for> item) could retain a reference into the removed nodes, making the analyzer emit invalid output such as const = _content_resume(...) that crashed the bundler.

  • Updated dependencies [0144550]:

    • @marko/compiler@5.39.66

@marko/runtime-tags@6.1.16

23 Jun 01:04
b0a9dec

Choose a tag to compare

Patch Changes

  • #3271 bf09dab Thanks @DylanPiercey! - Render a non-promise <await> value synchronously even when the <await> is inside a <try>. Previously the browser runtime could only render it synchronously at the top level and deferred to the next tick inside a <try> (because the await value is resolved before its content branch is created); it now renders in the same pass.

  • #3269 fdb5627 Thanks @DylanPiercey! - Render a <await> tag synchronously when its value is not a promise, instead of crashing with value.then is not a function. This matches the server runtime, which already renders non-promise values synchronously.

  • #3273 47bbd04 Thanks @DylanPiercey! - Collapse value signals that only forward their scope and value to another signal ((scope, value) => fn(scope, value)) down to the target signal itself, removing the redundant wrapper closure from the generated output.

  • #3265 3a66e8b Thanks @DylanPiercey! - Render known tag content passthroughs (<${input.x}/> with no tag variable, arguments, attributes or body) through a leaner _dynamic_tag_content signal instead of the general _dynamic_tag. When a known custom tag or <define> tag forwards statically known body content, the parent now calls this specialized signal, which skips renderer normalization, the native (string) tag branch, tag variables and parameter handling. Where that content branch is included in the client build (e.g. mounted inside a client-toggled <if>), this drops the heavy _dynamic_tag dependencies and roughly halves the bundled cost of that code. Server-rendered content is tree-shaken from the client as before, so those bundles and resume behavior are unchanged.

  • #3278 8b34976 Thanks @DylanPiercey! - Optimize text rendering: collapse text-only <if>/<else> chains in native elements to a single placeholder, escape only the dynamic parts of a placeholder (static strings are escaped at compile time), and hoist static leading/trailing text out of placeholders into static text nodes.

  • #3274 d043f9c Thanks @DylanPiercey! - Fix static (server only) pages not linking their client side assets. Colocated style files (eg template.style.css), <style> blocks, and imports matching the hydrateIncludeImports option are now included in a page's client entry even when nothing in its template tree is interactive, so completely static routes are no longer rendered unstyled.

@marko/compiler@5.39.66

23 Jun 14:42
df12750

Choose a tag to compare

Patch Changes

  • #3282 0144550 Thanks @DylanPiercey! - Add the Scopable alias to MarkoTagBody. It was already treated as scopable by the runtime checks (isScopable/isScope, so it gets its own scope) but was missing from the Scopable alias group, so Babel's scope-crawl reset visitor — which is registered via that alias — never reset a tag body's bindings during an ancestor/program-level scope.crawl(); it appended freshly-collected references on top of stale ones. Combined with an AST mutation that moves a reference out of a removed subtree (e.g. flattening a text-only <if>), a tag-body parameter (<await> value, <for> item) could retain a reference into the removed nodes, making the analyzer emit invalid output such as const = _content_resume(...) that crashed the bundler.

@marko/runtime-tags@6.1.15

22 Jun 15:42
0476783

Choose a tag to compare

Patch Changes

  • #3266 69e199d Thanks @DylanPiercey! - Error in development when a dynamic tag (<${value}>) receives a non-renderable value — a primitive, or an object without a valid content renderer. MARKO_DEBUG-only and stripped from production.