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

3 hours ago

Minor Changes

  • #2957 466a2fe Thanks @kanashimia! - Support returning an object from the <lifecycle> tag's onMount handler. The returned properties are assigned onto the lifecycle instance, making values created at mount (element references, third party instances, etc.) available as this properties in onUpdate and onDestroy.

Patch Changes

  • #3373 2919dc3 Thanks @DylanPiercey! - Fix the debug attribute-value assertion whitelisting any on*/*Change-named attribute, which let function values render as literal attribute source with no warning (e.g. a spread {checked, valueChange} on a plain input wrote valueChange="(v) => ..." into the DOM). Handlers the runtime actually consumes never reach the attribute writers, so any function value there now errors in debug, with a hint for unapplied change handlers.

  • #3348 a65f4bc Thanks @DylanPiercey! - Shrink SSR output slightly by reserving dense accessor ids for closure and change-handler keys instead of prefixing the binding's accessor with a letter.

  • #3368 f9061e6 Thanks @DylanPiercey! - Fix a duplicate value attribute on <let> (e.g. <let/x=input.a value=input.b/>) wiring reactivity to one attribute while generating code for the other, which threw a ReferenceError on the client. It is now a compile error, matching <script>.

  • #3367 9d4645b Thanks @DylanPiercey! - Fix assignments to a positional tag parameter (e.g. <for|item|> + item = x in a handler) generating code that referenced an undeclared binding, throwing ReferenceError: $Change is not defined during SSR. This is now a compile error pointing at the assignment, since a positional parameter has no object to carry a change handler.

  • #3370 5d85bfa Thanks @DylanPiercey! - Fix assignments to <id> and <define> tag variables compiling to silent no-ops (the assignment was replaced with its bare right-hand side). They now report the same "readonly and cannot be mutated" compile error as <const>.

  • #3366 c7fc346 Thanks @DylanPiercey! - Fix RegExp attribute values rendering differently on the client than on the server. SSR special-cased RegExp to write its .source while the DOM runtime stringified the whole expression, so the first post-hydration update corrupted an SSR-rendered attribute. The special case is removed: both targets now stringify RegExp values the same way (pattern="/^a+$/").

  • #3355 856f2ea Thanks @DylanPiercey! - Fix serialized Error/AggregateError values emitting invalid JS when the cause/errors value cannot be written inline (e.g. a circular reference back through the error), which aborted the entire resume script.

  • #3356 14329cd Thanks @DylanPiercey! - Fix serialization dispatching on val.constructor, which let an own constructor property (e.g. in parsed JSON data) silently corrupt or drop the value. Values are now classified by their prototype's constructor.

  • #3369 924357d Thanks @DylanPiercey! - Fix <textarea value=x>body</textarea> silently dropping the author's value attribute (the body was appended as a second, last-wins value). Combining both is now a compile error.

Don't miss a new marko release

NewReleases is sending notifications on new releases.