shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
ianchow 2020-10-08T04:08:40.338700Z

Hi, not sure if this is a shadow-cljs specific question but... I'm trying to use a js library https://github.com/tambien/Piano but am getting the error message

TypeError: Class constructor _o cannot be invoked without 'new'

(ns myapp.core
  (:require ["@tonejs/piano" :refer (Piano)]))
(Piano.)
I had set :compiler-options :output-feature-set to :es6 with no luck. Any help appreciated. Thanks.

Karol Wójcik 2020-10-08T07:03:48.339200Z

Which shadow-cljs version?

ianchow 2020-10-08T07:28:41.339400Z

2.11.4 Other npm packages seem to work fine.

thheller 2020-10-08T08:11:33.341200Z

@ianchow hard to say without full stacktrace. looks like it is something internal in the lib. not something you are actually calling from CLJS.

ianchow 2020-10-08T09:02:28.341700Z

Ah.. ok. Looks like I have to do more digging. Thanks.

Karol Wójcik 2020-10-08T11:09:07.342300Z

How can I include refactor-nrepl in shadow-cljs?

thheller 2020-10-08T11:28:13.342600Z

same as everywhere else I presume

Karol Wójcik 2020-10-08T11:31:12.342700Z

😄 Ok got it working!

Karol Wójcik 2020-10-08T11:32:37.342900Z

Last question though. What should I do to access that function? shadow.loader.load_many

Karol Wójcik 2020-10-08T11:32:54.343100Z

I'm getting: Uncaught TypeError: shadow.loader.load_many is not a function

Karol Wójcik 2020-10-08T11:33:42.343300Z

Module loader has been added to build: :module-loader true

Karol Wójcik 2020-10-08T11:46:54.343500Z

Ahh ok. It should load-multiple.

jacklombard 2020-10-08T16:22:38.347400Z

Hello I am trying to connect my chrome extension to the REPL. I can’t connect to that run time and this is the error I get in the websockets tab ["^ ","~:op","~:access-denied"] . Any help would be appreciated.

jacklombard 2020-10-08T16:23:53.348500Z

I am using binaryage/chromex and I have connected to the nrepl server and then I’ve done the (shadow/repl :extension) step where extension is the name of the build.

jacklombard 2020-10-08T16:45:14.348900Z

Nevermind I was able to resolve this

👍 1
2020-10-08T19:12:53.349500Z

Tried :es3, still no luck. IE throws exception about Object.assign.

thheller 2020-10-08T19:17:07.350Z

@jahson you could include the polyfill externally via https://polyfill.io/v3/

thheller 2020-10-08T19:18:22.351200Z

or :compiler-options {:force-library-injection ["es6/object/assign"]}

2020-10-08T19:18:46.351700Z

Yeah, but http://polyfill.io is not an option for me 🙂 Probably I will go with direct require / injection.

Karol Wójcik 2020-10-08T19:20:53.353400Z

@jahson you know that you can download full polyfill bundle?

2020-10-08T19:25:20.356400Z

@thheller Thank you for your help anyway.

2020-10-08T19:25:29.356800Z

@karol.wojcik Yeah, I've done polyfills many times in JS, just never did with ClojureScript.

2020-10-08T19:28:04.357900Z

Just wanted to make it more elegant 😉

👍 1