This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-27
Channels
- # announcements (3)
- # babashka (35)
- # babashka-sci-dev (42)
- # beginners (27)
- # calva (7)
- # clj-kondo (18)
- # cljs-dev (1)
- # clojure (40)
- # clojure-europe (141)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-uk (40)
- # clojurescript (15)
- # community-development (4)
- # cursive (54)
- # events (1)
- # fulcro (8)
- # helix (5)
- # hyperfiddle (22)
- # introduce-yourself (6)
- # jobs (3)
- # joyride (26)
- # lsp (7)
- # music (1)
- # nbb (7)
- # off-topic (28)
- # pathom (120)
- # pedestal (3)
- # podcasts-discuss (2)
- # portal (2)
- # rdf (2)
- # releases (20)
- # rewrite-clj (9)
- # shadow-cljs (26)
- # spacemacs (1)
- # sql (13)
- # vim (10)
- # xtdb (63)
@grav Currently nbb exposes goog.crypt
:
https://github.com/babashka/nbb/blob/main/src/nbb/impl/gcrypt.cljs
But we can certainly add that one too. Would you like to make an issue?
Woops, sorry for not responding back here @U04V15CAJ.
Thing is, I'm trying to use the bidi
library which I've "checked out" via https://github.com/babashka/nbb/blob/main/doc/dependencies.md, and what I get is this:
$ npx nbb script.cljs
npx: installed 6 in 1.178s
(node:84759) ExperimentalWarning: The ESM module loader is experimental.
----- Error --------------------------------------
Message: Unable to resolve classname: goog.Uri
Location: /home/grav/repo/jadak/examples/nbb-demo/nbb-deps/bidi/bidi.cljc:6:3
----- Context ------------------------------------
2:
3: (ns bidi.bidi
4: (:refer-clojure :exclude [uuid])
5: (:require clojure.string)
6: #?(:cljs (:import goog.Uri)))
^--- Unable to resolve classname: goog.Uri
7:
8: (defn url-encode
9: [string]
10: (some-> string
11: str
----- Stack trace --------------------------------
bidi.bidi - /home/grav/repo/jadak/examples/nbb-demo/nbb-deps/bidi/bidi.cljc:6:3
Unable to resolve classname: goog.Uri
So I'm wondering if it's possible to have the whole goog.*
library available, like with regular ClojureScript
@grav It seems you can use the google-closure-library
from npm to get to the stuff which is not available directly in nbb:
https://twitter.com/borkdude/status/1532479448380870657
But that doesn't make your code compatible. Having goog.Uri
in nbb is reasonable, but I have to add those things by hand. Feel free to make an issue for this
But it seems Node.js already provides support for that: https://stackabuse.com/encoding-and-decoding-base64-strings-in-node-js/