nextcloud-vue
nextcloud-vue copied to clipboard
Filter out invalid Components
Problem
- To prevent developers from adding components that does NOT fit Nextcloud standards, we prevent some to be rendered if they are not official ones.
- It create issues when we want to wrap said component:
Even if the Wrapper is just rendering a valid Action.<Actions> <ActionInput /> <!-- rendered --> <ActionButton /> <!-- rendered --> <Wrapper> <ActionButton /> <!-- NOT rendered --> </Wrapper> </Actions>
Temp solution
- We removed this in https://github.com/nextcloud/nextcloud-vue/pull/2252
Questions
- But it still bring back the debate whether enforcing is really such a wanted feature
- And if so, what approach should we take. Any component could theoretically set itself with a valid name and be rendered too :shrug:
Proposals:
- We stop doing this and we just check if devs do bad things with it
- We use css to hide the bad entries. Since we scope, we have a unique SCOPE ID that matches the library's build time. Since wrapping such components will still display them properly in the dom:
then we could hide all of those that does NOT match the library scope, or something like that :thinking:
I don't have strong preferences anymore. We don't have time reviewing every component created by devs, so :shrug:
We stop doing this and we just check if devs do bad things with it
I would go with this one. Hiding stuff seems a bit hacky :grin:.
People can do crazy things everywhere, why not inside <Actions>? :wink:
People can do crazy things everywhere, why not inside
<Actions>?
Well, Actions is not the only thing we protected :wink:
We stop doing this and we just check if devs do bad things with it
Would vote for this as well especially since runtime component validation unecessarily uses CPU resources when we can check instead on build and/or CI :)
I would also tend to not enforce this anymore. It will reduce CPU time and should simply work faster. As a dev you can do all kinds of unforseen stuff with the components, or simply not use them. We would hardly ever be able to prevent all undesired uses.
Although I have to admit that I wonder why you need a wrapper around your Actions, and whether this is a valid usage 😄🙈
I would second the removal of this check #1962
Edit: Already done????? #2252
@dartcafe yes, it created issues somewhere else