Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: remove dynamic locale switching support #1735

Merged
merged 48 commits into from
Mar 7, 2023

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Jan 13, 2023

Closes #1340

Removes the ability to change the locale on existing Faker instances.

New Features

  • Access locales directly from the main index file (en_AU_ocker)
  • Access to all locales at once (allLocales.en_AU_ocker)
  • Access faker instances directly from the main index file (fakerEN_AU_ocker)
  • Access to all faker instances at once (allFakers.en_AU_ocker)
  • Useful locale fallback (en_AU_ocker -> en_AU -> en ( -> en if not already present ( -> global later))

Changed Features

  • The main faker instance is now en only

Lost Features

  • Changing locales dynamically
  • Getting a random locale from the faker instance (and switch to that)
  • UsableLocale, UsedLocale, KnownLocale types

ToDos for later PRs

@ST-DDT ST-DDT added needs documentation Documentations are needed p: 1-normal Nothing urgent do NOT merge yet Do not merge this PR into the target branch yet s: needs decision Needs team/maintainer decision c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs breaking change Cannot be merged when next version is not a major release labels Jan 13, 2023
@ST-DDT ST-DDT added this to the v8.0 - Module Re-Shuffling milestone Jan 13, 2023
@ST-DDT ST-DDT requested a review from a team as a code owner January 13, 2023 23:09
@ST-DDT ST-DDT self-assigned this Jan 13, 2023
@ST-DDT ST-DDT marked this pull request as draft January 13, 2023 23:09
@codecov
Copy link

codecov bot commented Jan 13, 2023

Codecov Report

Merging #1735 (b166fff) into next (a4d5203) will decrease coverage by 0.02%.
The diff coverage is 91.18%.

❗ Current head b166fff differs from pull request most recent head f3b1484. Consider uploading reports for the commit f3b1484 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1735      +/-   ##
==========================================
- Coverage   99.64%   99.62%   -0.02%     
==========================================
  Files        2355     2356       +1     
  Lines      236763   236565     -198     
  Branches     1158     1192      +34     
==========================================
- Hits       235919   235678     -241     
- Misses        822      865      +43     
  Partials       22       22              
Impacted Files Coverage Δ
src/faker.ts 87.64% <71.71%> (-7.83%) ⬇️
src/index.ts 100.00% <100.00%> (ø)
src/locale/af_ZA.ts 100.00% <100.00%> (ø)
src/locale/ar.ts 100.00% <100.00%> (ø)
src/locale/az.ts 100.00% <100.00%> (ø)
src/locale/cz.ts 100.00% <100.00%> (ø)
src/locale/de.ts 100.00% <100.00%> (ø)
src/locale/de_AT.ts 100.00% <100.00%> (ø)
src/locale/de_CH.ts 100.00% <100.00%> (ø)
src/locale/dv.ts 100.00% <100.00%> (ø)
... and 58 more

@ST-DDT ST-DDT marked this pull request as ready for review January 14, 2023 00:28
@ST-DDT ST-DDT requested a review from a team January 14, 2023 00:28
test/internet.spec.ts Outdated Show resolved Hide resolved
test/scripts/apidoc/examplesAndDeprecations.spec.ts Outdated Show resolved Hide resolved
test/support/seededRuns.ts Show resolved Hide resolved
src/modules/random/index.ts Show resolved Hide resolved
src/faker.ts Outdated Show resolved Hide resolved
src/faker.ts Show resolved Hide resolved
src/faker.ts Show resolved Hide resolved
docs/guide/upgrading.md Outdated Show resolved Hide resolved
@ST-DDT ST-DDT requested review from matthewmayer and a team March 5, 2023 17:45
@ST-DDT ST-DDT requested review from a team March 5, 2023 18:49
@Shinigami92
Copy link
Member

@matthewmayer do you have any more reviews you want to have into the PR before merging?
Otherwise pls approve so your hard blocking change request goes away

@matthewmayer
Copy link
Contributor

@matthewmayer do you have any more reviews you want to have into the PR before merging? Otherwise pls approve so your hard blocking change request goes away

sorry my bad i didnt realise that blocked merge. approved now.

I have some further ideas for improving migration guide but that can be saved for a seperate PR.

@ST-DDT ST-DDT enabled auto-merge (squash) March 7, 2023 09:06
@ST-DDT ST-DDT merged commit 9a35dc9 into next Mar 7, 2023
@ST-DDT ST-DDT deleted the refactor/remove-locale-changing branch March 7, 2023 09:20
@Shinigami92
Copy link
Member

🎉

I will try to find some time the next days to address #1748 again
Thanks to all of you to bring this forward
This was the most huge "bloker" / "stone" in our way to proceed to a new future of Faker 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Cannot be merged when next version is not a major release c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Locale de_xy: house numbers are after street name in Europe, not before Remove locale switching support
4 participants