-
-
Notifications
You must be signed in to change notification settings - Fork 596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to instantiate Parse #203
Comments
@flovilmart you're absolutely correct that the SDK design goes against this style. Handling the scenario you describe isn't easy for something that's originally designed for client apps and sandboxed cloud environments. Unofficially, I'm looking for a way to separate the object representation format from the request structure -- essentially, a functional-programming API that would allow an object to be saved to any parse app. This would solve the problems you're looking for, and in my opinion it makes for much safer server code. I have not idea when or if it'll be released, but it's something I want to explore when I have the time. |
@andrewimm we could explore together if you like, if we settle on an API early on, I could fill in the blanks on side branches. |
It would also be great to disable the object state store which makes it extremely difficult to reason about the state of objects in a running server application. |
@TylerBrock isn't that the reason for disableSingleInstance() ? |
@flovilmart @TylerBrock regarding this topic in general, I'm considering a standalone repo to house some of these experimental ideas. I'll see what I can get around to later this week. |
@andrewimm I managed to get around the problem with subprocesses and HTTP as a transport which is OK as we'll need that eventually. But that would make it more efficient to not have this shared state due to the global nature of Parse and the a-synchronicity of node. |
@andrewimm is disableSingleInstance() called automatically by requiring |
Not exactly with that method, but it should be: https://github.com/ParsePlatform/Parse-SDK-JS/blob/master/src/ParseObject.js#L67 :) |
That's what I figured but we still see object state mutated by side effects of other queries/saves. I'll create a separate issue for that though (or update the existing one) |
Hmm, that's troubling, open a new issue to track it |
is it related to parse-community/parse-server#5278 |
Does anyone have any suggestions on implementing two or more Parse instances at the moment? Re-initializing Parse before making read/write requests is getting the job done for now, but I need to make multiple live query connections, and that is breaking when re-initializing the app. Ps: I don't use authentication, I'm building for electron so I can easily use parse/node instead if that makes it easier to use multiple instances. |
@flovilmart Even if years have passed, I think this issue is still relevant and should be addressed. |
As years have passed and no one has addressed the issue. It is only fitting to close it. If you really feel the issue should be addressed, why don't you take a stab at it? |
@flovilmart Indeed, I am currently looking into it. This is something that we'll need. |
@dplewis @mtrezza Your feedback would be appreciated. If we can find an agreement on this i could work on a PR in the next few months. After some digging in the SDK, it seems that we need to
As for using it
|
Can you lay out again what the objective would be? |
@mtrezza We need to connect to two different servers from the same app |
We may want to keep the iOS and Android SDKs in mind. Ideally we find a concept that can be replicated to these. Also, differentiation by app ID may make sense, to keep local cache separated. IIRC that is how it is currently done for Android and iOS SDK where app ID is part of the local storage path. There have been efforts in the past to remove the app ID from Parse Server entirely. It seems they have been abandoned, but some PRs have been merged. More relevant for multi-tenancy Parse Server but maybe also for this PR. @dplewis is the JS SDK expert here, I'm sure he has |
We will still have a use for this, expecially on Parse server to talk to another Server. Also, I think that while we are on this, we should also refactor the JS SDK, to replace the use of |
Just my thoughts on this: I've built an internal content & bull-jobs manager for our parse apps. We have many environments but the app id's of the instances running on different environments are all the same. So differentiation of the instances (for local cache keys) should ideally be something else, maybe even the Also, if there is motivation to refactor the JS SDK are there any thoughts on doing it with Typescript? I'd be happy to contribute as much as I can if I can. |
Does leaving global objects has positive impacts on tree shaking, like for the last firebase sdk ? |
While working on https://github.com/parseplatform/parse-server we face an issue with the shared state of Parse.
We'd need to be able to create instances of the Parse SDK, for cloud code functions, in the context of multiple apps running on the same server.
After investigating the code, it seems that the whole SDK design goes against an easy fix for that.
What do you think @andrewimm ?
The text was updated successfully, but these errors were encountered: