Skip to content

fix: use node-gyp as a module instead of shelling out - #400

Merged
malept merged 2 commits into
masterfrom
malept/refactor/node-gyp-module
Sep 7, 2020
Merged

malept merged 2 commits into
masterfrom
malept/refactor/node-gyp-module

Conversation

@malept

@malept malept commented Sep 2, 2020

Copy link
Copy Markdown
Member

Technically it's a refactor, but it's also a fix/perf improvement. Tests run significantly faster probably because it removes a layer of indirection (i.e., shelling out). I believe we may be able to do something similar with prebuild-install and just get rid of @malept/cross-spawn-promise as a dependency (still needs to be a devDependency).

This is ported from #363

Turns out the module uses command line arguments cry but it's still better than using spawn.

Also extracts the actual module rebuilding to its own class.

Additionally, it refactors locateBinary to be a little more efficient in the worst case.

@malept
malept requested a review from a team September 2, 2020 07:35
@malept
malept force-pushed the malept/refactor/node-gyp-module branch from 6bbc342 to 725149c Compare September 2, 2020 07:35
@malept
malept merged commit 9d166a8 into master Sep 7, 2020
@malept
malept deleted the malept/refactor/node-gyp-module branch September 7, 2020 02:50
@electron-bot

Copy link
Copy Markdown

🎉 This PR is included in version 2.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants