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

Remove Axios #2006

Merged
merged 27 commits into from
Jan 15, 2025
Merged

Remove Axios #2006

merged 27 commits into from
Jan 15, 2025

Conversation

addy-pathania
Copy link
Contributor

@addy-pathania addy-pathania commented Jan 8, 2025

Description / Motivation

This change is motivated by the security vulnerabilities found with the Axios library. This PR removes the default use of Axios for data fetching across the monorepo and transitions to the native fetch API.

Testing Details

  • Unit Test Added
  • Manual Test/Other (Please elaborate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@addy-pathania addy-pathania requested a review from a team January 8, 2025 14:12
Copy link
Contributor

@art-alexeyenko art-alexeyenko left a comment

Choose a reason for hiding this comment

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

Good work. Also a good catch that Native fetcher needs some extra unit tests.
Still, some things I'd like you to take a look at and adjust. Please check the comments.

@@ -47,15 +47,14 @@
"eslint": "^8.56.0",
"eslint-plugin-jsdoc": "48.7.0",
"mocha": "^10.2.0",
"nock": "^13.0.5",
"nock": "14.0.0-beta.7",
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to comment on why this specific version is used, for history.
Using beta version to fix this issue: nock/nock#2397 and allow testing for component library service
Using specific beta.7 version to not encounter this error: nock/nock#2789

packages/sitecore-jss/src/data-fetcher.ts Show resolved Hide resolved
packages/sitecore-jss/src/data-fetcher.ts Show resolved Hide resolved
packages/sitecore-jss/src/native-fetcher.test.ts Outdated Show resolved Hide resolved
packages/sitecore-jss/src/native-fetcher.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@illiakovalenko illiakovalenko left a comment

Choose a reason for hiding this comment

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

Overall looks good! See some questions/comments below
Applications are failing to build/start:

  1. Angular sxp
  2. Next.js styleguide application types check is failing
  3. Next.js xmcloud application types check is failing

CHANGELOG.md Outdated Show resolved Hide resolved
packages/sitecore-jss/src/native-fetcher.ts Outdated Show resolved Hide resolved
packages/sitecore-jss/src/native-fetcher.ts Outdated Show resolved Hide resolved
packages/sitecore-jss/src/native-fetcher.ts Show resolved Hide resolved
packages/sitecore-jss/src/native-fetcher.ts Outdated Show resolved Hide resolved
packages/sitecore-jss/src/native-fetcher.ts Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@illiakovalenko illiakovalenko left a comment

Choose a reason for hiding this comment

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

Looks good, it's close to be finished!
See one re-opened comment above, related to "headers" test, still missing

Copy link
Contributor

@art-alexeyenko art-alexeyenko left a comment

Choose a reason for hiding this comment

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

👍

@addy-pathania addy-pathania merged commit 8a4b494 into dev Jan 15, 2025
1 check passed
@addy-pathania addy-pathania deleted the bugfix/jss-1424-remove-axios branch January 15, 2025 23: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.

4 participants