Multiple App Hosts?

I have a project set up that serves as my design system. In this project, I register Coded Components and use them in other projects. In any project, I import my design system and configure the design system’s app host in that project to be able to use the Coded Components. However, if I want to register Coded Components from that project without being part of the design system, how can I do that? In theory, the design system is already using the project’s App Host…

Hi @andres_murillo, a project (and its imported projects) may only have 1 app host. In your case where you have a project and design system project, you’ll want your project app host to include all the required code components of your design system project.

I believe that is poorly conceived. The purpose of a design system is to feed one or multiple projects with components, styles, and even global functions. If I wanted to create a component specific to an individual project, I don’t understand why it would have to reside in the global design system. Or, for example, if I want to register a function just for one project, that function would live in all the projects connected to the design system. I think it is a basic function of the logic of a design system. Isn’t there an alternative solution?

I think this can be resolved with some set up.

Your design system package should export common components such as Button, Input, etc. In addition, it would export a registerPlasmic() function to register these components as code components in Plasmic. Your design system package could also have a Plasmic host that uses the same register function, in case you want to make common Studio components as well.

Now onto a project that uses the design system. Each project would have its own app host. The app host would call registerPlasmic() from the design system package. In addition, each project can also register its own project-specific code components.

Do you think this would work for your situation?

Okay, sounds good. Let me dive into that and i will return if i have further questions.