This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-01
Channels
- # beginners (59)
- # cider (3)
- # clara (4)
- # cljsjs (4)
- # clojure (144)
- # clojure-finland (2)
- # clojure-italy (10)
- # clojure-russia (2)
- # clojure-spec (7)
- # clojure-uk (53)
- # clojurescript (81)
- # cursive (30)
- # datomic (36)
- # defnpodcast (2)
- # editors (3)
- # emacs (4)
- # events (1)
- # fulcro (12)
- # off-topic (11)
- # onyx (14)
- # parinfer (2)
- # pedestal (12)
- # re-frame (3)
- # reagent (26)
- # shadow-cljs (81)
- # spacemacs (10)
- # sql (59)
- # uncomplicate (4)
- # yada (4)
@bhauman Figured out a way to have separate REPLs for CLJ and CLJS.. not perfect but good enough for now:
2) Launch a separate terminal and use leiningen to connect to existing REPL, e.g.: lein repl :connect nrepl:127.0.0.1:1234
(replacing 1234)
@bhauman If you feel it's useful enough to include in the figwheel-main lib I can create a pull request
Not really.. there's a very, very limited one-line evaluator.. they call it the Quasi-REPL.. it sucks
For Common Lisp Vim has slimv. It has an excellent REPL built-in. But the Clojure interop isn't great so I use fireplace
now that I understand how it works, I think I can come up with an interesting solution
actually I can't think of a better way to do this right now, you kinda have to choose with repl you want to work with rebel-readline
I guess there's no way to somehow combine lein repl :connect ...
and lein trampoline run -m rebel-readline.main
?
but you could make it so that the cljs repl gets rebel-readline instead of the clojure repl
If you are familiar with github pages development, you can use it jekyll serve
from the docs
directory
I'm having an issue with npm-deps where goog is saying undefined name to path for a dependency of the module I'm trying to use. I've tested my project.cljs with react and left pad and it works fine. any advice on where to go from here?
also here is my project.cljs and source if you want to check it out https://gist.github.com/mjrb/1903851fe692656329d5d9eb33205b01
@www.w.com123 Potential workaround: https://gist.github.com/mfikes/abd3389e5cefb06ff15124c243cd0060
has anyone experienced in web dev cljs and bidi
been successful using a prefix in their url routes, such as a #
?
Hello all, I need to define a javascript function in clojurescript env. I tried to use ^:export but it includes the namespace before. Is that possible to define without namespace?
@fabrao you can do (ns your.ns) (defn some-fn [] ...) (js/goog.exportSymbol "theFunction" some-fn)
@mfikes thanks for that, but I'd need to use the sdk package to login and get a client to get a mongo connection
Right now my work around is to use yarn and foreign libs to access the stuff. Id probably have to write externs regardless if I used foriegn libs or npm-deps right?
someone correct me if i’m wrong, but, in theory, libraries that get included via :npm-deps
get run through the closure compiler. if they survive that process, they’ll get minified along with the cljs code and you shouldn’t need externs. it isn’t clear how much js code can really survive closure compilation, however, so you may need to futz with externs after all. for :foreign-libs
included libraries, I’d turn on automatic inference if I were you. I think it works pretty well now. If you are using a lot of npm stuff, I’d further recommend you use shadow-cljs
as your build tool instead. including npm packages and inferring externs works very smoothly with it.
Thanks I'll look into shadow
you just have to write a bit of boilerplate glue that shadow-cljs elides - but this hardly matters in long term projects IMHO
You should avoid :npm-deps
unless you want to live on the cutting edge - or want to help advance that feature
@dnolen I followed that guide and that's how I currently got the project working, but when I tried to turn on adnvanced compilation (with infer externs) it said window.Ld was not defined or something which sounds like something weird happened with the externs
For context and if anyone is interested I'm working on a cljs library for mongodb stitch (a serverless platform that gives you secure client side db access)
(and also server side function and integrations with other services)
@www.w.com123 that doesn’t sound like an externs problem
I’ve tried it with fairly non-trivial stuff - React Datepicker etc. and I haven’t run into any issues myself
Google login (https://developers.google.com/identity/sign-in/web/sign-in) instructs to redefine the global onSignIn function to get the information after they've signed in. From browser console, this works from me; but how can I redefine this global function from my cljs file?
@worlds-endless just use goog.object/set
on js/window
:
(goog.object/set js/window "thing" "foo")
=> nil
(goog.object/get js/window "thing")
=> "foo"
Thanks, @lee.justin.m. Turns out it was even easier: (set! js/onSignIn on-google-signin)
(which is probably the same thing under the hood)
people often suggest using goog.object/set
, though I’m not sure what if any difference there is to just using set!
That's an interesting question; if goog.object/set is better than set!, I wonder why it isn't just rewritten as an alias?
for example, in the docstring of aset
, it suggests using goog.object/set
instead of just using set!
. i’m not quite sure why
AFAIK the rule of thumb is: 1. Object made & set through interop syntax, can use interop syntax 2. Object made by other JS? Use goog.object
I'm trying to update a set of CLJSJS packages. I run boot on the build.boot and it seems to 'complete', including buiding deps.clj, writing the pom stuff and writing the jar. But I can't find the poms or jar. Anyone know where this stuff is written or what otherwise may be wrong?? Thanks!
to answer my own question - this appears to be a boot thing. If you simply specify the package
task nothing is actually written (despite messages indicating otherwise). You need to specify boot package install target
to actually write the stuff out so that you can then test it
to answer my own question - this appears to be a boot thing. If you simply specify the package
task nothing is actually written (despite messages indicating otherwise). You need to specify boot package install target
to actually write the stuff out so that you can then test it