Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] live js and css reloading using server sent events #31

Closed
yoshuawuyts opened this issue Jun 30, 2016 · 7 comments
Closed

[feature] live js and css reloading using server sent events #31

yoshuawuyts opened this issue Jun 30, 2016 · 7 comments

Comments

@yoshuawuyts
Copy link
Member

should wrap this https://github.com/chinedufn/hot-app-replacement by @chinedufn

@marionebl
Copy link
Contributor

marionebl commented Aug 31, 2016

Appears to compete with #34, #1.
Some history and discussion about HMR approaches in #45 (browerify-hmr vs custom SSE)

In order to implement this there are changes that need to be landed and released:


Example of choo entry point with HMR enabled:

const html = require('choo/html')
const hmr = require('choo-hmr')
const choo = require('choo')

const app = choo()
app.use(hmr())

app.router([ '/', () => html`<div>hello world</div>`])

const tree = app.start()
document.body.appendChild(tree)

This was referenced Nov 6, 2016
@yoshuawuyts yoshuawuyts changed the title HMR [feature] live js and css reloading using server sent events Nov 6, 2016
@yoshuawuyts
Copy link
Member Author

related choo issue choojs/choo#295

@yoshuawuyts
Copy link
Member Author

@mattdesl
Copy link
Collaborator

You might be interested in following some of the recent LiveReload changes in budo:
mattdesl/budo#194

For example, you can use this in the client to force a style sheet to reload smoothly across all modern browsers:
https://www.npmjs.com/package/reload-css

I chose to go with WebSockets for budo just because they are supported in Edge/IE. I'd be curious to know if SSE has some advantage for live reload purposes, though.

fczuardi added a commit to 20kbudget/road that referenced this issue Mar 4, 2017
@yoshuawuyts
Copy link
Member Author

done!

@laduke
Copy link
Contributor

laduke commented Apr 29, 2017

how do you turn it on?

@mikker
Copy link

mikker commented Apr 29, 2017

@laduke With https://github.com/yoshuawuyts/choo-reload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants