Neos 5.2 »Bandersnatch« and Flow 6.2 released

Welcome Neos »Bandersnatch« to the release family!

– Written by


Glacier Cave in Switzerland - Roseg Glacier

Glacier Cave in Switzerland - Roseg Glacier - Neos 5.2 Login Wallpaper from Matthias Widmer

Neos 5.2 and Flow 6.2 aka »Bandersnatch« are finally released!

This release is a more technically focused one and most of the changes and new features are under the hood. But that doesn't make them less awesome! Check them out here:

The Bandersnatch. A drawing by dreamsAreHope from deviantart

The Bandersnatch, by dreamsarehope (deviantart)


Neos UI

Neos UI 5.2 introduces a few improvements. Here are some highlights you should check out!

Improved DND animation for the document tree

We have implemented a custom animation when dragging nodes in the tree. It looks better and makes it clear exactly at what point the nodes are going to be inserted.

Allow override of rootnodes in node trees

With this change it’s possible to change the rootNode via a prop of the document and content tree for when creating a custom Neos UI plugin. This makes it possible for example to create custom trees with tabs and each one can show a different part of the page tree.

Example:

const PageTree = containerRegistry.get('LeftSideBar/Top/PageTree');

const ModifiedTree = () => (
        <PageTree rootNode={aRootNodeThatIsNotTheSite} />
 );

containerRegistry.set('LeftSideBar/Top/PageTree', ModifiedTree);

Allow custom position for new nodes in Content Collections

Before this change a new node was always inserted as direct child.
With this change there can be any template structure and one element can be defined as anchor for insertion.
When multiple anchors exist, the first one will be used.

To specify the anchor point for inserting children of a collection in your markup,
you add an attribute on the container element: data-__neos-insertion-anchor.
If found, that container will be used for inserting new items, otherwise the parent
element (as usual). The Fusion object Neos.Neos:ContentCollection automatically has this attribute now and will behave as expected when used in your AFX template.

The primary use case is to have a ContentCollection that is also a content element itself. Usually the content collection has its own wrapper and all the children are in there. This is a feature that will be further improved in the next Neos versions but should solve common problems.

Add new Icons from fontawesome

Fontawesome was upgraded from 5.8.0 to 5.12.0 which adds a lot of new icons.

Minor UI improvements

  • Updates of dependencies
    All dependencies were updated to the latest versions. Notably, React was updated to version 16.13 (from 16.4) and Redux to 4.0. This means you can now use React hooks in your plugins.
  • Improve compatibility with event sourced Content-Repository
    Some issues with the ES CR were resolved
  • A lot of cleanup and other bugfixes
    In total, this release alone contains 110 commits since version 5.1.6!
  • Support for TypeScript in UI plugins
    This was actually a bugfix for 4.3+ but if you missed the release notes you can now import *.ts and *.tsx files from your manifest.js

Neos Backend

Reduced backend load time with nodetype schema cache

Load times for Neos instances with lots of nodetypes are reduced by several seconds depending on the setup. 
Also the response has a cache header to allow the browser to keep the result longer. 

This also helps in development context as the `version` parameter changes when the nodetypes change. Therefore changing Fusion and reloading is faster ;)

Reduced stylesheet for backend modules

The old stylesheets from pre-react times override a lot of basic styles for backend modules. 
This makes it hard to implement custom styles there or use our react ui components. 

With this change it's possible to configure a "Lite" and a "Minimal" variant of the Neos backend stylesheet via the module configuration

The old "Main" stylesheet variant is kept for compatibility reasons. 

The "Lite" stylesheet should be used with almost all modules and will also be used for the core modules. 
It also provides all relevant Neos CSS variables and is about 50% smaller than the old one.

The "Minimal" stylesheet should be used for modules that bring their own styles. For example modules that use the Neos react-components library. 
It also provides all relevant Neos CSS variables and is about 70% smaller than the old one. 

Example: 

  Neos:
    modules:
      management: # Or any other module group
        submodules:
          myModule:
            controller: \\My\\Site\\Controller\\MyModuleController
            label: 'My module'
            description: 'My module'
            icon: 'fas fa-camera'
            privilegeTarget: 'My.Site:ManageMyModule'
            mainStylesheet: 'Lite' # Or 'Minimal', default is 'Main'

These stylesheet variants now exist for compatibility reasons with old modules and to make writing new ones easier.
With Neos 6.x we plan to rewrite all backend styles and make building new backend modules more approachable.

Icons and description for asset sources

Asset source icons and description

Asset sources can now contain a custom icon and descripion to better identify them.

Icons and descriptions can now be provided by the asset source.  
The icon makes the asset source easier to identify while the description can provide further information or a link to the asset source as required by some free asset source API guidelines. 

To make your AssetSources compatible with Neos 6.0 add the methods

* public function getIcon(): string
* public function getDescription(): string

to your asset source.

