-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
!!! FEATURE: NodeTemplates Version 2.0 #53
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mhsdesign
changed the title
WIP: TASK: Separate template creation from apply
!!! WIP: TASK: Separate template creation from apply
Jun 3, 2023
…esultBecauseOfException for control flow
mhsdesign
changed the title
!!! WIP: TASK: Separate template creation from apply
!!! TASK: Separate template creation from apply
Jun 3, 2023
…trictly by type The differentiation is done as preparation for the new CR
previously it was possible to use properties._hidden #3
…teCreationFromApply
mhsdesign
changed the title
!!! TASK: Separate template creation from apply
!!! FEATURE: NodeTemplates Version 2.0
Jun 5, 2023
Todo:
|
(and extensible for the future)
…llowing to override the default value > nicht versuchen schlauer zu sein als das system > ~ Martin
New process + exception handling explained:
|
due to the discussion of unclear naming neos/neos-development-collection#4312
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
!!! TASK Separate template configuration processing from node creation
In preparation for the 9.0 version. But to have a larger test user base we will introduce this new architecture also for the old CR
resolves #48
resolves #50
resolves #43
resolves #35 (todo add configuration to turn on this feature)
see also #35 (comment)
NodeTemplates Version 2.0
With this new major release, we strive to make the version 2.0 template syntax and behaviour as close to the upcoming version 3 for Neos 9.
So you can for example expect stricter validation for properties already right now.
This mentality will make it easier to have a more similar code-base and also be able to easily backport features to the Version 2.
For that reason the whole code-base was refactored. With the most prominent changes being a two-step procedure to process the template and then start the node creation. Also a graceful exception handing wraps now nearly every operation.
This release is breaking for lots of edge cases but the error logs will hopefully be a helping compensation :D
!!! Refactoring: Two-step procedure to process the template and then start the node creation
Previously the template configuration was processed and nodes were created in the same step - coupled together. This was suboptimal architecture for the reasons:
FEATURE: Spot on exception handling, resuming with the next possible operation.
In the first step the configuration is processed, exceptions like those caused by an EEL Expression are caught, and any malformed parts of the template are ignored (with their errors being logged).
This might lead to a partially processed template with some properties or childNodes missing.
You can decide via the exception handling configuration
Flowpack.NodeTemplates.exceptionHandling
, if you want to start the node creation of this partially processed template (stopOnException: false
) or abort the process (stopOnException: true
), which will only lead to creating the root node, ignoring the whole template.In case exceptions are thrown in the node creation of the template, because a node constraint was not met or the
type
field was not set, the creation of the childNode is aborted, but we continue with the node creation of the other left over parts of the template.It behaves similar with properties: In case a property value doesn't match its declared type the exception is logged, but we will try to continue with the next property.
Changes in sight of Neos 9 ESCR forward compatibility
_foo
property syntax, which was introduced with was reverted.This was done in preparation for the Neos 9 ESCR to be forwards compatible. A new
properties._hidden: true
equivalent is in the work already see pr. In case you need support for another node option that will still be available in the new ESCR, please create an issue and let us know. In the other case you can stay on the previous v1.x Version of this package.(9.0 DOCS: Node
hidden
vsdisabled
neos/neos-development-collection#4312 (comment))nodeCreationDepth
was removed. It was previously more of a necessity as it was needed for the property mapper. Now the whole template will be evaluated and applied.triggeringNode
but also the currentnode
andparentNode
. Due to the two-step approach, first evaluating the template, you will only have access on to thetriggeringNode
.In version 3 the nature of the new Neos 9 API won't allow you to access the
triggeringNode
but presumably only the currentsubgraph
.options
array introduced with will also be dropped as the use case was unclear and conflicts with the refactoring to the mentioned two-step approach.Other changes
${
instead of trying to check if there is a valid expression. This will help in cases where the malformed expression was saved as property value instead throwing an error. See issuewithContext
where not accessible in the rooturiPathSegment
.uriPathSegment
generation of child pages was changed fromNeos\ContentRepository\Utility::renderValidNodeName($properties['title'] ?? null)
toNeos\Neos\Utility\NodeUriPathSegmentGenerator::generateUriPathSegment($node, $properties['title'] ?? null)
uriPathSegment
on the template root node will be either based on the template propertyproperties.uriPathSegment
or defaults to the slug generated from the creation dialog'sdata.title
(The original behaviour).type
is not allowed to be set for auto-created child nodes. We don't allow to change the type right now. We never did.type
must be set to a valid existing NodeType for to be created nodes. Previously it would fall back to the configured fallback like:Neos.Neos:FallbackNode
.int|float|string|bool|null
. (Using nested arrays might come in handy for new features later like for setting Neos 9 reference properties.) Previously it was also possible to set a property to a list likepropertyName = ['foo', 'bar']
instead of using EEL:propertyName = "${['foo', 'bar']}"
.title
anduriPathSegment
now simple strings work toouriPathSegment
was build fromtitle
property in childNodes