-
Notifications
You must be signed in to change notification settings - Fork 2.9k
chore: move trigger methods to its own package react-trigger
#24923
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
chore: move trigger methods to its own package react-trigger
#24923
Conversation
📊 Bundle size reportUnchanged fixtures
|
|
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 60ee223:
|
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 1321 | 1348 | 5000 | |
| Button | mount | 963 | 922 | 5000 | |
| FluentProvider | mount | 1593 | 1555 | 5000 | |
| FluentProviderWithTheme | mount | 633 | 632 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 585 | 589 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 626 | 636 | 10 | |
| MakeStyles | mount | 1898 | 1926 | 50000 | |
| SpinButton | mount | 2532 | 2570 | 5000 |
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: e58b334fbe079a3679a797d7252d4409681698d8 (build) |
05a3f55 to
730af74
Compare
|
Blocked by #24927 |
a779196 to
f2c6986
Compare
change/@fluentui-react-trigger-878d2c89-74e6-475d-bd81-c43652fb8f57.json
Outdated
Show resolved
Hide resolved
6968bef to
60ee223
Compare
behowell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks good technically. However, the description doesn't say why it's necessary to move this into a separate package. I'm worried about excessive proliferation of packages if we start moving each utility to its own package. Could you update the description with more details about what problem this is solving?
If you'd like, you can set this PR to auto-merge after updating the description, so it will merge once I see the update and approve.
Thanks!
behowell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it sounds like this is refactoring; not solving a technical problem, right? Before making a new package for this, it would be good to have a plan for how we decide when a utility should live in react-utilities vs. its own package. That way we can have a consistent and predictable set of packages.
If the goal is to keep related utilities together, then perhaps they should just be in a sub-folder of react-utilities, instead of their own package.
Or, if the goal is to separate out the fluentui-isms like triggers and slots, out from general-purpose utilities, then perhaps we name this package react-core or something, and move the slots and other core functionality into it.
Would it be possible to write a (short?) RFC about how that would work, and discuss it with the team at the next tech sync?
Yes, this is definitely just a refactoring, and a simple one.
The problem is not just splitting from general-purpose utilities methods, its more about the priority those domain specific utilities require in our own library. The way I see utilities provided on On the case of both slots and triggers utilities on the other hand, they have their own domain and its very specific use cases (including multiple types and helper methods that require to be used together in a certain pattern). Demanding proper documentation and examples on our side to ensure proper usage, simply adding comments doesn't get this done.
I believe a I don't see why having a package for each of those complete distinct logics is so harmful, they're treating complete different domain logics and have absolutely nothing in common but the fact that they're reused internally. if it were the case of having those two domains colide by depending on one another than I'd agree with keeping them together, but that is not the case. |
|
After internal discussion, I think it's a majority decision to keep the current folder structure the way it is, on the addendum of a commitment on our side for better documentation on those domain specific folders. |


Main reason for this split would only be better separation of concern. The way I see trigger has its own domain logic meanwhile
react-utilitiesshould be more devoted for general purpose things. I have the same feeling for slots (it should be separated from utilities), but I guess its already too late for that...@fluentui/react-utilitiesto@fluentui/react-trigger@fluentui/react-utilitiesto@fluentui/react-triggerreact-dialogreact-menureact-overflowreact-popoverreact-tooltip