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

fix(theme): add file extension to Theme imports and respective eslint rule #4771

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

rubencarvalho
Copy link
Collaborator

@rubencarvalho rubencarvalho commented Sep 18, 2024

Description

Add file extensions to the refactored imports in the sp-theme component and respective eslint rule to avoid running into this problem in the future. Original refactor PR: #4743

Related issue(s)

Motivation and context

This was breaking consumers, where some vitest configurations were not correctly resolving the files without extensions. While there might be an alternative solution, involving further tinkering with consumers configurations (e.g., tinkering and trying out different TypeScript module resolutions), this is the lowest effort path forward for all teams.

Also, I am considering this a bug-fix because it goes against our convention and status-quo.

How has this been tested?

Tried running the yarn lint:ts command to capture the errors:

Screenshot 2024-09-18 at 20 12 21

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Checklist

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • If my change required a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices

Best practices

This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against main.

@rubencarvalho rubencarvalho changed the title fix: add file extension to Theme imports and respective eslint rule fix(theme): add file extension to Theme imports and respective eslint rule Sep 18, 2024
Copy link

Branch preview

Visual regression test results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

@coveralls
Copy link
Collaborator

coveralls commented Sep 18, 2024

Pull Request Test Coverage Report for Build 10940061818

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 98.211%

Totals Coverage Status
Change from base Build 10939873828: 0.002%
Covered Lines: 32542
Relevant Lines: 32961

💛 - Coveralls

@rubencarvalho rubencarvalho marked this pull request as ready for review September 18, 2024 19:32
@rubencarvalho rubencarvalho requested a review from a team as a code owner September 18, 2024 19:32
Copy link

github-actions bot commented Sep 18, 2024

Tachometer results

Chrome

action-bar permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 500 kB 51.22ms - 53.02ms - faster ✔
2% - 6%
1.04ms - 3.40ms
branch 476 kB 53.59ms - 55.11ms slower ❌
2% - 7%
1.04ms - 3.40ms
-

action-menu permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 701 kB 136.48ms - 139.50ms - faster ✔
5% - 8%
7.47ms - 11.74ms
branch 659 kB 146.09ms - 149.11ms slower ❌
5% - 9%
7.47ms - 11.74ms
-

test-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 658 kB 65.27ms - 66.32ms - faster ✔
5% - 8%
3.75ms - 5.32ms
branch 616 kB 69.75ms - 70.91ms slower ❌
6% - 8%
3.75ms - 5.32ms
-

test-lazy permalink

Version Bytes Avg Time vs remote vs branch
npm latest 657 kB 63.29ms - 66.16ms - faster ✔
4% - 9%
2.98ms - 6.40ms
branch 615 kB 68.49ms - 70.34ms slower ❌
4% - 10%
2.98ms - 6.40ms
-

test-open-close-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 847 kB 1871.81ms - 1875.37ms - unsure 🔍
-0% - +0%
-1.52ms - +3.15ms
branch 802 kB 1871.27ms - 1874.29ms unsure 🔍
-0% - +0%
-3.15ms - +1.52ms
-

test-open-close permalink

Version Bytes Avg Time vs remote vs branch
npm latest 845 kB 1874.33ms - 1876.91ms - unsure 🔍
-0% - +0%
-2.89ms - +0.75ms
branch 801 kB 1875.41ms - 1877.97ms unsure 🔍
-0% - +0%
-0.75ms - +2.89ms
-

breadcrumbs permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 718 kB 495.22ms - 500.96ms - faster ✔
0% - 2%
1.13ms - 10.44ms
branch 676 kB 500.21ms - 507.54ms slower ❌
0% - 2%
1.13ms - 10.44ms
-

combobox permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 763 kB 37.19ms - 37.77ms - faster ✔
1% - 3%
0.54ms - 1.30ms
branch 718 kB 38.16ms - 38.64ms slower ❌
1% - 3%
0.54ms - 1.30ms
-

light-dom-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 763 kB 380.89ms - 387.53ms - faster ✔
1% - 4%
5.36ms - 14.39ms
branch 718 kB 391.03ms - 397.14ms slower ❌
1% - 4%
5.36ms - 14.39ms
-

contextual-help permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 689 kB 49.54ms - 50.66ms - faster ✔
6% - 9%
3.45ms - 5.07ms
branch 644 kB 53.78ms - 54.94ms slower ❌
7% - 10%
3.45ms - 5.07ms
-

menu permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 494 kB 207.86ms - 210.24ms - faster ✔
2% - 3%
3.39ms - 7.06ms
branch 470 kB 212.88ms - 215.67ms slower ❌
2% - 3%
3.39ms - 7.06ms
-

overlay permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 741 kB 435.03ms - 439.12ms - faster ✔
1% - 2%
2.40ms - 8.19ms
branch 698 kB 440.32ms - 444.43ms slower ❌
1% - 2%
2.40ms - 8.19ms
-

directive-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 822 kB 22.74ms - 23.20ms - faster ✔
9% - 11%
2.18ms - 2.84ms
branch 777 kB 25.24ms - 25.71ms slower ❌
9% - 12%
2.18ms - 2.84ms
-

element-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 812 kB 350.16ms - 354.14ms - faster ✔
2% - 7%
5.15ms - 25.77ms
branch 767 kB 357.50ms - 377.73ms slower ❌
1% - 7%
5.15ms - 25.77ms
-

lazy-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 609 kB 42.28ms - 42.94ms - faster ✔
6% - 9%
2.79ms - 4.00ms
branch 564 kB 45.49ms - 46.51ms slower ❌
7% - 9%
2.79ms - 4.00ms
-

picker permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 568 kB 503.09ms - 511.07ms - faster ✔
2% - 4%
10.86ms - 21.80ms
branch 526 kB 519.67ms - 527.16ms slower ❌
2% - 4%
10.86ms - 21.80ms
-

popover permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 395 kB 11.31ms - 12.35ms - unsure 🔍
-9% - +3%
-1.12ms - +0.37ms
branch 373 kB 11.68ms - 12.74ms unsure 🔍
-3% - +10%
-0.37ms - +1.12ms
-

slider permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 494 kB 76.31ms - 78.09ms - faster ✔
2% - 13%
0.92ms - 11.00ms
branch 470 kB 78.20ms - 88.12ms slower ❌
1% - 14%
0.92ms - 11.00ms
-

split-button permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 780 kB 1867.83ms - 1871.78ms - unsure 🔍
-0% - +0%
-0.86ms - +4.69ms
branch 736 kB 1865.95ms - 1869.84ms unsure 🔍
-0% - +0%
-4.69ms - +0.86ms
-

tooltip permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 618 kB 34.23ms - 34.78ms - faster ✔
4% - 6%
1.42ms - 2.36ms
branch 576 kB 36.02ms - 36.78ms slower ❌
4% - 7%
1.42ms - 2.36ms
-

test-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 579 kB 23.20ms - 24.19ms - faster ✔
4% - 9%
1.13ms - 2.23ms
branch 537 kB 25.13ms - 25.62ms slower ❌
5% - 10%
1.13ms - 2.23ms
-

test-element permalink

Version Bytes Avg Time vs remote vs branch
npm latest 704 kB 52.25ms - 53.19ms - faster ✔
5% - 7%
2.81ms - 4.18ms
branch 659 kB 55.72ms - 56.72ms slower ❌
5% - 8%
2.81ms - 4.18ms
-

test-lazy permalink

Version Bytes Avg Time vs remote vs branch
npm latest 680 kB 42.48ms - 43.53ms - faster ✔
6% - 9%
3.00ms - 4.45ms
branch 635 kB 46.23ms - 47.22ms slower ❌
7% - 10%
3.00ms - 4.45ms
-

truncated permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 545 kB 57.85ms - 58.47ms - faster ✔
4% - 6%
2.68ms - 3.77ms
branch 519 kB 60.93ms - 61.83ms slower ❌
5% - 6%
2.68ms - 3.77ms
-
Firefox

