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 unused packages #1675

Merged
merged 2 commits into from
Aug 15, 2023
Merged

Conversation

anshgoyalevil
Copy link
Member

@anshgoyalevil anshgoyalevil commented Aug 14, 2023

Fixes a part of #1672

What changes is this PR making?

  • This PR removes the unused packages from packages/jaeger-ui
  • The removed packages are:
    • @types/testing-library__jest-dom
    • @types/react-copy-to-clipboard
    • @types/recompose
    • tar

Checklist

Signed-off-by: Ansh Goyal <[email protected]>
@codecov
Copy link

codecov bot commented Aug 14, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (78f94df) 96.01% compared to head (31ac656) 96.01%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1675   +/-   ##
=======================================
  Coverage   96.01%   96.01%           
=======================================
  Files         241      241           
  Lines        7560     7560           
  Branches     1985     1985           
=======================================
  Hits         7259     7259           
  Misses        301      301           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -15,8 +15,6 @@
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.0",
"@svgr/babel-plugin-transform-svg-component": "^8.0.0",
"@svgr/babel-preset": "^8.0.0",
Copy link
Member

Choose a reason for hiding this comment

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

how do we know these are not used by babel toolchain?

Copy link
Member Author

Choose a reason for hiding this comment

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

According to their NPM Readme's, they need to be included inside the .babelrc or in our case, babel-transform.js file.

Copy link
Member Author

@anshgoyalevil anshgoyalevil Aug 14, 2023

Choose a reason for hiding this comment

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

Also, according to its implementation guide, it can only be used after defining the @svgr/{plugin-name} in some file (For example, webpack, cli, node, nextjs), which I couldn't find anywhere inside the codebase.

Copy link
Member

Choose a reason for hiding this comment

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

can you look back in git history when they were added and why? were they used in the past?

Copy link
Member Author

Choose a reason for hiding this comment

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

@yurishkuro
Copy link
Member

@anshgoyalevil could you please resolve conflicts?

@anshgoyalevil
Copy link
Member Author

@yurishkuro Done 🚀

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

nice!

@yurishkuro yurishkuro merged commit c539d3f into jaegertracing:main Aug 15, 2023
yurishkuro pushed a commit that referenced this pull request Aug 15, 2023
Related to: #1675 and
#1672
<!--
!! Please DELETE this comment before posting.
We appreciate your contribution to the Jaeger project! 👋🎉
-->

## What changes is this PR making?
- This PR removes the unused packages from packages/jaeger-ui
- The removed packages are:
   - `@svgr/babel-plugin-transform-svg-component`
   - `@svgr/babel-preset`
   - `@types/react-dom`
   - `@types/react-router-redux`

## Description of the changes
- As per the discussion
#1226 (comment),
and the manual check.

Previously, I was reluctant in removing `@types/react-dom` and
`@types/react-router-redux` because their corresponding packages are
used, but I gave them a test by removing:
- run `yarn lint`
- no errors
- remove these two packages and again run `yarn lint`
- no errors
- maybe linter is not working correctly, so removed
`@types/react-window`
- run `yarn lint`
- type errors
- added back `@types/react-window` and run `yarn lint`
- no errors
- Thus, these two deps aren't needed

## How was this change tested?
- By running yarn lint and yarn test

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Ansh Goyal <[email protected]>
anshgoyalevil added a commit to anshgoyalevil/jaeger-ui that referenced this pull request Aug 16, 2023
part of jaegertracing#1672

## What changes is this PR making?
- This PR removes the unused packages from packages/jaeger-ui
- The removed packages are:
   - `@svgr/babel-plugin-transform-svg-component`
   - `@svgr/babel-preset`
   - `@types/testing-library__jest-dom`
   - `@types/react-copy-to-clipboard`
   - `@types/recompose`
   - `tar`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: Ansh Goyal <[email protected]>
anshgoyalevil added a commit to anshgoyalevil/jaeger-ui that referenced this pull request Aug 16, 2023
Related to: jaegertracing#1675 and
jaegertracing#1672
<!--
!! Please DELETE this comment before posting.
We appreciate your contribution to the Jaeger project! 👋🎉
-->

## What changes is this PR making?
- This PR removes the unused packages from packages/jaeger-ui
- The removed packages are:
   - `@svgr/babel-plugin-transform-svg-component`
   - `@svgr/babel-preset`
   - `@types/react-dom`
   - `@types/react-router-redux`

## Description of the changes
- As per the discussion
jaegertracing#1226 (comment),
and the manual check.

Previously, I was reluctant in removing `@types/react-dom` and
`@types/react-router-redux` because their corresponding packages are
used, but I gave them a test by removing:
- run `yarn lint`
- no errors
- remove these two packages and again run `yarn lint`
- no errors
- maybe linter is not working correctly, so removed
`@types/react-window`
- run `yarn lint`
- type errors
- added back `@types/react-window` and run `yarn lint`
- no errors
- Thus, these two deps aren't needed

## How was this change tested?
- By running yarn lint and yarn test

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Ansh Goyal <[email protected]>
yurishkuro added a commit that referenced this pull request Aug 16, 2023
## Which problem is this PR solving?
- Fixes #1672 

## Description of the changes
- This PR adds a step in the unit-test workflow to check for unused
dependencies using the depcheck package.
- Certain dependencies which are installed but still being given in the
output are put into `.depcheckrc.json` file to be ignored.
- The `--skip-missing` flag is also added to ignore the missing deps
warning

## How was this change tested?
- The `ignores` array without any dep in `.depcheckrc.json` file was
pushed to the branch for testing, and it was observed that the CI
failed, which is the required behaviour: Workflow Run:
https://github.com/anshgoyalevil/jaeger-ui/actions/runs/5854765474/job/15871258991
- The `ignores` array with all unused deps was pushed for CI testing,
and the CI passed the Depcheck flow. Workflow Run:
https://github.com/anshgoyalevil/jaeger-ui/actions/runs/5854816286/job/15871414318#step:6:10
(Ignore the Lint fail error, as it is resolved in this PR, but workflow
run is not available because target push branch was changed to `main` in
that commit, and thus workflow run is not available to be shared)

## Notes:
Before merging this PR, all the unused deps which are neither added to
the `ignores` array, not have been removed need to be removed. Thus PR
#1675 needs to be merged before this one.
After that, this PR's branch needs to be updated with that code so that
the Depcheck doesn't fail in CI for this or for upcoming PRs.

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Ansh Goyal <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: wck-iipi <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pavol Loffay <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
Co-authored-by: Wck-iipi <[email protected]>
@anshgoyalevil anshgoyalevil deleted the rm-unused-deps branch August 16, 2023 14:35
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