-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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!: Integrate MongoOptions parser into driver #2680
Conversation
09174ae
to
74232bc
Compare
74232bc
to
687baea
Compare
687baea
to
13278cf
Compare
MongoOptions introduce a well typed HostAddress type that tracks the correct shape of a host's address depending on its type. The MongoClientOptions type inherit from node's TLS and Socket options and use our allow list of options to maintain a connection between the types and programmatic processing of options. The hierarchy of options from MongoClient > Topology > Server > ConnectionPool > Connection have been corrected and clarified for responsibilities. NODE-2704
13278cf
to
8f265c9
Compare
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.
Very nice work here! 🥳 I had a few small questions/comments but overall I think this is looking great.
src/logger.ts
Outdated
@@ -48,7 +48,7 @@ export class Logger { | |||
this.className = className; | |||
|
|||
// Current logger | |||
if (options.logger) { | |||
if (!(options.logger instanceof Logger) && typeof options.logger === 'function') { | |||
currentLogger = options.logger; | |||
} else if (currentLogger == null) { |
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.
nit: now that currentLogger defaults to console.warn
above, I don't think this branch will ever trigger.
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.
LGTM 🚀
MongoOptions introduce a well typed HostAddress type that tracks
the correct shape of a host's address depending on its type.
The MongoClientOptions type inherit from node's TLS and Socket options
and use our allow list of options to maintain a connection between the
types and programmatic processing of options. The hierarchy of options
from MongoClient > Topology > Server > ConnectionPool > Connection have
been corrected and clarified for responsibilities.
NODE-2704