mirror of
https://github.com/zadam/trilium.git
synced 2026-05-07 07:37:24 +02:00
docs(user): add breaking change documentation for axios
This commit is contained in:
90
docs/User Guide/!!!meta.json
vendored
90
docs/User Guide/!!!meta.json
vendored
@@ -17761,27 +17761,105 @@
|
||||
"notePosition": 130,
|
||||
"prefix": null,
|
||||
"isExpanded": false,
|
||||
"type": "text",
|
||||
"mime": "text/html",
|
||||
"type": "book",
|
||||
"mime": "",
|
||||
"attributes": [
|
||||
{
|
||||
"type": "label",
|
||||
"name": "iconClass",
|
||||
"value": "bx bx-up-arrow-alt",
|
||||
"isInheritable": false,
|
||||
"position": 30
|
||||
"position": 10
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "shareAlias",
|
||||
"value": "breaking-changes",
|
||||
"isInheritable": false,
|
||||
"position": 20
|
||||
},
|
||||
{
|
||||
"type": "relation",
|
||||
"name": "template",
|
||||
"value": "_template_list_view",
|
||||
"isInheritable": false,
|
||||
"position": 30
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "sorted",
|
||||
"value": "",
|
||||
"isInheritable": false,
|
||||
"position": 40
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "sortDirection",
|
||||
"value": "desc",
|
||||
"isInheritable": false,
|
||||
"position": 50
|
||||
}
|
||||
],
|
||||
"format": "markdown",
|
||||
"dataFileName": "Breaking changes.md",
|
||||
"attachments": []
|
||||
"attachments": [],
|
||||
"dirFileName": "Breaking changes",
|
||||
"children": [
|
||||
{
|
||||
"isClone": false,
|
||||
"noteId": "fqAK6opjUagR",
|
||||
"notePath": [
|
||||
"pOsGYCXsbNQG",
|
||||
"CdNpE2pqjmI6",
|
||||
"cNpC0ITcfX0N",
|
||||
"fqAK6opjUagR"
|
||||
],
|
||||
"title": "v0.103.0: Removal of axios",
|
||||
"notePosition": 10,
|
||||
"prefix": null,
|
||||
"isExpanded": false,
|
||||
"type": "text",
|
||||
"mime": "text/html",
|
||||
"attributes": [
|
||||
{
|
||||
"type": "label",
|
||||
"name": "shareAlias",
|
||||
"value": "axios-removal",
|
||||
"isInheritable": false,
|
||||
"position": 30
|
||||
}
|
||||
],
|
||||
"format": "markdown",
|
||||
"dataFileName": "v0.103.0 Removal of axios.md",
|
||||
"attachments": []
|
||||
},
|
||||
{
|
||||
"isClone": false,
|
||||
"noteId": "72dxvnbnkDFY",
|
||||
"notePath": [
|
||||
"pOsGYCXsbNQG",
|
||||
"CdNpE2pqjmI6",
|
||||
"cNpC0ITcfX0N",
|
||||
"72dxvnbnkDFY"
|
||||
],
|
||||
"title": "v0.102.0: Upgrade to jQuery 4.0.0",
|
||||
"notePosition": 20,
|
||||
"prefix": null,
|
||||
"isExpanded": false,
|
||||
"type": "text",
|
||||
"mime": "text/html",
|
||||
"attributes": [
|
||||
{
|
||||
"type": "label",
|
||||
"name": "shareAlias",
|
||||
"value": "jquery4",
|
||||
"isInheritable": false,
|
||||
"position": 30
|
||||
}
|
||||
],
|
||||
"format": "markdown",
|
||||
"dataFileName": "v0.102.0 Upgrade to jQuery.0.0.md",
|
||||
"attachments": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -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`.
|
||||
44
docs/User Guide/User Guide/Scripting/Breaking changes/v0.103.0 Removal of axios.md
vendored
Normal file
44
docs/User Guide/User Guide/Scripting/Breaking changes/v0.103.0 Removal of axios.md
vendored
Normal 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' })
|
||||
});
|
||||
```
|
||||
Reference in New Issue
Block a user