expressjs / expressjs/discussions
Remove the `extended` option and stop being opinionated about parsers
- Dominant language
- No language data
- Stars
- 73
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
I'm opening this here because it affects multiple packages, including mainly `body-parser` and Express, and I'd like to consolidate the discussion around `qs` instead of continuing it across multiple issues, discussions, and PRs.
- https://github.com/expressjs/body-parser/issues/252
- https://github.com/expressjs/body-parser/issues/566
- https://github.com/expressjs/body-parser/issues/347
- https://github.com/expressjs/body-parser/pull/603
- https://github.com/expressjs/body-parser/issues/132
- https://github.com/expressjs/body-parser/issues/22
- https://github.com/expressjs/body-parser/issues/88
- https://github.com/expressjs/express/pull/7151
- https://github.com/expressjs/express/pull/7117
- https://github.com/expressjs/express/pull/6865
- https://github.com/expressjs/express/issues/5878
- https://github.com/expressjs/express/discussions/5783
- https://github.com/expressjs/express/issues/6647
Currently, the `extended` option brings in `qs`. That's not really a major problem, since we could simply make it an optional peer dependency and let users install it if they need it while continuing to provide the option.
The more important point is that, recently, we've been moving away from being opinionated about these kinds of things. For example, we've made the query parser customizable, and we're also working toward non-blocking JSON parsing by allowing custom parsers in `body-parser` (https://github.com/expressjs/body-parser/pull/696). Similarly, `raw-body` no longer depends on `iconv-lite`; it now uses `TextDecoder` by default while still allowing users to provide their own decoder if needed https://github.com/stream-utils/raw-body/pull/145.
Express already allows customizing the URL query parser, so for Express 6 I think we should remove the `extended` option entirely. That way, Express no longer has an opinion about which parser should be used. If the platform default isn't what you want, you can simply plug in your own parser, just as you already can today.
I'm marking this for discussion in a future meeting so we can get feedback from the rest of the team, especially the captains, and use it to help plan Express 6.
For ref: https://sourcegraph.com/search?q=context:global+count:1100000+%22set%28%27query+parser%27%2C+%27extended%27%22+-file:node_modules&patternType=keyword&sm=0
This isn't about the dependency tree or any of that. It's about reducing the maintenance burden and staying true to our philosophy of being unopinionated: use what the platform provides. 🙂
Contributor guide
Assessment
This issue has not been assessed yet.