-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
refactor(Collapse): streamline atom functions #33463
base: master
Are you sure you want to change the base?
refactor(Collapse): streamline atom functions #33463
Conversation
📊 Bundle size reportUnchanged fixtures
|
Pull request demo site: URL |
0aea9d7
to
3608e82
Compare
change/@fluentui-react-motion-components-preview-67537ce1-b461-4bec-bbcb-61d9202e6632.json
Show resolved
Hide resolved
53ccc82
to
fca343d
Compare
fca343d
to
6eabc48
Compare
2fdcbee
to
ede82f1
Compare
ede82f1
to
acd854e
Compare
The PR description mentions that fadeAtom is in a common location and is imported into Collapse for reuse. Should the same logic be applied to the white space and container size atoms? Would it make sense to refactor these as reusable basic instances and move them to a shared location for consistency? |
I noticed the interfaces interface BaseMotionAtomParams {
duration: number;
easing: string;
delay?: number;
}
interface SizeEnterAtomParams extends BaseMotionAtomParams {
element: HTMLElement;
fromSize?: string;
} |
|
Good question. I moved Whereas the whitespace and container size atoms have only been used in |
This is an interesting abstraction consideration that I'm still pondering. With
Of course, we could allow I chose a different approach for |
Sure, we're at the point where |
Thank you for the clarification! While I understand the current scope of white space and container size atoms being specific to the Having a shared space for reusable atoms, even if they’re currently scoped to a single component, would make the system easier to extend and maintain. It would also prevent the loss of context for future developers unfamiliar with the current setup. Maintaining atomic logic where atoms are reusable building blocks ensures clarity and consistency across the project. When atoms are scoped exclusively to one molecule (like |
Reusable abstractions are good, when we've tested the abstraction through reuse across differing use cases. But if we haven't reused the abstraction, we haven't actually tested it well enough to know if it's ready to reuse. Premature Abstraction is a real problem that we must be mindful of. At this point, it seems premature to move atoms into the common space before we validate their reusability in multiple usage scenarios. |
Previous Behavior
New Behavior
fadeAtom
is in a common location;Collapse
andFade
import it for reuseFuture Work
fadeAtom
in other motion components wherever possiblefadeAtom
code; it can import it instead, after this PR.Related Issue(s)