-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
2 - S (<= 1 week)
-
4334
Problem
Once https://github.com/realm/realm-js/pull/4331 is merged our users need to add a lot of boilerplate code to use the feature:
Unable to find source-code formatter for language: typescript. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
const app = new Realm.App("awesome-app"); const user = await app.logIn(Realm.Credentials.anonymous()); const localConfig = { path: "local.realm", schema: [Person, Dog], }; // Copies a bundled realm to "local.realm" if (!Realm.exists(localConfig)) { Realm.copyBundledRealmFiles(); } const localRealm = new Realm(localConfig); const remoteConfig = { schema: [Person, Dog], sync: { user, partitionValue, }, }; if (Realm.exists(remoteConfig)) { return Realm.open(remoteConfig); } else { localRealm.writeCopyTo(remoteConfig); localRealm.close(); // Open the new remote Realm const syncedRealm = await Realm.open(remoteConfig); // Delete the old realm Realm.deleteFile(localConfig); return syncedRealm; }
Solution
Unable to find source-code formatter for language: typescript. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
// Copies a bundled realm to "local.realm" if (!Realm.exists({ path: "local.realm" })) { Realm.copyBundledRealmFiles(); } // Automagically copies the local Realm into a synced Realm as it's opened. const syncedRealm = await Realm.open({ path: "local.realm", sync: { user, partitionValue, }, });
How important is this improvement for you?
Would be a major improvement