-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
refactor: move framework plugins out of core #11158
Conversation
The new repositories are now being tested as part of vite-ecosystem-ci: |
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
I'll PR tomorrow a fix for vite-ecosystem-ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks good to me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎈
We discussed with @domininkg and @sapphi-red, and decided that we should remove the now duplicated Vue Rnd react playgrounds from core directly in this PR because testing works better if they are run in their own repository. We may want to port some tests from there to other playgrounds as we discover they are useful outside of the context of the framework. I removed the ones that were duplicated from the PR, but there are some other playgrounds that use the plugins (and I haven't moved these):
These aren't specifically testing the framework is using, it is just for historic reasons or because it was more comfortable to use a framework to implement the playground. With time, we should rewrite them, but we could still go forward with the PR with them as is. CI is down from 8min to 6min after removing these. For reference, the problem is that if there is an API change in Vite 5 that requires a release for these plugins, then we have to be doing a lot of paperwork just to keep the playgrounds functional (and even accept some failing PRs to accomplish it) |
Description
Benefits of Framework plugins being out of Core
Foster ownership of the plugin from folks out of the Core team
The framework plugins in the core monorepo doesn't help to encourage collaborators to move from one-off contributions and bug fixes to take responsibility for the long-term future of the plugins (especially in the case of plugin-react since there are several Vue core team members to look for plugin-vue). Some problems:
Independents repository under the @vitejs org would solve these issues
Reduce CI time, avoid building and fully-testing plugin-react for each PR/commit
With vite-ecosystem-ci available, we can include
@vitejs/plugin-react
CI and run it on demand when needed and before each release.We also avoid downloading deps and re-building pluing-react in vite-ecosystem-ci when we aren't testing React (right now we need to do this when testing every other CI).
This becomes more important now that we have two React plugins (one based on esbuild+babel, and the other one on esbuild+SWC).
Double down Vite's framework agnostic story
When Vite's API was still in flux and vite-ecosystem-ci wasn't there, I think it was justified to have Plugin React and Plugin Vue in core. Right now, IMO it is the other way around. It is unfair for framework plugins out of core and pushes us to take shortcuts that we may not do if the repos were separated.
Untangle the plugin release cycle from Vite core
@vitejs/plugin-react
and other plugins could have an independent release cycle. We would avoid releasing the plugin when it is using not yet released APIs from Vite core, something that is hard to test if the plugin is in core. We broke plugin-react a few times in the past year due to this.Moving forward
We decided we should move plugin-react, plugin-vue, and plugin-vue-jsx as independent repositories under the vitejs org as part of Vite 4.
Other Plugins
I think plugin-legacy should remain in core. An unrelated proposal would be to move create-vite out of core too. We already discussed this with @bluwy, in the context of https://github.com/bluwy/create-vite-extra. The PRs to the templates and discussions around what framework to include would also be better off out of the core monorepo IMO. But we can discuss this for Vite 5.
Repositories
Core
Vue
https://github.com/vitejs/vite-plugin-vue
https://github.com/vitejs/vite-plugin-vue2
React
https://github.com/vitejs/vite-plugin-react
https://github.com/vitejs/vite-plugin-react-swc
Testing infra
For now, all the Vue and React tests are duplicated in core and in the new repositories. There are Vite features we are testing in some of these. Ideally we should extract some of these, we may not need to test for core as much of Vue and React as we do now.
The extracted plugins will be added to vite-ecosystem-ci to be tested as part of the ecosystem CI infra as we already do with all other frameworks.
What is the purpose of this pull request?