-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support for Property Accessors #184
Comments
Hey @MikeBKemp, thanks for using I guess my first question is... why do you want to use property accessors with it? If accessing a property that is not defined on the class, that breaks type safety, which is the entire goal of this project. Same with I am hesitant to make that change, but before making that call, I'd like to hear your use case for using property accessors instead of |
HI @IRCraziestTaxi! Thanks for the response. The use case for me is private fields - I have several entities with foreign keys on private fields (for encapsulation of entity behaviour). I was using QueryBuilder to join on these keys - similar to this comment typeorm/typeorm#3548 (comment), but of course there's no type safety at all there. Using I appreciate that may a niche use case though. |
Hmm, I've just realised that I have another issue. I'm writing a React Native app with the Hermes engine, and facebook/hermes#114 breaks |
@MikeBKemp I'm glad you found a solution that works out for you! For the sake of any future users with the same issue, I would say that if you are joining on a relation, I would consider it a public property anyway. Adding support for property accessors and, in general, breaking type safety would not be a good solution. Again, thanks for using |
I don't know anything about |
Thanks for letting me know about the change. Unfortunately I cannot get the RC to build (probably some of my dependencies are incompatible, and it would take some time to recreate my use case in a fresh project). However facebook/hermes#114 (comment) certainly looks very promising and should fix my issue. |
Hi - do you plan to support property accessors? i.e.:
I've patched ts-simple-nameof locally to get it to work for me, by changing one of the regular expressions:
I appreciate such a change may be counter to your goals for the package (or maybe it's just a bad idea!).
The text was updated successfully, but these errors were encountered: