Registering multiple worklet modules or not?

Dear list,

When I make heavily use of CSS Houdini, in one app...
What would be best practice?

*A. **loading one (bundled) file, defining multiple
registerPaint/registerLayout-classes?*
CSS.paintWorklet.addModule('path/to/my/bundled/file/defining/all/my/registerPaint/classes.js');
CSS.layoutWorklet.addModule('path/to/my/bundled/file/defining/all/my/registerLayout/classes.js');

*or*

*B. **loading multiple worklets, each dedicated to one
registerPaint/registerLayout-class?*
CSS.paintWorklet.addModule('path/to/my/registerPaint/class/to/render/a');
CSS.paintWorklet.addModule('path/to/my/registerPaint/class/to/render/b');
CSS.paintWorklet.addModule('path/to/my/registerPaint/class/to/render/c');
CSS.layoutWorklet.addModule('path/to/my/registerLayout/class/to/render/x');
CSS.layoutWorklet.addModule('path/to/my/registerLayout/class/to/render/y');
CSS.layoutWorklet.addModule('path/to/my/registerLayout/class/to/render/z');

I think (A.) would be most performant booting the app, regarding having to
fetch and load just one (or two) (bundled) file(s). But I wonder if (B.)
would be more performant rendering the DOM because the browser can
instantiate multiple worklet-instances for multiple class-definitions each.

How many worklets can be added/loaded/mounted?
Can anyone help me telling which option is best?

Thank you very much,

All the best,

*Bob Hamblok | BOAPP GCV*
Freelance Software Engineer | Architect | Consultant
founder at neoScores NV

*EMAIL* post@bhamblok.be
*PHONE* +32 476 74 78 42

*ADDRESS* Jennevalstraat 18, BE-2600 Antwerp, Belgium
*VAT* BE0682.695.007

Received on Monday, 14 October 2019 11:02:14 UTC