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

ariaPressed name changed to prevent conflict with html attribute #235 #238

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rmenner
Copy link

@rmenner rmenner commented Nov 20, 2024

Alaska Airlines Pull Request

Type of change:

Please delete options that are not relevant.

  • New capability
  • Revision of an existing capability
  • Infrastructure change (automation, etc.)
  • Other (please elaborate)

Checklist:

  • My update follows the CONTRIBUTING guidelines of this project
  • I have performed a self-review of my own update

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!

-- Auro Design System Team

Summary by Sourcery

Rename 'ariaPressed' to 'ariapressed' to prevent conflict with the HTML attribute and enhance demo HTML files by removing duplicate stylesheet links and deferring module script loading.

Bug Fixes:

  • Rename 'ariaPressed' to 'ariapressed' to prevent conflict with the HTML attribute.

Enhancements:

  • Remove duplicate stylesheet link in demo HTML files.
  • Defer loading of module scripts in demo HTML files for improved performance.

@rmenner rmenner self-assigned this Nov 20, 2024
@rmenner rmenner requested a review from a team as a code owner November 20, 2024 23:57
Copy link

sourcery-ai bot commented Nov 20, 2024

Reviewer's Guide by Sourcery

This PR renames the ariaPressed property to ariapressed to prevent conflicts with HTML attributes, removes duplicate CSS imports, and improves script loading in demo files. The changes also include cleanup of initialization scripts by moving them directly into the JS files.

Class diagram for ComponentBase and AuroHyperlink changes

classDiagram
    class ComponentBase {
        - ariapressed: String
        - tabIsActive: String
        - runtimeUtils: AuroLibraryRuntimeUtils
    }
    class AuroHyperlink {
        - ariapressed: String
        + ariaPressedState(ariapressed): String
    }
    ComponentBase <|-- AuroHyperlink
    note for ComponentBase "ariapressed property renamed from ariaPressed"
Loading

Class diagram for initHyperlink functions

classDiagram
    class Api {
        + initHyperlinkApiExamples(initCount)
    }
    class Index {
        + initHyperlinkIndexExamples(initCount)
    }
    note for Api "initHyperlinkApiExamples moved to JS file"
    note for Index "initHyperlinkIndexExamples moved to JS file"
Loading

File-Level Changes

Change Details Files
Renamed ariaPressed property to prevent HTML attribute conflicts
  • Renamed property from 'ariaPressed' to 'ariapressed' in component base class
  • Updated template reference to use new property name
src/component-base.mjs
src/auro-hyperlink.js
Improved demo page structure and script loading
  • Removed duplicate design-tokens CSS import
  • Added 'defer' attribute to module script tags
  • Moved initialization scripts from HTML to JS files
  • Removed inline initialization scripts
demo/api.html
demo/index.html
demo/api.js
demo/index.js

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

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 @rmenner - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The initialization functions are now called immediately in the JS files rather than waiting for DOM ready. This could cause timing issues if the DOM isn't loaded yet. Consider keeping the init calls in the HTML or adding a DOMContentLoaded check.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 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.

@@ -33,17 +33,17 @@ export default class ComponentBase extends LitElement {
/**
* @private
*/
this.ariaPressed = 'false';
this.ariapressed = 'false';
Copy link
Contributor

Choose a reason for hiding this comment

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

ariaPressedState(ariaPressed) function should reflect this change

Copy link
Author

Choose a reason for hiding this comment

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

Maybe the one used in that function should be renamed. It is not related to the class property this.ariapressed

Copy link
Contributor

@sun-mota sun-mota left a comment

Choose a reason for hiding this comment

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

.

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

Successfully merging this pull request may close these issues.

Adding hyperlink to page causes "Failed to construct 'CustomElement': The result must not have attributes.
2 participants