Releases: Jarzka/stylefy
Releases · Jarzka/stylefy
3.2.0
3.1.0
3.0.0
April 9, 2021
stylefy.impl.dom
, which handles DOM manipulation when using styles in components, has been (mostly) removed and replaced with external modules. This change frees stylefy from depending on Reagent, which makes it possible to support many UI libraries / frameworks. At the beginning, three different modules are available:stylefy/reagent
, which is essentiallystylefy.impl.dom
that was shipped in previous versions.stylefy/rum
, which is functionally the same module asstylefy/reagent
, but for Rum.stylefy/generic-dom
is a general-purpose solution that does not depend on any specific UI library / framework. It makes only synchronous DOM updates, so the wide support comes with the cost of performance.
- Namespaced keywords are replaced with unnamespaced when caching CSS. This makes different module implementations easier to work with, and it also reduces the size of the cache by approximately 7%. Unsupported cache versions are cleared automatically, so no actions are required from the users of the library.
- This also means that after upgrading stylefy to version 3.0.0, you should not downgrade it, or the cache is going to get corrupted! (if you absolutely must downgrade, turn caching off)
- Style hashing now checks Garden units recursively. This makes sure that if Garden units are used deeply inside a style map, they are converted to CSS before hashing, so that the hash values are the same on both frontend and backend. This can cause changes in some autogenerated class names.
- A warning message about namespace conflict between
stylefy/class
andclojure.core/class
is now ignored.
Migration guide from previous versions (frontend only):
Assuming you are using Reagent, update stylefy version and add stylefy/reagent
as a new dependency. Your dependencies should look something like this:
[stylefy "3.0.0"]
[stylefy/reagent "3.0.0"]
Require stylefy.reagent
and initialise it together with stylefy (along with any other options you pass to stylefy/init
):
(:require [stylefy.reagent :as stylefy-reagent])
(stylefy/init {:dom (stylefy-reagent/init)})
That's it!
2.2.2
2.2.1
2.2.0
2.1.1
2.1.0
2.0.0
- BREAKING Removes the possibility to pass
::stylefy/with-classes
touse-style
via options map (second argument ofuse-style
). If you do this, a warning message is logged and the value is ignored. This feature has been marked as deprecated since version 1.3.0 (2018). If you have used::stylefy/with-classes
in options map, you can easily replace it with:class
. Notice that passing::stylefy/with-classes
via style map (first argument ofuse-style
) is still perfectly valid, this change is only related to the options map. :class
in HTML attributes and:stylefy.core/with-classes
in style map now support additional syntax: you can pass a string, a keyword or a vector of strings or keywords. You can also pass a vector of both keywords and strings if you wish.nil
is also accepted and it will be ignored. Discussion: #44- Adds basic support for Server-Side Rendering (SSR). This means that we can now use
use-style
on the backend, when generating Hiccup code. This new feature does not affect how you use stylefy on the frontend. If you don't need SSR, you can simply omit it by doing nothing.
1.14.1
- Fix a bug: style maps with Garden units were sometimes hashed incorrectly (thanks to @frankitox for reporting this: #21 (comment))
- Minor refactoring
If you have used stylefy's auto-generated class names in tests, you can expect the values of those tests to change.