faker
faker copied to clipboard
Split the Faker class into smaller units
Clear and concise description of the problem
Currently the main Faker class contains many features most users don't need in their application.
Suggested solution
The main Faker class should be split into multiple units that build on top of each other:
- CoreFaker (only seed and rng logic)
- BaseFaker extends CoreFaker (all modules that don't depend on locales
- LocalizedFaker extends BaseFaker (locale support, but no locale modules yet)
- Faker extends LocalizedFaker (all default modules, same as now)
See also: https://github.com/faker-js/faker/discussions/805#discussioncomment-2690233
That way could users could just use baseFaker.string.uuid() and have a very minimal footprint after tree shaking.
The class names aren't final yet. This needs to be documented properly.
Alternative
No response
Additional context
No response