-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Labels
Milestone
Description
Feature Request
The idea came from hexojs/site#1139 (comment) & #3677.
There is an article suggests we don't need lodash anymore.
According to benchmark below we can see es6 performance more or less as same as Lodash, in term of CPU, Memory or Handling time, at least in browser.
- https://dustinpfister.github.io/2017/11/20/lodash_foreach/
- https://hackernoon.com/es6-lodash-native-javascript-nodejs-example-tutorial-map-function-functional-programming-performance-speed-69645e613049
- https://www.reddit.com/r/javascript/comments/8j2hmq/performance_lodash_vs_es6_map/
There are also some benchmark of lodash vs es6 and es6 is definitely much faster in browser:
- https://blog.bitsrc.io/you-dont-need-lodash-or-how-i-started-loving-javascript-functions-3f45791fa6cd
- https://codeburst.io/why-you-shouldnt-use-lodash-anymore-and-use-pure-javascript-instead-c397df51a66
IMHO, we might consider replace at least some lodash with native js.
A guide about how to replace lodash with es6: https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore
A list of files that requires lodash:
hexo
- lib/plugins/console/deploy.js
- lib/theme/view.js
- lib/plugins/filter/template_locals/i18n.js
- lib/theme/index.js
- lib/hexo/load_config.js
- lib/plugins/filter/post_permalink.js
- lib/plugins/helper/toc.js
- lib/plugins/helper/date.js
- lib/hexo/multi_config_path.js
- lib/plugins/filter/new_post_path.js
- lib/hexo/post.js
-
lib/hexo/index.js - test/scripts/hexo/load_config.js
- test/scripts/filters/backtick_code_block.js
We might start with lib located under lib/plugins/
warehouse
yoshinorin, curbengh, dailyrandomphoto, slanterns and 1v91v91v9