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(ssr): properly handle vite.middlewares after restart #14917

Merged
merged 2 commits into from
Nov 9, 2023

Conversation

patak-dev
Copy link
Member

Description

See:

vite.middlewares is updated after a restart in middlewareMode: true. We need to recommend an indirection so users always get the latest middlewares, as proposed by @bluwy here

We could try to make vite.middlewares more magical and avoid reassigning in the future, but it isn't bad either that users know the middlewares change after a restart explicitly.


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.

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
@patak-dev patak-dev requested a review from bluwy November 9, 2023 08:09
docs/guide/ssr.md Outdated Show resolved Hide resolved
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
@patak-dev patak-dev enabled auto-merge (squash) November 9, 2023 08:25
@patak-dev patak-dev merged commit e49ef02 into main Nov 9, 2023
5 checks passed
@patak-dev patak-dev deleted the docs/middlewares-in-ssr-after-restart branch November 9, 2023 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants