Skip to content
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

ConfigService should always use infer: true #636

Closed
tomer953 opened this issue Jul 29, 2021 · 1 comment
Closed

ConfigService should always use infer: true #636

tomer953 opened this issue Jul 29, 2021 · 1 comment

Comments

@tomer953
Copy link

I'm submitting a...


[ ] Regression 
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

regarding the new option to { infer: true }

#573 (comment)
@kamilmysliwiec:

We couldn't really infer types by default due to backward compatibility

first, this feature is awesome, so thank you.
the problem is that we don't benefit the power of the intellisense until the { infer: true } is assigned.
this means that every time we start typing: this.config.get('foo.'
we need to move to the options part, type { infer: true } then go back to the string and check the intellisense;

Expected behavior

{ infer: true } as the default option, unless we disable it in the config module options
or, an option to autoInfer as defualt.

as a side note, I don't understand why we can't make breaking changes,
I think as long as we follow the semantic version (i.e. bump 0.6.3 to 1.0.0) - make it totally legit.

@kamilmysliwiec
Copy link
Member

as a side note, I don't understand why we can't make breaking changes

We can but we don't want to. Our goal is to generally avoid breaking changes as possible.

Now when this feature is available, we'll think about making it the "default option" in the next major release. If you want to use { infer: true } by default, you can always extend the ConfigService class creating the custom configuration service which automatically sets infer to true. This isn't blocking.

@nestjs nestjs locked and limited conversation to collaborators Jul 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants