How should extensions communicate?

Hi All,

I was wondering if we have two extensions and one extension needs to communicate with the other then what would be the recommended way to do so?
Especially when the two extensions are two individual packages and may or may not be running simultaneous (meaning one might be open and the other one not)

I want to keep data coupling at minimum but there are scenarios where we must share some state between extensions and it’s proving to be bit difficult to do that in a monorepo setup especially when requirements for state sharing arrive at a later point in time.

Hey @vatsal.uppal,

the way we usually accomplish this in Theia (i.e. the theia monorepo) is by providing shared interfaces for services, which can be implemented in other extensions. The interfaces can then be used everywhere, while the implementations are provided in specific packages. I’m not sure whether this works for your specific use case. It seems like your issue is a general architectural issue and less of a Theia specific technical one.

1 Like

Hi @msujew,

Thanks for your reply. Sorry for the late response but I ended up doing something like what you’ve suggested, i.e, writing a globally accessible service to manage data (similar to redux to manage global state)