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

Reduce lodash dependent code #3285

Merged
merged 1 commit into from Oct 14, 2018

Conversation

3 participants
@segayuu
Contributor

segayuu commented Oct 12, 2018

Thank you for creating a pull request to contribute to Hexo code! Before you open the request please review the following guidelines and tips to help it be more easily integrated:

  • Add test cases for the changes.
  • Passed the CI test.

@segayuu segayuu requested a review from hexojs/core Oct 12, 2018

@coveralls

This comment has been minimized.

coveralls commented Oct 12, 2018

Coverage Status

Coverage decreased (-0.003%) to 97.27% when pulling da3249c on segayuu:Reduce-lodash-dependent-code into d9196e3 on hexojs:master.

1 similar comment
@coveralls

This comment has been minimized.

coveralls commented Oct 12, 2018

Coverage Status

Coverage decreased (-0.003%) to 97.27% when pulling da3249c on segayuu:Reduce-lodash-dependent-code into d9196e3 on hexojs:master.

@@ -2,7 +2,7 @@
const moment = require('moment-timezone');
const isMoment = moment.isMoment;
const isDate = require('lodash').isDate;
const isDate = require('lodash/isDate');

This comment has been minimized.

@YoshinoriN

YoshinoriN Oct 14, 2018

Member

I think lodash/isDate maybe can replace instanceof Date.

This comment has been minimized.

@segayuu

segayuu Oct 14, 2018

Contributor

that's right!
In addition, lodash.isDate() returns the result if util.types.isDate() exists, if one exists.
Although it may be corrected, I think that the necessity to thoroughly perform the contents of this PR is thinner than other libraries such as warehouse.
That's because hexo exports the lodash namespace and it's a big size as a library.

@YoshinoriN

This comment has been minimized.

Member

YoshinoriN commented Oct 14, 2018

@segayuu
I tried hexo server and hexo generate using by your branch source code in my local environment.
Like this.

  "dependencies": {
    "hexo": "segayuu/hexo#Reduce-lodash-dependent-code"
    "hexo-generator-archive": "0.1.5",
    "hexo-generator-category": "0.1.3",
    ...
    "hexo-server": "0.3.3"
  }

It seems works well. I think this PR is no problem.
I will merge this PR if lodash/isDate question will be clear.

@YoshinoriN YoshinoriN merged commit e6cac92 into hexojs:master Oct 14, 2018

3 of 4 checks passed

coverage/coveralls Coverage decreased (-0.003%) to 97.27%
Details
codeclimate All good!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@YoshinoriN

This comment has been minimized.

Member

YoshinoriN commented Oct 14, 2018

OK, Merged !

@segayuu segayuu deleted the segayuu:Reduce-lodash-dependent-code branch Oct 14, 2018

@segayuu

This comment has been minimized.

Contributor

segayuu commented Oct 14, 2018

thank @YoshinoriN !

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