Fork me on GitHub
#scittle
<
2023-04-02
>
DerTev15:04:10

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?

borkdude15:04:27

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

DerTev17:04:26

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

borkdude17:04:47

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

DerTev17:04:20

So there is no jsdelivr for Clojurians?

DerTev17:04:04

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

DerTev17:04:18

I think there is a way to compile lol

borkdude17:04:59

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

borkdude17:04:47

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

DerTev20:04:01

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

DerTev20:04:47

My code is

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

borkdude20:04:01

This means that js/noUISlider doesn't exist

borkdude20:04:18

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

DerTev20:04:50

Uh, no, there is nothing

DerTev20:04:09

By I import it...

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

borkdude20:04:23

ok, I'll have a try...

DerTev20:04:34

Should work now, thanks a lot!

borkdude20:04:08

yeah, this worked:

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