Giter Site home page Giter Site logo

Comments (9)

glenjamin avatar glenjamin commented on May 2, 2024

I've generally found them to be simple & stable, work on modern browsers, and be a very lightweight dependency.

If it's causing issues I'm not averse to switching to websockets.

from webpack-hot-middleware.

 avatar commented on May 2, 2024

I'm trying to implement this middleware without the need for a node server. Specifically in Go, which doesn't have an adequate implementation of EventSource. Presumably because it's hardly used and the docs are nonexistent. It would be nice if it used websockets.

from webpack-hot-middleware.

glenjamin avatar glenjamin commented on May 2, 2024

This lib has its own hand rolled event-stream implementation - it's very straightforward. Slim over the source - feel free to ask any questions.

The spec itself I found quite clear - the main reason I think libs aren't very good is that it's very simple to do without.

Are you re-implementing webpack in go?

from webpack-hot-middleware.

 avatar commented on May 2, 2024

That's true, infact it's not so much of a problem with Go itself and lack of libraries, as I've managed to get it working for the most part. The weird thing for me has been chrome acting differently than firefox. For example Chrome will detect onopen on connection/headers, however firefox does not, until I send a "building" event. It may be a problem with my implementation but I have been able to recreate the problem sporadically with the default node implementation.

And no, not webpack itself but I would like to serve reloads from my backend rather than through a middleware/webpack. Ie. Push compile events from webpack to my backend and to the client, thus not needing CORS or any fancy middleware stacks.

from webpack-hot-middleware.

glenjamin avatar glenjamin commented on May 2, 2024

Going to close this, as there isn't really an action for me to take.

Feel free to ask more questions if you're still having trouble with the port.

from webpack-hot-middleware.

 avatar commented on May 2, 2024

Fwiw I ended up not implementing it in the way I initially planned. It's definitely better having the HMR decoupled from the backend. I was just being silly. Though I still think websockets would be a better choice :)

from webpack-hot-middleware.

kesne avatar kesne commented on May 2, 2024

I'm having issues with SSE behind a proxy. I run my node app in a local VM behind a proxy, and for some reason it doesn't proxy the SSE requests.

Are you still not averse to switching to websockets? I realize that the issues are related to my use case and really likely to be encountered by others.

from webpack-hot-middleware.

glenjamin avatar glenjamin commented on May 2, 2024

I'm still open to the idea, but if SSE is getting chewed up by the proxy, I'm not sure why websockets wouldn't.

from webpack-hot-middleware.

kesne avatar kesne commented on May 2, 2024

I'm not 100% that it wouldn't as well. This issue seems tangentially related to the issue that I've been having: http-party/node-http-proxy#921

I'll spend this weekend playing with a fork to see if websockets also get killed.

from webpack-hot-middleware.

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.