docs/react-v9/contributing/rfcs/react-components/convergence/field-package-layout.md
Contributors: @behowell
This RFC explores several options for which packages Field-related components should live in.
Currently, all Field versions of the components are exported from a single package: @fluentui/react-field (this is described in more detail as Option 0 below). This results in a large package with unrelated components exported from it. This RFC aims to decide what is the best place to put the Field component definitions.
All form components have both a base version without a label (e.g. Input), and a Field version that adds a label, message, and layout options (e.g. InputField).
@fluentui/react-fieldThis is how the packages are currently organized: the @fluentui/react-field package exports all of the individual component field types (InputField, TextareaField, etc.), and has dependencies on each components' packages.
Exports
@fluentui/react-field exports:
useField_unstable, etc.)CheckboxFieldComboboxFieldInputFieldProgressFieldRadioGroupFieldSelectFieldSliderFieldSpinButtonFieldSwitchFieldTextareaFieldDependencies
@fluentui/react-field depends on:
@fluentui/react-checkbox@fluentui/react-combobox@fluentui/react-input@fluentui/react-progress@fluentui/react-radio@fluentui/react-select@fluentui/react-slider@fluentui/react-spinbutton@fluentui/react-switch@fluentui/react-textarea@fluentui/react-icons@fluentui/react-labelThis would invert the dependencies, and have @fluentui/react-field be a utility package that only exports the definitions required to create Field components.
Exports
@fluentui/react-field exports:
useField_unstable, etc.)@fluentui/react-input exports:
InputInputFieldDependencies
@fluentui/react-input adds dependencies on:
@fluentui/react-field
@fluentui/react-icons@fluentui/react-label@fluentui/react-field package when adding a new component.@fluentui/react-field package to create Field versions of their own components without pulling in dependencies on all input controls.No change: export all field components from @fluentui/react-field
@fluentui/react-label and @fluentui/react-icons) out of base component packages.@fluentui/react-field package depends on many other packages that are unrelated to each other.Input and InputField are in different packages.-field versions of each packageAdd the following packages:
@fluentui/react-checkbox-field@fluentui/react-combobox-field@fluentui/react-input-field@fluentui/react-progress-field@fluentui/react-radio-field@fluentui/react-select-field@fluentui/react-slider-field@fluentui/react-spinbutton-field@fluentui/react-switch-field@fluentui/react-textarea-fieldExports
@fluentui/react-input-field exports:
InputFieldDependencies
@fluentui/react-input-field depends on:
@fluentui/react-input@fluentui/react-field
@fluentui/react-icons@fluentui/react-label