jcoglan / packr Goto Github PK
View Code? Open in Web Editor NEWRuby version of Dean Edwards' Packer
Ruby version of Dean Edwards' Packer
In Chrome 46.0.2490.86 / Firefox 42, the minimized code with base62 encode does not work.
when executing the generated source, it shows "Uncaught TypeError: Cannot set property length of # which has only a getter"
document.getElementsByTagName('script')
returns Array Like object depending on the kinds of browser. Then I suppose to replace from
document.getElementsByTagName('script')
to
Array.apply(null,document.getElementsByTagName('script'))
I just thought I'd document this issue here, but I recently upgraded to ruby 1.8.7 (2012-02-08 MBARI 8/0x6770 on patchlevel 358) [i686-darwin12.2.1], MBARI 0x6770, Ruby Enterprise Edition 2012.02
With the new version packr intermittently strips all spaces from javascript code (but not in strings). For example expected compressed output:
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={}} ...
actual output:
if(typeofYAHOO=="undefined"||!YAHOO){varYAHOO={}} ...
This behaviour only occurs intermittently for certain runs of the ruby runtime. If the bug is happening, then all usages of Packr.pack will exhibit the behaviour while ruby is running. For another run of ruby, the bug doesn't happen at all.
I believe the problem lies with packr being dependant on hash ordering somewhere. Versions of ruby > 1.8.7 p352 return random hash orderings as per this security fix.
Unfortunately this bug took me a long time to track down because I didn't initially realise it was related to a ruby upgrade which had happened a long time previously.
Anyway, I suggest this at least be documented somewhere and preferably fixed, though I realise 1.0.2 is very old now. Not sure if the problem manifests in newer versions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.