-
Notifications
You must be signed in to change notification settings - Fork 27
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
Transform Layer Issues #70
Comments
Hi Vladyslav, One note, the triggering of transforms only occurs on |
Hi Benjamin and thanks for your reply. Looking forward to your next response. And thanks for explanation on |
Hi Vladyslav, I've just fixed the type definition issue - an oversight on my behalf which was lacking tests to ensure it worked correctly. Your approach is pretty much spot on correct, however I've made the fix in a backwards-compatible manner. Please let me know if the document level transform isn't working for you still, I've got some tests which should be checking that aspect but if they aren't I'll need to restructure them to catch whatever is causing it to break for you. I'll also get round to updating the documentation as soon as we've sorted out the functional issues. |
Hi Benjamin! Thank you for such a quick fix of type definition issue. However, I'm still experiencing issues with transform functions are not being registered. I don't mind doing a PR if you can guide me. Regarding the tests: maybe it is worth to do some document altering here and then check in tests if document has been actually altered? So we can ensure that transform functions have been really executed. Or at least add |
Ah, well spotted. The I've since added tests for this (the latter option you suggested) and have made the fixes in Sorry about that oversight and thanks so much for helping me debug and fix this - it certainly shouldn't have slipped through the cracks, but alas that seems to be the nature of things. I can only hope it didn't impact you too heavily time wise and please feel free to get in touch if you run into anything else which isn't behaving as you expect it to. |
Thank you very much for so quick fix. The However, I guess I have spotted another problem while testing |
Hi Vladyslav, glad to hear it's working correctly now and no worries. The property transforms are actually lazily evaluated, somewhat differently to the |
Hi Benjamin! Thank you once more for explanation. I think it is worth to put this in documentation? Because at the moment documentation says the following:
But it turns out that actually they do not work the same. |
Hi Vladyslav, Can you please have a glance over the updated README and let me know if the changes there (under Transform Gotchas) provide enough information to help someone unfamiliar with the implementation navigate that functionality effectively? I'm, unfortunately, not in a great position to tell - having spent a lot of time working on the codebase and using it on other projects. |
Awesome, Benjamin! Looks very descriptive to me. Thank you for all your support. I'm enjoying using your library. |
Cool stuff, not a problem at all and glad you're enjoying it. Feel free to ask if you run into anything else. |
Today I've tried to apply
Transform
decorator to myUser
model.But this resulted in the following TS error:
Then I took a look at the
Decorators.d.ts
file and foundTransform
decorator factory function declaration, which is following:it returns
(target: Instance<any, any>, property?: string) => void;
.I tried to replace
Instance<any, any>
withInstanceImplementation<any, any>
and that fixed the TS error. However, I doubt that is a correct solution.Although, TS error has gone after I changed
target
type, added transform functions are not being executed.Then I also tried to add transform functions via
transforms
static property, like this:And it started partially working, partially is because only
fromDB
function is being executed as expected.toDB
is triggered byinsert()
method, butupdate()
method doesn't triggertoDB
.A bit about my environment:
node 7.6.0
typescript 2.2.1
Am I missing something or there is a bug in
Iridium
? Can someone please confirm or disconfirm the issues I've described above?The text was updated successfully, but these errors were encountered: