Skip to content

Add Parse.Object.getClass(className) #597

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

Closed
Aetherall opened this issue Jul 9, 2018 · 8 comments
Closed

Add Parse.Object.getClass(className) #597

Aetherall opened this issue Jul 9, 2018 · 8 comments
Labels
type:feature New feature or improvement of existing feature

Comments

@Aetherall
Copy link

So we can retrieve Classes from ClassNames

I can do a PR if needed

@flovilmart
Copy link
Contributor

What would be the use case? Getting the classes instead of importing the module that defines your class? Not against on the paper, but i’d recommend using the node require / import instead.

@Aetherall
Copy link
Author

I am creating a Collection class extending the Parse.Object class, where I use decorators on instance methods/properties as well as on static methods/properties to add "configuration" and functionalities to my objects. As it is abstracted from the Parse.Object itself, It makes no sense to import another collection in here. ( Furthermore that the Collection used in the method depends of the actual extend done to Collection )

@register
class Post extends Collection{

    set title(title){
        if(title.length > 50) throw new Error('The title is too long')
    } 

    @label('Title of the post')
    @perm.set(admin, owner('auhtor'))
    static title = String

    @disconnect(owner('author'))
    @connect(admin)
    @relation.one
    static author = 'User'
}

@flovilmart
Copy link
Contributor

Are you willing to make a PR for it?

@flovilmart
Copy link
Contributor

I also really like this decorator based SDK! Any chance you have it on GitHub?

@Aetherall
Copy link
Author

Yes, In fact, I am currently rebuilding Parse from scratch ^^
I am making good progress so far

@flovilmart
Copy link
Contributor

rebuilding Parse from scratch

You mean the SDK or the full server+ sdk’s?

I’m curious why you’d need to rewrite it all.

@Aetherall
Copy link
Author

Full server + SDK

I do not feel comfortable about how the server and the client work together

The whole concept is great, but the way its designed seem not ideal for me

My goal is to have something like a client execution for each request on the server, but in a way that allows node optimizations. ( no new class instances, just a context shift )

Also, the Parse.Promise thing was driving me crazy aha ^^

With field level validation, the need for ACL is reduced, so I got read of it too
( permissions are in fact functions you define in the form =>
canCreatePost(user, post) or canConnectPostToComment(user, post, comment) )
(it's not verbose like this, it was just an example )

Also, I got rid of the User part, so I can use any user system I want, just bind the user to the request via a middleware ( Accounts-js does the job well )

The framework will not be optimized for large projects at the beginning ( in term of relations between collections ) but if people are interested I can improve that

To conclude, my goal is to extract the data part of Parse, and make it something easy to use, and more relationship oriented than Apollo ( and react compatible as well )

@mtrezza mtrezza added type:feature New feature or improvement of existing feature and removed type:improvement labels Dec 6, 2021
@parse-github-assistant
Copy link

The label type:feature cannot be used in combination with type:improvement.

@parse-github-assistant parse-github-assistant bot removed the type:feature New feature or improvement of existing feature label Dec 6, 2021
@mtrezza mtrezza added the type:feature New feature or improvement of existing feature label Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests

4 participants