github marko-js/marko @marko/compiler@5.43.0

latest release: @marko/compiler@5.43.1
one hour ago

Minor Changes

  • #4677 e382f12 Thanks @DylanPiercey! - Rebuild taglib discovery as per-directory lookups that read only what is used. A directory's lookup is built on first use from its parent's (or shared with it when the directory adds no taglibs), each directory's package is found with one stat, installed taglibs are found once per package, a tags dir is read whole the first time a tag is looked up through it, a marko.json's <tag> entries load when used, and names merge through the chain on demand, so compiling templates across many directories no longer repeats dependency resolution or merges every taglib per directory. A local tag now replaces a native tag of the same name whole instead of inheriting its parse options, while a nearer definition of a translator's own tag still merges into it, keeping its hooks. Without the class API, a tag folder's entry is its index.marko, a <name>.marko or a marko-tag.json; renderers, hook entry files and older template names are class API only. taglib.buildLookup reads through the configured fileSystem and takes one as an optional fourth argument, and each file system gets its own cache. A relative class API renderer resolves through it too, using resolve-sync, rather than by patching require.extensions. A custom fileSystem may provide realpathSync, which resolves links in installed packages' paths. Comments in marko.json and marko-tag.json files are stripped by the compiler itself, about ten times faster, so @luxass/strip-json-comments is no longer a dependency. Translators and tools released before this keep working: a translator without classTaglibs that discovers components reads class API taglibs, tag definitions keep getAttribute/forEachAttribute, and <meta> keeps its content attribute declared. The lookup's getAttribute/forEachAttribute now find nothing. Drops the lookup's taglibsById (so @marko/vite 3.0 and earlier no longer pre-bundle installed taglibs' templates), taglib-imports of a package.json (list each dependency's marko.json instead), the { path, prefix } form of tags-dir, the undocumented htmlType: "custom-element" and template.html tag entry, the internal _loader/_finder, tooling-only tag metadata (descriptions, autocomplete, attribute types), which TypeScript now provides (a tag is documented by the comment above its template's Input), and the TagDefinition fields dir (use the directory of filePath), attributeGroups, deprecated and top-level openTagOnly (read parseOptions.openTagOnly).

Patch Changes

  • #4678 012a7e1 Thanks @DylanPiercey! - Resolve taglib-imports and a template's imports of a package's .marko files through the compile's fileSystem, using resolve-sync, so files only that file system holds are found, including in the browser build. A template's imports resolve with import conditions, as a bundler would, and an imported package needs a package.json.

Don't miss a new marko release

NewReleases is sending notifications on new releases.