docs(user): add breaking change documentation for axios

This commit is contained in:
Elian Doran
2026-04-10 10:15:24 +03:00
parent bfe593ae52
commit fe710823c1
9 changed files with 162 additions and 20 deletions

View File

@@ -1,6 +1,4 @@
# Breaking changes
## v0.102.0: Upgrade to jQuery 4.0.0
# v0.102.0: Upgrade to jQuery 4.0.0
jQuery 4 removes legacy browser support (such as IE11 support), but it also removes some APIs that are considered deprecated such as:
> `jQuery.isArray`, `jQuery.parseJSON`, `jQuery.trim`, `jQuery.type`, `jQuery.now`, `jQuery.isNumeric`, `jQuery.isFunction`, `jQuery.isWindow`, `jQuery.camelCase`, `jQuery.nodeName`, `jQuery.cssNumber`, `jQuery.cssProps`, and `jQuery.fx.interval`.

View File

@@ -0,0 +1,44 @@
# v0.103.0: Removal of axios
The `api.axios` library has been removed from the backend scripting API.
Axios was marked as deprecated at least since April 2024 in favor of the native `fetch()` API, which is available in both browser and Node.js environments. After two years of deprecation, the library was removed following the [March 2026 npm supply chain compromise](https://www.malwarebytes.com/blog/news/2026/03/axios-supply-chain-attack-chops-away-at-npm-trust), where attackers published malicious versions that deployed a remote access trojan. The Trilium's main developer almost got compromised, but `pnpm` not trusting unknown post-install scripts successfully avoided that.
Scripts that attempt to use `api.axios` will now throw an error with migration instructions.
## Migration
Replace `api.axios` calls with the native `fetch()` API.
### `GET` calls
Before (Axios):
```javascript
const response = await api.axios.get('https://api.example.com/data');
const data = response.data;
```
After (`fetch`):
```javascript
const response = await fetch('https://api.example.com/data');
const data = await response.json();
```
### `POST` calls
Before (Axios):
```javascript
await api.axios.post('https://api.example.com/data', { key: 'value' });
```
After (fetch):
```javascript
await fetch('https://api.example.com/data', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ key: 'value' })
});
```