You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.
I find it a bit off-putting that to use a component one has to import the compiled version from @material/react-button/dist (as opposed to simply @material/react-button). Is there a reason why you decided to make it so?
Apart from the packages in this repo I have never had to reference /dist - it is not obvious for me as a component consumer. What's more, in the docs to every component, the imports in demo look as one would expect :import Button from '@material/react-button'. Yet this won't work without having to transpile imported modules or in create-react-app context.
Please, let me if there is a good reason behind this decision I may not understand.
The text was updated successfully, but these errors were encountered:
Have you considered the impact using the compiled version will have on your bundle size? Using the uncompiled version allows for tree shaking which will lead to smaller bundle sizes.
@ebeloded sorry for the late reply. We thought that the uncompiled components would be used more than the compiled components. Like @ben-mckernan referenced, we saw it as a bundle savings. We also thought that having the transpiled code in a /dist or /build directory as being more semantic. However it seems that our main target audience are developers using CRA, which was short-sighted on our part.
After installing a few other packages and seeing what is distributed from the entry point it seems like we have this backwards, and in fact import Button from '@material/react-button should have the compiled code. And as reference in #107 we are causing more issues.
Dear maintainers,
I find it a bit off-putting that to use a component one has to import the compiled version from
@material/react-button/dist
(as opposed to simply@material/react-button
). Is there a reason why you decided to make it so?Apart from the packages in this repo I have never had to reference
/dist
- it is not obvious for me as a component consumer. What's more, in the docs to every component, the imports in demo look as one would expect :import Button from '@material/react-button'
. Yet this won't work without having to transpile imported modules or in create-react-app context.Please, let me if there is a good reason behind this decision I may not understand.
The text was updated successfully, but these errors were encountered: