This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-23
Channels
- # beginners (20)
- # boot (7)
- # cider (115)
- # cljsrn (13)
- # clojars (1)
- # clojure (122)
- # clojure-italy (23)
- # clojure-spec (60)
- # clojurescript (74)
- # data-science (7)
- # datomic (26)
- # emacs (8)
- # graphql (1)
- # lumo (26)
- # music (1)
- # off-topic (1)
- # re-frame (9)
- # ring (3)
- # rum (1)
- # spacemacs (4)
- # uncomplicate (6)
- # vim (7)
Let’s say I’m running a Clojure backend, rather than a cljs/node one. How would I go about doing server side rendering with Reagent? Nashorn seems uncomfortable with the JS generated by cljs. Would I have to run a Node instance on the side and pass the task along to it?
@henrik the example uses nashorn https://github.com/reagent-project/reagent-cookbook/tree/master/recipes/reagent-server-rendering
I had a look at that, tried to get Nashorn to parse base.js
as an experiment, and it started complaining about the code style. That, along with stuff like this (str "reagent_server_rendering.core.main('" page-id "');")
in the templates made me think that maybe it wasn’t the best/most mature option.
The current idea is to use Node as a rendering layer between Clojure/API and CloureScript/Frontend.
@henrik https://github.com/tonsky/rum does server-side rendering without the need for server-side JS
i use it isomorphically. works 👌
@robert-stuttaford Indeed, which is awesome. I’m not looking at Reagent specifically necessarily, just a generic way of pre-processing arbitrary JS.
Clojure backend, advanced-compiled cljs frontend, sharing .cljc source with the Rum defcs in it
right. if you need to run other JS, then yes, you’d need a JS VM 🙂
Yeah, indeed! It’s annoying to know that there is one embedded in JVM, but that it’s kind of slow and finicky.
I've moved these libraries into package.json and now got an error on react-native-packager start with optimizations :none : No such module 'path'. But with optimizations :simple all works.
and, of course, this doesn't work with figwheel because figwheel requires only optimizations :none
@okilimnik what are you trying to accomplish?
If you're using re-natal, did you run re-natal use-component moment
?
@pesterhazy I'm just trying to perfom @dnolen's request to give a try for clojurescript master and to move all node dependencies into project.clj. And in this case there is no need to add modules into .re-natal
got it
Also I really want to port Pedestal's routing lib to cljs as well. It's the best thing i used for routing
I’ve played with it briefly, and it’s great. I think there’s a general push towards .cljc for Pedestal.
base on pedestal , my goal is to replace secretary with pedestal routing on client side as well
which one is a better practice (i have 2 async channel for websocket in/out) ? 1) Returning async channels from a functions and pass them around 2) use global vars for async channels and require them on demand ?
@lxsameer what is a better practice? 1) returning values from functions 2) using global vars/atoms and referencing them on demand?
I do have another event-handler hooked to the "plz" and "ort" input elements. They work.
@magra you might be running into a weird issue where closure optimizes the call away incorrectly
Hi guys, does anyone know how to get RE-FRAME or RE-COME to work properly in a NEW POPUP window created with window.open() ? I want to create a popup window that I can render re-com elements into - but when I try to do this several things are not working properly - I am assuming because the necessary javascript / other stuff is not included in the new window ?
Hello. I've been playing around with datomic recently, and I'm interested in using datomic for an application with a frontend written in clojurescript. As far as I can tell, datomic.client doesn't support CLJS. I was kind of hoping for a solution that would basically let me deal with clojure data all the way through, without having to write, say, a rest frontend for my queries. What is the best way of going about this(AFAIK, the rest interface for datomic has been deprecated, so I'd rather not use that)
@sbrg Disclaimer: I am new to ClojureScript and haven’t been looking into it much, but I am also experimenting with Datomic as so stumbled upon a few solutions
http://precursorapp.com is built on DataScript + Datomic
And is open source: https://github.com/PrecursorApp/precursor
I had seen datascript, but as far as I could understand it was for directly interfacing with datomic. But I'll take a look at the links, thanks!
@sbrg as far as I know any interfacing between a frontend and datomic is very much experimental at this point
I see. It just seems so .. perfect to be able to speak to datomic directly from the frontend. But it looks like precursor has a pretty nice setup going with datomic + datascript + sente for real-time updates
@sbrg there are a lot of security implications that you have to consider. But Datomic’s filters and transaction log makes it much easier to do this (as shown by precursor)
i’m seeing a behavior difference with int
in clj/cljs:
(int \a) ; 97 in java land
(int \a) ; 0 in js land
is this a known issue or something?
or intentional perhaps heh
@bspaulding https://stackoverflow.com/questions/26396493/how-to-map-from-characters-to-numbers-in-clojure
Yea, saw that. Ok. I guess I'm stuck with reader conditionals to stay cross platform. Thanks!
@bspaulding I’m not familiar with Clojurescript though, there might be a better answer than this!
@bspaulding nevermind, I can give you a better answer
As mentioned in https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure, Javascript does not have a character type
@bspaulding (.charCodeAt \a 0)
https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/core.cljs#L2762
https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/core.cljs#L2825
So basically, if I am not mistaken, (int \a)
in ClojureScript is the same as "a" | 0
in js