Proposal: Introducing a Plugin System for Tres.js #1324
JaimeTorrealba
started this conversation in
General
Replies: 1 comment
-
|
Hey @JaimeTorrealba love to see this here ❤️ Option 1 (Vue-style I'd push back on presenting these as alternatives. They solve different problems:
The real question is: what level does a given plugin operate at? stats-gl probably wants to be inside the canvas. theatre.js might need Some further questions
wdyt? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone 👋
We’d like to open a discussion around the creation of a potential plugin system for Tres.js, with the goal of expanding our ecosystem in a scalable and maintainable way.
This is an early-stage proposal, and we’d love community feedback on API design, ergonomics, and limitations.
🎯 Motivation
As the Tres.js ecosystem grows, we see an opportunity to:
@tresjs/cientos) with many third-party dependencies📦 Dependency Separation (Cientos as an Example)
One of the key motivations is moving third-party dependencies into their own packages.
For example:
stats-glis currently used in@tresjs/cientoshttps://github.com/RenaudRohlinger/stats-gl
A plugin system could allow:
stats-glThe idea is not to replace large, feature-rich packages (e.g.
tres-rapier,postprocessing,leches), but rather to support small wrappers with concise APIs and possibly one-page documentation.🧩 Scope of the Plugin System
Examples of potential candidates:
stats-gllenistheatre.jsLineMesh2🧠 Existing Patterns in Tres.js
Currently, much of our ecosystem already relies on Vue’s
provide / injectpattern, which could serve as a solid foundation for a plugin system.This is worth highlighting, as it aligns well with Vue’s own recommended approaches.
🔌 Possible API Designs
Option 1: Vue-style Plugin API
Following Vue’s official plugin documentation:
https://vuejs.org/guide/reusability/plugins.html#provide-inject-with-plugins
Example usage:
Pros
provide / injectCons
Option 2: Component-based Abstraction (Cientos-like)
A simpler, component-first approach:
Pros
Cons
📚 Documentation Strategy
As part of a potential plugin system, we’d like to centralize documentation by maintaining a single site for all official Tres.js plugins.
Each plugin would remain independent in terms of repository and versioning, but its documentation would live alongside other official plugins to provide a unified and discoverable experience for users.
❓ Open Questions for the Community
We’d love your thoughts on the following:
🤝 Invitation to Discuss
This proposal is meant to start a conversation, not define a final direction.
If you:
👉 Please join the discussion and share your ideas.
Looking forward to hearing your thoughts and shaping this together 🚀
Beta Was this translation helpful? Give feedback.
All reactions