Vite 6 Experimental Environment API - Meteor opportunity?

Howdy all,

I saw Vite 6 has been released recently: Vite 6.0 is out! | Vite

Interestingly they are working on an experimental environment API which sounds useful for frameworks like Meteor. It seems like the idea is to make Vite work more easily on different environments, e.g. browser, Node, Deno, etc. Which, well, is basically what Meteor needs to achieve too.

Vite is getting more flexible with the new Environment API. These new APIs will allow framework authors to offer a dev experience closer to production and for the Ecosystem to share new building blocks. Nothing changes if you’re building a SPA; when you use Vite with a single client environment, everything works as before. And even for custom SSR apps, Vite 6 is backward compatible. The primary target audience for Environment API is framework authors.

They provide links to two resources, an introduction to the Environment API:

… and more formal docs:

With this fancy diagram:

I’m not sure how helpful that is, but it does seem aligned with Meteor’s goals, so best case this is something contributors can use, worst case I’m just adding noise and missing some key issues :upside_down_face:

2 Likes

Have you checked GitHub - JorgenVatle/meteor-vite: ⚡ Replace Meteor's bundler with Vite for blazing fast build-times.

Its already using vite v6. Check it out.

This is an example of meteor app with Vite 6.

Already tested in production env (with Disney meteor-base docker image).

  • Meteor 3.0.4
  • Vue 3
  • Vuetify 3
  • Vite 6
1 Like

Oh, I’ve made a proof of concept for a Meteor 3 upgrade strategy for our app using this package, but that was back when you had to use an older version of Vite. Nice to see it supports the server now, since SSR was something I was interested in pursuing further. Thanks for pointing out the support!

1 Like