Hi Plugin Developers,
Today, we have an important update regarding the use of the source property of scripts. We are working towards adding more advanced script editor features and extending our support for third-party tools.
However, currently the script source property has multiple functionalities and this is becoming a limiting factor for future development. To solve this issue, we are introducing two APIs for reading and updating the source property of scripts. We strongly encourage you to use these instead of directly editing the source property. This will guarantee the compatibility of your plugins with future platform features.
As of today, the Source property is
- replicated, persisted, and executed source code of the script.
- the content of the script editor that is shown to users and edited in the UI.
We are decoupling the script editor from the Source property in order to allow more advanced editor features. To do so, we are using the following two APIs and encourage you to do so as well:
We strongly encourage you to use these APIs as we guarantee that they will always reflect the script editor’s current state. By contrast, the Source property will no longer be updated immediately while a script is being edited, instead updates will be made periodically. For a full description of Script.Source’s behavior, please see the documentation here.
As a result of these changes, the source property will not always reflect the script editor’s content and thus future studio editor features might not be compatible with plugins that directly work with the source property.
We recognize that adapting to this change requires some effort on your end. We truly believe that embracing this new direction will offer long-term advantages and a more robust scripting environment for everyone.