{ "id": "171498", "key": "TIMOB-26053", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": "2018-04-11T12:58:24.000+0000", "priority": null, "labels": [ "build", "cb-tooling", "minify", "titaniumlib" ], "versions": [], "issuelinks": [ { "id": "58217", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "171283", "key": "DAEMON-243", "fields": { "summary": "Create titaniumlib with tiapp.xml parsing, sdk and module detection logic", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2020-03-06T21:34:40.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": "As a developer you have the option to pass `--skip-js-minify` to `appc ti build`. I think it should be unminifed by default, and only minify for production versions. There is no real benefit besides a smaller app.\r\n\r\nThe disadvantages however are:\r\n - Harder to debug your code from Titanium error messages\r\n - Slightly longer build time (havent tested how much)\r\n\r\nI suggest inverting the option to `--minify` to minify a development version if you want to. Not passing this option will not minify it. Production builds should have this enabled by default ofcourse.", "attachment": [], "flagged": false, "summary": "Skip JS minify by default", "creator": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "environment": "Any", "comment": { "comments": [ { "id": "436779", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "The minification has little performance hit during build since we already have the parsed AST in memory.\r\n\r\nNot sure about debugging. We do not generate source maps for Ti classic apps, but I believe Alloy does. I don't know if we package source maps with production alloy apps. Neither here nor there, we should have the option to package source maps with production apps and the debugger should use them.\r\n\r\nI do believe there is a performance benefit by minifying the source code. Minified code is faster to load from flash memory and faster to parse. Back in the day on slower devices with slower flash memory, this was noticeable.\r\n\r\nI think we should leave minification enabled for non-debug device builds and distribution builds. I'd be open to disabling minification for debug device builds.\r\n\r\nOn a side note, you could create a hook that disables minification for all build targets so that you never have to pass in {{\\-\\-skip\\-js\\-minify}}.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2018-04-11T13:22:27.000+0000", "updated": "2018-04-11T13:22:27.000+0000" }, { "id": "436780", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "yes it seems the loading time performance benefit is negligible. However I have found myself in the past with looking at minified build files trying to find an issue, where all variables were renamed to single characters etc.\r\n\r\nFrom a dev perspective it is very odd to do such a thing as minifying during the developer loop, hence I created this issue. I dont know the internals of flash memory storage and how exactly the javascript files are persisted on a phone, but perhaps memory has improved a lot and minification is no longer necessary.", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2018-04-11T13:39:03.000+0000", "updated": "2018-04-11T13:39:03.000+0000" }, { "id": "436781", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "The idea for minifying and encrypting device builds was to force developers to experience what their app might be like in production. Believe it or not, back in the day (and probably still today) many developers did not test their distribution builds. Since minification or some other feature could introduce issues, best to find them during device builds and not distribution builds.\r\n\r\nDespite flash memory and CPU speeds increasing, minified code will load and parse faster than non-minified code.\r\n\r\nMaybe we could expose some knobs to twiddle to not minify, but strip comments?\r\n\r\nIf we exposed a setting in the tiapp.xml to disable JavaScript minification and possibly the ability to just strip comments as well as improve our debugging experince by generating and using source maps, would that solve your use case?", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2018-04-11T13:48:46.000+0000", "updated": "2018-04-11T13:48:46.000+0000" }, { "id": "436783", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2018-04-11T14:10:23.000+0000", "updated": "2018-04-11T14:10:23.000+0000" }, { "id": "436785", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2018-04-11T14:39:53.000+0000", "updated": "2018-04-11T14:39:53.000+0000" }, { "id": "436788", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "i had no clue so much work has been done already. Though it saddens me it has been initiated over 5 years ago and it looks like it is not gonna be finished soon.\r\n\r\nI can see the business perspective of this being not a priority, but for me it has always been a shortcoming of working with titanium. There is simply too much \"magic\" going on with titanium builds, (not to speak about the alloy layer).\r\n\r\n", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2018-04-11T15:12:04.000+0000", "updated": "2018-04-11T15:12:04.000+0000" }, { "id": "436790", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "To add to this, Studio doesn't do minify by default for all non-production builds by adding the skip-minify part. ", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-11T16:02:36.000+0000", "updated": "2018-04-11T16:03:23.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }