brillout / react-streaming

React Streaming. Full-fledged & Easy.
MIT License
220 stars 14 forks source link

Question about GlobalObject #36

Closed tbrannam closed 9 months ago

tbrannam commented 9 months ago

I've been looking at the implementation of GlobalObject and was thinking through the implications for my project. I have a use case where a common Node runtime is being used by several Modules, of which several could consume react-streaming (similar to a plugin model). These are intended to be isolated from each other.

The implementation of getGlobalObject using a non-unique key projectKey would make these collide. Are there alternatives such as import.meta.url that would namespace to an actual module instead make this more flexible?

I don't fully understand the underlying problem getGlobalObject is trying to solve, so I'm not sure this would run counter to your goals.

brillout commented 9 months ago

I think supporting such use case should be outside of the scope of the project.

Feel free to fork, or elaborate on why your use case is important to you and I may reconsider, or PR welcome if it turns out to be an easy fix. Alternatively: sponsoring welcome to increase the priority for this.

tbrannam commented 9 months ago

I will investigate and see if I can create a PR. I wasn't sure if the problem globalObject is fixing is covered by tests. We'll see