Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring your own router: Remove react-router-dom dependency #230

Closed
brionmario opened this issue Jun 27, 2024 · 1 comment · Fixed by #214
Closed

Bring your own router: Remove react-router-dom dependency #230

brionmario opened this issue Jun 27, 2024 · 1 comment · Fixed by #214
Assignees

Comments

@brionmario
Copy link
Member

Is your suggestion related to an experience ? Please describe.

Currently (v4.0.4), the installation experience of the SDK is as follows.

npm install @asgardeo/auth-react react-router-dom

Installing the react-router-dom dependency is mandatory since the SDK has a SecureRoute component that allows defining protected routes in a React app.

This poses several issues:

  • DX is bad since an authentication SDK should not be opinionated about what routing library the application should use.
  • It's a maintenance overhead to the SDK maintainers since react-router major versions often have breaking changes.
  • Even if the SDK stay upto date, developers who are on older react router versions will not be able to use the SecureRoute component.
  • Maintaining different versioned components is not practical (SecureRouteV5, SecureRouteV4, etc)

Describe the improvement

Remove the react-router-dom dependency along with the SecureRoute and document code blocks in different routing flavours so that developers can easily use them and implement their own SecureRoute.

Additional context

N/A

@brionmario
Copy link
Member Author

Fixed with #214

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants