Fork me on GitHub
#announcements
<
2023-12-09
>
Roman Liutikov18:12:39

Just finished hacking on a highly experimental React DevTools library that treats cljs wrappers as first class citizens. The tool currently supports UIx and Reagent components and is able to capture and list props, hooks, reactions and re-frame subscriptions. https://github.com/roman01la/cljs-react-devtools

clojure-spin 20
metal 9
🙏 4
❤️ 5
1
p-himik18:12:25

Cool! So it becomes a separate panel but within the website's view?

Roman Liutikov18:12:03

yep, not really great from UX standpoint but I also don't want to be doing all extension/bridge/message passing dance that React DevTools is doing

p-himik19:12:06

Yeah, I can see that, especially given that their extension isn't compatible with older versions of React, so you have to jump through a few hooks to have it running if you still use 17. It's great to have an ability to rely on a very particular version of a particular tool in one's workflow. But a separate panel also isn't too bad from the UX standpoint. Very similar to re-frame-10x, and it's nice to work with. Although I'm a tad biased given that I use a tiling WM that makes things like this almost automatic.

👍 1
elken19:12:10

You could maybe get away with rendering it in an iframe which would let you "eject" it

Roman Liutikov19:12:11

It would still make things harder (message passing), and also iframe is just another element on a page, it can't really "move" the page as Chrome DevTools can for example

elken19:12:47

No, but modern browsers let you move an iframe to a new window

Roman Liutikov19:12:08

ah, interesting!

elken19:12:27

eg firefox (I just found a random codepen)

p-himik19:12:55

Definitely check out how re-frame-10x does it - they got it figured out. It uses shadow DOM, can be detached into a separate window, doesn't have to pass data around.

💯 3
👀 1
Roman Liutikov09:12:09

@U2FRKM4TW re-frame-10x external window thingy worked well 👌 Didn't know a parent window can manipulate DOM in a child window, also shadow dom is nice to make sure project styles are not affecting the devtools

🙌 3
Roman Liutikov09:12:56

now have to figure out picking when in external window

p-himik10:12:47

Awesome! Looking forward to what you end up discovering and making.

juhoteperi11:12:45

I remember 10x window breaking on some reload cases, but that was long time ago. I've just used code to adjust margin in main-app element so that panel doesn't overlay the app content: https://github.com/metosin/reagent-dev-tools

👀 1
Kimo14:12:23

Did anyone get this to work on a reagent project? I got some errors so far.. https://github.com/roman01la/cljs-react-devtools/issues/1

Roman Liutikov15:12:06

I'll take a look at the repro, thanks for reporting