"Preview Mode Doesn't Set Values for `editOnly` Global Contexts"

Hi! I’m having an issue with the studio “preview” mode for an artboard. If I have a custom global context with editOnly props, the values that are set in the studio are not being set when I switch to preview mode. I’m guess previewing mode just renders the project as configured, so it makes sense that this would happen! However, it does mean I don’t have a way to set these values for the project preview without either:

• deploying a new application in a live environment with the preview flag for the plasmic loader turned on
• running my application locally with the flag on
It seems like only by running the application my self and setting the globalContextsProps prop can I set these values. I do like the preview button as it has such a low barrier to quickly see changes without the overhead of a full app.

For context, I use the editOnly flag in global context to set things that I don’t want to expose in generated code (like auth keys for an API) and need to replace when running the actual application that consumes the plasmic project. I also use them to provide a nice abstraction for setting dynamic values that an application consumes. For instance, instead of filling out the query params section of the project in the studio I created a global context to set the values there, and then replace them in production with the query param values. This helps reduce the cognitive load on less technical members of my team (and reduces the chance that they change something like the name of a query param and break prod).

Happy to discuss more if needed!

Hi Kevin, we will be investigating it

Hey @carefree_muskox. The fix for this should be up later today.