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 :)
This change adds the Template as a top level abstraction. URL templating
is now a two-stage process.
First you use a 'key' to look up a Template, then you use the Template
to create the URL.
This change also has some cleanup of the way RoutePatternBinder gets
instantiated. I added a factory service so that most of the complex
things can be made internal to Dispatcher. Now it's much easier to
constuct and use. These impacts some pubternal APIs that we already
broke, but makes them actually nice :)
Also cleaned up some tests and fixed one that was broken and not
running.
This fixes the case described in the comments in TemplateBinder.
This case is much more common for pages which is why we're only seeing it
now. We've had this issue for all of 1.0.0 in both conventional and
attribute routing.
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.