Replies: 3 comments
-
Having read a bit more about it since chatting about it last week, I think that Lit should be a dependency for our components, so that it gets installed automatically when consumers install our package. So, therefore it would get bundled as part of each component, with the expectation that consuming applications are able to dedupe it through a combination of using NPM and treeshaking their code. Just a few added points around this topic (just to make sure they're documented as part of this discussion):
|
Beta Was this translation helpful? Give feedback.
-
Hey, I took some time to test different options of using What use of dependencies will bundle
|
Beta Was this translation helpful? Give feedback.
-
Thanks for setting up this discussion @maledr5 I just wanted to record some thoughts whilst they're still in my head! In my opinion, it makes sense to list some packages as dependencies of our components whilst not bundling them (via rollup configuration, for example). An example of this being My thoughts on the two terms: Dependency - Our components require these packages to work, however, it is not reasonable to expect a consuming application to already have these packages installed. Example: A Nuxt application would have no reason to install peerDependency - These are still required by our package, but there is a reasonable expectation that our consumers would use these packages themselves anyway. Example: A React component library would expect a consuming application to already have React installed. I am sure there are numerous examples that debunk this approach but I think it helps to simplify. Therefore in conclusion I think |
Beta Was this translation helpful? Give feedback.
-
As part of our bundling topic, we have an open question on how to include
Lit
package within our components. Currently we do not declare it as a dependency so pilot consumers have to install it separately.Options proposed are:
peerDependency
so that consumers know they have to install it separately (and not from an error message)dependency
, so that it gets automatically installed when consumers install our packageFrom an initial discussion we captured some points:
Lit
or any additional dependencies themselvesLit
The goal of this discussion is to capture ideas for next steps to tackle, most likely, things we will need to spike.
💡 This discussion is part of the whole bundling topic. If you have any other ideas or concerns around bundling in general, feel free to drop them here as well, and we'll see if we need to branch some of them to a new discussion.
Beta Was this translation helpful? Give feedback.
All reactions