@vue/reactivity for inversion of control in Node.js #8642
hypeJunction
started this conversation in
General Discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As of late, I have been thinking about IoC containers and how they pollute the global state, which becomes problematic in serverless/lambda environments, where you want to keep your functions to a minimal. With IoC containers the bundler has a difficulty determining whether something registered as a service would ever be invoked in the context of a specific lambda, so there isn't much treeshaking going on.
I was wondering what your thoughts are on using
@vue/reactivity
in the backend. If you think about it,ref
could be used to wrap around static dependencies (e.g. env values), andcomputed
could represent singletons:This approach would allow you to import services as needed with a clear dependency tree. It is also quite easy to stub the services for testing.
I guess my questions are:
Beta Was this translation helpful? Give feedback.
All reactions