kleinfreund / vue-accessible-color-picker

A color picker component for Vue.js 3.
https://vue-accessible-color-picker.netlify.app
MIT License
115 stars 8 forks source link

Provide untranspiled ES module bundles #10

Closed kleinfreund closed 2 years ago

kleinfreund commented 3 years ago

Please indicate whether you want the color picker to be distributed as a set of untranspiled ES modules by leaving a 👍🏻 or 👎🏻 reaction below.


Description

To give package users more flexibility, provide a set of untranspiled ES module bundles next to the already-existing transpiled bundles.

Motivation

The JavaScript package ecosystem will most likely move towards having package authors distribute untranspiled ES modules instead of transpiled UMD/AMD/CJS modules because that allows the consumer of the package to transpile according to their own needs rather than have the package author determine the browser support matrix.

For a package that contains a Vue.js component like this, there is only a limited need to take browser support into account. For example, this package uses CSS custom properties which cannot be polyfilled but which can be used in a way to not needlessly prevent them from being used in browsers not supporting them. Illustrative example:

p {
  color: #222;
  color: var(--text-color, #222);
}

In essence, if a package is distributed as an ES module without being transpiled, package consumers are free to transpile the package using their browser support matrix.

kleinfreund commented 2 years ago

I’ve added untranspiled ES modules in https://github.com/kleinfreund/vue-accessible-color-picker/commit/ce1dc59ab364329fd41db33127762dbacf4bce21. They are available with version 3.3.0 of the package.