action-bar permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 500 kB 112.73ms - 118.63ms - unsure 🔍
-6% - +0%
-6.85ms - +0.25ms
branch 476 kB 117.01ms - 120.95ms unsure 🔍
-0% - +6%
-0.25ms - +6.85ms
-

action-menu permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 701 kB 283.01ms - 286.15ms - faster ✔
11% - 13%
36.45ms - 42.75ms
branch 659 kB 321.45ms - 326.91ms slower ❌
13% - 15%
36.45ms - 42.75ms
-

test-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 658 kB 139.68ms - 142.48ms - unsure 🔍
-0% - +2%
-0.65ms - +3.17ms
branch 616 kB 138.52ms - 141.12ms unsure 🔍
-2% - +0%
-3.17ms - +0.65ms
-

test-lazy permalink

Version Bytes Avg Time vs remote vs branch
npm latest 657 kB 130.18ms - 132.22ms - faster ✔
3% - 5%
3.94ms - 7.02ms
branch 615 kB 135.53ms - 137.83ms slower ❌
3% - 5%
3.94ms - 7.02ms
-

test-open-close-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 847 kB 1886.74ms - 1891.78ms - unsure 🔍
-0% - +0%
-1.92ms - +4.68ms
branch 802 kB 1885.75ms - 1890.01ms unsure 🔍
-0% - +0%
-4.68ms - +1.92ms
-

test-open-close permalink

Version Bytes Avg Time vs remote vs branch
npm latest 845 kB 1895.76ms - 1901.08ms - unsure 🔍
-0% - +0%
-6.91ms - +1.23ms
branch 801 kB 1898.18ms - 1904.34ms unsure 🔍
-0% - +0%
-1.23ms - +6.91ms
-

breadcrumbs permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 718 kB 801.42ms - 816.10ms - faster ✔
1% - 4%
10.99ms - 31.41ms
branch 676 kB 822.86ms - 837.06ms slower ❌
1% - 4%
10.99ms - 31.41ms
-

combobox permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 763 kB 60.78ms - 62.14ms - faster ✔
3% - 7%
1.80ms - 4.24ms
branch 718 kB 63.46ms - 65.50ms slower ❌
3% - 7%
1.80ms - 4.24ms
-

light-dom-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 763 kB 745.25ms - 754.51ms - slower ❌
1% - 3%
6.09ms - 24.99ms
branch 718 kB 726.10ms - 742.58ms faster ✔
1% - 3%
6.09ms - 24.99ms
-

contextual-help permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 689 kB 107.53ms - 112.83ms - faster ✔
3% - 9%
3.16ms - 11.00ms
branch 644 kB 114.38ms - 120.14ms slower ❌
3% - 10%
3.16ms - 11.00ms
-

menu permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 494 kB 439.28ms - 447.92ms - faster ✔
1% - 5%
6.15ms - 21.81ms
branch 470 kB 451.05ms - 464.11ms slower ❌
1% - 5%
6.15ms - 21.81ms
-

overlay permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 819 kB 698.86ms - 712.90ms - slower ❌
4% - 6%
24.01ms - 40.59ms
branch 774 kB 669.17ms - 677.99ms faster ✔
3% - 6%
24.01ms - 40.59ms
-

directive-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 822 kB 50.54ms - 51.62ms - faster ✔
2% - 5%
1.03ms - 2.45ms
branch 777 kB 52.36ms - 53.28ms slower ❌
2% - 5%
1.03ms - 2.45ms
-

element-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 812 kB 709.16ms - 717.08ms - slower ❌
2% - 5%
15.22ms - 31.70ms
branch 767 kB 682.44ms - 696.88ms faster ✔
2% - 4%
15.22ms - 31.70ms
-

lazy-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 609 kB 93.68ms - 96.64ms - faster ✔
4% - 8%
4.12ms - 8.08ms
branch 564 kB 99.94ms - 102.58ms slower ❌
4% - 9%
4.12ms - 8.08ms
-

