Class-transformer: question: Breaking changes in the patch version? v0.3.1 to v0.3.2

Created on 20 Jan 2021  路  9Comments  路  Source: typestack/class-transformer

The problem: No one makes breaking changes in a PATCH version of the semver. We've spent couple hours to debug why we're facing an issue only on deployed envs.

Well, of course it's up to you, but as there is a standard please make sure you're not taking down people who rely on your package on production.

P.S. See semver.org for details.

question

Most helpful comment

I tried to warn everyone and my issue report was immediately closed.

How does a package get 572,670 weekly downloads and still be in version 0? How does it become so popular and trusted to deeply but still be in development with breaking changes winged into it? I consumed this package when I started using NestJs and wondering if that鈥檚 how everyone else started using this package and that it鈥檚 perhaps popular due to not enough libraries based on decorating functions?

All 9 comments

Thanks for broken production)
It was really hard to find the root of the issue.

So for all who wanna figure out why transformation is not working and how to fix it:

Developer released breaking change in patch, so all of your transformations became broken.
The reason is in changing format of arguments for Transform decorator function.
to fix it do next:

// before:
@Transform((value) {
  return parseInt(value, 10);
})

// after
// you need to add object destruction as transform decorator passes object instead of list of arguments
@Transform(({value}) {
  return parseInt(value, 10);
})

Message to developer: PLEASE DON'T RELEASE MANUALLY! PLEASE USE LIBRARY FOR CALCULATING VERSION OR READ ABOUT SEMVER!

I tried to warn everyone and my issue report was immediately closed.

How does a package get 572,670 weekly downloads and still be in version 0? How does it become so popular and trusted to deeply but still be in development with breaking changes winged into it? I consumed this package when I started using NestJs and wondering if that鈥檚 how everyone else started using this package and that it鈥檚 perhaps popular due to not enough libraries based on decorating functions?

No one responded to this issue, no apologies? Unbelievable irresponsible.

@ianhe8x That's how open source works)

Is there a way to sensibly debug the Transform decorators?

@Expose()
@Transform(({ value }) => Number.parseInt(value, 10))

It returns NaN but the plain object has a string representation of the number.

I too am noticing this issue. In my case, I'm transforming a date object into a string. Instead, subsequent properties after the transformed one are being merged into it.

0.4.0 has been released, 0.3.2 has been deprecated with a warning message:

This release contains a breaking change from 0.3.1 but otherwise functions properly. Please read the changelog on Github to learn more.

Closing this as solved.

No one responded to this issue, no apologies? Unbelievable irresponsible.

@ianhe8x There was a response in another issue because obviously half of the people didn't take the time to check if there is an open issue for this and so like 5 issues were opened about this. Creating 5x time for the contributor to scan, update and discuss. __Unbelievable irresponsible.__

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings