Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Remove unneeded dependencies - #4

Merged
rafeca merged 2 commits into
masterfrom
remove-unneeded-dependencies
May 6, 2019
Merged

rafeca merged 2 commits into
masterfrom
remove-unneeded-dependencies

Conversation

@rafeca

@rafeca rafeca commented May 6, 2019 •

Copy link
Copy Markdown

This PR gets rid of fs-extra, lodash.isinteger, loadash.isundefined and promisify-node from the list of dependencies of nsfw.

These packages and their dependencies contribute to 92 modules that need to be loaded, parsed and evaluated during the startup of Atom (out of ~400 total modules loaded).

  • lodash.isinteger has been replaced by Number.isInteger.
  • lodash.isundefined has been replaced by strict checks against undefined.
  • promisify-node has been replaced by the core util.promisify node API.
  • fs-extra has been replaced by the core fs module (only stat method was used on the package logic). For tests, I've replaced fs.remove() by rimraf).

This is part of the initiative to reduce the number of modules loaded during startup. More info: atom/atom#19269

@rafeca
rafeca requested a review from nathansobo May 6, 2019 15:59

@nathansobo nathansobo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm missing something, it looks like you still need to remove a require to promisify-node. Other than that, awesome work identifying the fact that we can drop all of this dead weight!

Comment thread js/spec/index-spec.js Outdated
@@ -1,7 +1,8 @@
const nsfw = require('../src/');
const path = require('path');
const promisify = require('promisify-node');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we're still using promisify-node here, but you mentioned removing it in the PR body and I see it removed from the dependencies. Was this an oversight?

@rafeca

rafeca commented May 6, 2019

Copy link
Copy Markdown
Author

Ups you're right! While staging some changes I reverted these changes... thanks for realizing!!

Btw, it looks like this repo has no CI configured (I didn't receive any build issue)

@rafeca
rafeca merged commit 3eacdb0 into master May 6, 2019
@rafeca
rafeca deleted the remove-unneeded-dependencies branch May 6, 2019 19:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants