Skip to content

text-bubbles v1.0.0 - #1

Merged
piique merged 11 commits into
mainfrom
release/v1
Oct 15, 2026
Merged

piique merged 11 commits into
mainfrom
release/v1

Conversation

@piique

@piique piique commented Oct 15, 2026

Copy link
Copy Markdown
Owner

text-bubbles 1.0.0

First npm release, published as text-bubbles (unscoped).

What changed

  • Framework-agnostic core (text-bubbles): createTextBubbles(target, options) with update, pause, resume, refresh, destroy and a ready promise. ~3.95 KB gzip, no dependencies, SSR-safe imports.
  • React adapter (text-bubbles/react): <TextBubbles> + useTextBubbles(), 'use client', no re-init on parent re-renders. 481 B + core.
  • Custom element (text-bubbles/element): <text-bubbles> for Astro, Vue, Svelte or plain HTML. 4.44 KB including core.
  • Fixes: devicePixelRatio scaling, passive touch listeners (page scroll is no longer blocked), ResizeObserver sizing (auto height), pause off-screen / hidden tab and sleep when settled, waits for web fonts, prefers-reduced-motion, stable options in React, maxWidth honored.
  • New options: multi-line text and word wrapping below a width, alignment, density, accent color/ratio, var(--token) colors that follow theme changes, intro duration, maxDpr, maxParticles.
  • Packaging: tsup build (ESM + CJS + types) with an exports map, MIT LICENSE, CHANGELOG, size-limit budgets, correct repository URL.
  • Playground: live controls with the text and options on screen together, generated snippets, and copyable code for the three ways to use it.
  • CI: Pages deploy with pnpm; PR checks (lint, types, unit + Playwright tests, build, size).

Verification

  • Vitest: 41 passed
  • Playwright (Chrome): 19 passed
  • size-limit: all budgets pass
  • npm pack --dry-run: 15 files, 19.1 kB

🤖 Generated with Claude Code

piique and others added 11 commits October 15, 2026 11:53
- Rename the package to the unscoped text-bubbles, version 1.0.0.
- Build the library (not the demo) with tsup: ESM + CJS + .d.ts for
  three entries (text-bubbles, text-bubbles/react, text-bubbles/element),
  ES2020, minified, adapters import the core by package name.
- exports map with types/import/require per entry, typesVersions for
  node10 resolution, files whitelist, sideEffects limited to the element.
- React and react-dom become optional peer dependencies (>=18).
- Fix repository URL, add homepage, bugs, engines, publishConfig.
- Drop the ./style.css export that never existed.
- Switch to pnpm; add Biome, size-limit budgets and prepublishOnly checks.

BREAKING CHANGE: the package name and entry points changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
createTextBubbles(target, options) owns its canvas inside the target and
returns an instance with update/pause/resume/refresh/destroy, ready,
canvas and particleCount.

- devicePixelRatio scaling (maxDpr), ResizeObserver sizing, auto height
  for containers without one.
- Multi-line text, align left/center/right, lineHeight, wrapBelow,
  maxWidth; font size fitted to the container.
- Colors from CSS colors, currentColor or var(--token), re-resolved on
  theme changes; accent particles with a deterministic ratio.
- density-based spacing (2-6 px) and a particle cap (maxParticles).
- Typed-array particles, no allocations or layout reads per frame, one
  path per color, loop sleeps at rest and pauses off-screen/hidden tab.
- Passive listeners only: touch never blocks page scrolling.
- prefers-reduced-motion: respect (static), ignore or hide.
- Waits for web fonts before sampling and re-samples on late loads.
- update() re-samples only for layout changes and just repaints colors.
- intro animation, onReady/onPointerEnter/onPointerLeave callbacks.
- SSR-safe: nothing touches window/document at import time.

BREAKING CHANGE: the React-only engine API is replaced by
createTextBubbles; spacing is renamed ease (alias kept).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
'use client' adapter on top of the core. Options are compared by value,
so re-renders with inline literals never re-initialize the instance;
changes go through update(). Children stay in the DOM as an accessible
fallback and the wrapper exposes data-ready.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Registers <text-bubbles> (guarded against double definition) with
kebab-case attributes mirroring the options, light DOM children kept as
fallback (and as the text source when there is no text attribute),
data-ready reflection and a ready event. defineTextBubbles() registers
it under any tag name and is a no-op on the server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Controls for the main options, live snippets for React, the custom
element and vanilla JS, light/dark themes through CSS variables, and
links to GitHub and npm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unit: option normalization, color/var resolution, line wrapping, font
fitting, density spacing, particle cap, accents, update() decisions and
SSR-safe imports.

Browser (system Chrome): particles painted, DPR scaling, no console
errors, sleeping loop, passive touch with real scroll, reduced motion
modes, off-screen pause, auto height, custom element attributes and
theme recolor, no React re-init on re-render, destroy() cleanup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Pages workflow now uses pnpm and the new scripts (build:demo, CNAME
copied from demo/public by Vite). A CI workflow runs lint, typecheck,
unit tests, build, size budgets and Playwright on pull requests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rewrite the README for the text-bubbles package: install, vanilla,
React (incl. Next.js App Router) and Astro quick starts, options and
instance API, accessibility, performance, theming and browser support.
Replace the dead Netlify demo link with text-bubbles.pedrovilaca.dev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each "Three ways to use it" example now explains when to use it and shows
the exact, copyable code that renders the live demo (core, React and the
custom element).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The playground is now a sticky workbench: the live text and the generated
snippet stay beside the options while you scroll. On wide screens (Full HD)
the options use two columns, so everything fits without scrolling; on
smaller screens the options panel scrolls on its own. The "three ways to use
it" examples moved below, full width. Color swatches now resolve var()
colors and follow the theme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for text-bubbles ready!

Name Link
🔨 Latest commit 20aae50
🔍 Latest deploy log https://app.netlify.com/projects/text-bubbles/deploys/6ad0ec308b0f2216a72d7910
😎 Deploy Preview https://deploy-preview-1--text-bubbles.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@piique
piique merged commit b4b2ba2 into main Oct 15, 2026
6 checks passed
@piique
piique deleted the release/v1 branch October 15, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant