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.
This PR attempts to improve the algorithm further by removing the second pass. Rather than moving nodes to the pantry, and then back in later, it moves them to the correct place all within the first (and only) pass.
Note that this is an evolution of the v0.4.0 two-pass algorithm, and is behind the same option, so default mode still behaves like v0.3.0, and one must still enable the new algorithm via the
twoPass
option (which has become a bit of a misnomer).Benefits:
beforeNodePantried
callback. If you are doing interesting things with any of the other hooks, e.g.data-turbo-permanent
, you'd often need to prevent the pantrying process from flattening the node trees that entered it, and thus you'd need to know how the internals of the pantrying process worked, and that there was a pantrying process at all, for that matter. This PR removes the hook, and the need for it.Finally, as far as I can tell, there are no downsides to this new approach, but I welcome any skeptical scrutiny to make this as good as it can be! Can we find any regressions from v0.3.0 or v0.4.0?
P.S. First two commits are from #83 , which is a bugfix and should be evaluated separately from the outcome of this. I'll rebase once that gets merged.