Fork me on GitHub
#nbb
<
2022-05-27
>
borkdude07:05:36

@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?

grav12:06:54

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

grav12:06:27

So I'm wondering if it's possible to have the whole goog.* library available, like with regular ClojureScript

borkdude21:06:21

@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

borkdude21:06:46

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

borkdude07:05:43

var b64string = /* whatever */;
var buf = Buffer.from(b64string, 'base64'); // Ta-da