Release v0.7.0#53
Merged
Merged
Conversation
Member
|
What a huge release! Fantastic effort, thank you. |
kailan
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release v0.7.0
Complete rewrite of the ESI parser from XML-based to nom-based parsing with full streaming support, comprehensive expression evaluation, and a rich function library.
Based on #43 and subsequent improvements.
Breaking Changes
quick-xmltonom— public API changed fromReader/Writer/parse_tagstoprocess_streamwithBufReader|req, _maxwait|)fastlydependency bumped to^0.121.95.0New Features
New ESI Tags
<esi:eval>— fetches content and always parses it as ESI (blocking operation), withdcasupport for two-phase processing<esi:param>— nested inside include/eval for query parameter injection<esi:foreach>/<esi:break>— iteration over lists and dicts<esi:function>/<esi:return>— user-defined functions with recursion depth control<esi:text>— raw passthrough (content emitted verbatim, no ESI processing)Expression Engine
['a', 'b', 'c']) and dictionary literals ({'key1': 'val1', 'key2': 'val2'})['one', 2, ['nested']])[1..10])$(VAR{$(dynamic_key)})has,has_i,matches,matches_i,+,-,*,/,%3 == '3'istrue);+does integer addition when both operands are integers (e.g.3 + 4=7), list concatenation for two lists, string concatenation otherwise (e.g.3 + '4'='34');*does integer multiplication, or string/list repetition with an integer count (e.g.3 * 'ab'='ababab'); expressions evaluate left to right, so2 + 8 + ' days'='10 days';-,/,%require integer operands$intparses strings to integers,$substrcoerces index args)$fn_name(args...)with nested calls supported\',\\,\$,\<)Function Library
$upper,$lstrip,$rstrip,$strip,$substr$html_decode,$url_encode,$url_decode,$base64_encode,$base64_decode,$convert_to_unicode,$convert_from_unicode$dollar,$dquote,$squote$len,$exists,$is_empty,$index,$rindex,$string_split,$join,$list_delitem$int,$str$digest_md5,$digest_md5_hex,$bin_int$time,$http_time,$strftime$rand,$last_rand$add_header,$set_response_code,$set_redirect<esi:function>/<esi:return>Variable System
$(VAR|'fallback')— if undefined, the default expression is used$(HTTP_*)maps any prefix to the corresponding header;$(HTTP_COOKIE{'name'})for cookies,$(QUERY_STRING{'param'})for query params$(REQUEST_METHOD),$(REQUEST_PATH),$(REMOTE_ADDR)$(ARGS)/$(ARGS{n})for positional access$(MATCHES{n})populated bymatches/matches_ioperatorsDCA Configuration
default_dcaconfig option for DCA inheritanceinherit_parent_dcafor subtree DCA inheritanceEdge-Controlheader support for per-fragment DCA controlmax_include_depthconfig with depth limit enforcementStreaming Processing
src,alt,dca,ttl,method,entity, headers, params) are parsed into expression ASTs during parsing, then fully evaluated before each request is dispatchedbufslots for ordered flushingfastly::http::request::select— replaces sequential.wait()calls; all pending includes share a single pool and responses are harvested as they arrive while preserving document orderRequestKey(method + URL) mapped throughurl_maptoSlotEntrydca="none"(raw insertion) anddca="esi"(parse response as ESI)TryBlockTrackerwith per-attempt slot tracking, failure propagation, and except-block fallback viaassemble_try_blockCacheConfigConfiguration
chunk_size— streaming read buffer sizefunction_recursion_depth— max user-defined function call depthCacheConfig— rendered output caching and cache-control header generationexpose-internalsfeature flag for benchmarkingImproved Features
<esi:include>— now with full attribute set:src,alt,dca,ttl,maxwait,no-store,method,entity,onerror,appendheader,setheader,removeheader(previously onlysrc,alt,onerror)<esi:try>/<esi:attempt>/<esi:except>— now supports parallel execution with multiple<esi:attempt>blocks<esi:vars>— now supports short form (name=attribute) and long form (with body)<esi:assign>— now with short and long form<esi:choose>/<esi:when>/<esi:otherwise>— now with pre-parsed expression evaluation$lower— now handles edge cases properly$html_encode— encodes 4 special characters per ESI spec (>,<,&,")$replace— now supports optional count parameterdca="esi"Fixes
Testing
parser.rs: tag parsing, expression parsing, operator precedence, backslash escapes, variable name validation, subkey assignmentesi_tests.rs: end-to-end processing with fragment dispatching, configuration options, variable evaluationstreaming_behavior.rs: incomplete tag detection for all ESI tag typestests/parser.rs: try/attempt/except, include attributes, header manipulationtests/eval_tests.rs: DCA modes, eval vs include behaviorfunctions.rs: all built-in functionsexpression.rs: function calls, HTML encoding, evaluationBenchmarks
parser_benchmarks— direct comparison with old XML parser using identical test cases (esi_documentsgroup)nom_parser_features— HTML comments, script tags, assigns, advanced expressions, mixed contentparser_scaling— 100 to 10,000 element documentsexpression_parsing— variable access, comparisons, logical operators, function callsinterpolated_strings— text with embedded expressionsExamples
All existing examples updated to work with the new API:
esi_example_minimal— updated fragment dispatcher signatureesi_example_advanced_error_handling— migrated fromReader/Writer/parse_tagstoprocess_streamwithBufReaderesi_try_example— updated fragment dispatcher signatureesi_vars_example— updated fragment dispatcher signatureesi_example_variants— migrated fromparse_tags+process_parsed_document+ URL map toprocess_streamwith inline URL rewritingesi_dca_example— new DCA configuration example