Fork me on GitHub
#helix
<
2020-07-05
>
lilactown18:07:11

I know this seems like a big jump, but I am interested in driving towards doing a 1.0 release of helix sooner rather than later

lilactown18:07:00

to me, helix 1.0 would include turning on some of the more experimental parts of helix: • support for react-refresh • inference and auto-filling deps for custom hooks • linting hooks usage at least

lilactown18:07:54

these are currently behind feature flags or are otherwise opt in, if they exist at all (inference for custom hooks hasn't been implemented yet)

lilactown18:07:43

I've created a helix.edge.core namespace that now represents a more volatile namespace for these features to be tried out

lilactown18:07:16

helix.core will stay stable with no breaking changes up until 1.0. helix.edge.core will experience potentially breaking changes

lilactown18:07:09

on release of 1.0, helix.edge.core will be renamed to helix.core

lilactown18:07:39

my goal is to encourage people to use helix.edge.core to validate those experimental features

Aron19:07:17

how reliable would inference be for hooks deps? for something like effect and layout-effect

lilactown19:07:20

it already works, you can pass in :auto-deps instead of a vector of dependencies for use-effect and use-layout-effect

lilactown19:07:26

it's reliable

lilactown19:07:44

I personally don't like using it for use-effect, but I think it is very good for use-memo and use-callback

lilactown19:07:03

the idea is that we could allow it to be used with custom hooks. so if you define a custom hook like:

(defhook use-custom-thing
  ;; annotate with metadata an argument that should be a deps array
  [^:deps deps x]
  ;; do something with deps and x
  (hooks/use-effect
    deps
    (prn x)))
Then the defnc macro can detect the metadata set on the use-custom-thing hook and check to make sure that you have passed in deps to the argument, or auto-fill it for you

lilactown19:07:18

I haven't done this work yet tho

Aron19:07:42

I never use use-memo or use-callback, perhaps because I never had to optimize the render so much. Maybe I should?

Aron19:07:38

It's awesome that auto-detecting stuff works runtime, it's like not even javascript