Skip to content

docs(ssr): properly handle vite.middlewares after restart#14917

Merged
patak-cat merged 2 commits intomainfrom
docs/middlewares-in-ssr-after-restart
Nov 9, 2023
Merged

docs(ssr): properly handle vite.middlewares after restart#14917
patak-cat merged 2 commits intomainfrom
docs/middlewares-in-ssr-after-restart

Conversation

@patak-cat
Copy link
Copy Markdown
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.

@patak-cat patak-cat requested a review from bluwy November 9, 2023 08:09
@patak-cat patak-cat enabled auto-merge (squash) November 9, 2023 08:25
@patak-cat patak-cat disabled auto-merge November 9, 2023 08:53
@patak-cat patak-cat merged commit e49ef02 into main Nov 9, 2023
@patak-cat patak-cat 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.

2 participants