Fork me on GitHub
#shadow-cljs
<
2021-10-21
>
rberger06:10:08

The link to mkcert was a great help. I got it all to work. I wrote up a quick blog post that put it all together in one place https://dev.to/rberger/set-up-ssltls-for-shadow-cljs-https-server-2np7

👍 2
martinklepsch11:10:54

Has anyone gone through the process of upgrading to the Firebase SDK v9? For a require like ["firebase/compat/auth"] I’m getting the following error. According to https://firebase.google.com/docs/web/modular-upgrade#update_imports_to_v9_compat it should be a drop in replacement.

jacekschae04:10:31

For Firebase v9 1. Update shadow-cljs to at least 2.15.8 in package.json  “shadow-cljs”: “2.15.8" 2. Add :js-options in shadow-cljs.edn under :app (the same place where :target, :output-dir, :asset-path, :modules, and :devtools are)

{:source-paths ["src"]

 :dependencies [[binaryage/devtools "0.9.10"]
        [proto-repl "0.3.1"]
        [reagent "0.8.0"]]

 :nrepl    {:port 3333}

 :builds
 {:app {:target :browser
    :output-dir "public/js"
    :asset-path "/js"

    :modules
    {:main
     {:entries [giggin.core]}}

     :js-options {:babel-preset-config {:targets {"chrome" "80"}}}

    :devtools
    {:after-load giggin.core/main
     :http-root "public"
     :http-port 3000}}}}
I had to figure this out as Firebase is part of the Learn Reagent course

❤️ 1
martinklepsch14:10:03

Is babel-preset-config documented anywhere? I can’t find it in the Shadow CLJS Guide

jacekschae00:10:23

there are a couple of these knobs that seem not to documented 😛

jacekschae00:10:46

maybe would be wort to put this in @U05224H0W ?

thheller04:10:29

this shouldn't be required or do anything anymore? I bumped the default to be chrome 90 so I doubt this does anything?

thheller04:10:59

:babel-preset-config is not documented since it is temporary and will be removed once I figure out how to remove babel completely

👍 1
thheller16:10:50

@martinklepsch that warning only tells you which files failed to load. the reason why is elsewhere. I can't diagnose anything based on that warning alone 😛

thheller16:10:47

I improved that error message a bit in 2.5.12

raymcdermott17:10:17

I'm trying to use clojure.core.specs.alphabut am getting a runtime error ...

raymcdermott17:10:22

Uncaught Error: Unable to resolve spec: :cljs.core.specs.alpha/defn-args

raymcdermott17:10:38

do I have to do something to make it available at runtime?

raymcdermott17:10:15

ls resources/public/js/cljs-runtime | grep core.specs
cljs.core.specs.alpha.js
cljs.core.specs.alpha.js.map

raymcdermott17:10:13

the map shows

(:require-macros [cljs.core.specs.alpha]))

borkdude18:10:40

ClojureScript 1.10.879
cljs.user=> (require 'cljs.core.specs.alpha)
nil

1
thheller18:10:34

@raymcdermott all specs in that ns only exist on the macro side so you can only use them in macros

raymcdermott18:10:21

how do you mean?

borkdude18:10:48

does cljs re-use core.specs.alpha from the clojure side?

borkdude18:10:14

i.e. there is no .cljs file with these specs.

raymcdermott18:10:22

Oh ... do I have to use them on the CLJ side via macros and then access those functions from CLJS?

raymcdermott18:10:07

@borkdude it's a CLJC file and CLJS

borkdude18:10:58

@raymcdermott as a workaround you could copy this file and rename the ns and then load it as .cljs. This works, I pasted it in the REPL ;)

cljs.core.specs.alpha=> (s/get-spec ::defn-args)
{:cljs.spec.alpha/op :cljs.spec.alpha/pcat,

thheller18:10:39

yeah, just copy the contents of the cljc file into a namespace you control

borkdude18:10:19

appropriate name suggestion: core.specs2.alpha :P

😂 1
raymcdermott19:10:31

what a pair of hackers 🙂

raymcdermott19:10:13

I'm gonna do that of course