I was able to figure out how to get instant front-end code reloads for Blaze (both the HTML & JS files); this trick could work with more than just Blaze, but so far I’ve only spent time getting it to work in Blaze. Check out a demo video below:
Mike Lublin will be presenting this feature, and many other cool Meteor related things we do at Qualia (http://qualia.com), at the next Meteor Night on February 23rd. Also, here is a shameless plug for our jobs page; we are hiring lots of engineers
I’m not quite ready to release this as a package, but I’d figure it’d be good to put a demo video out there. No promises, but we will try to release a package at the same time as Mike’s Meteor Talk.
Yep! It instant reloads. It’s even faster when I’m not video recording. I have some plans to make it re-render pretty much as fast as you can type. Also, it’s smart enough to not push anything when the template or code is malformed.
Doing the good work
Even if you can’t make a package directly, could you please put up a gist or something if you can? Interested in playing around with this. Would save us a bunch of time atm while refactoring.
What’s the chance of this working with the rest of a code base by the time you release it? I would personally pay for something like this, and others probably would too.
Right now there are a few things that are slightly coupled with our codebase but I think they are not too difficult to factor out. I’m going to work on getting this package ready for public consumption tomorrow (and perhaps some of our other internal packages, we have some realllllyyyyyyy useful internal stuff). The weirdest things about how this works are:
(a) It requires an editor plugin; right now we only have plugins for Emacs/Spacemacs & Sublime Text. Very easy to add support for new editors though.
(b) It works best if each template is in it’s own JS/HTML file. If there are multiple templates in a file it’d require additional work (however, I’d guess it’s probably not too hard to get it working).
I’m loving the idea of this package… I was blown away when I saw live CSS push and imagine this would even more exciting.
However, I think it may be a bit too “clever” with the Sublime Text integration. I think it would be a much cleaner solution if it worked on file save. After all, the file save is when we say, “okay, this is ready.”
I think it would be sufficient if, whenever a <template> or Template-related code was updated, it would skip the rebuild and just send a patch. Then, all other changes would trigger a rebuild.
On a side note, would be cool if text editors could tell us that there is an error with our templating before we find out in the browser window
I also think that’d be really convenient! Unfortunately (1) it’s hard to control the Meteor build system like that (2) you can’t do as-you-type reloads without an editor plugin
Alright… I’ve published a beta version of the reload package! I hacked it together pretty quickly today, so the code is ugly and it might break. That said: https://atmospherejs.com/qualia/reval
I updated the package to support relative paths now (good catch, it’s much easier on the eyes).
I also added some super simple Sublime & Spacemacs plugins to the Github repo. I left the as-you-type reloading out of the plugins because it complicates them significantly.