This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-09
Channels
- # admin-announcements (1)
- # beginners (78)
- # boot (36)
- # cider (13)
- # cljs-dev (15)
- # cljsjs (3)
- # cljsrn (10)
- # clojure (99)
- # clojure-austin (1)
- # clojure-australia (1)
- # clojure-italy (14)
- # clojure-korea (17)
- # clojure-norway (1)
- # clojure-russia (42)
- # clojure-sg (1)
- # clojure-spec (50)
- # clojure-uk (80)
- # clojurebridge (24)
- # clojurescript (83)
- # community-development (10)
- # conf-proposals (36)
- # core-async (12)
- # cursive (20)
- # datomic (38)
- # hoplon (63)
- # lambdaisland (2)
- # leiningen (6)
- # nyc (2)
- # om (54)
- # om-next (52)
- # onyx (129)
- # planck (15)
- # re-frame (38)
- # reagent (2)
- # rethinkdb (8)
- # specter (1)
- # untangled (2)
@rovanion yes rough spots depending on the GLSL subset but webGL should be good to go. Pretty sure I've seen it swapping out shaders in a repl without a context reload
Btw, my problem is now a stackoverflow http://stackoverflow.com/questions/39397638/clojurescript-duplicate-extern-input-error.
At the end you can find a workaround, but I definitely consider it just that and not a solution
The build instructions here are what I currently have to do to get it to work https://gitlab.com/mordocai/my-screeps/blob/clojurescript/README.org 😩
@wei - maybe take a look at: https://github.com/michaelklishin/crawlista
If I want to extend a protocol to all sequential types (vector, list, range, lazy seq), is there a protocol I can use for that?
now I'm switching on PersistentVector, Range, PersistentList etc. manually
@pesterhazy Seqable?
@cursork, Seqable
doesn't seem to exist, and ISeqable
doesn't actually work in extend-protocol
AFAICS
I can call seqable?
but that would defeat the purpose of using a protocol 🙂
oh I'm talking about clojurescript
@pesterhazy: I think there's ISequential
but unable to confirm right now
there is (http://cljs.github.io/api/cljs.core/ISequential), but extending it to a protocol doesn't seem to do the job
@pesterhazy you can’t extend to all types under a protocol
the pattern in Clojure is that you can extend to an interface - but of course no good for JavaScript which doesn’t have those
@dnolen, I see. So the best bet it to enumerate all the specific classes I know and fall back to checking for sequential?
in the default case?
@pesterhazy or just default + sequential?
check
is explicitly mentioning classes faster than manually checking?
it’s possible we could make extending to protocols work with more compiler support - but no one has taken on this particular challenge
cool, the manual approach works, I was just wondering if I was doing things wrong
@timgilbert some compiler options like :advanced
which generate different source will cause previously written files to be overwritten
it used to be this didn’t work very well - but a lot of enhancements have made it more and more reliable
so for dev (testing advanced) probably doesn’t matter - though for prod deploys I would probably always start clean
@yury.solovyov not aware of anything that does that yet
@mordocai you have deps.cljs
under your src
directory - I would try removing that for now and explicitly supplying :externs
in your build.clj
file
@lambdacoder you should take a look at @kovasb’s Gamma, he tried to tackle exactly that problem
@dnolen soo, you just let css do the job of referencing proper icons?
I did hear some people talk about using sass/compass at some point - perhaps that covers you?
I wonder how do you handle icons components
like buttons
and lists
just css + classes + icon font or sprite?
I wonder how crazy/stupid it would be to make a macro that reads icons/fonts into base64 string and puts it into a map that components can reference
it is not a huge deal for me, I'll be fine even with pure css, just trying to understant what is current state of the art here
thanks anyway
@yury.solovyov - you can use postcss with a plugin?
@am-a_metail not used postcss at all, also, I'm not sure how to integrate it into build process
@yury.solovyov - we use it, want an example?
@am-a_metail that would be nice, but I'll be fine anyway 🙂
https://github.com/postcss/postcss-url is even more generic
@yury.solovyov - in order to make it cross platform we just put postcss into a lein-npm script in project.clj
(def css-command
"lessc --no-color less/MetailStyles.less | postcss --use autoprefixer -o resources/public/css/MetailStyles.css")
...
:npm {:dependencies [[less "2.5.3"]
[postcss-cli "2.5.2"]
[autoprefixer "6.3.6"]]
:package {:scripts
{:css ~css-command}}}
Something like that
then lein npm run css
Or you can use a config file for a more elaborate setup
where would output be?
in this case: resources/public/css/MetailStyles.css
But you can use a directory instead
is there a way to copy files as part of build process? I need one to being cpoied over always
Yep - lein-resource
:resource {:resource-paths ["resources/public"]
:target-path "target"
:includes [#".*"]
:excludes [#".*~"
#"resources/public/.*\.html"]
:silent false
:verbose false
:skip-stencil [#"resources/public/css/.*"
#"resources/public/fonts/.*"
#"resources/public/img/.*"
#"resources/public/svg/.*"]
:extra-values nil}
For example
awesome, thanks a ton
No problem
@dnolen So it doesn't seem like the :externs in build.clj will work when I want the library(screeps-beans) to be providing the externs? Since I have to give a path in the current source repo right? I've actually got it working if I drop trying to have the extern in the library, but I really want it to be in the library.
@dnolen isn’t Gamma just a pure function of data to glsl text? AFAIK you still have to manually keep track of your programs and recompile/relink the updated ones on figwheel’s reload 🙂
@lambdacoder Kovas wrote a state abstraction
ohh sweet, didn’t see that part
oh I see, its gamma-driver handling the GL state, gamma itself is just to generate shaders
@dnolen Not sure if i'm 100% understanding. So if I move the extern file and deps.cljs to my main repo instead of in the library the build works fine with no "duplicate extern input" error. However, if I have the same in the library I get the duplicate extern error. So the build issue -appears- to be due to loading it as a library?