|
1 | 1 | # Change Log |
2 | 2 | **Dynamic Script Engine Plugin for Touch Portal**: changes by version number and release date. |
3 | 3 |
|
| 4 | +--- |
| 5 | +## 1.2.0.1-beta1 (20-Feb-2023) |
| 6 | + |
| 7 | +This version bring a number of fundamental changes, all of which hopefully make the system more flexible overall. |
| 8 | +I've preserved backwards compatibility with actions/connectors from the previous versions, except in the case of the "One-Time" |
| 9 | +action (details below). I encourage everyone to update to the new versions of the actions/connectors, but please |
| 10 | +do let me know if you find "regression" issues which break existing actions/connectors. An update to the new version is meant to be |
| 11 | +as seamless as possible. |
| 12 | + |
| 13 | +### Plugin Core |
| 14 | +- New paradigm decouples "Script" (Expression/File/Module) instances from Engine instances and from Touch Portal States: |
| 15 | + - Creating a Touch Portal State for each named Script instance is now optional. |
| 16 | + **Consequently, the "State Name" field for each action has been renamed to "Instance Name."** |
| 17 | + - Private Engine instances can now be independent from Script instances; they become their own named entities which can be re-used. |
| 18 | + - Script instances can be run in any existing Private Engine instances (or create their own, or run in Shared engine, as before). |
| 19 | + - Engine instances now "own" the system thread they (and all associated Scripts) run in. |
| 20 | +- Added support for using Actions in "On Hold" Touch Portal button setup, with multiple behavior options: |
| 21 | + - Activation options: On Press and/or On Release, Press and Repeat, Repeat After Delay. |
| 22 | + - Repeat delay and rate (interval) are controllable at both global default and per-instance levels. |
| 23 | + - Current repeat delay, rate, and maximum number of repeats can be set via instance properties. |
| 24 | +- Script instance properties and methods are now available in the JavaScript environment, allowing extended code-level functionality and customization (details below). |
| 25 | +- Scripts can now keep data in persistent storage which is saved and restored at plugin startup (for example to preserve state/settings between sessions). |
| 26 | +- Any Script Instance can now be set to "temporary persistence" and deleted automatically after a delay. This removes the need for a separate "one-time" action. |
| 27 | +- Added a plugin Setting to load/run a script file at plugin startup. |
| 28 | +- Added stack trace logging for unhandled script exceptions. |
| 29 | +- Added command-line switch to specify the Touch Portal Plugin ID to use in all communications (for advanced usage with custom entry.tp configuration). |
| 30 | +- Fixed/removed automatic replacement of spaces with underscores in Touch Portal State names/IDs. |
| 31 | +- Fixed all saved instances being removed if plugin is started w/out available Touch Portal host. |
| 32 | +- The "Shared" Engine instance now runs in its own system thread so as not to impact core plugin functions. |
| 33 | +- The Touch Portal network client (responsible for core communications) has also been moved to its own thread. |
| 34 | +- Miscellaneous optimizations, cleanups, and stability improvements. |
| 35 | + |
| 36 | +### Changes to Actions/Connectors |
| 37 | +- Added "Create State" option to each of the primary Script actions (Expression/File/Module). This is now also where the State's default value type is set. |
| 38 | +- Added "Instance Persistence" option which controls if a Script instance only exists for the current session, is saved at shutdown and loaded at startup, or is temporary (replaces "One-Time" action). |
| 39 | + - **REMOVED:** the "Anonymous (One-Time) Script" action (redundant with the more flexible new system).<br/> |
| 40 | + Unfortunately due to internal changes backwards compatibility could not be preserved in this one case. |
| 41 | +- Script Instances can now use any existing Engine instance (eg. created by another Script) in addition to Shared and Private engine types as previously; |
| 42 | + - Selecting the "Private" choice effectively creates a new private Engine with the same name as the Script. This reproduces the previous behavior. |
| 43 | +- Added "On Hold" option to each Script action type which controls when exactly Script evaluation happens if an Action is used in "On Hold" button setup tab. |
| 44 | +- The "Update Existing Instance" action/connector: |
| 45 | + - Now uses a choice list to select an existing Script instance to update (instead of having to type one in). |
| 46 | + - Can run an expression in a "Shared Default" instance which evaluates in the Shared engine scope but independent of any specific named Script instance (and does not create a Touch Portal State). |
| 47 | +- Renamed "Plugin Actions" to "Instance Control Actions" and: |
| 48 | + - Resets are now performed on named Engine instances, not Script Instances (this matters if multiple scripts share the same engine). |
| 49 | + - Added option to Delete Engine Instance(s). |
| 50 | + - Added options to Save, Load, and Remove Script Instance data to/from persistent storage. |
| 51 | + - **DEPRECATED:** "Set State Value" option;<br/> |
| 52 | + Existing instances will continue to work for now but cannot be edited; Support will be fully removed in the next major version; |
| 53 | +- Added "Set Held Action Repeat Rate/Delay" action & connector to set/adjust repeat rate/delay at both global default and instance-specific levels. |
| 54 | + |
| 55 | +### New States/Event |
| 56 | +- Added "Plugin running state" (stopped/starting/started) Touch Portal State and Event; |
| 57 | +- Added "Default held action Repeat Delay" and "Default held action Repeat Rate" States; |
| 58 | + |
| 59 | +### JavaScript Library |
| 60 | +- Added global `require()` function to import JS modules or JSON objects (whole or individual components) into any script, |
| 61 | + as an alternative to the `import ... from ...` syntax (which only works from other modules). |
| 62 | + This mimics the Node.js/CommonJS function(ality) of the same name. |
| 63 | +- Script Instance properties and methods are now exposed to the JavaScript environment as `DynamicScript` objects (see docs for details). |
| 64 | + - This essentially gives direct access to all properties of the Touch Portal action/connector which is being used to create or run the Script instance, |
| 65 | + as well as extended features and options which are not practical to configure using the Touch Portal interface. |
| 66 | + - Among other features, scripts can now control the parent category their State will be sorted into as well as the "friendly" name |
| 67 | + displayed in Touch Portal selector lists (which no longer has to match the underlying State ID). |
| 68 | +- Added native `Clipboard` module for interacting with operating system clipboard features. |
| 69 | +- Added properties and methods to `DSE` object for working with `DynamicScript` and Engine instances. A few properties have also been deprecated. |
| 70 | + - Added properties: |
| 71 | + - `DSE.VALUE_STATE_PARENT_CATEOGRY` |
| 72 | + - `DSE.defaultActionRepeatRate`, `DSE.defaultActionRepeatDelay` |
| 73 | + - `DSE.engineInstanceType`, `DSE.engineInstanceName`, `DSE.currentInstanceName` |
| 74 | + - Added methods: |
| 75 | + - `DSE.instance()`, `DSE.currentInstance()`, `DSE.instanceNames()`; |
| 76 | + - `DSE.setActionRepeat()`, `DSE.adjustActionRepeat()` |
| 77 | + - Added enumeration constants for various `DynamicScript` property values. |
| 78 | + - **DEPRECATED:** These will continue to work for now but will be removed in the next major version. See documentation for alternatives. |
| 79 | + - `DSE.instanceStateId()` method; |
| 80 | + - `DSE.INSTANCE_TYPE`, `DSE.INSTANCE_NAME`, `DSE.INSTANCE_DEFAULT_VALUE` properties; |
| 81 | +- Touch Portal API: |
| 82 | + - Added `TP.messageEvent()` which passes through every command/data message received from Touch Portal by the plugin. |
| 83 | + - Added `TP.choiceUpdateInstance()` and `TP.settingUpdate()` methods. |
| 84 | +- Fixed that `Net` API functions (internal and public) were mistakenly available in global scope. |
| 85 | +- Moved/renamed `GlobalRequestDefaults` to `Request.GlobalDefaults` (the former is now an alias for the latter but will be removed in a future version). |
| 86 | +- Added `Math.percentOfRange()` and `Math.rangeValueToPercent()` functions. |
| 87 | +- Fixed `Color.polyad()`, `Color.splitcomplement()` and `Color.analogous()` to preserve original alpha channel value. |
| 88 | +- **CHANGED:** The global `include()` function when used with relative paths will now first try to resolve the specified file |
| 89 | + relative to the _current script/module file's location_. If that fails, it falls back to the previous behavior using the plugin's _Script Files Base Directory_ setting. |
| 90 | + |
| 91 | +### Documentation |
| 92 | +- Updated main _Plugin Documentation_ pages to reflect changes in actions/connectors and features |
| 93 | + (including the new overall relationship between Script instances, Engine instances, and Touch Portal States). |
| 94 | +- Added _Plugin Documentation -> "Quick Start"_ page. |
| 95 | +- Added _Plugin Documentation -> "Settings, States and Events"_ page. |
| 96 | +- Added new JS Library Reference category for _Plugin API_ objects (`DSE` and `DynamicScript`). |
| 97 | +- Added and updated references for all new or changed API. |
| 98 | + |
4 | 99 | --- |
5 | 100 | ## 1.1.0.2 (20-Feb-2023) |
6 | 101 | - No changes since 1.1.0.1-beta1. |
|
0 commit comments