Keep tags and collections of assets when exporting sites

Tags and collections of assets are now included in site exports to XML and are imported properly, too.


Fusion performance optimization (lazy Component props)

Components provide a nice way to structure Fusion code but prevent lazy evaluation as Fusion by default does eager evaluation of all properties as props
If conditions are used inside the renderer, it's quite probable that not all props are used - so a large amount of unnecessary evaluations could be performed. 

This change introduces a LazyProps object implementing ArrayAccess that evaluates the actually accessed props lazily (and caches the results).

Allow more than one authentication provider

Neos 5.2 now allows to configure and use multiple authentication providers.
This does not cover the issues that arise when more than one account is associated with a single Neos user. It only allows one account per user (a limitation that already exists right now, though). 
Instead of always using the default authentication provider (Neos.Neos:Backend) to retrieve a user or username, the authentication provider associated with the respective account is used.

Sortable NodeType Post processors

Allows a position to be specified in the NodeType postprocessors configuration.

  'Some.Custom:NodeType':
    # ...
    postprocessors:
      SomeCustomTypePostprocessor:
        position: 'end'
        postprocessor: 'Some\\TypePostprocessor'

General improvements

  • Added basis for support for nested tags
    It is not yet exposed in the UI, as nested Tags will be a feature of the new Media UI.

Flow

Configurable UsernamePassword fields and UsernamePasswordTokeninterface

Allows to configure the argument names for username and password to make interoperability with other services easier.
The new options can be set for a specific provider with the following configuration:

Neos:
  Flow:
    security:
      authentication:
        providers:
          DefaultProvider:
            provider: PersistedUsernamePasswordProvider
              tokenOptions:
                usernamePostField: 'some.argument'
                passwordPostField: 'some.other.argument'

Virtual Object Configuration

The Flow Object Management has been built with the idea of virtual "object names". 
But so far it was not possible to have an object configuration with a name that is not equal to the class name. 
With this feature it is possible to create configurations for "virtual objects" within the Objects.yaml:

# the colon ":" makes this a virtual object
'Some.Package:SystemLogger':
  className: Psr\Log\LoggerInterface
  scope: singleton
  factoryObjectName: Neos\Flow\Log\PsrLoggerFactoryInterface
  factoryMethodName: get
  arguments:
    1:
      value: systemLogger
'Some.Package:SecurityLogger':
  className: Psr\Log\LoggerInterface
  scope: singleton
  factoryObjectName: Neos\Flow\Log\PsrLoggerFactoryInterface
  factoryMethodName: get
  arguments:
    1:
      value: securityLogger

..and to inject them:

/**
 * @Flow\Inject(name="Some.Package:SystemLogger")
 * @var LoggerInterface
 */
protected $systemLogger;

/**
 * @Flow\Inject(name="Some.Package:SecurityLogger")
 * @var LoggerInterface
 */
protected $securityLogger;

Allow configuring static factory methods in Objects.yaml

This change allows to configure static factory methods in Objects.yaml by only specifying a factoryMethodName and leaving out factoryObjectName.

Acme\My\Class:
  factoryMethodName: Acme\My\Class::fromStatic
  arguments:
    1:
      setting: Acme.My.Class.ConfigurableValue

Before this would have required to create a non-static factory method inside a dedicated factory class (to avoid cyclic instanciation).

Run garbage collection of configured caches

In order to run garbage collection the following command 
has been introduced 

./flow cache:collectgarbage

which will iterator over all configured caches and 
run the corresponding collectGarbage method. 

You can also run garbage collection on a single cache 
by definined the cache identifier 

./flow cache:collectgarbage --cache-identifier Flow_Monitor

Resolve authentication token by simple name

The documentation has long been showing that you can define 
a security token by it's simple name, if in the Neos.Flow 
package. 

This has not been really true, since there was no resolving 
from the simple string, similar to how providers have been 
resolved. 

This change brings the same resolving functionality as the 
provider.

Further changes

  • Array Debugger tolerates iterables
    This change lets the debug-array-renderer use the pseudo type iterable (Array or Traversable) instead of array.
  • Improve 304 response handling
    Flow will automatically return a 304 response if an ETag header matches the If-None-Match request.
  • Add EEL Helper File.exists(filename)
    This EEL helper determines if a file exists and helps with conditional rendering.
  • Emit a signal when view is resolved
    A new signal ViewResolved(ViewInterface $view) helps with providing global variables to views.

Documentation and Support

Upgrading

The detailed upgrading process for Neos 5.2 is explained in the upgrade instructions.

Changelogs

See the Neos 5.2 changelogs, Neos UI 5.2 changelogs and Flow 6.2 changelogs for all changes and details.

Support for Neos 5.2 and Flow 6.2

As shown in our release roadmap, Neos 5.2 and Flow 6.2 will get bug fixes until April 2021 and security fixes until April 2022.


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.

Take care everyone and stay healthy ❤️