The usual CLJS tools do not support this but shadow-cljs [1] does.

Closure has a variable and property map feature that will save the names it 
used on one compile which can then be imported on the next compile. 
shadow-cljs does this automatically and as long as you don't remove the map 
files the naming will be stable. Sometimes due to code motion the hash of 
the file overall changes but that should only happen if you make bigger 
changes. I have been using this for a while and caching is definitely 
improved by this.

There is a very old blog post [2] that talks about this feature. See "Short 
Names Aren't Necessarily Better".

[1] https://github.com/thheller/shadow-cljs
[2] 
http://closuretools.blogspot.de/2011/01/property-by-any-other-name-part-3.html

On Thursday, September 21, 2017 at 6:22:38 PM UTC+2, Scott Klarenbach wrote:
>
> I was hoping that by splitting my code into modules I could emulate npm's 
> vendor.js behavior - where massive dependencies like React and Material UI 
> go into a separate file and app.js goes into it's own file.  This doesn't 
> help initial load but greatly helps subsequent loads since vendor.js is 
> cached by the browser and I can update my app without resending the 
> unchanged majority of the code.
>
> So, I put my "vendor" code into one module and my app code into another. 
>  It does split it correctly, with 90% of the code ending up in one big 
> vendor.js file and my app in another.  But the problem is, everytime I 
> rebuild, the closure compiler chooses new short names for the vendor.js 
> file and so it can't be cached and makes the approach useless.
>
> Is there anyway to use advanced mode and have the closure compiler use the 
> same shortened names each time?  The vendor js file doesn't change much 
> from build to build except a few variable names are always different.
>
> Thanks.
>

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.

Reply via email to