atlassian-labs / react-resource-router

Configuration driven routing solution for React SPAs that manages route matching, data fetching and progressive rendering
https://atlassian-labs.github.io/react-resource-router
Apache License 2.0
202 stars 28 forks source link

Add support to additional route attributes #164

Closed haskellcamargo closed 2 years ago

haskellcamargo commented 2 years ago

This pull-request adds support to additional route attributes in the type definitions.

Background

Some applications might want or need to extend the routes to allow for additional configuration, such as supporting feature flags or adding custom business logic. From a runtime perspective, it's possible to define additional attributes in a route. From a type perspective, the TypeScript definition for a route is sealed and cannot be extended.

Solution

Adding a new interface, AdditionalRouteAttributes, and merging it with the route allows routes to be extended from the consumer side. It's the same method we're already using to allow the consumer to set the resource store context.

atlassian-cla-bot[bot] commented 2 years ago

Hooray! All contributors have signed the CLA.