X Tutup
Skip to content

Router should use strongly typed (and error-checked) classes, not maps #2261

@matanlurey

Description

@matanlurey

Before

@RouteConfig(const [
  const {
    'path': '/pipeline',
    'component': GtPipelineComponent,
    'as' : 'pipeline'
  },
  const {
    'path': '/cleanup',
    'component': GtCleanupComponent,
    'as' : 'cleanup'
  }
])

After

@RouteConfig(const [
  const Route(
    path: '/pipeline',
    component: GtPipelineComponent,
    as : 'pipeline'
  ),
  ...
])

e.g.

class Route {
  const Route({String path, Type component, String as, String redirectTo})
}

Additionally, this could use errors/assertions to catch invalid configuration, e.g. having component AND redirectTo should throw

Metadata

Metadata

Assignees

Labels

effort1: hoursfeatureLabel used to distinguish feature request from other issues

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    X Tutup