-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Correct msgWithReference logic in FES to fix issue 5576 #6221
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
Correct msgWithReference logic in FES to fix issue 5576 #6221
Conversation
🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page! |
@Ayush23Dash the change u made makes sense + looks good to me as far as i can tell. that said, when testing this locally i noticed something potentially off. first i tested issue #5576 by reproducing it locally using the version of p5.js i had cloned at the start of GSoC, as expected i got the same error reported in the issue with the link to the wrong doc:
looking at ur code it seems like a great way to fix the issue, but just to do my due diligence i pulled ur changes to my local machine, built the library (
realizing that the changes i pulled included a lot more than the change u had made (because it had been a couple of weeks since i pulled from upstream) I then ran the same experiment with the latest main branch and got the same result. @almchung any idea why this is the case? i'm assuming what we would want to see in the console is something more like this right?
|
Thanks for the thorough update @nbriz. This seems like a weird issue, I will check in and then discuss it over our meet! |
hey @Qianqianye + @almchung i just finished meeting with @Ayush23Dash && as mentioned in my previous comment it seems like there have been changes elsewhere in the code base that prevent me/us from fully testing Ayush's change, but I'm fairly certain the change made would solve issue #5576 so my recommendation would be to merge this && close that issue. is that something I should do myself, or is that something u'll do @Qianqianye (i'm still learning the workflow + protocols 😅) |
Thanks @nbriz! I have added you to the list of contributors who can merge PRs directly, so please feel free to go ahead and merge this one. You can read more about the workflow in the steward guide. I also pasted the PR merge workflow below:
|
Hey @Qianqianye @nbriz |
src/core/friendly_errors/fes_core.js
Outdated
msgWithReference = `${message} (http://p5js.org/reference/#/${referenceSection}/${funcName})`; | ||
|
||
//Whenever func having p5.[Class] is encountered, we need to have the error link as mentioned below else different link | ||
funcName.substring(0,2) === 'p5.' ? |
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.
funcName.startsWith('p5.') ?
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.
oh wow! when was this method added to JS strings? don't think i'd seen it before. thnx @wuyudi
it's not completely necessary, but it would be easier for other contributors to read/understand, what do u think @Ayush23Dash
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.
when was this method added to JS strings?
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.
ah! thnx for pointing me to the steward guide @Qianqianye just read through it (makes perfect sense), only question i have is where do i call the "all-contributors"? is that a comment i should leave here in the PR (before or after it's closed? does it matter?) or somewhere else? @Ayush23Dash as far as I can tell from looking at the rebase and resolve conflicts in the contributor guidelines, nothing more is needed git-wise (seeing as there are no conflicts && only the necessary files were changed + commits made) but considering that this is our first GSoC FES PR, i'll let @Qianqianye confirm this before i merge :) |
src/core/friendly_errors/fes_core.js
Outdated
@@ -144,7 +144,7 @@ if (typeof IS_MINIFIED !== 'undefined') { | |||
methodParts.length === 1 ? func : methodParts.slice(2).join('/'); | |||
|
|||
//Whenever func having p5.[Class] is encountered, we need to have the error link as mentioned below else different link | |||
funcName.substring(0,2) === 'p5.' ? | |||
funcName.startsWith(0,2) === 'p5.' ? |
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.
did u test this? i think the first argument of startsWith needs to be a string
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.
Apologies, fixed and tested it as well now!
ok @Qianqianye @almchung @Ayush23Dash @wuyudi merging our first FES-GSoC-2023 PR! 🥳 @all-contributors please add @Ayush23Dash for 'code' |
This project's configuration file has malformed JSON: .all-contributorsrc. Error:: Unexpected token ] in JSON at position 106406 |
@all-contributors please add @Ayush23Dash for code |
This project's configuration file has malformed JSON: .all-contributorsrc. Error:: Unexpected token ] in JSON at position 106406 |
@all-contributors please add @nbriz for review |
I've put up a pull request to add @nbriz! 🎉 |
@all-contributors please add @Ayush23Dash for code |
I've put up a pull request to add @Ayush23Dash! 🎉 |
Thank you all for working on this. There was a small error in the allcontributors doc earlier. I just added both @Ayush23Dash and @nbriz! 🎉 |
Resolves [#5576 ]
Changes:
Whenever a function having p5.[Class] in its name encounters an error, we need to have the a different FES error link as compared to when a different p5 function name encounters error.
This issue fixes #5576
Screenshots of the change:
PR Checklist
npm run lint
passes