Closed yoshuawuyts closed 7 years ago
Hmm, I don't like the API - if we're going to move towards an app.use()
API to sugercoat plugins then this wouldn't work. We'd need the state
value to sit next to the other hooks. API for HMR could then become:
const hmr = require('choo-hmr')
const choo = require('choo')
const app = choo()
app.use(hmr())
const tree = app.start()
document.body.appendChild(tree)
Actually even better would be if there was an initialStateWrap()
function - means we can trim bytes in production and move the logic to HMR :sparkles:
hmr repo: https://github.com/yoshuawuyts/hot-app-replacement/tree/choo/
edit: probs wanna implement that over SSE
or something hey
Spring cleaning time 🕥 - PR has been inactive for a while, closing!
Should add HMR capabilities to
barracks
/choo
- kinda experimental still tho butttt yeah putting it out there https://twitter.com/yoshuawuyts/status/751458983848845312