[RFC] Clean up kernel by introducing ParamConverters
- Dominant language
- PHP
- Stars
- 589
- Forks
- 186
- Avg merge
- 2h 23m
- Merged PRs (30d)
- 9
Description
Right now, we use magic in `Kernel.php` to define the contenttype routes like `/pages`, `/pages/4`, etc. It is a hefty operation that also parses yaml files, it happens here:
https://github.com/bolt/core/blob/master/src/Kernel.php#L124-L142
But this logic can also be implemented with ParamConverters, which will be "the Symfony way" of achieving dynamic parameters in routes:
https://symfony.com/bundles/SensioFrameworkExtraBundle/current/annotations/converters.html
Contributor guide
Research direction
Start with Kernel.php lines 124-142, where the current content type route logic and YAML parsing are implemented. Read the linked Symfony ParamConverters documentation and compare it with the existing route behavior for /pages and /pages/4. Done means the dynamic route handling is implemented with ParamConverters instead of the current Kernel magic, without changing the supported routes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, symfony
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100