tonistiigi / styler

CSS/Stylus live editor
MIT License
133 stars 9 forks source link

Support for other languages #10

Open tonistiigi opened 12 years ago

tonistiigi commented 12 years ago

So this has been asked a lot so I'm going to list it here for open discussion.

Question is whether Styler should allow you to open any type of file(JS, PHP, HTML etc) or not.

I'm not willing to do any JS hot swapping unless I get a really great idea about it. Just replacing Javascript functions would only screw up your state and make your app work differently from what it does on production. I also don't want to make any static syntax analyzing or fun things like that for these languages.

What I'm kind of ok is that you could open up these files, use all the features built in Ace and save them to disk. Also you could define some rules that make the whole preview page refresh on some file change(if you also need to restart the server then this should be out of Styler's scope).

There could aslo be a opt-in API for the hot swapping(instead of refresh) if users own architecture supports it. For example there may be even common cases for it when you use socketstream or some purely functional language(fay).