SlideShare a Scribd company logo
1 of 49
Download to read offline
grooscript
@grooscript
http://grooscript.org
Jorge Franco
0.5
About me
Developer, I love it
Lazy in english at school
Living in Madrid
Working at Osoco
Grooscript developer
@jfrancoleza
jorge.franco.leza@gmail.com
The players
Web developer
Leave your
comfort zone
Move to
the client side
Doesnā€™t run!
on browsers
Do something!
No excuses
You can do a library,
resolve issues,
create a plugin,
give feedback,
help other projects,
ā€¦
!
You will learn a lot
The wire
Groovy to Javascript converter
Groovy 2 to Javascript ECMAScript 5
Open source project, Apache 2 license
Library with Groovy and GPars dependencies
No special Javascript objects or functions
Converted code requires grooscript.js to run
Different conversion options
Grails plugin, npm package, gradle plugin
What is grooscript?
File.groovy File.js
Conversion!
Options
grooscript.js
Convert Groovy ļ¬les
Groovy code
def sayHello = { -> println "Hello ${it}!" }	
[ā€˜Groovy', ā€˜JavaScript', 'GrooScript'].each sayHello	
!
assert [1, 2, 3].size() == 3	
class Amazing {}	
!
amazing = new Amazing()	
amazing.metaClass.who = []	
amazing.metaClass.add = { who << it}	
!
amazing.add 'Rafa Nadal'	
assert amazing.who.size() == 1
Javascript result
function Amazing() {	
var gSobject = gs.inherit(gs.baseClass,'Amazing');	
gSobject.clazz = { name: 'Amazing', simpleName: 'Amazing'};	
gSobject.clazz.superclass = { name: 'java.lang.Object', simpleName: 'Object'};	
if (arguments.length == 1) {gs.passMapToObject(arguments[0],gSobject);};	
	
return gSobject;	
};	
var sayHello = function(it) {	
return gs.println("Hello " + (it) + "!");	
};	
gs.mc(gs.list(["Groovy" , "JavaScript" , "GrooScript"]),"each",[sayHello]);	
gs.assert(gs.equals(gs.mc(gs.list([1 , 2 , 3]),"size",[]), 3), null);	
amazing = Amazing();	
gs.sp((amazing = gs.metaClass(amazing)),"who",gs.list([]));	
gs.sp((amazing = gs.metaClass(amazing)),"add",function(it) {	
return gs.mc(gs.fs('who', this),'leftShift', gs.list([it]));	
});	
gs.mc(amazing,"add",["Rafa Nadal"]);	
gs.assert(gs.equals(gs.mc(gs.gp(amazing,"who"),"size",[]), 1), null);
Class
Default constructor
Function
New
Javascript
Groovy
Java
MoreJavascriptfriendly
Types, inheritance, java 8, ā€¦
metaClass
Lists
Closures
Operators
Dslā€™s
Expando
Maps
beans
methodMissing
Mixins
Categories
Traits
delegate
propertyMissing
Using converted code in javascript
Create classes
NameClass();
Default constructor with js object
NameClass({property: value, data: 1});
Call methods, basic parameters
myObject.method(params);
Access properties
myObject.property = 4;
Use functions as closures
list.each(function () { ā€¦ });
Traits
Metaprogramming
Mixins, Categories
Groovy types
gs.map({});
gs.set();
gs.range(1, 5);
gs.date();
gs.regExp();
gs.stringBuffer();
ā€¦
Groovy list functions added to js lists
Added some functions to numbers and strings
(1).times(function () {});
ā€œGroovyā€.startsWith();
ā€œHelloā€.replaceAll();
Added curry to functions
Convert objects ā€˜to groovyā€™ or ā€˜to javascriptā€™
gs.toGroovy(javaScriptList, NameClass);
gs.toJavascript(myGroovyObject);
Operators
Groovy truth
equals
getters and setters
Conversions
gs.toGroovy(obj, Type);
gs.toJavascript();
Limitations
Groovy / Java not fully supported
Working in groovy-core
No good support for inheritance (super)
No methods with same name
Basic support in metaClass
No packages, no classes with same name
No metainfo, expandoMetaClass, ā€¦
Only AST transformations applied in semantic phase
No complex Java / Groovy types (LinkedList,ā€¦)
ā€¦ see documentation for more info on grooscript.org
Directly convert code
@Grab(ā€˜org.grooscript:grooscript:0.5ā€™)	
!
import org.grooscript.GrooScript	
!
//Convert a fragment code	
String jsResult = GrooScript.convert(ā€œprintln ā€˜Hello!ā€™ā€)	
!
//Convert some file or folder, generate .js files with same name	
GrooScript.convert(ā€˜path/to/file.groovyā€™, ā€˜destination/folderā€™)	
GrooScript.convert(ā€˜path/to/folderā€™, ā€˜destination/folderā€™)	
GrooScript.convert(listOfFilesAndOrFolders, ā€˜destination/folderā€™)
Conversion options
convertDependencies - boolean - default true
classPath - List<String> or String - default null - Ex: ā€˜src/groovyā€™
customization - Closure - default null
mainContextScope - List<String> - default null
initialText / ļ¬nalText - String - default null
recursive - boolean - default false
//Set a conversion property	
GrooScript.setConversionProperty(ā€˜convertDependenciesā€™, false)	
GrooScript.setConversionProperty(ā€˜customizationā€™, {	
	 ast(TypeChecked)	
})
Convert dependencies option
Car.groovy
Wheel.groovy
Car.js
convert
== option
wheel
code
included
Main context scope
Customization
ā€¢ Requires Groovy 2.1, the closure is passed to withConļ¬g(conf)
ā€¢ More info in http://docs.codehaus.org/display/GROOVY/Advanced+compiler+conļ¬guration
ā€¢ Sometimes you donā€™t know where to ļ¬nd a variable
ā€¢ When conversion is done, some variables come from other contexts
ā€¢ grooscript.js sometimes tries to ļ¬nd missed variables with eval
ā€¢ Node.js eval not working same way that browsers do
ā€¢ You can deļ¬ne variables or function names with this option
ā€¢ Ex. [ā€˜$ā€™, ā€˜myAwesomeFunctionā€™, ā€˜myMissedVariableā€™]
Feature: Annotations
@GsNotConvert @GsNative
Feature: Daemon
>phantomjs myTest.js
Inject
grooscript.js
and jquery
Use Groovy
script abilities
I want to
be Groovy
@AST
http://phantomjs.org/
Please
code in
Groovy!
Mandatory Screen capture Before start test
More console info
Accept basic parameters
Works ļ¬ne in GroovyTestCase
Not so well in Spock
Have to
deļ¬ne
Phantom.js
path
Feature: PhantomJsTest
Example
@GrabConfig(systemClassLoader = true)	
@Grab(ā€˜org.grooscript:grooscript:0.5ā€™)	
!
import org.grooscript.asts.PhantomJsTest	
!
//Need phantoms installed	
System.setProperty(ā€˜PHANTOMJS_HOMEā€™, ā€˜path/to/phantomjsā€™)	
!
@PhantomJsTest(url = ā€˜http://www.grails.orgā€™)	
void grailsSiteChecks() {	
	 assert $(ā€˜aā€™).size() > 50, ā€œNot enough links ${$(ā€˜aā€™).size()}ā€	
	 def title = $(ā€œtitleā€)	
	 assert title[0].text == ā€˜Grails - The search is over.ā€™	
	 $(ā€˜aā€™).each {	
	 	 println it	
	 }	
}	
!
//Run phantomjs test	
grailsSiteChecks()
package org.grooscript.builder	
!
class HtmlBuilder {	
!
String html	
!
static String build(@DelegatesTo(HtmlBuilder) Closure closure) {	
def mc = new ExpandoMetaClass(HtmlBuilder, false, true)	
mc.initialize()	
def builder = new HtmlBuilder()	
builder.metaClass = mc	
closure.delegate = builder	
closure()	
!
builder.html	
}	
!
def yield(String text) {	
html += text	
}	
!
def methodMissing(String name, args) { ā€¦ }	
}	
Feature: html builder
def result = HtmlBuilder.build {	
body {	
ul(class: 'list', id: 'mainList') {	
2.times { number ->	
li number + 'Hello!'	
}	
}	
}	
}	
!
assert result == ā€˜<body><ul class='list'
id='mainList'><li>0Hello!</li><li>1Hello!</
li></ul></body>ā€™
grooscript-builder.js
Feature: jquery tools
package org.grooscript.jquery	
!
interface GQuery {	
def bind(String selector, target, String nameProperty)	
def bind(String selector, target, String nameProperty, 	
	 	 Closure closure)	
boolean existsId(String id)	
boolean existsName(String name)	
boolean existsGroup(String name)	
void bindEvent(String id, String name, Closure func)	
void doRemoteCall(String url, String type, params, 	
	 	 Closure onSuccess, Closure onFailure)	
void doRemoteCall(String url, String type, params, 	
	 	 Closure onSuccess, Closure onFailure, objectResult)	
void onReady(Closure func)	
void html(String selector, String text)	
}
import org.grooscript.jquery	
!
GQuery gQuery = new GQueryImpl()
gQueryImpl.js
Feature: binder
grooscript-binder.js
package org.grooscript.jquery	
!
class Binder {	
!
GQuery gQuery = new GQueryImpl()	
!
def bindAllProperties(target, closure = null) {	
target.properties.each { name, value ->	
if (gQuery.existsId(name)) {	
gQuery.bind("#$name", target, name, closure)	
}	
if (gQuery.existsName(name)) {	
gQuery.bind("[name='$name']", target, name, closure)	
}	
if (gQuery.existsGroup(name)) {	
gQuery.bind("input:radio[name=${name}]", target, name, closure)	
}	
}	
}	
!
def bindAllMethods(target) {	
target.metaClass.methods.each { method ->	
if (method.name.endsWith('Click')) {	
def shortName = method.name.substring(0, method.name.length() - 5)	
if (gQuery.existsId(shortName)) {	
gQuery.bindEvent(shortName, 'click', target.&"${method.name}")	
}	
}	
}	
}	
!
def call(target, closure = null) {	
bindAllProperties(target, closure)	
bindAllMethods(target)	
}	
}
Bind an instance properties to
input elements, by Id or name
Bind on click events to an
instance methods
new Binder()(myInstance)
grooscript-binder.js
grooscript.js
grooscript.min.js
grooscript-builder.js
grooscript-all.js
gQueryImpl.js
inside the jar, servlet 3.0: META-INF/resources
http://grooscript.org/downloads.html
Websockets with Vert.x
https://github.com/chiquitinxx/demoGroovyMeteor
http://www.meteor.com
https://vimeo.com/59395085
https://github.com/chiquitinxx/grooscript-vertx-plugin
http://www.grails.org/plugin/grooscript-vertx
v 0.4
Grooscript Vert.x Plugin
Convert Groovy code to Javascript
Run conversion daemon
Websockets
Eventbus bridge
New port open
Events in the client
Auto reload pages
Both are optional
http://grooscript.org/pluginManual/
v 1.3.1
Requires Java 1.7
Differences?Renders
on server
Renders
on the client
Conversions are cached with cache plugin
Grooscript tags auto - import js ļ¬les needed
Grails
port 8080
Vert.x
port 8085
Browser
gsp
eventBus
http
websockets
Conļ¬g.groovy
BootStrap.groovy Chat sample
main.gsp
More eventsHtml Builder
Where
Listen events Render on load
Send event message
= println
Execute on event message
Donā€™t use ${} in grooscript tags
Strong dependency Resources plugin
Can put code in a .groovy ļ¬le
Domain classes in the client*
*Experimental, it requires Groovy 2.1 (grails 2.3)
ā€¢ validate, clientValidations **
ā€¢ hasErrors
ā€¢ count
ā€¢ list * without params
ā€¢ get
ā€¢ save * without params
ā€¢ delete
Domain classes connected with the server*
*Experimental, it requires Groovy 2.1 (grails 2.3)
ā€¢ list
ā€¢ get
ā€¢ save
ā€¢ delete
PhantomJs Tests*
*Not working in Grails 2.3, need improvements
New test phase phantomjs
Tests in test/phantomjs
More features
features, featuresā€¦
next release - new plugin - remove vert.x
From resources plugin to Require.js or Asset pipeline plugin
Improve domain options
PhantomJs tests improvements
Move to websockets/sockJs/stomp with Spring 4 in grails 2.4
and many moreā€¦
Remote domain class to grails REST support
https://github.com/chiquitinxx/grooscript-gradle-plugin
v 0.3
Gradle plugin
Add in your build.gradle
http://grooscript.wordpress.com/2014/02/22/starting-with-grooscript/
buildscript {	
repositories {	
mavenCentral()	
}	
dependencies {	
classpath 'org.grooscript:grooscript-gradle-plugin:0.3'	
}	
}	
!
apply plugin: 'grooscript'	
!
//If you need to change any conversion option, can do this way, optional	
grooscript {	
source = [ā€˜src/main/groovy/presenters']	
}
Create more conversion tasks: http://grooscript.wordpress.com/2014/01/31/61/
Converted ļ¬les destination
Require.js setup ļ¬le
Files to be converted
Demo springboot
http://projects.spring.io/spring-boot/
REST - Require.js - Grooscript Gradle Plugin - Websockets - Mongo
https://github.com/chiquitinxx/springboot-rest-demo
https://github.com/chiquitinxx/grooscript/tree/master/npm
Example using node.js colors npm module
Node.js is very fast!
http://grooscript.wordpress.com/2014/01/10/impressive-node-js-v8-speed/
https://github.com/chiquitinxx/colors
Final topics
Why would I use grooscript?
ā€¢ Create small modules to use in your views
ā€¢ You can continue developing in Groovy
ā€¢ Can use dslā€™s, typeCheck, ASTā€™s,ā€¦ in the browser
ā€¢ You have all the java tools and IDEā€™s
ā€¢ You can work with new Javascript tools from Groovy
ā€¢ Donā€™t repeat code in two languages
ā€¢ Single development environment
ā€¢ Create your own architecture in Groovy
ā€¢ Donā€™t learn another ā€œto Javascriptā€ tool
Community will decide
Future
Version 0.5, you can improve
I will continue improving grooscript
Never will support full Groovy / Java
Iā€™m learning a lot, very fun
New grails plugin in summer
Focus next version: more and better java and groovy support
Questions?
Thank you!
All people reading this
680 motivation clicks
Jetbrains for IntelliJ IDEA v13 open source license
Special thanks to RenƩ, @glaforge @marioggar
@CedricChampeau @burtbeckwith

More Related Content

What's hot

(Greach 2015) Dsl'ing your Groovy
(Greach 2015) Dsl'ing your Groovy(Greach 2015) Dsl'ing your Groovy
(Greach 2015) Dsl'ing your GroovyAlonso Torres
Ā 
Flutter ę˜Æ什éŗ¼ļ¼Ÿē”Ø Flutter ꜃ēœåˆ°ę™‚é–“å—Žļ¼Ÿ @ GDG Devfest2020
Flutter ę˜Æ什éŗ¼ļ¼Ÿē”Ø Flutter ꜃ēœåˆ°ę™‚é–“å—Žļ¼Ÿ @ GDG Devfest2020Flutter ę˜Æ什éŗ¼ļ¼Ÿē”Ø Flutter ꜃ēœåˆ°ę™‚é–“å—Žļ¼Ÿ @ GDG Devfest2020
Flutter ę˜Æ什éŗ¼ļ¼Ÿē”Ø Flutter ꜃ēœåˆ°ę™‚é–“å—Žļ¼Ÿ @ GDG Devfest2020Johnny Sung
Ā 
Making Java Groovy (JavaOne 2013)
Making Java Groovy (JavaOne 2013)Making Java Groovy (JavaOne 2013)
Making Java Groovy (JavaOne 2013)Ken Kousen
Ā 
Lift off with Groovy 2 at JavaOne 2013
Lift off with Groovy 2 at JavaOne 2013Lift off with Groovy 2 at JavaOne 2013
Lift off with Groovy 2 at JavaOne 2013Guillaume Laforge
Ā 
groovy rules
groovy rulesgroovy rules
groovy rulesPaul King
Ā 
JavaCro 2016 - From Java to Groovy: Adventure Time!
JavaCro 2016 - From Java to Groovy: Adventure Time!JavaCro 2016 - From Java to Groovy: Adventure Time!
JavaCro 2016 - From Java to Groovy: Adventure Time!IvĆ”n LĆ³pez MartĆ­n
Ā 
Gradle in a Polyglot World
Gradle in a Polyglot WorldGradle in a Polyglot World
Gradle in a Polyglot WorldSchalk CronjƩ
Ā 
Functional Programming with Groovy
Functional Programming with GroovyFunctional Programming with Groovy
Functional Programming with GroovyArturo Herrero
Ā 
Introduction to Groovy runtime metaprogramming and AST transforms
Introduction to Groovy runtime metaprogramming and AST transformsIntroduction to Groovy runtime metaprogramming and AST transforms
Introduction to Groovy runtime metaprogramming and AST transformsMarcin Grzejszczak
Ā 
Go 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoGo 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoRodolfo Carvalho
Ā 
tictactoe groovy
tictactoe groovytictactoe groovy
tictactoe groovyPaul King
Ā 
Little Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinLittle Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinKai Koenig
Ā 
Eclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To GroovyEclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To GroovyAndres Almiray
Ā 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Guillaume Laforge
Ā 
groovy transforms
groovy transformsgroovy transforms
groovy transformsPaul King
Ā 
Š”Š¼ŠøтрŠøŠ¹ ŠŠµŃŃ‚ŠµŃ€ŃƒŠŗ, ŠŸŠ°Ń‚Ń‚ŠµŃ€Š½Ń‹ ŠæрŠ¾ŠµŠŗтŠøрŠ¾Š²Š°Š½Šøя Š² XXI Š²ŠµŠŗŠµ
Š”Š¼ŠøтрŠøŠ¹ ŠŠµŃŃ‚ŠµŃ€ŃƒŠŗ, ŠŸŠ°Ń‚Ń‚ŠµŃ€Š½Ń‹ ŠæрŠ¾ŠµŠŗтŠøрŠ¾Š²Š°Š½Šøя Š² XXI Š²ŠµŠŗŠµŠ”Š¼ŠøтрŠøŠ¹ ŠŠµŃŃ‚ŠµŃ€ŃƒŠŗ, ŠŸŠ°Ń‚Ń‚ŠµŃ€Š½Ń‹ ŠæрŠ¾ŠµŠŗтŠøрŠ¾Š²Š°Š½Šøя Š² XXI Š²ŠµŠŗŠµ
Š”Š¼ŠøтрŠøŠ¹ ŠŠµŃŃ‚ŠµŃ€ŃƒŠŗ, ŠŸŠ°Ń‚Ń‚ŠµŃ€Š½Ń‹ ŠæрŠ¾ŠµŠŗтŠøрŠ¾Š²Š°Š½Šøя Š² XXI Š²ŠµŠŗŠµSergey Platonov
Ā 
Ast transformation
Ast transformationAst transformation
Ast transformationGagan Agrawal
Ā 

What's hot (20)

Groovy & Grails
Groovy & GrailsGroovy & Grails
Groovy & Grails
Ā 
(Greach 2015) Dsl'ing your Groovy
(Greach 2015) Dsl'ing your Groovy(Greach 2015) Dsl'ing your Groovy
(Greach 2015) Dsl'ing your Groovy
Ā 
Flutter ę˜Æ什éŗ¼ļ¼Ÿē”Ø Flutter ꜃ēœåˆ°ę™‚é–“å—Žļ¼Ÿ @ GDG Devfest2020
Flutter ę˜Æ什éŗ¼ļ¼Ÿē”Ø Flutter ꜃ēœåˆ°ę™‚é–“å—Žļ¼Ÿ @ GDG Devfest2020Flutter ę˜Æ什éŗ¼ļ¼Ÿē”Ø Flutter ꜃ēœåˆ°ę™‚é–“å—Žļ¼Ÿ @ GDG Devfest2020
Flutter ę˜Æ什éŗ¼ļ¼Ÿē”Ø Flutter ꜃ēœåˆ°ę™‚é–“å—Žļ¼Ÿ @ GDG Devfest2020
Ā 
Making Java Groovy (JavaOne 2013)
Making Java Groovy (JavaOne 2013)Making Java Groovy (JavaOne 2013)
Making Java Groovy (JavaOne 2013)
Ā 
Lift off with Groovy 2 at JavaOne 2013
Lift off with Groovy 2 at JavaOne 2013Lift off with Groovy 2 at JavaOne 2013
Lift off with Groovy 2 at JavaOne 2013
Ā 
groovy rules
groovy rulesgroovy rules
groovy rules
Ā 
JavaCro 2016 - From Java to Groovy: Adventure Time!
JavaCro 2016 - From Java to Groovy: Adventure Time!JavaCro 2016 - From Java to Groovy: Adventure Time!
JavaCro 2016 - From Java to Groovy: Adventure Time!
Ā 
OpenLogic
OpenLogicOpenLogic
OpenLogic
Ā 
Gradle in a Polyglot World
Gradle in a Polyglot WorldGradle in a Polyglot World
Gradle in a Polyglot World
Ā 
Groovy 2.0 webinar
Groovy 2.0 webinarGroovy 2.0 webinar
Groovy 2.0 webinar
Ā 
Functional Programming with Groovy
Functional Programming with GroovyFunctional Programming with Groovy
Functional Programming with Groovy
Ā 
Introduction to Groovy runtime metaprogramming and AST transforms
Introduction to Groovy runtime metaprogramming and AST transformsIntroduction to Groovy runtime metaprogramming and AST transforms
Introduction to Groovy runtime metaprogramming and AST transforms
Ā 
Go 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoGo 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX Go
Ā 
tictactoe groovy
tictactoe groovytictactoe groovy
tictactoe groovy
Ā 
Little Helpers for Android Development with Kotlin
Little Helpers for Android Development with KotlinLittle Helpers for Android Development with Kotlin
Little Helpers for Android Development with Kotlin
Ā 
Eclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To GroovyEclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To Groovy
Ā 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007
Ā 
groovy transforms
groovy transformsgroovy transforms
groovy transforms
Ā 
Š”Š¼ŠøтрŠøŠ¹ ŠŠµŃŃ‚ŠµŃ€ŃƒŠŗ, ŠŸŠ°Ń‚Ń‚ŠµŃ€Š½Ń‹ ŠæрŠ¾ŠµŠŗтŠøрŠ¾Š²Š°Š½Šøя Š² XXI Š²ŠµŠŗŠµ
Š”Š¼ŠøтрŠøŠ¹ ŠŠµŃŃ‚ŠµŃ€ŃƒŠŗ, ŠŸŠ°Ń‚Ń‚ŠµŃ€Š½Ń‹ ŠæрŠ¾ŠµŠŗтŠøрŠ¾Š²Š°Š½Šøя Š² XXI Š²ŠµŠŗŠµŠ”Š¼ŠøтрŠøŠ¹ ŠŠµŃŃ‚ŠµŃ€ŃƒŠŗ, ŠŸŠ°Ń‚Ń‚ŠµŃ€Š½Ń‹ ŠæрŠ¾ŠµŠŗтŠøрŠ¾Š²Š°Š½Šøя Š² XXI Š²ŠµŠŗŠµ
Š”Š¼ŠøтрŠøŠ¹ ŠŠµŃŃ‚ŠµŃ€ŃƒŠŗ, ŠŸŠ°Ń‚Ń‚ŠµŃ€Š½Ń‹ ŠæрŠ¾ŠµŠŗтŠøрŠ¾Š²Š°Š½Šøя Š² XXI Š²ŠµŠŗŠµ
Ā 
Ast transformation
Ast transformationAst transformation
Ast transformation
Ā 

Viewers also liked

Dosa staff mtg_e_chazin_24sept2010
Dosa staff mtg_e_chazin_24sept2010Dosa staff mtg_e_chazin_24sept2010
Dosa staff mtg_e_chazin_24sept2010The Chazin Group LLC
Ā 
Sales Marketing Tandem
Sales Marketing TandemSales Marketing Tandem
Sales Marketing TandemChristian Maurer
Ā 
GR8Conf 2011: STS DSL Support
GR8Conf 2011: STS DSL SupportGR8Conf 2011: STS DSL Support
GR8Conf 2011: STS DSL SupportGR8Conf
Ā 
Pencernaan Daninurriyadi
Pencernaan DaninurriyadiPencernaan Daninurriyadi
Pencernaan Daninurriyadiguest8ced8a
Ā 
GR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf 2011: Tuning Grails Applications by Peter LedbrookGR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf 2011: Tuning Grails Applications by Peter LedbrookGR8Conf
Ā 
GR8Conf 2011: GORM Optimization
GR8Conf 2011: GORM OptimizationGR8Conf 2011: GORM Optimization
GR8Conf 2011: GORM OptimizationGR8Conf
Ā 

Viewers also liked (7)

Dosa staff mtg_e_chazin_24sept2010
Dosa staff mtg_e_chazin_24sept2010Dosa staff mtg_e_chazin_24sept2010
Dosa staff mtg_e_chazin_24sept2010
Ā 
Sales Marketing Tandem
Sales Marketing TandemSales Marketing Tandem
Sales Marketing Tandem
Ā 
GR8Conf 2011: STS DSL Support
GR8Conf 2011: STS DSL SupportGR8Conf 2011: STS DSL Support
GR8Conf 2011: STS DSL Support
Ā 
School Prep Hhs 07 Oct09
School Prep Hhs 07 Oct09School Prep Hhs 07 Oct09
School Prep Hhs 07 Oct09
Ā 
Pencernaan Daninurriyadi
Pencernaan DaninurriyadiPencernaan Daninurriyadi
Pencernaan Daninurriyadi
Ā 
GR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf 2011: Tuning Grails Applications by Peter LedbrookGR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
Ā 
GR8Conf 2011: GORM Optimization
GR8Conf 2011: GORM OptimizationGR8Conf 2011: GORM Optimization
GR8Conf 2011: GORM Optimization
Ā 

Similar to Convert Groovy to Javascript with GrooScript

Grooscript greach 2015
Grooscript greach 2015Grooscript greach 2015
Grooscript greach 2015Jorge Franco Leza
Ā 
Grooscript gr8conf 2015
Grooscript gr8conf 2015Grooscript gr8conf 2015
Grooscript gr8conf 2015Jorge Franco Leza
Ā 
Svcc Groovy Testing
Svcc Groovy TestingSvcc Groovy Testing
Svcc Groovy TestingAndres Almiray
Ā 
Introduction To Groovy
Introduction To GroovyIntroduction To Groovy
Introduction To Groovymanishkp84
Ā 
Groovy And Grails JUG Padova
Groovy And Grails JUG PadovaGroovy And Grails JUG Padova
Groovy And Grails JUG PadovaJohn Leach
Ā 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...Guillaume Laforge
Ā 
Groovy & Grails: Scripting for Modern Web Applications
Groovy & Grails: Scripting for Modern Web ApplicationsGroovy & Grails: Scripting for Modern Web Applications
Groovy & Grails: Scripting for Modern Web Applicationsrohitnayak
Ā 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with GroovyAli Tanwir
Ā 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Wsloffenauer
Ā 
Boosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyBoosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyJames Williams
Ā 
Javaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingJavaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingAndres Almiray
Ā 
Introduction to Grails Framework
Introduction to Grails FrameworkIntroduction to Grails Framework
Introduction to Grails FrameworkPT.JUG
Ā 
What's New in Groovy 1.6?
What's New in Groovy 1.6?What's New in Groovy 1.6?
What's New in Groovy 1.6?Guillaume Laforge
Ā 
Groovy for Java Developers
Groovy for Java DevelopersGroovy for Java Developers
Groovy for Java DevelopersAndres Almiray
Ā 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneAndres Almiray
Ā 
Android Bootstrap
Android BootstrapAndroid Bootstrap
Android Bootstrapdonnfelker
Ā 
Groovy Metaprogramming for Dummies
Groovy Metaprogramming for DummiesGroovy Metaprogramming for Dummies
Groovy Metaprogramming for DummiesDarren Cruse
Ā 

Similar to Convert Groovy to Javascript with GrooScript (20)

Grooscript greach 2015
Grooscript greach 2015Grooscript greach 2015
Grooscript greach 2015
Ā 
Grooscript gr8conf 2015
Grooscript gr8conf 2015Grooscript gr8conf 2015
Grooscript gr8conf 2015
Ā 
Grooscript greach
Grooscript greachGrooscript greach
Grooscript greach
Ā 
Groovy.pptx
Groovy.pptxGroovy.pptx
Groovy.pptx
Ā 
Svcc Groovy Testing
Svcc Groovy TestingSvcc Groovy Testing
Svcc Groovy Testing
Ā 
Introduction To Groovy
Introduction To GroovyIntroduction To Groovy
Introduction To Groovy
Ā 
Groovy And Grails JUG Padova
Groovy And Grails JUG PadovaGroovy And Grails JUG Padova
Groovy And Grails JUG Padova
Ā 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
Ā 
Groovy & Grails: Scripting for Modern Web Applications
Groovy & Grails: Scripting for Modern Web ApplicationsGroovy & Grails: Scripting for Modern Web Applications
Groovy & Grails: Scripting for Modern Web Applications
Ā 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with Groovy
Ā 
MetaProgramming with Groovy
MetaProgramming with GroovyMetaProgramming with Groovy
MetaProgramming with Groovy
Ā 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws
Ā 
Boosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with GroovyBoosting Your Testing Productivity with Groovy
Boosting Your Testing Productivity with Groovy
Ā 
Javaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 GroovytestingJavaone2008 Bof 5101 Groovytesting
Javaone2008 Bof 5101 Groovytesting
Ā 
Introduction to Grails Framework
Introduction to Grails FrameworkIntroduction to Grails Framework
Introduction to Grails Framework
Ā 
What's New in Groovy 1.6?
What's New in Groovy 1.6?What's New in Groovy 1.6?
What's New in Groovy 1.6?
Ā 
Groovy for Java Developers
Groovy for Java DevelopersGroovy for Java Developers
Groovy for Java Developers
Ā 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast Lane
Ā 
Android Bootstrap
Android BootstrapAndroid Bootstrap
Android Bootstrap
Ā 
Groovy Metaprogramming for Dummies
Groovy Metaprogramming for DummiesGroovy Metaprogramming for Dummies
Groovy Metaprogramming for Dummies
Ā 

More from GR8Conf

DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your TeamGR8Conf
Ā 
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle GR8Conf
Ā 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerGR8Conf
Ā 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with GroovyGR8Conf
Ā 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with GebGR8Conf
Ā 
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidHow to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidGR8Conf
Ā 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the DocksGR8Conf
Ā 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean CodeGR8Conf
Ā 
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsCut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsGR8Conf
Ā 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applicationsGR8Conf
Ā 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3GR8Conf
Ā 
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGrails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGR8Conf
Ā 
Functional testing your Grails app with GEB
Functional testing your Grails app with GEBFunctional testing your Grails app with GEB
Functional testing your Grails app with GEBGR8Conf
Ā 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCGR8Conf
Ā 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshopGR8Conf
Ā 
Idiomatic spock
Idiomatic spockIdiomatic spock
Idiomatic spockGR8Conf
Ā 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedGR8Conf
Ā 
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGroovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGR8Conf
Ā 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and GroovyGR8Conf
Ā 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineGR8Conf
Ā 

More from GR8Conf (20)

DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
Ā 
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle
Ā 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developer
Ā 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with Groovy
Ā 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with Geb
Ā 
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidHow to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and Android
Ā 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the Docks
Ā 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean Code
Ā 
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsCut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature plugins
Ā 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applications
Ā 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3
Ā 
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGrails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloud
Ā 
Functional testing your Grails app with GEB
Functional testing your Grails app with GEBFunctional testing your Grails app with GEB
Functional testing your Grails app with GEB
Ā 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPC
Ā 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshop
Ā 
Idiomatic spock
Idiomatic spockIdiomatic spock
Idiomatic spock
Ā 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem Revisited
Ā 
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGroovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examples
Ā 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and Groovy
Ā 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
Ā 

Recently uploaded

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
Ā 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
Ā 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...OnePlan Solutions
Ā 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
Ā 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
Ā 
Shapes for Sharing between Graph Data SpacesĀ - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data SpacesĀ - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data SpacesĀ - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data SpacesĀ - and Epistemic Querying of RDF-...Steffen Staab
Ā 
CALL ON āž„8923113531 šŸ”Call Girls Kakori Lucknow best sexual service Online ā˜‚ļø
CALL ON āž„8923113531 šŸ”Call Girls Kakori Lucknow best sexual service Online  ā˜‚ļøCALL ON āž„8923113531 šŸ”Call Girls Kakori Lucknow best sexual service Online  ā˜‚ļø
CALL ON āž„8923113531 šŸ”Call Girls Kakori Lucknow best sexual service Online ā˜‚ļøanilsa9823
Ā 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
Ā 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
Ā 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
Ā 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
Ā 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
Ā 
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
Ā 
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļøcall girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļøDelhi Call girls
Ā 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
Ā 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
Ā 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
Ā 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
Ā 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
Ā 

Recently uploaded (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
Ā 
Call Girls In Mukherjee Nagar šŸ“± 9999965857 šŸ¤© Delhi šŸ«¦ HOT AND SEXY VVIP šŸŽ SE...
Call Girls In Mukherjee Nagar šŸ“±  9999965857  šŸ¤© Delhi šŸ«¦ HOT AND SEXY VVIP šŸŽ SE...Call Girls In Mukherjee Nagar šŸ“±  9999965857  šŸ¤© Delhi šŸ«¦ HOT AND SEXY VVIP šŸŽ SE...
Call Girls In Mukherjee Nagar šŸ“± 9999965857 šŸ¤© Delhi šŸ«¦ HOT AND SEXY VVIP šŸŽ SE...
Ā 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
Ā 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...
Ā 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
Ā 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
Ā 
Shapes for Sharing between Graph Data SpacesĀ - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data SpacesĀ - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data SpacesĀ - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data SpacesĀ - and Epistemic Querying of RDF-...
Ā 
CALL ON āž„8923113531 šŸ”Call Girls Kakori Lucknow best sexual service Online ā˜‚ļø
CALL ON āž„8923113531 šŸ”Call Girls Kakori Lucknow best sexual service Online  ā˜‚ļøCALL ON āž„8923113531 šŸ”Call Girls Kakori Lucknow best sexual service Online  ā˜‚ļø
CALL ON āž„8923113531 šŸ”Call Girls Kakori Lucknow best sexual service Online ā˜‚ļø
Ā 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Ā 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
Ā 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
Ā 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
Ā 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Ā 
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
Ā 
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļøcall girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
Ā 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
Ā 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Ā 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
Ā 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
Ā 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Ā 

Convert Groovy to Javascript with GrooScript

  • 2. About me Developer, I love it Lazy in english at school Living in Madrid Working at Osoco Grooscript developer @jfrancoleza jorge.franco.leza@gmail.com
  • 4. Web developer Leave your comfort zone Move to the client side
  • 5.
  • 7. Do something! No excuses You can do a library, resolve issues, create a plugin, give feedback, help other projects, ā€¦ ! You will learn a lot
  • 9. Groovy to Javascript converter Groovy 2 to Javascript ECMAScript 5 Open source project, Apache 2 license Library with Groovy and GPars dependencies No special Javascript objects or functions Converted code requires grooscript.js to run Different conversion options Grails plugin, npm package, gradle plugin What is grooscript?
  • 11. Groovy code def sayHello = { -> println "Hello ${it}!" } [ā€˜Groovy', ā€˜JavaScript', 'GrooScript'].each sayHello ! assert [1, 2, 3].size() == 3 class Amazing {} ! amazing = new Amazing() amazing.metaClass.who = [] amazing.metaClass.add = { who << it} ! amazing.add 'Rafa Nadal' assert amazing.who.size() == 1
  • 12. Javascript result function Amazing() { var gSobject = gs.inherit(gs.baseClass,'Amazing'); gSobject.clazz = { name: 'Amazing', simpleName: 'Amazing'}; gSobject.clazz.superclass = { name: 'java.lang.Object', simpleName: 'Object'}; if (arguments.length == 1) {gs.passMapToObject(arguments[0],gSobject);}; return gSobject; }; var sayHello = function(it) { return gs.println("Hello " + (it) + "!"); }; gs.mc(gs.list(["Groovy" , "JavaScript" , "GrooScript"]),"each",[sayHello]); gs.assert(gs.equals(gs.mc(gs.list([1 , 2 , 3]),"size",[]), 3), null); amazing = Amazing(); gs.sp((amazing = gs.metaClass(amazing)),"who",gs.list([])); gs.sp((amazing = gs.metaClass(amazing)),"add",function(it) { return gs.mc(gs.fs('who', this),'leftShift', gs.list([it])); }); gs.mc(amazing,"add",["Rafa Nadal"]); gs.assert(gs.equals(gs.mc(gs.gp(amazing,"who"),"size",[]), 1), null); Class Default constructor Function New
  • 13. Javascript Groovy Java MoreJavascriptfriendly Types, inheritance, java 8, ā€¦ metaClass Lists Closures Operators Dslā€™s Expando Maps beans methodMissing Mixins Categories Traits delegate propertyMissing
  • 14. Using converted code in javascript Create classes NameClass(); Default constructor with js object NameClass({property: value, data: 1}); Call methods, basic parameters myObject.method(params); Access properties myObject.property = 4; Use functions as closures list.each(function () { ā€¦ }); Traits Metaprogramming Mixins, Categories Groovy types gs.map({}); gs.set(); gs.range(1, 5); gs.date(); gs.regExp(); gs.stringBuffer(); ā€¦ Groovy list functions added to js lists Added some functions to numbers and strings (1).times(function () {}); ā€œGroovyā€.startsWith(); ā€œHelloā€.replaceAll(); Added curry to functions Convert objects ā€˜to groovyā€™ or ā€˜to javascriptā€™ gs.toGroovy(javaScriptList, NameClass); gs.toJavascript(myGroovyObject); Operators Groovy truth equals getters and setters Conversions gs.toGroovy(obj, Type); gs.toJavascript();
  • 15. Limitations Groovy / Java not fully supported Working in groovy-core No good support for inheritance (super) No methods with same name Basic support in metaClass No packages, no classes with same name No metainfo, expandoMetaClass, ā€¦ Only AST transformations applied in semantic phase No complex Java / Groovy types (LinkedList,ā€¦) ā€¦ see documentation for more info on grooscript.org
  • 16. Directly convert code @Grab(ā€˜org.grooscript:grooscript:0.5ā€™) ! import org.grooscript.GrooScript ! //Convert a fragment code String jsResult = GrooScript.convert(ā€œprintln ā€˜Hello!ā€™ā€) ! //Convert some file or folder, generate .js files with same name GrooScript.convert(ā€˜path/to/file.groovyā€™, ā€˜destination/folderā€™) GrooScript.convert(ā€˜path/to/folderā€™, ā€˜destination/folderā€™) GrooScript.convert(listOfFilesAndOrFolders, ā€˜destination/folderā€™)
  • 17. Conversion options convertDependencies - boolean - default true classPath - List<String> or String - default null - Ex: ā€˜src/groovyā€™ customization - Closure - default null mainContextScope - List<String> - default null initialText / ļ¬nalText - String - default null recursive - boolean - default false //Set a conversion property GrooScript.setConversionProperty(ā€˜convertDependenciesā€™, false) GrooScript.setConversionProperty(ā€˜customizationā€™, { ast(TypeChecked) })
  • 19. Main context scope Customization ā€¢ Requires Groovy 2.1, the closure is passed to withConļ¬g(conf) ā€¢ More info in http://docs.codehaus.org/display/GROOVY/Advanced+compiler+conļ¬guration ā€¢ Sometimes you donā€™t know where to ļ¬nd a variable ā€¢ When conversion is done, some variables come from other contexts ā€¢ grooscript.js sometimes tries to ļ¬nd missed variables with eval ā€¢ Node.js eval not working same way that browsers do ā€¢ You can deļ¬ne variables or function names with this option ā€¢ Ex. [ā€˜$ā€™, ā€˜myAwesomeFunctionā€™, ā€˜myMissedVariableā€™]
  • 22. >phantomjs myTest.js Inject grooscript.js and jquery Use Groovy script abilities I want to be Groovy @AST http://phantomjs.org/ Please code in Groovy!
  • 23. Mandatory Screen capture Before start test More console info Accept basic parameters Works ļ¬ne in GroovyTestCase Not so well in Spock Have to deļ¬ne Phantom.js path Feature: PhantomJsTest
  • 24. Example @GrabConfig(systemClassLoader = true) @Grab(ā€˜org.grooscript:grooscript:0.5ā€™) ! import org.grooscript.asts.PhantomJsTest ! //Need phantoms installed System.setProperty(ā€˜PHANTOMJS_HOMEā€™, ā€˜path/to/phantomjsā€™) ! @PhantomJsTest(url = ā€˜http://www.grails.orgā€™) void grailsSiteChecks() { assert $(ā€˜aā€™).size() > 50, ā€œNot enough links ${$(ā€˜aā€™).size()}ā€ def title = $(ā€œtitleā€) assert title[0].text == ā€˜Grails - The search is over.ā€™ $(ā€˜aā€™).each { println it } } ! //Run phantomjs test grailsSiteChecks()
  • 25. package org.grooscript.builder ! class HtmlBuilder { ! String html ! static String build(@DelegatesTo(HtmlBuilder) Closure closure) { def mc = new ExpandoMetaClass(HtmlBuilder, false, true) mc.initialize() def builder = new HtmlBuilder() builder.metaClass = mc closure.delegate = builder closure() ! builder.html } ! def yield(String text) { html += text } ! def methodMissing(String name, args) { ā€¦ } } Feature: html builder def result = HtmlBuilder.build { body { ul(class: 'list', id: 'mainList') { 2.times { number -> li number + 'Hello!' } } } } ! assert result == ā€˜<body><ul class='list' id='mainList'><li>0Hello!</li><li>1Hello!</ li></ul></body>ā€™ grooscript-builder.js
  • 26. Feature: jquery tools package org.grooscript.jquery ! interface GQuery { def bind(String selector, target, String nameProperty) def bind(String selector, target, String nameProperty, Closure closure) boolean existsId(String id) boolean existsName(String name) boolean existsGroup(String name) void bindEvent(String id, String name, Closure func) void doRemoteCall(String url, String type, params, Closure onSuccess, Closure onFailure) void doRemoteCall(String url, String type, params, Closure onSuccess, Closure onFailure, objectResult) void onReady(Closure func) void html(String selector, String text) } import org.grooscript.jquery ! GQuery gQuery = new GQueryImpl() gQueryImpl.js
  • 27. Feature: binder grooscript-binder.js package org.grooscript.jquery ! class Binder { ! GQuery gQuery = new GQueryImpl() ! def bindAllProperties(target, closure = null) { target.properties.each { name, value -> if (gQuery.existsId(name)) { gQuery.bind("#$name", target, name, closure) } if (gQuery.existsName(name)) { gQuery.bind("[name='$name']", target, name, closure) } if (gQuery.existsGroup(name)) { gQuery.bind("input:radio[name=${name}]", target, name, closure) } } } ! def bindAllMethods(target) { target.metaClass.methods.each { method -> if (method.name.endsWith('Click')) { def shortName = method.name.substring(0, method.name.length() - 5) if (gQuery.existsId(shortName)) { gQuery.bindEvent(shortName, 'click', target.&"${method.name}") } } } } ! def call(target, closure = null) { bindAllProperties(target, closure) bindAllMethods(target) } } Bind an instance properties to input elements, by Id or name Bind on click events to an instance methods new Binder()(myInstance)
  • 31. Grooscript Vert.x Plugin Convert Groovy code to Javascript Run conversion daemon Websockets Eventbus bridge New port open Events in the client Auto reload pages Both are optional http://grooscript.org/pluginManual/ v 1.3.1 Requires Java 1.7
  • 32. Differences?Renders on server Renders on the client Conversions are cached with cache plugin Grooscript tags auto - import js ļ¬les needed
  • 34. More eventsHtml Builder Where Listen events Render on load Send event message = println Execute on event message Donā€™t use ${} in grooscript tags Strong dependency Resources plugin Can put code in a .groovy ļ¬le
  • 35. Domain classes in the client* *Experimental, it requires Groovy 2.1 (grails 2.3) ā€¢ validate, clientValidations ** ā€¢ hasErrors ā€¢ count ā€¢ list * without params ā€¢ get ā€¢ save * without params ā€¢ delete
  • 36. Domain classes connected with the server* *Experimental, it requires Groovy 2.1 (grails 2.3) ā€¢ list ā€¢ get ā€¢ save ā€¢ delete
  • 37. PhantomJs Tests* *Not working in Grails 2.3, need improvements New test phase phantomjs Tests in test/phantomjs More features
  • 38. features, featuresā€¦ next release - new plugin - remove vert.x From resources plugin to Require.js or Asset pipeline plugin Improve domain options PhantomJs tests improvements Move to websockets/sockJs/stomp with Spring 4 in grails 2.4 and many moreā€¦ Remote domain class to grails REST support
  • 40. Gradle plugin Add in your build.gradle http://grooscript.wordpress.com/2014/02/22/starting-with-grooscript/ buildscript { repositories { mavenCentral() } dependencies { classpath 'org.grooscript:grooscript-gradle-plugin:0.3' } } ! apply plugin: 'grooscript' ! //If you need to change any conversion option, can do this way, optional grooscript { source = [ā€˜src/main/groovy/presenters'] }
  • 41. Create more conversion tasks: http://grooscript.wordpress.com/2014/01/31/61/ Converted ļ¬les destination Require.js setup ļ¬le Files to be converted
  • 42. Demo springboot http://projects.spring.io/spring-boot/ REST - Require.js - Grooscript Gradle Plugin - Websockets - Mongo https://github.com/chiquitinxx/springboot-rest-demo
  • 44. Example using node.js colors npm module Node.js is very fast! http://grooscript.wordpress.com/2014/01/10/impressive-node-js-v8-speed/ https://github.com/chiquitinxx/colors
  • 46. Why would I use grooscript? ā€¢ Create small modules to use in your views ā€¢ You can continue developing in Groovy ā€¢ Can use dslā€™s, typeCheck, ASTā€™s,ā€¦ in the browser ā€¢ You have all the java tools and IDEā€™s ā€¢ You can work with new Javascript tools from Groovy ā€¢ Donā€™t repeat code in two languages ā€¢ Single development environment ā€¢ Create your own architecture in Groovy ā€¢ Donā€™t learn another ā€œto Javascriptā€ tool
  • 47. Community will decide Future Version 0.5, you can improve I will continue improving grooscript Never will support full Groovy / Java Iā€™m learning a lot, very fun New grails plugin in summer Focus next version: more and better java and groovy support
  • 49. Thank you! All people reading this 680 motivation clicks Jetbrains for IntelliJ IDEA v13 open source license Special thanks to RenĆ©, @glaforge @marioggar @CedricChampeau @burtbeckwith