Babel Plugin does not add primary key to schema if static primary key value is a variable

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintableJSON

      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 to static 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:

      const key = '_id';
      export class MyObject extends Realm.Object<MyObject>
        static primaryKey = key;
      

      The following example DOES get a primary key added to the schema by the Babel plugin:

      export class MyObject extends Realm.Object<MyObject>
        static primaryKey = '_id';
      

      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

            Assignee:
            Unassigned
            Reporter:
            Unito Sync Bot
            Archiver:
            Marc Greenfield

              Created:
              Updated:
              Resolved:
              Archived: