3.1.3

Changes

  • SEO prerendering:

    • The sanitizer, stripBindingsFrom() and stripClobberingNamesFrom() now also clean a template's own children. In browsers and jsdom, a parsed template has none, so their output is unchanged.
    • The string forms had the same problem during prerendering, and are fixed.
    • No longer crashes on libraries that read DOM getters off their prototypes.
    • The SSR polyfills (tools/builder/core/seo/ssr/ssr-polyfills.js, new installSpecAccessors(window)) now give each of these prototypes an accessor that resolves as node[name] would:
      • Node: nodeType, nodeName, ownerDocument, parentNode, parentElement, childNodes, firstChild, lastChild, previousSibling, nextSibling, textContent
      • Element: children, attributes, localName, namespaceURI, tagName, firstElementChild, nextElementSibling
      • DocumentFragment: children
      • HTMLTemplateElement: content
    • It also covers the case that failed silently: linkedom's Node.prototype getters for childNodes, firstChild, nextSibling and textContent.
  • i18n: i18n in nutin.config.js now lists the languages.

    • i18n: ['en', 'fr'] turns i18n on, the first language being the default. i18n: [] turns it off, and is the default for new projects.
    • i18n: true and i18n: false still work. true lists no language, so it means English only, and the build warns about it.
    • nutin-update migrates existing projects. The update summary says what it will do, and the confirmation asks for it. i18n: true becomes the config/languages.json list, the default language first. i18n: false becomes [], and the update prints the dropped list. A list you already wrote is kept. With no i18n option at all (an extension), then config/languages.json is deleted.
  • nutin-update: An AGENTS.md that only differs by its "generated with Nutin X" line no longer counts as edited by you. It's updated in place. When you did edit it, the new version line merges without a conflict, even with your edits right next to it.

  • Browser extension projects:

    • New extension projects no longer get the tools their build never runs:
      • tools/builder/core/seo/, with the linkedom devDependency;
      • tools/builder/core/i18n/;
      • tools/builder/core/prod-bundle/compress-files.js;
      • config/seo.json.
    • The builder now runs without a config/ folder.
    • Existing extension projects: nutin-update lists those files as no longer generated and leaves them in place, along with config/seo.json: you can delete them. It also reports linkedom as no longer needed, without removing it.