For preview one the branding is:
new thing = UseGlobalRouting/UseEndpoint
old thing = UseRouter
We're going to drop the name Dispatcher everywhere and make sure that we
position our new work as 'new and improved routing' instead of
introducing a new product/concept name.
We're not totally sure of the term Global yet, but it's what we're doing
for preview 1. Suggestions welcome for dicussion after we do the first
preview :)
Here's a code dump of the parts of the Dispatcher prototype codebase
that are needed to get us off the ground.
This first cut attempts to use part of routing where possible, and not
all of those changes will be long-lasting.
I'll leave comments through thoughout the PR for education.
This changes TemplateMatcher to mutate RouteData.Values directly instead
of creating a new dictionary and then merging in values. This is one the
biggest single costs in routing in terms of both allocations and execution
time.
So Match now becomes TryMatch. This will dirty the state of the RVD, so
the caller needs to snapshot it before calling into it (handled
inside the TreeRouter or RouteCollection).
Some subtle changes were needed to how/when values are added to be
compatible with the existing tests. The general idea is that we add null
values for non-parameter defaults or catchalls, but only if they don't
trounce an existing value. This logic used to live in MergeValues but now
it's in TryMatch since TryMatch might be working from existing data.
Also fixed the .sln to avoid building a package that we use as shared
source.