RE: JS Use API usability or limitations

2017-01-12 Thread lancedolan
Aha. Thanks, I was sure it was sure weird Rhino thing. It's hard to call it valid JavaScript either, though, as it's invalid in every single popular browser. That mozilla doc says "Non-standard. The Iterator function is a SpiderMonkey-specific feature, and will be removed at some point. " As a

Re: JS Use API usability or limitations

2017-01-12 Thread Jason Bailey
lways struck me as kind of wasteful. From: lancedolan <lance.do...@gmail.com> Sent: Wednesday, January 11, 2017 4:41 PM To: users@sling.apache.org Subject: RE: JS Use API usability or limitations No architectural reason - purely speed of development

RE: JS Use API usability or limitations

2017-01-11 Thread lancedolan
No architectural reason - purely speed of development reasons. Our team has switched from Java to Node.js on our other projects and are seeing real gains in dev time. We believe we could see the same faster development with lightweight JS files as opposed to traditional type-safe Java. I think

RE: JS Use API usability or limitations

2017-01-11 Thread Jason Bailey
@sling.apache.org Subject: RE: JS Use API usability or limitations Thank you for your time everybody! For posterity: First to clarify, my very specific question is how to iterate an iterable in the model-building logic (what us old timers might call a "backing bean"). I do already know that I c

RE: JS Use API usability or limitations

2017-01-11 Thread lancedolan
Thank you for your time everybody! For posterity: First to clarify, my very specific question is how to iterate an iterable in the model-building logic (what us old timers might call a "backing bean"). I do already know that I can use HTL to iterate the children, and I do recognize that in this

Re: JS Use API usability or limitations

2017-01-11 Thread Vlad Bailescu
Hi Lance! The problem is not the JS Use API but the way the JS Iterator is used. One should do: for (var [key, res] in Iterator(children)) { returnObj.content += res.name; } Also, Robert is right, you should strive to keep your business logic (use objects) as light as possible do the

Re: JS Use API usability or limitations

2017-01-11 Thread Robert Munteanu
Hi, On Tue, 2017-01-10 at 18:29 -0700, lancedolan wrote: > All I want to do is print out a resource's children resources. Using the HTL repl [1] I narrowed down the following way of listing child resources: template.html - ${properties.jcr:title} My siblings are:  

RE: JS Use API usability or limitations

2017-01-11 Thread Stefan Seifert
i've not tested your example but by reading the code i would say it should work like this conceptually. i think there is no "community consensus" on using the JS use API or not. i personally would advise to not use it for non-trivial tasks, because it creates a unhealthy combination of