feat: Add FieldContext to pass props to controls inside Field#27399
Merged
Conversation
Collaborator
📊 Bundle size reportUnchanged fixtures
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: f196c2eb9fe14dbfca668815fc20925cb7618d19 (build) |
Collaborator
🕵 fluentuiv9 No visual regressions between this PR and main |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 3423379:
|
Collaborator
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 930 | 922 | 5000 | |
| Button | mount | 572 | 573 | 5000 | |
| Field | mount | 1635 | 1643 | 5000 | |
| FluentProvider | mount | 1176 | 1185 | 5000 | |
| FluentProviderWithTheme | mount | 304 | 324 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 278 | 275 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 298 | 299 | 10 | |
| InfoButton | mount | 210 | 193 | 5000 | |
| MakeStyles | mount | 1314 | 1309 | 50000 | |
| Persona | mount | 2249 | 2228 | 5000 | |
| SpinButton | mount | 2013 | 1982 | 5000 |
behowell
marked this pull request as ready for review
March 31, 2023 23:20
behowell
requested review from
a team,
khmakoto,
sopranopillow and
tomi-msft
as code owners
March 31, 2023 23:20
behowell
requested review from
a team,
micahgodbolt,
smhigley and
spmonahan
as code owners
March 31, 2023 23:20
Contributor
spmonahan
approved these changes
Apr 1, 2023
Contributor
Author
I think it's because it had more logic related to merging props, in addition to importing |
khmakoto
reviewed
Apr 4, 2023
…self at the same time
This was referenced Apr 4, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Previous Behavior
Fieldreads and modifies the props of its child elements, in order to set up thearia-labelledby, etc. associations between the control and the labels in the Field.This works fine in common, simple cases where the control is the direct child of the field. However, some form validation libraries require inserting a React component around the control, as is the case with #27202. This component interferes with the prop setting approach that Field was using.
New Behavior
FieldContextto pass information about the Field to its child elements.useFieldControlProps_unstablefor controls to use to merge field props from the context.Related Issue(s)