You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "Fine0830 (via GitHub)" <gi...@apache.org> on 2025/04/22 03:19:22 UTC
[PR] refactor: use the Fetch API to replace `Axios` [skywalking-booster-ui]
Fine0830 opened a new pull request, #466:
URL: https://github.com/apache/skywalking-booster-ui/pull/466
The PR uses the Fetch API to query data from serve and remove `Axios` library.
Benefits of Fetch API over `Axios`:
Built into browsers – No extra dependencies, reducing bundle size.
Simpler syntax – Uses promises and works natively with `async/await`.
Lightweight – No library overhead, ideal for performance-focused apps.
Modern features – Supports streaming (`ReadableStream`) and cancellation (`AbortController`).
Signed-off-by: Qiuxia Fan <qi...@apache.org>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor: use the Fetch API to replace `Axios` [skywalking-booster-ui]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #466:
URL: https://github.com/apache/skywalking-booster-ui/pull/466#discussion_r2053266628
##########
src/store/modules/profile.ts:
##########
@@ -94,91 +93,91 @@ export const profileStore = defineStore({
this.highlightTop = !this.highlightTop;
},
async getEndpoints(serviceId: string, keyword?: string) {
- const res: AxiosResponse = await graphql.query("queryEndpoints").params({
+ const response = await graphql.query("queryEndpoints").params({
serviceId,
duration: useAppStoreWithOut().durationTime,
keyword: keyword || "",
limit: EndpointsTopNDefault,
});
- if (res.data.errors) {
- return res.data;
+ if (response.errors) {
+ return response;
}
- this.endpoints = res.data.data.pods || [];
- return res.data;
+ this.endpoints = response.data.pods || [];
+ return response;
Review Comment:
The function currently returns the full response object whereas similar functions in other modules return response.data. Standardizing the return type could prevent unexpected behavior in callers.
```suggestion
return response.data;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor: use the Fetch API to instead of `Axios` [skywalking-booster-ui]
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #466:
URL: https://github.com/apache/skywalking-booster-ui/pull/466
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org