This repository has been archived by the owner on Dec 13, 2018. It is now read-only.
Releases: paypal/glamorous
Releases Β· paypal/glamorous
v4.4.0
v4.3.1
v4.3.0
v4.2.1
v4.2.0
v4.1.2
v4.1.1
v4.1.0
v4.0.0
4.0.0 (2017-08-03)
New Features
propsAreCssOverrides
is now officially exposed and supported allowing you to create your own version of built-in components (likeglamorous.Div
) that accept props as css. By @kentcdodds in #258withProps
API now available to allow you to specify props you want applied to your component. Give this a look! By @kentcdodds in #255shouldClassNameUpdate
which is accepted as part of the options in theglamorous
function allows you to create a component factory which works kind of likeshouldComponentUpdate
except instead of skipping render, it will simply skip regenerating theclassName
which can be a nice performance booster if you need. There is room to improve this API further so keep an eye on this. By @kentcdodds in #250.
Performance
- @tkh44 found a great optimization in #254 by deferring styles resolution and merging to glamor. Rather than using internal APIs. Benchmarks are silly so it's hard to tell how this will impact your app, but you could see ~8% or more perf improvements when mounting and a bit of a bump for re-rendering.
Bug Fixes
- In some cases, you could wind up with two glamor-generated classNames on a single glamorous component. Fixed by @tkh44 in #254.
Breaking Changes
glamorous.config
is no longer available. The only configurable option wasuseDisplayNameInClassName
and now, if you're using[email protected]
or greater then you'll benefit from the new readable classnames feature automatically whenNODE_ENV=development
orNODE_ENV
is unset. To update your code remove any usage ofglamorous.config
. By @oalbacha and @kentcdodds in #221 and #247- The
theme
argument is no longer available in dynamic props. Instead,theme
is available onprops
. (Before:glamorous.div((props, theme) => ({fontSize: theme.fontSize}))
After:glamorous.div((props) => ({fontSize: props.theme.fontSize}))
. To update your code run this codemod. By @tdeschryver in #222. Codemod by @tdeschryver and @kentcdodds in #234 - TypeScript: There are tons of TypeScript improvements and updates. Upgrade glamorous and fix all your violations π (π for static typing)
Typescript
In addition to support for all the new features and breaking changes announced, there has been significant improvements to the coverage of existing typing. With the exception of built-in components (only Div
and Svg
are available currently) glamorous should now be fully typed.
Glamorous component factory arguments have been improved to no longer accept style objects that are not valid css or svg property sets. #230
Renamed types
HTMLGlamorousInterface
->HTMLComponentFactory
,StyledFunction
->GlamorousComponentFactory
,SVGGlamorousInterface
->SVGComponentFactory