fix(db): move db constants to other file to avoid circular ref - #1858
Merged
Conversation
lib/db.js referenced lib/operations/db_ops.js, which in turn referenced lib/db.js to get some constants. Moved constants to their own file, and used dynamic imports to get DB constructor Fixes NODE-1692
mbroadst
approved these changes
Oct 24, 2018
| @@ -0,0 +1,10 @@ | |||
| 'use strict'; | |||
Member
There was a problem hiding this comment.
similar to the other PR, can we just rename this file constants.js, in the likely event we will end up with non-db related constants. Trying to contain file bloat here.
Contributor
Author
There was a problem hiding this comment.
Do you think that we shouldindividually bring the constants on to the Db constructor instead of using Object.assign? If we add new constants, it will be easy to accidentally expose them.
Member
There was a problem hiding this comment.
yeah, I think that is probably best practice
mbroadst
approved these changes
Oct 29, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lib/db.js referenced lib/operations/db_ops.js, which in turn
referenced lib/db.js to get some constants. Moved constants to
their own file, and used dynamic imports to get DB constructor
Fixes NODE-1692
Replaces #1828