uniforms icon indicating copy to clipboard operation
uniforms copied to clipboard

Consider support absolute path render with <AutoField>

Open levi-art-rules opened this issue 2 years ago • 6 comments

Motivation why you'd like to see this in uniforms.

We have a use case where we want to display a field down to its sister field. Rn, because uniforms only supports rendering children fields within a specific field, it is not possible. In general, I think it's also beneficial to enable rendering a field given an absolute path. uniforms already provides useField with options to accept this option, what we need to do is to enable it inside createAutoField.

Examples of how others could use this feature.

Usage: <AutoField name="lists.0.name" options={ absoluteName: true} />

Possible workarounds, if applicable.

N/A

levi-art-rules avatar Jun 07 '22 01:06 levi-art-rules

Hi @levi-art-rules and thanks for the idea! I definitely see it as something we'd like to have going forward, but introducing any sort of prop (with a sane name) to AutoField may break a lot of projects. It's doable in v4, though.

In the meantime, I'm thinking whether or not we could add something like experimental_nameIsAbsolute flag or even experimental_absoluteName as an alternative to name. What do you think?

CC @vazco/open-source.

radekmie avatar Jun 10 '22 12:06 radekmie

Hi @levi-art-rules and thanks for the idea! I definitely see it as something we'd like to have going forward, but introducing any sort of prop (with a sane name) to AutoField may break a lot of projects. It's doable in v4, though.

In the meantime, I'm thinking whether or not we could add something like experimental_nameIsAbsolute flag or even experimental_absoluteName as an alternative to name. What do you think?

CC @vazco/open-source.

Feature flag sounds good to me. Thank you for your reply. I wonder what the timeline for pushing it will look like?

levi-art-rules avatar Jun 14 '22 17:06 levi-art-rules

@radekmie I think adding it as an experimental feature flag sounds good.

As a side note, maybe we could make it easier for us to introduce such changes in the future by adding a mention to the docs like any props prefixed with "uniformsExperimental_" are reserved? I don't think it's a common practice or how useful that will actually be but just a random thought.

wadamek65 avatar Jun 15 '22 14:06 wadamek65

@levi-art-rules We can't give you a timeline, sorry!

@wadamek65 Do you think that we should add uniforms prefix too? I never seen a lot of experimental_ props anyway, especially on UI components. In any case, we should add it to FAQ, that we may use them for pre-releases of some features.

radekmie avatar Jun 27 '22 13:06 radekmie

(That also means this issue is up for grabs; if you want, do send us a PR!)

radekmie avatar Jun 27 '22 13:06 radekmie

@radekmie Just experimental_ also sounds good to me.

wadamek65 avatar Jun 28 '22 08:06 wadamek65