Commit Graph

311 Commits

Author SHA1 Message Date
Ryan Nowak 736b49294d Add Template abstraction
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.
2017-10-25 22:15:24 -07:00
Ryan Nowak 2d661396df Port TemplateBinder to dispatcher 2017-10-25 14:28:20 -07:00
Jass Bagga eebc7db2ca Use RoutePatternMatcher logic in TemplateMatcher (#484) 2017-10-25 14:16:04 -07:00
Jass Bagga 485278bf0d Add RoutePatternMatcher to Dispatcher (#482) 2017-10-23 11:20:23 -07:00
Ryan Nowak bd517f891f Support conversions from RouteTemplate -> RoutePattern 2017-10-20 16:58:14 -07:00
Ryan Nowak df78db934d Port IRouteConstraint to the dispatcher project 2017-10-20 14:04:22 -07:00
Jass Bagga fdc5f21428 Port PathTokenizer (#478) 2017-10-20 13:24:00 -07:00
Ryan Nowak 08a64048da Redesign public API for templates
-Renamed RouteTemplate -> RoutePattern
-Made immutable
-Added Builder
-Lots of fixes to parser to support new design

There are a few small issues logged for follow-up but this is mostly in
the place I want it design-wise.
2017-10-19 09:41:45 -07:00
George Chakhidze a3c1b6d033 Avoid allocation of a new char array on every request in RouteCollection class
This is a very small micro-optimization: When LowercaseUrls and/or AppendTrailingSlash
options are enabled, on every call to RouteCollection.NormalizeVirtualPath a new
char[] { '?', '#' } is being allocated.
2017-10-17 17:45:15 -07:00
Jass Bagga 3a5cd6dd25 Port TemplateParser to Dispatcher project (#473)
Addresses #466
2017-10-17 11:52:26 -07:00
Ryan Nowak 927f8ed3d2 Add empty baselines for dispatcher
These packages didn't exist in 2.0 so there's no compat bar.
2017-10-17 10:46:03 -07:00
Jass Bagga bdbe922b22 Add logging (#467)
Addresses #439
2017-10-12 14:23:01 -07:00
Ryan Nowak 56ae2e0177 Respond to feedback about handler factory
- Handler factories are now associated with the dispatcher entry
- Handler factory is now an interface
2017-10-06 10:11:05 -07:00
Ryan Nowak 63d2cc4637 Changes due to davidfowl feedback
Changed dispatchers to IMatcher, added a context.

Removed a bunch of outdated cruft and updated the sample to use
attribute-routing like entries.
2017-10-05 18:31:23 -07:00
Jass Bagga 2f8951e244 Productize HttpMethodEndpointSelector (#463)
Addresses #452
2017-10-05 15:14:17 -07:00
Jass Bagga f49cbd1b25 Selectors initialization and DispatcherBase logging (#451) 2017-09-29 17:50:45 -07:00
Ryan Nowak abb41302e9 Add a dispatcher by default (#462)
This change adds the TreeDispatcher by default to the pipeline. You can
register DispatcherDataSource instances to configure it.
2017-09-29 16:06:38 -07:00
Ryan Nowak bd750ad76d Making endpoints and addresses easier
This makes endpoints and addresses easier to work with by dropping the
'metadata first' approach for the the things that are really at the core
of the dispatcher.
2017-09-28 22:07:32 -07:00
Ryan Nowak 5fed462123 Add tree dispatcher 2017-09-27 14:34:09 -07:00
Ryan Nowak eeebefee1b Add data source 2017-09-26 10:17:48 -07:00
Ryan Nowak 7685e17e80 Add Addresses and link generation 2017-09-24 23:16:34 -07:00
Javier Calvarro Nelson 475712d613 Update API Check baselines 2017-09-22 14:16:39 -07:00
Ryan Nowak 41f26dc69d Add endpoint disambiguation
- Better sample of metadata
- Sample shows how conventional routing would work
- Added endpoint disambiguation
2017-09-22 10:54:20 -07:00
Ryan Nowak d652b86852 Split RVD in twain 2017-09-21 09:19:10 -07:00
Ryan Nowak 134096d9cb Relayer implementation
This refactor introduces two major changes

1. Now creating the 'handler' delegate happens inside the endpoint
middleware. This allows you to short circuit even harder, AND to create
endpoint funcs that capture and use 'next' to rejoin the middleware
pipeline.

2. Relayered the implementation to have routing plug into the dispatcher.
It wasn't immediately apparent to me that this was the right thing to do,
but I think we will need to do things this way to deliver the kind of
back-compat experience we need to do.

The idea that I have is that 'attribute routing' will be the 'default'
entry in the dispatcher. Adding additional conventional routes or other
IRouter-based extensibility will be possible through adapters - but the
default experience will be to add items to the 'attribute route'.

So. We will need to port the attribute routing infrastructure to the
dispatcher library.

We may also need to make RVD into a subclass of something in the
dispatcher assembly.
2017-09-17 18:29:22 -07:00
Jass Bagga b01072eb47 Use RouteTemplate and TemplateMatcher (#443)
Addresses #438
2017-09-14 15:24:40 -07:00
Jass Bagga a9b47f6722 Startup experience (#442)
Addresses #437 and #440
2017-09-11 15:10:33 -07:00
Jass Bagga ebd0baa458 Add dispatcher packages 2017-08-31 11:54:27 -07:00
Nate McMaster e67d85d30c Use PackageLineup to manage PackageReference versions 2017-08-29 11:31:54 -07:00
Nate McMaster 44f9a7083b Use Directory.Build.props/targets 2017-08-29 11:30:03 -07:00
Pranav K a23f1601fd Remove usage of TaskCache 2017-06-08 09:06:41 -07:00
Ryan Nowak d39305aa91 Improve formatting 2017-05-24 08:36:24 -07:00
Ryan Nowak 1165a1de33 Updates to generated resource files 2017-05-24 08:32:15 -07:00
Joonas Westlin 9a6cb89b8d Adjusted example error message to reflect the situation that causes the error. 2017-05-24 08:23:20 -07:00
Joonas Westlin a18f59ab88 Changed expected exception message to the one defined in Resources.resx.
Removed the Debug.Assert as that caused the test runner to crash as in
this case the preceding part is not a literal.
Fixes the test runner crash.
2017-05-24 08:23:20 -07:00
Ryan Brandenburg efb097ce60 Target .NET Standard 2.0 and add net461 testing 2017-05-23 14:38:36 -07:00
John Luo 1f3b20e177 Migration 2017-05-05 17:54:49 -07:00
Pranav K ce021a888e Change TFM to netcoreapp2.0 2017-05-05 09:49:42 -07:00
Ryan Nowak 232b73a151 Fix aspnet/Mvc#6218
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.
2017-04-28 17:00:35 -07:00
Smit Patel 0aebdb4110 Update API Check related files
React to aspnet/BuildTools#238
2017-04-25 08:19:04 -07:00
Steve Sanderson 8c58086030 Make TreeRouter restore RouteData snapshots consistently. Fixes #394. 2017-04-11 15:36:34 +01:00
Pranav K 1ef45e64b8 Update to net46 2017-03-22 18:26:48 -07:00
Nate McMaster 101764328b Consolidate dependency versions to one file and remove workarounds 2017-03-15 17:01:10 -07:00
Pranav K 0f4ce625ed Update to VS 2017 RC3 2017-01-27 11:04:42 -08:00
Kiran Challa 755d436840 Fixed error message related to escaping curly braces. 2017-01-03 14:33:36 -08:00
Kiran Challa 071b616178 Merge branch 'rel/1.1.1' into dev
# Conflicts:
#	NuGet.config
#	samples/RoutingSample.Web/project.json
#	src/Microsoft.AspNetCore.Routing.Abstractions/project.json
#	src/Microsoft.AspNetCore.Routing.DecisionTree.Sources/project.json
#	src/Microsoft.AspNetCore.Routing/project.json
#	test/Microsoft.AspNetCore.Mvc.Routing.Abstractions.Tests/project.json
#	test/Microsoft.AspNetCore.Routing.DecisionTree.Sources.Tests/project.json
#	test/Microsoft.AspNetCore.Routing.FunctionalTests/project.json
#	test/Microsoft.AspNetCore.Routing.Tests/project.json
2017-01-03 13:33:26 -08:00
Kiran Challa 4bfd663c45 [Fixes #370] Raw route values should be restored after template binder failing binding values when generating a url
- Reverted changes made in commit: 1c9a54aeb8
2017-01-03 13:23:36 -08:00
Pranav K ce525150ab Updating to 4.4 CoreFx packages 2016-12-21 22:55:19 -08:00
Ajay Bhargav Baaskaran c5b7a3f710 Fixed a policheck violation 2016-12-21 11:05:09 -08:00
Kiran Challa 20967cfa76 [Fixes #367] Add extensions on WebHostBuilder for super simple HTTP service application building 2016-12-21 10:04:02 -08:00