DEV Community

Discussion on: Web Components for the Web Monetization API

Collapse
 
webpadawan profile image
Serhii Kulykov

The looks interesting. Please consider publishing ES2015 and not ES5 for modern browsers.
It's better to ship modern code and let the actual users decide if they need Babel.

Collapse
 
philnash profile image
Phil Nash

OK, version 0.2.0 now publishes four consumable versions of the component:

  • A Babel transpiled, UMD version for use in browsers that don't support ES modules/latest syntax
  • The above, but minified, to be used in CDNs like unpkg
  • A CommonJS module
  • An ES module (can be used in browsers that support ES modules)

Neither the CJS or ESM version go through Babel, so you can choose to transpile as part of your own build process.

Does that work better?

Collapse
 
philnash profile image
Phil Nash

Yeah, that's a good point. I kind of just followed my previous process, but that was from a couple of years ago.

The ES Module version should really be the raw written code that can be imported or loaded as a module in the page. I'll look into updating the build process for that (and for <web-share-wrapper> while I'm at it).

Collapse
 
webpadawan profile image
Serhii Kulykov • Edited

Thanks! Yes, I checked the version 0.3.0 at unpkg and it looks good now.

Thread Thread
 
philnash profile image
Phil Nash

Awesome, thanks for the feedback!