Re: [css-houdini-drafts] [css-paint-api] Use JS export instead of registerPaint

(It’s probably too late to change anything on this API, but I’ll try to give my thoughts anyways)

I see where you are coming from, but I don’t think your proposed API is actually desirable.
The way your API works is _magic_ (implicitly registering an export — or all exports— as a paint class). What happens if I export a constant? Or a function? What if I want to share this module and only a subset of exports are actually paint classes? 

The behavior that you describe can be built on top of the current API, so what we currently have is a low-level primitive that allows to build your more high-level approach.

```js
const painters = await import('./your-painter-module.js');
for(const [name, painter] of Object.entries(painter))
  registerPaint(name, painter);
```

-- 
GitHub Notification of comment by surma
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/564#issuecomment-359250327 using your GitHub account

Received on Sunday, 21 January 2018 13:58:04 UTC