Skip to content

Conversation

@jdaugherty
Copy link
Contributor

@jdaugherty jdaugherty commented Jul 10, 2025

No description provided.

@jdaugherty jdaugherty force-pushed the 7.0.x-restore-sitemesh3 branch from a960a76 to cdbb4df Compare July 10, 2025 17:40
@jdaugherty
Copy link
Contributor Author

Previously, sitemesh2 existed across 2 coordinates: org.grails.plugins:sitemesh and org.grails:grails-web-sitemesh. From my research in Grails 6, to use sitemesh3, the grails-web-sitemesh library was still included in the application. Per discussion with Scott, we wanted this to be an either/or choice, so if you choose sitemesh3 it will function like prior milestones did. If you choose sitemesh2, the known issues will be fixed and the old behavior is restored.

Notes on this work:

Decoupling

I've decoupled sitemesh2 completely from gsp with these changes. Either grails-sitemesh3 or grails-layout must be specified if using gsp and wanting the full functionality.

Forge

I've enhanced forge so that if you add the Sitemesh3 feature, it will use that instead of the default (which is grails-layout).

Documentation

I've updated the upgrading guide to clarify this requirement to make sure people are aware.

Testing

My real issue was what to do about testing since there are several known issues with the sitemesh 3 plugin. We already have a testing app dedicated to sitemesh3 that's split off with @PendingFeature, but we know there are several other pieces of functionality broken with sitemesh 3. For this reason, I added SITEMESH3_TESTING_ENABLED - if this env is set, it will run with sitemesh3 plugin instead of the default grails-layout. This allows us to test sitemesh3 easily and see where it stands on becoming the default. In addition to the @PendingFeature failures, this build scan is what will fail if using sitemesh3 only.

I've also not ported the applyLayout tests since there isn't a functionality equivalent in sitemesh3. If/when we decide to remove sitemesh2, we'll need to make sure these tests are ported.

Spring Boot

I reverted the changes to Spring Boot app, so it's assumed that if you're using spring boot and grails, you're using sitemesh 3. I don't think the demand is too high for sitemesh2 + Spring Boot, so this seems like a reasonable compromise - otherwise we would have a lot more work to do and have to create 2 separate projects. Also, we are not publishing this application so it's only an example.

@jdaugherty jdaugherty marked this pull request as ready for review July 10, 2025 17:50
@jdaugherty
Copy link
Contributor Author

@matrei I've renamed the plugin from grailsLayout to layout

@jdaugherty jdaugherty force-pushed the 7.0.x-restore-sitemesh3 branch from cb7a050 to 84a6d43 Compare July 10, 2025 23:26
@jdaugherty jdaugherty force-pushed the 7.0.x-restore-sitemesh3 branch from 84a6d43 to 9a3f649 Compare July 11, 2025 00:30
@codeconsole
Copy link
Contributor

codeconsole commented Jul 11, 2025

From my research in Grails 6, to use sitemesh3, the grails-web-sitemesh library was still included in the application

Minor clarification: grails-web-sitemesh was manually excluded in the build.gradle in Grails 6.2.x
There were only a few classes that were needed from that package and they were bundled in the plugin as empty classes with the same package structure.

configurations { all { // ... existing configurations exclude group:'org.grails.plugins', module:'sitemesh2' exclude group:'org.grails', module:'grails-web-sitemesh' } } dependencies { implementation("org.sitemesh:grails-plugin-sitemesh3:6.1.2") // ... existing dependencies }

(excellent work btw... 😄)

Copy link
Contributor

@sbglasius sbglasius left a comment

Choose a reason for hiding this comment

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

I assume the many removed tests from sitemesh3 is on purpose.

So as you can see, just being nitpicky. I approve!

@jdaugherty
Copy link
Contributor Author

I assume the many removed tests from sitemesh3 is on purpose.

As part of the decoupling, since either sitemesh library can be used with gsp, I had to pull up several tests. We have grails-layout & grails-sitemesh3 test projects and I've moved or duplicated the tests between those projects where appropriate. Overall, there shouldn't be a removal of tests.

@jdaugherty jdaugherty merged commit ed736e5 into 7.0.x Jul 11, 2025
33 checks passed
@jdaugherty jdaugherty deleted the 7.0.x-restore-sitemesh3 branch July 11, 2025 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants