-
Notifications
You must be signed in to change notification settings - Fork 32.6k
keytar
brings in a lot of files in the build
#143395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
I think we need to solve this in our build scripts. In vscode/build/lib/dependencies.ts Line 60 in b0cbac3
keytar dependencies (along with all it's subdependencies) as we know they are not needed at runtime.
I want to look at implementing this, unless there are better ideas. @joaomoreno ? |
I'm not sure you'll find success here since dependencies might be shared with another one of our dependencies, due to deduplication. Given that keytar doesn't have any dependencies other than installation-time dependencies, we can take the approach of installing Another approach: fork keytar into a version which ships all prebuilt binaries variants at install time and have a |
Those both seem like decent options. The former seems easier... @deepak1556 do you have any advice here? Also is there something I could ask the keytar folks to do that would make this easier? |
Agree with @joaomoreno on the available solutions, sqlite3 native dependency also has the same issue and we took the second approach with a slight variant microsoft/vscode-node-sqlite3@59a82b2. We simply do not rely on the prebuilt binaries in the fork, since essentially we want to ship native modules for both our client and server compiled with the toolchain we have customized for our CI based on the electron and node versions, prebuild is unnecessary in these cases. I don't think the upstream keytar can make things easier for us, since prebuild-install cannot be made optional. The issue we are facing is specific to how we bundle and ship these modules, so I would align with a fork and control what we want to ship. |
@deepak1556 do you think we could meet and go over the approach with vscode-node-sqlite3 and how I could do the same for keytar? I like the idea of following that pattern and I'm curious to know how we publish vscode-node-sqlite3 |
Came across the same issue using this package in a VS Code extension, recommend supporting keytar moving to using prebuildify |
Looks like my issue should be marked as a dupe :) atom/node-keytar#462 @thegecko btw, I noticed you mentioned bringing in keytar for a vscode extension... you actually don't need to bundle keytar in your extension because we shim keytar so that you use the keytar that ships in vscode. In your code, you can use keytar as you do today (importing it as normal), but you don't need to bundle it (and it's deps) with your extension. |
That's awesome! is it easy to discover other packages which can be leveraged in this way? Especially native ones. |
@thegecko that comes from here:
It's really just keytar, the vscode module itself, obviously, and the Keytar behaves this way so that you have consistency if your extension is actually running on a remote. You get the value stored on the client side (the side with an actual keychain). |
I'm looking into reducing the number of files in our server build.
Turns out that
keytar
brings in a lot of file because the use ofprebuild-install
in theinstall
script.Because of that
prebuild-install
is a dependency (not just a dev dependency) andprebuild-install
and all it's dependencies end up in the bits we ship (tar-fs, tar-stream, readable-stream....).It's not easy to remove all these unnecessary from the build. We have a hand curated filter (https://github.com/microsoft/vscode/blob/main/build/.moduleignore) but that's cumbersome and might change after an update.
The text was updated successfully, but these errors were encountered: