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

hiddenClients property doesnt hide clients #1250

Closed
Lumca opened this issue Mar 20, 2024 · 6 comments
Closed

hiddenClients property doesnt hide clients #1250

Lumca opened this issue Mar 20, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@Lumca
Copy link

Lumca commented Mar 20, 2024

What happens?

It stays as it is, even when empty array is passed, it doesnt show clients that are not shown by default

What did you expect to happen?

Hide the clients

Or that could be a feature where can I set which clients I want to show, we want to show just a HTTP1.1.
But the feature for hidding is good enough

How can we reproduce the issue?

Set for example hiddenClients: [node] in ApiReference

Thanks for checking! :)

Swagger/OpenAPI Example

No response

@Lumca Lumca added the bug Something isn't working label Mar 20, 2024
@hanspagel
Copy link
Member

Thanks for the report! I’ll fix that.

@hanspagel hanspagel self-assigned this Mar 20, 2024
HelgeSverre added a commit to HelgeSverre/scalar that referenced this issue Apr 5, 2024
…httpClients() hook, it will only run once (which was probably done due to performance benefits), however this breaks this feature as only the DEFAULT_EXCLUDED_CLIENTS will be applied the first time this runs, and the next time this is meant to run to filter the targets and clients based on the provided user configuration, it is not updated, aka, doesnt work, this is references in scalar#1250.

This commit fixes the bug, and retains the performance benefit by caching the target list using watchEffect to only update/recompute the target list when the configuration changes.
Next i will implement the inverse of this, and add the ability to specify clients in specific targets to ignore/include, as currently, if you hide "curl", you hide both the curl CLI tool and the php "curl" client, which is probably not intentional.
hanspagel pushed a commit that referenced this issue Apr 30, 2024
…httpClients() hook, it will only run once (which was probably done due to performance benefits), however this breaks this feature as only the DEFAULT_EXCLUDED_CLIENTS will be applied the first time this runs, and the next time this is meant to run to filter the targets and clients based on the provided user configuration, it is not updated, aka, doesnt work, this is references in #1250.

This commit fixes the bug, and retains the performance benefit by caching the target list using watchEffect to only update/recompute the target list when the configuration changes.
Next i will implement the inverse of this, and add the ability to specify clients in specific targets to ignore/include, as currently, if you hide "curl", you hide both the curl CLI tool and the php "curl" client, which is probably not intentional.
hanspagel pushed a commit to HelgeSverre/scalar that referenced this issue May 6, 2024
…httpClients() hook, it will only run once (which was probably done due to performance benefits), however this breaks this feature as only the DEFAULT_EXCLUDED_CLIENTS will be applied the first time this runs, and the next time this is meant to run to filter the targets and clients based on the provided user configuration, it is not updated, aka, doesnt work, this is references in scalar#1250.

This commit fixes the bug, and retains the performance benefit by caching the target list using watchEffect to only update/recompute the target list when the configuration changes.
Next i will implement the inverse of this, and add the ability to specify clients in specific targets to ignore/include, as currently, if you hide "curl", you hide both the curl CLI tool and the php "curl" client, which is probably not intentional.
hanspagel pushed a commit to HelgeSverre/scalar that referenced this issue May 6, 2024
…httpClients() hook, it will only run once (which was probably done due to performance benefits), however this breaks this feature as only the DEFAULT_EXCLUDED_CLIENTS will be applied the first time this runs, and the next time this is meant to run to filter the targets and clients based on the provided user configuration, it is not updated, aka, doesnt work, this is references in scalar#1250.

This commit fixes the bug, and retains the performance benefit by caching the target list using watchEffect to only update/recompute the target list when the configuration changes.
Next i will implement the inverse of this, and add the ability to specify clients in specific targets to ignore/include, as currently, if you hide "curl", you hide both the curl CLI tool and the php "curl" client, which is probably not intentional.
hanspagel pushed a commit to HelgeSverre/scalar that referenced this issue May 6, 2024
…httpClients() hook, it will only run once (which was probably done due to performance benefits), however this breaks this feature as only the DEFAULT_EXCLUDED_CLIENTS will be applied the first time this runs, and the next time this is meant to run to filter the targets and clients based on the provided user configuration, it is not updated, aka, doesnt work, this is references in scalar#1250.