picker permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 568 kB 1046.78ms - 1057.54ms - faster ✔
5% - 7%
51.22ms - 83.34ms
branch 526 kB 1104.30ms - 1134.58ms slower ❌
5% - 8%
51.22ms - 83.34ms
-

popover permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 395 kB 30.59ms - 33.01ms - unsure 🔍
-6% - +5%
-1.82ms - +1.54ms
branch 373 kB 30.77ms - 33.11ms unsure 🔍
-5% - +6%
-1.54ms - +1.82ms
-

slider permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 494 kB 164.88ms - 173.08ms - unsure 🔍
-5% - +2%
-7.91ms - +2.79ms
branch 470 kB 168.11ms - 174.97ms unsure 🔍
-2% - +5%
-2.79ms - +7.91ms
-

split-button permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 780 kB 1880.36ms - 1885.28ms - unsure 🔍
+0% - +0%
+0.11ms - +6.45ms
branch 736 kB 1877.54ms - 1881.54ms unsure 🔍
-0% - -0%
-6.45ms - -0.11ms
-

tooltip permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 704 kB 79.14ms - 83.34ms - slower ❌
6% - 12%
4.35ms - 8.89ms
branch 659 kB 73.76ms - 75.48ms faster ✔
6% - 11%
4.35ms - 8.89ms
-

test-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 579 kB 47.84ms - 48.92ms - faster ✔
3% - 6%
1.54ms - 3.22ms
branch 537 kB 50.11ms - 51.41ms slower ❌
3% - 7%
1.54ms - 3.22ms
-

test-element permalink

Version Bytes Avg Time vs remote vs branch
npm latest 704 kB 132.02ms - 137.86ms - slower ❌
5% - 11%
6.05ms - 13.31ms
branch 659 kB 123.10ms - 127.42ms faster ✔
5% - 10%
6.05ms - 13.31ms
-

test-lazy permalink

Version Bytes Avg Time vs remote vs branch
npm latest 680 kB 90.25ms - 94.11ms - faster ✔
9% - 15%
9.11ms - 15.77ms
branch 635 kB 101.91ms - 107.33ms slower ❌
10% - 17%
9.11ms - 15.77ms
-

truncated permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 545 kB 106.28ms - 111.88ms - unsure 🔍
-6% - +1%
-6.75ms - +1.19ms
branch 519 kB 109.04ms - 114.68ms unsure 🔍
-1% - +6%
-1.19ms - +6.75ms
-

Copy link
Contributor

@Rajdeepc Rajdeepc left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@spdev3000 spdev3000 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 Ruben

Copy link

Lighthouse scores

Category Latest (report) Main (report) Branch (report)
Performance 0.99 0.99 0.99
Accessibility 1 1 1
Best Practices 1 1 1
SEO 1 0.92 0.92
PWA 1 1 1
What is this?

Lighthouse scores comparing the documentation site built from the PR ("Branch") to that of the production documentation site ("Latest") and the build currently on main ("Main"). Higher scores are better, but note that the SEO scores on Netlify URLs are artifically constrained to 0.92.

Transfer Size

Category Latest Main Branch
Total 228.513 kB 216.509 kB 🏆 216.776 kB
Scripts 57.884 kB 51.919 kB 🏆 52.179 kB
Stylesheet 34.584 kB 30.042 kB 🏆 30.148 kB
Document 6.225 kB 5.463 kB 🏆 5.467 kB
Font 126.903 kB 126.613 kB 🏆 126.632 kB

Request Count

Category Latest Main Branch
Total 52 52 52
Scripts 41 41 41
Stylesheet 5 5 5
Document 1 1 1
Font 2 2 2

@rubencarvalho rubencarvalho merged commit a2b6bea into main Sep 19, 2024
58 of 60 checks passed
@rubencarvalho rubencarvalho deleted the fix/theme-import-extension branch September 19, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jira ticket created
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants