-
Notifications
You must be signed in to change notification settings - Fork 1
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
Loading user-defined components? / Dynamic component registration #14
Comments
This is definetly a cool idea we will implement eventually. Are you interested in working on it? We could have a call if you like to participate. |
Good to know it's on the radar. My interest is because I mainly have time to write fragile, one off code that meets my immediate needs, so I'm probably not the person to work on something robust for pod-os :-) |
I now think my preference for implementation of this is through loading a user script from a trusted location, which then accesses hooks in the base code, similar to what Wikipedia does. The user script would register the custom component. Edit: it looks like a minimal implementation of this involves:
Essentially for the minimal case replacing index.html takes the role of a user script, and replacing pos-type-router provides the necessary hook. |
In creating dashboards, I've instead been using:
|
Just documenting SolidOS' pane selection logic:
The pane registry currently gets populated on load of SolidOS The disadvantage of this approach is that all panes need to be loaded in memory in order to determine whether it is used. |
Hi, I'm interested in defining and loading user-defined components at runtime for particular types and even particular objects. Do you have plans to implement something like this?
In the context of podos, this would be mostly web components, but I could also imagine displaying a specific Uri (e.g. a web page or image) as the default view of a given object.
Solidos allows dynamic registration of panes, and this can be done from an IFrame, but the registration is only for the current session and creating a component in the render method is a js-heavy task/needs the component to be built offline.
I understand the corresponding logic in podos is currently here:
PodOS/elements/src/components/pos-type-router/pos-type-router.tsx
Lines 29 to 30 in 5debca1
I think what I am suggesting is 1) Loading (additional) type-component registrations from RDF, 2) Looking for the named custom component if not built-in, and loading it dynamically if needed.
The RDF registration could be in the same resource/named graph, same resource hierarchy, prefs, or simply defined in the current store (probably in that order of preference).
It would be nice to have some level of compatibility with forms vocabs and https://github.com/jeff-zucker/solid-ui-components, but I think neither quite fits this use case:
There are security issues to consider, but this is already the case with web pages loaded in an IFrame in both solidos and podos. Probably there will need some way to mark a URI/resource as safe to execute.
The text was updated successfully, but these errors were encountered: