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

feat: create a conditional module #1409

Merged
merged 3 commits into from Sep 12, 2023

Conversation

jmcdo29
Copy link
Member

@jmcdo29 jmcdo29 commented Aug 7, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

There's no utility method for conditionally registering modules

Issue Number: #1407

What is the new behavior?

With the new ConditionalModule devs can now register modules based on keys in the process.env or have them registered as blanks modules under the guise of a dynamic module. This works for nested modules, multiple imports, and dynamic modules.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

lib/conditional.module.ts Outdated Show resolved Hide resolved
With the new `ConditionalModule` devs can now register
modules based on keys in the `process.env` or have them
registered as blanks modules under the guise of a dyanmic module.
This works for nested modules, multiple imports, and dynamic modules.

Signed-off-by: Jay McDoniel <jmcdo29@gmail.com>
@Tony133
Copy link
Contributor

Tony133 commented Aug 9, 2023

Just a question and also a curiosity this ConditionalModule module is a Public Api, right?

@Tony133
Copy link
Contributor

Tony133 commented Aug 9, 2023

Ok, seeing the last commit I'd say yes, it's a Public Api 😉👍

@Tony133
Copy link
Contributor

Tony133 commented Aug 14, 2023

@jmcdo29 As soon as you find some time, can you create a PR to document this part in the documentation ? 🙌 🙂

@jmcdo29
Copy link
Member Author

jmcdo29 commented Aug 14, 2023

@Tony133 that was the plan, just wanted to make sure this was feature complete before doing so, less updating back and forth to have to do

@kamilmysliwiec
Copy link
Member

LGTM

Let me know if there's anything you want to add/if it's ready to be merged 🚀

@jmcdo29
Copy link
Member Author

jmcdo29 commented Sep 11, 2023

I think I just need to make some documentation around this, which I plan to do today/tomorrow

Docs PR

@kamilmysliwiec kamilmysliwiec merged commit 9c42639 into nestjs:master Sep 12, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants