In https://codeberg.org/kitten/app/src/branch/main/examples/slash-forwarding/page-with-parameters/index_%5Bname%5D.page.js, I was expecting the following to work when I authored it:
export default ({ name = ''} = {}) => kitten.html`Hello ${name}`
i.e., My expectation was that request.params would be spread into the parameter object received by the route render function.
Of course, that’s not how Kitten currently works (you get request object of type KittenRequest as a property and that, in turn, has a params property).
- Should we spread request parameters into the parameter object of route render functions?
- If so, what would the equivalent be for
POSTroutes for consistency? - Side effects? (Overwriting default properties, etc.)
Decide if this is a good idea or not.
In https://codeberg.org/kitten/app/src/branch/main/examples/slash-forwarding/page-with-parameters/index_%5Bname%5D.page.js, I was expecting the following to work when I authored it:
```js
export default ({ name = ''} = {}) => kitten.html`Hello ${name}`
```
i.e., My expectation was that `request.params` would be spread into the parameter object received by the route render function.
Of course, that’s not how Kitten currently works (you get `request` object of type `KittenRequest` as a property and that, in turn, has a `params` property).
- [ ] Should we spread request parameters into the parameter object of route render functions?
- [ ] If so, what would the equivalent be for `POST` routes for consistency?
- [ ] Side effects? (Overwriting default properties, etc.)
Decide if this is a good idea or not.