Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.

[core] Provide a way to customize which elements get created #51

Open
hmans opened this issue Feb 3, 2021 · 1 comment
Open

[core] Provide a way to customize which elements get created #51

hmans opened this issue Feb 3, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@hmans
Copy link
Owner

hmans commented Feb 3, 2021

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.

@hmans hmans added this to the 0.4 milestone Feb 3, 2021
@hmans hmans added the enhancement New feature or request label Feb 3, 2021
@hmans hmans self-assigned this Feb 3, 2021
@hmans hmans changed the title Provide a way to customize which elements get created [core] Provide a way to customize which elements get created Feb 4, 2021
@hmans
Copy link
Owner Author

hmans commented Feb 19, 2021

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.

@hmans hmans modified the milestones: 0.4, 0.5 Feb 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant