Overview of ANode Compression (APack)
masterANode compression, known as APack, is designed to reduce the size of compiled template JSON objects (ANodes) for faster network transmission and improved initial loading performance.
Design Principles:
- Uses a one-dimensional JS Array as the compressed structure to allow single-pass decompression.
- Uses a
{number}headidentifier to denote node types, allowing the removal of all property names from the object. - Uses
undefinedto represent empty values (arrays, objects, etc.) to minimize size. - For arrays, the first element is the length, followed by the items.
- Boolean
trueis represented as1, whilefalseis represented asundefined(resulting in an empty compressed array).