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

The README section 'Usage' mentions example code that does not exist. #2392

Closed
7 of 10 tasks
HenryHall opened this issue Sep 13, 2023 · 3 comments · Fixed by #2433
Closed
7 of 10 tasks

The README section 'Usage' mentions example code that does not exist. #2392

HenryHall opened this issue Sep 13, 2023 · 3 comments · Fixed by #2433
Assignees
Labels
c: bug Something isn't working c: docs Improvements or additions to documentation p: 1-normal Nothing urgent
Milestone

Comments

@HenryHall
Copy link

Pre-Checks

Describe the bug

https://github.com/faker-js/faker/blob/next/README.md?plain=1#L84

The above link directs to a README line which mentions a commented out bit of code for importing faker from a single locale. However that bit of code does not exist!

Minimal reproduction code

No response

Additional Context

No response

Environment Info

N/A

Which module system do you use?

  • CJS
  • ESM

Used Package Manager

npm

@HenryHall HenryHall added c: bug Something isn't working s: pending triage Pending Triage labels Sep 13, 2023
@matthewmayer matthewmayer added the c: docs Improvements or additions to documentation label Sep 13, 2023
@matthewmayer
Copy link
Contributor

We could probably remove this whole paragraph, it's already explained better at https://fakerjs.dev/guide/localization.html#individual-localized-packages:

The above code indicates a basic usage of Faker.
The point of interest is the import statements at the top.
The first import indicates how one can import the entirety of Faker, which includes every locale, while the commented-out import showcases how to import only a single locale.
In most situations, importing a single locale is preferable for performance because some testing frameworks reload imports for every test file, which causes startup latencies to add up quickly.
Thus, limiting the import to a single locale can speed up startup times.

@HenryHall
Copy link
Author

It looks like it was intentionally included in this section of the readme to 'hint' at options for better performance.

@ST-DDT
Copy link
Member

ST-DDT commented Oct 5, 2023

Sorry, for the late response.
The section is indeed outdated and should be removed, because since v8.0 faker instances only contain a single locale and not multiple as before.

Will be fixed in #2433

@ST-DDT ST-DDT self-assigned this Oct 5, 2023
@ST-DDT ST-DDT added p: 1-normal Nothing urgent and removed s: pending triage Pending Triage labels Oct 5, 2023
@ST-DDT ST-DDT added this to the vAnytime milestone Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working c: docs Improvements or additions to documentation p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants