Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Nov 12, 2024

Fixes #3058

Next steps: #3266

Meeting-Notes: 2024-11-07


This PR tries to lay the foundation of what is considered generic and what is specifically sexed:

  • Generic: Values that can be attributed to/used by either of male or female persons. (e.g. Dr.)
  • Female/Male: Values that can be attributed to specifically female/male (e.g. Mrs./Mr.)

It also changes the way how definitions are selected:

  • If generic is requested: Then only values that are specifically generic are returned, unless there are no such values.
  • If female/male is requested: Then the method will mostly (80%) return female/male values with some (20%) generic values sprinkled in. Since generic can explicitly be both, the generic elements don't cause any issues.

Please check whether the definitions/jsdoc are clear regarding their intentions and if you consider this definition to be correct.
We will clean up the locale data in separate PRs as this might affect lots of files/locales.

@ST-DDT ST-DDT added p: 1-normal Nothing urgent c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs m: person Something is referring to the person module labels Nov 12, 2024
@ST-DDT ST-DDT added this to the vAnytime milestone Nov 12, 2024
@ST-DDT ST-DDT requested review from a team November 12, 2024 21:33
@ST-DDT ST-DDT self-assigned this Nov 12, 2024
@netlify
Copy link

netlify bot commented Nov 12, 2024

Deploy Preview for fakerjs ready!

Name Link
🔨 Latest commit e011624
🔍 Latest deploy log https://app.netlify.com/projects/fakerjs/deploys/6930ce412acbbb00084708fb
😎 Deploy Preview https://deploy-preview-3259.fakerjs.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

❌ Patch coverage is 94.87179% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.97%. Comparing base (78c892b) to head (e011624).

Files with missing lines Patch % Lines
src/modules/person/index.ts 94.11% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #3259      +/-   ##
==========================================
- Coverage   99.97%   99.97%   -0.01%     
==========================================
  Files        2995     2995              
  Lines      236243   236266      +23     
  Branches      941      943       +2     
==========================================
+ Hits       236186   236208      +22     
- Misses         57       58       +1     
Files with missing lines Coverage Δ
src/definitions/person.ts 100.00% <ø> (ø)
src/modules/image/index.ts 100.00% <100.00%> (ø)
src/modules/person/index.ts 96.66% <94.11%> (-0.28%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@matthewmayer
Copy link
Contributor

matthewmayer commented Nov 14, 2024

I understand wanting to keep this PR small but I think it's difficult to decide if this is the right approach without reviewing what locale files will need to be updated too.

To clarify with this approach would we require the "generic", "female" and "male" options never have any items in common?

@ST-DDT
Copy link
Member Author

ST-DDT commented Nov 14, 2024

Team Decision

We will change the sexType method to return all SexType values.
A parameter includeGeneric: boolean = false can be used to control the inclusion of generic in the results.
We will check in v10 whether we want to change the default for includeGeneric based on code usage?

ST-DDT: Will create a stacked PR for the locale changes.

  • Things in both female and male -> generic
  • Things in generic -> remove from female and male
  • Without manual changes
  • The stacked PR might be later split in smaller chunks to help with reviewability

@ST-DDT
Copy link
Member Author

ST-DDT commented Nov 15, 2024

ST-DDT: Will create a stacked PR for the locale changes.

[...]

  • Without manual changes
  • The stacked PR might be later split in smaller chunks to help with reviewability

@xDivisionByZerox Currently, the person files aren't sorted, so this by itself causes a massive diff.
Should we sort them first? Would you like to create a PR for that or should I?

(Maybe start with only sorting first, because the cleanup PR will use the list for filtering: See #3266 (comment))

@ST-DDT
Copy link
Member Author

ST-DDT commented Dec 24, 2024

Updated the distribution to match the result from our team meeting.

Ready for review.

@ST-DDT
Copy link
Member Author

ST-DDT commented Feb 12, 2025

Read for review

matthewmayer
matthewmayer previously approved these changes Feb 14, 2025
@matthewmayer
Copy link
Contributor

Looks good to me, but I think let's wait till after 10.2.0 is released to merge it.

Then this as well as the follow on locale changes can be part of 10.3.0.

@xDivisionByZerox
Copy link
Member

Thanks for the input @matthewmayer 👍
I'll mark this PR with do NOT merge yet Do not merge this PR into the target branch yet to prevent us from merging it for now.

@xDivisionByZerox xDivisionByZerox added the do NOT merge yet Do not merge this PR into the target branch yet label Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs do NOT merge yet Do not merge this PR into the target branch yet m: person Something is referring to the person module p: 1-normal Nothing urgent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean up generic prefixes

6 participants