Fork me on GitHub
#clojurescript
<
2018-04-01
>
danielo51507:04:02

Hello everybody!

danielo51507:04:45

Has clojurescript a package to easily store options on user namespace ?

jsmesami10:04:54

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.

deg11:04:32

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.

deg12:04:31

That doc seems to be outdated in parts (no surprise, given the 1.9 in the title).

robert-stuttaford12:04:24

working clojure-cli repl / figwheel / cider / clj-refactor 🙂

robert-stuttaford12:04:46

i don’t use the cljs repl, so you may need to do a little extra if you want that

bhauman13:04:52

a note here: that there will be a figwheel.main in the next couple of months

deg15:04:46

@U064J0EFR That sounds cool, but I'm not sure exactly what it means?

bhauman15:04:11

a wrapper for the new cljs.main that handles presents a better clojure cli interface for figwheel like workflows

deg17:04:26

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)

robert-stuttaford17:04:10

🙂 the push towards the command line is forcing simple composable tools on us all. i love it.

justinlee17:04:13

@U3JJ35GUT you are not alone 🙂

zentrope00:04:56

@U0509NKGK When I try your figwheel script, I don’t get the “watching” behavior. Hm.

zentrope01:04:59

Ah, never mind.

zentrope01:04:06

Output is in the log file.

zentrope01:04:38

And my build script had a system/exit in it, which I guess pre-empted whatever figwheel does to hang on.

scknkkrer12:04:10

Hi, can we use a clojurescript project as a standalone js file in another type project that requires a js file ?

gklijs12:04:53

@scknkkrer don't see why not, but you at least make no optimal use of clojure. It's probably better to extend them

scknkkrer12:04:49

@gklijs, my point is to use clojurescript instead of js on a 2d game project that requires js as a script language.

scknkkrer12:04:09

You might have heard that, Cocos2d-x.

scknkkrer13:04:11

Ok, I have done it. Just cleaning the external libraries’ calls solve my problem. No external calls, no external code in exported file.

scknkkrer13:04:57

Just as a note; If anyone who interesting with cocos2d with clojurescript, I am working on it for a product.

stephenmhopper13:04:04

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?

danielo51514:04:14

Hello, is there a clojure equivalent for this package ? https://www.npmjs.com/package/configstore

justinlee17:04:03

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)

justinlee18:04:01

@rdanielo it’s only about 100 lines of javascript so you could probably bang out an implementation as a fun exercise

danielo51519:04:09

I never checked. It provides so cool functionality and easy to use that I though it should be a bit more complex

danielo51519:04:21

I was writting a wrapper around it in fact.

danielo51519:04:49

I don't know how it is implemented, but I am more or less sure that it uses some deep JS functionalities like proxies

danielo51519:04:44

Well, I posted that as example, I'm currently using this one: https://www.npmjs.com/package/preferences

danielo51519:04:49

sames stuff 111 LOC

danielo51519:04:09

Maybe I can write a cljs version that uses EDN directly

danielo51519:04:43

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

justinlee19:04:01

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

danielo51519:04:37

Sorry, my question was totally unrelated to implementing the provied package

danielo51519:04:52

It is about usual practices on JS to translate them to cljs