Skip to content
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

segayuu
Copy link
Contributor

@segayuu 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 a team October 12, 2018 02:38
@coveralls
Copy link

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
Copy link

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');
Copy link
Member

Choose a reason for hiding this comment

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

I think lodash/isDate maybe can replace instanceof Date.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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
Copy link
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
@yoshinorin
Copy link
Member

OK, Merged !

@segayuu segayuu deleted the Reduce-lodash-dependent-code branch October 14, 2018 12:16
@segayuu
Copy link
Contributor Author

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants