Fork me on GitHub
#shadow-cljs
<
2022-03-16
>
ahungry04:03:41

I'm trying to follow set up guides for both fulcro and re-frame, and I'm hitting a dead-end in both scenarios when it comes to "Having no JS environment" (even if I ensure I visit something like localhost:8200 before trying repl buffer evaluation, in fact, i visited 3 localhost domains trying fulcro that were output in terminal). If I change from build-id :main or :app to browser, I can get a successful repl call to something like (js/alert 1) to work, but can't load any files from my project template (cljs) in repl. I thought my issue may have been emacs/cider specific, but even following the guide on shadow-cljs and said binary to make a client connection presented the same failure - I tried going through the shadow-cljs documentation for that section to no avail - any idea what I may be messing up?

thheller07:03:53

@m131 sorry, don't know anything about emacs/cider. I can tell you how it works with the command line and maybe you can reconstruct what to do from there.

thheller07:03:29

when you visit the browser page that has your compiled JS loaded you should be getting a shadow-cljs ready log in the browser console

thanks3 2
thheller07:03:52

assuming for all of this that your shadow-cljs watch the-build-id process is running

Aspirational09:03:34

Hi! I am using only whitespace :optimasations and continue to recieve warnings from chrome web store about code obfuscation. Can we somehow deel with such code obfuscation? out/background.js:null:null: var cljs$cst$symbol$response = new cljs.core.Symbol(null, "response", "response", 572107335, null);...............

wombawomba12:03:45

So the shadow-cljs build reports are fantastic, but is there a way to get even more detailed info? Specifically, I'd like to know which vars are getting pulled in from a specific namespace, and what code is pulling them in.

thheller16:03:26

@dovganchin sorry, don't know what that error message means. definitely do not use :whitespace regardless though. at the very least :simple better :advanced. I doubt that is responsible for any issue you might see

thheller16:03:34

@wombawomba that info does not exist. if you want that kind of detail you can use shadow-cljs release app --pseudo-names and go browsing through the code. through pseudo names you can sort of tell where code comes from and how it got there

wombawomba16:03:13

alright, yeah, that's what I'm trying to do currently

Aspirational16:03:28

@thheller earlier I have used --pseudo-names, and it were ok, but now apparently the requirements for code readability (for chrome extension) have increased and even using :simple does not work. It looks like we can no longer use clojuresctipt in chrome extension development.

😨 1
thheller16:03:03

that sounds highly unlikely. I don't know how they define readable but every build tool I know of minimizes the code in some way

thheller16:03:02

I know they banned certain things such as eval and dynamic script loading. never head of a "readability" check

dpsutton17:03:26

“Starting today, Chrome Web Store will no longer allow extensions with obfuscated code.” and later “Thus, minification will still be allowed, including the following techniques:”

thheller17:03:25

haha thats ridicilous. but according to their description :simple should be fine

thheller17:03:25

as if a human would read that code ...

thheller17:03:52

especially whats wrong with var cljs$cst$symbol$response = new cljs.core.Symbol(null, "response", "response", 572107335, null);

thheller17:03:01

too many $ in the variable name or what? 😛

🤕 1
thheller17:03:00

you can try :compiler-options {:shadow-keywords true} in the build config. maybe its happy with that? somehow doubt that change anything but it will change that code a little bit