Skip to content
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

Upgrade JS dependencies #1514

Merged
merged 7 commits into from
Jan 29, 2023
Merged

Upgrade JS dependencies #1514

merged 7 commits into from
Jan 29, 2023

Conversation

ahangarha
Copy link
Contributor

@ahangarha ahangarha commented Jan 28, 2023

In this PR, I have updated our JS dependencies to address several known security vulnerabilities. Amoung them and due to our urgency I resolved the issues with ansi-regex using resolutions entry in yarn.lock. This is a temporary fix due to complexities of upgrading eslint and other relevant dependencies (namely prettier-eslint-cli) to newer versions.

This change is Reviewable

@ahangarha ahangarha marked this pull request as draft January 28, 2023 14:38
@ahangarha ahangarha changed the title Upgrade JS dependencies WIP - Upgrade JS dependencies Jan 28, 2023
@ahangarha ahangarha force-pushed the fix-js-vulnerabilities branch 4 times, most recently from 381acaa to a019f7e Compare January 28, 2023 17:18
@ahangarha ahangarha marked this pull request as ready for review January 28, 2023 17:27
@ahangarha ahangarha changed the title WIP - Upgrade JS dependencies Upgrade JS dependencies Jan 28, 2023
CHANGELOG.md Outdated
@@ -17,6 +17,9 @@ Changes since last non-beta release.

*Please add entries here for your pull requests that are not yet released.*

### Fixed
- Upgrade several JS dependencies to knows security issues. [PR 1514](https://github.com/shakacode/react_on_rails/pull/1514) by [ahangarha](https://github.com/ahangarha)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upgrade several JS dependencies to fix security issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad! Editing several times and finally pushing a wrong sentence! 😞
Fixed ✅

package.json Outdated
@@ -53,6 +54,9 @@
"react": ">= 16",
"react-dom": ">= 16"
},
"resolutions": {
"ansi-regex": "^3.0.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed?

should be documented in the PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I explained in its own commit:

This is a temporary fix due to complexities of upgrading eslint and
other relevant dependencies (namely prettier-eslint-cli) to newer
versions.

Maybe I had to bring it to the PR body as well.

Since we had a kind of urgency in resolving high/critical vulnerabilities, I did a tradeoff and chose to use this approach for this particular package rather than spending hours or days to fix issues with upgrading prettier-eslint-cli, which required upgrading eslint and make modifications in our source code to address the breaking changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed ✅

"react": "^16.5.2",
"react-dom": "^16.5.2",
"prop-types": "^15.8.1",
"react": "^16.14.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is react not upgraded to 17 at least?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was no security issue with React. For such dependencies, I only pushed all minor versions. I thought it might be a development decision to use which version of React.

This is a temporary fix due to complexities of upgrading eslint and
other relevant dependencies (namely prettier-eslint-cli) to newer
versions.
@justin808 justin808 merged commit 34c9487 into master Jan 29, 2023
@justin808 justin808 deleted the fix-js-vulnerabilities branch January 29, 2023 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants