Open Mister-Hope opened 3 weeks ago
In most blog sites, there should be no comment box at homepage, timeline, catetgories/tags list.
However, these pages can contain article list, which can contain pageviews of the article.
To achieve the best performance, only pageview feature is needed here. (Especially for homepage, the full artalk chunk should not be forced loaded)
My package Waline provides a standalone pageview chunk as @waline/client/pageview for it, which solves the problem.
@waline/client/pageview
The main problem that Artalk has, is that not only it's not providing a separate chunk, but it also do not allow to "tree shake" the feature.
Though loadCountWidget is a sub export for the main module, it's coming from static member from artalk, i.e.:
loadCountWidget
class Artalk { // ... static loadCountWidget(e) { // ... } } const loadCountWidget = Artalk.loadCountWidget export { loadCountWidget }
In most blog sites, there should be no comment box at homepage, timeline, catetgories/tags list.
However, these pages can contain article list, which can contain pageviews of the article.
To achieve the best performance, only pageview feature is needed here. (Especially for homepage, the full artalk chunk should not be forced loaded)
My package Waline provides a standalone pageview chunk as
@waline/client/pageview
for it, which solves the problem.The main problem that Artalk has, is that not only it's not providing a separate chunk, but it also do not allow to "tree shake" the feature.
Though
loadCountWidget
is a sub export for the main module, it's coming from static member from artalk, i.e.:Suggested solution
loadCountWidget
and all other possible exports tree-shakable. The "server link" should be required when calling these features alone.