Closed vorg closed 1 year ago
I would avoid 3. (deep import in packages currently cause me more headache and might confuse bundlers), keep pex-renderer exporting components and rely on tree-shaking.
Not sure it is necessary to sub-namespace components so I'd stick with 1.
@simonharrisco mentions option 4. - exposing all components on the top level, also not a bad idea
import { directionalLight } from "pex-renderer"
const e = {
directionalLight: directionalLight()
}
export { default as directionalLight } from "./components/directional-light.js";
// or
export * from "./components/index.js";
and also means only systems are namespaced?
and also means only systems are namespaced?
No, if we move components up then systems too.
and also means only systems are namespaced?
No, if we move components up then systems too.
We'd run into conflict for animation (both component and system) unless systems are suffixed (animationSystem).
Well that was the idea for name-spacing in the first place which looks like brings us back to current option 1.
We decided to leave flat list of components. Maybe later if list gets too big.
I miss destructuring a bit
Any preference?
const e = { directionalLight: components.directionalLight() }
3.