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

Sync axios #2

Open
ModyQyW opened this issue Dec 15, 2022 · 7 comments
Open

Sync axios #2

ModyQyW opened this issue Dec 15, 2022 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@ModyQyW
Copy link
Member

ModyQyW commented Dec 15, 2022

No description provided.

@ModyQyW ModyQyW added the enhancement New feature or request label Dec 15, 2022
@ModyQyW ModyQyW self-assigned this Dec 15, 2022
@ModyQyW ModyQyW changed the title Sync axios 1.2.1 and release 1.0.0 Sync axios 1.2.2 and release 1.0.0 Jan 3, 2023
@ModyQyW ModyQyW changed the title Sync axios 1.2.2 and release 1.0.0 Sync axios Feb 1, 2023
@ModyQyW
Copy link
Member Author

ModyQyW commented Feb 1, 2023

AxiosHeaders 引发大量问题,而且增加了复杂性,不再同步 AxiosHeaders 到 UnHeaders。

// axios 下报类型错误,uni-network 没有问题
instance.interceptors.request.use((config) => ({
  ...config,
  headers: {
    token: 'abc',
  },
}));

// 正常
instance.interceptors.request.use((config) => {
  config.headers = configs.headers ?? {};
  config.headers.token = 'abc';
  return config;
});

@ModyQyW
Copy link
Member Author

ModyQyW commented Feb 3, 2023

需要同步 transformRequest

  1. 会增加不必要的复杂性,我觉得拦截器已经够用了。
  2. 会增加体积。

@ModyQyW
Copy link
Member Author

ModyQyW commented Feb 3, 2023

需要同步 transformResponse

  1. 会增加不必要的复杂性,我觉得拦截器已经够用了。
  2. 会增加体积。

@ModyQyW
Copy link
Member Author

ModyQyW commented Apr 7, 2023

Axios 1.3.5 允许 paramsSerializer 设置函数(类似 0.27.2)或对象(1.0.0 引入),我觉得值得同步一下。

https://github.com/axios/axios/blob/4af78a72eee06172c53383aaed74e2dcaf44d620/lib/helpers/buildURL.js#L24-L63

https://github.com/axios/axios/blob/4af78a72eee06172c53383aaed74e2dcaf44d620/lib/core/Axios.js#L50-L71

引入了 AxiosURLSearchParams,会增加复杂性和体积。不再同步该部分。

@github-actions github-actions bot added the Stale label Jun 11, 2023
@uni-helper uni-helper deleted a comment from github-actions bot Jun 11, 2023
@ModyQyW ModyQyW removed the Stale label Jun 11, 2023
@github-actions github-actions bot added the Stale label Aug 13, 2023
@uni-helper uni-helper deleted a comment from github-actions bot Aug 14, 2023
@ModyQyW ModyQyW removed the Stale label Aug 14, 2023
@github-actions github-actions bot added the Stale label Oct 15, 2023
@uni-helper uni-helper deleted a comment from github-actions bot Oct 18, 2023
@ModyQyW ModyQyW removed the Stale label Oct 18, 2023
@ModyQyW
Copy link
Member Author

ModyQyW commented Apr 16, 2024

axios 1.2.2 重构了 adapter 加载,会增加复杂性和体积。不再同步该部分。

@ModyQyW
Copy link
Member Author

ModyQyW commented Jul 5, 2024

axios 1.6 优化了错误追踪,已同步,目前已同步至 1.7.3。

@ModyQyW
Copy link
Member Author

ModyQyW commented Sep 6, 2024

已同步至1.7.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant