grunt-dom-munger icon indicating copy to clipboard operation
grunt-dom-munger copied to clipboard

Any thoughts on reordering the options so that remove/update is performed last?

Open ProLoser opened this issue 10 years ago • 2 comments

This way people can use DOM that will eventually be removed as a selector BEFORE it's gone.

ProLoser avatar Feb 18 '14 23:02 ProLoser

After I merged your PR, I did change the order a bit. Reads are always first, then removes, then all other modification actions. I did it this way so a typical concat/minify step could be done with one dom_munger task. So you do the read to get the scripts, then you remove those script tags, then you add the final one with the concat-ed minified script.

I was also considering some way to declare a desired order (for example, an order number that could be placed on each action but that seems a little in-elegant).

The latest 3.4 release is where I made the changes. If you have that and still need a different order than [read, remove, everything else], please let me know your use case. With the array feature you added, its really nice to get all dom_munger operations down into one task.

cgross avatar Feb 19 '14 14:02 cgross

I REALLY feel that remove should be absolutely last. This way, I can read it, and then do an after/before on it, and then finally remove it.

ProLoser avatar Feb 20 '14 00:02 ProLoser