This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-01
Channels
- # beginners (28)
- # cider (39)
- # cljs-dev (2)
- # cljsjs (1)
- # clojure (67)
- # clojure-conj (1)
- # clojure-dev (103)
- # clojure-gamedev (3)
- # clojure-uk (2)
- # clojurescript (46)
- # data-science (7)
- # datascript (1)
- # fulcro (5)
- # lein-figwheel (2)
- # mount (2)
- # off-topic (55)
- # portkey (7)
- # protorepl (11)
- # re-frame (45)
- # reagent (21)
- # shadow-cljs (34)
- # tools-deps (3)
- # vim (8)
- # yada (1)
Hello everybody!
Has clojurescript a package to easily store options on user namespace ?
Hi! I have this problem:
When I run my figwheel server with lein figwheel
, it picks the configuration of my Ring handler from project.clj
:
(defproject foo "1.0"
:figwheel {:ring-handler dev-app/app})
But when I connect to a running nREPL and start figwheel
(use 'figwheel-sidecar.repl-api)
(start-figwheel!)
(cljs-repl)
It doesn't use the config and I can't figure how to make it use that handler.Has anyone yet written a tutorial yet on using clj -m cljs.main
, etc. with Emacs/Cider and Figwheel?
If not, I can save some notes as I figure it out, but I'll need some help getting started.
Partial answer to myself: I just found http://www.functionalbytes.nl/clojure/nodejs/figwheel/repl/clojurescript/cli/2017/12/20/tools-deps-figwheel.html, though I've not read it yet.
you can just crib what i’ve done @U3JJ35GUT https://github.com/robert-stuttaford/bridge/
working clojure-cli repl / figwheel / cider / clj-refactor 🙂
i don’t use the cljs repl, so you may need to do a little extra if you want that
@U064J0EFR That sounds cool, but I'm not sure exactly what it means?
a wrapper for the new cljs.main that handles presents a better clojure cli interface for figwheel like workflows
@U3JJ35GUT, instead of something like this to start figwheel https://github.com/robert-stuttaford/bridge/blob/master/dev/figwheel.clj, it’ll be something like this https://github.com/robert-stuttaford/bridge/blob/master/Makefile#L18
Very nice. I have to confess to being sufficiently old-school to still prefer make to all the java-ecosystem tools. (And don't get me started on the ugliness of anything XML-based; LOL)
🙂 the push towards the command line is forcing simple composable tools on us all. i love it.
@U3JJ35GUT you are not alone 🙂
@U0509NKGK When I try your figwheel script, I don’t get the “watching” behavior. Hm.
And my build script had a system/exit in it, which I guess pre-empted whatever figwheel does to hang on.
Hi, can we use a clojurescript project as a standalone js file in another type project that requires a js file ?
@scknkkrer don't see why not, but you at least make no optimal use of clojure. It's probably better to extend them
@gklijs, my point is to use clojurescript instead of js on a 2d game project that requires js as a script language.
Ok, I have done it. Just cleaning the external libraries’ calls solve my problem. No external calls, no external code in exported file.
Just as a note; If anyone who interesting with cocos2d with clojurescript, I am working on it for a product.
Does anyone have an example of using native React components with CLJS and Rum? I have an NPM module that I’m importing with :npm-deps
and my namespace seems to be requiring / importing it just fine, but I’m unsure how to instantiate the given JS React component in Rum. Any ideas?
Hello, is there a clojure equivalent for this package ? https://www.npmjs.com/package/configstore
you essentially create them directly using normal js interop syntax. rum is compatible with that approach (though I concede I had issues with HOC. i’m sure they are solvable though)
@rdanielo it’s only about 100 lines of javascript so you could probably bang out an implementation as a fun exercise
Does it ?
I never checked. It provides so cool functionality and easy to use that I though it should be a bit more complex
I was writting a wrapper around it in fact.
I don't know how it is implemented, but I am more or less sure that it uses some deep JS functionalities like proxies
Well, I posted that as example, I'm currently using this one: https://www.npmjs.com/package/preferences
sames stuff 111 LOC
Maybe I can write a cljs version that uses EDN directly
One question, how does people on cljs (if they even do it) accept a bunch of parameters and return something similar to a client with methods ? Actually they are not methods, but functions that should use certain default parameters . In JS y usually capture those parameters on a closure and return an object containing functions
i don’t really understand your question. the implementation of configstore actually looks extremely simple. the only fancy feature it uses is get/set https://github.com/yeoman/configstore/blob/master/index.js
Sorry, my question was totally unrelated to implementing the provied package
It is about usual practices on JS to translate them to cljs
@lee.justin.m okay, thank you!