asgardeo / asgardeo-auth-react-sdk

To maintain the implementation of Asgardeo React authentication SDK
Apache License 2.0
40 stars 91 forks source link

Replace axios with fetch #139

Open yathindrak opened 2 years ago

yathindrak commented 2 years ago

Describe the improvement

Using fetch over axios will reduce the bundle size of the sdk. This would improve the cold starts in serverless environments as well.

Here, we may consider providing browser polyfills as well.

Additional context

Even though this issue is opened in the React SDK, the required changes need to be implemented in the SPA-SDK. We heavily rely on axios interceptors for SDK hooks[1], so it's necessary to explore whether an alternative approach using fetch can be implemented.

[1] https://github.com/asgardeo/asgardeo-auth-react-sdk/blob/main/API.md#on

Yash-sudo-web commented 1 month ago

Hey @yathindrak @NipuniBhagya , i'd like to work on this issue, can i be assigned to it?

pavinduLakshan commented 1 month ago

Hi @Yash-sudo-web , thanks for offering to help. Replacing axios with fetch will need a significant effort as some core SDK functionalities heavily rely on axios features. I have updated the issue description to include those information as well. Please let us know if you are still willing to take on the challenge.

Yash-sudo-web commented 1 month ago

@pavinduLakshan , i have also commented on Issus #251, can that be assigned to me first? i think that is less complex and would help out in understanding the codebase better