Fork me on GitHub
#reagent
<
2018-04-13
>
pesterhazy09:04:57

I wish we had a playground where you can demo usage of NPM-provided React libs in the browser

pesterhazy09:04:57

Klipse has the basics but lacks polish. Maybe https://www.maria.cloud/ ?

wliao16:04:54

Hi, I'm trying to learn Reagent. Is it possible to use React Developer Tools to explore the components generated by reagent?

justinlee16:04:19

@lwlw1988 yes. reagent creates normal react components in the end

justinlee16:04:09

and you are actually able to render a page with reagent components?

wliao16:04:22

Yes, I just run a chestnut template.

wliao16:04:14

Uncaught TypeError: Cannot read property 'nativeObjectCreate' of undefined
    at Object.<anonymous> (VM3502 backend.js:708)
    at __webpack_require__ (VM3502 backend.js:20)
    at Object.<anonymous> (VM3502 backend.js:690)
    at __webpack_require__ (VM3502 backend.js:20)
    at Object.<anonymous> (VM3502 backend.js:59)
    at __webpack_require__ (VM3502 backend.js:20)
    at VM3502 backend.js:40
    at VM3502 backend.js:43
I get some errors from console, but can't really get my head around it.

justinlee16:04:21

is that the only error?

justinlee16:04:59

it’s weird that you are getting webpack errors

justinlee16:04:43

you just did lein new chestnut +reagent or something like that and then compiled it and ran on a browser?

wliao16:04:56

I added some dependencies, Im doing a fresh setup to see.

wliao16:04:01

A fresh template is OK, so I think I should try digging what wrong with those dependencies, thanks.

emccue17:04:51

what is the current "best" way to have a clojurescript project use arbitrary npm modules

emccue17:04:19

I took a break from cljs simply because it was hard to pull arbitrary react components

justinlee17:04:32

two ways: (1) use shadow-cljs, (2) use the webpack double-bundle. https://gist.github.com/jmlsf/f41b46c43a31224f46a41b361356f04d

emccue17:04:44

okay webpack double bundle was trash

emccue17:04:14

externs, basically

gadfly36117:04:26

@emccue I am reluctant to believe it is trash ..

emccue17:04:57

is there a lein template for shadowcljs?

emccue17:04:04

some sort of quick start

gadfly36117:04:57

lein new shadow-cljs your-project +reagent

justinlee17:04:19

it is true that shadow’s externs inference seems to just work

emccue17:04:00

fantastic!

emccue17:04:12

do leiningen and figwheel work?

justinlee17:04:39

lein yes, figwheel no. but it has its own hot reload system and HUD that works well

justinlee17:04:45

there’s #shadow-cljs too

emccue17:04:47

okay, now I just need to get it working with cursive

justinlee17:04:13

I’m using it with cursive so you should be fine