Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update FormFieldShim to work with Field context changes #27436

Merged
merged 4 commits into from
Apr 11, 2023

Conversation

behowell
Copy link
Contributor

@behowell behowell commented Apr 4, 2023

Previous Behavior

FormFieldShim relies on Field's previous behavior of setting props on its child element, to get field props passed to the v0 input controls.

With PR #27399, Field uses context to pass props to its children, instead of setting props directly on the children. Field also supports a render-props function as its child, if using a component that doesn't get props from FieldContext.

New Behavior

Update FormFieldShim to use a render-props function as its child, in order to merge the field's props with the child's props. This results in similar behavior from before #27399.

Related Issue(s)

@fabricteam
Copy link
Collaborator

fabricteam commented Apr 4, 2023

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-datepicker-compat
DatePicker Compat
251.272 kB
67.329 kB
251.257 kB
67.33 kB
-15 B
1 B
react-field
Field
21.509 kB
7.408 kB
21.494 kB
7.41 kB
-15 B
2 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-checkbox
Checkbox
37.02 kB
11.255 kB
react-combobox
Combobox (including child components)
89.718 kB
28.49 kB
react-combobox
Dropdown (including child components)
88.402 kB
28.217 kB
react-components
react-components: Button, FluentProvider & webLightTheme
67.994 kB
18.395 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
207.512 kB
57.555 kB
react-components
react-components: FluentProvider & webLightTheme
38.819 kB
12.351 kB
react-input
Input
26.707 kB
8.113 kB
react-portal-compat
PortalCompatProvider
6.446 kB
2.185 kB
react-progress
ProgressBar
16.322 kB
5.822 kB
react-radio
Radio
35.48 kB
11.126 kB
react-radio
RadioGroup
18.889 kB
6.929 kB
react-select
Select
27.915 kB
9.189 kB
react-slider
Slider
36.845 kB
11.474 kB
react-spinbutton
SpinButton
36.598 kB
10.752 kB
react-switch
Switch
32.438 kB
9.706 kB
react-table
DataGrid
150.829 kB
41.052 kB
react-table
Table (Primitives only)
47.119 kB
12.703 kB
react-table
Table as DataGrid
138.971 kB
35.722 kB
react-table
Table (Selection only)
86.8 kB
21.742 kB
react-table
Table (Sort only)
86.13 kB
21.549 kB
react-textarea
Textarea
30.108 kB
9.478 kB
🤖 This report was generated against 5a8d7a29645b3b500eb7145d2e42ac34fcafc4c6

@fabricteam
Copy link
Collaborator

fabricteam commented Apr 4, 2023

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 896 884 5000
Button mount 591 573 5000
Field mount 1510 1538 5000
FluentProvider mount 1095 1099 5000
FluentProviderWithTheme mount 295 288 10
FluentProviderWithTheme virtual-rerender 271 273 10
FluentProviderWithTheme virtual-rerender-with-unmount 300 285 10
InfoButton mount 201 196 5000
MakeStyles mount 1402 1394 50000
Persona mount 2158 2087 5000
SpinButton mount 1806 1837 5000

@size-auditor
Copy link

size-auditor bot commented Apr 4, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 5a8d7a29645b3b500eb7145d2e42ac34fcafc4c6 (build)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 4, 2023

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 7b9a11d:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@fabricteam
Copy link
Collaborator

🕵 fluentuiv9 No visual regressions between this PR and main

@behowell behowell marked this pull request as ready for review April 4, 2023 23:15
@behowell behowell requested review from a team as code owners April 4, 2023 23:15
@behowell behowell requested a review from chpalac April 4, 2023 23:18
@behowell behowell merged commit 3bad9d0 into microsoft:master Apr 11, 2023
@behowell behowell deleted the field/context-formfieldshim branch April 11, 2023 16:33
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Apr 13, 2023
…t/drawer-light-dismiss-prop

* marcosmoura/feat/drawer-component: (51 commits)
  fix: upgrade react-dialog
  Doc: Add/Remove TreeItem and useFlatTree stories (microsoft#27515)
  applying package updates
  Fix accessibility labels for tree stories (microsoft#27443)
  fix: BasePickerListBelow aria-describedby with values (microsoft#27525)
  chore: Remove deprecated InputField, etc. shim components (microsoft#27492)
  [Feature]: allow aria-description attribute on v9 (microsoft#27478)
  feat(react-jsx-runtime): implements custom JSX pragma (microsoft#27472)
  chore: update generator to include "test-ssr" script (microsoft#27463)
  applying package updates
  fix: add "style" to exports field (microsoft#27274)
  applying package updates
  feat(react-datepicker-compat): Make package public (microsoft#27524)
  fix: react-combobox defines fallbackPositions for popup on small screens (microsoft#27521)
  fix: use tabster to focus on trigger, instead of manually invoking .focus (microsoft#27512)
  add cxe-red to react-shared-context ownership (microsoft#27296)
  docs: add props tables for all exported Popover controls (microsoft#27503)
  fix: Update FormFieldShim to work with Field context changes (microsoft#27436)
  Fix wrong state narration for multiple selected legends (microsoft#27429)
  add codeowners to theme designer v9 (microsoft#27311)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants