This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-21
Channels
- # announcements (6)
- # bangalore-clj (1)
- # beginners (46)
- # cider (21)
- # cljs-dev (30)
- # cljsjs (3)
- # clojure (131)
- # clojure-dev (20)
- # clojure-europe (2)
- # clojure-italy (12)
- # clojure-nl (11)
- # clojure-russia (4)
- # clojure-spec (55)
- # clojure-uk (57)
- # clojurebridge (1)
- # clojured (1)
- # clojurescript (55)
- # cursive (11)
- # data-science (1)
- # datomic (23)
- # duct (1)
- # emacs (1)
- # events (1)
- # figwheel-main (2)
- # fulcro (219)
- # graphql (16)
- # immutant (1)
- # jackdaw (3)
- # java (6)
- # juxt (30)
- # kaocha (8)
- # mount (3)
- # nyc (1)
- # off-topic (16)
- # pathom (48)
- # pedestal (1)
- # re-frame (71)
- # reagent (17)
- # ring-swagger (3)
- # shadow-cljs (96)
- # spacemacs (21)
- # specter (8)
- # speculative (20)
- # sql (21)
- # test-check (2)
- # tools-deps (12)
- # vim (6)
I’m using this in an attempt to get an AST for my cljs source:
(cljs/cljs.analyzer.api (File. filename))
But it fails with No such namespace: cljsjs.react
which is a transitive dependency to my project via re-frame. Is it a problem with the project setup or am I using the analyzer incorrectly?
@stathissideris the analyzer must be initialized with the :foreign-lib
data from deps.cljs
files
@thheller thanks for the pointer, I’ll look into it
@thheller does it make any difference that my project uses cljsjs deps only?
deps.cljs
files contains the foreign lib definitions mapping the cljsjs.*
namespaces back to some JS files
oh, I see, it’s under add-implicit-options
in the build
function. Thanks!
https://www.dropbox.com/s/95vx39pgubb6p1u/Screenshot%202019-02-21%2010.24.48.png?dl=0
@borkdude because it starts a server that the REPL code will connect to and exchange messages
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/repl/node_repl.js
then why does MacOS complain about this? I don’t see this with any other REPLs I use 🙂
https://www.dropbox.com/s/wlwrij3pdun6m1z/Screenshot%202019-02-21%2010.39.11.png?dl=0
thanks @thheller, icon and text are corresponding cljs classes, but as in Js TouchableOpacity component wraps Icon and Text I am assuming same behavior as in touchable-opacity would wrap icon and text classes
@paul931224 hey, did you use it with react-chartjs?
Not the person you asked to, but I used chartjs without react-chartsjs but I heard good things about it!
I am looking for slides or transcript of ClojureScript for Skeptics by Derek Slager, does anyone have seen them?
@mateus.pimentel.w nope, I used it with interop. I use reagent, render a canvas, and with component-did-mount I initialize ChartJs
not that flexible, because at new data you have to re-render, so giving new parameters is not enough. But it works pretty well for me.
anyone know where the array-map/hash-map size is dictated in the cljs codebase? I see this in the changes.md * CLJS-1650:
cljs.reader/read-map` now returns array-map/hash-map based on the size of the sequence.` but readmap doesn't seem to be defined any longer
ah ok. i was able to trace it to clojure.tools reader and then back to (set! (.-HASHMAP-THRESHOLD PersistentArrayMap) 8)
Here’s a dumb one. I’m using clojure.data.xml under clojurescript in the node environment, which uses XMLSerializer
and DOMParser
globals (which do exist in the browser). I have a node library that has perfectly good DOMParser and XMLSerializer implementations and have validated that they’ll work for my purposes by monkey-patching them onto the global object
Now I’m left with the mystery of how to do that monkey patching for a real build
Basically, I need js/DOMParser and js/XMLSerializer to exist before I load clojure.data.xml
They don’t actually have to point to the real implementations I’m going to use—can hook that up at call time—but something has to be there to get c.d.xml to load
Another way to put it might be “I need to run two lines of some dumb arbitrary javascript before I load all my cljs stuff” 🙂
@chancerussell easiest way is to create a namespace that you'll require before you require clojure.data.xml
@thheller That was my first approach but it didn’t seem to actually be working. Maybe I was missing something in the dependency tree, though
Seemed like my setup code was somehow running after clojure.data.xml loaded up and threw
as long as you ensure it is loaded before you first use clojure.data.xml you should be fine
but now that I’m describing that impression I’m realizing it doesn’t actually make sense 😛