Comments (7)
Now that Vite supports server-side HMR with its new runtime API, are there any plans to modify the plugin to work with this new API?
I know that! I'm planning to make Vite dev-server support the API in the near future.
If not, I would be happy to try implement it; thanks!
Sounds good! You'll be able to do it.
I was thinking a adapter
should include a runtime, for instance, you can use "worked" runtime if you choose Cloudflare adapter. This way makes sense.
https://github.com/honojs/vite-plugins/tree/main/packages/dev-server#adapter-1
from vite-plugins.
Now that Vite supports server-side HMR with its new runtime API, are there any plans to modify the plugin to work with this new API?
I know that! I'm planning to make Vite dev-server support the API in the near future.
If not, I would be happy to try implement it; thanks!
Sounds good! You'll be able to do it.
I was thinking a
adapter
should include a runtime, for instance, you can use "worked" runtime if you choose Cloudflare adapter. This way makes sense.https://github.com/honojs/vite-plugins/tree/main/packages/dev-server#adapter-1
Thanks @yusukebe I will try to give a shot. Just a bit of clarification, you mean the plugin should received an additional runtime parameter? Should the default be vite's runtime? Sorry I am not familiar with worked or Cloudflare in general.
from vite-plugins.
Just a bit of clarification, you mean the plugin should received an additional runtime parameter? Should the default be vite's runtime?
Ideally, it should use the "workerd" runtime if the Cloudflare adapter is used. However, it currently takes a lot of work to get the workerd runtime. You can refer to: https://github.com/sapphi-red/vite-envs/tree/main/packages/cloudflare-pages
Also, runtime providers should provide these runtimes, not what we users extract from them. For example, I believe Cloudflare will provide a runtime for Vite in the future.
So, for now, it is better to use the Vite "default" runtime than to rush into implementation.
In addition, the Runtime API will be renamed the Environment API in v6.0.0 or later and the API will be changed. We will need to follow this change.
https://deploy-preview-16471--vite-docs-main.netlify.app/guide/api-vite-environment.html
from vite-plugins.
Ideally, it should use the "workerd" runtime if the Cloudflare adapter is used. However, it currently takes a lot of work to get the workerd runtime. You can refer to: https://github.com/sapphi-red/vite-envs/tree/main/packages/cloudflare-pages
Also, runtime providers should provide these runtimes, not what we users extract from them. For example, I believe Cloudflare will provide a runtime for Vite in the future.
So, for now, it is better to use the Vite "default" runtime than to rush into implementation.
OK got it, will do that then thanks.
In addition, the Runtime API will be renamed the Environment API in v6.0.0 or later and the API will be changed. We will need to follow this change.
https://deploy-preview-16471--vite-docs-main.netlify.app/guide/api-vite-environment.html
Yes I am aware of this change :) will keep an eye on it.
from vite-plugins.
Thanks! This is experimental, but it is worth it for us to challenge it.
from vite-plugins.
So I cloned this on my local, and switched line 103 in dev-server.ts
from ssrLoadModule
to executeEntryPoint
from the Vite runtime and it worked, should I make a PR or am I missing something?
from vite-plugins.
Yes. Can you create a PR?
from vite-plugins.
Related Issues (20)
- What's the correct way to import css?
- Error running dev server HOT 2
- Cloudflare pages plugin prevents Vite's library mode from working HOT 6
- bug(dev-server): with multiple configuration methods, env is overwritten HOT 6
- Ignore `.wrangler` directory when watching
- [@hono/vite-dev-server] Hostname/IP does not match certificate's altnames: Host: localhost. is not in the cert's altnames: DNS:httpbin.org, DNS:*.httpbin.org HOT 5
- When using @hono/vite-dev-server in Cloudflare Workers development, there is a misjudgment in hono/adapter's env(). HOT 4
- [@hono/vite-dev-server] simple bun usage fails HOT 7
- [@hono/vite-cloudflare-pages] Serve static assets using `_routes.json` HOT 2
- Can't get devServer to work with Qwik & vite-cloudflare-pages
- Hono ViteDevServer takes 2s to serve index html HOT 5
- [@hono/vite-cloudflare-pages] Importing Node.js Modules Throw Runtime Errors HOT 1
- [@hono/vite-cloudflare-pages] Support to serve static files on root directory HOT 3
- Support caches api HOT 2
- Support wasm in cloudflare adapater HOT 1
- Vite dev server crashes if error is introduced in the Hono Server. HOT 2
- Support reading env from `wrangler.toml` in dev server HOT 1
- [@hono/vite-dev-server] add bun websocket support
- Add support to React Refresh HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite-plugins.