Plugins using environment references #20371
jasonkuhrt
started this conversation in
General
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.
-
Environment Instance Stability During Dev Server Lifecycle
Context
I'm developing a Vite plugin that needs to track which environments load a virtual module and invalidate the module in those specific environments when the underlying data changes.
Current Implementation
Currently storing environment names and looking them up dynamically:
Question
Would it be safe to store direct references to Environment objects instead?
Specific concerns:
server.environments[name]
the recommended approach?Use Case
This is for a reactive data plugin that serves virtual modules containing reactive data (using Vue reactivity). When the data changes, we need to invalidate the module in all environments that have loaded it.
Thanks for any guidance on the intended lifecycle and stability guarantees of Environment instances!
Beta Was this translation helpful? Give feedback.
All reactions