Git Product home page Git Product logo

Comments (7)

yusukebe avatar yusukebe commented on June 14, 2024 2

Hi @alessandrojcm

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.

alessandrojcm avatar alessandrojcm commented on June 14, 2024

Hi @alessandrojcm

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.

yusukebe avatar yusukebe commented on June 14, 2024

Hi @alessandrojcm

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.

alessandrojcm avatar alessandrojcm commented on June 14, 2024

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.

yusukebe avatar yusukebe commented on June 14, 2024

@alessandrojcm

Thanks! This is experimental, but it is worth it for us to challenge it.

from vite-plugins.

alessandrojcm avatar alessandrojcm commented on June 14, 2024

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.

yusukebe avatar yusukebe commented on June 14, 2024

Hi @alessandrojcm

Yes. Can you create a PR?

from vite-plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.