Fork me on GitHub
#shadow-cljs
<
2019-03-03
>
mhuebert12:03:56

hmm. now I am getting errors like Uncaught ReferenceError: $spark_web$views$account$index$index$$ is not defined. this is happening after the module loads, which I verified by adding a logging statement via :append. I can see in the source of the account module that it is defining that thing, function $spark_web$views$account$index$index$$($var_args$jscomp$814$$) {...}, but it isn’t being set on the window object. if I manually add this line below it, window.$spark_web$views$account$index$index$$ = $spark_web$views$account$index$index$$;, then it loads correctly.

mhuebert12:03:37

I tried setting :output-wrapper false, didn’t seem to have an effect

mhuebert12:03:49

maybe there is something weird with how my functions are being defined

thheller12:03:17

@mhuebert yeah I discovered that bug yesterday

thheller12:03:45

for now set :compiler-options {:language-out :ecmascript5} in your build config. I'll finish a release later that adds that default back.

thheller12:03:32

the issue is that GCC defaults to strict mode so the function declared in the module files isn't visible globally

thheller12:03:51

ie. the files start with "use strict"; when they shouldn't

thheller12:03:14

it should work with :output-wrapper true though

mhuebert12:03:08

@thheller it works with that ecmascript setting. I might have put :output-wrapper in the wrong place

mhuebert12:03:16

:compiler-options

mhuebert12:03:33

oh nevermind I think misunderstood what you were saying

thheller12:03:20

yeah false won't work. true should.

thheller12:03:36

if defaults to false when using multiple modules

mhuebert12:03:03

i see that the warnings about module entries being moved have been improved

mhuebert12:03:41

this new setup feels much cleaner than before

austinbirch13:03:09

Hello all, does anybody know a workaround to only trigger a download of deps.edn dependencies whilst this issue is still open: https://github.com/thheller/shadow-cljs/issues/362? I’m sure I’ve read something somewhere about triggering a download of dependencies for deps projects, but can’t seem to find it.

thheller14:03:03

@austinbirch you can just add shadow-cljs to your deps.edn and use clj to download the deps. clj -Stree or so

austinbirch14:03:23

@thheller ah, okay. That works - thanks very much.

beders15:03:48

Has someone been able to successfully use atlaskit components with shadow-cljs? (see https://atlaskit.atlassian.com/packages/core/global-navigation ) I'm hitting a

You probably need to run:
  npm install querystring
caused by a dependency:
node_modules/url/url.js
And I'm not sure how I can troubleshoot it. I installed querystring, but the problem is not going away. querystring has a regular index.js which seems to be the top level module.

✔️ 4
beders16:03:26

Solved adding this to a build:

:js-options {:resolve {"querystring" {:target :npm
                                                    :require "querystring/index.js"}}}

thheller17:03:37

no. you need to add shadow-cljs to your package.json.

thheller17:03:44

its one of those packages that is overriden by https://github.com/webpack/node-libs-browser

sveri15:03:58

@thheller Hi Thomas, first of all, thanks for the awesome work. In case you got some time, I just created this issue: https://github.com/thheller/shadow-cljs/issues/453 and I am here for today if you want me to try some things out 🙂

minhnn16:03:08

how to change namespace in cljs.user

thheller17:03:12

in the REPL I assume? (require 'some.other.ns) then (in-ns 'some.other.ns)

p-himik20:03:54

@thheller Thanks for the new article on code splitting! It's good to have an overview of this functionality. In the article, you mention shadow.lazy but it's not actually used anywhere. Also, demo.util/lazy-component is used but there's no implementation. Is this an exercise for the reader or will there be any addition to the article? I saw the code splitting example in your examples repo but it's very simplistic and doesn't have anything about lazy loading components.

thheller20:03:34

the article is still in progress. I'm finishing things right now and will publish the full example with code

thheller20:03:15

meant to only publish the draft without making it public yet but did it wrong 😉

thheller20:03:25

I'll ping you once I finished it

bmo 5
p-himik09:03:39

Awesome, thanks!