Fork me on GitHub
#clojure-europe
<
2019-04-01
>
thomas07:04:05

so... other question related to Neo4J... I want to build a (simple) photo-library with a web front end. Use the JS api for Neo4J or do all the work on the back end?

thomas07:04:12

what would you advice?

otfrom07:04:59

I do wonder if using cljs means that it is a good idea to write a lot more in the browser now. Is there less need for a back end for the front end if the front end can use a good language? (with apologies to javascript)

otfrom07:04:46

I suppose the greater network delay still means you might want something closer to your data doing filtering if your backend services don't have good interfaces for it.

thomas07:04:03

I was wondering about that recently.... at work here we build a web site for a client and there is a react frontend, but it could have been 99% backend with just links to the back end to do stuff and next to no JS needed IMHO.

otfrom07:04:37

if you don't need much interactivity then server side rendering is a good idea

helios08:04:32

Definitely! And CLJC means that you can try to write very similar code (possibly the same code) for your frontend and backend. But yeah I am of the idea that you shouldn't do stuff client-side if there is no need. I think at work we'll be reworking public pages (i.e. logged out versions) into JS-less bits. That helps a lot with SEO too! 😄

otfrom08:04:41

@helios so why no big things on the client side? I can think that accessibility might be a bit harder and some people turn off js, but other than that?

otfrom08:04:12

the compiled js could be small and cached. If you have good rest interfaces on the data coming back then they can be cached as well.

mpenet08:04:34

seo can be solved with pre-rendering proxies

mpenet08:04:44

it's no longer such as big deal I believe

helios08:04:04

Didn't say necessarily not big things on the client-side, but avoiding to overcomplicate things when not needed 😄

mpenet08:04:10

Personally I am in favor of not doing anything related to the front-end on the servers anymore, makes everybody's job easier

helios08:04:12

i.e. low interactivity

mpenet08:04:49

Then sure. I guess if the UI is very simple and unlikely to change a lot why not

thomas08:04:48

I suspect that sometimes things are done on the frontend mainly because you can. And I do like CLJC... we recently had a case where there were lots of front end calculations... and then the customer wanted to get an Excel export functionality as well.. and suddenly all the JS code had to be duplicated in Java again. Big fail IMO.

helios08:04:02

We're now starting to experiment with re-frame in the backend too, so we can use (most of) the same code for SSR and Client-side 😄

otfrom09:04:08

I'm not sure the "don't do things on the client" necessarily makes sense if the same team/people are using cljc for both front and back end.

thomas09:04:15

in that case it makes sense... I agree... but if it is two different languages?