Skip to content

Commit 5fa1dfb

Browse files
authored
Update parse-time-evaluation.md
1 parent f1bcdde commit 5fa1dfb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/parse-time-evaluation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Copyright (c) 2019-2024 [Sempare Limited](http://www.sempare.ltd)
44

55
## Parse Time Evaluation
66

7+
Parse time evaluation is different to normal template evaluation, as it allows for 'constant-like' variables to be substituted, and in some cases, expressions can be evalutated and some statements (if statements where the condition can be evaluated) can result in some template code being eliminated. It is a light weight pre-evaluation step in the template, which means the resulting template AST can be smaller.
8+
79
Parse time evaluation is done by enabling the options eoEvalEarly and eoEvalVarsEarly in the _context_ options.
810

911
The requirement for parse time evaluation is that variables must be defined within the context. This is useful when you know certain information is _static_ and is unlikely to change.

0 commit comments

Comments
 (0)