Is there a way to have Hype NOT minify the *_hype_generated_script.js? I am trying to integrate my Hype animation into Angular and I’m thinking about putting the script in a directive, but it would be easier if it wasn’t minified.
@Photics I would expect there to be some 3rd party libraries inside their library. They can still provide un-minified library (with 3rd party libraries still minified).
This would help people understand exactly what is going on with their animations and possibly help with support - if we could see the code, maybe we could help solve problems or make better suggestions. Better yet - you should open source the library. I would contribute in a heartbeat! Granted, you would still have full control over what gets merged.
Think about it.
Did you read the thread? There’s a great behind-the-scenes look into Hype – how they handled at least one third-party library and how to view the un-minified code.
There is a way, but it probably isn’t quite what you want . The *_hypegenerated_script.js file is pretty minimal and only includes code for loading in the Hype Runtime along with JSON data which represents the document contents/scenes/animations/etc. The JSON data is just about as impenetrable as minified code. Also, it is really only partially non-minified; there are several steps we do to reduce code size even before running it through a minifier at build time for Hype.
If you want to look at the * _hypegenerated_script.js before your data has been added to it, you can do it via control-clicking on the Hype application and choosing Show Package Contents and navigating to Hype2.app/Contents/Resources/DocumentLoader_Template.js. In that folder is also HYPE.thin.js and HYPE.full.js (which don’t change based on data).
The final way is completely unsupported and totally not recommended, but you can run this command in the Terminal:
defaults write com.tumult.Hype2 UseFullHypeJSTemplate -bool YES
When outputting, it will use unminified versions. We use this internally for debugging. Do not use it for any production documents (re-run the command with a NO in place of a YES to change it back).
As @photics mentioned the other thread talks about this a bit, but we basically don’t use third party libraries, minus a snippet of code here and there. Even Matter.js that we use for Physics isn’t wholesale and modified a bit to fit within Hype and to remove parts that aren’t necessary.
So I’m not ruling it out - there are tons of benefits… but that’s why we haven’t thus far (and don’t have specific plans to do this in the future). Yet all feedback counts and it is good to know this is wanted!