-
Notifications
You must be signed in to change notification settings - Fork 585
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
BSON exported #3363
BSON exported #3363
Conversation
a03af08
to
13d48f0
Compare
@@ -1,6 +1,6 @@ | |||
//////////////////////////////////////////////////////////////////////////// | |||
// | |||
// Copyright 2020 Realm Inc. | |||
// Copyright 2016 Realm Inc. |
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.
Hah! What a weird change. I didn't move this file 😆
expect(typeof BSON).equals("object"); | ||
}); | ||
|
||
it("can construct an ObjectId", () => { |
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.
Do we need to check Decimal128
too?
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.
If constructing an ObjectId works, I would expect a failure to construct a Decimal128 to come from a bug in the bson
package. In other word, I think its safe to keep it limited to this.
5eb604d
to
aad8d91
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.
We are not validating if the BSON type is coming from our dependency or somewhere else. Are we going to do that or we are going to allow external BSON type usage. So two ways to handle these:
- We allow the usage of external BSON types and its responsibility of the developer to handle any incompatibilities
- We validate the BSON type is explicitly our own dependency and throw errors if it is not.
Currently we have these checks which will be valid regardless of where the BSON type is coming from.
https://github.com/realm/realm-js/blob/v10/src/node/node_value.hpp#L101-L123
aad8d91
to
b02e739
Compare
I've rebased this on the current master and testet it locally in Chrome debugging mode ✅ |
6517302
to
a807d17
Compare
a807d17
to
e329d59
Compare
The project uses the esModuleInterop option
The project uses the esModuleInterop option
Started to get Any thoughts? We send warnings to our reporting tool so this is causing some really bad noise right now. |
What, How & Why?
This closes #3242 by exporting the BSON types from both Realm JS and Realm Web.
This is what the JSDocs look like:
☑️ ToDos
Compatibility
label is updated or copied from previous entryBreaking
label has been applied or is not necessaryIf this PR adds or changes public API's: