Problem/Motivation
We have Symfony CMF as a dependency, but we only really use three things from it:
RouteEnhancerInterface
RouteFilterInterface
Also the ROUTE_NAME and ROUTE_OBJECT constants from RouteObjectInterface
Proposed resolution
Quoting timplunkett from [#2883680:79]
AFAIC the only thing left from CMF that we use with no alteration is RouteObjectInterface, and *only* for the ROUTE_NAME/ROUTE_OBJECT constants.
I'd propose creating an empty RouteEnhancerInteface and RouteFilterInterface in Drupal\Core\Routing that extends the CMF ones, but leaves us open to eventually decoupling. The current CR and code change move us *closer* to CMF which is bad.
We should create our own version of RouteObjectInterface which just contains the ROUTE_NAME and ROUTE_OBJECT constants, then convert code to use those.
After this we'll have no direct dependencies on Symfony CMF routing, and could remove the dependency in 9.0.
One thing that's tricky is there's no way to issue deprecations for code in dependencies, we'll need to discuss that but it needs its own issue too.