- clj-kondo hooks for DOM macros lint
&
correctly
- Extend JS Symbol using the primitive
symbol
- #130 String keys are now supported in props, which when given to a DOM element will pass those verbatim (i.e. without camelCasing)
helix.hooks/use-id
that wraps new base React hookuseId
(@rome-user)- #131
helix.core/creat-ref
that wrapsReact.createRef
similar to use-ref (@rome-user) - #146 / #142
:style/indent
metadata on$
,defnc
,defnc-
,defhook
, and all DOM macros - DOM macros are now written literally; this helps move towards self hosted CLJS support
- #136 Fix issue with loading helix in Node.js due to depending on
window
being available (@rome-user)
- #127
helix.hooks/wrap-fx
is now private (@rome-user)
- Replace deprecated
goog.object/extend
withjs/Object.assign
:wrap
can now be passed in the metadata map as well as the options map. A clj-kondo lint warning will occur when using:wrap
in the options map. See #110- clj-kondo hooks are now included when using git deps
- Add support for
:define-factory
in clj-kondo hooks - Add
hgroup
element tohelix.dom
defnc-
no longer requires one to referdefnc
as wellprovider
no longer emits extern warnings- clj-kondo hooks no longer remove metadata like line numbers when analyzing
- Passing a function to the setter returned by
use-state
caused an infinite loop
- Added docstrings to many functions and macros
helix.dom/marker
DOM macrodefnc-
which defines a private functional component in the namespace it's called in
defcomponent
now adds thedisplayName
property as a static, so should show up in devtools now- Mark
assoc-some
as private - Fixed an issue with fast-refresh where JS values in hooks would incorrectly invalidate on every refresh
- The setter function returned by
use-state
, when passed multiple arguments, will check whether the first argument is callable before callingapply
on it. defcomponent
now properly accepts docstring
- Allow metadata to be set on vars created with
defnc
as a map after the name and before the args list, just likedefn
- clj-kondo hooks for
defnc
,$
et al.
- Removed
deps.cljs
which declares dependencies on React. This was causing unnecessary build warnings/errors. Consumers should installreact
andreact-dom
themselves. This will not break existing projects.
- Correctly compare props when using
helix.core/memo
without a custom comparator combined with:define-factory
- CLJS 1.10.891 compat: don't assume
goog.object
is globally available
- Fix invalid hooks check when hooks appear inside literals, i.e.
(when x [(use-foo)])
- Fix recursive calls to components wrapped in HOC
- Detect hooks inside of JS literals
- Fix invalid hooks check false warnings when a
use-
symbol appears in a quoted form (@SevereOverfl0w) - Allow a single var/binding to be passed to
use-callback
- Invalid hooks check now happens in
defhook
forms fnc
for constructing anonymous components
- Fix performance issue with
use-subscription
due to callingpr-str
on subscription state every render
- Enable
:check-invalid-hooks-usage
by default
helix.dom/$d
helper for rendering components with DOM props coercion; e.g.($d material-ui/button {:class ["foo" "bar"]})
- (@jimmyhmiller) Fix
use-subscription
infinite render
- (@alidlorenzo) Correctly handle objects when passing a vector into React Native
style
prop - (@aiba) Don't log result of
performFastRefresh
- (@stanislas) Don't camel case CSS custom properties
- (@wilkerlucio) Declare DOM macros to allow Cursive's static analysis to detect them
- (@wilkerlucio) Correctly declare deps in deps.edn
- (@jimmyhmiller) Change from js/goog.DEBUG to goog/DEBUG to help with infer-externs
- (@jimmyhmiller) Add style/indent :defn to hooks that have deps
- use-debug-value correctly refers React's useDebugValue
use-subscription
hook that respects Clojure equality
- mark component-fn private when using factory functions
- Passing in
:ref
and:key
props with factory functions - Docstrings for
defnc
and$
- for "native" elements the
:style
prop now accepts an arbitrary JS object as well as a map or vector
- Added
deps.cljs
which specifies react, react-refresh :class
prop for native components now accepts a seq(able) collection, e.g.:class ["foo" "bar"]
is equivalent to:class (str foo " " bar)
.- Spread props can now take a JS object. This can help a lot in certain interop situations where a 3rd party library passes a JS object that are meant to be given as props to an element of your choice.
- Spread props using keyword
:&
works with non-native components - Fix a bug where passing in non-existent value to a native element would pass in
nil
, when the element expectedjs/undefined
- Helix now works with the vanilla CLJS compiler, including figwheel projects
:define-factory
works with:fast-refresh
feature flag
- Due to thheller/shadow-cljs#709, the fix for vanilla CLJS now requires that shadow-cljs projects emit ES6 code during development.