











<is-land autoinit>: Removes autoinit attribute and the is-land-autoinit.js file. Switch to use framework initialization types (via Island.addInitType()) instead (see sample code below).1.61 kB to v5.0.0 at 1.83 kBon:idle, on:media, or on:load conditions.on:interaction to improve scrolling performance (fixes Lighthouse warning) #20import attribute support to core plugin (was previously in is-land-autoinit.js)Island.addInitType() and islands must match the appropriate name in the <is-land type> attribute — examples provided for alpine, petite-vue (see below), vue, vue-ssr, preact, preact-ssr, svelte, or svelte-ssr (Web Components and lit are supported out of the box).
type and import (e.g. <is-land type import>) import attribute targets are not loaded automatically for you:
<is-land import="">: import() is performed for you<is-land import="" type="">: you’re responsible for import() in your initialization function.Island.addFallback API to improve control of fallback content. Example provided for Alpine.js islands (Demo) (without separate <template> markup) for easier-to-control progressively-enhanced fallback content.on: attribute prefix #16?nodefine query param per https://www.zachleat.com/web/nodefine/dist/is-land.min.js minimized JS to published code.Island.define() and customElements.define for using a different tag name (rather than <is-land>). Island.define(tagName) API is removed. #32Island.addInitType APISample Island.addInitType usage for petite-vue:
// This code only needs to be added once globally Island.addInitType("petite-vue", async (node) => { // Load the library, mount the target node const { createApp } = await import("https://unpkg.com/petite-vue@0.4.1/dist/petite-vue.es.js"); createApp().mount(node); });
More examples available.
Milestone: https://github.com/11ty/is-land/milestone/2?closed=1
Full Changelog: v4.0.1...v5.0.0
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。