shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
ianchow 2020-10-22T04:37:32.077600Z

Hi, would appreciate if anyone could try to use this npm module @tonejs/piano https://www.npmjs.com/package/@tonejs/piano using shadow-cljs to see if the error is just on my end. Trying to instantiate a Piano object using (Piano.) results in TypeError: Class constructor _o cannot be invoked without 'new' and I can't figure out how to debug it.

AJ Jaro 2020-10-22T11:37:27.081Z

When I execute a build for shadow-cljs, there are still some :infer-warnings that get displayed. The default for this type of warning is false and there is no change in behavior when I add the additional compiler-option to set that warning type to false. Why are there some :infer-warning types that still display during the build even though the option is turned off by default or explicitly?

------ WARNING #22 - :infer-warning --------------------------------------------
 File: /ui/components/team.cljs:78:77
--------------------------------------------------------------------------------
  75 |            [:input {:placeholder "Username"
  76 |                     :value       username
  78 |                     :on-change   #(rf/dispatch-sync [::changeusername (.-target.value %)])}]
-----------------------------------------------------------------------------------^
 Cannot infer target type in expression (. p1__110681# -target.value)

thheller 2020-10-22T12:43:32.081400Z

@ajarosinski use (.. % -target -value) and the warning should go away?

thheller 2020-10-22T12:43:49.081800Z

surprised .-target.value even works at all

AJ Jaro 2020-10-22T12:58:58.081900Z

Thanks. I couldn’t get this interop to work but I got something similar to get the build behavior to change.

AJ Jaro 2020-10-22T12:59:01.082100Z

Thanks!

JAtkins 2020-10-22T18:58:20.085Z

Any idea how the wrong version of an npm dep would end up used by shadow? I just upgraded sweetalert2 from v9 to v10 in package.json, and I verified that project/node_modules/sweetalert2 contains the published code for v10. I cleared everything from the :output-dir and :asset-path. However, after a shadow restart and compile, I see the code for sweetalert2 v9 in the :output-dir again...

JAtkins 2020-10-22T18:58:47.085500Z

Oh, and I did check, ~/node_modules doesn't have any cached version of sweetalert

thheller 2020-10-22T19:08:59.086Z

try deleting .shadow-cljs/builds. thats the cache maybe something is confused

AJ Jaro 2020-10-23T12:21:17.092200Z

@thheller I’ve found this particular flow a challenge when upgrading dependencies as well. It seems like this is required whenever a dependency is changed. Do you know of a better way to ensure the shadow-cljs build is updated when upgrading dependencies other than deleting builds?

thheller 2020-10-23T13:08:56.092400Z

I haven't deleted builds in years so I don't have a clue what you are doing that makes this necessary

thheller 2020-10-23T13:09:05.092600Z

if you have a reproducible case please open an issue

thheller 2020-10-23T13:09:46.092800Z

which shadow-cljs version is this?

AJ Jaro 2020-10-29T01:18:18.194200Z

@thheller This is in 2.11.4. I’ll try to make a reproducible case so we can investigate further

JAtkins 2020-10-22T19:28:07.086200Z

ah, missed that one

JAtkins 2020-10-22T19:42:04.086500Z

@thheller many thanks, that worked.

Александр Стоянов 2020-10-22T23:39:48.087500Z

Hello! How can i run backend in re-frame template?

thheller 2020-10-22T23:41:13.087900Z

better ask in #re-frame. shadow-cljs only handles CLJS stuff.