-
-
Notifications
You must be signed in to change notification settings - Fork 949
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
chore(helpers): deprecate invocations on non-functions for fakeEval #2913
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 #2913 +/- ##
==========================================
- Coverage 99.95% 99.95% -0.01%
==========================================
Files 2987 2987
Lines 216037 216052 +15
Branches 601 948 +347
==========================================
+ Hits 215944 215951 +7
- Misses 93 101 +8
|
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 don't really like introducing this change suddenly as it's likely to only be found at runtime.
If we don't want to support this syntax any more I think we could log a warning in v9 and error in v10 instead.
Team Decision
|
Fixed - ready for review |
Having a chore! is invalid 🤔 either it did not change runtime behavior or it is a breaking change 👀 |
I think it's no longer breaking so ! Should be removed but it should get a brief write up at the bottom of the migration guide. |
Example log: [@faker-js/faker]: Invoking expressions which are not functions is deprecated since v9.0 and will be removed in v10.0.
Please remove the parenthesis or replace the expression with an actual function.
person.first_name()
^ |
Co-authored-by: Matt Mayer <[email protected]>
4180bcf
This PR deprecates the current behavior of fake in preparion to be more consistent with standard JS behavior.
Would now print a deprecation warning.
In v10 would fail with an exception:
This PR is part of an attempt to solve some of the TODOs in our source code.