Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Universal groovy

256 views

Published on

JCConf 2016

  • Be the first to comment

  • Be the first to like this

Universal groovy

  1. 1. Universal Groovy JCConf 2016 吳欣展 pcbill
  2. 2. Isomorphic / Universal Applications which run both client-side and server-side. The backend and frontend share the same code.
  3. 3. Library (JAR) Groovy 2.3+(for traits) to javascript ECMA 5 Apache 2 License Converted code needs grooscript.js Tools: gradle, grails, npm/bower Grooscript
  4. 4. WHY? You have all the Java tools and IDE’s Don’t repeat code in 2 languages Single development environment Don’t learn another “to Javascript” tool Static typed if you want to Using Spock to test your codes
  5. 5. FUN !!!
  6. 6. LINKS Website: http://grooscript.org Documentation: http://grooscript.org/doc.html Github: https://github.com/chiquitinxx/grooscript Demos: https://github.com/chiquitinxx/grooscript-demos Twitter @grooscript Try live!: http://grooscript.org/conversions.html
  7. 7. Groovy UI component def <-> var Expando <-> Javascript object [ ] <-> [ ] { } <-> function() { } HTML Builder Javascript
  8. 8. form(id: 'addTodos') { h3 'TODO' ul { todos.each { li it } li { input(type: 'text', id: 'actualTodo', value: actualTodo) button { yield "Add #${todos.size() + 1}" } } } }
  9. 9. Reactjs? http://grooscript.org/react_example.html Angularjs? https://devsoap.com/writing-angularjs-applications-in-groovy/
  10. 10. Q & A

×