helix

https://github.com/Lokeh/helix
Aron 2020-06-03T06:46:39.115400Z

how do people inspect state?

Eliraz 2020-06-03T13:22:01.115700Z

people? what do you mean inspect?

Aron 2020-06-03T13:48:05.116Z

people, as in human beings : D inspect means the word inspect

Aron 2020-06-03T13:49:19.116900Z

https://clojureverse.org/t/introducing-shadow-cljs-inspect/5012 like the word used here

Aron 2020-06-03T13:50:25.117300Z

or here https://i.imgur.com/PkVg33H.png

Lucy Wang 2020-06-03T13:53:18.119100Z

@ashnur Personally I simply use the repl to inspect any data. I tried shadow-cljs inspect and tbh, it doesn't feel that easy to use (or maybe I didn't get how to use it correctly).

Aron 2020-06-03T13:53:53.119300Z

simply?

Aron 2020-06-03T13:54:08.119600Z

so not easily?

Aron 2020-06-03T13:54:13.119900Z

: )

Aron 2020-06-03T13:55:04.120600Z

how do you use the repl exactly to see the live data in helix hooks?

Aron 2020-06-03T13:56:14.121400Z

I can evaluate stuff from my editor and print into browser console, very neat trick, but it doesn't help me get access to the state

orestis 2020-06-03T15:31:48.121900Z

React dev tools , log the component to the console

orestis 2020-06-03T15:32:17.122300Z

Then you get the custom formatters in play

orestis 2020-06-03T15:32:42.123100Z

In theory you could also inspect the values directly in dev tools but they don’t speak CLJS

dominicm 2020-06-03T15:33:43.123200Z

We've been discussing the devtools internally. If we get some breathing room, I'd love to have one of our devs add JSONML support to the react devtools.

dominicm 2020-06-03T15:34:06.123400Z

Although - we're pretty small, so it might be better for us to sponsor someone to look at that.

orestis 2020-06-03T15:34:53.124900Z

There was some discussion about this with the react team, the rationale being that they need to also support immutable.js and immer so some kind of custom formatting is needed. I don’t think that went anywhere though.

dominicm 2020-06-03T15:35:13.125Z

I read the issues, yeah :)

lilactown 2020-06-03T15:44:49.125700Z

I’m currently trying to gett some time to work on some code for inspecting/manipulating components at a REPL

lilactown 2020-06-03T15:47:41.128Z

example, imagine:

(-> (query-component MyComponent)
    (inspect))
;; => {:type MyComponent
;;     :props {:foo "bar" :baz {:asdf "jkl"}}
;;     :state [{:count 3}]}

dominicm 2020-06-03T15:51:23.128200Z

I saw the PR, I think that's great too

dominicm 2020-06-03T15:51:29.128300Z

I think different tools for different times though.

dominicm 2020-06-03T15:51:40.128400Z

Sometimes, clicky clicky is pretty handy

lilactown 2020-06-03T15:59:38.129300Z

v true. I just think that we’ve (or at least, I have) trained ourselves to eschew the REPL for UI programming due to lack of capability

lilactown 2020-06-03T16:00:48.130200Z

lots of people I’ve worked with just use console.log. and say how much they miss effectively using chrome’s debugger w/ their code

dominicm 2020-06-03T16:47:23.131400Z

I think what I'd want from the repl tool is a clicky for the element somehow. So I don't need to filter a list. But maybe that's a separate tool.

Aron 2020-06-03T18:56:16.131800Z

@lilactown may I ask which editor/repl setup are you using?

Aron 2020-06-03T18:56:43.132100Z

conjure looking really good, but I have literally no idea how to make use of it

lilactown 2020-06-03T19:04:47.132500Z

I use Emacs w/ CIDER

Aron 2020-06-03T19:12:57.132800Z

thanks

lilactown 2020-06-03T19:14:55.133500Z

specifically spacemacs

Aron 2020-06-03T19:14:58.133600Z

used to use spacemacs too, when I was writing lots of php

Aron 2020-06-03T19:15:09.133900Z

but because of javascript, I stopped using it

lilactown 2020-06-03T19:15:43.134200Z

yeah the javascript support is so-so

lilactown 2020-06-03T19:15:55.134500Z

I think if I was doing JS for a living I would probably switch back to VS Code

lilactown 2020-06-03T19:16:10.134800Z

but now that I only dabble in JS/TS it works pretty well for that too

Aron 2020-06-03T19:18:15.135300Z

vscode is for TS, not js

Aron 2020-06-03T19:19:11.136300Z

with new tools, the more I think about the more sure I am that spacemacs could work better. To be honest, the last straw was really something I lost on the long run, I wrote comma first at the time (this was before code formatters)

Aron 2020-06-03T19:47:54.136900Z

https://clojurians.slack.com/archives/CRRJBCX7S/p1591199261128000 would this work with hooks?

lilactown 2020-06-03T19:50:03.137600Z

yeah the hooks state is stored on each fiber similar to class component state

Aron 2020-06-03T20:08:00.137900Z

thanks, good to know

Aron 2020-06-03T20:08:25.138400Z

I read those fiber docs long time ago, but I forgot the details 😐

lilactown 2020-06-03T21:23:06.139100Z

there isn’t a public API for this so a lot of the stuff I’ve tried so far is just looking at what’s in the object after injecting some code similar to the way react devtools does it

lilactown 2020-06-03T21:23:17.139500Z

it’s all hacky and using private APIs that might break later

Aron 2020-06-03T21:51:36.140400Z

yeah, not very easy, but I read some of the fiber source code and it's quite readable

Aron 2020-06-03T21:51:43.140600Z

i just don't remember it 😄