-
Notifications
You must be signed in to change notification settings - Fork 304
Workflow
When building something you should be able to see the product as you work. The basic process while working with components is:
- Make changes
- Compile/build
- Refresh your browser
All you should be doing though is switching between your text editor and your browser. Discussing how to achieve this while working with components is the purpose of this page. Eventually it should contain information for people using each of the main development environments (i.e. mac, windows, linux) and the common tools used within them (i.e. text editors and browsers).
One way to automate the compile stage is with brute force. i.e. a continuous compilation cycle. visionmedia/watch is a good tool for that. The problem with this approach though is that its inefficient and if you place a delay between cycles, it can be slow to respond. Ideally then you would be responding to file changes. This can be done either by listening for file system events or text editor events. Since the next step which is refreshing the browser needs to be done with events the compilation step may as well event driven too.
This can't really be done the brute force way since having the page refresh while you are looking at it sucks. Its also fairly tricky since browser vendors don't really offer anything for the purpose. One approach is to connect your page to a local websocket which sends it messages when files change so it can respond by refreshing. This is the approach livereload takes but unfortunately it doesn't work properly on Linux.