RC-Paves3-build / plovr

Automatically exported from code.google.com/p/plovr
0 stars 0 forks source link

Option to output the variable renaming map #42

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This is more a feature request.

I have a script which I compile with plovr that retrieves data from the server, 
in order to produce output that the script understands the server needs to know 
the variable renaming map that was produced when compiling the script.

When using Google Closure Compiler directly, I can output this map. 

Would you accept a patch which exposes this option via configuration?

Original issue reported on code.google.com by johannes...@gmail.com on 22 Jun 2011 at 5:31

GoogleCodeExporter commented 8 years ago
Hi, I would accept a patch for this, though do you need it in addition to the 
source map?

Also, are you also using the source map right now? I found that the source map 
was expensive to calculate, so I ended up making it a command line flag so that 
it was easier to do conditionally:

http://code.google.com/p/plovr/source/browse/src/org/plovr/cli/BuildCommandOptio
ns.java

If the variable map is also expensive to calculate, then perhaps it should be a 
command-line flag as well?

Though on the other hand, now that I introduced "config inheritance" 
(http://groups.google.com/group/plovr/browse_thread/thread/56c7965e3d3628fd) 
perhaps it is just as easy to make it a config option, and then use config 
inheritance to create a special config that produces it, if necessary.

What do you think?

Original comment by bolinf...@gmail.com on 22 Jun 2011 at 5:57

GoogleCodeExporter commented 8 years ago
I have tried the source map, but I haven't found the information in there. My 
understanding is that you only need the source map if you want to use the 
Google Closure Inspector (which I don't).

Right now, I have a pre-processing step of the configuration which resolves 
some paths, and replaces some place holders with application specific data 
(https://github.com/schmittjoh/GoogleClosureBundle/blob/master/Resources/doc/ind
ex.rst). So, to me it doesn't really matter where we locate it in plovr source: 
I would locate it in my configuration and then simply convert it to a command 
line flag if necessary.

I haven't really looked at the plovr source yet, but is it easier to make the 
option available for the "build" and the "serve" command if it is located in 
the configuration?

Original comment by johannes...@gmail.com on 22 Jun 2011 at 6:41

GoogleCodeExporter commented 8 years ago
I've created a patch to add support for the build command, see
https://gist.github.com/cd04a9360c6cb285993f

Let me know what you think. 

Adding support to the serve command seems a bit more tricky, do you have any 
pointers for that, or do you think it's not such a good idea?

Original comment by johannes...@gmail.com on 22 Jun 2011 at 7:36

GoogleCodeExporter commented 8 years ago
PLEASE PLEASE PLEASE get this added to plovr...  I'm using it with .NET MVC but 
can't get templates to use my JSON.  With a property map I could write a class 
to modify the JSON I return to have the shortened names.  In regular javascript 
I can use the string name (although it is awkward), but I can't figure out how 
to do that in templates (i.e. {$opt_data['Name']} doesn't work)

Original comment by jason.go...@gmail.com on 4 Jul 2011 at 8:10

GoogleCodeExporter commented 8 years ago
I've now also added support to the "serve" command. The full changeset is here:
https://github.com/schmittjoh/plovr/commit/920fdf53889ab6132878bbaa7d657e980e5f6
e33

I haven't worked much with hg, so I don't know how to best submit a patch, but 
maybe you can somehow import this:
https://github.com/schmittjoh/plovr/commit/920fdf53889ab6132878bbaa7d657e980e5f6
e33.patch

Let me know if I need to change anything to get this included. You can also 
comment directly in the code I linked above.

Cheers,
Johannes

Original comment by johannes...@gmail.com on 9 Jul 2011 at 11:12

GoogleCodeExporter commented 8 years ago
Fixed in 
http://code.google.com/p/plovr/source/detail?r=ef5105ad3c7723078ecbbce56f46ed34b
808c3c1

Original comment by bolinf...@gmail.com on 21 Sep 2011 at 2:24