Skip to content
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

Typescript: OmittedRealmTypes type removed in 12.3? #6288

Open
doelgonzo opened this issue Nov 27, 2023 · 2 comments
Open

Typescript: OmittedRealmTypes type removed in 12.3? #6288

doelgonzo opened this issue Nov 27, 2023 · 2 comments
Labels

Comments

@doelgonzo
Copy link

doelgonzo commented Nov 27, 2023

How frequently does the bug occur?

Always

Description

Was OmittedRealmTypes removed from exports now? I receive the following (After upgrade from 12.2.1 to 12.3.1):

Module '"realm"' has no exported member 'OmittedRealmTypes'

Note, I'm simply trying to type the data being returned without all the other props returned with Realm.Object
OmittedRealmTypes<T> used to achieve this but now it's no longer exported?

Stacktrace & log output

No response

Can you reproduce the bug?

  • select --

Reproduction Steps

No response

Version

12.3

What services are you using?

Atlas Device Sync

Are you using encryption?

No

Platform OS and version(s)

MacOS

Build environment

Which debugger for React Native: ..

Cocoapods version

No response

@doelgonzo
Copy link
Author

Note, a workaround would be to include our own type like

type OmittedRealmTypes<T> = Omit<
  T,
  | '_objectId'
  | '_objectKey'
  | 'addListener'
  | 'entries'
  | 'getPropertyType'
  | 'isValid'
  | 'keys'
  | 'linkingObjects'
  | 'linkingObjectsCount'
  | 'objectSchema'
  | 'removeAllListeners'
  | 'removeListener'
  | 'toJSON'
>

But it could break on updates that change the Realm.Object structure. Is there a different way I should be doing this? Note, I am using this where I have data that matches the schema in Realm before writing the data, and it would be ideal to not repeat the type outside of the class defining the schema. Maybe I'm going about this wrong?

@kneth
Copy link
Contributor

kneth commented Dec 1, 2023

@doelgonzo

Thank you for reporting. We need to investigate in order to find a solution.

@sync-by-unito sync-by-unito bot added the First-Good-Issue First Good Issue - Relatively easy issue for new contributers label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants