Neos and Flow 7.2 "Mock Turtle" Release

Welcome Neos and Flow 7.2 "Mock Turtle" to the release family!

This release of Neos comes with some great new features, bugfixes and a lot of modernisation of the existing code base.

– Written by



Mock Turtle

Mock Turtle appears in chapters nine and ten of Lewis Carroll's Alice in Wonderland.

He seems to be very sad and constantly sobs. He tells Alice about his schooldays.

We chose Mock Turtle because this release cost us some tears of frustration caused by some rather sad bugs. ?

Alice sitting between Gryphon and Mock turtle
Alice sitting between Gryphon and Mock turtle.
John Tenniel`s original (1865) illustration for Lewis Carroll`s "Alice in Wonderland".

Release Highlights

NodeTypes in Subfolders

With bigger projects, the number of NodeType definitions can grow such that it's really hard to keep an overview. Therefore, in Neos 7.2 you are now able to organize NodeTypes in a hierarchical folder structure.

 

This feature allows ``NodeType.*.yaml`` files to be put into nested folders underneath ``<Package-Root>/NodeTypes``:

Packages
  Some.Package
    Configuration
      NodeTypes.yaml (still supported!)
    NodeTypes
      Foo
        Bar.yaml (new)

Note though, that this feature is backwards compatible, and you can also mix both ways :)

 

PHP 8 Attributes Support

As promised in the Neos 7.1 release, Neos 7.2 finally comes with support for PHP 8 attributes!

 

This allows you to use all existing annotations as PHP 8 attributes and make the ReflectionService pick up attributes like annotations. Hence all ``is*AnnotatedWith()`` and ``*Annotation()`` methods will return attribute classes as if they were annotations.

 #[Flow\\Scope("singleton")]
 class MyClass {

    /**
     * @var LoggerInterface
     */
    #[Flow\\Inject]
    protected $logger;

Note though, that this means a class that has both annotation and the equal attribute will behave as if all annotations were duplicated.

Also, in case you manually instantiated an Annotation class, you need to adjust to the changed constructor, which no longer takes a named array, but the list of actual properties. In most cases, instead of ``new Flow\\Inject($args)`` you can probably do ``new Flow\\Inject(...$args)`` with PHP8 and named parameters.

For Doctrine Annotations - see https://github.com/doctrine/orm/pull/8266 which will be available with 2.9

More Performance Improvements

During performance investigations in the last weeks we got aware, that the content tree loads a lot of information from the rendered content. This also explains, why the tree breaks when the rendering breaks. Also a lot of information is loaded from the Content Repository to make sure that everything is in the guest frame.

This is now greatly improved :) 

 

Besides the improvements to the content tree, several improvements were made to reduce the number of queries to the database for nodes and related data in the Neos backend and frontend. Especially larger projects should get a noticeable improvement here.

Fusion Memo Object

This Fusion object stores its value based on the given discriminator and returns the same result in future calls during the same rendering. The value will then not be evaluated again.

 

Example:

 prototype(My.Vendor:Expensive.Calculation) < prototype(Neos.Fusion:Memo) {
     discriminator = 'expensive-calculation'
     value = ${1+2}
 }
 myValue = My.Vendor:Expensive.Calculation
 myValue2 = My.Vendor:Expensive.Calculation

More Neos 7.2 Highlights

Features

 

Upgraded Font Awesome to Version 5.15

With this change, we get new brand icons and COVID-19 icons. Also some bug fixes related to Unicode  issues and much more.

You can now e.g. use new icons like a head-side-mask.

Neos-7-2-Font-Awesome-Update.png

Custom preview icons for data sources

When using a custom data source for a node property that has a select box editor, you can now provide custom image previews and don't have to rely only on Font Awesome.

Custom icons in a Neos inspector dropdown

Show the last login date in the user/account list

The title is pretty self-explaining :)

Neos-7-2-Last-Login.png

More Flow 7.2 Highlights

Features

Extensible Configuration Loaders

This feature allows implementing custom ConfigurationLoader classes which replace the currently rather hard-coded ConfigurationProcessor's in an OOP way.

It is now possible to load custom configurations in the ConfigurationManager with custom locations and custom configuration formats. E.g. it is possible to load JSON files or NodeTypes from another directory than ``Configuration``.

This is not a breaking change for most cases, but the signature of ``ConfigurationManager::registerConfigurationType()`` has been changed and the usage of "configurationProcessingTypes" deprecated in favor of ``Neos\\Flow\\Configuration\\Loader\\LoaderInterface`` instances:

  // legacy (and still supported)
  $configurationManager->registerConfigurationType('SomeCustom', ConfigurationManager::CONFIGURATION_PROCESSING_TYPE_APPEND);

  // now
 $configurationManager->registerConfigurationType('SomeCustom', new AppendLoader($yamlSource, 'SomeCustom'));

I18n.translate() now accept $source to contain dots

``translateByExplicitlyPassedOrderedArguments()`` and ``I18n.translate()`` now accept ``$source`` argument to contain dots instead of only a path to the translation file.

When we use translations, we use for example the shorthand

```php
{I18n.translate('Muensmedia.DistributionPackage:NodeTypes.Content.Todo.Container:ui.label')}
```

When we want to pass arguments we had to use

```php
${I18n.translate('progress', null, {solved: this.checkedElementsCount, total: this.checkboxCount}, 'NodeTypes/Content/Todo/Container', 'Muensmedia.DistributionPackage')}
```

As you can see, you have to pass the **path** to the translation file instead of the well known dot-notation.

This feature enables you to use also the well known dot-notation for the source argument:

```php
${I18n.translate('progress', null, {solved: this.checkedElementsCount, total: this.checkboxCount}, 'NodeTypes.Content.Todo.Container', 'Muensmedia.DistributionPackage')}
```

Documentation and Support

Upgrading

The detailed upgrading process for Neos 7.2 is explained in the upgrade instructions and Release Notes.

For Flow related upgrade instructions, please refer to the Flow 7.2 Release Notes.

Changelogs

See the Neos 7.2, Neos UI 7.2 and Flow 7.2 change logs for all changes and further details.

Support for Neos 7.2 and Flow 7.2

As shown in our release roadmap, Neos 7.2 and Flow 7.2 will get bug fixes until August 2022 and security fixes until August 2023.


Thank you!

Thanks to all core team members and the community for your valuable contributions and sponsorships. Especially during this difficult time in which a lot of people have many private topics on their mind and less time to contribute.

Also, a big thank you to the families of all the team members, that allow them to still put all of this effort into the project!

Take care of everyone and stay healthy ❤️