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

Make the Lit integration be compat with Vite 3.0.1 #4009

Merged
merged 4 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/mighty-poets-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'astro': patch
'@astrojs/lit': patch
---

Fixes Lit compat with Vite 3.0.1
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"strip-ansi": "^7.0.1",
"supports-esm": "^1.0.0",
"tsconfig-resolver": "^3.0.1",
"vite": "^3.0.0",
"vite": "^3.0.2",
Copy link
Member

Choose a reason for hiding this comment

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

I would consider this Vite making breaking changes behind patches, and not following semver. Can we pin to v3.0.2 for now until their v3 matures a bit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Choose a reason for hiding this comment

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

Sorry for this. FWIW, we counted it as regression as we didn't intend to change the way noExternal/external works. Given the current discussion in vitejs/vite#9275, I think that external will end up working as it did in Vite 2 and also count as a regression fix.
But I totally understand fixing the version until this is resolved 👍🏼

"yargs-parser": "^21.0.1",
"zod": "^3.17.3"
},
Expand Down
8 changes: 3 additions & 5 deletions packages/integrations/lit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ function getViteConfiguration() {
},
ssr: {
external: [
'lit-element/lit-element.js',
'@lit-labs/ssr/lib/install-global-dom-shim.js',
'@lit-labs/ssr/lib/render-lit-html.js',
'@lit-labs/ssr/lib/lit-element-renderer.js',
'@astrojs/lit/server.js',
'lit-element',
'@lit-labs/ssr',
'@astrojs/lit',
],
},
};
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.