-
Notifications
You must be signed in to change notification settings - Fork 20
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
C2LC-575: Update react-scripts to version 5 #317
C2LC-575: Update react-scripts to version 5 #317
Conversation
* With the update, ESLint started generating 'no-use-before-define' warnings when a class method has a Flow annotation that states that the method returns an instance of itself. We use this pattern in the CharacterState and ProgramSequence classes. This commit adds comments to suppress these ESLint warnings. * Update the Netlify build to Node 14 (react-scripts version 5 no longer supports Node 12) * Update the GitHub Actions CI build to Node 14 and 16
With the update to react-scripts 5.0.0, flow-coverage-report is failing with an error similar to this issue filed against flow-coverage-report on 2021-10-21: rpl/flow-coverage-report#208
We should discuss in today's meeting, I think we can keep the flow coverage reporting if we simply switch to using |
I see that the CI checks already used |
Thanks Tony. This is the failure that I saw in CI: https://github.com/sbates-idrc/c2lc-coding-environment/runs/4597242223?check_suite_focus=true And the issue filed against |
I compared the output of It looks like five more medium severity vulnerabilities would be resolved if we updated node-sass, I filed C2LC-578 to cover that work. We still have some vulnerabilities brought in by react-scripts, these will be whitelisted when we work on C2LC-553. |
I compared the packed content sizes in the deployed develop-1.2 preview to those in this build, there were no red flags I could find. The updated version ends up producing a few kilobytes more content, but overall the speed seems fine. |
package.json
Outdated
@@ -7,18 +7,17 @@ | |||
"classnames": "2.3.1", | |||
"enzyme": "3.11.0", | |||
"enzyme-adapter-react-16": "1.15.6", | |||
"node-sass": "4.14.1", | |||
"node-sass": "7.0.0", |
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 didn't see that you had updated this already when I commented earlier and filed C2LC-578. If we're already updating, then we should go ahead and update to 7.0.1
.
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.
Done. Thanks.
src/CharacterState.js
Outdated
@@ -60,6 +60,7 @@ export default class CharacterState { | |||
return true; | |||
} | |||
|
|||
// eslint-disable-next-line no-use-before-define |
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.
Are there any circumstances in which this check is helpful to us? If not, maybe we should disable the rule rather than adding all these comments.
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.
That's a good question. Disabling the rule, would certainly make the code cleaner by not requiring these comments.
I think the rule offers some value but I think not a huge amount. I'll disable the rule and remove the comments. We can always reconsider. But I think minimizing the number of ESLint-specific comments is worthwhile.
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've disabled the "no-use-before-define" rule
I left a couple of minor comments, otherwise this looks good. |
See: https://issues.fluidproject.org/browse/C2LC-575