scittle

Chris McCormick 2024-12-19T20:14:50.106769Z

I'm trying the new js/import and I get undefined if I log js/import to the console. I'm using the latest build - https://github.com/babashka/scittle/commit/6c3b5f56880142b6cf6f45e81ccd6da7749b71f6.

✅ 1
Chris McCormick 2024-12-21T10:40:26.267029Z

I figured it out - it's when I use 'latest' as the version: https://cdn.jsdelivr.net/npm/scittle@latest/dist/scittle.min.js

Chris McCormick 2024-12-21T10:44:02.584809Z

Lol infuriatingly it now works. I must have had a cached version or something. Sorry for the noise.

Chris McCormick 2024-12-21T10:44:15.543229Z

I guess this is a disadvantage of using @latest. 🤔

👍 1
Chris McCormick 2024-12-21T10:54:29.675099Z

Set up a test importing virtual-audio-graph from CDN from inside CLJS and it works great! Thanks for adding this. 🙏

🎉 1
borkdude 2024-12-19T20:19:07.541519Z

I can't repro. This works for me:

<html>
  <head>
    <script src="" type="application/javascript"></script>
    <script type="application/x-scittle">
      (let [blob (js/Blob. #js ["export default function setup(sr) {console.log(1);}"] #js {:type "text/javascript"})
      ;; Create a URL object from the Blob
      url (js/URL.createObjectURL blob)]
  (.then (js/import url)
      (fn [module] (println "work"))
      (fn [error] (println "error"))
  )
)
    </script>
  </head>
  <body>
    <button onclick="my_alert()">
      Click me!
    </button>
  </body>
</html>

borkdude 2024-12-19T20:19:49.163679Z

This also works for me:

(js/console.log js/import)
in the above HTML

borkdude 2024-12-19T20:43:24.969149Z

also works here: https://babashka.org/scittle/codemirror.html

borkdude 2024-12-20T15:41:26.263419Z

@chris358 did you manage to find out why it didn't work for you?