Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[experiment] Accoutrements #2969

Draft
wants to merge 1 commit into
base: alex/state-node-prototype-1
Choose a base branch
from

Conversation

SomeHats
Copy link
Contributor

In #2957, we implemented some of the functionality of the speech bubble shape as a separate react component that needs to be passed in as a top-level OnTopOfCanvas component. This works well, but it means that if you're using this shape (or e.g. our own shapes were built in this way) you'd need to bring in both the shape and the OnTopOfCanvas component. It makes it very hard to distribute something like a custom shape as its own npm package.

One solution here would be a way to bundle together related customisations that make up a coherent feature into a single package that could then be plugged-in to the editor. These plug-in-able things are called "accoutrements".

Accoutrements are a purely additive change - they work with our existing extension methods, but let you bundle things up into a single object if they don't make sense on their own. They're fully backwards-compatible with our existing extension methods. You could still pull out individual parts if you wanted e.g. the shape definition, but wanted to supply your own interactions on top of it.

(the exact API of defining and using these is up for debate! i just did the most minimal thing i could for this diff to illustrate the concept)

Copy link

vercel bot commented Feb 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
examples ✅ Ready (Inspect) Visit Preview Feb 27, 2024 2:08pm
1 Ignored Deployment
Name Status Preview Updated (UTC)
tldraw-docs ⬜️ Ignored (Inspect) Feb 27, 2024 2:08pm

@mimecuvalo
Copy link
Contributor

this is pretty cool. i could see this being useful in the plugin world. fwiw, probably the more tech-y name for accoutrements would be "mods" :)

@SomeHats
Copy link
Contributor Author

mods, DLC, extensions, plugins, addons, expansion packs, patches, tapas, skins, widgets, side dishes,..... uhhhh......... soup de jour

@mimecuvalo
Copy link
Contributor

les mods or les extensions :P

@steveruizok steveruizok changed the title [prototype] Accoutrements [experiment] Accoutrements Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants