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

> What happens if I export a constant? Or a function? 

Same thing that happens if you "registerPaint" a constant or function.

> What if I want to share this module and only a subset of exports are actually paint classes?

If you never try to use those exports, then it does nothing. If they are used, then the errors in https://drafts.css-houdini.org/css-paint-api/#registering-custom-paint would trigger. I guess this would require changing the algorithms to trigger errors when there is a match between a paint function and a worklet export, rather than when at export time.

> 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.

I'm not sure one is lower-level than the other. One is declarative, the other imperative.

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

Received on Sunday, 21 January 2018 16:34:44 UTC