-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Define action name to be as the function name #2262
Conversation
Do I need to make these changes also in v4 folder? |
Once the |
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.
LGTM, but perhaps add one more test where name
would be created within the test as non-configurable? To avoid regressions in the future.
How I can change functions |
Oh, that won't work because you are creating a new object for that check every time. That's not ideal, but I cannot think of a different approach. It could work with |
With |
You not missing anything, I haven't realized how is the check done. I suppose it would have to be enough. Complicating the code further for the sake of tests is probably not worth it. |
I agree :) |
Oh, btw, next time please don't tick the box that you have updated changelog. Clearly you did not and I forgot to check. Nevermind now, I will add it there directly |
This is awesome! BTW, why not do this in production mode too? |
@elektronik2k5 That would work only if the action name is passed as a string in the first arg. Function names are usually minified. It would be inconsistent. Besides, this is intended for debugging purposes mostly. |
@FredyC, digging a bit further into the code, I see it isn't that simple. I understand that and am not challenging it any further right now - and definitely not as part of this PR. However, I still want to address some of your assertions and perhaps we can improve it in the future:
You're right: function names are usually mangled. Practically always in browsers and often in node packages which go through a build/compilation step. However, that is not always the case:
Only if we let it be inconsistent.
In my view, debugging isn't a nice to have, but a first class feature of any tool/package I consider using. |
Thanks for taking the effort to create a PR!
If you are creating an extensive PR, you might want to open an issue with your idea first, so that you don't put a lot of effort in an PR that wouldn't be accepted. Please prepend pull requests with
WIP:
if they are not yet finishedPR checklist:
/docs
. For new functionality, at leastAPI.md
should be updatednpm run perf
)Feel free to ask help with any of these boxes!
The above process doesn't apply to doc updates etc.