This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-05
Channels
- # arachne (7)
- # architecture (3)
- # beginners (106)
- # cider (22)
- # clara (2)
- # cljs-dev (14)
- # cljsrn (12)
- # clojure (121)
- # clojure-china (1)
- # clojure-italy (2)
- # clojure-spec (22)
- # clojure-uk (32)
- # clojurescript (38)
- # community-development (45)
- # cursive (15)
- # datascript (6)
- # datomic (12)
- # defnpodcast (2)
- # emacs (8)
- # events (1)
- # fulcro (14)
- # immutant (6)
- # jobs (3)
- # jobs-discuss (6)
- # jobs-rus (3)
- # keechma (4)
- # keyboards (4)
- # leiningen (8)
- # luminus (1)
- # off-topic (91)
- # onyx (13)
- # parinfer (36)
- # re-frame (12)
- # reagent (23)
- # remote-jobs (1)
- # ring-swagger (3)
- # shadow-cljs (57)
- # specter (11)
- # sql (9)
- # uncomplicate (4)
- # vim (2)
- # yada (15)
the closest analogs in my opinion are go
blocks (`async`) and <!
(`await`) from core.async
@fabrao Dunno about await
but async
has something to do with doing tests on asynchronous things.
@levitanong I think he’s asking about javascript’s async/await keywords, which are closest to go blocks
Oops, silly me!
Is pr-str
ing data structures a good way to serialize edn or is there something more space efficient?
pr-str would be the standard way to make edn - edn is a string format and doesn’t allow space optimizations. There’s transit which is designed to store arbitrary clojure data, and is extensible, and optimized for avoiding duplication of shared data in the output, but it’s not edn. It is faster than edn though, and has libraries to consume and create the data from other langauges.
For any Cursive + cljs users out there. The REPL that I end up with by running a lein figwheeel task is pretty lame, up/down arrows do not search history so I end up copying and pasting all the time. Should it be better?
I start a regular clj repl from cursive and call "cljs-repl" from the figwheel api
works flawlessly
I'm trying to use existing npm packages inside my cljs project. I can make the example from https://anmonteiro.com/2017/03/requiring-node-js-modules-from-clojurescript-namespaces/ with left-pad
work. However, when I try another package (`apollo-client`), it doesn't work:
Hi. You can see discussion here: https://github.com/macchiato-framework/macchiato-core/issues/23 on how to use npm deps in cljs.
I did add the npm package to :npm-deps
(just the way I added left-pad
).
I seem to be able to load the apollo-client, but I can't do anything with it:
(require '[apollo-client])
nil
cljs.user> apollo-client
#object[ReferenceError ReferenceError: [...]$node_modules$apollo_client$index is not defined]
nil
cljs.user> apollo-client.
#object[ReferenceError ReferenceError: apollo_client_SLASH_ is not defined]
nil
cljs.user> apollo-client/ApolloClient
#object[ReferenceError ReferenceError: [...]$node_modules$apollo_client$index is not defined]
nil
How can I use apollo-client
?checking the apollo-client
module source: it has this structure:
-- packages
|
|- ...
-- apollo-client
so it has a package apollo-client (amongst others).And packages/apollo-client/rollup.config.js
:
import build from '../../rollup.config';
export default build('apollo.core');
I'm not sure how to deal with this 😛.^^ how can I make the apollo-client
run in cljs?
@kurt-o-sys I think if you just want to be productive A) just build your JS separately and use a single include B) try an alternative tool like shadow-cljs
:npm-deps
is for the long haul, there’s still a lot of work to do, and not just us (Closure Compiler)
oh, ok... so it's better to avoid :npm-deps for now?
yeah, that's my goal 🙂 . OK, let me see how shadow-cljs
works. thx.
hi, im trying to use lein-asset-minifier
to minize the compiled reagent app's app.js
file and I get this error: JSC_READ_ERROR. Cannot read: /home/user/sample/target/cljsbuild/public/app.js at (unknown source) line (unknown line) : (unknown column)
can you use this
as an argument in cljs? does it get munged away from this
in the emitted code?
yes you can, I use that name when I pass this
explicitly
but in that situation a collision would be undetectable? if it was the this argument or the keyword this in javascript?
"this" is nothing in cljs
you need to use this-as
for accessing it
or use (js* "this")