AlaskaAirlines / auro-icon

Custom HTML element for the use of easily displaying an icon from the Auro Icon library
https://auro.alaskaair.com/components/auro/icon
Apache License 2.0
0 stars 4 forks source link

perf: refactor how the component registers the custom element #133

Closed jason-capsule42 closed 2 months ago

jason-capsule42 commented 2 months ago

Alaska Airlines Pull Request

Type of change:

Please delete options that are not relevant.

Checklist:

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

Refactor the custom element registration to utilize RuntimeUtils, enhancing the modularity of the component registration process. Remove unnecessary eslint-disable comments and add a new ESLint configuration file to standardize code quality checks.

Enhancements:

Chores:

sourcery-ai[bot] commented 2 months ago

Reviewer's Guide by Sourcery

This pull request refactors how the component registers the custom element, improving performance. The main changes include:

  1. Replacing the custom registerComponent function with a utility method from the Auro Design System library.
  2. Updating the registration process in various files to use the new utility method.
  3. Removing the default internal definition of the custom element in the main component file.
  4. Updating test files to reflect the new registration method.
  5. Adding a new ESLint configuration file.

These changes streamline the component registration process and align it with the Auro Design System standards, potentially improving performance and maintainability.

File-Level Changes

Files Changes
index.js
test/auro-icon.test.js
demo/index.html
Replaced custom registerComponent function with RuntimeUtils.default.prototype.registerComponent
src/auro-icon.js Removed default internal definition of 'auro-icon' custom element
index.js
test/auro-icon.test.js
demo/index.html
Updated import statements to include RuntimeUtils from Auro library
src/auro-icon.js
src/auro-alaska.js
src/baseIcon.js
Removed eslint-disable comments and unused variables
eslint.config.mjs Added new ESLint configuration file using flat config format

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.
blackfalcon commented 2 months ago

:tada: This PR is included in version 4.5.1-beta.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: