-
Notifications
You must be signed in to change notification settings - Fork 4
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
WIP: FEATURE Infer props from component #17
base: master
Are you sure you want to change the base?
WIP: FEATURE Infer props from component #17
Conversation
mhsdesign
commented
Oct 24, 2022
``` @proptypes { text = PackageFactory.AtomicFusion.PropTypes:PropsFromComponent { type = "Foo.Bar:Text" isRequired = true } } ```
@@ -1,8 +1,31 @@ | |||
// this is only included in dev context | |||
// todo not anymore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thats a proplem as we cant use eel here.
either put some logic in PropTypeExceptionHandler
to determine if in dev context and fall back to the general exception handler (fusion settings)
or we use context aware objects.yaml and use an interface which we set in @exceptionHandler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could of course achieve the previous behaviour with aop and \Neos\Neos\Domain\Service\FusionService::setPrependFusionIncludes
prototype(Neos.Fusion:Component) { | ||
@exceptionHandler = 'PackageFactory\\AtomicFusion\\PropTypes\\Error\\ExceptionHandler\\PropTypeExceptionHandler' | ||
} | ||
|
||
prototype(PackageFactory.AtomicFusion:Component) { | ||
@exceptionHandler = 'PackageFactory\\AtomicFusion\\PropTypes\\Error\\ExceptionHandler\\PropTypeExceptionHandler' | ||
} | ||
|
||
prototype(PackageFactory.AtomicFusion.PropTypes:PropsFromComponent) < prototype(Neos.Fusion:Value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naming is WIP too - when we find a fitting name i will extract the prototypes into its own folders
suggestion by martin:
PackageFactory.AtomicFusion.PropTypes:ForComponent
andPackageFactory.AtomicFusion.PropTypes:ForComponentArray
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i find PackageFactory.AtomicFusion.PropTypes:ForComponentCollection
tempting, as i would name my php collection dto like that...
or we could also play with the words infer
and props
- they are common in typescript / js
or similar to React.ComponentProps<MyComponent>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prop.Types:FromComponent
PackageFactory.AtomicFusion.PropTypes:PropTypesFromComponent
we could also use a prop isIterateable = true
instead of adding a second prototype for array
Ups did not see that. However i kinda like the fusion implementations from the other pr a little better |