Fork me on GitHub
#clojurescript
<
2016-09-09
>
selfsame00:09:14

@nickt I think there's a bit of stuff in &env and &form as well

selfsame00:09:18

@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

mordocai04:09:13

At the end you can find a workaround, but I definitely consider it just that and not a solution

mordocai04:09:50

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 😩

wei05:09:00

can anyone recommend a good clojurescript setup for web scraping?

wei08:09:48

cool, thanks!

pesterhazy09:09:12

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?

pesterhazy09:09:02

now I'm switching on PersistentVector, Range, PersistentList etc. manually

pesterhazy10:09:33

@cursork, Seqable doesn't seem to exist, and ISeqable doesn't actually work in extend-protocol AFAICS

pesterhazy10:09:58

I can call seqable? but that would defeat the purpose of using a protocol 🙂

cursork10:09:08

(map #(instance? clojure.lang.Seqable %) [[] {} '() (lazy-seq (fn [] '())) (range)])

cursork10:09:13

That works for me

pesterhazy10:09:32

oh I'm talking about clojurescript

cursork10:09:44

Wrong channel!

anmonteiro10:09:34

@pesterhazy: I think there's ISequential but unable to confirm right now

pesterhazy10:09:21

there is (http://cljs.github.io/api/cljs.core/ISequential), but extending it to a protocol doesn't seem to do the job

dnolen13:09:56

@pesterhazy you can’t extend to all types under a protocol

dnolen13:09:46

the pattern in Clojure is that you can extend to an interface - but of course no good for JavaScript which doesn’t have those

pesterhazy13:09:06

@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?

dnolen13:09:35

@pesterhazy or just default + sequential? check

dnolen13:09:43

but yes - that’s right

dnolen13:09:23

one problem with the default approach is that satisfies? is always true

pesterhazy13:09:50

is explicitly mentioning classes faster than manually checking?

dnolen13:09:11

generally yes

dnolen13:09:43

it’s possible we could make extending to protocols work with more compiler support - but no one has taken on this particular challenge

pesterhazy13:09:00

cool, the manual approach works, I was just wondering if I was doing things wrong

dnolen13:09:41

nope that’s how it works for now

dnolen13:09:02

@timgilbert some compiler options like :advanced which generate different source will cause previously written files to be overwritten

dnolen13:09:29

it used to be this didn’t work very well - but a lot of enhancements have made it more and more reliable

dnolen13:09:17

so for dev (testing advanced) probably doesn’t matter - though for prod deploys I would probably always start clean

dnolen13:09:07

@yury.solovyov not aware of anything that does that yet

dnolen13:09:21

@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

dnolen13:09:07

@lambdacoder you should take a look at @kovasb’s Gamma, he tried to tackle exactly that problem

dnolen13:09:47

Oh oops @selfsame already mentioned it 🙂

yury.solovyov13:09:44

@dnolen soo, you just let css do the job of referencing proper icons?

dnolen13:09:24

I’m not writing much CSS these days so I’m not too worried about it

dnolen13:09:37

I did hear some people talk about using sass/compass at some point - perhaps that covers you?

yury.solovyov13:09:02

I wonder how do you handle icons components

yury.solovyov13:09:58

just css + classes + icon font or sprite?

yury.solovyov13:09:04

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

yury.solovyov13:09:01

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

dnolen13:09:05

yeah there’s not a one stop solution a la Webpack

am-a_metail13:09:41

@yury.solovyov - you can use postcss with a plugin?

yury.solovyov13:09:34

@am-a_metail not used postcss at all, also, I'm not sure how to integrate it into build process

nickt13:09:17

Webpack does base64 inlining of small images/fonts

am-a_metail13:09:50

@yury.solovyov - we use it, want an example?

yury.solovyov13:09:23

@am-a_metail that would be nice, but I'll be fine anyway 🙂

nickt13:09:06

^ I believe that's what webpacks does, if you're interested 🙂

am-a_metail13:09:09

@yury.solovyov - in order to make it cross platform we just put postcss into a lein-npm script in project.clj

am-a_metail14:09:03

(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}}}

am-a_metail14:09:07

Something like that

am-a_metail14:09:23

then lein npm run css

am-a_metail14:09:51

Or you can use a config file for a more elaborate setup

yury.solovyov14:09:59

where would output be?

am-a_metail14:09:11

in this case: resources/public/css/MetailStyles.css

am-a_metail14:09:27

But you can use a directory instead

yury.solovyov14:09:41

is there a way to copy files as part of build process? I need one to being cpoied over always

am-a_metail14:09:56

Yep - lein-resource

am-a_metail14:09:34

: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}

yury.solovyov14:09:32

awesome, thanks a ton

mordocai15:09:04

@dnolen Thanks, going to try that in a few minutes.

mordocai16:09:24

@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.

Jeremie Pelletier16:09:20

@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 🙂

dnolen16:09:27

@lambdacoder Kovas wrote a state abstraction

Jeremie Pelletier16:09:41

ohh sweet, didn’t see that part

dnolen16:09:31

@mordocai being in the library is a separate issue from messing up your build 🙂

Jeremie Pelletier16:09:53

oh I see, its gamma-driver handling the GL state, gamma itself is just to generate shaders

mordocai16:09:07

@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?

mordocai16:09:56

And i'm not sure how to put it in build.clj when the extern file is in a separate repo(the library), if that is what you are suggesting will work

fenton18:09:35

how do people spec predicate uuid's in clojurescript?

fenton19:09:11

This lib seems okay: