Skip to content

Revert to Sitemesh 2 for Grails 7 #14875

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

Open
wants to merge 1 commit into
base: issue14193Cleanup
Choose a base branch
from
Open

Conversation

jdaugherty
Copy link
Contributor

See discussion [1]. This will likely fix:

Please note that the sitemesh license terms has these sections:

  • Products derived from this software may not be called "OpenSymphony" or "SiteMesh", nor may "OpenSymphony" or "SiteMesh" appear in their name
  • The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by the OpenSymphony Group (http://www.opensymphony.com/)."

For this reason, I've renamed most of our classes away from "sitemesh" to a variant of Grails Layout & updated the end user documentation.

[1] https://lists.apache.org/thread/8lynrl0yd6ykn749md1g2wjb8jph3s5l

@codeconsole
Copy link
Contributor

Why not just submit a PR to Sitemesh 3 if any fixes are needed? Sitemesh 2.6.x was just a quick patch for a codebase abandoned in 2009. If you were to revert to Sitemesh 2, the proper course of action would be Sitemesh 2.7.x

@jdaugherty
Copy link
Contributor Author

@codeconsole It's a timing problem. We're running out of time to get these issues fixed so going to 2.6.0 is a stop gap since it makes us compatible with 6. I think it's reasonable to consider 2.7.0 for 7.1. Especially, if we have help or volunteers to do the upgrade. The only reason we're trying to move forward here is because of the blocker it's had on the 7 release.

@codeconsole
Copy link
Contributor

If I remember correctly, going back to 2.x has major negative consequences. It basically compiles Sitmesh 2.x code into everything so any future upgrades will result in breaking every plugin.

@jdaugherty
Copy link
Contributor Author

Can you please help me understand what would cause a plugin to break? I assume it's the GSP compiled logic? I think we may have to deal with that since it's the same as 6.x. We're open to suggestions on how to reduce this. The core issue is the architecture difference and not integrating into the Spring DispatcherServlet.

@codeconsole
Copy link
Contributor

no, it has to do with references to sitemesh logic in traits that are compiled into a lot of plugin classes. When you try to use them in a future version, you get an exception. The only workaround at that point is re-releasing every plugin.

@jdaugherty
Copy link
Contributor Author

I don't see that on first glance of this PR. If you can take a look at this review to help me find that, I think decoupling by introducing interfaces/intermediate classes in Grails so in the future we can remove sitemesh2 is very reasonable.

@codeconsole
Copy link
Contributor

Well, you can start by looking at your changes to the ResponseRenderer trait and look at all the locations that gets compiled into.

I don't see the need to push this back into the dark ages. Don't most of these issues have workarounds? Why not just use decorator chaining if you want to apply multiple layouts?

Copy link
Contributor

@matrei matrei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, work James! The usual nitpicks I pick up when scanning the changes.

@jdaugherty
Copy link
Contributor Author

Almost all of this feedback was on the original code that I restored without changing. I agree with cleaning it up, but I originally hadn't to reduce the potential for problems. My last commit contains all of the feedback.

@jdaugherty
Copy link
Contributor Author

I had to revert the cast that shows an error in intellij. Otherwise, a large amount of tests fail with a cast exception.

@codeconsole
Copy link
Contributor

I think a more rational decision would be to fork 8 before this is merged and keep 8 moving forward.

@matrei
Copy link
Contributor

matrei commented Jul 4, 2025

I had to revert the cast that shows an error in intellij. Otherwise, a large amount of tests fail with a cast exception.

That is interesting considering the cast is made inside an if (content instanceof StreamCharBuffer) condition.
Doing a proper cast seems to work better:

gspGrailsLayoutPage.pageBuffer = (StreamCharBuffer) content

@jdaugherty
Copy link
Contributor Author

Thanks @matrei , that cast seems to work.

I'm going to restructure the commits in this PR so that it's easier to revert sitemesh 2. This way we can keep branches merged cleanly.

@jdaugherty
Copy link
Contributor Author

I'm going to open another PR and split this one between just the sitemesh2 change and all of the clean up / test pollution fixes / and test case restores

@jdaugherty jdaugherty changed the base branch from 7.0.x to issue14193Cleanup July 4, 2025 11:37
@jdaugherty
Copy link
Contributor Author

This PR now is only a single commit with only the sitemesh2 revert.

#14876 contains all of the feedback / cleanup related commits prior to the sitemesh revert.

This will allow us to revert one commit to have sitemesh3

@jdaugherty jdaugherty force-pushed the issue14193 branch 8 times, most recently from 75ed6df to 01e3fc9 Compare July 4, 2025 18:45
@jdaugherty jdaugherty force-pushed the issue14193 branch 2 times, most recently from cd74aa5 to 758a45f Compare July 4, 2025 18:51
@jdaugherty
Copy link
Contributor Author

@codeconsole @matrei I think I've decoupled anything that would break a plugin. Let me know if you find anything else in the sitemesh2 revert.

@jdaugherty jdaugherty force-pushed the issue14193Cleanup branch 2 times, most recently from 7589fca to 24db59d Compare July 5, 2025 14:45
@jdaugherty jdaugherty force-pushed the issue14193Cleanup branch from fceb843 to 80ad81c Compare July 5, 2025 18:04
@jdaugherty jdaugherty force-pushed the issue14193Cleanup branch from 80ad81c to f30c712 Compare July 5, 2025 18:09
@jdaugherty jdaugherty force-pushed the issue14193Cleanup branch 2 times, most recently from 18bf4d1 to 107f771 Compare July 5, 2025 18:36
@jdaugherty jdaugherty force-pushed the issue14193Cleanup branch from 107f771 to 514bb2a Compare July 5, 2025 18:47
@jdaugherty jdaugherty force-pushed the issue14193Cleanup branch from 2cd6401 to c69a8a4 Compare July 5, 2025 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants