question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Breaking Change regarding the usage of keytar

See original GitHub issue

Hi,

I’m working on VSCode and I am trying to enable the usage of ASAR for VSCode. This can improve the startup time of VSCode by up to 5%. We are at a point where we are pursuing even such small gains…

I have found that your extension makes an assumption about the disk layout of VSCode’s node_modules:

ms-azuretools.vscode-cosmosdb/out/src/tree/AttachedAccountsTreeItem.js:35
  this._keytar = require(`${vscode.env.appRoot}/node_modules/keytar`);

To 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:

function getNodeModule(moduleName) {
  try {
    return require(`${vscode.env.appRoot}/node_modules.asar/${moduleName}`);
  } catch(err) { }
  try {
    return require(`${vscode.env.appRoot}/node_modules/${moduleName}`);
  } catch(err) {}
  return null;
}

I 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:

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
chrmarticommented, Feb 23, 2018

Keytar is a native module, so you’d have to ship one version per architecture and bitness (currently 5) and these would need to be rebuilt when we update to a new V8 with a new version of Electron. Having keytar built as part of VS Code does that for us.

0reactions
alexdimacommented, Feb 28, 2018

Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Breaking Change regarding the usage of keytar #39 - GitHub
Hi, I'm working on VSCode and I am trying to enable the usage of ASAR for VSCode. This can improve the startup time...
Read more >
Keytars Rule - Defending Music's Least Respected Instrument
The suspicion that the keytar is merely a symbol isn't completely off; after all, every keyboard deals in representations of other sounds. And ......
Read more >
8 Best Keytars In 2022- Wired & Wireless Picks
Keytars are crazy cool instruments that are slowly becoming more relevant. In this post I break down the new technology companies are using....
Read more >
Long-Live the Keytar: 4 Reasons Why This Portable Piano ...
Keytars are extremely versatile instruments. They can be used for a wide range of genres, from pop and rock to jazz and blues....
Read more >
Roland Ax-Edge keytar - Facebook
Lasse Raelahti my humble opinion is just that Roland simply knows the power of midi BT and does not want to let user...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found