route-model-binding icon indicating copy to clipboard operation
route-model-binding copied to clipboard

Use container providers

Open Melchyore opened this issue 1 year ago • 0 comments

Proposed changes

This PR introduces a new way to resolve dependencies of controllers methods, because in the new version of AdonisJS, the IoC container changed the way they are resolved. So now, the bind decorator defines a static function on controllers called containerProvider that will be used to resolve dependencies (see here for more details). This change was needed since the module wasn't working on real-world apps.

Types of changes

What types of changes does your code introduce?

  • [x] Bugfix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • [x] I have read the CONTRIBUTING doc
  • [x] Lint and unit tests pass locally with my changes
  • [x] I have added tests that prove my fix is effective or that my feature works.
  • [ ] I have added necessary documentation (if appropriate)

Further comments

I think this PR needs a careful review, because it's the first time I'm using the container providers API, even if it's working.

Melchyore avatar May 02 '24 16:05 Melchyore