sparsetech / trail

Routing library for the Scala platform
82 stars 8 forks source link

Route: Only encode placeholders in type parameter #29

Closed tindzk closed 5 years ago

tindzk commented 5 years ago

Previously, static path elements were encoded in Route's HList. This prevented conditional routes such as the following:

if (isProduction) Root / "api" / "v2.0" else Root

Change the implementation such that only placeholders (e.g. Arg[String] or Fragment[Int]) are encoded in Route's type parameter.

Also, simplify the design by using tuples instead of HLists. As a consequence, the compile-time and run-time footprint is reduced.

Detailed changes:

Closes #14. Closes #28.