github marko-js/marko @marko/compiler@5.42.7

3 hours ago

Patch Changes

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

  • #4248 d36b447 Thanks @DylanPiercey! - Append the coding-agent fix guide to a thrown CompileError's label as well as its message, so bundler plugins that print label in place of the framed message keep the pointer.

  • #4245 8af26eb Thanks @DylanPiercey! - An invalid parameter in an attribute method (<a onClick(1){}>) is now reported as a compile error with a code frame at the parameter, instead of crashing with Babel's TypeError: Property params[0] of FunctionExpression ….

  • #4241 6485a1f Thanks @DylanPiercey! - CompileResult now follows the options passed to compile*: ast and map are null unless ast: true / sourceMaps are set, and code is null with code: false. Code that reads ast or map may need a null check. TagDefinition and AttributeDefinition mark fields that real definitions can omit as optional, declare setFlag, and parseTypeArgs / parseTypeParams are now declared.

  • #4253 0bde97c Thanks @DylanPiercey! - Ship a README and point the package homepage at the Compiler API reference on markojs.com.

  • #4268 413c8f3 Thanks @DylanPiercey! - Keep the marko/translator interop translator when an app on marko@5 also depends on @marko/runtime-tags, instead of switching to the translator that rejects the Class API. When two Marko runtimes are depended on, the compile error now names both and points at the translator option.

  • #4247 348266e Thanks @DylanPiercey! - Keep the comments inside an open tag in source output, which were deleted before. Each is printed before the attribute after it, or after the last one, and a comma follows a value that a comment comes after, so the comment is not read as part of it.

  • #4238 1c73664 Thanks @DylanPiercey! - Keep TypeScript on attribute methods and tag params in output: "source" and "migrate": a shorthand method keeps its type parameters and parameter types (onClick<T>(event: T) {}), a function value with a return type is no longer rewritten as a shorthand that drops it, and tag params keep their types (|x: T|).

  • #4255 0848d17 Thanks @DylanPiercey! - End a compiled template's source map sourceRoot with a path separator, so Node's --enable-source-maps and URL-based consumers such as browser devtools resolve the original .marko file instead of a path with the directory and file name run together.

  • #4238 1c73664 Thanks @DylanPiercey! - Escape text content in output: "source" and "migrate" with htmljs-parser's escapeText, so a literal \${text} no longer comes back as a live placeholder, and stop inserting a space between adjacent text nodes, which rendered as an extra space.

  • #4242 4c04d1d Thanks @DylanPiercey! - Accept a tag var that ends in a line comment (<div/el // the box\n class="box"/>), which htmljs-parser folds into the var, and keep the comment from swallowing the rest of the tag in source output.

  • #4244 710a6f2 Thanks @DylanPiercey! - Template text now collapses only HTML's ASCII whitespace (space, tab, newline, carriage return, form feed). A non-breaking space, U+2028, U+2029 or U+FEFF typed in text is kept instead of becoming a plain space, matching attribute values.

Don't miss a new marko release

NewReleases is sending notifications on new releases.