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

perf: cache loaded configuration file #2294

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

micalevisk
Copy link
Member

@micalevisk micalevisk commented Sep 17, 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)
[x] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: closes #2275

What is the new behavior?

now #load is being invoked only once instead of twice (generate.command, build.action) when running nest build. And only once instead of three times (generate.command, start.action, build.action) on nest start

The downside of this solution is that there's no way to bypass the cache. So a command cannot access a fresh version of the config file unless the CLI process restarts. But AFAIK (and tested) this isn't a feature of the start --watch

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Co-authored-by: Kamil Mysliwiec <mail@kamilmysliwiec.com>
@kamilmysliwiec
Copy link
Member

LGTM

@kamilmysliwiec kamilmysliwiec merged commit 197b30f into nestjs:master Sep 21, 2023
@micalevisk micalevisk deleted the refactor/issue-2275 branch September 21, 2023 15:02
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.

refactor request: avoid useless calls to NestConfigurationLoader#load on 'build' (and 'start') commands
2 participants