-
Notifications
You must be signed in to change notification settings - Fork 253
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(NODE-5040): add color to BSON inspect #635
Merged
Merged
Conversation
This file contains 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
addaleax
reviewed
Oct 9, 2023
nbbeeken
changed the title
feat(Node 5040): add color to BSON inspect
feat(NODE-5040): add color to BSON inspect
Oct 9, 2023
W-A-James
added
the
Primary Review
In Review with primary reviewer, not yet ready for team's eyes
label
Oct 9, 2023
W-A-James
requested changes
Oct 9, 2023
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.
Looks good, but I agree with Anna's comments.
baileympearson
requested changes
Oct 9, 2023
W-A-James
requested changes
Oct 10, 2023
W-A-James
requested changes
Oct 11, 2023
baileympearson
requested changes
Oct 11, 2023
W-A-James
previously approved these changes
Oct 12, 2023
W-A-James
added
Team Review
Needs review from team
and removed
Primary Review
In Review with primary reviewer, not yet ready for team's eyes
labels
Oct 12, 2023
baileympearson
previously approved these changes
Oct 12, 2023
nbbeeken
requested changes
Oct 12, 2023
aditi-khare-mongoDB
dismissed stale reviews from baileympearson and W-A-James
via
October 13, 2023 16:16
fb33d30
aditi-khare-mongoDB
requested review from
nbbeeken,
baileympearson and
W-A-James
October 13, 2023 16:17
nbbeeken
previously approved these changes
Oct 13, 2023
W-A-James
requested changes
Oct 13, 2023
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, but not sure why we brought back test/colors.mjs
W-A-James
approved these changes
Oct 13, 2023
nbbeeken
approved these changes
Oct 13, 2023
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.
Description
Utilizing Node.js's custom inspect functionality
[Symbol.for('nodejs.util.inspect.custom')]
, we are able to write custom functions to print out user input to BSON types. This allows users to visualize their BSON objects in color, as well as set options to their inspect function.What is changing?
Node.js colors the various types of javascript values, through the inspect function, and we can now harness that for BSON types. In addition, we support all user-defined inspect option inputs, for all types except RegExp.
This functionality is not available in the browser, in which case the Node Driver defaults to the default JS inspect.
Is there new documentation needed for these changes?
Yes. Users need to be provided with information about what is printed with the new inspect functionality and how to modify the options.
What is the motivation for this change?
To help users have better control over their visualization of BSON objects, especially in the case of color visualization of values of different types.
Release Highlight
Node.js BSON now supports inspect options, specifically visualizing in color
Prior Visualization:
New Color Visualization:
Other Notable Changes
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript