Comments (8)
Just had a play with styles concept because we need the styles to be "toString"able for our static style extraction and the data attributes and this seems to work well: https://codesandbox.io/s/staging-flower-nhm3w
It actually feels much nicer than what we currently have on our side.
from primitives.
considering individual parts are no longer tree-shakable
Oooo, interesting! Maybe we could test one of our larger components. One test with tree-shakable exports and another with dot notation to see if the difference is really that significant ?
Given that we're moving cssResets
into its own package, our styles will only contain functional styles and I'm thinking most of the time consumers would need/want to use these?
from primitives.
So perhaps we should already export them named like this, seeing that people will build on top and most likely call it the same.
Yep I agree, I brought this up before and I'd guess many consumers building component libs will wish for the same.
from primitives.
From a DX perspective I think I agree -- the static property is quite nice!
For smaller components I don't think this matters all that much, but for larger components with more logic and complexity are we potentially designing ourselves into a box with this pattern, considering individual parts are no longer tree-shakable? I've actually been wondering if we might move back in the other direction to favor individual exports for that reason alone. 😬
from primitives.
Oooo, interesting! Maybe we could test one of our larger components. One test with tree-shakable exports and another with dot notation to see if the difference is really that significant ?
I'd love to see this before we release! I think most components we have right now are probably OK because all of the parts are pretty much required anyway. But in a select, you may or may not want Select.OptionCheckbox
or Select.OptionRadio
but we're giving you all of that code anyway. I could see something like a datepicker getting really wild.
from primitives.
I'm confused about the tree-shakability because generally the parts are not optional.
There might be the odd one but generally it's not the case. So the cost is there regardless.
I think most components we have right now are probably OK because all of the parts are pretty much required anyway. But in a select, you may or may not want Select.OptionCheckbox or Select.OptionRadio but we're giving you all of that code anyway. I could see something like a datepicker getting really wild.
Just saw that now… haha, yeah 🤔
from primitives.
Yeah this is less of a concern now than a potential concern that may come back to bite us if we want a consistent API 😬
from primitives.
Looks like we've covered all basis with this one now. I'll close but feel free to re-open if anyone thinks more attention is needed 😘
from primitives.
Related Issues (20)
- [a11y] WAVE error on Dialog and other primitives (Broken Aria Reference: aria-labelledby)? HOT 1
- Tabs set orientation="vertical" not working HOT 1
- Allow passing `virtualRef` to `TooltipTrigger` similar to `PopoverAnchor`
- Expose cross axis shifting in Popover
- Adding Tooltip.Anchor to Tooltip anatomy
- Track when the scroll appears at the very top of the component
- [Feat:Portal] Override default portal'd location
- Nested popovers cause problems on Safari and Firefox HOT 2
- Slider not working with Android Talkback HOT 2
- Avatar always has a delay in loading
- Add stop propagation / prevent default flag to all Dialogs HOT 1
- Delay opened HoverCards do not cancel their open delay inside of DropdownMenus
- [DropdownMenu] Down-right mouse movements wont close submenu
- Button's ghost variant has inconsistent padding HOT 1
- Dialog component should use HTML dialog
- Dropdown menu issue with Interaction to Next Paint (INP) on mobile
- Dialog primitive does not respond to Windows Ctrl + mouse scroll wheel hotkeys
- SelectValue's placeholder isn't stylable HOT 3
- [Dialog] Close the dialog after asynchronous form submission without declaring state HOT 2
- Draggable and onDragStart
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from primitives.