Fork me on GitHub
#shadow-cljs
<
2018-05-17
>
wilkerlucio00:05:38

had anyone tried to use shadow-cljs to create chrome extensions?

wilkerlucio00:05:23

I'm trying to create a developer tool there, but the connection doesn't work, it's trying to use a path relative to the extension, which ends up like this:

shadow.cljs.devtools.client.browser.js:811 WebSocket connection to '' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED

wilkerlucio00:05:48

is there a way to force the URL for the websocket to be used as localhost instead of relative to page?

wilkerlucio01:05:06

got it, closure defines 🙂

wilkerlucio01:05:08

:closure-defines {shadow.cljs.devtools.client.env/devtools-url ""}

wilkerlucio01:05:00

after more setup, new issue:

wilkerlucio01:05:02

Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:". Either the 'unsafe-inline' keyword, a hash ('sha256-8QW/FL/JEeHNL6TDE0m/ACLlRnGNJ8rr574pBcCZ1hM='), or a nonce ('nonce-...') is required to enable inline execution.

wilkerlucio01:05:15

that happens when shadow tries to reload the files

wilkerlucio01:05:32

I tried adding "content_security_policy": "'unsafe-inline'", to the manifest, but chrome doesn't allow that =/

wilkerlucio01:05:39

any ideas on how to get around that?

wilkerlucio04:05:51

another issue regarding chrome, I need to compile and run things also in content scripts, and there it's pretty hard to read content dynamically, I'm seeing by the docs that shadow doens't use other compilation modes in dev, but I really need something like :whitespace, or anything that outputs everything in a single file, is there a way to do this in dev mode?

thheller08:05:54

@lilactown this was a bug in the closure compiler. the latest shadow-cljs version has the latest closure so try that

thheller08:05:56

@wilkerlucio :devtools {:devtools-url ...} is shorter or :devtools {:use-document-host false} should also work

thheller08:05:19

hmm CSP would need the nonce. wonder if there is a way to get it

thheller09:05:18

took the default CSP rules from https://developer.chrome.com/apps/contentSecurityPolicy and added script-src: 'self' 'unsafe-eval';

thheller09:05:41

only did the basic background.js test though. that loads fine and live-reload, REPL work

wilkerlucio12:05:29

@thheller awesome! now the reload is working on background and on the devtool 🙂

wilkerlucio12:05:42

but I noticed a few things after updating (I was in 2.3.21 before):

wilkerlucio12:05:23

- my builds now seem to be starting one by one (I run 4 builds at once, so the startup got noticable slower)

thheller12:05:00

oh. yeah I know why. will fix.

wilkerlucio12:05:06

- the regular browser devcards build, it tries to use my IP directly and it didn't connected, I had to set the :devtools-url manually for it, while before it worked without setup

thheller12:05:13

hmm maybe my boolean logic failed again, will check

wilkerlucio12:05:23

and about the content-script page, you have any idea what we can do to work there?

thheller12:05:37

what is that?

wilkerlucio12:05:49

the loads seems to fail completely there, the content-script permission is weird

wilkerlucio12:05:13

in the past I used to work in dev mode using :whitespace compilation for it so it loads on a single file

wilkerlucio12:05:35

now it's just a bunch of:

thheller12:05:35

what is content-script?

wilkerlucio12:05:36

09:41:46.304 main.js:3027 GET  404 (Not Found)
(anonymous) @ main.js:3027
env.load @ main.js:3020
(anonymous) @ main.js:3065
09:41:46.306 main.js:3027 GET  404 (Not Found)
(anonymous) @ main.js:3027
env.load @ main.js:3020
(anonymous) @ main.js:3065
09:41:46.307 main.js:3027 GET  404 (Not Found)
(anonymous) @ main.js:3027
env.load @ main.js:3020
(anonymous) @ main.js:3065
09:41:46.307 main.js:3027 GET  404 (Not Found)
(anonymous) @ main.js:3027
env.load @ main.js:3020
(anonymous) @ main.js:3065
09:41:46.308 

wilkerlucio12:05:54

content-script is when you want a chrome extension to inject code in the user page

wilkerlucio12:05:09

on manifest.json is like this:

