This repository was archived by the owner on Mar 4, 2020. It is now read-only.
RFC: drop support for primitive shorthand values #2206
+528
−732
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.
RFC: drop support for primitive and array shorthand values
The proposal here is to drop the support for using primitive and array shorthand values:
to be replaced with:
*The second option is already available
Why?
We will have only way of defining shorthands, so customers will be able to easily understand and apply it
Currently, customers don't understand the transition from primitive shorthands to props object. For example, why in the case of the icon prop, the primitive is mapped to name, but in the case of content, it is mapped to content
is the same with
For the problem with
content={{content: '...' }}
, @layershifter already has an RFC for removing it: #2205There is a confusion, as people see only simple examples in the components' docs page and don't understand that they can pass additional properties :(
It will greatly simplify the internal implementation - we will be able to remove lots of the logic we have now where we have to handle primitives + objects, and in the future will allow us to have more generic way of internal injection of utilities classes/properties to the components, without having to do some checks for primitives or figuring out which property the primitive value is mapped to. (this will reduce the number of potential bugs we may introduce...)
Problems:
Please share your opinion!