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 unnecessary resolutions from package.json #1298

Open
tmarkley opened this issue Feb 28, 2022 · 4 comments
Open

Remove unnecessary resolutions from package.json #1298

tmarkley opened this issue Feb 28, 2022 · 4 comments
Labels
dependencies Pull requests that update a dependency file needs more info Requires more information from poster refactor Tech debt related tasks that need refactoring technical debt If not paid, jeapardizes long-term success and maintainability of the repository.

Comments

@tmarkley
Copy link
Contributor

tmarkley commented Feb 28, 2022

There are many leftover resolutions from past fixes that are no longer relevant/necessary after recent changes. We need to attempt to remove as many manual resolutions as possible to clean up our dependencies. Some of them are bringing in libraries that are no longer in the dependency tree.

The following resolutions require additional changes/upgrades:

@types/node: @microsoft/api-documenter
ansi-regex: many upstream dependencies, see #1084
async: @elastic/makelogs, grunt-contrib-clean, ejs, webpack-dev-server
d3-color: @elastic/charts
glob-parent: eslint, chokidar, webpack, mocha, chromedriver, parcy/cli, and more
hoist-non-react-statics: react-intl
json-schema: webpack #1118
kind-of: is-number, define-property, micromatch, @types/globby
loader-utils: webpack #1118
node-jose: @elastic/request-crypto
nth-check: css-select, cheerio, typescript, enzyme
trim: eui, react-markdown, jimp
typescript: osd, eui
unset-value: webpack #1118

@tmarkley tmarkley added the dependencies Pull requests that update a dependency file label Feb 28, 2022
@tmarkley tmarkley self-assigned this Feb 28, 2022
@tmarkley tmarkley added the refactor Tech debt related tasks that need refactoring label Feb 28, 2022
@tmarkley
Copy link
Contributor Author

The following resolutions require additional changes/upgrades:

@types/node: @microsoft/api-documenter
front-matter: sass-lint
glob-parent: eslint, chokidar, webpack, mocha, chromedriver, parcy/cli, and more
hoist-non-react-statics: react-intl
kind-of: is-number, define-property, micromatch, @types/globby
merge: sass-lint
minimist: sass-lint
node-jose: @elastic/request-crypto
trim: eui, react-markdown, jimp
typescript: osd, eui

tmarkley pushed a commit to tmarkley/OpenSearch-Dashboards that referenced this issue Feb 28, 2022
* Many of these resolutions brought in libraries that were no longer in
  the dependency tree. Those could be removed without any changes.
* Upgrades `geckodriver` from v1.21.0 to v3.0.1.
  * No breaking changes: [CHANGELOG](https://github.com/vladikoff/node-geckodriver/tree/v3.0.1#changelog)
* Upgrades `load-grunt-config` from v3.0.1 to v4.0.1.
  * No breaking changes: [CHANGELOG](https://github.com/firstandthird/load-grunt-config/blob/4.0.1/CHANGELOG.md)
* Bumps `ejs` from v3.1.5 to v3.1.6 and
  `@types/ejs` from v3.0.4 to v3.1.0.

Partially addresses opensearch-project#1298

Signed-off-by: Tommy Markley <markleyt@amazon.com>
tmarkley pushed a commit to tmarkley/OpenSearch-Dashboards that referenced this issue Mar 1, 2022
* Many of these resolutions brought in libraries that were no longer in
  the dependency tree. Those could be removed without any changes.
* Upgrades `geckodriver` from v1.21.0 to v3.0.1.
  * No breaking changes: [CHANGELOG](https://github.com/vladikoff/node-geckodriver/tree/v3.0.1#changelog)
* Upgrades `load-grunt-config` from v3.0.1 to v4.0.1.
  * No breaking changes: [CHANGELOG](https://github.com/firstandthird/load-grunt-config/blob/4.0.1/CHANGELOG.md)
* Bumps `ejs` from v3.1.5 to v3.1.6 and
  `@types/ejs` from v3.0.4 to v3.1.0.

Partially addresses opensearch-project#1298

Signed-off-by: Tommy Markley <markleyt@amazon.com>
tmarkley pushed a commit that referenced this issue Mar 2, 2022
* Many of these resolutions brought in libraries that were no longer in
  the dependency tree. Those could be removed without any changes.
* Upgrades `geckodriver` from v1.21.0 to v3.0.1.
  * No breaking changes: [CHANGELOG](https://github.com/vladikoff/node-geckodriver/tree/v3.0.1#changelog)
* Upgrades `load-grunt-config` from v3.0.1 to v4.0.1.
  * No breaking changes: [CHANGELOG](https://github.com/firstandthird/load-grunt-config/blob/4.0.1/CHANGELOG.md)
* Bumps `ejs` from v3.1.5 to v3.1.6 and
  `@types/ejs` from v3.0.4 to v3.1.0.

Partially addresses #1298

Signed-off-by: Tommy Markley <markleyt@amazon.com>
@tmarkley
Copy link
Contributor Author

Async (after addressing #1440):

$ yarn why async
yarn why v1.22.17
[1/4] Why do we have the module "async"...?
[2/4] Initialising dependency graph...
warning Resolution field "typescript@4.0.2" is incompatible with requested version "typescript@~4.5.2"
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "async@3.2.3"
info Has been hoisted to "async"
info Reasons this module exists
   - "workspace-aggregator-c0722a78-ad95-4f99-ae26-c77d29b69f1b" depends on it
   - Hoisted from "_project_#getos#async"
   - Hoisted from "_project_#archiver#async"
info Disk size without dependencies: "1.08MB"
info Disk size with unique dependencies: "1.08MB"
info Disk size with transitive dependencies: "1.08MB"
info Number of shared dependencies: 0
=> Found "@elastic/makelogs#async@1.5.2"
info This module exists because "_project_#@elastic#makelogs" depends on it.
info Disk size without dependencies: "180KB"
info Disk size with unique dependencies: "180KB"
info Disk size with transitive dependencies: "180KB"
info Number of shared dependencies: 0
=> Found "@osd/ui-framework#async@2.6.3"
info Reasons this module exists
   - "_project_#@osd#ui-framework#grunt-contrib-clean" depends on it
   - Hoisted from "_project_#@osd#ui-framework#grunt-contrib-clean#async"
   - in the nohoist list ["/_project_/**/@types/*","/_project_/**/@types/*/**","/_project_/**/grunt-*","/_project_/**/grunt-*/**","/_project_/@elastic/eui/rehype-react","/_project_/@elastic/eui/remark-rehype","/_project_/@elastic/eui/remark-rehype/**"]
info Disk size without dependencies: "852KB"
info Disk size with unique dependencies: "5.71MB"
info Disk size with transitive dependencies: "5.71MB"
info Number of shared dependencies: 1
=> Found "grunt#async@3.2.3"
info Reasons this module exists
   - "_project_#grunt#grunt-legacy-util" depends on it
   - Hoisted from "_project_#grunt#grunt-legacy-util#async"
   - in the nohoist list ["/_project_/**/@types/*","/_project_/**/@types/*/**","/_project_/**/grunt-*","/_project_/**/grunt-*/**","/_project_/@elastic/eui/rehype-react","/_project_/@elastic/eui/remark-rehype","/_project_/@elastic/eui/remark-rehype/**"]
info Disk size without dependencies: "1.08MB"
info Disk size with unique dependencies: "1.08MB"
info Disk size with transitive dependencies: "1.08MB"
info Number of shared dependencies: 0
=> Found "jake#async@0.9.2"
info This module exists because "_project_#@osd#plugin-generator#ejs#jake" depends on it.
info Disk size without dependencies: "120KB"
info Disk size with unique dependencies: "120KB"
info Disk size with transitive dependencies: "120KB"
info Number of shared dependencies: 0
=> Found "portfinder#async@2.6.3"
info This module exists because "_project_#@osd#ui-framework#webpack-dev-server#portfinder" depends on it.
info Disk size without dependencies: "852KB"
info Disk size with unique dependencies: "5.71MB"
info Disk size with transitive dependencies: "5.71MB"
info Number of shared dependencies: 1
Done in 1.11s.
$ npm ls async
opensearch-dashboards@2.0.0 /home/ubuntu/ws/OpenSearch-Dashboards
├─┬ @elastic/makelogs@6.1.0
│ └── async@1.5.2 
├─┬ @osd/plugin-generator@1.0.0 -> /home/ubuntu/ws/OpenSearch-Dashboards/packages/osd-plugin-generator
│ └─┬ ejs@3.1.6
│   └─┬ jake@10.8.4
│     └── async@0.9.2 
├─┬ archiver@5.3.0
│ └── async@3.2.3 
├─┬ getos@3.2.1
│ └── async@3.2.3  deduped
└─┬ grunt@1.4.1
  └─┬ grunt-legacy-util@2.0.1
    └── async@3.2.3 

@tmarkley tmarkley mentioned this issue Apr 13, 2022
7 tasks
@tmarkley tmarkley removed their assignment May 23, 2022
@tmarkley tmarkley added the technical debt If not paid, jeapardizes long-term success and maintainability of the repository. label May 25, 2022
@tmarkley
Copy link
Contributor Author

tmarkley commented Dec 3, 2022

Details for unset-value

After removing the manual resolution:

$ yarn why unset-value
yarn why v1.22.15
[1/4] Why do we have the module "unset-value"...?
[2/4] Initialising dependency graph...
warning Resolution field "typescript@4.0.2" is incompatible with requested version "typescript@~4.5.2"
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "unset-value@1.0.0"
info Reasons this module exists
   - "_project_#braces#snapdragon#base#cache-base" depends on it
   - Hoisted from "_project_#braces#snapdragon#base#cache-base#unset-value"
info Disk size without dependencies: "88KB"
info Disk size with unique dependencies: "128KB"
info Disk size with transitive dependencies: "208KB"
info Number of shared dependencies: 6
=> Found "@types/globby#unset-value@1.0.0"
info Reasons this module exists
   - "_project_#@types#globby#fast-glob#micromatch#snapdragon#base#cache-base" depends on it
   - Hoisted from "_project_#@types#globby#fast-glob#micromatch#snapdragon#base#cache-base#unset-value"
   - in the nohoist list ["/_project_/**/@types/*","/_project_/**/@types/*/**","/_project_/**/grunt-*","/_project_/**/grunt-*/**","/_project_/@elastic/eui/rehype-react","/_project_/@elastic/eui/remark-rehype","/_project_/@elastic/eui/remark-rehype/**"]
info Disk size without dependencies: "96KB"
info Disk size with unique dependencies: "136KB"
info Disk size with transitive dependencies: "216KB"
info Number of shared dependencies: 6
=> Found "@osd/optimizer#unset-value@1.0.0"
info Reasons this module exists
   - "_project_#@osd#optimizer#@types#watchpack#chokidar#braces#snapdragon#base#cache-base" depends on it
   - Hoisted from "_project_#@osd#optimizer#@types#watchpack#chokidar#braces#snapdragon#base#cache-base#unset-value"
   - in the nohoist list ["/_project_/**/@types/*","/_project_/**/@types/*/**","/_project_/**/grunt-*","/_project_/**/grunt-*/**","/_project_/@elastic/eui/rehype-react","/_project_/@elastic/eui/remark-rehype","/_project_/@elastic/eui/remark-rehype/**"]
info Disk size without dependencies: "96KB"
info Disk size with unique dependencies: "136KB"
info Disk size with transitive dependencies: "216KB"
info Number of shared dependencies: 6
=> Found "@osd/pm#unset-value@1.0.0"
info Reasons this module exists
   - "_project_#@osd#pm#@types#globby#fast-glob#micromatch#snapdragon#base#cache-base" depends on it
   - Hoisted from "_project_#@osd#pm#@types#globby#fast-glob#micromatch#snapdragon#base#cache-base#unset-value"
   - in the nohoist list ["/_project_/**/@types/*","/_project_/**/@types/*/**","/_project_/**/grunt-*","/_project_/**/grunt-*/**","/_project_/@elastic/eui/rehype-react","/_project_/@elastic/eui/remark-rehype","/_project_/@elastic/eui/remark-rehype/**"]
info Disk size without dependencies: "96KB"
info Disk size with unique dependencies: "136KB"
info Disk size with transitive dependencies: "216KB"
info Number of shared dependencies: 6
Done in 1.33s.

$ npm list unset-value
opensearch-dashboards@3.0.0 /workspaces/OpenSearch-Dashboards
├─┬ @osd/eslint-plugin-eslint@1.0.0 -> /workspaces/OpenSearch-Dashboards/packages/osd-eslint-plugin-eslint
│ └─┬ micromatch@3.1.10
│   └─┬ snapdragon@0.8.2
│     └─┬ base@0.11.2
│       └─┬ cache-base@1.0.1
│         └── unset-value@1.0.0 
└─┬ @types/globby@8.0.0
  └─┬ fast-glob@2.2.7
    └─┬ micromatch@3.1.10
      └─┬ snapdragon@0.8.2
        └─┬ base@0.11.2
          └─┬ cache-base@1.0.1
            └── unset-value@1.0.0 

After upgrading globby and removing the micromatch dependency:

$ yarn why unset-value
yarn why v1.22.15
[1/4] Why do we have the module "unset-value"...?
[2/4] Initialising dependency graph...
warning Resolution field "typescript@4.0.2" is incompatible with requested version "typescript@~4.5.2"
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "unset-value@1.0.0"
info Reasons this module exists
   - "_project_#braces#snapdragon#base#cache-base" depends on it
   - Hoisted from "_project_#braces#snapdragon#base#cache-base#unset-value"
info Disk size without dependencies: "88KB"
info Disk size with unique dependencies: "128KB"
info Disk size with transitive dependencies: "208KB"
info Number of shared dependencies: 6
=> Found "@osd/optimizer#unset-value@1.0.0"
info Reasons this module exists
   - "_project_#@osd#optimizer#@types#watchpack#chokidar#braces#snapdragon#base#cache-base" depends on it
   - Hoisted from "_project_#@osd#optimizer#@types#watchpack#chokidar#braces#snapdragon#base#cache-base#unset-value"
   - in the nohoist list ["/_project_/**/@types/*","/_project_/**/@types/*/**","/_project_/**/grunt-*","/_project_/**/grunt-*/**","/_project_/@elastic/eui/rehype-react","/_project_/@elastic/eui/remark-rehype","/_project_/@elastic/eui/remark-rehype/**"]
info Disk size without dependencies: "96KB"
info Disk size with unique dependencies: "136KB"
info Disk size with transitive dependencies: "216KB"
info Number of shared dependencies: 6
Done in 1.41s.

$ npm list unset-value
opensearch-dashboards@3.0.0 /workspaces/OpenSearch-Dashboards
└─┬ @osd/eslint-import-resolver-opensearch-dashboards@2.0.0 -> /workspaces/OpenSearch-Dashboards/packages/osd-eslint-import-resolver-opensearch-dashboards
  └─┬ webpack@4.46.0
    └─┬ micromatch@3.1.10
      └─┬ snapdragon@0.8.2
        └─┬ base@0.11.2
          └─┬ cache-base@1.0.1
            └── unset-value@1.0.0 

Thus, the webpack upgrade is blocking this.

@joshuarrrr
Copy link
Member

@tmarkley Can you provide a little more context on this issue to make it more actionable for other potential contributors?

There are many leftover resolutions from past fixes that are no longer relevant/necessary after recent changes

What's the best way to identify these? What was your process for generating the list?

We need to attempt to remove as many manual resolutions as possible to clean up our dependencies. Some of them are bringing in libraries that are no longer in the dependency tree.

Can you explain a little more about what the potential consequences, risks, or problems with these resolutions? Having a clear description of the impact makes it easier to prioritize.

Finally, can you outline the general steps that an interested contributor should take to remove or resolve one of these resolutions?

@joshuarrrr joshuarrrr added the needs more info Requires more information from poster label Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file needs more info Requires more information from poster refactor Tech debt related tasks that need refactoring technical debt If not paid, jeapardizes long-term success and maintainability of the repository.
Projects
None yet
Development

No branches or pull requests

2 participants