feat(mongo)!: remove exported internal types#12037
Conversation
User descriptionDescription of changeTypeORM was exporting all MongoDB types, including things like To prevent shadowing our own types and polluting the TypeORM exports, I completely removed the MongoDB types. The users can import them from MongoDB if they need, they would be more accurate anyway. Pull-Request Checklist
PR TypeEnhancement Description
Diagram Walkthroughflowchart LR
A["src/driver/mongodb/typings.ts exports"] -->|removed| B["TypeORM index.ts"]
C["mongodb package"] -->|import ObjectId| D["User code"]
E["Test/Sample files"] -->|update imports| D
B -->|no longer exports| F["ObjectId and other MongoDB types"]
|
| Relevant files | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Enhancement | 30 files
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Refactoring | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Documentation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bug_fix | 1 files
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Configuration_changes | 1 files
|
commit: |
PR Code Suggestions ✨Latest suggestions up to 5c17f3a
Previous suggestionsSuggestions up to commit 40ec139
|
||||||||||||||||||||||||
Code Review by Qodo
1. RepositoryUpdateOptions removal undocumented
|
|
I'm not sure how those two files had 100% coverage since we don't really use anything except |
40ec139 to
5c17f3a
Compare
Code Review by Qodo
1. MongoDB docs still use typeorm ObjectId
|
5c17f3a to
2028ed8
Compare
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewⓘ The new review experience is currently in Beta. Learn more |
1 similar comment
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewⓘ The new review experience is currently in Beta. Learn more |
2028ed8 to
4fb5073
Compare
Code Review by Qodo
1. Optional mongodb now required
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewⓘ The new review experience is currently in Beta. Learn more |
4fb5073 to
0e85d37
Compare
Code Review by Qodo
1. ObjectId type surface mismatch
|
0e85d37 to
e4c8a22
Compare
Code Review by Qodo
1. 7437 test assertion mismatch
|
Code Review by Qodo
1. RepositoryUpdateOptions removal undocumented
|
Code Review by Qodo
1. RepositoryUpdateOptions removal undocumented
|
Code Review by Qodo
1. RepositoryUpdateOptions removal undocumented
|
Code Review by Qodo
1. Optional peer type leak
|
b6f9079 to
ca01a46
Compare
|
Persistent review updated to latest commit ca01a46 |
ca01a46 to
4f2c4fc
Compare
| export * from "./repository/MongoRepository" | ||
| export type * from "./repository/RemoveOptions" | ||
| export type * from "./repository/SaveOptions" | ||
| export type { UpdateOptions as RepositoryUpdateOptions } from "./repository/UpdateOptions" |
There was a problem hiding this comment.
We should mention this in migratuin guide...
|
Persistent review updated to latest commit 4f2c4fc |
4f2c4fc to
70baf4d
Compare
|
|
Persistent review updated to latest commit 70baf4d |



Description of change
TypeORM was exporting all (internally declared) MongoDB types, including things like
UpdateOptionsorConnectionOptionswhich in TypeORM also exist or used to exist.Ideally, we should avoid
export * from ...and useexport { Thing } from ...to make sure we are exporting only what we want.To prevent shadowing our own types and polluting the TypeORM exports, I completely removed the MongoDB types. The users can import them from MongoDB if they need, they would be more accurate anyway.
Pull-Request Checklist
masterbranchFixes #00000tests/**.test.ts)docs/docs/**.md)