realm / realm-js

Realm is a mobile database: an alternative to SQLite & key-value stores
https://realm.io
Apache License 2.0
5.73k stars 564 forks source link

Web SDK, ability to import without `import * as Realm ...` #4943

Open mongodben opened 1 year ago

mongodben commented 1 year ago

Problem

right now, with the Realm Web SDK, you must import the entire SDK with an import alias in import statements, such as:

import * as Realm from "realm-web";

instead of this, i would like imports to behave as they do for the Node.js/React Native SDKs, so i can just do:

import Realm from "realm-web";

// or 
import { App } from "realm-web";

i would like to see this change for the following reasons:

Solution

support the API:

import Realm from "realm-web";

How important is this improvement for you?

Would be a major improvement

kneth commented 1 year ago

@mongodben Thanks for the suggestion - it makes good sense.