Skip to content

chore: add changeset for Vitest client environment breaking change#15049

Merged
delucis merged 4 commits intowithastro:nextfrom
Ntale3:add-vitest-changeset
Dec 19, 2025
Merged

chore: add changeset for Vitest client environment breaking change#15049
delucis merged 4 commits intowithastro:nextfrom
Ntale3:add-vitest-changeset

Conversation

@Ntale3
Copy link
Contributor

@Ntale3 Ntale3 commented Dec 18, 2025

Changes

  • Adds changeset documenting the removal of the Vitest workaround for client environment imports
  • This breaking change requires users to configure Vitest with an SSR environment (node) when testing Astro component rendering
  • The code change was already implemented in the next branch; this PR only adds the changeset to document the breaking change

Testing

No code changes were made in this PR - only a changeset was added to document an existing breaking change. The implementation is already present in the next branch where Astro components are stubbed in client environments (see packages/astro/src/vite-plugin-astro/index.ts lines 263-274).

Manual testing was performed on the next branch with similar changes to verify the behavior:

  • ✅ Astro components render correctly in node environment
  • ❌ Astro components are stubbed in jsdom/happy-dom environments (as expected)

Docs

I made the documenation changes already withastro/docs/pull/12808.

/cc @withastro/docs maintainers for feedback!

The changeset includes comprehensive migration instructions for affected users, covering:

  • Who is affected by this change
  • How to update vitest.config.ts to use node environment
  • Advanced workspace configuration for projects testing both Astro components and browser code

Closes #14895

@changeset-bot
Copy link

changeset-bot bot commented Dec 18, 2025

🦋 Changeset detected

Latest commit: 4b4ec97

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@florian-lefebvre florian-lefebvre added this to the v6.0.0 milestone Dec 18, 2025
@Ntale3
Copy link
Contributor Author

Ntale3 commented Dec 18, 2025

@florian-lefebvre the documentation for the the workaround fix hasnt been merged yet but i believe the link hash will eventually be here https://v6.docs.astro.build/en/guides/testing/ since its a testing change correct me if am wrong before i make the next PR

@ematipico
Copy link
Member

Sounds good then. Feel free to apply the suggestions and update the link

@florian-lefebvre
Copy link
Member

@Ntale3 no need to make another PR! You can just click on commit suggestion.

image

And we still want to point to the upgrade guide, which itseld will point to the testing docs section.

You'll only be able to update the link once the docs PR is finalized, I left a bunch of comments there

@sarah11918
Copy link
Member

I have updated Florian's suggestion with the full link to the upgrade guide now that it's known.

@sarah11918
Copy link
Member

sarah11918 commented Dec 19, 2025

I am going to go ahead and accept Florian's change, then I think this should be ready to merge?

@Ntale3 - for future PRs, you can see the image of the "commit suggestion" button from Florian's post. When a maintainer makes a suggestion (that you agree with 😄 ) you only need to press that button and type a commit message. Maintainers are also allowed to perform that action on your behalf, so I'm doing that now so we can resolve this PR before the weekend, and Florian and I both go on holidays for two weeks! 🥳

…ted in v6 upgrade guide

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

I see @sarah11918 took care of applying my suggestion, so this should be ready to merge.

Thanks again for helping out on this one @Ntale3!

@delucis delucis merged commit beddfeb into withastro:next Dec 19, 2025
2 checks passed
@Ntale3
Copy link
Contributor Author

Ntale3 commented Dec 20, 2025

@florian-lefebvre @delucis @ematipico and @sarah11918 i really appreciate you help.
Looking forward to another collaboration soon
Thank you guys!

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.

5 participants