{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/13163","repository_url":"https://api.github.com/repos/yiisoft/yii2","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/13163/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/13163/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/13163/events","html_url":"https://github.com/yiisoft/yii2/issues/13163","id":194312113,"number":13163,"title":"View::registerJsFile doesn't append timestamp for not mapped assets","user":{"login":"DarthLegiON","id":11365194,"avatar_url":"https://avatars.githubusercontent.com/u/11365194?v=3","gravatar_id":"","url":"https://api.github.com/users/DarthLegiON","html_url":"https://github.com/DarthLegiON","followers_url":"https://api.github.com/users/DarthLegiON/followers","following_url":"https://api.github.com/users/DarthLegiON/following{/other_user}","gists_url":"https://api.github.com/users/DarthLegiON/gists{/gist_id}","starred_url":"https://api.github.com/users/DarthLegiON/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DarthLegiON/subscriptions","organizations_url":"https://api.github.com/users/DarthLegiON/orgs","repos_url":"https://api.github.com/users/DarthLegiON/repos","events_url":"https://api.github.com/users/DarthLegiON/events{/privacy}","received_events_url":"https://api.github.com/users/DarthLegiON/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-08T11:28:33Z","updated_at":"2016-12-10T20:03:04Z","closed_at":"2016-12-10T20:03:04Z","body":"Hello!\r\nI used such code for registering Js file in view:\r\n```php\r\n$this->registerJsFile('@web/js/result-index.js', ['depends' => [AppAsset::className()]]);\r\n```\r\nI have an `appendTimestamp` property set on `true` but timestamp near file import doesn't appears (see https://github.com/yiisoft/yii2/pull/10297#issuecomment-265699405).\r\n\r\nIt behaviors such way because of truncating alias `@web/js/result-index.js` to relative `/js/result-index.js` and `$basePath = null` (see https://github.com/yiisoft/yii2/commit/3ec3ce931216a44ec0b850c429c9d8c7f9a17e6d) for created `AssetBundle`. Solution is only using `assetMap` property of `AssetManager` and creating aliases for used Js files. \r\n\r\n```php\r\n'assetMap' => [\r\n    'result-index.js' => '@web/js/result-index.js',\r\n],\r\n```\r\n\r\nIs there another, more simple solution? I have a lot of dynamically registered Js and Css files in my project, creating aliases may take some time, and this solution is not universal for all potential use cases. Thanks!\r\n\r\n### Additional info\r\n\r\n| Q                | A\r\n| ---------------- | ---\r\n| Yii version      | 2.0.10\r\n| PHP version      | 7.0.8\r\n| Operating system | CentOS 6, Windows 10\r\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/266234108","html_url":"https://github.com/yiisoft/yii2/issues/13163#issuecomment-266234108","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/13163","id":266234108,"user":{"login":"SilverFire","id":4499203,"avatar_url":"https://avatars.githubusercontent.com/u/4499203?v=3","gravatar_id":"","url":"https://api.github.com/users/SilverFire","html_url":"https://github.com/SilverFire","followers_url":"https://api.github.com/users/SilverFire/followers","following_url":"https://api.github.com/users/SilverFire/following{/other_user}","gists_url":"https://api.github.com/users/SilverFire/gists{/gist_id}","starred_url":"https://api.github.com/users/SilverFire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SilverFire/subscriptions","organizations_url":"https://api.github.com/users/SilverFire/orgs","repos_url":"https://api.github.com/users/SilverFire/repos","events_url":"https://api.github.com/users/SilverFire/events{/privacy}","received_events_url":"https://api.github.com/users/SilverFire/received_events","type":"User","site_admin":false},"created_at":"2016-12-10T20:03:04Z","updated_at":"2016-12-10T20:03:04Z","body":"> I have a lot of dynamically registered Js and Css files in my project\r\n\r\nYou can create AssetBundles for those JS as CSS files and `appendTimestamp` will apply to them. I can't suggest you easier way to solve your problem, sorry."}}
{"actor":{"display_login":"SilverFire"}}