Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

docs: backend integration clarify tags to include in production HTML #16086

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

brownan
Copy link
Contributor

@brownan brownan commented Mar 3, 2024

Description

While writing my own backend integration, the documentation wasn't clear to me what tags were required in generated HTML. After looking at what the vite build-html plugin does, and what a couple other integrations do, I wanted to update the documentation with what I found. I hope this clarifies how backends should interpret the manifest and what HTML tags they should generate.

Additional context

Some integrations recursively followed imports and included script tags for imported javascript chunks, and some included <link rel="modulepreload"> tags. Is there an official stance from the project on how imported javascript chunks should be included? I consider them optional since the entry point chunk's javascript imports any dependent javascript files anyways, so it'd just be an optimization.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines, especially the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Update the corresponding documentation if needed.
  • Ideally, include relevant tests that fail without this PR but pass with it.

Copy link

stackblitz bot commented Mar 3, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@brownan brownan changed the title Backend Integration docs: Clarify tags to include in production HTML docs: Backend Integration docs: Clarify tags to include in production HTML Mar 3, 2024
@brownan brownan changed the title docs: Backend Integration docs: Clarify tags to include in production HTML docs: backend integration clarify tags to include in production HTML Mar 3, 2024
@brownan
Copy link
Contributor Author

brownan commented Mar 6, 2024

Thanks for the feedback! I agree, it's still useful to include an example template. I've modified it to fit in with the description more closely. Also I realized that each chunk can have multiple css files, and that both functions can be simplified to a single function which recursively gets the imported chunks. Let me know what you think of this. I feel the two examples and the description flow nicely together now.

@brownan
Copy link
Contributor Author

brownan commented Mar 13, 2024

@patak-dev if you have a chance, can you take a look at the changes I made? Thanks!

Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for working on this!

@sapphi-red sapphi-red added the documentation Improvements or additions to documentation label Mar 14, 2024
@sapphi-red sapphi-red merged commit 90556eb into vitejs:main Mar 14, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants