helix

https://github.com/Lokeh/helix
Aron 2020-05-08T07:14:06.255800Z

so, I updated https://github.com/ashnur/sierpinski-cljs-fiber-demo it follows the https://github.com/facebook/react/tree/master/fixtures/fiber-triangle quite closely, simpler at places. the scaling animation applied to the whole app https://github.com/ashnur/sierpinski-cljs-fiber-demo/blob/master/src/sierpinski/experimental.cljs#L75 through its props stops until https://github.com/ashnur/sierpinski-cljs-fiber-demo/blob/master/src/sierpinski/experimental.cljs#L42(`second` ) is updated. I tried to defer and everything, but nothing helps. Could be react bug, but I would suspect bug in my code first

Aron 2020-05-08T07:19:18.256700Z

can't even type properly, but I added links with the edits to what I am talking about

Aron 2020-05-08T07:19:57.257500Z

tbh, the performance is good enough for most real world applications, if it wouldn't be the point of the whole exercise to not get blocked animation, I wouldn't care : )

2020-05-08T11:43:40.258100Z

Are there any examples of using helix and shadow-cljs to grab and use a 3rd-party hook from npm?

Aron 2020-05-08T12:12:36.258400Z

should just work if you require it, no?

Aron 2020-05-08T12:13:04.258700Z

which hook is this?

aiba 2020-05-08T19:11:01.259100Z

Yeah in my experience, 3rd party hooks just work out of the box with helix and shadow-cljs

2020-05-08T22:40:43.259500Z

useMachine from @xstate/react

lilactown 2020-05-08T22:55:52.260200Z

@laheadle the only complexity here is understanding how to represent JavaScript objects using ClojureScript syntax

lilactown 2020-05-08T22:58:55.263300Z

for instance, to use their example on the quick-start of their docs:

import { useMachine } from '@xstate/react';
import { Machine } from 'xstate';

const toggleMachine = Machine({
  id: 'toggle',
  initial: 'inactive',
  states: {
    inactive: {
      on: { TOGGLE: 'active' }
    },
    active: {
      on: { TOGGLE: 'inactive' }
    }
  }
});
would translate to:
(ns my-app.feature
  (:require
    ["xstate" :refer [Machine]]
    ["@xstate/react" :refer [useMachine]]))

(def toggle-machine
  (Machine
   #js {:id "toggle"
        :initial "inactive"
        :states #js {"inactive" #js {:on #js {"TOGGLE" "active"}}
                     "active" #js {:on #js {"TOGGLE" "inactive"}}}}))

lilactown 2020-05-08T22:59:40.263900Z

these differences are extremely mechanical, and it’s a matter of learning how to use ClojureScript; helix doesn’t introduce any new rules

lilactown 2020-05-08T23:07:29.264400Z

if you’re new to CLJS, feel free to post here or in #clojurescript when you get stuck and I’ll do my best to help out 🙂