Fork me on GitHub
#clojurescript
<
2016-09-02
>
shaunlebron00:09:48

@stbgz: the only way to retrieve cljs dependencies from Maven is through what i assume is a complex java library called Aether

shaunlebron00:09:55

cemerick wraps that library with his own, Pomegranate, which is used by lein and boot

shaunlebron00:09:56

so any cljs build tool will not be able to run without java as long as the only way to resolve dependencies is through a java library

stbgz00:09:44

so basically we have to translate aether from java to js

shaunlebron00:09:04

yup 👍, no one’s stepped up to it yet

Alex Miller (Clojure team)02:09:08

reading the Aether source code will remind you why you like Clojure

Alex Miller (Clojure team)03:09:00

it’s a generic dependency plugin framework with separate impls for all the actual Maven bits

Alex Miller (Clojure team)03:09:24

forced abstractions everywhere

Alex Miller (Clojure team)03:09:40

interfaces that are maps but don’t extend any of the Java collection map interfaces

Alex Miller (Clojure team)03:09:06

we owe cemerick a debt of gratitude for putting something tolerable in front of it :)

shaunlebron03:09:11

> Pomegranate: A sane Clojure API for Sonatype Aether

shaunlebron03:09:39

glad I have the pretext for that description now, thanks @alexmiller

shaunlebron03:09:23

i wonder if GWT can be used to compile it without much modification, that would be the dream

stbgz03:09:36

I thought about that

stbgz03:09:51

but gwt is pretty specific

shaunlebron03:09:51

and cemerick’s stuff can probably be mostly reused

stbgz03:09:19

it was my understanding that gwt was only doing some translation of certain classes to js

stbgz03:09:29

but now that I think about it that doesn’t make sense

stbgz03:09:42

you know it would be at least interesting to try it

shaunlebron03:09:18

i just don’t know enough about this, I feel like the rough parts would be to translate the IO calls, not just the syntax stuff

stbgz03:09:20

possibly but at least it gives you a head start

stbgz03:09:49

provided that the generated code is understandable at all

stbgz04:09:29

scratch that I don’t think gwt will do the trick classes need to extend ‘EntryPoint’ unless we go and modify the source code it wont work out the box

Jon05:09:34

@xcthulhu I use pure cljs because I want to escape from mutable stuffs in JavaScript world. For example, my virtual DOM is immutable, then I can make transformations to generate new virtual DOM, without worrying of breaking my library. In JavaScript it could be dangerous to modify virtual DOM and nobody would do that in normal code. Though cljs has its cost, I have to use it.

selfsame10:09:42

might be relevant to see another impl from aether 🙂

rnandan27313:09:51

How do we enable SEO for clojurescript apps? any suggestions?

xcthulhu13:09:26

@rnandan273 : You'll want to have some kind of server side rendoring

xcthulhu13:09:38

One way is to write your app in CLJS entirely and use node.js and use ReactDOMServer for rendering to plain HTML

xcthulhu13:09:59

(assuming you are using OM or Reagent)

rnandan27313:09:17

I am using re-frame for the app,

xcthulhu13:09:35

So another way (which you probably can't do given your data model) is to write all of your Reagent code so that it can function as plain hiccup, as @yogthos describes here - http://yogthos.net/posts/2015-11-24-Serverside-Reagent.html

yogthos13:09:17

note that you don’t usually have to do that for all your front-end

yogthos13:09:29

just the parts that need to show up statically

rnandan27313:09:00

currently i am implementing a online store that serves data via a recommendation engine

rnandan27313:09:12

the client asked me about SEO lately

xcthulhu13:09:34

I'm going to assume the backend is in Clojure...

rnandan27313:09:46

i am using the luminus framework

rnandan27313:09:59

with re-frame

xcthulhu13:09:14

Okay, so you are left with a final, unhappy option - call ReactDOMServer from Nashorn

xcthulhu13:09:28

Which has two problems:

xcthulhu13:09:36

(1) It's sloooowwwww

xcthulhu13:09:16

(2) Nashorn has a very crude JS implementation. It's a good idea to test against it with your unit test suite thoroughly before trying this option.

rnandan27313:09:18

I can convert this to without using re-frame as

rnandan27313:09:30

so what would be your suggestion?

xcthulhu13:09:06

It's hard to say, all of the choices are a lot of work.

rnandan27313:09:49

but in recommendation engine scenario how much of SEO will help

xcthulhu13:09:30

Could help a ton, actually

xcthulhu13:09:57

If you ever shop for things on Amazon, one important question is to ask "How much does the price fluctuate for this?"

xcthulhu13:09:09

A quick search shows a bunch of people are tracking the prices

xcthulhu13:09:52

Similarly, Amazon often fails to recommend alternatives - again, folks will often resort to Google when Amazon fails

xcthulhu13:09:32

Anyway, I think you could drop re-frame and just go with a localStorage atom instead - https://github.com/alandipert/storage-atom

rnandan27313:09:13

ok thanks for your suggestion, i will explore

xcthulhu13:09:47

And then have isomorphic code on the backend that takes an similar data-structure which is just munged from a database somewhere directly

rnandan27313:09:40

thanks a lot

dominicm14:09:01

I thought that google could process SPAs now? Therefore javascript-based pages were no longer an SEO concern?

rnandan27315:09:49

Thanks @dominicm for the article, it will help me

stbgz16:09:15

@selfsame that’s an interesting option we can probably compile to js

shaunlebron16:09:17

thanks for getting me to do this, @richiardiandrea ^

richiardiandrea16:09:30

@shaunlebron thaaanks!! I was worried that I pushed a little too much on that one :)

nickt17:09:29

hey all. Any om users here? How do I deal with props.children in om?

nickt17:09:44

specifically I want to write a button component which takes text as children and renders them as the button text

rohit17:09:15

@shaunlebron: I’ve got cljs code to recursively firstly find all the sub dependencies for a dependency and then download it to a folder. Its targetting node. Its pretty hacky but it works. https://github.com/ducky427/cljs-deps

nickt17:09:11

or rather... how do I pass all props arbitrarily to a component?

nickt17:09:30

What's wrong with this?

(defn button [props & children]
  (reify
    om/IRender
    (render [_]
      (dom/button #js
        {:className "my-button"}
        children))))

nickt17:09:13

it renders a bunch of weird <span> objects when I try to use it like (button nil "+")

dnolen17:09:48

@nickt there’s an #om channel btw

nickt17:09:58

@dnolen ah didn't know! thanks

nickt18:09:14

I can move this there

shaunlebron20:09:07

@rohit: nice! added it to the readme, i wonder what’s left to do?

rohit20:09:42

@shaunlebron: 1) it doesn’t check the hash of the file 2) only looks at maven and clojars 3) it doesn’t touch the default maven local repository ~/.m2 folder

rohit20:09:41

Also no error handling yet.

rohit20:09:34

That too.

rohit20:09:20

Its pretty basic right now and needs polish and tlc to get it at the same level as the java/clj implementations.

arohner20:09:31

Are there any twitter bootstrap-like frameworks that are Closure DCE compatible? I’m looking for something that a non-designer (i.e. me) can use to make a site that doesn’t look terrible, and doesn’t use jQuery (for size reasons)

shaunlebron20:09:34

@arohner: maybe try searching bootstrap alternatives and search goog.provide in their repos. I’m not aware of any, but I’ve used http://getskeleton.com which is just a pretty CSS file

arohner20:09:00

@shaunlebron interesting, thanks. I also found https://github.com/google/material-design-lite, which is 27kB

shaunlebron21:09:36

oh, cool, that’s nice