-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix: Fix slot render functions #27561
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: Fix slot render functions #27561
Conversation
|
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 3894bc2:
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: d2f17a39e1ccd8b106a442a77a4a143432cb9d54 (build) |
📊 Bundle size reportUnchanged fixtures
|
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 701 | 700 | 5000 | |
| Button | mount | 394 | 414 | 5000 | |
| Field | mount | 1237 | 1251 | 5000 | |
| FluentProvider | mount | 775 | 764 | 5000 | |
| FluentProviderWithTheme | mount | 103 | 110 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 90 | 100 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 96 | 97 | 10 | |
| InfoButton | mount | 13 | 19 | 5000 | |
| MakeStyles | mount | 1197 | 1183 | 50000 | |
| Persona | mount | 1870 | 1894 | 5000 | |
| SpinButton | mount | 1443 | 1491 | 5000 |
…lots/fix-render-function
🕵 fluentuiv9 No visual regressions between this PR and main |
|
Here's the follow up on test #27575 |

Previous Behavior
Slot render functions don't work. This was caused by the change to
resolveShorthandin #27472. It now sets the render function onSLOT_RENDER_FUNCTION_SYMBOLinstead ofchildren. The existinggetSlotsfunction is unaware ofSLOT_RENDER_FUNCTION_SYMBOL, and thus ignores the render function.New Behavior
Make
getSlotscheck forSLOT_RENDER_FUNCTION_SYMBOLand use that as the render function instead ofchildren, if present.Related Issue(s)
Note: This PR is a quick fix and doesn't include tests. There should be tests written that would have caught this bug. I logged this to track adding tests: