Releases: sizzlorox/react-pretext
Releases · sizzlorox/react-pretext
v0.1.5
v0.1.4
v0.1.3
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
--provenanceflag (provenance is generated automatically when publishing via OIDC from GitHub Actions) - Fixed
repository.urlformat in `package.json
v0.1.2
v0.1.1
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/pretextLive demo
Initial Release
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/pretextWhat'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.