cssinjs / theming

Unified CSSinJS theming solution for React
300 stars 39 forks source link

UMD bundle #9

Closed vesparny closed 7 years ago

vesparny commented 7 years ago

I see there is no UMD bundle at the moment (https://unpkg.com/theming@1.0.1/dist/)

Would it make sense to have one? I think without it people not using a bundler won't be able to use theming (mainly because dependencies are not bundled in cjs/es dist files)

@kentcdodds what do you think? I'm a little bit lost when I have to deal with dist files :)

iamstarkov commented 7 years ago

its not a big deal to have one.

At the same time as far as this lib is going to be used tightly with react and cssinjs libs, i'm struggling to come up with any possible use case for umd bundle

kentcdodds commented 7 years ago

its not a big deal to have one

Agreed. I only added one to my libs so people could play with them in the browser via tools like codepen and jsbin. But now that we have codesandbox and webpackbin I see UMD builds as less necessary.

It's definitely a nice to have, but not really a must.

kentcdodds commented 7 years ago

If you do want to have one, then you'll mark peerDependencies (like React) as externals and you'll bundle all other dependencies with the UMD bundle. That's what we do for glamorous (we have React and glamor as externals and reference the global variables from their UMD bundles instead).

GertSallaerts commented 7 years ago

You could use the relevant parts from this PR if you want to add UMD bundle, but I agree that it's not a must.

iamstarkov commented 7 years ago

@Gertt yep, your pull-request will be used as reference =)

iamstarkov commented 7 years ago

lets close it for now, as far as we have webpackbin and codesandbox to use for react demos

iamstarkov commented 7 years ago

everyone, who came into this issue in search for umd bundle: if you need one and you are not happy with webpackbin or codesandbox please to share yours use cases and we will help