Releases: TYPO3/Fluid
5.0.3
What's Changed
- [TASK] Extend enum test coverage by @s2b in #1269
- [DOCS] Document
<f:argument>does not work when rendering sections by @cundd in #1274 - [BUGFIX] Allow constants and enum cases as argument default by @s2b in #1272
- [TASK] Loosen PHPDoc type for Fluid namespaces by @s2b in #1280
- [TASK] Allow TemplateValidator to discover underscore variables by @s2b in #1283
New Contributors
Full Changelog: 5.0.2...5.0.3
5.0.2
5.0.1
5.0.0
Version 5.0 is the next major milestone in the development of the Fluid templating engine. Based on the previous efforts that went into Fluid 4, Fluid 5 continues to refactor and to modernize the underlining source code, which sometimes requires introducing strategic breaking changes. All breaking changes in this release have been pre-announced in Fluid 4, both in the changelog and by applying the @deprecated annotation or emitting a deprecation notice in the code.
These breaking changes allow us to ship meaningful new features that weren't possible before:
Streamlined ViewHelper Argument Validation
ViewHelpers now use the StrictArgumentProcessor to validate ViewHelper arguments. This means that argument validation behaves the same with ViewHelpers and with the <f:argument> ViewHelper, which was introduced with Fluid 4.2. While the new validation might require some adjustments in existing projects, it has clear advantages: ViewHelper instances can actually rely on the types specified in their API to be checked properly by Fluid, which makes a lot of custom validation code obsolete.
The new argument validation adds support for union types as well as iterable, countable and callable, which allows ViewHelpers to define a clearer API.
See #1062, #1074, #1194 and #1226 for more details.
Template File Resolving and File Extension
Fluid 5 now features an internal fallback chain for template file names. Template files are now resolved in the following order (first match wins):
templateRootPath: templates/
template: myTemplate
format: html
1. templates/myTemplate.fluid.html
2. templates/myTemplate.html
3. templates/myTemplate
4. templates/MyTemplate.fluid.html
5. templates/MyTemplate.html
6. templates/MyTemplate
This means that it's no longer necessary for template names to start with an uppercase character. Also, there is a new dedicated file extension *.fluid.* for Fluid templates: *.fluid.html instead of *.html, *.fluid.xml instead of *.xml, and so on. Because of the fallback chain, both can be added without breaking potential overrides from other template paths.
We recommend switching to the new file extension if Fluid 5 can be a hard requirement for your project. Otherwise, just stick to the existing general file extensions. The new file extension is entirely optional and will not be a requirement.
See #1243 and #1258 for more details.
Simplified Cache Warmup
Fluid 5 comes with a much simpler way to warmup the template cache in your project. The existing cache warmup functionality has been removed and replaced by a new implementation that requires much less configuration and context. By default, it makes use of the new *.fluid.* file extension to discover all Fluid templates in your project.
bin/fluid warmup \
--cacheDirectory examples/cache/ \
--path examples/Resources/
--path examples/ResourceOverrides/
See #1224 for more details.
Alternative Syntax for CDATA Sections
A long-standing issue in Fluid templates has been that the Fluid variable and inline ViewHelper syntax collides with inlined CSS or JavaScript code. This issue has now been addressed with Fluid 5: A new alternative syntax has been introduced that makes collisions between CSS/JavaScript and Fluid far less likely.
The normal inline and variable syntax uses single curly braces { } as tokens in Fluid templates. In <![CDATA[ ]]> sections, this syntax are now ignored. Instead, three curly braces {{{ }}} can be used to call Fluid ViewHelpers or to access variables. The tag-based syntax is disabled altogether in CDATA sections.
See #1246 and the documentation for more details: Avoiding syntax collision with JS and CSS.
Deprecations and Breaking Changes
Please refer to the documentation for a full list of breaking changes and newly introduced deprecations in Fluid 5.0: Changelog 5.x.
What's Changed
Please note that some of the listed changes have been backported to Fluid 4.5.0, most importantly all new ViewHelpers.
- [BUGFIX] empty array is now valid as typed array by @Kanti in #1139
- [TASK] Set branch alias for Fluid 5 by @s2b in #1142
- [TASK] Avoid testing of mocked abstract classes by @s2b in #1141
- [!!!][TASK] Remove setChildNodes() on ViewHelpers by @s2b in #1145
- [DOCS] Improve ViewHelper example code by @s2b in #1147
- [TASK] Clarify code comments related to escaping by @s2b in #1151
- [BUGFIX] allow usage of interfaces in StrictArgumentProcessor by @Kanti in #1155
- [DOCS] Re-enable cross reference to TYPO3 doc for new ViewHelpers by @s2b in #1138
- [TASK] Treat f:argument with default value as optional by @jramke in #1150
- [TASK][v5] Disallow argument definitions with a default value while also being required by @jramke in #1157
- [DOC] Incorrect path specified in the Contribution Guide – ViewHelper documentation is not referenced correctly (#1167) by @staatzstreich in #1168
- [!!!][TASK] Remove renderStatic() for ViewHelpers by @s2b in #1146
- [TASK] Add non-critical type hints to ViewHelper classes by @s2b in #1153
- [!!!][TASK] Remove ViewHelper namespace inheritance by @s2b in #1154
- [FEATURE] RangeViewHelper to return a range of integers as array (#1122) by @ulrichmathes in #1163
- [!!!][TASK] Add final and type checks to SyntaxTree nodes by @s2b in #1140
- [FEATURE] LengthViewHelper returns the length of a given string (#1124) by @staatzstreich in #1169
- [TASK] Remove obsolete IgnoreDeprecations attribute by @s2b in #1178
- [TASK] Annotate correct return types in ViewInterface by @s2b in #1181
- [!!!][TASK] Remove deprecated methods from tag-based VH by @s2b in #1173
- [!!!][TASK] Remove deprecated ViewHelper API methods by @s2b in #1174
- [!!!][TASK] Remove support for {layoutName} variable by @s2b in #1175
- [!!!][TASK] Remove deprecated methods from ViewHelperResolver by @s2b in #1176
- [!!!][TASK] Remove deprecated TemplatePaths API by @s2b in #1177
- [!!!][TASK] Remove wildly unknown VH namespace syntax by @lolli42 in #1184
- [TASK] Add PHP 8.5 to test matrix by @lolli42 in #1185
- [BUGFIX] Fix path access in
ChainedVariableProvider::getby @sascha-egerer in #1165 - [TASK] Apply react/promise patch to fix PHP 8.5 deprecation by @lolli42 in #1189
- [DOCS] Improve TYPO3-related sections of components docs by @s2b in #1188
- [TASK] Apply new cgl rules by @s2b in #1195
- [BUGFIX] Address bug in test ViewHelper by @s2b in #1198
- [BUGFIX] Call proper API to obtain ViewHelper API by @s2b in #1199
- [TASK] Remove micro-optimization from HtmlspecialcharsViewHelper by @s2b in #1197
- [FEATURE] A new <f:merge> ViewHelper should be added to Fluid (#1123) by @staatzstreich in #1206
- [FEATURE] Two new ViewHelpers <f:startsWith> and <f:endsWith> should be added to Fluid. (#1126) by @staatzstreich in #1170
- [TASK] Deprecate old cache warmup feature by @lolli42 in #1211
- [TASK] Avoid PHP 8.5 deprecation \SplObjectStorage->attach() by @lolli42 in #1212
- [TASK] Avoid context-dependent prefixes for cache files by @s2b in #1205
- [FEATURE] Introduce ViewHelperArgumentsValidated event (#1200) by @s2b in #1213
- [!!!][TASK] Strict argument processing for ViewHelpers by @s2b in #1194
- Revert "[TASK] Apply react/promise patch to fix PHP 8.5 deprecation by @lolli42 in #1214
- [!!!][TASK] Remove old cache warmup implementation by @s2b in #1209
- [!!!][FEATURE] Ability to replace argument processor by @s2b in #1204
- [TASK] Remove obsolete $tagAttributes property by @s2b in #1218
- [BUGFIX] Allow NULL for optional arguments with default by @s2b in #1221
- [TASK] Remove unused resetState() method by @s2b in #1217
- [TASK] Address deprecations introduced by PHP 8.5 by @s2b in #1236
- [!!!][TASK] Don't allow null as template identifier in parser by @s2b in #1239
- [!!!][TASK] Remove tag attributes if set to null by @billdagou in #1233
- [!!!][TASK] Accumulate validation code in ViewHelperInvoker by @s2b in #1216
- [FEATURE] Add f:round, f:ceil and f:floor ViewHelpers b...
4.5.0
Fluid 4.5 makes advances in two areas: It contains a range of new ViewHelpers that should make the life of integrators easier. Also, it includes deprecations in preparation for the upcoming Fluid 5.0, which will contain various breaking changes.
New ViewHelpers in Fluid 4.5:
<f:range>creates an array containing the specified range of integers<f:length>returns the length of a given string<f:merge>merges two given arrays into one<f:startsWith>and<f:endsWith>check if a given string starts or ends with another string<f:round>,<f:ceil>and<f:floor>provide various ways to round floats<f:min>and<f:max>return the minimum/maximum value in the given array<f:contains>checks if a given array/string contains the given value
The deprecations and preparations for the upcoming Fluid 5.0 are listed in the documentation: Changelog 4.x
What's Changed
- [TASK] Avoid mocking of nodes in tests by @s2b in #1143
- [FEATURE] RangeViewHelper to return a range of integers as array (#11… by @s2b in #1171
- [FEATURE] LengthViewHelper returns the length of a given string (#1169) by @s2b in #1172
- [TASK] Annotate correct return types in ViewInterface (#1181) by @s2b in #1182
- [TASK] Deprecate unknown VH namespace syntax by @s2b in #1179
- [TASK] Add PHP 8.5 to test matrix (#1185) by @lolli42 in #1186
- [BUGFIX] Fix path access in
ChainedVariableProvider::get(#1165) by @lolli42 in #1187 - [TASK] Apply react/promise patch to fix PHP 8.5 deprecation by @lolli42 in #1190
- [DOCS] Improve TYPO3-related sections of components docs (#1188) by @s2b in #1192
- [TASK] Apply new cgl rules by @s2b in #1196
- [BUGFIX] Address bug in test ViewHelper by @s2b in #1201
- [BUGFIX] Call proper API to obtain ViewHelper API (#1199) by @s2b in #1202
- [TASK] Remove micro-optimization from HtmlspecialcharsViewHelper (#1197) by @s2b in #1203
- [FEATURE] <f:merge> ViewHelper (#1206) by @s2b in #1207
- [FEATURE] <f:startsWith> and <f:endsWith> ViewHelpers (#1170) by @s2b in #1208
- [TASK] Deprecate old cache warmup feature by @s2b in #1210
- [FEATURE] Introduce ViewHelperArgumentsValidated event by @s2b in #1200
- Revert "[TASK] Apply react/promise patch to fix PHP 8.5 deprecation by @lolli42 in #1215
- [BUGFIX] Allow NULL for optional arguments with default by @s2b in #1222
- [TASK] Address deprecations introduced by PHP 8.5 (#1236) by @s2b in #1238
- [FEATURE] Add f:round, f:ceil and f:floor ViewHelpers (#1220) by @s2b in #1240
- [TASK] Remove false-positive from phpstan baseline by @s2b in #1252
- [FEATURE] Add f:min and f:max ViewHelpers (#1245) by @s2b in #1251
- [TASK] Deprecate variables that start with a "_" (#1253) by @s2b in #1256
- [TASK] Deprecate CDATA removal from templates (#1231) by @s2b in #1257
- [FEATURE] <f:contains> ViewHelper (#1193) by @s2b in #1262
Full Changelog: 4.4.3...4.5.0
4.4.3
4.4.2
4.4.1
What's Changed
- [TASK] Avoid testing of mocked abstract classes by @s2b in #1144
- [DOCS] Improve ViewHelper example code (#1147) by @s2b in #1148
- [TASK] Clarify code comments related to escaping (#1151) by @s2b in #1152
- [BUGFIX] allow usage of interfaces in StrictArgumentProcessor (#1155) by @s2b in #1156
- [DOCS] Re-enable cross reference to TYPO3 doc for new ViewHelpers by @s2b in #1158
- [TASK] Treat f:argument with default value as optional (#1150) by @s2b in #1159
Full Changelog: 4.4.0...4.4.1
4.4.0
What's Changed
- [TASK] Clarify parsing state by @s2b in #1117
- [TASK] Add Contribution Guidelines by @pixeldesu in #1120
- [FEATURE] Add f:flatten ViewHelper by @pixeldesu in #1119
- [FEATURE] Add f:shuffle ViewHelper by @pixeldesu in #1121
- [DOCS] Reduce friction for TYPO3 users by @s2b in #1131
- [FEATURE] Named Slots by @s2b in #1118
- [TASK] Establish proper API to set template layout by @s2b in #1090
New Contributors
- @pixeldesu made their first contribution in #1120
Full Changelog: 4.3.0...4.4.0
4.3.0
Fluid 4.3 introduces the concept of components to Fluid. Components are custom HTML-like tags based on Fluid templates that you can reuse throughout your project. The concept is similar to popular frontend frameworks like React and Vue or native Web Components, but they are server-rendered by PHP.
In addition to the user-facing components feature, new low-level APIs have been introduced which potentially allow Fluid to interact with other templating engines.
Both aspects are explained in detail in the documentation:
Thank you to all members of the TYPO3 Association who voted for the community budget idea and made this release possible! ❤️
What's Changed
- [TASK] Clarify current namespace types by @s2b in #1083
- [DOCS] Add inline example for f:format.trim by @metapublic-gbr in #1087
- [DOCS] Re-enable reference to TYPO3 for f:argument by @s2b in #1089
- [FEATURE] Introduce ViewHelperResolver delegates by @s2b in #1084
- [TASK] Deprecate childNodes property for ViewHelpers by @s2b in #1091
- [TASK] Consolidate boolean type aliases by @s2b in #1092
- [TASK] Convert TemplateParser tests to functionals by @s2b in #1094
- [TASK] Add namespace/name getters to ViewHelperNode by @s2b in #1097
- [TASK] Improve ViewHelperNode creation in parser by @s2b in #1095
- [BUGFIX] Attempt to cast boolean arguments by @s2b in #1096
- [TASK] Add cases for inline syntax to parser tests by @s2b in #1100
- [TASK] Add more test coverage for inline ViewHelper syntax by @s2b in #1101
- [TASK] Consistent parser error handling for inline ViewHelpers by @s2b in #1102
- [TASK] Bump dev dependencies by @lolli42 in #1107
- [FEATURE] Reusable components by @s2b in #1098
- [DOCS] New features and deprecations in Fluid 4.2 by @s2b in #1110
- [DOCS] Add documentation for components feature by @s2b in #1111
- [DOCS] Invoking other ViewHelpers by @s2b in #1113
- [DOCS] Improve components documentation by @s2b in #1115
New Contributors
- @metapublic-gbr made their first contribution in #1087
Full Changelog: 4.2.0...4.3.0