grails / grails-gsp

GSP (Grails Server Pages) - A server-side view rendering technology based on Groovy
Apache License 2.0
15 stars 33 forks source link

`grails-gsp` should not depend on `codeconsole/grails-sitemesh3` #465

Open matrei opened 1 month ago

matrei commented 1 month ago

The dependency appears to be required solely for the String constant RENDERING_VIEW_ATTRIBUTE.

@codeconsole Could we either reverse this dependency or recreate the constant in grails-gsp to decouple grails-gsp from the grails-sitemesh3 plugin?

codeconsole commented 1 month ago

@matrei I believe this was done because there was a forced dependency for the constant for SiteMesh 2. Can you provide a code link to where the plugin is being required?

matrei commented 1 month ago

Sure, here are links to the usages:

https://github.com/grails/grails-gsp/blob/acfd8d699b7cc4fe78e482245cd052a6ab66bcf7/grails-web-gsp/build.gradle#L7

https://github.com/grails/grails-gsp/blob/acfd8d699b7cc4fe78e482245cd052a6ab66bcf7/grails-web-gsp/src/main/groovy/org/grails/web/pages/GroovyPagesServlet.java#L22

https://github.com/grails/grails-gsp/blob/acfd8d699b7cc4fe78e482245cd052a6ab66bcf7/grails-web-gsp/src/main/groovy/org/grails/web/pages/GroovyPagesServlet.java#L219

https://github.com/grails/grails-gsp/blob/acfd8d699b7cc4fe78e482245cd052a6ab66bcf7/grails-web-gsp/src/main/groovy/org/grails/web/servlet/view/GroovyPageView.java#L37

https://github.com/grails/grails-gsp/blob/acfd8d699b7cc4fe78e482245cd052a6ab66bcf7/grails-web-gsp/src/main/groovy/org/grails/web/servlet/view/GroovyPageView.java#L70

codeconsole commented 1 month ago

@matrei thanks for that. It has been so long, I forgot I removed sitemesh2 from grails-gsp as well. The reason it was required is layouts are a fundamental part of Grails Web GSP and they will not work without SiteMesh or SiteMesh 3. SiteMesh 2 has always been a forced dependency. If we want to offer a version of grails that does not support layouts, we could remove the dependency. I don't have a problem with that. Another reason to not force SiteMesh 3 resolution would be if we decided to keep support for SiteMesh 2.

codeconsole commented 1 month ago

sitemesh3-grails-plugin could also be brought in under grails-gsp repo

matrei commented 1 month ago

sitemesh3-grails-plugin could also be brought in under grails-gsp repo

@codeconsole Yes, I think that makes sense, as sitemesh is such an integral part of Grails 👍