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

Bad build should trigger livereload #70

Open
Rich-Harris opened this issue May 7, 2015 · 5 comments
Open

Bad build should trigger livereload #70

Rich-Harris opened this issue May 7, 2015 · 5 comments

Comments

@Rich-Harris
Copy link
Contributor

The livereload signal is only sent when a build completes. I think it should also be sent if the build breaks, since otherwise the only indicator you get is a) the CLI output (which might not be visible on the screen, particularly if you're working on a laptop), or b) you notice that the page doesn't seem to be reloading any more.

A related question is whether the livereload signal should be sent as soon as the build invalidates. For: nice short feedback loop. Against: a complex build might take a while, and you don't get a chance to continue using the previous build, or take a mental snapshot of the app state (tangential thought: what would it take to support figwheel/steal/webpack-style hot module replacement?) while the rebuild is happening

@martypdx
Copy link

martypdx commented May 7, 2015

HMR is the way to go and that means breaking down the boundary between file system and browser. Create web sockets and send just updated contents into the browser. You can be notified of bad build AND keep working. We can stop the bundling insanity that kills cycle time.

@Rich-Harris
Copy link
Contributor Author

Totally agree. I haven't delved into it much so far, other than reading a few blog posts and watching a few shiny demos, but it's clearly the direction that things are moving in. Have you experimented with any of the implementations out there?

@martypdx
Copy link

martypdx commented May 7, 2015

Have you experimented with any of the implementations out there?

No, not yet. Web sockets in all modern environment (node and chrome) are dead easy though. Haven't kept up on the gobble architecture, would be cool if the nodes and transform model could just cross over the boundary and continue.

@Rich-Harris
Copy link
Contributor Author

Web sockets in all modern environment (node and chrome) are dead easy though

True - question is how does the client script get injected? Is it kosher to just append a <script src='magic-gobble-client.js'> to any HTML file that gets served?

Haven't kept up on the gobble architecture

it's a work in progress...

@martypdx
Copy link

martypdx commented May 7, 2015

True - question is how does the client script get injected? Is it kosher to just append a <script src='magic-gobble-client.js'> to any HTML file that gets served?

If someone has a build system they can easily conditionally include it themselves. But throwing it in automagically might be fine too. There's probably some configurable hooks, or the build system doesn't go the full mile, because given the type of file you'd want to do different things. A css file can be mapped to a style tag and swapped, but a js file may, or may not, require a "reload". A ractive component could be hot-loaded (assuming we had the api for that), etc.

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

2 participants