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

Update Vite to v3/v4 #1

Merged
merged 3 commits into from
Jan 18, 2023
Merged

Update Vite to v3/v4 #1

merged 3 commits into from
Jan 18, 2023

Conversation

zoton2
Copy link
Contributor

@zoton2 zoton2 commented Dec 4, 2022

Not experienced at developing Vite plugins but giving this a shot. Keeping this as draft for now as we work on it.

  • Updates vite to the latest 3.x.x version.
  • Updates rollup to the latest 2.x.x version; mainly had to bump this to fix some typing issues during build because of mismatched dependencies between rollup and Vite. There is also a newer major version (3.x.x) but it isn't supported by Vite 3.
  • Updated pnpm-lock.yaml version to 5.4.
  • Added "WebWorker" to "compilerOptions.lib" in tsconfig.json; not sure if this is needed but will not build without it because of type issues in dependencies.
    • Adding "skipLibCheck": true into "compilerOptions" also works, but wasn't sure if there was an important reason not to have it.

This successfully builds and when used in my nodecg-vue-ts-template, allows that to successfully build as well. You may need to check the Vite migration guide yourself to see if I missed anything as I'm not great at fully checking it when I didn't write the plugin.

We should also probably bump the other dependencies too, at least to minor versions, but I wanted to bump the least amount possible to see what was needed to get this to build.

- vite to latest 3.x.x release
- rollup to latest 2.x.x release
- updates pnpm-lock.yaml version to 5.4
- added "WebWorker" to "compilerOptions.lib" in tsconfig.json; not sure if needed but will not build without it because of type issues in dependencies
@Dan-Shields Dan-Shields self-assigned this Dec 4, 2022
@Dan-Shields Dan-Shields self-requested a review December 4, 2022 14:10
@Dan-Shields
Copy link
Member

Will review ASAP, thanks very much

@zoton2
Copy link
Contributor Author

zoton2 commented Jan 16, 2023

Vite v4 came out recently as well so will probably want to tweak this for that version. It also supports rollup v3 so we can bump that now as well.

@zoton2
Copy link
Contributor Author

zoton2 commented Jan 16, 2023

Just bumped all versions of dependencies up to the latest, including vite to 4.x.x and rollup to 3.x.x. No issues building, but have yet to test it with my template. The migration guide for vite v3 to v4 can be found here if it's needed for reference.

@zoton2 zoton2 changed the title Update Vite to v3 Update Vite to v4 Jan 16, 2023
@zoton2 zoton2 changed the title Update Vite to v4 Update Vite to v3/v4 Jan 16, 2023
@Dan-Shields
Copy link
Member

I can't see any issues with this from looking at the changes. I'll test it out tomorrow and merge if all is well.

I'd like to get #2 ironed out too before releasing a major version bump. Could also be good to do that before a RC.

@zoton2
Copy link
Contributor Author

zoton2 commented Jan 17, 2023

Just to update, I tested this myself on my template and it seems to build without issue.

@Dan-Shields
Copy link
Member

Added "WebWorker" to "compilerOptions.lib" in tsconfig.json

Appears to be a reproduction of vitejs/vite#9813. If that gets resolved we can remove this, it shouldn't be necessary from what I can tell.

@Dan-Shields
Copy link
Member

Can't see any issues with updating rollup. We only hook into writeBundle and buildStart and these haven't been changed.

Copy link
Member

@Dan-Shields Dan-Shields left a comment

Choose a reason for hiding this comment

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

Looks good to go. I'm going to merge into master and after I've tackled #2 and #3 this week I'll make a pre-release RC.

@Dan-Shields Dan-Shields marked this pull request as ready for review January 18, 2023 02:09
@Dan-Shields Dan-Shields merged commit ee8c91b into nodecg:master Jan 18, 2023
@zoton2 zoton2 deleted the vite-3 branch March 10, 2023 21:03
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.

None yet

2 participants