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

ref(ui): Remove qs imports, not a dependency #77972

Merged
merged 1 commit into from
Sep 23, 2024
Merged

Conversation

scttcper
Copy link
Member

We do not have qs as a direct dependency. It works anyway because we have it as a sub dependency, but we shouldn't import things that aren't dependencies. This could be a eslint rule we enable.

yarn why qs

=> Found "qs@6.11.0"
info Reasons this module exists
   - "webpack-dev-server#express" depends on it
   - Hoisted from "webpack-dev-server#express#qs"
   - Hoisted from "@rsdoctor#webpack-plugin#@rsdoctor#sdk#body-parser#qs"

We do not have `qs` as a direct dependency. It works anyway because we have it as a sub dependency, but we shouldn't import things that aren't dependencies.

```
   - "webpack-dev-server#express" depends on it
   - Hoisted from "webpack-dev-server#express#qs"
   - Hoisted from "@RSdoctor#webpack-plugin#@RSdoctor#sdk#body-parser#qs"
```
@scttcper scttcper requested a review from a team September 23, 2024 19:15
@scttcper scttcper requested review from a team as code owners September 23, 2024 19:15
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Sep 23, 2024
Copy link
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

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

I was going to ask if qs and query-string have identical behaviour, but all the tests pass so I guess that's the answer I wanted

@scttcper
Copy link
Member Author

scttcper commented Sep 23, 2024

i think array formatting is usually the only one that matters for us. EDIT: It doesn't seem to be the same

import queryString from 'query-string';

queryString.stringify({foo: [1, 2, 3]});
//=> 'foo=1&foo=2&foo=3'
qs.stringify({ a: ['b', 'c', 'd'] });
// 'a[0]=b&a[1]=c&a[2]=d'

@scttcper
Copy link
Member Author

scttcper commented Sep 23, 2024

i don't see any arrays being formatted

@scttcper scttcper merged commit 3d302dd into master Sep 23, 2024
42 checks passed
@scttcper scttcper deleted the scttcper/remove-qs branch September 23, 2024 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants