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

refactor: remove ready state and *-ready event #74

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

sun-mota
Copy link
Contributor

@sun-mota sun-mota commented Dec 2, 2024

Alaska Airlines Pull Request

closed #72

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I have performed a self-review of my own update.

Summary by Sourcery

Refactor components to remove the 'ready' state and 'ready' events, simplifying the initialization process and updating documentation and tests accordingly.

Enhancements:

  • Remove the 'ready' state and associated 'ready' events from components to simplify initialization logic.

Documentation:

  • Update documentation to reflect the removal of 'ready' events and states across components.

Tests:

  • Remove tests related to the 'ready' state and events from the test suite.

Copy link

sourcery-ai bot commented Dec 2, 2024

Reviewer's Guide by Sourcery

This pull request removes the 'ready' state and associated 'ready' events from multiple components to simplify the initialization process. The changes eliminate the need for components to wait for a ready state before performing certain operations, making the component lifecycle more straightforward.

Class diagram for AuroCombobox after removing 'ready' state

classDiagram
    class AuroCombobox {
        -menuWrapper
        -dropdown
        -auroDropdownReady
        -auroMenuReady
        -auroInputReady
        -readyRetryCount
        -options
        -menu
        -input
        -value
        -optionSelected
        -optionActive
        -checkmark
        -noFilter
        -showBib()
        -configureInput()
        -handleMenuOptions()
        -handleInputValueChange()
        -configureDropdown()
        -configureCombobox()
        -handleSlotChange()
        -updated(changedProperties)
    }
    note for AuroCombobox "Removed 'ready' state and related methods"
Loading

Class diagram for AuroSelect after removing 'ready' state

classDiagram
    class AuroSelect {
        -dropdown
        -auroDropdownReady
        -auroMenuReady
        -readyRetryCount
        -menu
        -value
        -optionActive
        -validation
        -configureDropdown()
        -configureSelect()
        -generateOptionsArray()
        -handleMenuOptions()
        -handleInputValueChange()
        -updated(changedProperties)
    }
    note for AuroSelect "Removed 'ready' state and related methods"
Loading

Class diagram for AuroDropdown after removing 'ready' state

classDiagram
    class AuroDropdown {
        -inset
        -placement
        -rounded
        -tabIndex
        -noToggle
        -bibContent
        -floater
        -handleTriggerTabIndex()
    }
    note for AuroDropdown "Removed 'ready' state and related methods"
Loading

Class diagram for AuroMenu after removing 'ready' state

classDiagram
    class AuroMenu {
        -optionSelected
        -matchWord
        -noCheckmark
        -optionActive
        -value
        -items
        -index
        -handleSlotItems()
        -updateActiveOption(index)
    }
    note for AuroMenu "Removed 'ready' state and related methods"
Loading

File-Level Changes

Change Details Files
Remove ready state and ready events from base components
  • Remove ready property and notifyReady method
  • Remove ready event listeners and event dispatching
  • Remove readyRetryCount and readyTimer logic
  • Remove checkReadiness and readyActions methods
components/dropdown/src/auro-dropdown.js
components/menu/src/auro-menu.js
components/input/src/base-input.js
Refactor initialization logic in composite components
  • Remove ready state checks before performing actions
  • Move initialization logic from readyActions to connectedCallback
  • Remove dependency on ready events from child components
  • Simplify component lifecycle by removing ready state management
components/select/src/auro-select.js
components/combobox/src/auro-combobox.js
Update documentation and tests to reflect removal of ready state
  • Remove ready event documentation from component API docs
  • Remove ready state checks from test cases
  • Update event documentation to remove ready events
components/select/demo/api.md
components/menu/demo/api.md
components/dropdown/demo/api.md
components/combobox/docs/api.md
components/select/test/auro-select.test.js
components/combobox/test/auro-combobox.test.js

Assessment against linked issues

Issue Objective Addressed Explanation
#72 Remove ready state and ready events from combobox, select and input components
#72 Ensure no regression on component functionality

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sun-mota sun-mota force-pushed the sunMota/remove-ready-state branch from f7ab282 to fba3ec3 Compare December 2, 2024 23:24
@sun-mota sun-mota marked this pull request as ready for review December 2, 2024 23:24
@sun-mota sun-mota requested a review from a team as a code owner December 2, 2024 23:24
@sun-mota sun-mota self-assigned this Dec 2, 2024
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @sun-mota - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟡 Testing: 2 issues found
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@@ -84,7 +84,6 @@ describe('auro-combobox', () => {

it('hides the bib when making a selection', async () => {
const el = await defaultFixture();
await waitUntil(() => el.ready);

Copy link

Choose a reason for hiding this comment

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

suggestion (testing): Remove unnecessary ready state checks from tests

Since the ready state and events have been removed, we should remove these waitUntil checks. The component initialization is now synchronous so we can proceed with the test assertions immediately after fixture creation.

@@ -104,7 +104,6 @@ describe('auro-select', () => {

it('make invalid selection programmatically results in error ui', async () => {
const el = await presetValueFixture();
await waitUntil(() => el.ready);

Copy link

Choose a reason for hiding this comment

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

suggestion (testing): Remove ready state checks from select component tests

Similar to the combobox tests, we should remove these ready state checks since the initialization is now synchronous. This will simplify the tests and make them more straightforward.

  it('hides the bib when making a selection', async () => {
    const el = await defaultFixture();

    const trigger = el.dropdown.querySelector('[slot="trigger"]');

@sun-mota sun-mota force-pushed the sunMota/remove-ready-state branch from fba3ec3 to c5533d4 Compare December 5, 2024 00:01
@sun-mota sun-mota merged commit c84c627 into main Dec 5, 2024
2 of 4 checks passed
@sun-mota sun-mota deleted the sunMota/remove-ready-state branch December 5, 2024 00:02
@rmenner
Copy link
Contributor

rmenner commented Dec 16, 2024

🎉 This PR is included in version 1.6.0-beta.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auro-form: remove ready state from combobox, select and input
3 participants