{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/vscode-cosmosdb/issues/364","repository_url":"https://api.github.com/repos/Microsoft/vscode-cosmosdb","labels_url":"https://api.github.com/repos/Microsoft/vscode-cosmosdb/issues/364/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode-cosmosdb/issues/364/comments","events_url":"https://api.github.com/repos/Microsoft/vscode-cosmosdb/issues/364/events","html_url":"https://github.com/Microsoft/vscode-cosmosdb/issues/364","id":298297316,"number":364,"title":"Breaking Change regarding the usage of keytar","user":{"login":"alexandrudima","id":5047891,"avatar_url":"https://avatars3.githubusercontent.com/u/5047891?v=4","gravatar_id":"","url":"https://api.github.com/users/alexandrudima","html_url":"https://github.com/alexandrudima","followers_url":"https://api.github.com/users/alexandrudima/followers","following_url":"https://api.github.com/users/alexandrudima/following{/other_user}","gists_url":"https://api.github.com/users/alexandrudima/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandrudima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandrudima/subscriptions","organizations_url":"https://api.github.com/users/alexandrudima/orgs","repos_url":"https://api.github.com/users/alexandrudima/repos","events_url":"https://api.github.com/users/alexandrudima/events{/privacy}","received_events_url":"https://api.github.com/users/alexandrudima/received_events","type":"User","site_admin":false},"labels":[{"id":698187622,"url":"https://api.github.com/repos/Microsoft/vscode-cosmosdb/labels/P1","name":"P1","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Microsoft/vscode-cosmosdb/milestones/8","html_url":"https://github.com/Microsoft/vscode-cosmosdb/milestone/8","labels_url":"https://api.github.com/repos/Microsoft/vscode-cosmosdb/milestones/8/labels","id":3062595,"number":8,"title":"0.5.0","description":"","creator":{"login":"EricJizbaMSFT","id":11282622,"avatar_url":"https://avatars2.githubusercontent.com/u/11282622?v=4","gravatar_id":"","url":"https://api.github.com/users/EricJizbaMSFT","html_url":"https://github.com/EricJizbaMSFT","followers_url":"https://api.github.com/users/EricJizbaMSFT/followers","following_url":"https://api.github.com/users/EricJizbaMSFT/following{/other_user}","gists_url":"https://api.github.com/users/EricJizbaMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/EricJizbaMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EricJizbaMSFT/subscriptions","organizations_url":"https://api.github.com/users/EricJizbaMSFT/orgs","repos_url":"https://api.github.com/users/EricJizbaMSFT/repos","events_url":"https://api.github.com/users/EricJizbaMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/EricJizbaMSFT/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":6,"state":"open","created_at":"2018-01-25T00:16:11Z","updated_at":"2018-02-27T17:10:36Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2018-02-19T14:36:53Z","updated_at":"2018-02-27T17:10:37Z","closed_at":"2018-02-27T17:10:37Z","author_association":"MEMBER","body":"Hi,\r\n\r\nI'm working on VSCode and I am trying to enable the usage of [ASAR for VSCode](https://github.com/Microsoft/vscode/issues/36997). This can improve the startup time of VSCode by [up to 5%](https://github.com/Microsoft/vscode/pull/41353). We are at a point where we are pursuing even such small gains...\r\n\r\nI have found that your extension makes an assumption about the disk layout of VSCode's `node_modules`:\r\n```\r\nms-azuretools.vscode-cosmosdb/out/src/tree/AttachedAccountsTreeItem.js:35\r\n  this._keytar = require(`${vscode.env.appRoot}/node_modules/keytar`);\r\n```\r\n\r\nTo make your extension entirely compatible with a distribution of VSCode that uses ASAR, and to make your extension work with both VSCode stable and VSCode insiders, you will need to try to load from two paths... Something like the following:\r\n\r\n```js\r\nfunction getNodeModule(moduleName) {\r\n  try {\r\n    return require(`${vscode.env.appRoot}/node_modules.asar/${moduleName}`);\r\n  } catch(err) { }\r\n  try {\r\n    return require(`${vscode.env.appRoot}/node_modules/${moduleName}`);\r\n  } catch(err) {}\r\n  return null;\r\n}\r\n```\r\n\r\nI plan to release the changes to Insiders this week, such that the Insiders build on Friday, 23.02.2018, will contain the ASAR packing of node modules. In the meantime, I have created custom builds that include this change if you wish to test your extension against a VSCode version which contains these changes:\r\n- [Win 64](https://az764295.vo.msecnd.net/insider/64ee4f4955c99beea32fbf7bb46a0cd847cff434/VSCode-win32-x64-1.21.0-insider.zip)\r\n- [Win 32](https://az764295.vo.msecnd.net/insider/64ee4f4955c99beea32fbf7bb46a0cd847cff434/VSCode-win32-ia32-1.21.0-insider.zip)\r\n- [macOS](https://az764295.vo.msecnd.net/insider/64ee4f4955c99beea32fbf7bb46a0cd847cff434/VSCode-darwin-insider-unsigned.zip)\r\n- [Linux 64](https://az764295.vo.msecnd.net/insider/64ee4f4955c99beea32fbf7bb46a0cd847cff434/code-insider-1.21.0-1519035389_amd64.tar.gz)\r\n- [Linux 32](https://az764295.vo.msecnd.net/insider/64ee4f4955c99beea32fbf7bb46a0cd847cff434/code-insider-1.21.0-1519035388_i386.tar.gz)\r\n"}}
{"actor":{"display_login":"EricJizbaMSFT"}}