Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
matrei opened this issue Jul 25, 2024 · 6 comments
Open

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

matrei opened this issue Jul 25, 2024 · 6 comments

Comments

@matrei
Copy link
Contributor

matrei commented Jul 25, 2024

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
Copy link
Contributor

codeconsole commented Jul 25, 2024

@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
Copy link
Contributor Author

matrei commented Jul 25, 2024

Sure, here are links to the usages:

api "org.sitemesh:grails-plugin-sitemesh3:6.2.0"

import org.grails.web.sitemesh.GroovyPageLayoutFinder;

request.setAttribute(GroovyPageLayoutFinder.RENDERING_VIEW_ATTRIBUTE, Boolean.TRUE);

import org.grails.web.sitemesh.GroovyPageLayoutFinder;

request.setAttribute(GroovyPageLayoutFinder.RENDERING_VIEW_ATTRIBUTE, Boolean.TRUE);

@matrei matrei changed the title grails-gsp should not depend on codeconsole/sitemesh3-grails-plugin grails-gsp should not depend on codeconsole/grails-sitemesh3 Jul 25, 2024
@codeconsole
Copy link
Contributor

@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
Copy link
Contributor

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

matrei added a commit that referenced this issue Jul 27, 2024
`grails-gsp` should not depend on an external Grails Plugin.
This dependency was only needed for a `String` constant:
`org.grails.web.sitemesh.GroovyPageLayoutFinder.RENDERING_VIEW_ATTRIBUTE`.

This commit removes the dependency by declaring the same constant
in `GroovyPagesServlet` and using that instead.

Closes #465
@matrei
Copy link
Contributor Author

matrei commented Jul 27, 2024

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 👍

@jamesfredley jamesfredley moved this to Todo in Grails 7 Oct 1, 2024
@codeconsole
Copy link
Contributor

cf0265c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants