Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

Mister-Hope
Copy link
Member

@Mister-Hope Mister-Hope commented Oct 9, 2024

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 Mister-Hope linked an issue Oct 9, 2024 that may be closed by this pull request
@coveralls
Copy link

coveralls commented Oct 9, 2024

Pull Request Test Coverage Report for Build 11266238703

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 11266064405: 0.0%
Covered Lines: 648
Relevant Lines: 906

💛 - Coveralls

@meteorlxy
Copy link
Member

meteorlxy commented Oct 10, 2024

Then the markdown.headers option should default to false?

@meteorlxy
Copy link
Member

Could headers be server-side rendered after the change?

@Mister-Hope
Copy link
Member Author

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
Copy link
Member

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

@Mister-Hope
Copy link
Member Author

Mister-Hope commented Nov 8, 2024

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request] Remove header field in page data
3 participants