Skip to content

Commit a41a87c

Browse files
gpenetomscytaleMarc-Roigpwizlapetersg83
authored
4.6.1 Docs Release (#1492)
* user-permissions plugin: document how to add Patreon as an Oauth provider * add server webhooks populateRelations config variable * Update docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md Co-authored-by: Pierre Wizla <[email protected]> * Auto stash before merge of "dev/webhook-populated-relations" and "origin/dev/webhook-populated-relations" * add 4.6.1 migration guide * Update docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md Co-authored-by: Pierre Noël <[email protected]> * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md Co-authored-by: Pierre Noël <[email protected]> * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md Co-authored-by: Pierre Noël <[email protected]> * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md Co-authored-by: Pierre Noël <[email protected]> * improve explanation of webhooks populate relations usage * Update filtering-locale-publication.md (#1441) for this pull strapi/strapi#15046 * Fix deployment instructions for Azure CLI # Change 1: Update Node runtime argument of ```az webapp create``` Running the docs as-is produces an error: ```... Linux Runtime 'node|10.14' is not supported.Run 'az webapp list-runtimes --os-type linux' to cross check``` The correct parameter today is ```bash --runtime "node|14-lts" ``` # Change 2: Update IP address block arguments of ```az mysql server firewall-rule create``` Running the docs as-is produces an error: ```... the following arguments are required: --start-ip-address, --end-ip-address``` Based on [the most recent docs](https://learn.microsoft.com/en-us/cli/azure/mysql/server/firewall-rule?view=azure-cli-latest), the correct parameters to define the allowed IP blocks are: ```bash --start-ip-address 0.0.0.0 --end-ip-address 0.0.0.0 ``` * Change Node 14 to Node 16 https://azure.microsoft.com/en-us/updates/community-support-for-node-14-lts-is-ending-on-30-april-2023/ * Update docs/developer-docs/latest/plugins/users-permissions.md * Update docs/developer-docs/latest/plugins/users-permissions.md * Fix broken links reported in issue #1423 (#1484) * Fix broken links reported in issue #1423 * Fix BE custom. > middlewares link * Update quick-start.md (#1478) * Move sizeLimit one level above in upload provider (#1133) * move sizeLimit one level above in upload provider * add sizeLimit deprecation warning * minor change * minor change * checkFileSize upload provider * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla <[email protected]> * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla <[email protected]> * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla <[email protected]> * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla <[email protected]> * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla <[email protected]> * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla <[email protected]> * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla <[email protected]> * move migration steps to 4.5.1 to 4.6.1 --------- Co-authored-by: Pierre Wizla <[email protected]> * update localhost link * Connect can not be used for media attributes (#1490) * connect can not be used for meida attributes * change warning to caution --------- Co-authored-by: Tom Shortall <[email protected]> Co-authored-by: Marc-Roig <[email protected]> Co-authored-by: Pierre Wizla <[email protected]> Co-authored-by: Pierre Noël <[email protected]> Co-authored-by: Jorge Martin <[email protected]> Co-authored-by: Antti <[email protected]> Co-authored-by: Shaun Brown <[email protected]> Co-authored-by: Pierre Wizla <[email protected]> Co-authored-by: katekosm <[email protected]>
1 parent e5dc4dd commit a41a87c

File tree

9 files changed

+155
-11
lines changed

9 files changed

+155
-11
lines changed

docs/developer-docs/latest/developer-resources/database-apis-reference/rest/relations.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ You can also use the longhand syntax to [reorder relations](#relations-reorderin
4141

4242
`connect` can be used in combination with [`disconnect`](#disconnect).
4343

44+
:::caution
45+
46+
`connect` can not be used for media attributes.
47+
48+
:::
49+
4450
<br />
4551

4652
:::::: tabs card

docs/developer-docs/latest/development/providers.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ module.exports = {
151151
delete(file) {
152152
// delete the file in the provider
153153
},
154+
checkFileSize(file, { sizeLimit }) {
155+
// implement your own file size limit logic
156+
// there is a default logic in place if this
157+
// method is not implemented
158+
},
154159
};
155160
},
156161
};

docs/developer-docs/latest/getting-started/quick-start.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ Now that we have created a basic data structure with 2 collection types, "Restau
191191
#### Create an entry for the "Restaurant" collection type
192192

193193
1. Go to ![Content Manager icon](../assets/quick-start-guide/icons/content.svg) [Content Manager > Collection types - Restaurant](http://localhost:1337/admin/content-manager/collectionType/api::restaurant.restaurant) in the navigation.
194-
2. Click on **Add new entry**.
194+
2. Click on **Create new entry**.
195195
3. Type the name of your favorite local restaurant in the _Name_ field. Let's say it's `Biscotte Restaurant`.
196196
4. In the _Description_ field, write a few words about it. If you're lacking some inspiration, you can use `Welcome to Biscotte restaurant! Restaurant Biscotte offers a cuisine based on fresh, quality products, often local, organic when possible, and always produced by passionate producers.`
197197
5. Click **Save**.
@@ -204,7 +204,7 @@ The restaurant is now listed in the [Collection types - Restaurant](http://local
204204

205205
Let's go to ![Content Manager icon](../assets/quick-start-guide/icons/content.svg) [Content Manager > Collection types - Category](http://localhost:1337/admin/content-manager/collectionType/api::category.category) and create 2 categories:
206206

207-
1. Click on **Add new entry**.
207+
1. Click on **Create new entry**.
208208
2. Type `French Food` in the _Name_ field.
209209
3. Click **Save**.
210210
4. Go back to _Collection types - Category_, then click again on **Add new entry**.

docs/developer-docs/latest/plugins/upload.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export default [
135135

136136
</code-group>
137137

138-
In addition to the middleware configuration, you can pass the `sizeLimit`, which is an integer in bytes, in the `providerOptions` of the [plugin configuration](/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md) in `./config/plugins.js`:
138+
In addition to the middleware configuration, you can pass the `sizeLimit`, which is an integer in bytes, in the [plugin configuration](/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md) in `./config/plugins.js`:
139139

140140
<code-group>
141141

@@ -148,9 +148,7 @@ module.exports = {
148148
// ...
149149
upload: {
150150
config: {
151-
providerOptions: {
152-
sizeLimit: 250 * 1024 * 1024 // 256mb in bytes
153-
}
151+
sizeLimit: 250 * 1024 * 1024 // 256mb in bytes
154152
}
155153
}
156154
};

docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The `./config/server.js` file can include the following parameters:
3232
| `cron.tasks` | Declare [CRON jobs](/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md) to be run at specific dates. | object | |
3333
| `dirs` | Path configuration of different directories Strapi uses. | object | |
3434
| `dirs.public` | Customize the path of the public folder. | string | `./public` |
35+
| `webhooks.populateRelations` | For backward compatibility reasons, the default value is `true`, but the recommended value is `false` to avoid performance issues when having many relations. If you need populated relations in your webhook, we recommend doing a separate query in your webhook listener to fetch the entity only with the necessary data. | boolean | `true` |
3536

3637
## Configurations
3738

@@ -130,6 +131,7 @@ export default ({ env }) => ({
130131
},
131132
});
132133
```
134+
133135
</code-block>
134136
</code-group>
135137

docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ In this section we'll use the Azure Portal to create the required resources to h
4848

4949
- _Name_ - `my-strapi-app`
5050
- _Publish_ - `Code`
51-
- _Runtime stack_ - `Node 14 LTS`
51+
- _Runtime stack_ - `Node 16 LTS`
5252
- _Operating System_ - `Linux`
5353
- _Region_ - Select an appropriate region
5454

@@ -126,11 +126,11 @@ In this section, we'll use the [Azure CLI](https://docs.microsoft.com/cli/azure/
126126
az appservice plan create --resource-group $rgName --name $appPlanName --is-linux --number-of-workers 4 --sku S1 --location $location
127127
```
128128

129-
3. Create a Web App running Node.js 14.
129+
3. Create a Web App running Node.js 16.
130130

131131
```bash
132132
webAppName=my-strapi-app
133-
az webapp create --resource-group $rgName --name $webAppName --plan $appPlanName --runtime "node|10.14"
133+
az webapp create --resource-group $rgName --name $webAppName --plan $appPlanName --runtime "node|16-lts"
134134
```
135135

136136
4. Create a Storage Account.
@@ -162,7 +162,7 @@ In this section, we'll use the [Azure CLI](https://docs.microsoft.com/cli/azure/
162162
az mysql db create --resource-group $rgName --name $dbName --server-name $serverName
163163

164164
# Allow Azure resources through the firewall
165-
az mysql server firewall-rule create --resource-group $rgName --server-name $serverName --name AllowAllAzureIps --start-ip-range 0.0.0.0 --end-ip-range 0.0.0.0
165+
az mysql server firewall-rule create --resource-group $rgName --server-name $serverName --name AllowAllAzureIps --start-ip-address 0.0.0.0 --end-ip-address 0.0.0.0
166166
```
167167

168168
6. Add configuration values to the Web App.

docs/developer-docs/latest/update-migration-guides/migration-guides.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Migrations are necessary when upgrades to Strapi include breaking changes. The m
2222
- [Migration guide from 4.3.6 to 4.3.8](migration-guides/v4/migration-guide-4.3.6-to-4.3.8.md)
2323
- [Migration guide from 4.4.3 to 4.4.5](migration-guides/v4/migration-guide-4.4.3-to-4.4.5.md)
2424
- [Migration guide from 4.4.5 to 4.5.1](migration-guides/v4/migration-guide-4.4.5-to-4.5.1.md)
25+
- [Migration guide from 4.5.1+ to 4.6.1](migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md)
2526

2627
## v3 to v4 migration guides
2728

docs/developer-docs/latest/update-migration-guides/migration-guides/v4/code/backend/policies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ In Strapi v4, depending on whether the policy is applied to REST or GraphQL (use
121121

122122
- Both REST and GraphQL contexts have access to the `is`, `type`, and `state`.
123123
- The REST context have access to the destructed Koa context.
124-
- The GraphQL context has access to `parent`, `args`, `context` (which is the GraphQL Context), `info` & `http` (which contains the Koa context) (see [GraphQL customization](http://localhost:8080/developer-docs/latest/plugins/graphql.html#custom-configuration-for-resolvers) documentation).
124+
- The GraphQL context has access to `parent`, `args`, `context` (which is the GraphQL Context), `info` & `http` (which contains the Koa context) (see [GraphQL customization](/developer-docs/latest/plugins/graphql.md#custom-configuration-for-resolvers) documentation).
125125

126126
You can use `policyContext.type`, which value is either `koa` for REST or `graphql` for the GraphQL plugin, to determine the type of context the policy uses.
127127
:::
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
---
2+
title: Migrate from 4.5.1+ to 4.6.1 - Strapi Developer Docs
3+
description: Learn how you can migrate your Strapi application from 4.5.1+ to 4.6.1.
4+
canonicalUrl: https://docs.strapi.io/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.html
5+
---
6+
7+
# v4.5.1+ to v4.6.1 migration guide
8+
9+
The Strapi v4.5.1+ to v4.6.1 migration guide upgrades v4.5.1+ to v4.6.1. We introduced a configuration for webhooks to receive populated relations. Also, this migration guide is needed for all users who were limiting media size for the local upload provider.
10+
11+
The migration guide consists of:
12+
13+
- Upgrading the application dependencies
14+
- Changing the webhooks configuration (optional)
15+
- Updating the local upload provider `sizeLimit`
16+
- Reinitializing the application
17+
18+
## Upgrading the application dependencies to 4.6.1
19+
20+
:::prerequisites
21+
Stop the server before starting the upgrade.
22+
:::
23+
24+
1. Upgrade all of the Strapi packages in `package.json` to `4.6.1`:
25+
26+
```json
27+
// path: package.json
28+
29+
{
30+
// ...
31+
"dependencies": {
32+
"@strapi/strapi": "4.6.1",
33+
"@strapi/plugin-users-permissions": "4.6.1",
34+
"@strapi/plugin-i18n": "4.6.1"
35+
// ...
36+
}
37+
}
38+
```
39+
40+
2. Save the edited `package.json` file.
41+
42+
3. Run either `yarn` or `npm install` to install the new version.
43+
44+
::: tip
45+
If the operation doesn't work, try removing your `yarn.lock` or `package-lock.json`. If that doesn't help, remove the `node_modules` folder as well and try again.
46+
:::
47+
48+
## Changing the webhooks configuration (optional)
49+
50+
By default, and for backward compatibility reasons, webhooks will receive the entity with its relations populated again. We do recommend to disable this behavior if you were not using it, as it may cause performance issues when having many relations. If you need populated relations in your webhook, we recommend doing a separate query in your webhook listener to fetch the entity only with the necessary data.
51+
52+
If you want to change this behavior, you can do so by editing the `./config/server.js` file (or `./config/server.ts` if you are using TypeScript) and add the following configuration:
53+
54+
```jsx
55+
'use strict';
56+
57+
module.exports = ({ env }) => ({
58+
host: env('HOST', '0.0.0.0'),
59+
port: env.int('PORT', 1337),
60+
url: 'http://localhost:1337',
61+
webhooks: {
62+
// Add this to not receive populated relations in webhooks
63+
populateRelations: false,
64+
},
65+
});
66+
```
67+
68+
With this, you will no longer receive populated relations in webhooks, and **response times on the Content Manager will be shorter**.
69+
70+
You can see more of the available configuration options in the [server configuration documentation](/developer-docs/latest/setup-deployment-guides/configurations/required/server.md).
71+
72+
## Updating the sizeLimit provider configuration
73+
74+
This step is only required if you were using the [`sizeLimit` configuration](/developer-docs/latest/plugins/upload.md#max-file-size) for your upload provider.
75+
76+
:::caution
77+
The documentation required the `sizeLimit` to be in bytes, but it was actually in kilobytes. This is now fixed, and the limit will be interpreted as bytes.
78+
79+
If you, for some reason, were limiting the file size to kilobytes, you should update the value to be in bytes.
80+
:::
81+
82+
We recommend to move the `sizeLimit` outside the provider options like the following, as it will be deprecated in the next major version.
83+
<code-group>
84+
85+
<code-block title="JAVASCRIPT">
86+
87+
```js
88+
// path: ./config/plugins.js
89+
90+
module.exports = {
91+
// ...
92+
upload: {
93+
config: {
94+
sizeLimit: 250 * 1024 * 1024 // Now
95+
providerOptions: {
96+
sizeLimit: 250 * 1024 * 1024 // Before
97+
}
98+
}
99+
}
100+
};
101+
```
102+
103+
</code-block>
104+
105+
<code-block title="TYPESCRIPT">
106+
107+
```js
108+
// path: ./config/plugins.ts
109+
110+
export default {
111+
// ...
112+
upload: {
113+
config: {
114+
sizeLimit: 250 * 1024 * 1024 // Now
115+
providerOptions: {
116+
sizeLimit: 250 * 1024 * 1024 // Before
117+
}
118+
}
119+
}
120+
};
121+
```
122+
123+
</code-block>
124+
125+
</code-group>
126+
127+
To change the script:
128+
129+
1. In the `./config/plugins.js` file, identify the upload configuration if you have one.
130+
2. (_optional_) If you have a `sizeLimit`, move it one level above `providerOptions`.
131+
132+
!!!include(developer-docs/latest/update-migration-guides/migration-guides/v4/snippets/Rebuild-and-start-snippet.md)!!!

0 commit comments

Comments
 (0)