Skip to content

Conversation

@trurl-master
Copy link
Owner

🎯 Overview

This PR adds comprehensive support for the CSSNumberish type introduced in the Web Animations API, replacing the previous number type for timing properties.

✨ Key Changes

New Features

  • CSSNumberish Helper Module: Centralized conversion utilities in cssNumberishHelpers.ts
  • Type-Safe Conversions: Robust handling of CSSUnitValue (time units) and CSSMathValue
  • Cross-Runner Compatibility: Enhanced runner abstraction with spyOn support
  • Comprehensive Testing: Unit tests for helpers + integration tests across all runners

Technical Improvements

  • Boundary-Layer Pattern: Convert CSSNumberish to number at API boundaries
  • Zero any Types: Complete elimination of any in favor of unknown
  • Graceful Degradation: Safe handling of unsupported CSS units with warnings
  • Environment Awareness: JSDOM-compatible checks for browser APIs

🧪 Testing

All tests pass across:

  • ✅ Jest
  • ✅ Vitest
  • ✅ SWC
  • ✅ Examples

📦 Version

Bumps to 1.14.0 - new feature release

🔧 Breaking Changes

None - this is a backward-compatible enhancement that maintains existing API contracts while adding support for the new CSSNumberish type.

@trurl-master trurl-master merged commit a3edce5 into master Jul 27, 2025
9 checks passed
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.

2 participants