Components: too tightly coupled to dependencies
See original GitHub issueWhen using any components, there is no flexibility to use without adding multiple PS packages for styling.
Expected behavior
With BC’s in mind, the components should be as agnostic and lightweight as possible, not requiring or adding a CSS-in-JS library to the depedancy list, but rather using plain CSS. Essentally, a BC should not be required to install core, glamour, or any other dependency, but just download Dropdown and everything works fine.
Actual behavior
If I only need to use Dropdown
for example, I cannot just install the single package. It requires the installation of:
- core
- ActionMenu
- glamour
- also adds emotion to bundle
Steps to repro
- Create a new app using CRA w/ Typescript
- Install styled-components (example)
- Install
core
package - Install
Dropdown
&ActionMenu
- Run tests (will fail due to no glamour)
- Run bundle analyze to see emotion is added to bundle
- Run start to see TS fails due to no typing packages (also no notes on this in the docs)
Related packages
- core@latest
- Dropdown@latest
- ActionMenu@latest
Environment
- OS - MacOS 10.12
- Browser version - Chrome v60
The Value Add
This allows the PSDS to be more flexible and keep all BC bundles as small as possible.
The Tradeoffs
Requires possible rebuild to remove CSS-in-JS lib for pure CSS
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
What is the difference between loose coupling and tight ...
Tight coupling is when a group of classes are highly dependent on one another. This scenario arises when a class assumes too many...
Read more >design - Software components tightly coupled or loosely ...
Loose and tight coupling are not about the number of dependencies, but about how dependent class are coupled.
Read more >Why is loose coupling between services so important?
Loose coupling implies that services are independent so that changes in one service will not affect any other. The more dependencies you ...
Read more >Can a loosely coupled architecture reduce technical debt?
The tight component coupling associated with monolith-like architectures often fosters rigid component dependencies that make it impossible ...
Read more >How coupling impacts software quality - InfoWorld
Tight coupling makes it challenging to change the modules of an application because one module will impact numerous dependent modules. This high ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @caseybaggz , thanks for the perspective. I’ll share a few thoughts that may help as well:
core
is not a peerDependency at this point and should be included as adependencies
entry where needed.devDependencies
definitely shouldn’t be included in thedist/
output of bundles. If it is, as it seems it might, we need to figure out how to build our packages to exclude that.Thanks for your time and insight!
No plans to act on fundamental changes here currently. Will add revisit label as we consider any big-picture changes in the future.