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

wip: add vite5 support #10818

Closed
wants to merge 7 commits into from
Closed

wip: add vite5 support #10818

wants to merge 7 commits into from

Conversation

dominikg
Copy link
Member

@dominikg dominikg commented Oct 1, 2023

  • added lots of overrides to ensure consistent use of typescript, esbuild, rollup, vite, vite-plugin-svelte and workspace:^
  • bumped typescript, rollup, esbuild to latest
  • vite-plugin-svelte as peerDependency on sveltejs/kit

right now this PR is a breaking change as users have to install v-p-s manually after upating.

To avoid the breaking change, we would need to somehow keep the dependency on v-p-s@2 and add a new one to v-p-s@3, maybe using an alias like "@sveltejs/vps3":"npm:@sveltejs/vite-plugin-svelte@^3" and then dynamically picking the one to use after a vite version check.

Downside is that with v-p-s 2 still in the dependencies, users updating to vite-5/v-p-s3 would see peer dependency warnings about it.

The other alternative is trying to use a combined range in dependencies "@sveltejs/vite-plugin-svelte":"^2.4.1|| ^3.0.0-next.0" but then it becomes a bit difficult to manage our own workspace as running sth like pnpm update @sveltejs/vite-plugin-svelte could bork that.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

@changeset-bot
Copy link

changeset-bot bot commented Oct 1, 2023

⚠️ No Changeset found

Latest commit: b2db22e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@benmccann
Copy link
Member

I merged in the latest master to fix a merge conflict and get @bluwy's improvements from #10896. I'm now seeing this PR fail with:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './parseAst' is not defined by "exports" in node_modules/.pnpm/vite@5.0.0-beta.11_@types+node@18.18.6_lightningcss@1.21.8/node_modules/rollup/package.json imported from node_modules/.pnpm/vite@5.0.0-beta.11_@types+node@18.18.6_lightningcss@1.21.8/node_modules/vite/dist/node/index.js

@dominikg
Copy link
Member Author

I merged in the latest master to fix a merge conflict and get @bluwy's improvements from #10896. I'm now seeing this PR fail with:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './parseAst' is not defined by "exports" in node_modules/.pnpm/vite@5.0.0-beta.11_@types+node@18.18.6_lightningcss@1.21.8/node_modules/rollup/package.json imported from node_modules/.pnpm/vite@5.0.0-beta.11_@types+node@18.18.6_lightningcss@1.21.8/node_modules/vite/dist/node/index.js

beta.11 has rollup4 so we have to use it here aswell. took the opportunity to bump a few others alongside.

@@ -30,6 +29,16 @@ for (const pkg_path of glob(resolve_path('../../../packages/*/package.json'))) {
overrides[name] = `${protocol}${path.dirname(path.resolve(pkg_path))}`;
}

for (const [name, version] of Object.entries(overrides)) {
Copy link
Member

Choose a reason for hiding this comment

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

what is this for?

Copy link
Member Author

Choose a reason for hiding this comment

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

create-svelte tests generate a temp workspace and that needs to handle overrides. In this PR I introduced workspace level overrides for some packages

			"esbuild": "$esbuild",
			"svelte": "$svelte",
			"vite": "$vite",
			"typescript": "$typescript",
			"rollup": "$rollup"

the updated script ensures that the temp workspace uses the correct values from workspace devDependencies.

@benmccann
Copy link
Member

There's some issue with Vite 5 that I think remains even with this PR: #11085. I looked into it for a bit this morning, but am out of time at the moment to keep investigating

@benmccann
Copy link
Member

Closing in favor of #11122, which is up-to-date and has a closer approach to what we've decided to go with

@benmccann benmccann closed this Dec 1, 2023
@benmccann benmccann deleted the vite-5 branch December 3, 2023 17:59
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