Open shakyShane opened 9 years ago
I have another point to bring into the discussion: Is this tool supposed to work with single page apps using frameworks like Angular, React, etc? Is this even viable? Let's consider:
With Angular we'll have to somehow force recompilation of directives. It shouldn't be that hard:
// 1. Get all instances of old template in live HTML
var instances = getTheContainerElementsFor(changedHTML);
// 2. Get the $compile service from the current app:
var $compile = angular.element('.ng-scope').injector().get('$compile');
// 3. Replace all instances with new HTML and compile with original scopes
instances.forEach((instance) => {
var element = angular.element(instance);
var scope = element.scope();
$compile(element.replaceWith(changedHTML))(scope);
});
// 4. Wrap up with refreshing the whole up:
$scope.$apply();
@shakyShane ?
Wow! if it's really that easy to hot-update angular directives I'd certainly be happy to support this. Would be pretty easy too, although I'm thinking it would be a separate BS plugin.
Any plans to continue development?
This is a todo-list for tracking what I consider to be deal-breakers stopping me promoting & classifying this plugin as production ready.
h1
changes toBlog post
then the id can also change to become<h1 id="blog-post">Blog post</h1>
. Solution - Allow multiple tasks to be executed per changed node.notify()
method to give useful info + allow it to be switched off.