vuepress / core

Vue-Powered Static Site Generator
https://vuepress.vuejs.org
MIT License
2.35k stars 923 forks source link

feat(core)!: remove headers field from page data #1613

Open Mister-Hope opened 1 month ago

Mister-Hope commented 1 month ago

This reduces page data size by removing headers info from page data, downstream themes can infer headers via dom structure with @vuepress/helper and they can manually write it to page data if necessary.

coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 11266238703

Details


Totals Coverage Status
Change from base Build 11266064405: 0.0%
Covered Lines: 648
Relevant Lines: 906

💛 - Coveralls
meteorlxy commented 1 month ago

Then the markdown.headers option should default to false?

meteorlxy commented 1 month ago

Could headers be server-side rendered after the change?

Mister-Hope commented 1 month ago

I think the header information might still be required on the page object, but we should no longer pass it to client data by default.

meteorlxy commented 1 month ago

I see. What about SSR? Seems that helper pkg is using DOM api to get headers.

Mister-Hope commented 2 weeks ago

A toc is not needed for ssr I think. VitePress is doing the same, the full content dom is already rendered.