You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.
Right now, once you import "three-elements", all of Three.js will be imported, and custom elements will be generated for all of its (constructible) members. This is fine for quick hosted examples, but makes it impossible to just selectively import parts of Three.js, or perform tree-shaking in a build pipeline that offers this.
Suggestion:
Move the meat of the current three-elements package to a new package @three-elements/core and make importing that package side-effect free
Provide a way to selectively generate elements for a list of user-provided Three.js classes
(Maybe use the opportunity to also allow the user to customize the naming of the tags, eg. use a t- prefix instead if a three- one)
Reduce the three-elements package in scope so it just imports core and performs the brute-force initialization it's been doing so far.
This way, if you just want "everything", you can keep importing from "three-elements"; if you don't, you'll work with @three-elements/core and explicitly ask it to set up elements for you, following your configuration.
The text was updated successfully, but these errors were encountered:
There's some good discussion in this webcomponents-cg issue that suggests we should think about this some more before doing anything crazy, so I'm deferring this to the next milestone.
Right now, once you
import "three-elements"
, all of Three.js will be imported, and custom elements will be generated for all of its (constructible) members. This is fine for quick hosted examples, but makes it impossible to just selectively import parts of Three.js, or perform tree-shaking in a build pipeline that offers this.Suggestion:
@three-elements/core
and make importing that package side-effect freet-
prefix instead if athree-
one)three-elements
package in scope so it just importscore
and performs the brute-force initialization it's been doing so far.This way, if you just want "everything", you can keep importing from "three-elements"; if you don't, you'll work with
@three-elements/core
and explicitly ask it to set up elements for you, following your configuration.The text was updated successfully, but these errors were encountered: