This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-05
Channels
- # bangalore-clj (4)
- # beginners (16)
- # boot (4)
- # cljs-dev (1)
- # cljsrn (2)
- # clojure (177)
- # clojure-italy (2)
- # clojure-nl (1)
- # clojure-russia (41)
- # clojure-spec (3)
- # clojure-uk (21)
- # clojurescript (46)
- # code-art (1)
- # datomic (10)
- # hoplon (125)
- # leiningen (1)
- # luminus (2)
- # lumo (1)
- # off-topic (10)
- # onyx (69)
- # re-frame (22)
- # reagent (4)
- # ring (32)
- # rum (6)
- # specter (2)
- # untangled (5)
Hey, how do I "`lein clean, cljsbuild once --SET_VAR=api-url=https://prod.site/api`"?? (something like command line env)
I’m trying to setup a dev environment for a service worker with boot-cljs but getting stuck on the :optimizations :none
output file it generates as it contains document.write
when I want it to use self.importScripts
but I can’t find where to override that - writing a custom boostrap file loses the generated content such as defines which is cumbersome
i could use :simple
optimizations but thats not ideal with reloading
Built one more Todolist in ClojureScript~ https://github.com/Memkits/pudica-schedule http://repo.tiye.me/Memkits/pudica-schedule/
I have a question, should I use .- length "some string"
or count "some string
? Which one is better for performance?
@luisdevlopez count
will use .-length
after a few if/else checks. So they'll be pretty much equivalent. Use what's more idiomatic: count
I'm using CLJS to do WEBGL. My code works fine under :optimizations :none
My code mungles some stuff under :optimiozatinos :advanced
What confuses me is as follows:
(. gl bindBuffer ...)
<-- bindBuffer does NOT get mungled
(. gl createVertexArray)
<-- createVertexArray does get mungled
what's going on?
@qqq it is called "maybe-incomplete default externs coming from various random places in versions you can hardly control”: https://github.com/google/closure-compiler/blob/1f7d74b3c06c95c0264bc6722e6b1af17e08f7b4/externs/browser/webgl.js#L1885
next up: reading about signed distance fields, evaluating bezier curves on shaders, and firuging out why, in 2017, rendering text is still so annoying in webgl
@darwin: I tried the aget, with strings, but I wasn't smart enough to figure out the .call part
so with .call, it beomces
(.call (aget obj "field") obj arg1 arg2)
where obj has to be passed tiwce, the first to extract the field, and the second as the 'this' element ?@souenzzo you can parametrise ClojureScript builds by using goog defines, e.g. take a look at https://clojurescript.org/reference/compiler-options#closure-defines
but I'm not sure if lein-cljsbuild allows to override compilation options like this in command line args, so in worst case you will need to create a different build id for each api-url and build that explicitly, e.g.: lein cljsbuild prod once
Hi guys. I have just started learning clojurescript and started with a leningen template.
The build was working initially , but now the figwheel repl is stuck and I see Please run lein figwheel to start the ClojureScript compiler and reload the page.
message. Where should I look for errors?
@shakdwipeea most likely the browser has lost the socket connection to figwheel. Restart the figwheel and reload the browser.
I have tried that multiple times. I tried to do lein clean
but nothing helped.
that's weird, because if you're seeing that, you are running js code compiled with figwheel.
Also when I open in firefox I can see the working application with hot reloading but not when I refresh.
The template was working initially. I changed some code, I will try to post a github link.
that could be because you hot reload to localhost:3449/uri-that-doesnt-exist-in-the-handler then reload and you see blank page. (just a theory)
I think that could be the reason, let me check.
often browser caching causes these issues
try a different browser altogether
yes I think it is , because on chromium Ctrl + R
seems to solve the problem
Ok i think I got it, it was a combination of both what you guys said, a rogue handler was not running on hot reload change and I think due to browser caching I was unable to debug them
It is now working on chromium and firefox but not on opera
I think that is mostly due to some caching issue ..
Thanks a lot guys
@qqq yes, .call
usage is quite verbose, but you write a wrapper function once, and then use it conveniently,
or via cljs-oops simply (ocall obj “field” arg1 arg2)
, it passes correct this to .call for you
Would it be a good idea to use clojurescript and reagent as a frontend for a java ee application?
Java EE is just your back end, it provides an API which the frontend (regardless of the technology it is written in) can take advantage of
React (and by extension reagent) is just a system to help in making the UI, it doesn't matter what your back end is
It starts to matter if you go full tilt and want to make an spa, since certain tools make server side rendering more manageable
I might be able to give better advice if you could share more about your application structure
So this is part of a school assignment. The course for this semester is Java EE. For this quartille we will make a simplistic twitter clone. The first part of this assignment is to build the back end, this is done with java ee api. What most of my class does is setup paraya/glassfish with a mysql database both on the local machine(I do it on my remote server). How it is expected of us to make this work is with a servlet that calls a service that calls a dao implementation. After the back end is done we get to the front end. School will use Angular as course material but we are encouraged to try something different so long we can explain the design pattern used. Important thing to note is that schools has us setup jenkins and artifactory as part of a CI/CD pipeline, though I think it should not be a problem to add Lein CLJS build as part of the jenkins build configuration.