helix

https://github.com/Lokeh/helix
lilactown 2020-07-05T18:31:11.294400Z

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

lilactown 2020-07-05T18:33:00.296200Z

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

lilactown 2020-07-05T18:33:54.297200Z

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)

lilactown 2020-07-05T18:34:43.297900Z

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

lilactown 2020-07-05T18:35:16.298600Z

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

lilactown 2020-07-05T18:36:09.299300Z

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

lilactown 2020-07-05T18:36:39.300Z

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

Aron 2020-07-05T19:28:17.300800Z

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

lilactown 2020-07-05T19:33:20.301400Z

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

lilactown 2020-07-05T19:33:26.301600Z

it's reliable

lilactown 2020-07-05T19:33:44.302100Z

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

lilactown 2020-07-05T19:36:03.304500Z

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

lilactown 2020-07-05T19:36:18.304700Z

I haven't done this work yet tho

Aron 2020-07-05T19:58:42.305400Z

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

Aron 2020-07-05T19:59:38.306100Z

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