{
"id": "174666",
"key": "ALOY-1714",
"fields": {
"issuetype": {
"id": "2",
"description": "A new feature of the product, which has yet to be developed.",
"name": "New Feature",
"subtask": false
},
"project": {
"id": "11113",
"key": "ALOY",
"name": "Alloy",
"projectCategory": {
"id": "10400",
"description": "Tools for developing applications",
"name": "Tooling"
}
},
"fixVersions": [],
"resolution": null,
"resolutiondate": null,
"created": "2020-01-23T17:25:35.000+0000",
"priority": {
"name": "None",
"id": "6"
},
"labels": [
"griffin-app",
"widget",
"wpath"
],
"versions": [],
"issuelinks": [],
"assignee": {
"name": "fmiao",
"key": "fmiao",
"displayName": "Feon Sua Xin Miao",
"active": true,
"timeZone": "America/Vancouver"
},
"updated": "2020-01-23T23:35:09.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": "-Currently you have to use WPATH() around everything that refers to a path relative to the widget directory.-\r\n\r\nYou can do this currently if you are using the PR for this ticket: ALOY-1253 . \r\nI highly recommend merging this PR as well.\r\n\r\n\r\n{noformat}\r\n\r\n\t\r\n\r\n{noformat}\r\n\r\n\r\nI am proposing that ~/ be used as a shortcut for this so that WPATH() is no longer required when using with XML View attributes\r\n\r\n\r\n{noformat}\r\n\r\n\t\r\n\r\n{noformat}\r\n\r\n",
"attachment": [],
"flagged": false,
"summary": "Allow ~/ to be used as a shortcut for WPATH() in xml view attributes",
"creator": {
"name": "bhouse",
"key": "bhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"subtasks": [],
"reporter": {
"name": "bhouse",
"key": "bhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"environment": null,
"comment": {
"comments": [
{
"id": "453788",
"author": {
"name": "eharris",
"key": "eharris",
"displayName": "Ewan Harris",
"active": true,
"timeZone": "Europe/Dublin"
},
"body": "[~bhouse] I think that the webpack loader for Alloy is introducing some special syntax for this kinda thing too, so I'd like for us to align between the two rather than have two ways to achieve the same thing.\r\nAccording to [this doc|https://github.com/appcelerator/appcd-plugin-webpack/blob/master/migration.md#code-changes] the widget syntax there will be {{@widget}} is that right [~jvennemann]?",
"updateAuthor": {
"name": "eharris",
"key": "eharris",
"displayName": "Ewan Harris",
"active": true,
"timeZone": "Europe/Dublin"
},
"created": "2020-01-23T18:18:01.000+0000",
"updated": "2020-01-23T18:18:01.000+0000"
},
{
"id": "453789",
"author": {
"name": "bhouse",
"key": "bhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"body": "Something like this {{require('@widget/utils')}} - as an example on the docs is a bad idea. The \"@\" symbol has a special meaning with node modules and all npm scoped packages begin with this character. Using {{require('@widget/utils')}} would tell the system to require something from the npm package {{@widget/utils}}\r\n\r\nPlus... it's not much of a shortcut if it is the same or longer than using WPATH",
"updateAuthor": {
"name": "bhouse",
"key": "bhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"created": "2020-01-23T18:35:24.000+0000",
"updated": "2020-01-23T18:39:40.000+0000"
},
{
"id": "453792",
"author": {
"name": "jvennemann",
"key": "jvennemann",
"displayName": "Jan Vennemann",
"active": true,
"timeZone": "Europe/Berlin"
},
"body": "[~bhouse], Webpack uses an enhanced resolve mechanism, so things like {{@widget/utils}} are perfectly valid. The {{@widget}} is just a path alias and Webpack falls back to the default node resolve algorithm using {{@widget}} as the scope if it won't find anything under the alias. Prefixing aliases in Webpack with either {{@}} or {{~}} is common practice. Using those character alone generally is used as an alias to the {{src}} or {{asset}} directories of a project. I used the same [alias configuration|https://github.com/appcelerator/appcd-plugin-webpack/blob/9f2f03cc5b88e958abb9ddefad4e19fe36f4b88b/src/config/alloy.js#L39] in our Webpack configs as well. To properly distinguish between the project source alias and the one for widgets i chose {{@widget}}.\r\n\r\nAlthough {{@widget}} is not very much of a shortcut, IMHO it's still much easier to write than the cumbersome {{WPATH()}}. And since this is all just a Webpack alias configuration we can easily add a short version like {{@w}}.",
"updateAuthor": {
"name": "jvennemann",
"key": "jvennemann",
"displayName": "Jan Vennemann",
"active": true,
"timeZone": "Europe/Berlin"
},
"created": "2020-01-23T22:30:47.000+0000",
"updated": "2020-01-23T22:47:16.000+0000"
},
{
"id": "453793",
"author": {
"name": "bhouse",
"key": "bhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"body": "So what would happen if you used {{@widget/utils}} and if {{/my-widget/utils}} did exist but you wanted to use the correct path of {{node_modules/@widget/utils}} ?",
"updateAuthor": {
"name": "bhouse",
"key": "bhouse",
"displayName": "Brenton House",
"active": true,
"timeZone": "America/Chicago"
},
"created": "2020-01-23T22:37:31.000+0000",
"updated": "2020-01-23T22:37:58.000+0000"
},
{
"id": "453795",
"author": {
"name": "jvennemann",
"key": "jvennemann",
"displayName": "Jan Vennemann",
"active": true,
"timeZone": "Europe/Berlin"
},
"body": "It would use the first match (which would be the alias). There are currently no published packages under {{@widget}} so it wouldn't be an issue anyway. Also I'd say the chances of this every being an issue are pretty low.\r\n\r\nBut we can change it of course just to be safe. However, if possible i would not use {{~/}} since it is very common to use that as the alias to assets in Web projects and i would like to keep it that way in Titanium as well. Any suggestions?",
"updateAuthor": {
"name": "jvennemann",
"key": "jvennemann",
"displayName": "Jan Vennemann",
"active": true,
"timeZone": "Europe/Berlin"
},
"created": "2020-01-23T23:35:09.000+0000",
"updated": "2020-01-23T23:35:09.000+0000"
}
],
"maxResults": 5,
"total": 5,
"startAt": 0
}
}
}