This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-15
Channels
- # beginners (97)
- # boot (54)
- # cider (13)
- # cljs-dev (3)
- # cljsrn (9)
- # clojure (64)
- # clojure-berlin (1)
- # clojure-brasil (119)
- # clojure-dev (3)
- # clojure-france (5)
- # clojure-greece (1)
- # clojure-italy (5)
- # clojure-madison (1)
- # clojure-russia (15)
- # clojure-spec (25)
- # clojure-uk (57)
- # clojurebridge (5)
- # clojurescript (45)
- # code-art (1)
- # community-development (17)
- # cursive (24)
- # datomic (83)
- # emacs (11)
- # fulcro (70)
- # hoplon (7)
- # immutant (3)
- # leiningen (19)
- # luminus (5)
- # lumo (25)
- # onyx (123)
- # other-languages (7)
- # pedestal (2)
- # re-frame (12)
- # ring (15)
- # ring-swagger (51)
- # shadow-cljs (89)
- # spacemacs (23)
- # sql (4)
- # unrepl (57)
- # utah-clojurians (1)
- # vim (1)
hey, if anyone could please help me with my issue in calling cljs files from the lein repl I just posted about it in the leiningen channel. thanks. 🙂
without using core.async, is there a way to 'queue' messages on a websocket when it's in the "CONNECTING' state ?
manifold stream maybe? https://github.com/dm3/manifold-cljs
I went to Devoxx and heard about Elm there. It seems like I might like static typing more, especially since it gives nice error messages compile time. Still have to finish a clojure(script) project before I can do something with Elm. But I wondered if maybe somebody here tried it. From what I read the javascript interop is slightly more work, but on other fronts it seems better.
@gklijs never used Elm personally but this might be relevant https://www.youtube.com/watch?v=Q6Q5D6mI-34
Thanks, form a quick look it will give me some answers, one of things that’s very nice about clojurescript is the repl, but I hardly ever use it.
hello friends, I am using Lumo
and puppeteer
to scrap some web pages. Some $ selectors returns a js Map object. Does anyone knows how can I use it in cljs ?
@baptiste-from-paris js/Map
implements Iterable protocol, so you can unwrap it into js/Array
of map entries using js/Array.from
Yes, that’s what I was reading, I have to try that
@gklijs here is one answer... swannodette thinks elm and scala.js are awesome, but he'd rewrite ClojureScript if others took it away from him swannodette@defn#26
@gklijs I’ve done some work in Elm. Elm is really great if you don’t mind writing some javascript on the side
if you need to be pragmatic and you want to stay in one language, then Clojurescript is far better in my opinion
@gklijs i spent some serious time last summer evaluating Elm as a replacement for Clojurescript in a project for a client. Having better confirmation of types in the program was the main reason. I concluded that Clojurescript is much more mature and stable overall, and you can solve the data shaping problem using Clojure.spec of any of the many other libraries out there. In general, you can also get work done faster in Clojurescript, and it involves a lot less code than Elm.
ok, less code is also less chance of errors, and I’m already quit familiar with spec. It just feels a bit cumbersome at times, but on the other side it’s nice you can do a lot of things without specs, and quickly see if it works,
Elm has some notable downsides that may or may not matter to your case, but lack of support for advanced optimizations is one of them. Also, inability to easily write a program that integrates heavily with third-party libraries in JS. Elm devs overall tend to agree that Elm is not the best choice if you need the wider JS ecosystem because of the overhead in time to get things done.
Clojure is ultimately more flexible since it has a fantastic macro system so you can add whatever features to the language you feel are missing
Continuing with puppeteer
I have to inject clojurescript into chrome instance with the addScriptTag
in order to use clojure along with puppeteer
. Is there a CDN for some kind of cljs.js with the whole language ?
https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pageaddscripttagoptions
Hey all, is it possible to load a clojurescript namespace from lein repl? Does anyone know how to do it?
@derpocious are you familiar with figwheel?
Hi all! Today I'm thinking about making a simple CLJS example to demonstrate JS (export module) interop -- just want to check: has anyone done this? (context is seeing António's talk at the Conj)
@U0501UWML: I found that talk super interesting. Do you mean export to npm?
sure.. could be npm or any other conventional JS target.... the trick is our CLJS gurus are creating far to much cool stuff --- i just want to document it!
reviewing the talk now... https://www.youtube.com/watch?v=63K--ctvT-g
Yeah, I was experimenting with consuming npm modules in cljs, and while I got it to work for a couple of libs (react, prosemirror... ), I couldn't get it to work for quite a few others.
Hi all. I'm working on integrating cljs and js code in a project, and I have a build that is working well, except advanced compilation mode is throwing errors on ES6 features:
ERROR - this language feature is only supported for ECMASCRIPT6 mode or better: arrow function. Use --language_in=ECMASCRIPT6 or ECMASCRIPT6_STRICT or higher to enable ES6 features.
In the clojurescript docs it says that ES6 modules can be enabled by including the library as a foreign lib:
:foreign-libs [{:file "src/js"
:module-type :es6}]
(as seen in: https://clojurescript.org/guides/javascript-modules)
And while this also works with no optimizations, in advanced mode, it does not have the expected effect, and the same errors are thrown. Has anyone had experience including ES6 js code in their project?@U05224H0W: I see, is that instead of the foreign-libs entry, or in addition to.
Hmm... while that works for the errors, I'm now seeing a lot of warnings about skipped compiler passes:
WARNING: Skipping pass optimizeToEs6
I really have no idea how all this works in CLJS core. it works very differently in shadow-cljs as described here: https://code.thheller.com/blog/shadow-cljs/2017/11/10/js-dependencies-in-practice.html
Anyone ever seen the cljs compiler emit a bunch of warnings like:
WARNING: Skipping pass checkVariableReferences
factory features: [block function, getters, string continuation ... etc
I'm compiling a very simple build that includes es6 js, and for the life of me I can't get it to compile with advanced optimizations.
The JS file being included:
goog.provide('js.lib');
js.lib.debugMessage = (x = "any old string") => {
console.log(`Printing ${x} from cljs!`);
};
Compiler options:
{:asset-path "js/main.out"
:optimizations :advanced
:source-map false
:parallel-build true
:language-in :es6
:foreign-libs [{:file "src/js"
:module-type :es6}]}
Minimal build here: https://github.com/zalky/integratedHello, I was a bit out of the loop with ClojureScript recently but followed the announcement of :npm-deps and got quite exited. I would like to try the new apollo client via npm-deps with clojurescript in the browser. everything compiles and the node dependencies do get installed. but when I open my app in the browser I get errors like this "Uncaught ReferenceError: module is not defined" and "Uncaught ReferenceError: module$home$roman$workspace$apollo$node_modules$apollo_link$lib$index is not defined" telling me something is not right with my node dependencies. What's the state of :npm-deps? Are there still some restrictions with node modules, is this a bug, am I doing something wrong, or is trying to use a package like apollo-client via :npm-deps still a bit too ambitious? Any ideas? 🙂
@U0CKBRBD2: I also experimented recently with :npm-deps, and my experience was that while I was able to get some libs to work, others libs had issues similar to what you saw. My understanding is that the compiler has trouble inferring externs from some of the more advanced code that some libraries use. If you want to test that your approach is correct, I recommend trying your build with one of the projects that is known to work via :npm-deps
, like react or lodash.
@U0HJK8682 ok, thanks! I'll verify with lodash next
@U0HJK8682 react via :npm-deps is working, so maybe something with apollo 😕
@U05224H0W ok, good to know. I'll try it. Thanks 🙂
Is there a way to tell the cljs compiler to include deps with a chosen build, but not with other builds? (Ideallly via lein cljsbuild)? I've been looking for some docs regarding this process so if you could point me to it that'd be great too
Probably need to use profiles to include/exclude deps
@danielcompton You're right -- that looks like what I want. https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md