Parse JS SDK: Bundle Size

236 Views Asked by At

I'm tasked with making a js application which uses parse more efficient. It currently uses webpack v4 and the parse js sdk.

I noticed that the largest module in my bundle is the parse sdk at a whopping 147KB after minification.

Here are examples depicting my entire use of this SDK. From what I can tell, there aren't that many network requests in the browser. Is there any way to get a smaller bundle size with this SDK or should I write the logic myself if bundle size is important?

("" is used instead of specific keys/config values, etc)

Initialization

Parse.initialize("");
Parse.serverURL = "";

Checking if logged in

if(Parse.User.current()) { ... do stuff }

Getting user info

const query = new Parse.Query("");
query.equalTo("user", Parse.User.current());
return query.find();

Saving user info

const objectToSave = new Parse.Object("");
objectToSave("prop","value");
return objectToSave.save();

Logging in

return Parse.User.logInWith(authProvider, { authData: { id: userId, access_token: accessToken } }).then(...

Logging out

Parse.User.logOut()
1

There are 1 best solutions below

0
Davi Macêdo On

If the 147KB is a big issue for you, you can write your own API calls using lower level Node.js libraries directly to the REST API: https://docs.parseplatform.org/rest/guide/