uniforms icon indicating copy to clipboard operation
uniforms copied to clipboard

Consider removing `props` from `Bridge.getInitialValue`

Open radekmie opened this issue 4 years ago • 2 comments

As described in https://github.com/vazco/uniforms/issues/998#issuecomment-938594418, passing props to Bridge.getInitialValue was not well-thought:

[...] It'd be enough to memoize this getInitialValue call. The problem is that we cannot do that, as it receives props that may include arbitrary complex structures. Why? you may ask. And that's a very good question! Only to implement the initialCount prop for ListField (JSON schema, SimpleSchema).

As this is the only usage of it within the core themes and we haven't seen any "in the wild", we decided to deprecate this feature and remove it in v4. This issue is a place to raise concerns, questions, or alternative proposals.

radekmie avatar Oct 13 '21 10:10 radekmie

(We've had a team discussion about this issue, and here are the notes.)

We've decided to remove it in v4.

radekmie avatar Dec 10 '21 10:12 radekmie

We've revisited this issue and confirmed our decision of the removal of props in Bridge.getInitialValue. This will lead to the deletion of the initialCount prop as its usage is not intuitive and can be worked around. To migrate, one should start using defaultValue instead.

wadamek65 avatar Sep 08 '22 12:09 wadamek65