Neat. More useful for projects without unminified sources, like Google Analytics. Here's the output for ga.js: https://gist.github.com/yahelc/00299f2e4a3c07cafa1a
Show HN: Beautify-with-words unminifies JS with unique words for variable names
21–30 of 35 posts
Re: Show HN: Beautify-with-words unminifies JS with unique words for variable names
#22Often with AngularJS, after minification, you find you've not properly injected a service or something and looking for a missing 'a' is near impossible. This would be really useful to hunting that down. Would make a great post-min debug Grunt module.
Re: Show HN: Beautify-with-words unminifies JS with unique words for variable names
#23Often with AngularJS, after minification, you find you've not properly injected a service or something and looking for a missing 'a' is near impossible. This would be really useful to hunting that down. Would make a great post-min debug Grunt module.
Re: Show HN: Beautify-with-words unminifies JS with unique words for variable names
#24Often with AngularJS, after minification, you find you've not properly injected a service or something and looking for a missing 'a' is near impossible. This would be really useful to hunting that down. Would make a great post-min debug Grunt module.
You might find ngmin[1] helpful for that. Then you can use the shorter injection syntax and have it expanded via a compilation step. Since you mentioned Grunt, you'd probably want to just use grunt-ngmin[2]. [1] https://github.com/btford/ngmin [2] https://github.com/btford/grunt-ngmin
Re: Show HN: Beautify-with-words unminifies JS with unique words for variable names
#25Re: Show HN: Beautify-with-words unminifies JS with unique words for variable names
#26Re: Show HN: Beautify-with-words unminifies JS with unique words for variable names
#27While it's a good idea, I feel like it should rename with real words, or not rename at all. From the example: function(bedad, latay, vublu) { if (!adag(this, "on", bedad, [ latay, vublu ]) || !latay) return this; this._events || (this._events = {}); var cyem = this._events[bedad] || (this._events[bedad] = []); bedad, latay and vublu don't make it much easier to remember which variable is which than just using a,b,c
Re: Show HN: Beautify-with-words unminifies JS with unique words for variable names
#28Very cool. Nice work. I think it would be even cooler as a Firefox extension -- open up a .min.js file in one tab, hit your button, and get a new tab with the beautified js. I don't know anything about FF extensions, but since this is written in JS in the first place, it seems doable. (Or alternatively, it would also be cool as a standalone site, just paste the URL or uglified JavaScript in a box, and get the pretty…
Edit: If you want to use your own bookmarklet, feel free to start off with this: void(open("http://beautifywithwords.com?url=" + location,'_self',''))
Edit2: http://jsbeautifier.org/ has some similarities to this (and integrates with various browsers, editors, etc.) but I don't think it replaces variable names. Perhaps it would make sense to integrate your code into it as an extra feature?
Re: Show HN: Beautify-with-words unminifies JS with unique words for variable names
#29While it's a good idea, I feel like it should rename with real words, or not rename at all. From the example: function(bedad, latay, vublu) { if (!adag(this, "on", bedad, [ latay, vublu ]) || !latay) return this; this._events || (this._events = {}); var cyem = this._events[bedad] || (this._events[bedad] = []); bedad, latay and vublu don't make it much easier to remember which variable is which than just using a,b,c
I forked the original to address this [1]. Here's a sample: var strategy = moduleInterfaceFactory.Events = { on: function(strategyFacade, strategyFactoryDecorator, interfaceFacade) { if (!flyweight(this, "on", strategyFacade, [ strategyFactoryDecorator, interfaceFacade ]) || !strategyFactoryDecorator) return this; this._events || (this._events = {}); var strategyPattern = this._events[strategyFacade] || (this._events…
Re: Show HN: Beautify-with-words unminifies JS with unique words for variable names
#30While it's a good idea, I feel like it should rename with real words, or not rename at all. From the example: function(bedad, latay, vublu) { if (!adag(this, "on", bedad, [ latay, vublu ]) || !latay) return this; this._events || (this._events = {}); var cyem = this._events[bedad] || (this._events[bedad] = []); bedad, latay and vublu don't make it much easier to remember which variable is which than just using a,b,c
It is a lot easier once you've figured out what a particular variable stands for to do a global search and replace for "vublu" than "a".