Skip to content

Latest commit

 

History

History
578 lines (407 loc) · 23.7 KB

CHANGELOG.md

File metadata and controls

578 lines (407 loc) · 23.7 KB

Changelog

3.3.0

  • Upgrade Groovy to 4.0.14
  • Upgrade Thymeleaf to 3.1.2.RELEASE

3.2.1

  • Upgrade Groovy to 4.0.10
  • Bundle native-image metadata for developers creating GraalVM native images (#232)
  • Updated thymeleaf-expression-processor, which also contains GraalVM native-image metadata

3.2.0

  • Remove old log warning about layout:fragment in the <head> section (#225)
  • Workaround for Groovy 4 + Zulu 8 on Apple Silicon issues (#230)
  • Upgrade Groovy to 4.0.7

3.1.0

  • Upgrade Groovy to 4.0.0 (#224)
  • The javadoc artifact in Maven downloads now includes this project's groovydocs, which have been missing in recent releases

3.0.0

  • Minimum supported version of Java is now Java 8 (#213)
  • Upgrade Groovy to 3.0.8 (#202)
  • Deprecated layout:decorator processor has been deleted (#95)
  • Deprecated $DECORATOR_TITLE constant has been deleted (#95)
  • <head> merging strategies now respect the <title> position by default (#177)
  • Deprecated layout:collect
  • Added an Automatic-Module-Name of nz.net.ultraq.thymeleaf.layoutdialect (#171)

Version 3.0 of the layout dialect is largely an upgrade to use Groovy 3.0 which removes the 'reflective access warning' in Java (which is set to become an error in Java 17) and the deletion of code that has been deprecated in version 2.x. It's also a step towards becoming a full Java module, applying an automatic module name and doing some reorganizing of packages in the interim.

I've written a migration guide to help make the assessment of what an upgrade to 3.0 would entail for you. Check it out on the documentation site: https://ultraq.github.io/thymeleaf-layout-dialect/migrating-to-3.0/

2.5.3

  • Upgrade Groovy to 2.5.14 (#214)

2.5.2

  • Fix from @silkentrance for re-declared layout fragments in deep hierarchies, where the layout dialect would return the wrong fragment from the template hierarchy ([#200])(#200)

2.5.1

  • Fix POM generation issue that declared dependencies as runtime instead of compile (#208)

2.5.0

  • Upgrade Groovy dependency to 2.5.x, fixing bytecode compatibility issues with JDK11+ in certain situations (#205)
  • Groovy metaprogramming enhancements to Thymeleaf objects is now done via extension modules. This has led to a slight improvement in performance: ~10% faster to complete the included benchmark project on JDK8, memory footprint remains unchanged.
  • Fixed the fragment cache not being cleared when dispatching/forwarding to the error page (#189)
  • Revamped the documentation website on https://ultraq.github.io/thymeleaf-layout-dialect/ (#204)
  • Rolled the benchmark project into this repo so that performance testing can be done right next to the code (#192)
  • Migrated unit tests from JUnit to Spock (#193)

2.4.1

  • Fix missing positions value from GroupingStrategy sorting method (#185)

2.4.0

  • Allow passing of values up to layout templates using fragment parameters (#157)
  • Updated how <head> element sorting was done so that the <title> can now optionally be put as the first element, instead of always making it first. Also created 2 new sorting strategies that reflect this respecting of the <title> and other element positions. (#176)
  • Fixed a bug around nested elements which arose in 2.3.0 (#178)
  • Fixed a bug when self-closing <html> tags are used as a root element (#173)
  • Added an experimental option to allow developers to opt-out of the automatic <head> merging that normally occurs, useful if wanted to manage that section using other Thymeleaf processors (#165)

2.3.0

  • Verification that the layout dialect plays well with Java 9 and Spring 5, involved a patch upgrade of Groovy to 2.4.13 (#161)
  • Contribution from @Vineg to add a layout:collect/data-layout-collect processor that accumulates encountered fragments of the same name. Documentation is still pending, but eager devs can take a look at the PR for more details (#166)
  • A few tool updates for linting, automated testing, and code coverage w/ Travis CI (included dropping the JDK7 build as I could no longer get a supported configuration working on Travis, but the layout dialect still aims to support Java 7 for the remainder of the 2.x releases).

2.2.2

  • Another decorate processor root element check fix for deep hierarchies that include a th:with attribute processor (which gets mutated by the various) decoration processes) (#127)
  • Updated thymeleaf-expression-processor, which includes a null check for parsing fragment expressions, a potential fix for (#151)

2.2.1

  • Fix decorate processor root element check when interacting with high-priority custom dialects (#127)

2.2.0

  • Rework how titles are handled to support inline expressions in Thymeleaf 3 (#145)
  • Now that the complete title cannot be known during execution of the title pattern processor, remove the exposed "layout context" object which contained the title values. (#147)
  • Implement a more accurate way to check if the decorate processor is in the root element of a template (#127)

2.1.2

  • Fix insertion of elements into a <head> section that is empty, ie: <head></head> (#144)

2.1.1

  • Simplify and fix the "model level" counting algorithm after a better understanding of attoparser and how it works (#142, #143)

2.1.0

  • Be less strict with HTML templates that are auto-balanced by Attoparser (usually a result of not knowing which HTML elements cause auto-closing behaviours), instead only using tags that are in the original templates to influence the "model level". While this was a great tool for learning more about the HTML spec when it errors, it is more in line with how Thymeleaf behaves (#138)
  • Reveal the processed content and layout title values on the layout object (#137)
  • Huge improvements to the memory profile of the layout dialect (#102, #139)

What follows is a summary of the performance improvements in 2.1.0. For details such as the test methodology and changes made, see the full release notes at: https://github.com/ultraq/thymeleaf-layout-dialect/releases/tag/2.1.0

Thymeleaf Layout Dialect 2.0.4

memory usage 2 0 4

Main takeaways:

  • The JMeter test took about 3 minutes to complete (started around the 30 second mark), with requests taking an average of 1.674 seconds each

  • Old generation space at 99MB

  • 35 garbage collections

  • 27 million object allocations

  • 4 seconds spent in GC

  • Several items taking over 10MB of retained memory (none of them appearing as dominators however, so are potentially GC'able, but don't seem to have been collected)

    screen shot 2016-11-06 at 1 33 32 pm

  • Majority of the object allocations taking place in the IModelExtensions.findModel closure, which uses a Groovy feature of dynamic metaclass creation

    screen shot 2016-11-06 at 1 36 02 pm

Thymeleaf Layout Dialect 2.1.0

memory usage 2 1 0-snapshot

Differences:

  • The JMeter test took about 1 minute to complete (also started around the 30 second mark), with requests taking an average of 452ms to complete (at least 3x faster)

  • Old generation space at 22MB (memory footprint 1/5th the size)

  • 21 garbage collections (40% less GCs)

  • 7.1 million object allocations (74% less objects created)

  • 1 second spent in GC (75% less time spent in GC)

  • Only 1 item taking over 10MB of retained memory (dominator profile looking mostly the same however)

    screen shot 2016-11-06 at 1 51 37 pm

  • Majority of the object allocations no longer in a Groovy dynamic meta class method, but in one of Thymeleaf's utility projects, unbescape

    screen shot 2016-11-06 at 1 54 42 pm

2.0.5

  • Upgrade thymeleaf-expression-processor to 1.1.2, which includes a fix for multiline fragment expressions (#140)
  • Use Thymeleaf's AssignationUtils class for parsing variable declarations so that variable declarations behave the same way they do in Thymeleaf (#126)

2.0.4

  • Have the layout:title-pattern processor work when using th:utext/data-th-utext on the <title> tag as well (#136)

2.0.3

  • Kill the rise in memory usage found by (#134)

2.0.2

  • Convert FragmentProcessor from a model processor to a tag processor to get around model level problems when inserting fragments that may alter the model level (#129)
  • Fix the merging of the <head> section in multi-level layouts (#130)
  • Respect the runtime-configured prefix (#103)

2.0.1

  • Fix NullPointerException when using any of the include/insert/replace processors with a full template fragment expression (#120)
  • Restored support for multi-level layouts (#121)
  • Reduced logging of backwards compatibility warnings to log just the first time the compatibility was encountered (#124)
  • Improved memory usage by not being so wasteful of objects in a few parts of the codebase, which in turn fixed a potential memory leak (#122)
  • Fixed a backwards compatibility problem when using layout:decorator (#125)

2.0.0

  • Layout dialect rewritten to support Thymeleaf 3 (#68, Layout Dialect 2.0 milestone)
  • layout:decorator processor renamed to layout:decorate, $DECORATOR_TITLE renamed to $LAYOUT_TITLE (#95)
  • Deprecated layout:include processor for the new layout:insert processor (#107)
  • New documentation site created to hold what was turning into a gigantic readme! (#115)

Upgrading to 2.0? I've written a migration guide to help make the transition easier. Check it out on the new documentation pages site, here: https://ultraq.github.io/thymeleaf-layout-dialect/MigrationGuide.html

As of release there are still some tests that have been disabled and may cause regressions for these use cases. They are listed here:

def exclusions = [
'nz/net/ultraq/thymeleaf/tests/decorators/Decorate-DeepHierarchy.thtest',
'nz/net/ultraq/thymeleaf/tests/decorators/html/TitlePattern-AllowOtherProcessors.thtest',
// Disabled, see test file for details
'nz/net/ultraq/thymeleaf/tests/decorators/html/TitlePattern-DynamicContent.thtest'
]
One is a very specific and rare case, another is an undocumented use of the layout dialect, and the commented one I don't feel I should fix as it feels like the incorrect use of an element. For those first 2 cases, I'll work on them in upcoming patches so they don't hold up the release.

1.4.0

  • Change the behaviour of merging th:with attributes so that child pages can override layout values (#99)
  • Fixed lack of a 'groovydoc' archive being included with the download bundle and Maven artifacts

1.3.3

  • Don't copy collapsible whitespace between <head> elements during decoration (#92)

1.3.2

  • Prevent IllegalArgumentException when using a template with a condensed <head> section (#90)
  • Fix fragment scoping so that fragments from one decorator/include/replace operation aren't shared with other ones (#87)

1.3.1

  • Restore Java 6 support (#85)

1.3.0

From 1.3.0, this project follows semantic versioning.

  • Dialect rewritten in Groovy
  • Dropped the deprecated substituteby processor
  • Allow the title to be completely processed (#72) before expanding the value of title-pattern, fixing cases like that described in (#64)
  • Split out the <head> element sorting into a customizable sorting strategy, and provided strategies for each of the behaviours that the layout dialect has implemented in the past. See the element merging section in the README for more details.

1.2.9

  • Have all non-element nodes (text, comments) included in the merging of the <head> section (#70)

1.2.8

  • Contribution from Oliver Niekrenz to fix a recursion issue in the way fragments are picked out of templates (#60)

1.2.7

  • Fix for ArrayIndexOutOfBoundsExceptions coming out of the grouping feature introduced in 1.2.6 (#54)

1.2.6

  • Reduce the amount of whitespace copied surrounding the <html> tag (#50)
  • Start logic to group like elements in the merged <head> section together (#52)

1.2.5

  • Restore title fallback behaviour when either content or decorator title elements are empty (#45)
  • Fix title creation when using th:text without a layout:title-pattern processor (#46)

1.2.4

  • Contribution from Justin Munn to fix bugs in the layout:title-pattern processor, making it behave more naturally in the process (#42)

1.2.3

  • Fix for nested layout fragments using the replace/substituteby processors (#37)
  • Don't pass arbitrary attributes (ie: anything that isn't an attribute processor) up to decorator pages if the content template is a fragment (#39)

1.2.2

  • Allow passing variables for all document types, not just full HTML templates (#32)
  • Remove the reliance on Thymeleaf's literal substitutions feature for the layout:title-pattern processor, allowing devs to use the pipe | character in their title patterns (#33)
  • Fix the passing of decorator/content title values up deep layout hierarchies (#34)

1.2.1

  • Restore layout:decorator behaviour when using it for deep page hierarchies in Thymeleaf 2.1.2 (#30)

1.2

  • Works with Thymeleaf 2.1 (#26)
  • layout:title-pattern now works on title text created using the th:text attribute (#28)

1.1.4

  • Minor bugfixes, small refactoring, and a large cleanup as a result of the work done towards being compatible with Thymeleaf 2.1.

1.1.3

  • Refactored handling of <title> elements for when they're lacking in either content or decorator templates and the layout:title-pattern processor is being used (#25)
  • Added a layout:replace attribute processor, an alias of layout:substituteby (Just like Thymeleaf, the replace processor will eventually replace substituteby. They both perform the same function, but substituteby is effectively deprecated.)
  • Updated the Eclipse plugin help file to point to the updated 1.1.x processor locations.

1.1.2

  • Relaxed the root element restriction when using the LEGACYHTML5 template mode due to the way the NekoHTML parser works on HTML fragments (#23)

1.1.1

  • Restore the help/documentation file so that this dialect will appear in content assist in the Thymeleaf Eclipse plugin. (I used a new build process for the 1.1 branch, and it missed this resource file! Apologies for that folks.)

1.1

  • Change package to nz.net.ultraq.thymeleaf (dropped the 'web' part).
  • Change XML namespace to http://www.ultraq.net.nz/thymeleaf/layout (dropped the 'web' part).
  • Implemented unit tests, using the Thymeleaf Testing library.
  • Added a layout:substituteby processor which works much like layout:include, but with the behaviour of Thymeleaf's th:substituteby (#21)

1.0.6

  • Added a help/documentation file so that this dialect will appear in content assist in the Thymeleaf Eclipse plugin.

1.0.5

  • Added the ability to specify the final <title> through a configurable pattern, specified in a new layout:title-pattern attribute.
  • Made code emit a warning to the logs if the layout:fragment element was in the <title> element (I keep seeing people doing this, even though it's not required since the dialect automatically takes the content <title> over the decorator <title>).
  • Made it so that content outside the decorator page's <html> element (like IE conditional comments) are included in the resulting page (#10)

1.0.4

  • Fixed enforcing of layout:decorator element being in the root element, leading to a better error message if this attribute is found elsewhere.
  • Fixed the resulting JAR which didn't recreate the proper Maven metadata in the manifest section and might have caused it to not be picked up by tools like m2eclipse.
  • Fix a ClassCastException for cases when layout:include was used to include entire pages (#7)

1.0.3

  • Added a layout:include attribute which works like th:include but allows for the passing of element fragments to the included page.
  • Allow th:with local variable declarations made in the decorator page to be visible in content pages during processing (#3)
  • Removed the restriction that the layout:decorator tag appear in an HTML element since Thymeleaf 2.0.10 relaxed that restriction too (tag must still appear in the root element of your page however) (#4)
  • Updated Thymeleaf dependency to 2.0.11 for a required API change.

1.0.2

  • Allow a decorator and content pages to contain just a <head> section, or just a <body> section, or neither section, or some other combination between pages (#2)

1.0.1

  • Switched from Ant to Gradle as a build tool and to generate Maven-compatible artifacts.
  • To appease the Mavenites amongst you, the project is now being served from Maven Central, co-ordinates added to installation instructions (#1)

1.0

  • Initial release.