Skip to content

v0.4.2

Choose a tag to compare

@olibaron olibaron released this 08 Sep 11:10
· 6 commits to main since this release

Changed

tippy.js is optional, and loads on the first tooltip. It was a hard dependency imported at module load, so every consumer paid for it in install size and in the bundle — including the many that never render a toolbar. It is now an optional peer dependency, imported dynamically the first time a tooltip mounts. Install it and tooltips are unchanged; leave it out and nothing breaks.

Every control stays named without it. With tippy absent the imperative show/hide handle is inert and the trigger keeps the native title it already carried, so toolbar buttons remain labelled and reachable — a plainer tooltip, not a missing one.

The loader survives both module shapes. tippy.js@6 ships main and module with no exports map, so the callable export sits at a different depth depending on the resolver: a bundler reaching for ESM finds it at default, Node taking the CommonJS build finds it at default.default. The loader descends until something is callable instead of assuming a depth. The import is attempted once per module; a failed load leaves the retry open for a later tooltip, and one that resolves without a callable is not retried.

Tooltip creation reads current props. tippy now arrives a microtask after the effect runs, so creation reads the latest props at that moment rather than the ones captured when the effect was scheduled, and an unmount during the load disposes cleanly instead of leaving an orphaned instance.

Docs

The docs site is measured with Google Analytics, through the classic preset's own gtag plugin rather than a snippet in headTags — the site is a single-page app after first paint, so a bare snippet would count the entry page and nothing after it. Production builds only: docusaurus start injects no tag.

Compatibility

No API change: Tooltip keeps its props and its show/hide handle. The one thing to know is installation — tippy.js is no longer installed for you. A consumer that wants rich tooltips should add tippy.js@^6.3.1 alongside this package; one that does not gets native titles and a smaller bundle. Patch release.