Closed antmendoza closed 3 years ago
Hi @JBBianchi , did you have the chance to look into this?
I have been reading through rollup documentation and plugins and I didn't find any option to generate the methods as plain functions instead of functions expressions
@antmendoza I had a look yesterday but couldn't investigate that much. I must admit I don't really see where the difference lies. Maybe in one case the function/method is in the object prototype (no problem) and in another case the function/method is in the object directly (error). One dirty workaround might be to delete normalize()
from the clone:
normalize?(): Databasedswitch {
const clone = new Databasedswitch(this);
normalizeUsedForCompensationProperty(clone);
normalizeOnErrorsProperty(clone);
normalizeDataConditionsProperty(clone);
delete clone.normalize;
return clone;
}
It also means normalize()
will need to be checked before being called as it becomes nullable.
It's just an idea, it's probably not the solution.
thank you @JBBianchi ,
I have tested your solution and works fine, just it involves more changes:
if you think that this is a better solution I can change the code, no problem
@antmendoza lgtm :)
thank you @JBBianchi ,
I have tested your solution and works fine, just it involves more changes:
* invoke "normalize" in constructors for each property we are "hydrating" * delete normalize property in the validate method as well.
if you think that this is a better solution I can change the code, no problem
Does the PR actually fixes the problem? I read I have changed the way we are deffinig "normalize" method to be able to reproduce the error in test.
and understood it was "only" making the code consistent between dev & published versions.
If the PR fixes the issue, then just ignore what I wrote and merge :)
understood it was "only" making the code consistent between dev & published versions
yes, those changes are not really needed. it can be reverted.
Does the PR actually fixes the problem?
Yes as far as I now.
I am using the sdk with this changes into other project and I am not facing the mentioned issue.
Also I have run the index.html example (I have to create a test here) that was having the same problem, since is using the same bundle, and it is working ok now.
understood it was "only" making the code consistent between dev & published versions
yes, those changes are not really needed. it can be reverted.
Does the PR actually fixes the problem?
Yes as far as I now.
I am using the sdk with this changes into other project and I am not facing the mentioned issue.
Also I have run the index.html example (I have to create a test here) that was having the same problem, since is using the same bundle, and it is working ok now.
Ok, sorry I misunderstood. Then all green for me :) Thanks a lot 👍
Many thanks for submitting your Pull Request :heart:!
What this PR does / why we need it:
When I was testing the sdk into other project I realice that the behaviour of the binary (./dist/umd/index.umd.js) was different than the actual source code. The
validate
function was throwing an error related to have found the "normalize" method as additional propertyI have changed the way we are deffinig "normalize" method to be able to reproduce the error in test.
Special notes for reviewers: if you want to reproduce the error I've faced:
npm run build && cd dist && npm link
npm link @severlessworkflow/sdk-typescript
and create a workflow using builders,you will see an error like the following:
Additional information (if needed):