Fork me on GitHub
#shadow-cljs
<
2018-11-24
>
richiardiandrea00:11:36

@thheller should be that one, let me try that

richiardiandrea00:11:38

actually it might be something else...I mainly want to instrument even if release

manuel08:11:21

I have [refactor-nrepl "2.4.0"] in my shadow-cljs.edn, I am connected to the nREPL server started by shadow-cljs watch via cider-connect and (shadow/nrepl-select my-app). When I try to do M-x cljr-clean-ns in a CLJS file, I get this: user-error: The refactor-nrepl middleware isn’t available! Did you remember to install it? Am I missing something?

thheller08:11:30

@manuel guess you need to configure the middleware

thheller08:11:43

:nrepl {:middleware [refactor-nrepl.middleware/wrap-refactor]}

manuel08:11:58

@thheller you mean add that to shadow-cljs.edn?

manuel08:11:11

@thheller works like a charm. Thank you!

achikin21:11:03

Can I serve release build with the built-in development server?

thheller21:11:46

in actual production or just for testing locally?

achikin21:11:44

For testing locally.

thheller21:11:57

its just serving files so yeah you can use it

thheller21:11:23

it will be started automatically when a server is running, eg. npx shadow-cljs server

thheller21:11:41

no watch needs to be running

achikin21:11:45

I want to experiment with :js-options {:js-provider :closure}

achikin21:11:49

Thank you!

thheller21:11:15

good luck πŸ˜›

thheller21:11:35

I gave up a long time ago. too many packages just don't work πŸ˜›

achikin21:11:54

I have a few. react, material-ui and some react components.

thheller21:11:23

react sort of works. most components don't

thheller21:11:38

especially everything rewritten by babel

achikin21:11:53

I've just run shadow-cljs check app and got a bunch of warnings. All of them come either from cljs.core or from reagent - is that expected?

thheller21:11:30

something about Java from cljs.core yes that is expected

thheller21:11:34

reagent not sure?

achikin21:11:36

------ WARNING #28 -------------------------------------------------------------
 File: ~/.m2/repository/org/clojure/clojurescript/1.10.439/clojurescript-1.10.439.jar!/cljs/core.cljs:10520
 actual parameter 2 of goog.object.set does not match formal parameter
found   : (string|symbol)
required: string
--------------------------------------------------------------------------------

achikin21:11:11

------ WARNING #31 -------------------------------------------------------------
 File: ~/.m2/repository/reagent/reagent/0.8.1/reagent-0.8.1.jar!/reagent/impl/component.cljs:296:33
 Property _reactInternalInstance never defined on G__2678
--------------------------------------------------------------------------------

thheller21:11:17

hmm yeah the reagent one will probably get renamed without externs

thheller21:11:42

the goog.object.set is due to an outdated closure library I think

thheller21:11:48

it hasn't been updated in ages

thheller21:11:02

but won't cause issues

thheller21:11:28

check unfortunately is not very useful sometimes

achikin21:11:55

> hmm yeah the reagent one will probably get renamed without externs Do I need to provide externs for reagent?

achikin21:11:14

I mean react πŸ™‚

thheller21:11:54

hmm no I guess not

thheller22:11:27

hmm guess those are all fine

achikin22:11:32

Thank you! Everything seems to be working under release πŸ™‚

thheller22:11:44

with :closure?

achikin22:11:19

No, without :closure

achikin22:11:13

Just tried :closure. main.js is 95kb instead of 98kb with :shadow, nothing is rendered due to minified react error. And it was just react + material-ui with a single button rendered on the screen.

achikin22:11:38

You were right - it's not worth it πŸ™‚

thheller22:11:46

yeah material-ui is a terrible package when it comes to :advanced

lilactown22:11:30

> material-ui is […] terrible

souenzzo23:11:09

some recommendation for a CSS noob?