Skip to content

refactor!: remove dynamic locale switching support#1735

Merged
ST-DDT merged 48 commits intonextfrom
refactor/remove-locale-changing
Mar 7, 2023
Merged

refactor!: remove dynamic locale switching support#1735
ST-DDT merged 48 commits intonextfrom
refactor/remove-locale-changing

Conversation

@ST-DDT
Copy link
Copy Markdown
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
Copy Markdown

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

Comment thread test/locales.spec.ts
@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
Comment thread test/internet.spec.ts Outdated
Comment thread test/scripts/apidoc/examplesAndDeprecations.spec.ts Outdated
Comment thread test/support/seededRuns.ts
Comment thread src/modules/random/index.ts
Comment thread src/faker.ts Outdated
Comment thread src/faker.ts
Comment thread src/faker.ts
Comment thread docs/guide/upgrading.md Outdated
@ST-DDT ST-DDT requested review from a team and matthewmayer March 5, 2023 17:45
@ST-DDT ST-DDT requested review from a team March 5, 2023 18:49
@Shinigami92
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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