codeconsole commented on code in PR #16184:
URL: https://github.com/apache/grails-core/pull/16184#discussion_r3962888540


##########
grails-gsp/grails-sitemesh3/src/main/groovy/org/grails/plugins/sitemesh3/Sitemesh3GrailsPlugin.groovy:
##########
@@ -147,9 +147,13 @@ class Sitemesh3GrailsPlugin extends Plugin {
 
             // The SiteMesh 3 specific key wins; fall back to the legacy
             // grails.views.layout.default key so existing apps keep their
-            // configured default layout when switching.
+            // configured default layout when switching, and finally to 
SiteMesh's own
+            // sitemesh.decorator.default - the key a Spring Boot application 
using GSP for views
+            // configures, and the one Sitemesh3EnvironmentPostProcessor 
derives from the Grails
+            // keys above, so it only decides when neither of them is set.
             String defaultLayout = 
config.getProperty('grails.sitemesh.default.layout') ?:
-                    config.getProperty('grails.views.layout.default')
+                    config.getProperty('grails.views.layout.default') ?:
+                    config.getProperty('sitemesh.decorator.default')

Review Comment:
   Documented in 688436e00c as its own upgrade note. It states the change for a 
Grails application — one that set `sitemesh.decorator.default` and neither 
Grails key was decorated with the implicit `application` layout and is now 
decorated with the layout that property names — and gives both ways out: set 
`grails.sitemesh.default.layout`, or remove the SiteMesh key. The layouts.adoc 
wording stays as the description of the resolution order.
   



##########
grails-gsp/core/src/main/groovy/org/grails/gsp/compiler/GroovyPageCompiler.groovy:
##########
@@ -151,16 +151,14 @@ class GroovyPageCompiler {
                 }
 
                 // write the view registry to a properties file (this is read 
by GroovyPagesTemplateEngine at runtime)
+                // The registry names every page compiled here, whether or not 
this run had to recompile it, so it
+                // is written whole rather than merged into what an earlier 
run left behind. Merging kept naming
+                // pages that have since been renamed, removed or registered 
under a different prefix, against
+                // classes no longer on the class path.
                 File viewregistryFile = new File(targetDir, 
'gsp/views.properties')
                 viewregistryFile.parentFile.mkdirs()
                 // Use SortedProperties to ensure a consistent order of 
entries for reproducible builds
                 Properties views = 
CollectionFactory.createSortedProperties(false)
-                if (viewregistryFile.exists()) {
-                    // only changed files are added to the mapping, read the 
existing mapping file
-                    viewregistryFile.withInputStream { stream ->
-                        views.load(new InputStreamReader(stream, 'UTF-8'))
-                    }
-                }
                 views.putAll(compileGSPRegistry)

Review Comment:
   Stated in the comment in 688436e00c: writing whole relies on a caller 
handing the compiler the entire source set on every run, which 
`GroovyPageForkCompileTask` and `GroovyPageCompilerTask` both do — the fork 
task passes its full `srcDir`, the Ant task scans `srcdir` for `**/*.gsp` — and 
a caller passing only changed files would now write a registry naming those 
alone.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to