We should create an ExtensibleView that provides an API for other apps to inject templates and contexts, which are then handled by the view, e.g. by rendering the template snippets in tabs/eidgets/etc.
How would this work technically: Each app can declare inside the index.js which collection the respective app defines, and which components it provides for specific collections. Vite/the bundler will somehow merge thes values and provide at a singular place (via the aleksis mixin maybe?).
Example: the core would define the collections "core-dashboard", "core-person-overview" and "core-group-overview", and alsijil would supply components for personal statistics (and at a later point one for group statistics as well)
This should work for any object type, so there could be a collection for components, but also for objects (e.g. extensible menus) or functions (e.g. extensible actions on a crud page)
<script>// Inside the index.js in the coreexportconstcollections=[{name:"dashboard",// Auto-prefixed with the app label (?)type:Object,// Documentation purposes, maybe used for validation at a later point. Maybe add a validator func?}]// Inside the index.js in dashboard-feedsexportconstcollectionItems={coreDashboard:[{name:"dashboardFeeds.rssFeedWidget",component:()=>import("RSSFeedWidget.vue")shouldDisplay:(user,person,preferences)=>{if (preferences.showDefaultDashboard)returntrue;if (user.isAdmin)returntrue;returnfalse;}}]}// Inside the frontend component fileimport{coreDashboard}from"aleksis.collections";// → how should the imports look?exportdefault{name:"DashboardComponent",mixins:{mixinThatGivesMeUserDetails},computed:{widgets(){// Is this really just an array or should be something different?returncoreDashboard.filter(widget=>widget.shouldDisplay(user,person,preferences));},widgetProps(){return{idk:"???",person,"???":"idk",}}},};</script><template><divv-for="widget in widgets"><component:is="widget.component"v-bind="widgetProps"/></div></template>
How does this example usage look for you @hansegucker (this is purely fictional at this point)
I highlighted important things in the code for you.
I believe we also discussed something about other exported properties being merged, however then i wouldn't know how one would access them. Do you remember more?