grooscript
Little framework to convert Groovy code to Javascript.
| Home | Try it | Robots | Examples | Documentation | About |
Do you love Groovy?
Not a big fan of Javascript?
Do you need execute your code in Javascript?
Want to use Javascript only for web view?
To have all the logic on awesome spock tests?
Number of motivation clicks:
News! Version 0.2.4 out. Grails Plugin is out too. Visit the Blog.
If you missing something or get a fail, report it in Github or email me.
... thank you all. I hope you get some fun in the browser with GrooScript.
Coming in 0.3
-
Grails plugin. With new daemon is more interesting, but I need improve my Grails skills.
-
Modules system to add external js libraries, and use from Groovy. For example, I use a jQuery wrapper groovy class in my examples. Can go further and return from jQuery a groovy list of expando's, or work with canvas with a groovy controller,... I think is interesting use js frameworks or libraries from groovy, then can do more complete tests from spock.
-
No more groovy / java support planned. Just more functions on maps, lists, ranges, date, string, numbers, regexp. If you missing badly any groovy feature, contact me.
-
I have 80+ tests, 3+ demos done, and atm no bugs reported. But, the most important effort on next version, will be test and use.
What's new in 0.2.4
-
Experimental annotation to use PhantomJs from Groovy. Example
-
Some fixes.
What's new in 0.2.3
-
New function to stop the daemon.
What's new in 0.2.2
-
New daemon, that detect changes in your groovy files, and convert to javascript in background.
-
More spread operator support added. Very little support to use StringBuffer <<.
-
Starting support on mixins, and improved categories support. @Mixin and @Category not supported.
-
Added a little, very little support to delegate closures. Now you can create very little dsl's, setting the delegate of the closure, you can access delegate's methods from your dsl.
What's new in 0.2.1
-
Now you can add methods and variables to classes (static functions too). MyClass.metaClass.myFunction = { ... }
-
Basic support Class.forName().
-
Multiple assignment allowed. (x,y) = { -> [1,2]}
-
Method pointer to class methods. myClosure = someObject.&someMethod
-
Safe expressions. object?.property
-
Starting categories support.
-
Added a new compilation option for don't convert dependencies. By default, if you convert a class with some imports, that files are converted too in the result.
What's new in 0.2
-
Supporting groovy beans, getter, setters, getProperties, methodMissing,...
-
Missing pretty print in javascript result, now all method calls and property access are captured.
-
More lists and maps functions are supported.
-
grooscript.js inside the jar in meta-inf/resources folder, so can use with servlet 3.0 spec.
-
Better support in dependency files, can set classpath and all converted in one file.
-
More javascript and conversion options.
-
More groovy support. Check documentation, nice example there.
@GrooScript 2012