Skip to content

DEV: replace select-kit utils mixin methods with input-utils lib #32594

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

Merged
merged 1 commit into from
May 7, 2025

Conversation

tyb-talks
Copy link
Contributor

@tyb-talks tyb-talks commented May 6, 2025

This PR replaces the set of methods related to validation and normalization of input values in the select-kit utils mixin with simple exported functions from a input-utils lib file.

We maintain the _normalize method on the select-kit component because there are external repos dependent on that part of the interface.

We'll replace the remainder of the mixin with another utils lib file in a separate PR.

@tyb-talks tyb-talks changed the title DEV: replace select-kit utils mixin with exported functions from lib modules DEV: replace select-kit utils mixin methods with input-utils lib May 6, 2025
@tyb-talks tyb-talks marked this pull request as ready for review May 6, 2025 12:41
Copy link
Contributor

@jjaffeux jjaffeux left a comment

Choose a reason for hiding this comment

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

LGTM, thanks. Hopefully sometimes this year I can remove all of this.

@tyb-talks tyb-talks merged commit 18bbfa8 into main May 7, 2025
20 checks passed
@tyb-talks tyb-talks deleted the dev-refactor-select-kit-utils-mixin branch May 7, 2025 01:25
tyb-talks added a commit that referenced this pull request May 23, 2025
Follow up to refactoring the generic utils mixin used in select-kit
components in #32594.

This PR follows a different approach as the util functions related to
properties here aren't easily extracted without a major change to the
interface due to the dependency on `this.selectKit`. These util
functions are instead declared on the prototype with a class decorator
which ensures the same behaviour is maintained without relying on a
mixin.

It's largely a lift-and-shift with some minor refactoring of the
conditional logic to reduce nesting and improve readability of the
functions.
martin-brennan pushed a commit that referenced this pull request Jun 10, 2025
)

This PR replaces the set of methods related to validation and
normalization of input values in the select-kit utils mixin with simple
exported functions from a input-utils lib file.

We maintain the `_normalize` method on the select-kit component because
there are external repos dependent on that part of the interface.

We'll replace the remainder of the mixin with another utils lib file in
a separate PR.
martin-brennan pushed a commit that referenced this pull request Jun 10, 2025
Follow up to refactoring the generic utils mixin used in select-kit
components in #32594.

This PR follows a different approach as the util functions related to
properties here aren't easily extracted without a major change to the
interface due to the dependency on `this.selectKit`. These util
functions are instead declared on the prototype with a class decorator
which ensures the same behaviour is maintained without relying on a
mixin.

It's largely a lift-and-shift with some minor refactoring of the
conditional logic to reduce nesting and improve readability of the
functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants