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

Chore: Remove axios as a dependency for sign-plugin #292

Merged
merged 2 commits into from
Jul 10, 2023

Conversation

academo
Copy link
Member

@academo academo commented Jul 6, 2023

What this PR does / why we need it:

Removes axios as a dependency for sign-plugin. Axios is only used to make a single post request and it adds a layer of "black box" that can make situations like #290 harder to diagnostic.

Test run with a success case

image

Test run with an error case

image

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @grafana/sign-plugin@1.0.3-canary.292.c5013c7.0
# or 
yarn add @grafana/sign-plugin@1.0.3-canary.292.c5013c7.0

@academo academo self-assigned this Jul 6, 2023
@academo academo added chore Other changes that don't modify src or test files sign-plugin Changes related to sign-plugin labels Jul 6, 2023
@academo academo requested review from jackw and mckn July 7, 2023 14:32
@jackw jackw added patch Increment the patch version when merged release Create a release when this pr is merged labels Jul 10, 2023
Copy link
Collaborator

@mckn mckn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Added one small nit. No need to mark the function with async since you are returning a promise.

status: number;
}

export async function postData(urlString: string, data: unknown, headers: Headers): Promise<Response<string>> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export async function postData(urlString: string, data: unknown, headers: Headers): Promise<Response<string>> {
export function postData(urlString: string, data: unknown, headers: Headers): Promise<Response<string>> {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Usually the linter catches these things. I'll see if I can modify the rules so this is automatically suggested.

Copy link
Collaborator

@tolzhabayev tolzhabayev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! We might also want to get rid of minimist next and have 0 deps.

@academo academo merged commit d5ff424 into main Jul 10, 2023
@academo academo deleted the academo/do-not-use-axios branch July 10, 2023 09:11
@grafana-delivery-bot
Copy link

🚀 PR was released in @grafana/create-plugin@1.7.1, @grafana/sign-plugin@1.0.3 🚀

@grafana-delivery-bot grafana-delivery-bot bot added the released This issue/pull request has been released. label Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Other changes that don't modify src or test files patch Increment the patch version when merged release Create a release when this pr is merged released This issue/pull request has been released. sign-plugin Changes related to sign-plugin
Projects
Development

Successfully merging this pull request may close these issues.

4 participants