wilkerlucio12:05:10

"content_scripts": [
    {
      "matches": ["<all_urls>"],
      "js": ["js/content-script/main.js"],
      "run_at": "document_start"
    }
  ],

thheller12:05:50

hmm dev mode will probably not work for this

wilkerlucio12:05:11

I wrote some about it in the past, because figwheel also didn't worked good for it: https://medium.com/@wilkerlucio/setting-up-figwheel-for-chrome-extensions-content-scripts-f1631d8e782a

thheller12:05:24

we really need to control the global scope for the devtools stuff

wilkerlucio12:05:28

I wasn't sucessful on making it work proper, but there is some info about loading there

thheller12:05:20

just to clarify: this is for javascript that will be injected into any random page? meaning pages not written by you?

thheller12:05:45

yeah :dev builds will never be reliable for this

thheller12:05:50

:release is probably the only safe thing for this

thheller12:05:18

I could add a :dev thing that only outputs a single file so the debug loader is not used

thheller12:05:27

but live-reload or REPL will never work properly

thheller12:05:23

you can get lucky and have it work but it won't be reliable or even safe

wilkerlucio12:05:27

ok, it's reasonable, because currently it just doesn't work as dev at all, I would have to manually re-trigger a release everytime on every update

wilkerlucio12:05:41

if we can it just re-compiling in a single file automatically, would help a lot

wilkerlucio12:05:29

but I'm wondering, why can't the REPL work there?

thheller12:05:04

during dev mode it assumes that YOU own the global scope

thheller12:05:36

meaning it creates a bunch of global variables, eg. cljs, goog and so on

thheller12:05:01

when injected into the page you do not own the global scope so the potential for conflicts is high

thheller12:05:20

what are you trying to do?

thheller13:05:38

its also a bit scary since you are technically giving the page you inject into access to your REPL

thheller13:05:18

suppose your plugin injects into a page that is running a dev build

thheller13:05:25

your code would replace the actual page code

thheller13:05:31

and everything would explode

wilkerlucio13:05:37

but on content scripts you kind have your own context, and you can inject those variable and reliably access then

wilkerlucio13:05:13

I'm making a fulcro-inspect version that runs on chrome ext / electron

thheller13:05:25

I thought the scripts are injected? ie eval'd in the page?

wilkerlucio13:05:39

so the content-script will have to hook into the fulcro tools to send information to the remote ui (that will be in a chrome devtool/electron)

wilkerlucio13:05:49

they are, but they have a special context

wilkerlucio13:05:53

Although the execution environments of content scripts and the pages that host them are isolated from each other, they share access to the page's DOM.

thheller13:05:13

ah so they are isolated

thheller13:05:26

ok thats fine then

thheller13:05:59

ok then scratch everything I said.

wilkerlucio13:05:18

sorry I wasn't clear before, it's been a while I read that, so yeah, separated envs, shared DOM

thheller13:05:13

hmm whats the minimum of config I need for this?

thheller13:05:41

will need a test setup for this otherwise I'd just be guessing

wilkerlucio13:05:33

this should be fine on manifest:

wilkerlucio13:05:34

"content_scripts": [
    {
      "matches": ["<all_urls>"],
      "js": ["js/content-script/main.js"],
      "run_at": "document_start"
    }
  ],

wilkerlucio13:05:44

that will make the script run on every page

wilkerlucio13:05:12

for compilation I currently have this:

wilkerlucio13:05:13

:chrome-content-script {:target          :browser
                                        :output-dir      "shells/chrome/js/content-script"
                                        :asset-path      "js/content-script"
                                        :closure-defines {:devtools-url ""}
                                        :modules         {:main {:entries [fulcro.inspect.chrome.content-script.main]}}}

thheller13:05:48

ok this should be easy

thheller13:05:11

the :browser config is not really suited for this though

thheller13:05:19

it appears that I must reload the chrome extension before it uses any updated code

thheller13:05:24

or am I doing something wrong?

thheller13:05:03

@wilkerlucio how important is "run_at": "document_start" to you? would document_idle be enough?

wilkerlucio14:05:54

@thheller I don't know yet, was just setting up the env, maybe document_idle will be enough

wilkerlucio14:05:01

is there a roadblock with document_start?

thheller14:05:32

nah not really. currently the debug loader tries to be smart and checks if it can use document.write to load scripts

thheller14:05:51

with document_start that is true

thheller14:05:59

but that causes the scripts to load in your the ppage

thheller14:05:03

not in the isolated context 😛

wilkerlucio14:05:26

hehe, maybe we can have a flag for it

wilkerlucio14:05:36

so we can override on content-script case

thheller14:05:38

with document_idle the check fails and it then does the usualy async load + eval

thheller14:05:53

yeah adding that currently

🆒 4
zarkone14:05:43

Hi! trying to do release build of project. Got this output for :target :node-script:

var shadow$provide = {};
#!/usr/bin/env node
(function(){
...

thheller14:05:12

@zarkone which version are you one? I thought I fixed that

zarkone14:05:35

oh, sorry, forgot to checkout. I'm on something-recent-11

zarkone14:05:54

will now try to update, thanks!

kenny14:05:44

Are macros supposed to work with shadow-cljs node-repl?

thheller14:05:21

using macros or actually writing defmacro? using yes, writing no.

kenny14:05:57

Is there a way to write macros in node?

kenny14:05:36

Not in node but to be used in node.

kenny14:05:08

My use case is I'd like some computation to be done at compile time and statically defined in the app.

thheller14:05:13

its the same deal as with any other macro for CLJS

thheller14:05:19

they need to be written in CLJ

kenny14:05:30

Right but I can't get it to work with node-repl.

thheller14:05:34

you could write them in shadow-cljs clj-repl

thheller14:05:50

you can't write them inside node-repl since that is a CLJS repl

kenny14:05:17

Oh I see. So I need to run two REPLs?

kenny14:05:00

It confused me because when developing my browser application I am able to write and use macros by default.

thheller14:05:25

hmm? the rules for the browser are identical?

thheller14:05:04

not how that works

thheller14:05:15

(ns shadow-macros.core
  (:require
    [shadow-macros.macros :include-macros true :as macros]))

zarkone14:05:16

@thheller thanks! got rid of this error.

thheller14:05:31

this will try to load shadow-macros/macros.cljs AND the .clj file

thheller14:05:39

since only the .clj file exists this fails

zarkone14:05:48

also, getting this with release build:

------ WARNING #1 --------------------------------------------------------------
 File: com/cognitect/transit.js:649:8

 variable module is undeclared
--------------------------------------------------------------------------------

------ WARNING #2 --------------------------------------------------------------
 File: com/cognitect/transit/impl/writer.js:256:8

 variable isObject is undeclared
--------------------------------------------------------------------------------

------ WARNING #3 --------------------------------------------------------------
 File: com/cognitect/transit/types.js:384:70

 variable Buffer is undeclared
--------------------------------------------------------------------------------


thheller14:05:18

@zarkone yeah disregard those ... they aren't used anyways

kenny14:05:45

I believe I also tried just :require-macros and that did not work either.

thheller14:05:15

@kenny the macros example I made is how you should setup macros

thheller14:05:27

meaning you write a .cljs file and .clj file with the same name

thheller14:05:37

and the cljs file does a require-macros for itself

thheller14:05:02

NEVER do dedicated .macros namespaces. thats just makes things more confusing

zarkone14:05:13

@thheller just haven't seen this warnings with boot-cljs and :advanced optimizations. Trying to figure out why some parts of my code in release silently doesn't work 🙂 Thank you!

thheller14:05:35

@zarkone boot probably doesn't have those checks enabled

zarkone14:05:40

right, that might be the case: haven't seen default params enabled in boot for cljs compilation

thheller14:05:55

@kenny taking my macros example you would write your macro in the app/lib.clj

thheller14:05:13

and then use it from app/main.cljs

thheller14:05:41

your example tries to skip the "additional" .cljs file but it is very important to have that

thheller14:05:49

do not try to shortcut your way out of that

kenny14:05:19

I had no idea that was a requirement.

thheller14:05:38

it is not a requirement but it saves you from dealing with :require-macros or :include-macros all over the place

thheller14:05:43

getting those correct is just a nightmare

kenny14:05:50

I totally agree.

thheller14:05:00

with the recommended setup you do :require-macros ONCE and only to require itself

thheller14:05:18

no-one else ever needs to to know about macros at all

kenny14:05:39

Wait so I don't even need to :include-macros then?

thheller14:05:25

clean and simple

thheller14:05:11

@zarkone CLJS by default doesn't enable those checks either. its just something shadow-cljs does. if you want to find out why things don't work shadow-cljs check your-build might help

kenny14:05:49

Yep that works. Wow, that clears a lot up. Thank you. I think this bit of information is important enough to include in the documentation somewhere.

zarkone14:05:15

@thheller oh, thanks a lot! will try it out

thheller14:05:31

is that not documented anywhere else? this has been in CLJS for a couple of years

kenny14:05:50

I don't think I've read anywhere about a "suggested" pattern.

thheller14:05:56

I always wonder why people still do the old way

thheller14:05:29

are there any official macro docs?

kenny14:05:14

There's this https://clojurescript.org/guides/ns-forms. But doesn't really suggest a pattern.

kenny14:05:45

I'd even argue that makes things more confusing because it introduces you to all the different ways you can use macros 🙂

thheller14:05:55

I guess its mentioned under Implicit Sugar

zarkone14:05:56

@thheller actually, I've known that I can get rid of :require-macros from recent defn podcast where you've talked about it 😄

thheller14:05:10

but yeah super confusing that its not mentioned as the first and only thing

kenny14:05:34

Exactly. That's what it needs. I don't have any reason to care about all that other stuff.

zarkone14:05:35

btw, was really good episode

thheller14:05:12

it was fun! a bit all over the place but fun. 🙂

kenny14:05:58

Is there a technical reason why the dummy CLJS ns can't be created behind the scenes?

kenny14:05:35

That may be what your issue there is talking about?

kenny14:05:07

No that's different.

thheller14:05:44

the CLJS ns serves several purposes

thheller14:05:57

you can write actual CLJS code there that you macros might want to use

thheller14:05:19

and if you want to emit code that uses other namespaces the CLJS ns can require those to ensure they are loaded

thheller14:05:25

since .clj files can't require CLJS files

kenny14:05:44

Sure but I may not have either of those requirements.

thheller14:05:50

technically it could generate a simple version if only a clj file exists yes

thheller14:05:04

but thats kinda dangerous since ANY clojure namespace can then be loaded that way

thheller14:05:59

in practice it is not a problem to create that simple .cljs file

kenny14:05:39

That's true. What is the danger in being able to load and CLJ namespace?

thheller14:05:39

confusion mostly

thheller14:05:03

people might end up trying to use random CLJ libraries and wonder why they don't work

thheller14:05:09

happens often enough as it is

kenny14:05:49

That's fair enough

kenny14:05:07

Thanks for the help!

thheller15:05:06

@wilkerlucio the problem with a single output file is source maps. debugging without those is horror but they get waaaaaaaaaaaaay too large and slow

thheller15:05:43

wonder if that could be improved somehow

wilkerlucio15:05:02

@thheller yeah, not cool, after those changes is the regular :none working?

thheller15:05:41

I'm playing with a coupe different approaches currently

thheller15:05:00

a) output files like browser, load async over network

thheller15:05:13

b) output files like brower, load via document.write

thheller15:05:22

c) output one file

thheller15:05:56

a) sucks because certain lifecycle events fire before the code is loaded eg. chrome.runtime.OnInstalled

thheller15:05:22

b) sucks because chrome complains and you must reload browser extension manually on each code change

thheller15:05:43

live-reload works though

thheller15:05:52

c) seems best but source map gen is too slow 😞

thheller15:05:37

there is this trick webpack and others do to just use eval + sourceURL

thheller15:05:42

but that feels so dirty 😛

wilkerlucio15:05:33

gotcha, thanks for the clarification, this is a tricky one

jjttjj15:05:29

How do prevent the clojure.spec exception from being thrown due to the non-conforming NS form from the JS string requires? I'm trying :jvm-opts ["-Dclojure.spec.compile-asserts=false"] in shadow-cljs.edn but it's not seeming to be working. is there a standard way to address this?

thheller15:05:10

@jjttjj which error? invalid ns forms are never allowed?

thheller15:05:32

the asserts can't be disabled since the ns form would be invalid

jjttjj15:05:32

getting a massive spec error relating to an invalid NS form when I try to eval the NS form in the repl. It works fine outside of the repl connection. I assumed this was due to the (:require ["js-lib" :as js-lib"] ...) string form causing issues but I could be wrong

thheller15:05:07

massive spec error where? are you trying to eval this in CLJ?

thheller15:05:48

CLJS REPL should work fine for this but you might be trying to eval this in CLJ which won't work

jjttjj15:05:40

doh! yup that was it, thanks!

thheller15:05:23

@wilkerlucio I will think about this for a bit. you can get it sort of working now by setting

:chrome-content-script
  {:target :browser
   :output-dir "shells/chrome/js/content-script"
   :asset-path ""
   :modules {:main {:entries [fulcro.inspect.chrome.content-script.main]}}
   :devtools
   {:devtools-url ""
    :http-root "shells/chrome/js/content-script"
    :http-port 8020}}

thheller15:05:44

but must use document_idle for now

thheller15:05:44

:browser is complete overkill for this though.

:chrome-ext
  {:target :chrome.content-script
   :output-to "out/chrome-ext/background.js"
   :entry demo.chrome-bg}

thheller15:05:50

this is better 😉

wilkerlucio16:05:04

@thheller thank you very much for looking so quickly on it, I’ll try those as soon as I get home today

thheller16:05:19

@wilkerlucio good timing I guess since I wanted to try some ideas for a chrome extension for shadow-cljs anyways 🙂

🙂 4
😍 4
theeternalpulse16:05:20

in the beginner's tutorial https://medium.com/@jiyinyiyong/a-beginner-guide-to-compile-clojurescript-with-shadow-cljs-26369190b786 It mentions you have to link the index.html to the target folder. Is there a way to do this as part of the build process in the shadow-cljs.edn file?

lilactown17:05:58

@thheller I'm still seeing the Uncaught TypeError: Cannot call a class as a function error in shadow-cljs 2.3.22

lilactown17:05:52

upped to 2.3.23, same issue

wilkerlucio17:05:40

@thheller the version with the chrome updates is released?

lilactown17:05:09

I think that for now, I can just delete the _classCallCheck(this, Source); from the source of the npm module

lilactown17:05:05

is there a way for me to vendor the npm module outside of node_modules/? I see that I can redirect what it resolves to, but the only options I see are either :global or :npm. I'd like to stick it in another dir that I can commit to source control

thheller19:05:57

@lilactown what was your error again?

thheller19:05:55

oh wait .. it was graphql right?

thheller19:05:14

that is not actually a closure issue

thheller19:05:22

maybe not though .. the error was different https://github.com/thheller/shadow-cljs/issues/248

thheller19:05:01

this should be fixed in closure 20180506. maybe you have an older closure dependency?

thheller19:05:52

as for npm fixing I would suggest taking the node_modules/graphql directory and publish it under @lilactown/graphql or so

thheller19:05:20

then :resolve {"graphql" {:target :npm :require "@lilactown/graphql"}}

theeternalpulse22:05:19

Ah thanks, it is linked in the main website, so I figured it was recommended. Also there's a discrepancy in the namespaces created and built in that article

Jon13:05:28

would you suggest any fix? I can update those contents.

thheller19:05:09

that just has a public/index.html that doesn't need to be moved or anything

wilkerlucio19:05:23

@thheller sorry bothering, I can't find the updates with the chrome things, did you pushed those?

thheller19:05:48

@wilkerlucio which updates? I didn't release anything related to that yet no

thheller19:05:49

just got back home. will fiddle around with it some more now

wilkerlucio20:05:03

ah, gotcha, no worries, I just had assumed you pushed, my bad

thheller20:05:00

the config I posted doesn't work? the :browser one?

thheller20:05:47

hehe I can crash chrome by pressing ctrl+shift+e trying to profile my background page 😛

lilactown20:05:22

Would it matter if I had clojurescript in my lein deps? I'm using the lein integration

lilactown20:05:38

Regarding the version of closure I'm usinf

thheller20:05:20

just check with lein deps :tree

thheller20:05:23

and yes that would matter

thheller20:05:39

depending on the order of your deps

wilkerlucio20:05:17

didn't tried yet, still not home, was just trying to check it before you might go sleep 🙂

lilactown20:05:30

Ok I'll check when I'm back at my computer 😁

wilkerlucio20:05:39

when you announced the :target :chrome.content-script I though it was out

thheller20:05:02

nah need to sort out the source map issue first

thheller20:05:34

@wilkerlucio just pushed the basic version in master

thheller20:05:53

:chrome-bg
  {:target :chrome-extension
   :output-to "out/chrome-ext/background.js"
   :entry demo.chrome-bg}

  :chrome-content
  {:target :chrome-extension
   :output-to "out/chrome-ext/content-script.js"
   :entry demo.chrome-content}

thheller20:05:09

but no live-reload or REPL support yet

wilkerlucio20:05:26

cool, but isn't the background settings different from the content-script one?

wilkerlucio20:05:41

I mean, the background and devtools parts were working perfectly here

thheller20:05:54

yeah you can stick with :browser for that one

thheller20:05:30

but :browser does a lot of stuff that the chrome ext will never use

thheller20:05:43

but if it works for you just stick with that for now

thheller20:05:00

still just messing arround

wilkerlucio20:05:17

hum, so the plan is for :chrome-extension for all, I would guess content-scripts would have a different setting compared to background/popups/devtools, I guess we will figure that soon

thheller20:05:47

I need to check which capabilities the chrome ext itself has

thheller20:05:14

seems like its a bunch of different ways to execute scripts

thheller20:05:31

not sure they all run in the same runtime or are isolated from each other and so on

wilkerlucio20:05:23

yeah, sometimes chrome forces you do make a lot of round before doing something, what you can do in background is different from what you can do on a popup page, that's also different from a content-script...

thheller20:05:09

a different build for each seems like a bit of overkill but probably the only option

thheller20:05:24

one build means only one live-reload/REPL

wilkerlucio20:05:50

for compilation I think 2 should suffice, one for content-script, and another for the rest

wilkerlucio20:05:10

because the content-script is the one that has a bit difference in security things

wilkerlucio20:05:25

the other ones vary mostly on which chrome API's you can access, but that's not a compilation concern

thheller20:05:44

I thought you wanted a REPL in the content-script?

thheller20:05:51

and background

wilkerlucio20:05:08

but the REPL for background and pages is working already, isn't it?

thheller20:05:55

bugs me a bit that the browser target does so much more stuff we don't need

thheller20:05:21

if I can sort out this source map issue then all targets could technically use the simplified :chrome-extension

wilkerlucio20:05:35

what kinds of things the :browser does that we don't need there?

thheller20:05:35

generating manifest stuff

thheller20:05:02

output wrappers

thheller20:05:10

some code gen could be simplified

thheller20:05:31

bunch of small stuff really .. but just the config alone could be easier

thheller20:05:57

browser target code is 700+ lines

thheller20:05:05

chrome ext could be 60 or so

thheller20:05:27

less moving parts, easier to debug

thheller20:05:47

if it wasn't for this damn source map issue I'd be done already

thheller20:05:01

another option would be to rewrite the manifest.json

thheller20:05:10

and just automatically add the scripts

thheller20:05:18

> The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array.

thheller20:05:53

it already takes a list of files so I could update those

wilkerlucio20:05:11

the problem is happening now is at initial load, or to refresh code after?

thheller20:05:56

which problem? the only problem currently is no source maps

wilkerlucio20:05:01

yeah, that one 🙂

wilkerlucio20:05:14

so there are no source-maps at all?

thheller20:05:15

:chrome-extension generates a single file

thheller20:05:26

generating a source map for that single file takes 500ms+

thheller20:05:29

since its huge

thheller20:05:39

too slow for watch

thheller20:05:57

and can also take quite a while to load in chrome itself

thheller20:05:48

I think the manifest edit option might be best

thheller20:05:16

difficult to coordinate though when running 2+ builds

thheller20:05:33

don't want to deal with file locking and such

wilkerlucio20:05:48

does that solve the problem on reloading code after?

thheller20:05:21

not related to that at all. that all works without issues in theory. didn't enable it yet

thheller20:05:48

the reloading problem is solved though by adding the script-src 'unsafe-eval'

thheller20:05:07

that probably won't change since we need eval

wilkerlucio20:05:34

yeah, and that's fine

wilkerlucio20:05:03

would be nice to do some changes before releasing, but that is a deploy process problem

thheller21:05:33

:flush (362 ms) with index map with only cljs.core

thheller21:05:45

definitely not an option

thheller21:05:27

:flush (9 ms) without any maps

thheller22:05:33

@wilkerlucio master now has source maps and REPL but not live-reload doesn't work

thheller22:05:57

but only the slow source maps so its not very practical

thheller22:05:22

will do some more digging after sleep

wilkerlucio22:05:21

thank you very much, I just got home, so time to try and hack 🙂

lwhorton22:05:56

does shadow yet support continuously running tests? i know that’s not a … flavor… that people in the clj world like, but it would ease a lot of my coworker’s anxieties

lwhorton22:05:11

looks like the default node target just spits out a file, then you can run it with node automatically with :autorun . i could probably setup some node watcher to keep reading that file for changes and rerun on change, but I dont want to duplicate effort

thheller22:05:26

@lwhorton :autorun is specifically only for :node-test? what else do you mean?

lwhorton22:05:29

i mean that if I run shadow compile test with :autorun true it will launch the node ./out/node-tests.js and spit the results, but then the node process dies… is there a built in way to keep rerunning that node command every time node-tests.js changes?

thheller22:05:44

shadow watch test

🎉 4
thheller22:05:08

but no the node process will exit every time

thheller22:05:33

re-using that is currently not supported

lwhorton22:05:52

that’s exactly what i was looking for, i’m just being stupid (forgot watch was a thing)

wilkerlucio22:05:04

@thheller I tried adding the content script here now, it loads, but I'm getting errors: https://www.dropbox.com/s/hevvi7n2lps765i/Screenshot%202018-05-17%2019.56.34.png?dl=0

wilkerlucio22:05:55

ps: I'm using the .23 version yet, not sure how to use it shadow from master

thheller22:05:26

yeah thats the conflict stuff I mentioned. your injected code "replacing" the actual code in the page

thheller22:05:32

so they conflict with each other

thheller22:05:43

to try master just clone it and run lein install

wilkerlucio22:05:55

ah, I'm using from the npm run version

wilkerlucio23:05:42

I was reading the code on repo, I guess you do some scripting to make a release (because trying to install directly from git didn't work, there is no package.json on the root)

thheller23:05:05

you should just need lein install

thheller23:05:16

don't mess with the npm stuff. it is not required.

wilkerlucio23:05:09

so I just override my local version, right?

wilkerlucio23:05:23

I see it still compiles one by one, would you like me to create an issue so we don't forgot about the paralell initial compilation?

thheller23:05:50

yeah, forgot already 😛

wilkerlucio23:05:11

[:chrome-content-script] Build failure:
invalid require
{:entry [fulcro.inspect.chrome.content-script.main]}
ExceptionInfo: invalid require
	clojure.core/ex-info (core.clj:4739)
	clojure.core/ex-info (core.clj:4739)
	shadow.build.resolve/resolve-require (resolve.clj:492)
	shadow.build.resolve/resolve-require (resolve.clj:482)
	shadow.build.resolve/resolve-entry (resolve.clj:496)
	shadow.build.resolve/resolve-entry (resolve.clj:495)
	clojure.lang.PersistentVector.reduce (PersistentVector.java:341)
	clojure.core/reduce (core.clj:6747)

wilkerlucio23:05:22

the :entry is to be a namespace, right?

thheller23:05:23

just the symbol

thheller23:05:27

not in a vector

thheller23:05:00

final version will have specs for that but didn't add those yet 😉

wilkerlucio23:05:23

yeah, I tried to be smart and just move the code, that's what I get, hehe