This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-23
Channels
- # announcements (5)
- # beginners (14)
- # bigdata (1)
- # calva (13)
- # cider (10)
- # clj-kondo (53)
- # cljs-dev (1)
- # cljsrn (12)
- # clojure (67)
- # clojure-uk (8)
- # clojuredesign-podcast (3)
- # clojurescript (53)
- # duct (4)
- # emacs (1)
- # events (1)
- # figwheel-main (5)
- # fulcro (9)
- # graalvm (68)
- # graphql (3)
- # joker (3)
- # juxt (4)
- # off-topic (32)
- # other-languages (1)
- # pathom (35)
- # re-frame (6)
- # rum (1)
- # shadow-cljs (52)
- # spacemacs (3)
- # sql (10)
- # tools-deps (15)
Would it be helpful to create a spec for the shadow cls config? I could see that along with Bruce's spell spec lib going a long way to catching some configuration mistakes up front.
Great, I'll take a look and see if I can do anything more.
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/build/config.clj and then each target extends the multispec https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/build/targets/browser.clj
could probably do more though but I don't like closing down the config format too much. so to some degree I don't it want to complain about keys it doesn't know
question for the compiler nerds here: what is the correct term for this in compiler terms? https://ask.clojure.org/index.php/8879/cljs-should-macros-support-lifting-vars-to-the-ns-level
I was thinking of https://clojuredocs.org/clojure.core/intern
no. that would have the same issues. the issue is declaring the var outside the current context. so it doesn't have to check if the work was already done previously
there are plenty of other ways to do what I want to do ... but the variant with "lifting" the var would be the most efficient
the only potential stumbling block I can think of is keeping it semi-hygienic, right
hehe, I'm referring to the chance of clashing with a var already def
or interned in the namespace
if I only knew the correct term for this I could look at other lisps and how they do it
well I guess they might just automatically lift the def
out of the current scope .. no clue.
I think a lot of lisps would frown on this because it kind of breaks the mental model of local and hygienic macros
in clojure thats no problem since it just generates a class outside of the var system
in CLJS it can't. so it just dumps the code directly in there wrapped in an exists?
check
this isn't something I made up ... I'm 100% sure there is a regular compiler term for this
I'll create some benchmarks too see if I'm just overthinking this .. probably not worth worrying about this so much if the JIT is gonna do this for us anyways
I know that @U0FR82FU1 did some work in uix to hoist static data to a shared global ns. Might check that out and see if it gives you any ideas
Any idea how I can resolve this problem?
The required JS dependency "@babel/runtime/helpers/interopRequireDefault" is not available, it was required by "node_modules/react-dates/lib/index.js".
Search in:
/Users/user/my-project/node_modules
You probably need to run:
npm install @babel/runtime/helpers/interopRequireDefault
When I run the npm install it gives me this
npm install @babel/runtime/helpers/interopRequireDefault
npm ERR! code ENOLOCAL
npm ERR! Could not install from "@babel/runtime/helpers/interopRequireDefault" as it does not contain a package.json file.
I've trying to import the react-dates npm package
I would like to use shadow-cljs to require arbitrary npm and cljs dependencies from a self hosted clojurescript repl. I saw example at https://github.com/thheller/shadow-cljs/blob/0e28c615cd75d4cbce27ede7a8f7f70785d42c86/src/dev/demo/selfhost/simple.cljs. Now my question is to allow dependency definition at runtime - do I have to start shadow cljs via command line with generated settings files. Or would I rather run it via its compiler api?
What I want to do is provide dependencies for a few important cljs and npm dependencies out of the box. And then everything else should be fetched from npm / maven at runtime and be served to the load-fn in the browser repl.
I use deps.edn for local libraries
@grounded_sage likely a dependency conflict of @babel/runtime
. ie. react-dates depending on a different version than present in node_modules/@babel/runtime
house of cards land of JS
@hoertlehner the self-hosted stuff only supports "pre-packaging" npm dependencies. if you want to do it dynamically then you must build that yourself using regular self-hosted cljs stuff. shadow-cljs can't help for those.
@thheller I'd like to know how I can fix this. But in the meantime I am using HTML date input element because I'm just prototyping atm.
make sure all the right versions are installed. standard dependency conflict resolving.
@thheller Thanks Thomas! Could you point me to the location where you do the npm prepackaging in your code?
I can but none of that will be relevant to the self-hosted stuff. It uses the Closure Compiler heavily which is written in Java and won't be available for self-hosted