Minor Changes
- #4677
e382f12Thanks @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, amarko.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 itsindex.marko, a<name>.markoor amarko-tag.json; renderers, hook entry files and older template names are class API only.taglib.buildLookupreads through the configuredfileSystemand takes one as an optional fourth argument, and each file system gets its own cache. A relative class APIrendererresolves through it too, usingresolve-sync, rather than by patchingrequire.extensions. A customfileSystemmay providerealpathSync, which resolves links in installed packages' paths. Comments inmarko.jsonandmarko-tag.jsonfiles are stripped by the compiler itself, about ten times faster, so@luxass/strip-json-commentsis no longer a dependency. Translators and tools released before this keep working: a translator withoutclassTaglibsthat discoverscomponentsreads class API taglibs, tag definitions keepgetAttribute/forEachAttribute, and<meta>keeps itscontentattribute declared. The lookup'sgetAttribute/forEachAttributenow find nothing. Drops the lookup'staglibsById(so@marko/vite3.0 and earlier no longer pre-bundle installed taglibs' templates),taglib-importsof apackage.json(list each dependency'smarko.jsoninstead), the{ path, prefix }form oftags-dir, the undocumentedhtmlType: "custom-element"andtemplate.htmltag 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'sInput), and theTagDefinitionfieldsdir(use the directory offilePath),attributeGroups,deprecatedand top-levelopenTagOnly(readparseOptions.openTagOnly).
Patch Changes
- #4678
012a7e1Thanks @DylanPiercey! - Resolvetaglib-importsand a template's imports of a package's.markofiles through the compile'sfileSystem, usingresolve-sync, so files only that file system holds are found, including in the browser build. A template's imports resolve withimportconditions, as a bundler would, and an imported package needs apackage.json.