WIP: FEATURE Infer props from component#17
WIP: FEATURE Infer props from component#17mhsdesign wants to merge 1 commit intoPackageFactory:masterfrom
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.
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.
we could of course achieve the previous behaviour with aop and \Neos\Neos\Domain\Service\FusionService::setPrependFusionIncludes
| @exceptionHandler = 'PackageFactory\\AtomicFusion\\PropTypes\\Error\\ExceptionHandler\\PropTypeExceptionHandler' | ||
| } | ||
|
|
||
| prototype(PackageFactory.AtomicFusion.PropTypes:PropsFromComponent) < prototype(Neos.Fusion:Value) { |
There was a problem hiding this comment.
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:ForComponentandPackageFactory.AtomicFusion.PropTypes:ForComponentArray
There was a problem hiding this comment.
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.
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 |