diff --git a/docs/plugins/composability.md b/docs/plugins/composability.md new file mode 100644 index 0000000000..d85a557772 --- /dev/null +++ b/docs/plugins/composability.md @@ -0,0 +1,86 @@ +--- +id: composability +title: New Composability System +description: + Documentation and migration instructions for new composability APIs. +--- + +## Summary + +This page describes the new composability system that was recently introduced in +Backstage. It describes the new system from the perspective of the existing +patterns and APIs. As the new system is solidified and existing code is ported, +this page will removed and replaced with a more direct description of the +composability system. + +The core principle of the new composability system is that plugins should have +clear boundaries and connections. It should isolate crashes within a plugin, but +allow navigation between them. It should allow for plugins to be loaded only +when needed, and enable plugins to provide extension point for other plugins to +build upon. The composability system is also built with an app-first mindset, +prioritizing simplicity and clarity in the app over plugins and core APIs. + +The new composability system isn't a single new API surface. It is a collection +of patterns, new primitives, new APIs, and old APIs used in new ways. At the +core is the new concept of Extensions, are exported by plugins for use in the +app. There is a new primitive called component data, which is used to connect +plugin and the app, and a new hook that provides a practical use of . + +## Component Data + +Component data is a new composability primitive that is introduced as a way to +provide a new data dimension for React components. Data is attached to React +components using a key, and is then readable from any JSX elements created with +those components using the same key, as illustrated by the following example: + +```tsx +const MyComponent = () =>