Skip to content

Releases: sizzlorox/react-pretext

v0.1.5

03 Apr 17:47

Choose a tag to compare

Fix publish workflow — use Node 24 which ships with npm 11+ natively (required for OIDC trusted publisher auth).

v0.1.4

03 Apr 17:45

Choose a tag to compare

Notes:
Fix OIDC trusted publisher auth — no functional changes to the package.

Changes

  • Upgrade npm to latest in publish workflow (npm 11.5.1+ is required for OIDC token exchange — Node 22 ships with npm 10.x which does not support it)

v0.1.3

03 Apr 17:41

Choose a tag to compare

Notes:
Fix OIDC trusted publisher workflow — no functional changes to the package.

Changes

  • Bumped Node to 22 in CI/CD (required for npm trusted publisher OIDC auth — minimum Node 22.14.0)
  • Removed --provenance flag (provenance is generated automatically when publishing via OIDC from GitHub Actions)
  • Fixed repository.url format in `package.json

v0.1.2

03 Apr 17:32

Choose a tag to compare

Changes

  • Removed registry-url from setup-node in publish workflow, which was overriding the OIDC auth and causing 404 errors on publish

v0.1.1

03 Apr 17:28

Choose a tag to compare

Changes

  • Renamed package to @sizzlorox/react-pretext (unscoped name was taken on npm)
  • Switched npm publish to OIDC trusted publisher — no token secrets needed
  • Added CI workflow (typecheck + test + build on every push and PR)

Install

npm install @sizzlorox/react-pretext @chenglou/pretext

Live demo

https://sizzlorox.github.io/react-pretext/

Initial Release

03 Apr 17:23

Choose a tag to compare

React hooks and a drop-in component for @chenglou/pretext — high-performance text measurement and layout without DOM reflows.

Install

npm install @sizzlorox/react-pretext @chenglou/pretext

What's included

  • usePretext — combined hook: prepare + layout in one call, returns lineCount, height, and optional per-line text
  • usePreparedText / usePreparedTextWithSegments — memoized Phase 1, only reruns when text or font changes
  • usePretextLayout / usePretextLines — pure-arithmetic Phase 2, safe to call every render
  • usePretextContainerWidth — ResizeObserver-based container width, SSR-safe
  • — drop-in component that measures its own container and renders line-by-line with zero DOM reflows
  • Full TypeScript types — no need to import @chenglou/pretext directly for types
  • Re-exports layoutNextLine and walkLineRanges for advanced use cases like flowing text around shapes

Live demo
Includes an interactive text-around-moving-shapes demo running at 60fps with zero synchronous DOM reads.