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

fix(css): reset render cache on renderStart #14326

Merged
merged 1 commit into from
Sep 8, 2023
Merged

fix(css): reset render cache on renderStart #14326

merged 1 commit into from
Sep 8, 2023

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Sep 8, 2023

Description

Fix unocss fail in ecosystem-ci, since #13974 that revealed a bug in our code.

Additional context

Unocss has a test in lib mode with multiple outputs, each output is rendered once. The css-post plugin has caches for the render hooks, e.g. renderChunk and generateBundle, the caches are scoped to each render (aka each output).

However, we reset our cache in buildStart, that means each render share the same cache, which is incorrect. This PR changes to renderStart instead.


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.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • 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).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@bluwy bluwy added feat: css p3-minor-bug An edge case that only affects very specific usage (priority) labels Sep 8, 2023
@stackblitz
Copy link

stackblitz bot commented Sep 8, 2023

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

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.

Nice catch! This may also be an issue in the manifest plugin:

@bluwy
Copy link
Member Author

bluwy commented Sep 8, 2023

I think the manifest plugin is intentional because it wants to output the manifest only on the final output

@patak-dev patak-dev merged commit 19bf0f1 into main Sep 8, 2023
9 of 10 checks passed
@patak-dev patak-dev deleted the css-post-cache branch September 8, 2023 07:07
Gaubee pushed a commit to Gaubee/vite that referenced this pull request Sep 13, 2023
@bluwy bluwy mentioned this pull request Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: css p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants