tea3 / hexo-related-popular-posts

A hexo plugin that generates a list of links to related posts and popular posts. Also , this plugin can get Visitor Counts (PV) on posts.
MIT License
109 stars 14 forks source link

chore(deps): support hexo 4.2.0 (#22) #23

Closed yoshinorin closed 4 years ago

yoshinorin commented 4 years ago

Description

fixes: #22

In hexo 4.2.0 Locals class use hexo-util. Please see followings:

https://github.com/hexojs/hexo/pull/3996 https://github.com/hexojs/hexo/commit/c6e6e6b4e79d04f48b73d66812ad5e601b0f651a#diff-8706ed85bcc456bc4bd99698f3cb949dR7

Fix

hexo.locals.cache to hexo.locals.cache.cache

Others

Thank you :)

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 78.947% when pulling f422b7cb8afbec0119547a0bb23f1b7bbe145d6a on YoshinoriN:hexo4.2.0-support into 5f782be6d13008eedd862049689df0a014dbfdb3 on tea3:master.

yoshinorin commented 4 years ago

At first glance, on my local machine works well. But, the performance problem occurred.

Browser reload is very slow when post file change...

SukkaW commented 4 years ago

@YoshinoriN Locals.cache.cache should be considered a private API. We could add a dump() in Hexo 4.3.0, so that we will have a consistent API.

According to Hexo API's documents, there is already a method called toObject(). The plugin should use Locals.toObject() for consistency. And cache for toObject() should be handled by plugin itself.

yoshinorin commented 4 years ago

@SukkaW Thank you :) I will check it later.