diff options
| author | Shinigami <[email protected]> | 2024-02-25 10:30:18 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-02-25 10:30:18 +0100 |
| commit | a9dc7017b4a2b2bf79c42fe947de6029fae5e937 (patch) | |
| tree | 413e33e1ef0e8a94c33fa420b3eb1ed2edb115d0 /docs | |
| parent | 260ffc6cc8ff2ead96aaa7ae8c55c94f43333156 (diff) | |
| download | faker-a9dc7017b4a2b2bf79c42fe947de6029fae5e937.tar.xz faker-a9dc7017b4a2b2bf79c42fe947de6029fae5e937.zip | |
refactor!: remove v8 deprecated faker class parts (#2682)
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/guide/upgrading_v9/2682.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/guide/upgrading_v9/2682.md b/docs/guide/upgrading_v9/2682.md new file mode 100644 index 00000000..491b4cfe --- /dev/null +++ b/docs/guide/upgrading_v9/2682.md @@ -0,0 +1,22 @@ +### Remove deprecated faker constructor and deprecated JS backwards compatibility + +Removed deprecated faker constructor, so it is not possible anymore to just pass a locale string identifier. + +Also removed the accessors and method that were only for JS backwards compatibility. + +- `get/set locales` +- `get/set locale` +- `get/set localeFallback` +- `setLocale` + +To use the new constructor, you need to pass a locale object like: + +```ts +import { Faker, es, base } from '@faker-js/faker'; + +// A custom faker instance that does not have any fallbacks +const customEsFakerWithoutFallback = new Faker({ locale: es }); + +// A custom faker instance that has only base-data as fallback, but not english data +const customEsFakerWithFallback = new Faker({ locale: [es, base] }); +``` |
