Consider integrationing with Vite instead of custom dev server #1933
Replies: 2 comments 1 reply
-
@web/dev-server (WDS) and it's predecessor es-dev-server actually existed before vite, when everyone was still using webpack dev server, and I think it inspired some of the technical foundations of vite when the project started. At least some things looked very familiar at the time :) I do see a major difference between vite and WDS in both the philosophy and implementation. vite implements/promotes using non-standard coding patterns to benefit DX while WDS sticks purely to web standards while sometimes sacrificing DX until standard patterns emerge. For open-wc / modern-web it's important that the code you write can run in a modern browser without requiring processing by a build tool. That being said it's true that vite has risen to a prominent position and pushing modern frontend development further. Supporting it with web test runner will be beneficial for many projects. Because of the reasons above, we should keep WDS as the default server for WTR. But we should be able to support using vite as a plugin. I've suggested in the past also to the maintainers of vite. We already have something similar for snowpack: https://github.com/withastro/snowpack/tree/main/plugins/web-test-runner-plugin that can be a good starting point. We might need to make some more changes in test runner core, we are open to that if anyone is willing to look into it. |
Beta Was this translation helpful? Give feedback.
-
@ScottAwesome I took a stab at creating a tiny WTR plugin to support Vite: web-test-runner-vite-plugin Let me know what you think 😄 |
Beta Was this translation helpful? Give feedback.
-
First and foremost I want to say this is an amazing project, and I like how it initially started out.
However, I think its safe to say that vite has very clearly taken the lead in the next gen web development platforms.
@web/dev-server
has 20,067 weekly downloads, as opposed to vite's 585,897.I think its clear that
vite
is leading the way here, and I don't see any major differences betweenvite
and@web/dev-server
that couldn't be solved via plugins (whichvite
supports fully via a rollup like interface).I believe switching to
vite
would lead to a wider adoption of other projects under the@web
namespace, most notably@web/test-runner
, not to mention efforts for improving developer experience could be shared in one underlying project, and could share in the broader and ever growingvite
ecosystem. I thinkvite
has been around long enough that its established front running is very unlikely to be upended any time soon.Not to mention,
vite
solves the issue that none of the current projects under the@web
banner solve the issue of building your projects, you have to run a separate rollup pipeline for that. That means there would be gains in functionality as well, without major additional efforts.I think it would really lead to an explosion of growth and adoption for other
@web
projects (including rocket) if it was able to tap into the energy of thevite
community and its ecosystem.Beta Was this translation helpful? Give feedback.
All reactions