Feedback on Realm Web SDK vs Stitch Browser SDK

Hi,

I want to give feedback here if may I.
I really don’t like how realm is imported and instances are accessed. The deprecated stitch-browser-sdk its much more intuitive and intelisense works great, its a much better experience.
Can you fix it?

example:

import { Injectable } from '@angular/core';
import { JsonConvert } from 'json2typescript';
import { RemoteMongoClient, RemoteMongoDatabase, Stitch, StitchAppClient } from 'mongodb-stitch-browser-sdk';

import { environment } from 'src/environments/environment';

@Injectable()
export class DatabaseService {
  client: StitchAppClient;
  database: RemoteMongoDatabase;

  private jsonConvert: JsonConvert;

  constructor() {
    this.client = Stitch.initializeAppClient(environment.stitchConfig.clientId);
    this.database = this.client
      .getServiceClient(RemoteMongoClient.factory, environment.stitchConfig.clusterName)
      .db(environment.stitchConfig.databaseName);

    this.jsonConvert = new JsonConvert();
  }

  deserializeObject<T>(jsonObject: any, classReference: any): T {
    return this.jsonConvert.deserializeObject(jsonObject, classReference);
  }

  deserializeArray<T>(jsonArray: any[], classReference: any): T[] {
    return this.jsonConvert.deserializeArray(jsonArray, classReference);
  }
}

Or will I have to refactor everything?

Kind regards,
Rui Cruz

Hi @Rui_Cruz - thanks for your reply (which might have been even better as a new post). We’re always looking for ways to improve the experience and a regression in developer experience is naturally not our intention with the new SDKs.

Would you mind sharing the above example using the new Realm SDKs for comparison?
What more specifically are you asking us to fix? I.e. what specifically is not intuitive about how realm is imported and instances are accessed? Intelisense should be supported out of the box with the new SDKs, if not on your platform, thats something we need to look into. Would you mind sharing what editor / platform you’re on?

Oops I guess miss your reply… Well maybe is something wrong with my vs-code setup.
I was talking about declaring all imports its easier to understand and even lookup into code instead of import * as RealmWeb from "realm-web"; For me its easier to click on some import and check source-code to see if there is something i’m missing and its also clear, I prefer to see import { Credentials } from 'realm-web' and not RealmWeb.Credentials.