These are chat archives for canjs/canjs

12th
Mar 2016
Viktor Busko
@Lighttree
Mar 12 2016 09:48

Hi guys,
I'm doing some research for new project and would like to know some opinions. Basically we are using CanJS in scope of our Java application already. But this is still Java app with some CanJS insertions on couple of pages.
We are starting new stream (project) and I would like to go with full client-side app (with Java as web-services), but in some reason I can't just use DoneJS (it is awesome actually and do all the things that I need :D), mostly because there is couple of reasons from customer side (it will be hardly possible to have NodeJS on production) and tech-stack that already used on the project.
It seems that I have to create my own bicycle for build/deploy etc.
For now I see 2 ways:
1) go with NPM scripts (uglify-js, eslint, node-sass, etc) and build everything into one bundle. (this way seems easiest and straightforward to develop/maintain and since the app itself not so large, I think I don't really need progressive-loading)
2) go with WebPack :| (hard and painful, but functionality close to steal, seems like more future-proof)

Maybe someone has any suggestions or experience with such approaches :)

Mohamed Cherif Bouchelaghem
@cherifGsoul
Mar 12 2016 10:09
Hi @Lighttree I use this approach with PHP for non-single page applications where I use canjs in some parts like poll system or likes/deslikes widgets with comments etc
Viktor Busko
@Lighttree
Mar 12 2016 10:30
@cherifGsoul Hi, well actually this is how we work with CanJS also. But I'm trying to push CanJS (DoneJS if it will be possible) as main framework for single-page applications. And go from JSP pages to small single page apps. So I have to establish some process to build and deploy client-side apps, because currently we do it by some Java (maven etc.) and our custom tools.
Chris
@chrischrischris
Mar 12 2016 19:42
Hi, I'm trying out canjs for the first time and really enjoying it, however I've got a simple problem that I can't find an answer to: I have a Component that uses a .stache template loaded using can.view. The data for the component is loaded in the viewModel using articles: Article.findAll(). In my template I'm using {{#each articles}} but I get a "TypeError: Cannot use 'in' operator to search for 'xxx' in pending" which is happening as it's trying to render before the data is loaded. Any simple pointers for me?
Also interestingly if I don't use a property within the {{each}} loop, it loops 9 times before any data is even loaded
Chris
@chrischrischris
Mar 12 2016 20:01
And of course, once I ask for help online, I figure it out myself =). I've got it going thanks to the can.List.promise docs
Mohamed Cherif Bouchelaghem
@cherifGsoul
Mar 12 2016 21:09
@chrischrischris nice