faker icon indicating copy to clipboard operation
faker copied to clipboard

refactor(helpers)!: remove v8 deprecated unique

Open Shinigami92 opened this issue 1 year ago β€’ 10 comments

extracted from #2608

  • #2608

referencing #1785

  • #1785

should be merged before starting #2335

  • #2335

Shinigami92 avatar Feb 11 '24 22:02 Shinigami92

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.55%. Comparing base (fd05126) to head (ef40320).

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2661      +/-   ##
==========================================
- Coverage   99.55%   99.55%   -0.01%     
==========================================
  Files        2817     2816       -1     
  Lines      251188   250918     -270     
  Branches     1117      707     -410     
==========================================
- Hits       250074   249805     -269     
+ Misses       1114     1084      -30     
- Partials        0       29      +29     
Files Coverage Ξ”
src/modules/helpers/index.ts 98.82% <ΓΈ> (-0.10%) :arrow_down:

... and 30 files with indirect coverage changes

codecov[bot] avatar Feb 11 '24 22:02 codecov[bot]

As mentioned earlier. I don't think we should remove unique from faker as it is a very useful feature when generating test data. I would like to check with the rest of the team and to a certain extend the community, whether we should remove it or replace it.

EDIT: Reason: #2667 in combination with #2664 will likely invalidate the circumstances that the initial decision was made upon.

Please vote this comment with

  • πŸ‘ for removal of unique and
  • πŸ‘Ž for retaining unique, although with a different implementation and interface.

ST-DDT avatar Feb 11 '24 23:02 ST-DDT

What about the possibility of taking an external replacement like https://www.npmjs.com/package/enforce-unique and moving it within the faker-js org, but as a separate package/repo?

matthewmayer avatar Feb 12 '24 00:02 matthewmayer

As mentioned earlier. I don't think we should remove unique from faker as it is a very useful feature when generating test data.

I would like to check with the rest of the team and to a certain extend the community, whether we should remove it or replace it.

Please vote this comment with

  • πŸ‘ for removal of unique and

  • πŸ‘Ž for retaining unique, although with a different implementation and interface.

I need to say that I 100% dislike to bring up a long discussion we already had and even written down in our internal notes. As Matthew already wrote: there is another package that does the same if not better. And for all the reasons: please lock back in history notes. Period.

Shinigami92 avatar Feb 12 '24 03:02 Shinigami92

Let's just make sure we have very good documentation explaining how to migrate from using the existing method to a third-party package.

matthewmayer avatar Feb 12 '24 03:02 matthewmayer

i went ahead and added some documentation and suggested alternatives direct on this branch. Feedback welcome.

matthewmayer avatar Feb 14 '24 02:02 matthewmayer

Thank you @matthewmayer I rebased it, fixed a conflict and fixed some minor typos

LGTM πŸ‘

Shinigami92 avatar Feb 14 '24 08:02 Shinigami92

Please dont rebase unless necessary as it makes reviews harder.

ST-DDT avatar Feb 14 '24 09:02 ST-DDT

This will also need a migration guide snippet. Hopefully it can be quite short now and just link to the unique guide page.

matthewmayer avatar Feb 14 '24 11:02 matthewmayer

This will also need a migration guide snippet. Hopefully it can be quite short now and just link to the unique guide page.

added

Shinigami92 avatar Feb 14 '24 19:02 Shinigami92

I published a new version of enforce-unique. Now it supports exclude.

MansurAliKoroglu avatar Feb 23 '24 12:02 MansurAliKoroglu

Approved as per old team decision so it's no longer hard blocked, but I still think it's wrong.

I owe you a favor πŸ‘

Shinigami92 avatar Feb 24 '24 09:02 Shinigami92