node-object-mapper icon indicating copy to clipboard operation
node-object-mapper copied to clipboard

Changelog about major version 6 ?

Open ouraios opened this issue 5 years ago • 3 comments

I've updated to the major version 6 but because of the lack of changelog and possible breaking changes im not able to understand the return objects are not exactly the same between version 5 & 6.

Could you please @wankdanker make a changelog explaining what are the big changes in major version 6 against 5 ? That would help everyone ... because right now i had no choice but to rollback to version 5 :/

ouraios avatar Dec 27 '19 15:12 ouraios

Hi @ouraios. There was a major rewrite done by @switzer. I was concerned that with such a rewrite something may have broken backwards compatibility, which is why I did the major version bump.

I believe that none of the tests were changed and all of the tests continued to pass after the rewrite. So, if something has changed, I would say that was unintentional and there must not have been a test covering that use case.

So, sadly, I do not have a concise list of what has changed. However, if you can give me a failing test case, we can add it to the tests and then try to get it fixed up.

wankdanker avatar Dec 27 '19 18:12 wankdanker

Thanks for your answer @wankdanker Here is an example of how worked version 5.0.0 : https://runkit.com/embed/qlxasxo90r6n And same example on version 6.2.0 : https://runkit.com/embed/zb6j2r1f32dd

As you can see the difference is that in 5.0.0 activityList still appeared after mapping being empty but in 6.2.0 it gets deleted after mapping 😞

I hope you'll be able to find a goof fix for that test case !

And really thank you for your great work on this package !

ouraios avatar Dec 31 '19 10:12 ouraios

  myInputKey: {
    key: 'myOutputKey',
    default: () => new Array(),
    transform: (values: MyInterface[]) =>
      // values can be null. We don't check it because we define 'default' function.
      values.map(...)
  },

This code works in 5.0.0 but doesn't work in >=6.0.0. Also key: 'myOutputKey?', - question mark doesn't help us in 6.0.0.

silveoj avatar Jan 24 '20 09:01 silveoj