v0.7.0
Breaking release (0.x minor): leaner defaults, viewport-aware sources, and a
truly zero-config auto. Migration notes are under each item.
Changed
autois now fully declarative and attaches nothing by default. It no
longer auto-attachesviewport/pointerto:root. Declare every source —
globals included — withdata-props-for, e.g.<html data-props-for="viewport pointer">. Migration: add the globals you relied on to the root<html>.autoloads plugins on demand. The first time adata-props-forkey needs
a plugin, its chunk is dynamically imported and registered, then the binding
attaches — no moreregisterPlugins()/prop-for-that/pluginsimport when
usingauto. Because it lazy-loads via dynamicimport(), loadautoas a
module:<script type="module" src=".../auto.js">. The classic
auto.global.jsdrop-in is removed (it can't resolve lazy chunks from a CDN).
Migration: switch theautoscript tag totype="module"and drop any
registerPlugins()calls that existed only to feedauto.- Element sources are viewport-gated. An
element-scoped source now runs only
while its element is in the viewport (via the sharedIntersectionObserver);
off screen its work is torn down and its last values freeze in place, resuming +
re-seeding on re-entry. Global sources and:rootbindings are never gated; a
source can opt out withgate: false. No API change for consumers. - The frame loop freezes while the tab is hidden (
document.hidden) and stays
fully idle when nothing is changing — fewer strayrequestAnimationFrames on
pages that aren't actively updating. - Shared
ResizeObserver/IntersectionObservernow support multiple subscribers
per element (with last-entry replay to late subscribers), so an element can be
watched by both a source and the gate at once. autono longer caches a failed plugin load permanently — a transient failure
(offline, blocked, flaky CDN) is dropped so a later request for the same key retries.img-colormemoizes its extracted palette per rendered source, so the viewport
gate re-runningstart()on scroll-in reuses the result instead of re-sampling the
canvas when the image hasn't changed.- Documented the auto path's two limits (light-DOM only / no shadow roots; needs a
CDN that serves thedisttree verbatim) and the gate contract for source authors
(start()is re-invoked on every viewport re-entry, so keep it cheap + idempotent).
Added
gate?: booleanonSource— opt an element source out of viewport gating
(defaults on forscope: 'element').visibilitysets itfalse.isRegistered(key)exported fromprop-for-that— whether a source key is
currently registered.
Removed
pointeris no longer a core source — it writes on everypointermove, so
it's now an opt-in plugin alongsidepointer-local. Migration: underauto
it just works (loaded on demand). Imperatively,registerit first:
import { pointer } from 'prop-for-that/plugins'; register(pointer); propsFor(['pointer']).dist/auto.global.js(the classic, non-moduleautodrop-in) — see the
autonote above.