This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-08
Channels
- # admin-announcements (3)
- # bangalore-clj (3)
- # beginners (21)
- # boot (32)
- # cider (14)
- # clara (2)
- # cljs-dev (19)
- # cljsjs (8)
- # cljsrn (1)
- # clojars (1)
- # clojure (147)
- # clojure-australia (6)
- # clojure-brasil (8)
- # clojure-canada (2)
- # clojure-gamedev (3)
- # clojure-greece (2)
- # clojure-hk (5)
- # clojure-italy (10)
- # clojure-japan (8)
- # clojure-korea (4)
- # clojure-russia (25)
- # clojure-sg (2)
- # clojure-spec (36)
- # clojure-uk (34)
- # clojurescript (88)
- # cursive (157)
- # datomic (6)
- # devcards (1)
- # dirac (1)
- # editors-rus (3)
- # events (2)
- # funcool (1)
- # hoplon (57)
- # jobs (9)
- # lein-figwheel (2)
- # luminus (1)
- # om (156)
- # onyx (93)
- # perun (11)
- # rdf (65)
- # re-frame (36)
- # reagent (17)
- # ring-swagger (3)
- # specter (19)
- # untangled (33)
I watched this talk by the author of https://github.com/dvdt/gyptis It’s clojure lib but draw on browser https://www.youtube.com/watch?v=RvZ0au1XM-w
Any tips on resolving circular dependencies when defining routes on the frontend? my.routes
requires most app namespaces (because it defines routes referring to my.product/screen and my.login.screen). But I also occasionally need to refer to my.routes/routes
.
I guess you need some kind of indirection
I've been using multimethods, routes
defines a render-view
or such and all views define their own implementations for that. routes
doesn't need to require any view namespaces.
- an atom - a var manually resolved - something else?
ah a multimethod would work for that as well
super sneaky
in my.sneaky-routes
: (defmulti routes identity)
and in my.routes
: (defmethod routes :default [_] the-routes)
that's quite different to what I use, but I guess it will work also 🙂
hackity hack 🙂
cljs.user=> (instance? IFn identity)
false
is there another type I should use if I want to extend-protocol
a protocol for functions?
js/Function
!
Throwing it out here again: Has anyone worked with WebGL the same way it's possible to work with the DOM? Like figwheel+react manages to replace code in the running application without ruining its state. Right now I can replace the JS code but I have to restart the WebGL state machine to change the GPU program.
rovanion: check out https://github.com/kovasb/gamma for data to GLSL compilation. For scene graph stuff maybe three.js, I think textures and mesh data might have to be preloaded, but the scene graph objects could constructed from a data layer
hey all. Is it possible to write a macro with side effects at expansion time? (defmacro [blah] (do some side effect) ~(println blargh))
you can have a registry atom in the macro ns and build up data from multiple expansions
@rovanion im using figwheel with webgl, you just have to defonce your context/state variables (or use stuartsierra’s component and defonce the system only)
that way I can modify the render logic without reloading the render state
I am trying to pr-process a text file in the browser before sending it on to the backend, how would I even get started with such a thing
I feel like i’m missing something fundamental here with closure library.. if I have to :import
constructor classes, what happens with something like this:
(:import
[goog.ui.PopupBase EventType]
[goog.events EventType]
)
How can i differentiate between these?right, but do I have to do something like [goog.ui.PopupBase]
and reference it via PopupBase.EventType
so that EventType
of goog.events
isn’t clobbered?
I could use some help with clojurescript here. This is my first "real" clojurescript project, and i'm getting an error about duplicate externs https://gitlab.com/mordocai/my-screeps/tree/clojurescript. Error: http://paste.lisp.org/display/325470. Link to the checkouts/screeps-beans is in http://README.org but its https://github.com/archlisp/screeps-beans. I'm not married to any of the existing structure, just need something that works. Goal is a discrete javascript file to be loaded/used by https://screeps.com. I think I could fix this by ditching the screeps-beans library and moving the extern directly into my project, but i'd rather use the library if possible.
hey all what’s the fastest way to test core.async
code within a deftest
test, it seems to me like the test was running and not waiting on the (<!)
macro to finish executing
@pat Well, that is how the API I have to use works (if I am understanding you correctly). Also, the screeps-beans project that is doing the extern builds just not my project that uses it
@mordocai: you can co master and comment out the global in the node extern that ships with cljs and see if that works
@pat I can go through the trouble of doing that to try it, but does that explain why screeps-beans compiles fine but my-screeps doesn't?
@pat yeah, so if I run the scripts/watch in the other repo it outputs
➜ screeps-beans git:(master) ✗ scripts/watch
Building ...
Building ...
Copying jar:file:/home/ccarpenter/.m2/repository/org/clojure/clojurescript/1.9.229/clojurescript-1.9.229.jar!/cljs/core.cljs to release/cljs/core.cljs
Analyzing jar:file:/home/ccarpenter/.m2/repository/org/clojure/clojurescript/1.9.229/clojurescript-1.9.229.jar!/cljs/core.cljs
Compiling release/cljs/core.cljs
Compiling /home/ccarpenter/git_repos/screeps-beans/src/screeps/structure.cljs
Compiling src/screeps/memory.cljs
WARNING: Use of undeclared Var screeps.memory/store at line 21 src/screeps/memory.cljs
Compiling src/screeps/position.cljs
Compiling /home/ccarpenter/git_repos/screeps-beans/src/screeps/creep.cljs
Compiling src/screeps/spawn.cljs
Compiling src/screeps/room.cljs
Compiling src/screeps/game.cljs
Compiling src/ai/test.cljs
WARNING: Use of undeclared Var screeps.memory/store at line 43 src/ai/test.cljs
WARNING: Use of undeclared Var screeps.memory/update at line 45 src/ai/test.cljs
WARNING: Use of undeclared Var screeps.memory/memory at line 46 src/ai/test.cljs
WARNING: Use of undeclared Var screeps.memory/memory at line 47 src/ai/test.cljs
Compiling src/ai/creep.cljs
Applying optimizations :advanced to 22 sources
... done. Elapsed 13.008752139 seconds
export SCREEPS_USERNAME and SCREEPS_PASSWORD (optionally SCREEPS_BRANCH) to autodeploy code.
Watching paths: /home/ccarpenter/git_repos/screeps-beans/src
(this on a different computer than last night so that's why it says ccarpenter instead of mordocai)
I'm guessing this is going to come down to a stupid typo/something i'm overlooking. That's usually my experience when things are hard to figure out like this
FWIW it works to build without optimizations :advanced, but it obviously isn't in an ideal form to use it on http://screeps.com.
Tried this with both :on and :off with no difference:
(let [start (System/nanoTime)]
(b/build "src"
{:output-to "release/main.js"
:output-dir "release"
:optimizations :advanced
:externs-validation :off
:verbose true})
(println "... done. Elapsed" (/ (- (System/nanoTime) start) 1e9) "seconds"))
@pat So that's interesting. With it set to :off I get the same thing as before. When set to :on I get a NullPointerException seen here http://paste.lisp.org/display/325552. Running it as
(require '[cljs.build.api :as b])
(println "Building ...")
(let [start (System/nanoTime)]
(b/build "src"
{:output-to "release/main.js"
:output-dir "release"
:optimizations :advanced
:closure-warnings {:externs-validation :on}
:verbose true})
(println "... done. Elapsed" (/ (- (System/nanoTime) start) 1e9) "seconds"))
Setting to :error and :warning get the same results as before, the "duplicate extern" error
@mordocai it may be that closure is just silent for the working repo, this will force you to know one way or the other
@pat With :closure-warnings {:externs-validation :error}
there is no difference in output from before (on the working repo).
can clojurescript tools inline images into css as webpack does?
and/or svgs
@jr so if I reference *ns*
in my defmacro
body it will be bound to the calling ns for each invocation?
Say, quick question: if I do an :optimizations :none
build and then follow it with an :optimizations :advanced
, is it necessary / recommended to run a lein clean
(or boot equivalent) in between? I suspect not, but I just thought I'd ask
@selfsame: Looked at that earlier but as the main README says, it's very early alpha and there's not been a lot of action since 2015.
@lambdacoder Thank you, that's pretty much what I figured after thinking about it for a while. But then my thoughts were that you could only do this to the CPU part of the program, that changing any GLSL would necessarily have to mean a restart of the WebGL state machine. But maybe I'm wrong on that?
@lambdacoder You don't happen to have a PoC lying around?