-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
refactor(errors): one file per error #10355
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
Conversation
I don't really see the advantage of this, the error logic is far from complicated and all this does is increase load time. |
Codecov Report
@@ Coverage Diff @@
## master #10355 +/- ##
==========================================
- Coverage 96.28% 89.71% -6.57%
==========================================
Files 68 90 +22
Lines 9775 9726 -49
==========================================
- Hits 9412 8726 -686
- Misses 363 1000 +637
Continue to review full report at Codecov.
|
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.
@SimonSchick - I just tested on my machine here, using time-require:
I didn't compute the standard deviation for each case explicitly but the values ranged from ~330 to ~370 on both cases. To be honest I was surprised, I thought the load time would increase a lot more! Regardless, I believe this is a very small price to pay (the difference is eaten by the standard deviation!) for better readability and maintainability. @sushantdhiman Nice catch! You're right. By removing it, esdoc parses correctly the inheritance chain by default! Nice! I just did it. |
@papb that is weird, when I did the mass cleanups before it increased load times by almost 10% which is why I omitted it from my PR, I guess this depends on the system it's running. My previous test was using You should add trailing newlines btw. Also @sushantdhiman what's the deal with the manual |
@SimonSchick - I see... I am on windows on Node 6 (old, I know, I'll do something about it later). I've just added the trailing newlines as requested 😁 |
@SimonSchick Looks like that |
@sushantdhiman as a future note, this can be removed once support for v6 is dropped, iirc it was a workaround for prototype shenanigans pre v4. |
Pull Request check-list
Please make sure to review and check all of these items:
npm run test
ornpm run test-DIALECT
pass with this change (including linting)?Description of change
All errors were defined in a single huge file. This PR refactors it so that every error has its file, and uses a folder structure for the nested error types.
I encountered this when I was about to contribute with a new error, but I felt like refactoring this first.