This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-21
Channels
- # aws (2)
- # aws-lambda (1)
- # beginners (62)
- # cider (31)
- # cljs-dev (16)
- # cljsrn (8)
- # clojure (115)
- # clojure-greece (3)
- # clojure-israel (2)
- # clojure-italy (13)
- # clojure-nl (8)
- # clojure-russia (5)
- # clojure-spec (3)
- # clojure-uk (146)
- # clojurescript (108)
- # clojutre (5)
- # code-reviews (3)
- # cursive (48)
- # datomic (22)
- # editors (20)
- # emacs (7)
- # fulcro (16)
- # graphql (10)
- # mount (2)
- # off-topic (47)
- # onyx (22)
- # re-frame (100)
- # reagent (5)
- # reitit (7)
- # ring-swagger (6)
- # rum (5)
- # shadow-cljs (51)
- # specter (2)
- # tools-deps (95)
- # vim (10)
- # yada (7)
A dependency I’m using uses cljsjs firebase and I’m getting The required namespace "firebase.app" is not available, it was required by "com/degel/re_frame_firebase/core.cljs".
In the firebase cljsjs library it seems to export firebase.app
like this:
{:file "cljsjs/development/firebase-app.inc.js" :provides ["firebase.app"]}
I’ve installed firebase app and firebase through npm but it is not picking it up. How would shadow-cljs know to point firebase-app to firebase.app?
Just wondering how I would begin to fix this@caleb.macdonaldblack is something you are using still requiring something through cljsjs? If so, you need to shim the cljsjs file. https://shadow-cljs.github.io/docs/UsersGuide.html#cljsjs
otherwise, if this is your file, you just add something like [firebase :as firebase]
to your (require...)
vector
Yea this it another dependency requiring. The link you sent looks like it exactly what I need. Thank you!
I am still having trouble here. the library is requiring it like this: [firebase.app :as firebase-app]
and in the cljsjs package it is setting it up to work on the firebase.app
namespace with the :provides
option in the deps.cljs
I’m looking at this repo: https://github.com/thheller/shadow-cljsjs for examples but none of them help me here
I thought you’d need to something like (ns firebase.app (:require ["firebase" :as firebase])) (js/goog.exportSymbol "firebase" firebase))
oh i see your namespace is firebase.app I didn’t take notice of that
let me try now
Yea that did it. I was wondering what was with the weird file structure in the shadow-cljsjs repo. It was matching the required namespace
thanks again
Recently, I try to change my project using this amazing shadow-cljs. It is a great success! I love the idea, the build tools itself is built as a library. I want to take this one step further, if all the internal api could take a map instead of hard coded to (config/load-cljs-edn)
, it would be easier to integrate with other libraries (like Component/Integrant).
Another idea is we can have api to access the data in manifest.edn
, it would be very useful information for adding caching list in serviceworker.
@thheller don’t know if they are good ideas for shadow-cljs
@albert.lai you have access to all the data. not sure what you want to do with it.
integrating with component/integrant should be pretty straightforward. config file isn't going away for the time being though.
https://github.com/duct-framework/server.figwheel, I am trying to integrate shadow-cljs to duct framework. everything is working, the only different is the shadow-cljs’s config is not inside the system map. This make sharing information abit indirect. e.g. the webpush’s application server key string must first export to environment variable for shadow-cljs to include.
I reaaaaaaaaallly do not recommend running shadow-cljs as part of your clojure server
In my production app I have a "component" which just watches for changes to the manifest.edn
you can run it as part of your server if you really want but you are just making life harder IMHO
I know your idea. But duct will only load figwheel in development mode, figwheel will be excluded in production.
But, yes, it did have more chance to have dependency conflicts..
I understand that the goal is to start everything at once but to me it just looks way more complicated than running them separately
when it works, it works well. when it stop working, now we have a bigger mud ball. It might not worth the effort. Thanks for your explanation.
I added ^js
and :compiler-options {:infer-externs :auto}
in my project, the warnings are gone.
=>> client=local node server.js
Using default schema.
/Users/chen/repo/cirru/calcit-editor/dist/server.js:731
function Kv(){var a=ek.a(Hv),b=Bv(),c=mv.join(__dirname,"app");a=100+a;b.use("/",Bv.Yd(c),function(){var a=Ni(new u(null,1,[yj,!0],null));return Cv(c,a)}());b.listen(a);return Gi(P([["Serving local editor at ",x.a(Yq.blue(["",x.a(a)].join("")))].join("")]))}
^
TypeError: Bv.Yd is not a function
at Kv (/Users/chen/repo/cirru/calcit-editor/dist/server.js:731:85)
at Function.<anonymous> (/Users/chen/repo/cirru/calcit-editor/dist/server.js:733:377)
at $e (/Users/chen/repo/cirru/calcit-editor/dist/server.js:152:111)
at /Users/chen/repo/cirru/calcit-editor/dist/server.js:733:270
at Object.<anonymous> (/Users/chen/repo/cirru/calcit-editor/dist/server.js:734:3)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
@jiyinyiyong try compiling with shadow-cljs release server --pseudo-names
to confirm that it is actually that part of the code
check if the .shadow-cljs/builds/server/release/externs.shadow.js
file contains the .static
property
static
is one of those reserved "special" properties that the CLJS compiler will munge
@jiyinyiyong just saw that you use .static express
when express
is a ns
:as
alias. try express/static
instead. that has protection against the built-in munging from the CLJS compiler
I think the issue is that static
gets renamed to static$
by the cljs compiler and your code isn't used in dev so you only notice it on release?
@jiyinyiyong found it. fixed in 2.4.8
. it was in my externs generation code which munged reserved properties when it shouldn't have.