{ "id": "173898", "key": "TIMOB-27255", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2019-07-18T16:52:24.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "cb-tooling" ], "versions": [], "issuelinks": [], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2020-02-10T21:37:32.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [], "description": "There are 2 major Titanium CLI <=5.x plugin related deprecations coming up with the release of the next Titanium CLI, namely version 6.0.\r\n\r\n1. Titanium CLI 6 will drop support for all Titanium CLI plugins that are executed for any command other than {{\"ti build\"}} (or {{\"appc run\"}}). That means that any plugin that was loaded for a non-build command, such as \"create\"/\"new\", will no longer be loaded in Titanium CLI 6.\r\n\r\n* Hooks that will only fire when performing a build\r\n** {{cli:command-loaded}}\r\n** {{cli:go}}\r\n** {{cli:post-execute}}\r\n** {{cli:post-validate}}\r\n** {{cli:pre-execute}}\r\n** {{cli:pre-validate}}\r\n** {{help:header}}\r\n* Hooks that will no longer be called\r\n** {{clean.config}}\r\n** {{clean.post}}\r\n** {{clean.pre}}\r\n** {{create.config}}\r\n** {{create.finalize}}\r\n** {{create.post}}\r\n** {{create.pre}}\r\n\r\nAll other {{build.*}} hooks will continue to fire including Alloy, Hyperloop, Liveview, Ti.shadow, etc.\r\n\r\n2. Titanium CLI 7 will drop support for all Titanium CLI plugins including \"build\" related commands.\r\n\r\nh2. New Titanium CLI 6 Plugin System\r\n\r\nThe new Titanium CLI 6 will support plugins in the form of Appc Daemon (appcd) plugins. While the daemon's plugin system exists as well as the underlying hook mechanism, the hook registration system (DAEMON-90) does not exist yet.\r\n\r\nOnce the hook system is implemented in the appcd plugin system, then Titanium CLI <=5.x plugins with {{clean.*}} and {{create.*}} hooks will need to be ported to the new format. Porting is not trivial, but it's hours, not days, of work.\r\n\r\nAppcd plugins also have limitations compared to Titanium CLI <=5.x plugins. While pre and post hooks are possible, modifying function hook arguments, the actual hooked function, and the result are not. Furthermore, appcd plugins must be async aware and maintain their own state.\r\n\r\nCurrently, there are no known plugins that use the {{clean.*}} hooks, however we have several new project templates that use the {{create.*}} hooks. Those project templates will need to be updated.\r\n\r\nh2. Titanium CLI 7 Plugin Support\r\n\r\nWith Ti CLI 7, all Titanium CLI <=5.x plugins will no longer work and thus must be ported. Plugins such as Alloy, Hyperloop, and Liveview will need to be ported to appcd plugins. This is a big effort, however Titanium CLI 7 likely won't ship until the 2nd half of 2020. We have time.\r\n\r\nh2. References\r\n\r\nhttps://wiki.appcelerator.org/display/guides2/Titanium+CLI+Plugins\r\n", "attachment": [], "flagged": false, "summary": "Titanium CLI plugin deprecation notices", "creator": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "environment": null, "comment": { "comments": [ { "id": "449935", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "{{clean.post}} is used in the alloy [deepclean hook|https://github.com/appcelerator/alloy/blob/c63914c87610bcd1bc0e8be3426b160783a0991e/hooks/deepclean.js#L39-L41] that _every_ alloy project will use, as well as in the [windows sdk|https://github.com/appcelerator/titanium_mobile_windows/blob/c58b5b6efcfc75ab69914987e38f6bab50c6a2e0/cli/hooks/clean.js#L21-L31] (maybe this one could be migrated to be a _clean.js file though as I think Chris W added support for that)\r\n\r\nAs for community plugins from a quick search (limited to plugins that are available on GitHub and area not archived by the owner)\r\n\r\n{{clean.config}} - [tiapp-composer|https://github.com/caffeinalab/tiapp-composer]\r\n{{clean.post}} - Most repos seem to be archived, and lots of noise from apps with alloy hooks\r\n{{clean.pre}} - Could not find any\r\n\r\n{{create.*}} - Only our repos", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2019-07-19T09:32:54.000+0000", "updated": "2019-07-19T15:49:57.000+0000" }, { "id": "449941", "author": { "name": "bhouse", "key": "bhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "One thing to note is that it is probably a very small percentage of teams that are allowed to open-source their code and put it out on GitHub. We probably want to do our due diligence in reaching out to developers and customers to see what they are using as well. \r\n\r\nIs there a technical reason the new Daemon system supports less hooks than the existing Titanium system?", "updateAuthor": { "name": "bhouse", "key": "bhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2019-07-19T15:54:17.000+0000", "updated": "2019-07-19T15:55:29.000+0000" }, { "id": "449946", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~bhouse] The Titanium CLI.next relies on the Appc Daemon where all of the Titanium CLI logic runs in a plugin that is executed in a long running subprocess. Because of that, arbitrary JavaScript \"plugin\" files are not loaded and I'm not entirely convinced that's even a good idea.\r\n\r\nFurthermore, Titanium CLI plugins can \"hook\" into two types of hooks: event and function hooks. Event hooks just fire a callback that an event has occurred such as \"build.pre.compile\".\r\n\r\nHowever, function hooks wrap a function and allow a plugin to modify the arguments going into the function, the function itself, and the return value. The daemon promotes the idea of plugins being decoupled and thus the communicate through a central dispatch system where all payloads must be serializable (via {{JSON.stringify()}}). Certain data types such as class instances or contexts cannot be serialized without data loss. Even then, things like {{Error}} would have to be reconstructed for {{instanceof}} to work.\r\n\r\nAs an example of how much pain this is, go look at [vm2|https://www.npmjs.com/package/vm2]. The simplest of simple things are [impossible|https://github.com/patriksimek/vm2/issues/62].\r\n\r\nUnless we add support for one-time loaded scripts, plugins will need to be daemon plugins that abide by the lifecycle and limitations of the daemon.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2019-07-19T17:10:32.000+0000", "updated": "2019-07-19T17:10:32.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }