scittle

DerTev 2023-04-02T15:10:10.147559Z

I "download" noUiSlider with

<!-- Import noUiSlider -->
    <link rel="stylesheet" href="">
    <script src=""></script>
But when I want to require it with '["nouislider$noUiSlider" :as slider] , I get the the following error:
Could not find namespace nouislider$noUiSlider.
Any idea, why?

borkdude 2023-04-02T15:27:27.866719Z

You don’t require it in scittle, just use the global object

DerTev 2023-04-02T17:17:49.367019Z

Like js/noUiSlider ?

borkdude 2023-04-02T17:30:08.974969Z

yeah

DerTev 2023-04-02T17:30:14.414859Z

👍

DerTev 2023-04-02T17:31:26.810929Z

And is there any way to import dependencies from Clojurians? Is there smth like jsdelivr but for Clojurians? Because I would like to use https://github.com/oliyh/martian in my Project

borkdude 2023-04-02T17:32:47.102059Z

that is only possible if you include the source via a src="..." script tag and you need to include them in the right namespace dependency order

DerTev 2023-04-02T17:33:20.152059Z

So there is no jsdelivr for Clojurians?

borkdude 2023-04-02T17:33:54.753789Z

not yet :)

DerTev 2023-04-02T17:35:04.874759Z

Ok, and is there something like this planned? Or can I easily compile such a project to static JS?

DerTev 2023-04-02T17:35:18.627499Z

I think there is a way to compile lol

borkdude 2023-04-02T17:35:59.997159Z

yes, you could compile but this is not how scittle is used. for that approach you should just use regular CLJS or shadow-cljs

DerTev 2023-04-02T17:37:19.008209Z

Hm, ok

borkdude 2023-04-02T17:42:47.997319Z

Note that you don't really need jsdeliver but you can integrate sources straight from github, like this example: https://babashka.org/scittle/tictactoe.html

DerTev 2023-04-02T20:28:01.717259Z

> Like js/noUiSlider ? Using that, I get the error Uncaught TypeError: Cannot read properties of undefined (reading 'create')

DerTev 2023-04-02T20:28:47.928359Z

My code is

(.create js/noUiSlider (.getElementById js/document "slider")
                           #js {:start [20 80] :connect true :range {"min" 0 "max" 100}})

borkdude 2023-04-02T20:30:01.598019Z

This means that js/noUISlider doesn't exist

borkdude 2023-04-02T20:30:18.103589Z

can you check in the console and type no and then see if something pops up?

DerTev 2023-04-02T20:30:50.532149Z

Uh, no, there is nothing

DerTev 2023-04-02T20:31:09.421479Z

By I import it...

<!-- Import noUiSlider -->
    <link rel="stylesheet" href="">
    <script src=""></script>

borkdude 2023-04-02T20:31:23.707069Z

ok, I'll have a try...

borkdude 2023-04-02T20:32:34.562989Z

I'm getting a 404 for this one: https://cdn.jsdelivr.net/npm/nouislider@15.7.0/dist/noUiSlider.js

DerTev 2023-04-02T20:33:00.271849Z

Bruh

DerTev 2023-04-02T20:33:34.199009Z

Should work now, thanks a lot!

borkdude 2023-04-02T20:34:08.803619Z

yeah, this worked:

<!-- Import noUiSlider -->
    <link rel="stylesheet" href="">
    <script src=""></script>