core icon indicating copy to clipboard operation
core copied to clipboard

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

Open Mister-Hope opened this issue 1 year ago • 5 comments

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.

Mister-Hope avatar Oct 09 '24 17:10 Mister-Hope

Pull Request Test Coverage Report for Build 13690291830

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 71.722%

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

💛 - Coveralls

coveralls avatar Oct 09 '24 17:10 coveralls

Then the markdown.headers option should default to false?

meteorlxy avatar Oct 10 '24 01:10 meteorlxy

Could headers be server-side rendered after the change?

meteorlxy avatar Oct 10 '24 01:10 meteorlxy

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.

Mister-Hope avatar Oct 10 '24 02:10 Mister-Hope

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

meteorlxy avatar Oct 12 '24 05:10 meteorlxy

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

Mister-Hope avatar Nov 08 '24 06:11 Mister-Hope

I think this can be merged

Mister-Hope avatar Dec 06 '24 10:12 Mister-Hope