-
-
Notifications
You must be signed in to change notification settings - Fork 935
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
docs(guide): add complex overwrites example #3207
Conversation
✅ Deploy Preview for fakerjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #3207 +/- ##
========================================
Coverage 99.95% 99.96%
========================================
Files 2798 2798
Lines 216718 216718
Branches 577 955 +378
========================================
+ Hits 216631 216642 +11
+ Misses 87 76 -11 |
Hmm this seems more like a "how to use typescript" than anything faker-specific. |
The entire section is more about raising awareness of concepts you could use with faker. A secondary goal is push users into this style of creating "faker" methods, so that they can more easily switch to standalone module functions (see the code examples in the alternatives section) if they would like to when we introduce them in v10. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this, since there was an explicit call out from some community members for this type of documentation.
However, I agree with Matthew that this content seems more related to general programming practices rather than faker specifically. Every programmer should be able to identify these situations as the a requirement for creation design pattern.
Our documentation primarily focuses on the factory pattern. Is it necessary to prime consumers towards a specific programming style, when other approaches, such as the builder pattern, might be better suited for their needs? While it’s not inherently bad, it might limit the flexibility for users to choose the best method for their particular use case.
Furthermore, I fear that the inclusion of documentation that focuses on the developer interaction with faker instead of the usage of faker might set expectations for our community that we don't want to get involved in.
I'll grudgingly approve 😂 Sometimes you see these kind of worked examples in a kind of "cookbook" section. Could be worth considering in future. |
Fixes #1508
The PR adds an additional example to the complex objects creation documentation.