Respect the input order when filtering #337
Merged
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.
Motivation
The original implementation of document filtering iterated over a Set and a Dictionary, which do not guarantee a stable order, meaning that every time the filter command was invoked with identical inptus, it could produce different outputs, potentially leading to needless rebuilds when used as a plugin, and needless commits when using ahead-of-time generation. It also made debugging of the generator itself more difficult.
Modifications
Respect the input order of operations and components.
Result
Invoking the generator multiple times with the same input produces the same output every time, improving cachability.
Test Plan
Renamed the filter test to be consistent with the rest and manually tested on a larger document.