Interface ChunkAware
-
- All Known Implementing Classes:
CssCustomFunctionNode,CssCustomFunctionNode.CssCustomFunctionNodeProxy,CssDefinitionNode,CssFontFaceNode,CssFunctionNode,CssKeyframesNode,CssKeyNode,CssMediaRuleNode,CssProvideNode,CssRequireNode,CssSelectorNode
public interface ChunkAwareInterface to annotate CSS nodes with target CSS chunk id.Compiled CSS can be split into multiple parts to serve them separately, improving page load and browser's CSS parsing time. These parts are called chunks. Usually source code of a CSS chunk is a small group of CSS/GSS files.
Because of inter-chunk dependencies (constant definitions and their references, and rules order) chunks are parsed and processed as a single file. On top of that, CSS size optimizations mix CSS rules coming from many chunks. The
ChunkAwareinterface is used to preserve the chunk information during all those operations. Chunk information attached to a CSS node is used to print the optimized CSS AST into separate chunks. It can also be used to preserve CSS correctness while performing optimizations.The chunk id is represented as a general
Objectso that the user can choose a representation that it convenient for their task. In particular, tests simply useStringas chunk ids. The type of the chunk ids cannot be parameterized because of the strange inheritance hierarchy of the CSS AST. Chunks are identified usingObject.equals(java.lang.Object).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.ObjectgetChunk()Gets the chunk id of the node.voidsetChunk(java.lang.Object chunk)Sets the chunk id on the node.
-