There's been a while since I was waiting something like this landing in the Groovy scene. Why couldn't we have a Javascript "compiler" to use it in the views as well?
Although Grooscript still needs time to be mature it's really promising. I have played with it a little bit and it's really funny the things you can do in Groovy. The most important feature in version 0.1 is that you can call native javascript inside your methods. The syntax to do it is the following:
@org.grooscript.GsNative def myMethod(parameter){/* //Javascript Code Here */}
This syntax has been chosen among others mainly because the lack of native method support in Groovy. We couldn't have used the word 'native' as GWT does when invoking javascript native methods.
By the time I'm writing this entry I have found one issue in the native support in Grooscript, and it seems that the workaround is pretty easy, you only need to add a dummy method at the end of your script to make the native support works.
@org.grooscript.GsNative def myMethod(parameter){/* alert(parameter); */} @org.grooscript.GsNative def dummy(){/**/}
Because I really liked the project I started creating a Grails plugin to be able to use it any Grails project. It is not available yet in the Grails repository, but I guess it will be eventually. You can clone it, package it and install it in your Grails application, the code is at github.
The plugin enables you to declare Groovy scripts as static resources and compile those scripts to Javascript code.
Groovy files must have the suffix '.gs'. I still don´t know why files with '.groovy' suffix can´t be 'watched' (Grails doesn´t see any changes made to that files). In the meanwhile I opened an issue at JIRA (The more votes the faster it could be resolved :-) )
You must declare the dependency of the 'grooscript' module in those modules you're declaring any groovy scripts (I also have added here the jquery dependecy because I use it in the example).
modules = { myGroovyFiles{ dependsOn 'jquery' dependsOn 'grooscript' resource url:'js/gs/GrooscriptNative.gs' } }
In order to proof the native support of Grooscript I did a really simple example. I made a script that changes the Grails logo in your Grails application for the Grooscript logo. Here's the code of the GrooscriptNative.groovy
import org.grooscript.asts.* class GrooscriptNative{ @GsNative def changeImage(selector,image){/* $(selector).attr("src",image.url); */} /* Workaround for an issue */ @GsNative def dummy(){/* */} } class ImageHolder{ String url } def selector = "#grailsLogo a img" def image = new ImageHolder(url:"http://grooscript.org/img/logo.png") new GrooscriptNative().changeImage(selector,image)If you've installed the plugin properly, declared the ".gs" file in the resources file and on running the application you opened the browser you should see the following:
Cool!! isn't it?
You can get Grooscript from its site or getting the jar adding the public sonatype repository as an extra maven repository to your project.
Ecorptrainings.com provides GROOVY in hyderabad with best faculties on real time projects. We give the best online trainingamong the GROOVY in Hyderabad. Classroom Training in Hyderabad India
ReplyDeleteGreat Article android based projects
DeleteJava Training in Chennai Project Center in Chennai Java Training in Chennai projects for cse The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training Project Centers in Chennai
hi...Im student from Informatics engineering nice article,
ReplyDeletethanks for sharing :)
Excellent blog has been given.very well explanation about plugin enables.
ReplyDeletethanks for sharing this blog.
oracle fusion procurement online training
Oracle fusion financials online training institute we have our branch over all the india.
ReplyDeleteOracle Fusion Cloud HCM Online Training in Hyderabad, Bangalore, Delhi, Chennai, Kolkata, Pune, Mumbai, Ahmedabad, Gurgon, Noida, India, Dubai, UAE, USA, Kuwait, UK, Singapore, Saudi Arabia, Canada, Oracle Fusion HCM Online Trainings
Oracle fusion Financials Online Training
Oracle Fusion Financials online Training
thanq very much for sharing
ReplyDeleteLearn Oracle Fusion Financials Online training from igofusion classroom coaching
All given info was wonderful and it's very helpful for everyone. I read your post is very nice thank you.
ReplyDeleteWe Have Top Rated CALFRE Search Engine to search about all different courses in Al Karama, Dubai Locations. For Example Search a particular course like Oracle ASCP Training in Location Dubai Know More Click Here
Hi, Thanks for posting a great information of the your blog.
ReplyDeleteDOT NET Training Institutes in Ameerpet
I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.
ReplyDeleteOracle Project Accounting Training in Hyderabad
This article is well written and quite informative.
ReplyDeleteMore articles should be written and you have just found a follower.and more visit.
mainframe training in hyderabad
Nice information. I was searching for the same. It helped me a lot and saved my time.
ReplyDeleteOracle Fusion SCM Training in Hyderabad
Thanks for sharing the details!
ReplyDeleteCognos training in hyderabad
Thanks for providing a useful article containing valuable information. start learning the best online software courses.
ReplyDeleteWorkday Online Training
Really excellent information and thank you for giving your valuable information
ReplyDeleteWorkday HCM Online Training
It's Incredibly grand. Really very helpful article , Thank you for sharing
ReplyDeleteWorkday Online Training
Very interesting blog Really excellent information and thank you for giving your valuable information
ReplyDeleteOracle Fusion HCM Online Training
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well.
ReplyDeleteOracle Fusion SCM Online Training
Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
ReplyDeletebest workday studio online training
Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
ReplyDeletemicroservices online training
best microservices online training
top microservices online training
Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
ReplyDeleteworkday hcm online training
best workday hcm online training
top workday hcm online training
I just loved your article on the beginners guide to starting a blog.If somebody take this blog article seriously
ReplyDeletein their life, he/she can earn his living by doing blogging.Thank you for this article.
best tibco sportfire online training
Web Development Company in chennai
ReplyDeleteXmedia Solution About us
Xmedia Solution infrastructure
Xmedia Solution Career
I just loved your article on the beginners guide to starting a blog.If somebody take this blog article seriously
ReplyDeletein their life, he/she can earn his living by doing blogging.Thank you for this article.
tibco sportfire online training
I just loved your article on the beginners guide to starting a blog.If somebody take this blog article seriously
ReplyDeletein their life, he/she can earn his living by doing blogging.Thank you for this article.
python online training
I just loved your article on the beginners guide to starting a blog.If somebody take this blog article seriously
ReplyDeletein their life, he/she can earn his living by doing blogging.Thank you for this article.
blueprism online training
Web Development Company in usa
ReplyDeleteMobile app development
Android app development company in usa
ios app development in usa
ionic framework development in usa
coin haber - bitcoin haberleri - instagram video indir - instagram takipçi satın al - instagram takipçi satın al - tiktok takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - instagram beğeni satın al - instagram beğeni satın al - google haritalara yer ekleme - btcturk güvenilir mi - binance hesap açma - kuşadası kiralık villa - tiktok izlenme satın al - instagram takipçi satın al - sms onay - paribu sahibi kim - binance sahibi kim - btcturk sahibi kim - paribu ne zaman kuruldu - binance ne zaman kuruldu - btcturk ne zaman kuruldu - youtube izlenme satın al - torrent oyun - google haritalara yer ekleme - altyapısız internet - bedava internet - no deposit bonus forex - erkek spor ayakkabı - tiktok jeton hilesi - tiktok beğeni satın al - microsoft word indir - misli indir
ReplyDeleteaşk kitapları
ReplyDeletetiktok takipçi satın al
instagram beğeni satın al
youtube abone satın al
twitter takipçi satın al
tiktok beğeni satın al
tiktok izlenme satın al
twitter takipçi satın al
tiktok takipçi satın al
youtube abone satın al
tiktok beğeni satın al
instagram beğeni satın al
trend topic satın al
trend topic satın al
youtube abone satın al
takipçi satın al
beğeni satın al
tiktok izlenme satın al
sms onay
youtube izlenme satın al
tiktok beğeni satın al
sms onay
sms onay
perde modelleri
instagram takipçi satın al
takipçi satın al
tiktok jeton hilesi
instagram takipçi satın al pubg uc satın al
sultanbet
marsbahis
betboo
betboo
betboo
yasaklı sitelere giriş
ReplyDeletepepsi kodları
wall hack kodu
ücretsiz antivirüs programları
yeni kimlik yenileme ücreti
internetsiz oyunlar
en hızlı dns sunucuları
hız testi
tiktok jeton hilesi
ucuz takipçi
ReplyDeleteucuz takipçi
tiktok izlenme satın al
binance güvenilir mi
okex güvenilir mi
paribu güvenilir mi
bitexen güvenilir mi
coinbase güvenilir mi
instagram takipçi satın al
instagram takipçi satın alz
Thanks for sharing such a wonderful information from this post. We are providing the best services click on below links to visit our website.
ReplyDeleteOracle Fusion HCM Training
Workday Training
Okta Training
Palo Alto Training
Adobe Analytics Training
thanks for sharing a nice post keep posting https://snowflakemasters.in/
ReplyDeletethanks for sharing a nice post
ReplyDeleteSalesforce CPQ Online Training Hyderabad
Salesforce CPQ Online Training India
seo fiyatları
ReplyDeletesaç ekimi
dedektör
instagram takipçi satın al
ankara evden eve nakliyat
fantezi iç giyim
sosyal medya yönetimi
mobil ödeme bozdurma
kripto para nasıl alınır
instagram beğeni satın al
ReplyDeleteyurtdışı kargo
seo fiyatları
saç ekimi
dedektör
fantazi iç giyim
sosyal medya yönetimi
farmasi üyelik
mobil ödeme bozdurma
bitcoin nasıl alınır
ReplyDeletetiktok jeton hilesi
youtube abone satın al
gate io güvenilir mi
referans kimliği nedir
tiktok takipçi satın al
bitcoin nasıl alınır
mobil ödeme bozdurma
mobil ödeme bozdurma
perde modelleri
ReplyDeletesms onay
mobil ödeme bozdurma
nft nasıl alınır
Ankara evden eve nakliyat
trafik sigortasi
Dedektor
web sitesi kurma
ASK ROMANLARİ
smm panel
ReplyDeleteSmm panel
iş ilanları
instagram takipçi satın al
hirdavatciburada.com
beyazesyateknikservisi.com.tr
SERVİS
tiktok jeton hilesi
There will be best course in Hyderabad, duck creek policy program,duck creek can earn a salary 130000 per annum.it is useful to students career in the field you have interest visit my website link.thanks youhttps://duckcreektraining.com/
ReplyDeletethanks to share very useful information..
ReplyDeleteWorkday Online Training in Hyderabad
Workday Training
An awesome blog for the freshers. Thanks for posting this information.
ReplyDeleteServiceNow Training
ServiceNow Online Training
lisans satın al
ReplyDeleteyurtdışı kargo
minecraft premium
en son çıkan perde modelleri
uc satın al
en son çıkan perde modelleri
özel ambulans
nft nasıl alınır