Releases: blakeembrey/free-style
Releases · blakeembrey/free-style
ES2015 Set and Map
ESM only
Changed
- This package is now ESM only! Do not upgrade if you aren't using ESM or a compatible bundler.
- Style properties are no longer sorted (fixes #105).
Improvements
- Shrunk the package 0.1kb (7% smaller).
- Performance improved in large style benchmarks by ~5%.
Added
- Added a
compile
API for pre-compiling styles to add to multiple sheets. - Added support for a custom
prefix
tocreate()
so all styles can be namespaced in a single sheet.
Allow null and undefined in `PropertyValue`
Changed
- Allow null and undefined in PropertyValue f6b33f9
- Primarily means that an array of values can now contain
null
andundefined
and they will be filtered out as if they weren't set
- Primarily means that an array of values can now contain
Remove `register*` Methods
Changed
- Remove old
register*
methods b506c8b- Everything can be done using a singular
registerStyle
going forward, simplifies the API interface and removes even more bytes in production! - If you need to provide backward-compatible interfaces (e.g. you're a library wrapping
free-style
), the commit above shows how it backward compatibility was maintained in3.x
- you'll just need to implement it yourself now - The entire bundle of
free-style
is down to 1.7kB https://bundlephobia.com/result?p=free-style@4.0.0
- Everything can be done using a singular
Fix Nested Selector Hashing
Fixed
- Fix nested selectors returning the same hash when no other styles are present
- E.g.
{ color: 'red' }
and{ '&:first-child': { color: 'red' } }
should return different hashes, otherwise it'll create some nasty edge cases for the class name getting set to{ color: 'red' }
unexpectedly
- E.g.
Remove \0 From Strings
Fixed
- Remove
\0
from internal hash strings - Use the internally generated hash for shorter IDs for conflict resolution
Publish ES5 Distribution
Fixed
- Add new
dist.es5
directory to NPM files, left out of the previous release 😅
Add ES5 Distribution
Added
- Create an ES5 distribution available at
free-style/dist.es5
Register Style For Everything
Added
- Allow
registerStyle
to handle every previous method in one function (e.g.registerHashRule
,registerRule
andregisterCss
)- This works by interpolating rules with
&
(e.g.@keyframes &
), and adding a new flag$global: true
- This works by interpolating rules with
Even Smaller Build
Changed
- Move to ES2015 (saves 0.3kb)
- Cosmetic code changes to shave a few extra bytes