Open channeladam opened 1 year ago
I agree, this is a bug.
Note to the team: We shouldn't check that the value is a string literal here: https://github.com/realm/realm-js/blob/master/packages/babel-plugin/src/plugin/index.ts#L356-L357 .. even better would be to simply leave it alone and adopt the SDKs schema parser to read the static directly.
How frequently does the bug occur?
Always
Description
The Babel plugin does not add a primary key to the static
schema
of the TypeScript class when the value assigned tostatic primaryKey
is a variable - e.g. a constant.The following example does NOT get a primary key added to the
schema
by the Babel plugin:The following example DOES get a primary key added to the
schema
by the Babel plugin:Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
No response
Version
Babel plugin 0.1.1
What services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
Android 11 R API 30 - Pixel 5 emulator
Build environment
Which debugger for React Native: .. Flipper
Cocoapods version
No response