[jira] [Commented] (SLING-6763) Remove org.apache.sling.commons.json dependency from esx engine

2017-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-6763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15964339#comment-15964339
 ] 

ASF GitHub Bot commented on SLING-6763:
---

GitHub user labertasch opened a pull request:

https://github.com/apache/sling/pull/212

SLING-6763 |  fixed typo in readme for the test script foo.esx and up…

SLING-6763 |  fixed typo in readme for the test script foo.esx and updated 
parent pom to 30

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/labertasch/sling SLING-6763

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/sling/pull/212.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #212


commit a553ad0172a0757273c027f522acdedfbf2cf22f
Author: labertasch 
Date:   2017-04-11T13:07:25Z

SLING-6763 |  fixed typo in readme for the test script foo.esx and updated 
parent pom to 30




> Remove org.apache.sling.commons.json dependency from esx engine
> ---
>
> Key: SLING-6763
> URL: https://issues.apache.org/jira/browse/SLING-6763
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Reporter: Senol Tas
>Assignee: Bertrand Delacretaz
> Fix For: Scripting ESX 0.2.0
>
>
> remove org.apache.sling.commons.json dependency from esx engine and replace 
> with native build in nashorn JSON parser
> + minor updates in the demo package to showcase the usage of dynamically 
> changing handlebars templates based on selector.
> + added experimental es6 transpiler as preperation for sandboxing the engine
> + updated demo with es6 classes and imports
> i created a pull request on github:
> https://github.com/apache/sling/pull/209



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (SLING-6763) Remove org.apache.sling.commons.json dependency from esx engine

2017-04-11 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-6763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15964082#comment-15964082
 ] 

Bertrand Delacretaz commented on SLING-6763:


I have committed your contribution, thank you very much!

And also created a sibling org.apache.sling.fragment.nashorn fragment bundle 
which means you don't need to edit sling.properties anymore, just install that 
bundle to export the Nashorn API package.

However at revision 1790948 the minimal example from the README does not work 
for me, it outputs 

{code}
${currentNode.properties.title}Here's some example text
{code}

Without interpreting the {{currentNode.properties.title}} variable.

What I did is:
* Start a Sling trunk launchpad from scratch
* Install the org.apache.sling.fragment.nashorn fragment and esx bundles, 
verify that esx is active
* Run the minimal example from the README

The ESX engine is activated, it's just the interpretation of the readme test 
example variable that does not happen.


> Remove org.apache.sling.commons.json dependency from esx engine
> ---
>
> Key: SLING-6763
> URL: https://issues.apache.org/jira/browse/SLING-6763
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Reporter: Senol Tas
>Assignee: Bertrand Delacretaz
> Fix For: Scripting ESX 0.2.0
>
>
> remove org.apache.sling.commons.json dependency from esx engine and replace 
> with native build in nashorn JSON parser
> + minor updates in the demo package to showcase the usage of dynamically 
> changing handlebars templates based on selector.
> + added experimental es6 transpiler as preperation for sandboxing the engine
> + updated demo with es6 classes and imports
> i created a pull request on github:
> https://github.com/apache/sling/pull/209



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (SLING-6763) Remove org.apache.sling.commons.json dependency from esx engine

2017-04-10 Thread Oliver Lietz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-6763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15963179#comment-15963179
 ] 

Oliver Lietz commented on SLING-6763:
-

[~labertasch], have a look at Scripting Thymeleaf or Scripting FreeMarker for 
integration testing with Pax Exam.

> Remove org.apache.sling.commons.json dependency from esx engine
> ---
>
> Key: SLING-6763
> URL: https://issues.apache.org/jira/browse/SLING-6763
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Reporter: Senol Tas
>Assignee: Bertrand Delacretaz
> Fix For: Scripting ESX 0.2.0
>
>
> remove org.apache.sling.commons.json dependency from esx engine and replace 
> with native build in nashorn JSON parser
> + minor updates in the demo package to showcase the usage of dynamically 
> changing handlebars templates based on selector.
> + added experimental es6 transpiler as preperation for sandboxing the engine
> + updated demo with es6 classes and imports
> i created a pull request on github:
> https://github.com/apache/sling/pull/209



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (SLING-6763) Remove org.apache.sling.commons.json dependency from esx engine

2017-04-10 Thread Senol Tas (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-6763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15963106#comment-15963106
 ] 

Senol Tas commented on SLING-6763:
--

+ any help writing test-cases is appreciated. a blueprint which i could take up 
from would be also cool :-)

> Remove org.apache.sling.commons.json dependency from esx engine
> ---
>
> Key: SLING-6763
> URL: https://issues.apache.org/jira/browse/SLING-6763
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Apache Sling Scripting ESX 0.2.0
>Reporter: Senol Tas
>Assignee: Bertrand Delacretaz
>
> remove org.apache.sling.commons.json dependency from esx engine and replace 
> with native build in nashorn JSON parser
> + minor updates in the demo package to showcase the usage of dynamically 
> changing handlebars templates based on selector.
> + added experimental es6 transpiler as preperation for sandboxing the engine
> + updated demo with es6 classes and imports
> i created a pull request on github:
> https://github.com/apache/sling/pull/209



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (SLING-6763) Remove org.apache.sling.commons.json dependency from esx engine

2017-04-10 Thread Senol Tas (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-6763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15963103#comment-15963103
 ] 

Senol Tas commented on SLING-6763:
--

Thanks Bertrand for the Feedback.

I bundled the sling-babel implementation with the code and extended the maven 
build script to automatically install node dependencies. also adapted the 
README as it is not required to do separate installation for the demo anymore.
to test it: 
update the readme test example from:
```var output  = "" + currentNode.properties.title + "";
 to ```var output  = `${currentNode.properties.title}`;```
Which is the es6 template string, if this is getting rendered it is working.
as reference you can use: https://babeljs.io/learn-es2015/


> Remove org.apache.sling.commons.json dependency from esx engine
> ---
>
> Key: SLING-6763
> URL: https://issues.apache.org/jira/browse/SLING-6763
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Apache Sling Scripting ESX 0.2.0
>Reporter: Senol Tas
>Assignee: Bertrand Delacretaz
>
> remove org.apache.sling.commons.json dependency from esx engine and replace 
> with native build in nashorn JSON parser
> + minor updates in the demo package to showcase the usage of dynamically 
> changing handlebars templates based on selector.
> + added experimental es6 transpiler as preperation for sandboxing the engine
> + updated demo with es6 classes and imports
> i created a pull request on github:
> https://github.com/apache/sling/pull/209



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (SLING-6763) Remove org.apache.sling.commons.json dependency from esx engine

2017-04-10 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-6763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15962844#comment-15962844
 ] 

Bertrand Delacretaz commented on SLING-6763:


Also, minor typo, "decoreateScript" should be "decorateScript"

> Remove org.apache.sling.commons.json dependency from esx engine
> ---
>
> Key: SLING-6763
> URL: https://issues.apache.org/jira/browse/SLING-6763
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Apache Sling Scripting ESX 0.2.0
>Reporter: Senol Tas
>Assignee: Bertrand Delacretaz
>
> remove org.apache.sling.commons.json dependency from esx engine and replace 
> with native build in nashorn JSON parser
> + minor updates in the demo package to showcase the usage of dynamically 
> changing handlebars templates based on selector.
> + added experimental es6 transpiler as preperation for sandboxing the engine
> + updated demo with es6 classes and imports
> i created a pull request on github:
> https://github.com/apache/sling/pull/209



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (SLING-6763) Remove org.apache.sling.commons.json dependency from esx engine

2017-04-10 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-6763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15962835#comment-15962835
 ] 

Bertrand Delacretaz commented on SLING-6763:


Thanks for your contribution! 

The {{sling-babel.js}} file is quite long and looks like it might have been 
generated, as opposed to handwritten code, could you briefly explain what it's 
about and if generated how that happens?

Also, I don't see any changes under src/test which might indicate "suboptimal" 
test coverage, is there a way to test these new features? Does the demo package 
allows for doing that manually? If yes that's ok as a temporary state until 
there's stronger test coverage, which we should have before releasing this 
module.

> Remove org.apache.sling.commons.json dependency from esx engine
> ---
>
> Key: SLING-6763
> URL: https://issues.apache.org/jira/browse/SLING-6763
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Apache Sling Scripting ESX 0.2.0
>Reporter: Senol Tas
>Assignee: Bertrand Delacretaz
>
> remove org.apache.sling.commons.json dependency from esx engine and replace 
> with native build in nashorn JSON parser
> + minor updates in the demo package to showcase the usage of dynamically 
> changing handlebars templates based on selector.
> + added experimental es6 transpiler as preperation for sandboxing the engine
> + updated demo with es6 classes and imports
> i created a pull request on github:
> https://github.com/apache/sling/pull/209



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)