-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: migrate to adonisjs 6 #24
base: develop
Are you sure you want to change the base?
Conversation
tsconfig + package.json metas + eslint/prettier
|
||
await app.booted(async () => { | ||
slugify = await app.container.make('slugify.decorator') | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about this.
in fact, here we're making a container service for the decorator. This container service can be imported and used like this:
import slugify from '@adonisjs/lucid-slugify/decorator'
class Post {
@slugify({ .. })
public slug: string
}
it works, but I think it feel a bit weird because so far we've never used a container service for this kind of thing. but maybe its fine
it's the only solution I have found because the decorator needs SlugifyManager
, and the IoC manages its instantiation.
if a better solution is desirable, please let me know
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that seems awful. The decorators shouldn't be turned into container services. Seems like, we will need a bit of refactoring within the codebase. Lemme give that a try
@Julien-R44 any change we can get this to v6 version? 😋 #25 |
@Julien-R44 when can we expect this to be done? :) |
Changes
Add support for AdonisJS 6
No breaking changes, except the way we should import things :
Types are now available on
/types
submodule :And SlugifyManager should be resolved from the container like that :
See README for more details.