This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-17
Channels
- # aws (3)
- # beginners (81)
- # boot (155)
- # capetown (2)
- # cider (32)
- # clara (14)
- # cljs-dev (40)
- # cljsrn (12)
- # clojure (158)
- # clojure-austin (5)
- # clojure-korea (6)
- # clojure-poland (1)
- # clojure-russia (63)
- # clojure-spec (45)
- # clojure-uk (75)
- # clojurescript (109)
- # code-reviews (1)
- # core-logic (12)
- # core-matrix (1)
- # cursive (36)
- # datomic (16)
- # defnpodcast (1)
- # devcards (2)
- # editors (3)
- # euroclojure (1)
- # events (3)
- # flambo (1)
- # hoplon (19)
- # javascript (4)
- # jobs (1)
- # lein-figwheel (4)
- # leiningen (1)
- # off-topic (1)
- # om (177)
- # onyx (121)
- # pedestal (14)
- # planck (19)
- # proton (3)
- # re-frame (36)
- # reagent (21)
- # remote-jobs (1)
- # ring (4)
- # ring-swagger (6)
- # spacemacs (1)
- # specter (2)
- # test-check (4)
- # untangled (9)
- # utah-clojurians (1)
- # yada (2)
I think the "problem" with "cursors" is that there's sorta only one place where you're supposed to be changing things.
This works great if it's a single user application and there are no timers / no incoming data sources / no other updates.
However, if you have timers / othter channels also sending updates to your app, something like reagent (with reactive atoms) may work better than Om (with a single data store + cursors)
in cljs, is there a way to throw/catch arbitrary cljs data structure, rather than a (js/Error) ?
@hwk (throw (ex-info msg {:thing "data"}))
and get it via (catch :default e (something (ex-data e)))
Hi. Is there 1-level version of clj->js
?
Is it possible to configure the figwheel server to catch-all routes?
@danielcompton you probably need to setup custom ring
handler
wrong person, but ok, I'll look into this
oops, sorry
thanks for the pointer
Trying this as a simple handler but doesn't work:
(defn handler [request]
(io/resource "public/index.html"))
@danielstockton what the error is?
Just get a 404 on any other route "Figwheel Server: Resource not found"
ok, you might need "routes"
Perhaps it isn't picking up the handler for some reason
you (println ...)
to figure this out
or even (throw ...)
Don't routes dispatch on something in the request? A simple handler shouldn't need routes.
uhm, not sure
But am I getting right, you actually have added :figwheel {:ring-handler foo.core/handler}
to project.clj
?
I mean :ring-handler
to :figwheel
section
Oh, damn 🙂 Not exactly
foor.core.handler...typo
yes, and make sure there ain't like two :figwheel
inclusions
and everything's in place
Got it working, thanks a lot
Not with io/resource, but with
(ns dev
(:require [ring.util.response :as resp]))
(defn handler [request]
(resp/resource-response "index.html" {:root "public"}))
Needs to be a proper ring response
i can do it into html using something like yogthos/markdown-clj, but if the markdown is large then it's inefficient to keep rendering the html in react, it would be better to provide hiccup
@kenny You asked about what's wrong with cursors, this blog expands on it: https://circleci.com/blog/why-we-use-om-and-why-were-excited-for-om-next/
@borkdude ag -G .cljs foo
@borkdude stealing that, thanks!
but I must be doing something wrong: https://gist.github.com/spacepluk/85b07e6eabb146e78c7fc02fb091057f
@spacepluk You're using js/Error
in :clj
code
That's the clj environment, because you're calling a macro when the clj code of your other macro compiles
@spacepluk I myself use a little helper macro:
(defmacro cljs? []
`(boolean (:ns ~'&env)))
the ~'
is to ensure that the literal &env
symbol is embedded, not the namespace qualified
Re: the CircleCI Om Next article - the 'mutations' concept seems to lead in a direction resembling Redux's reducers, to the best of my knowledge. Is that accurate?
@fellshard not accurate
anyone notice clojurescript compiler / figwheel slow down after they've been running it for a while?
what's the best/easiest way to import a NPM module for frontend/client-side use (and this NPM module has 4-5 other modules as dependencies). Neither it or its dependencies are currently provided by CLJSJS
[i haven't looked yet at the dependencies of those 4-5 other modules but if they each have a handful of dependencies, this could get painful fairly quickly]
The root module in question is: react-swipeable-views
if anyone knows about or alternatives to this functionality in particular.
@jasonjckn haven’t encountered that myself