helix

https://github.com/Lokeh/helix
Derek Passen 2020-02-25T00:04:31.013900Z

feels like a lot of incidental complexity

Derek Passen 2020-02-25T00:04:40.014200Z

but i’m done for the night, thank you for your suggestions 🙂

lilactown 2020-02-25T00:22:10.015300Z

I mean, ostensibly your classes will almost always show up in something like:

:class "foo bar baz"
I would try and look for patterns like that, instead of matching every form to a class name. but I don’t know how expressive purgecss is

lilactown 2020-02-25T17:06:05.020100Z

I’ve just cut a new release of helix - 0.0.9. It includes the following changes: • Fix integration with Fast Refresh that was broken in 0.0.8 (Still WIP, still experimental!) • $ is a little faster now, due to no longer emitting code that does dynamic dispatch (thanks @darwin!) • Feature flag :check-invalid-hooks-usage now emits compiler warnings rather than throwing at macro time • :check-invalid-hooks-usage no longer will complain about usages of user 😛 hooks must currently be kebab-case to work with it. Better RegEx foo incoming. • A new helper helix.core/create-context • A new defhook macro which will in the future help with checking for invalid hooks usage, integrating with Fast Refresh, and more.

👍 4
❤️ 4
Luis C. Arbildo 2020-02-25T22:28:08.021500Z

@lilactown I try to run the example in the Readme but don't work

lilactown 2020-02-25T22:28:19.021700Z

oops, what’s the error?

Luis C. Arbildo 2020-02-25T22:29:04.022100Z

Luis C. Arbildo 2020-02-25T22:29:06.022500Z

the state don't update

Luis C. Arbildo 2020-02-25T22:29:41.023Z

(defnc Greeting
  "A component which greets a user."
  [{:keys [name]}]
  ;; use helix.dom to create DOM elements
  (d/div "Hello, " (d/strong name) "!"))


(defnc App []
  (let [[state set-state] (hooks/use-state {:name "Helix User"})]
    (d/div
     (d/h1 "Science Timeline!")
     ;; create elements out of components
     ($ Greeting {:name (:name state)})
     (d/input {:value name
               :on-change #(do (set-state assoc :name (.. % -target -value))
                               (println (.. % -target -value)) )}))))

lilactown 2020-02-25T22:35:33.023200Z

oops, you’re right

lilactown 2020-02-25T22:35:54.023700Z

(d/input {:value (:name state) should be the correct code

✅ 1
Luis C. Arbildo 2020-02-25T22:36:07.023900Z

oh i see

Luis C. Arbildo 2020-02-25T22:37:11.024700Z

I will write a post about how make web apps in Helix 🙂

lilactown 2020-02-25T22:40:45.025100Z

I’ve fixed it in the README. Thanks for reporting!

Luis C. Arbildo 2020-02-25T22:41:03.025400Z

Thank you for the support!

Luis C. Arbildo 2020-02-25T23:17:07.026100Z

["pigeon-maps" :as pm]
  

(pm/Map)

Luis C. Arbildo 2020-02-25T23:17:20.026300Z

Luis C. Arbildo 2020-02-25T23:17:23.026700Z

What I'm doing wrong?

Luis C. Arbildo 2020-02-25T23:21:31.027100Z

(defnc AppMap
  "A component which show a map."
  [{:keys [scientists]}]
  ;; use helix.dom to create DOM elements
  (d/div
   (pm/Map)
   (d/div "Hello !")))

lilactown 2020-02-25T23:23:20.027400Z

check out https://github.com/Lokeh/helix/blob/master/docs/creating-elements.md

lilactown 2020-02-25T23:24:21.028200Z

you might also not be requiring the pigeon-maps lib correctly

lilactown 2020-02-25T23:25:03.028900Z

try this:

["pigeon-maps" :default Map]

($ Map)

Luis C. Arbildo 2020-02-25T23:26:57.029100Z

new error

Luis C. Arbildo 2020-02-25T23:27:03.029200Z

lilactown 2020-02-25T23:28:10.030200Z

that’s better. try similar what you had before

["pigeon-maps" :as Map]

($ Map)

lilactown 2020-02-25T23:28:39.030500Z

you can (js/console.log Map) to see what it’s importing, that might help

lilactown 2020-02-25T23:28:58.030800Z

getting the requires down for npm libs is a little tricky sometimes