Skip to content

Commit

Permalink
Update migration guide for express 5.0.0-beta.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Feb 15, 2022
1 parent ef068f8 commit 9ce25eb
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 16 deletions.
4 changes: 2 additions & 2 deletions _includes/announcement/announcement-en.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<ul>
<li>
<p class="announcement-title">Express 5.0 alpha documentation is now available.</p>
<p class="announcement-title">Express 5.0 beta documentation is now available.</p>
<p markdown="1">
The alpha <a href="{{ page.lang }}/5x/api.html">API documentation</a> is a work in progress. For information on what's in the release, see the Express <a href="https://github.com/expressjs/express/blob/5.0/History.md">release history</a>.
The beta <a href="{{ page.lang }}/5x/api.html">API documentation</a> is a work in progress. For information on what's in the release, see the Express <a href="https://github.com/expressjs/express/blob/5.0/History.md">release history</a>.
</p>
</li>
</ul>
2 changes: 0 additions & 2 deletions _includes/api/en/5x/express.static.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ Possible values for this option are:
- "deny" - Deny a request for a dotfile, respond with `403`, then call `next()`.
- "ignore" - Act as if the dotfile does not exist, respond with `404`, then call `next()`.

**NOTE**: With the default value, it will not ignore files in a directory that begins with a dot.

<h5 id='fallthrough'>fallthrough</h5>

When this option is `true`, client errors such as a bad request or a request to a non-existent
Expand Down
2 changes: 1 addition & 1 deletion _includes/api/en/5x/express.urlencoded.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The following table describes the properties of the optional `options` object.

| Property | Description | Type | Default |
|------------------|-----------------------------------------------------------------------|-------------|-----------------|
| `extended` | This option allows to choose between parsing the URL-encoded data with the `querystring` library (when `false`) or the `qs` library (when `true`). The "extended" syntax allows for rich objects and arrays to be encoded into the URL-encoded format, allowing for a JSON-like experience with URL-encoded. For more information, please [see the qs library](https://www.npmjs.org/package/qs#readme). | Boolean | `true` |
| `extended` | This option allows to choose between parsing the URL-encoded data with the `querystring` library (when `false`) or the `qs` library (when `true`). The "extended" syntax allows for rich objects and arrays to be encoded into the URL-encoded format, allowing for a JSON-like experience with URL-encoded. For more information, please [see the qs library](https://www.npmjs.org/package/qs#readme). | Boolean | `false` |
| `inflate` | Enables or disables handling deflated (compressed) bodies; when disabled, deflated bodies are rejected. | Boolean | `true` |
| `limit` | Controls the maximum request body size. If this is a number, then the value specifies the number of bytes; if it is a string, the value is passed to the [bytes](https://www.npmjs.com/package/bytes) library for parsing. | Mixed | `"100kb"` |
| `parameterLimit` | This option controls the maximum number of parameters that are allowed in the URL-encoded data. If a request contains more parameters than this value, an error will be raised. | Number | `1000` |
Expand Down
2 changes: 1 addition & 1 deletion _includes/header/header-en.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<ul id="application-menu" class="menu">
<li><a href="/{{ page.lang }}/4x/api.html"{% if page.menu == 'api' %} class="active"{% endif %}>API reference</a>
<ul>
<li><a href="/{{ page.lang }}/5x/api.html">5.x (alpha)</a>
<li><a href="/{{ page.lang }}/5x/api.html">5.x (beta)</a>
</li>
<li><a href="/{{ page.lang }}/4x/api.html">4.x</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion en/5x/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ redirect_from: "/5x/api.html"

<h1>5.x API</h1>

{% include note.html content="This is early alpha documentation that may be incomplete and is still under development." %}
{% include note.html content="This is early beta documentation that may be incomplete and is still under development." %}

{% include api/{{ page.lang }}/5x/express.md %}
{% include api/{{ page.lang }}/5x/app.md %}
Expand Down
13 changes: 4 additions & 9 deletions en/guide/migrating-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,18 @@ redirect_from: "/guide/migrating-5.html"

<h2 id="overview">Overview</h2>

Express 5.0 is still in the alpha release stage, but here is a preview of the changes that will be in the release and how to migrate your Express 4 app to Express 5.
Express 5.0 is still in the beta release stage, but here is a preview of the changes that will be in the release and how to migrate your Express 4 app to Express 5.

Express 5 is not very different from Express 4: The changes to the API are not as significant as from 3.0 to 4.0. Although the basic API remains the same, there are still breaking changes; in other words an existing Express 4 program might not work if you update it to use Express 5.

To install the latest alpha and to preview Express 5, enter the following command in your application root directory:
To install the latest beta and to preview Express 5, enter the following command in your application root directory:

```console
$ npm install express@>=5.0.0-alpha.8 --save
$ npm install express@>=5.0.0-beta.1 --save
```

You can then run your automated tests to see what fails, and fix problems according to the updates listed below. After addressing test failures, run your app to see what errors occur. You'll find out right away if the app uses any methods or properties that are not supported.

<h2 id="changes">Changes in Express 5</h2>

Here is the list of changes (as of the alpha 2 release ) that will affect you as a user of Express.
See the [pull request](https://github.com/expressjs/express/pull/2237) for a list of all the planned features.

**Removed methods and properties**

<ul class="doclist">
Expand Down Expand Up @@ -137,7 +132,7 @@ In Express 4, the `req.host` function incorrectly stripped off the port number i

<h4 id="req.query">req.query</h4>

In Express 4.7 and Express 5 onwards, the query parser option can accept `false` to disable query string parsing when you want to use your own function for query string parsing logic.
The `req.query` property is no longer a writable property and is instead a getter. The default query parser has been changed from "extended" to "simple".

<h3>Improvements</h3>

Expand Down

0 comments on commit 9ce25eb

Please sign in to comment.