replacing gsp-resources

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

replacing gsp-resources

Scott Ingram
My Grails 2.2 project uses http://grails.org/plugin/gsp-resources which I now need to replace as I am upgrading to Grails 3.1

I can't find an existing replacement.  (Is there one?)  So, I need to roll my own.

I hope to extend asset-pipeline and use grails.gsp.PageRenderer to convert myJavaScript.js.gsp into myJavaScript.js which does lots of fun things like database and GORM calls.

But after reading its documentation, I found this page https://github.com/bertramdev/grails-asset-pipeline/wiki/Why-asset-pipeline-over-grails-resources-plugin
with this comment that concerns me: 

"In production, the asset-pipeline compiles your assets on war create."

Is the "war create" phase fully empowered with access to all the capabilities of my app, including GSP rendering, GORM, and LDAP ? 

thanks,
Scott


--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/18a34502-d261-45af-8e41-432d0b7f9eca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: replacing gsp-resources

sergiomichels
Hi Scott,

I've never used this plugin that you mentioned (gsp-resources), but I'm wondering how it works... Can you give an use-case for generating javascript based on a GSP with database info? Do you need to create a javascript per request, or the requisite is to generate it once on startup? 


--
Sérgio Michels

On Sun, Oct 1, 2017 at 9:45 AM, Scott Ingram <[hidden email]> wrote:
My Grails 2.2 project uses http://grails.org/plugin/gsp-resources which I now need to replace as I am upgrading to Grails 3.1

I can't find an existing replacement.  (Is there one?)  So, I need to roll my own.

I hope to extend asset-pipeline and use grails.gsp.PageRenderer to convert myJavaScript.js.gsp into myJavaScript.js which does lots of fun things like database and GORM calls.

with this comment that concerns me: 

"In production, the asset-pipeline compiles your assets on war create."

Is the "war create" phase fully empowered with access to all the capabilities of my app, including GSP rendering, GORM, and LDAP ? 

thanks,
Scott


--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/18a34502-d261-45af-8e41-432d0b7f9eca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CAHTf1NUU_Gcucuz0zmPPbUENNW_5ND_XRHr1DPW6x9sXZkxEJA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: replacing gsp-resources

Scott Ingram
Hi Sérgio,

In my single-page web app, my JavaScript uses a lot of static information stored the database, like countries, MPAA movie ratings, or a nested tree of movie genre/sub-genres, etc.  While there is also a lot of data that I pull over in real-time via AJAX calls, the static data goes through gsp-resources.  I have a gsp that instantiates domain objects, makes SQL select statements, etc, uses <g:tags> to format it all into JavaScript, which gsp-resources writes into dictionary.js once on startup / war-create.

thanks,
Scott

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/33cd7c10-42bf-4798-acdc-f3f88afe7be6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.