Skip to content

Upgrade JS dependencies#1514

Merged
justin808 merged 7 commits intomasterfrom
fix-js-vulnerabilities
Jan 29, 2023
Merged

Upgrade JS dependencies#1514
justin808 merged 7 commits intomasterfrom
fix-js-vulnerabilities

Conversation

@ahangarha
Copy link
Copy Markdown
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
Comment thread CHANGELOG.md Outdated
*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
Copy Markdown
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
Copy Markdown
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 ✅

Comment thread package.json Outdated
"react-dom": ">= 16"
},
"resolutions": {
"ansi-regex": "^3.0.1"
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed ✅

Comment thread package.json
"react": "^16.5.2",
"react-dom": "^16.5.2",
"prop-types": "^15.8.1",
"react": "^16.14.0",
Copy link
Copy Markdown
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
Copy Markdown
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.

@ahangarha ahangarha force-pushed the fix-js-vulnerabilities branch from 106c21f to 4b0dfdf Compare January 29, 2023 06:24
This is a temporary fix due to complexities of upgrading eslint and
other relevant dependencies (namely prettier-eslint-cli) to newer
versions.
@ahangarha ahangarha force-pushed the fix-js-vulnerabilities branch from 4b0dfdf to 18b93e2 Compare January 29, 2023 06:30
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