Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Neos Con 2022: The New Content Repository

Neos Con 2022: The New Content Repository

Sebastian Kurfürst

May 13, 2022
Tweet

More Decks by Sebastian Kurfürst

Other Decks in Technology

Transcript

  1. immediately consistent strongly consistent not consistent eventually* consistent *eventually !=

    eventuell (DE) eventually == at some point in the future eventually == "bald" Consistency
  2. update projections append events Event Sourced Architecture Events "modify" read*

    Event Store e1 e1 Node properties were updated e2 Node was created e3 Node properties were updated e4 Workspace was created
  3. Projections can be rebuilt DB Tables Empty DB Tables apply

    event 1 DB Tables apply event 2 apply event 3 apply event 4 apply event 1000
  4. write side read side (projections) Event store (DB Table) Content

    Graph Commands Events Workspace Changes (soft) constraints Routing / Linking ... Eventually Consistent
  5. Workspace + Content Stream Dimensions with fallbacks Migrations ... just

    more consistent Consistency Checks + Integrity Violation Checks Node Types new CR
  6. Site A without dimensions Site B and C German, English

    Assets English < German Projectio Events Event Store New Conten t Reposit ory Comman ... Projectio Events Event Store New Conten t Reposit ory Comman ... Projectio Events Event Store New Conten t Reposit ory Comman ...
  7. main innovations 
 Capture users' intention through Commands/ Events -

    Event sourcing 
 Content Graph 
 clean and extensible PHP API
  8. 8.0 8.1 9.0a1 9.0 alpha 1 8.2 ... 8.3 LTS

    ... neos/contentrepository-development-collection neos/neos-development-collection 9.0 "you can start using the new CR alpha for projects with not many package dependencies." "please adjust your packages for Neos 9.0" April '22 August '22 December '22 April '23 est. August '23 Big changes will be coordinated with 9.x 9.0 branch master branch 8.1 branch 8.2 branch 8.3 branch "the fi rst sites run on new CR, please start adjusting your packages"
  9. Creating Nodes (old) $newNode = $node->createNode( null, $this->nodeTypeManager->getNodeType('My.Package:MyNodeType'), ); $newNode->setProperty('myProperty',

    'myValue'); // When are things persisted?? no clue. // Non-Complete Node // How do we get the parent node? // I always have to look this up - ugly!! $context = $this->contextFactory->create([ // what other parameters can I specify here?? 'workspaceName' => 'live', 'invisibleContentShown' => $invisibleContentShown, 'dimensions' => [ 'language_country' => $dimension ], 'targetDimensions' => [ // Who knows the difference between "dimensions" and "targetDimensions"? 'language_country' => $preset ] ]); $node = $context->getRootNode()->getNode('sites/site');
  10. Creating Nodes (new) $command = new CreateNodeAggregateWithNode( $parentNode->getContentStreamIdentifier(), // A.K.A

    Workspace NodeAggregateIdentifier::create(), // generate a new Identifier NodeTypeName::fromString('My.Package:MyNodeType'), OriginDimensionSpacePoint::fromDimensionSpacePoint($parentNode->getDimensionSpacePoint() // which language version to create? UserIdentifier::forSystemUser(), $parentNode->getNodeAggregateIdentifier(), // ID of parent node null, null, PropertyValuesToWrite::fromArray([ // Initial values 'myProperty' => 'myValue' ]) ); $commandResult = $this->nodeAggregateCommandHandler ->handleCreateNodeAggregateWithNode($command); // This will change in the future to $contentRepository->handle($command); 
 $commandResult->blockUntilProjectionsAreUpToDate();
  11. Reading Nodes (old) // TODO: again fetch the start node

    from the context $node->getNode('foo')->getProperties(); // You can only traverse through the tree // If you just updated a node, will it contain the old or the new properties? // If you just created a node, will it already be findable?
  12. Reading Nodes (new) // NodeAccessor wraps the Content Graph and

    provides an extension point for upper layers. $nodeAccessor = $this->nodeAccessorManager->accessorFor( $contentStreamIdentifier, // A.K.A. Workspace DimensionSpacePoint::fromArray([]), // no dimensions, VisibilityConstraints::withoutRestrictions() // or "frontend" for filtering out hidden nodes ); $node = $nodeAccessor->findByIdentifier( NodeAggregateIdentifier::fromString('38364416-ebdf-42b8-87e3-e3e608add663') ); $node->getProperties(); $children = $nodeAccessor->findChildNodes($node);
  13. Fusion and FlowQuery # stays the same, except: # .context()

    is deprecated; and right now we only support # the following two operations: x = ${q(node).context({workspaceName: "user-foo"})} x = ${q(node).context({invisibleContentShown: true})} # .nodePath is deprecated (and expensive). Use the NodeAddress # instead and do not rely on the path information x = ${q(node).nodePath}