This commit fixes the bug, and retains the performance benefit by caching the target list using watchEffect to only update/recompute the target list when the configuration changes.
Next i will implement the inverse of this, and add the ability to specify clients in specific targets to ignore/include, as currently, if you hide "curl", you hide both the curl CLI tool and the php "curl" client, which is probably not intentional.
@SlavaSereb
Copy link

Hey @hanspagel I can see that you're extensively working on the fix, thank you!

Any estimated time for pushing it?

@hanspagel
Copy link
Member

Very soon :)

hanspagel pushed a commit to HelgeSverre/scalar that referenced this issue May 8, 2024
…httpClients() hook, it will only run once (which was probably done due to performance benefits), however this breaks this feature as only the DEFAULT_EXCLUDED_CLIENTS will be applied the first time this runs, and the next time this is meant to run to filter the targets and clients based on the provided user configuration, it is not updated, aka, doesnt work, this is references in scalar#1250.

This commit fixes the bug, and retains the performance benefit by caching the target list using watchEffect to only update/recompute the target list when the configuration changes.
Next i will implement the inverse of this, and add the ability to specify clients in specific targets to ignore/include, as currently, if you hide "curl", you hide both the curl CLI tool and the php "curl" client, which is probably not intentional.
hanspagel pushed a commit to HelgeSverre/scalar that referenced this issue May 13, 2024
…httpClients() hook, it will only run once (which was probably done due to performance benefits), however this breaks this feature as only the DEFAULT_EXCLUDED_CLIENTS will be applied the first time this runs, and the next time this is meant to run to filter the targets and clients based on the provided user configuration, it is not updated, aka, doesnt work, this is references in scalar#1250.

This commit fixes the bug, and retains the performance benefit by caching the target list using watchEffect to only update/recompute the target list when the configuration changes.
Next i will implement the inverse of this, and add the ability to specify clients in specific targets to ignore/include, as currently, if you hide "curl", you hide both the curl CLI tool and the php "curl" client, which is probably not intentional.
marclave pushed a commit that referenced this issue May 14, 2024
* fix: Because the "allTargets()..."-code is defined outside of the usehttpClients() hook, it will only run once (which was probably done due to performance benefits), however this breaks this feature as only the DEFAULT_EXCLUDED_CLIENTS will be applied the first time this runs, and the next time this is meant to run to filter the targets and clients based on the provided user configuration, it is not updated, aka, doesnt work, this is references in #1250.

This commit fixes the bug, and retains the performance benefit by caching the target list using watchEffect to only update/recompute the target list when the configuration changes.
Next i will implement the inverse of this, and add the ability to specify clients in specific targets to ignore/include, as currently, if you hide "curl", you hide both the curl CLI tool and the php "curl" client, which is probably not intentional.

* feat: allow using an object to specify clients within specific targets to be hidden.
Example:
{
    php: true, // Exclude all PHP clients
    python: true, //  Exclude all Python clients
    node: ['fetch'], // We expect the "fetch" client to still be available in the "javascript" target.
  }

* chore: add tests and fix TS issues

* chore: disable unirest client by default

* fix: unirest is not hidden by default

* fix: list of clients still show clients even if they are hidden

* fix: add undici again

* fix: setExcludedClients has wrong type

* refactor: move to computed, use flatMap instead of filter + map

* refactor: don’t use return for a single return

---------

Co-authored-by: Hans Pagel <mail@hanspagel.com>
@hanspagel
Copy link
Member

Should be fixed in #1387 :)

@Lumca
Copy link
Author

Lumca commented May 21, 2024

Thanks guys!

@Lumca
Copy link
Author

Lumca commented May 22, 2024

So I have tested it and there is still little bug.
I have setted:
hiddenClients: { php: true, python: true, c: true, node: true, javascript: true, go: true, java: true, ruby: true, shell: true, clojure: true, csharp: true, kotlin: true, objc: true, swift: true, r: true, powershell: true, ocaml: true, curl: true, },

It still makes curl default:
image

and upon clicking there is only http
image

should I create new bug? :)

thank you guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants