expressjs / expressjs/expressjs.com

5.x docs are missing some documentation added in late 4.x versions

Open
#1,881 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
MDX
Stars
5.4k
Forks
2.3k
Avg merge
2d 23m
Merged PRs (30d)
14

Description

@paulhiggs in https://github.com/expressjs/express/issues/6479 reported that `express.text()` is missing from 5.x docs.

`express.text()` and `express.raw()` were added in Express 4.17.0. The 4.x documentation reflects that (18dfac1bbd053fb99cba9ff137cb5a5e0c67d5fe, 958e581dbea384dca6bf4a62020762bb0f1ab1dc, b49ab1b94a34e37c791ec661b66ffac5a37803a5), but 5.x documentation has not been updated after changes from 4.17.0/4.17.1 were merged into 5.0/5.x branches (https://github.com/expressjs/express/commit/121fe9982b62d2b1760ec9cb148c19bc5f17255b).

TODO:

- [x] Add `express.text()` to 5.x API docs (#1883)
- [x] Add `express.raw()` to 5.x API docs (#1883)
- [x] Review 4.x documentation changes and check if more changes to late 4.x versions that were later included in 5.x are missing in 5.x docs (it has already been tracked in #1479)
- [x] 4.18 added `priority` option to `res.cookie()` and `root` option to `res.download()` (5c98ee4e949fc69b9dbc89b839c137b7a2eea3fc) (#1886)
- [x] #1402 improved `req.acceptsLanguages()` docs, but only the 4.x version (#1886)
- [x] 5e918ea3a98edcc9a4f9698ca0994f3c6fc1f4e3 added warning boxes to `res.render()` and `app.render()` (#1886)
- [x] fcaca7fcc6f182a8821352a94a88f9fc10320cbb added warnings about `locals` (#1886)
- [x] #1456 documented the `partitioned` option of `res.cookie()` (#1886)
- [x] 4.x and 5.x had slightly different (and incompatible) examples for `router.param(fn)`, which doesn't even exist in Express 5 (#1884)
- [x] a5ca5b0edf437c066f7a1dfa5dc11bc4cb9981e1 changed `req.body` documentation (4.x), removing references to `multer` and `body-parser` and presenting built-in middleware. (#1886)
- [x] #1063 expanded `res.cookie()` docs, showing how to set multiple cookies (#1886)

Other differences include:

- [x] Admonitions are used inconsistently (e.g. in 4.x [`express.static()`](https://github.com/expressjs/expressjs.com/pull/1595/files#diff-4dd9bd27a40d87fc41f870652c2023fff253e27ac6e468f10f094f15bd21a514), but not in 5.x; there are still [many `.doc-box`](https://github.com/search?q=repo%3Aexpressjs%2Fexpressjs.com%20path%3A_includes%2Fapi%2Fen%2F5x%2F%20%22class%3D%5C%22doc-box%22&type=code) `

`s)
- [x] One warning about open redirect was [removed](https://github.com/expressjs/expressjs.com/pull/1835/files#diff-54e9e2e7d6dd5640cb29c0d5e13bb180377ad72da8d6c79b19b55f594f34d742L13-L15) in 5.x `res.location()` in #1835
- [ ] In 4.x most strings in comments use single quotes, but in 5.x many more use double quotes (and one in `res.type()` has [a typo](https://github.com/expressjs/expressjs.com/blob/9cff646b19d9221b89005bd525674c86bd23efad/_includes/api/en/5x/res-type.md?plain=1#L12) - after redesign the typo is [here](https://github.com/expressjs/expressjs.com/blob/f118e033c9a129fc8e4bcfa0717e2699e8d99a19/src/content/api/5x/api/response/index.mdx?plain=1#L1107))
- 5.x docs sometimes place comments showing expected value (`// => sth`) in the same line as code, while 4.x consistently uses new line
- [x] In some 5x docs _available in Express 4.?? onwards_ or similar notes have been removed (or never added), but in most places those still exist
- [ ] `req.host` and `req.hostname` sections are sorted differently
- [ ] Page description uses _request_/_response_ in 5.x and _req_/_res_ in 4.x

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.