Neos 9 Beta-8 Release

Today we released another Neos 9 Beta.

It contains many bugfixes, some refactoring and also new features (marked with :sparkles:).
Most of the work was merged at the Neos sprint in Hamburg and the following weeks.
Thanks to all who participated:

Upgrade instructions from Beta 7

In your composer.json you should require 9.0.0-beta8 for all Neos packages from the development distribution and for the NeosUi:

"neos/neos": "9.0.0-beta9",
"neos/neos-ui": "9.0.0-beta8"

Edit: For Neos packages Beta-9 must be used as it contains an important fix! See https://discuss.neos.io/t/neos-9-beta-9-release-beta-8-addendum/6568.

Breaking changes in Neos

1.) !!! TASK: Move ContentRepositoryId to SharedModel namespace

Instead of referencing Neos\ContentRepository\Core\Factory\ContentRepositoryId you should reference Neos\ContentRepository\Core\SharedModel\ContentRepository

(That can as well be a simple string replace)

2.) :sparkles: Highlight :sparkles: !!! TASK: Workspace aware commands

The php api of most content repository commands was adjusted. The content stream id argument was removed and replaced with the workspace name.
(To migrate you can also look into the Ui adjustments for inspiration)

$contentRepository->handle(
    SetNodeProperties::create(
        WorkspaceName::forLive(), // instead of $contentStreamId
        $subject->nodeAggregateId,
        $originDimensionSpacePoint,
        PropertyValuesToWrite::fromArray(['foo' => 'bar'])
    )
);

This change is partially breaking to your existing events. To allow discarding or publishing a workspace the migration has to be applied:

./flow migrateevents:migrateMetaDataToWorkspaceName

3.) !!! TASK: Split dimensionspacepoints into separate table to reduce data duplication

Note that this needs a ./flow cr:setup and ./flow cr:projectionreplay --projection contentGraph

4.) :sparkles: Highlight :sparkles: !!! FEATURE: Separate properties from references in NodeType declaration

This pr is made backwards compatible in that the declaration of reference properties are still allowed and will be handled at runtime.
The nodetype contains a breaking change, as the references are not any longer available via getProperties and getPropertyType.
For theses usecases getReferences and hasReference were introduced.

Accessing getPropertyType is unsafe for references and will throw:

$propertyType = $nodeType->getPropertyType($propertyName);
if ($propertyType === 'reference' || $propertyType === 'references') {
    // special stuff
}
// ...

The code must be changed to:

if ($nodeType->hasReference($propertyName)) {
    // special stuff
    break;
}
if ($nodeType->hasProperty($propertyName) {
    $propertyType = $nodeType->getPropertyType($propertyName);
    // ...
}

Existing Neos 9 projects using the legacy property-like declaration syntax AND the new features like reference constraints or properties must be migrated to the new syntax with this change.

Note that the php api regarding hasReference and getReferences might NOT be final yet and might be overhauled.

5.) :sparkles: Highlight :sparkles: !!! FEATURE: Subtree Tags

This is a breaking change mainly because it extends the Node and Aggregate read models.
Also the NodeHiddenState projection (and its NodeHiddenStateFinder) were replaced, see TASK: Adjust to introduced Subtree Tags by bwaidelich · Pull Request #3741 · neos/neos-ui · GitHub

A projection replay is not required because the deprecated NodeAggregateWasDisabled and NodeAggregateWasEnabled events are automatically up-casted!

Custom projections might have to be reworked if they handled those events!

6.) !!! TASK: Forgiving node type manager

Optional upgrade instructions to fix your static analysis tools

If you do want the NodeType manager to throw if the NodeType doesnt exist please write:

$nodeType = $nodeTypeManager->getNodeType($nodeTypeName) ?? throw new NodeTypeNotFound('Node type "' . $nodeTypeName->value . '" is unknown to the node type manager.', 1713690868);

But if you want to early return if the NodeType does not exist you can continue to write this

if (!$nodeTypeManager->hasNodeType($nodeTypeName)) {
    return;
}
$nodeType = $nodeTypeManager->getNodeType($nodeTypeName);

or, to fix phpstan errors check if $nodeType is not null:

$nodeType = $nodeTypeManager->getNodeType($nodeTypeName);
if (!$nodeType) {
    return;
}

To retrieve Neos’ 8.3 Fallback behaviour - as documented in 4466 - you can use the NodeTypeWithFallbackProvider trait:

class Foo
{
    use NodeTypeWithFallbackProvider;
    // ...
    $nodeType = $this->getNodeType($node);

Breaking changes in the Neos.Neos.Ui

1.) !!! FEATURE: Overhaul NodeCreationHandlerInterface

If you already implemented a NodeCreationHandlerInterface in Neos9 beta please look into the pr to how the API changed.
Also this extension point is not considered public API with Neos9 and most use-cases should - if applicable - be handled with Flowpack.NodeTemplates (still WIP for Neos0)


Other changes

Neos:

Dev only relevant

Neos.Neos.Ui

Upgrade instructions from Neos 8.3

… are still in the works. But you can already take a glance at Version 9.x - Neos Upgrade Instructions - API - Neos Docs or read the new documentation for Neos 9 (marked with [9.0]).

Other planned (breaking) changes before the Final release of Neos 9

  • The NodeType will get an overhaul (discussion)
  • The Node will now its WorkspaceName instead of ContentStreamId
  • The NodeUriBuilder will be refactored
  • Some event migrations are still expected
4 Likes

We released a small hotfix Neos 9 Beta-9 Release (Beta 8 Addendum)

2 Likes