Problem/Motivation

Getting some warnings/notices when running npm run build, most of these are related to accessibility issues. Not at all a priority right now, but all these should be fixed going forward.

Steps to reproduce

Change your directory to sveltejs in the module root and run the command 'npm run build'. You will see the following message.

src/main.js → public/build/bundle.js...
(!) Plugin svelte: A11y: <a> element should have an href attribute
src/ProjectBrowser.svelte
117:                 <!-- @todo Derive these filters from drupalSettings.project_browser.smart_filters. -->
118:                 <li class:js-active-tab="{tab === 'recommended'}" class="tabs__tab js-tab is-active">
119:                     <a class:is-active="{tab === 'recommended'}" on:click={showRecommended} class="tabs__link js-tabs-link">Recommended projects</a>
                         ^
120:                 </li>
121:                 <li class:js-active-tab="{tab === 'all'}" class="tabs__tab js-tab">
src/ProjectBrowser.svelte
120:                 </li>
121:                 <li class:js-active-tab="{tab === 'all'}" class="tabs__tab js-tab">
122:                     <a class:is-active="{tab === 'all'}" on:click={showAll} title="All published projects" class="tabs__link js-tabs-link">All projects</a>
                         ^
123:                 </li>
124:             </ul>
src/Pagination.svelte
51:     <ul class="pager__items js-pager__items">
52:         <li class="pager__item pager__first">
53:             <a class="pager__link" disabled={page === 0} on:click={e => onChange(e, 0)}>
                ^
54:                 {labels.first}
55:             </a>
src/Pagination.svelte
56:         </li>
57:         <li class="pager__item pager__previous">
58:         <a class="pager__link" disabled={page === 0} on:click={e => onChange(e, page - 1)}>
            ^
59:             {labels.previous}
60:         </a>
src/Pagination.svelte
65:                     class:pager__item--active={page === page + button}
66:                 >
67:                     <a class="pager__link"
                        ^
68:                             class:is-active={page === page + button}
69:                             on:click={e => onChange(e, page + button)}>
src/Pagination.svelte
74:         {/each}
75:         <li class="pager__item pager__next">
76:             <a      class="pager__link"
                ^
77:                     disabled={page > pageCount - 1}
78:                     on:click={e => onChange(e, page + 1)}>
src/Pagination.svelte
81:         </li>
82:         <li class="pager__item pager__last">
83:             <a      class="pager__link"
                ^
84:                     disabled={page >= pageCount} on:click={e => onChange(e, pageCount)}>
85:                 {labels.last}
(!) Plugin svelte: Unused CSS selector ".center > span"
src/ProjectGrid.svelte
78:     }
79: 
80:     .center > span {
        ^
81:         padding: 10px 10px;
82:         float: left;
(!) Plugin svelte: A11y: A form label must be associated with a control.
src/Search.svelte
111: <form class="views-exposed-form">
112:     <div class="views-exposed-form__item js-form-item form-item js-form-type-textfield form-type--textfield ">
113:         <label class="form-item__label">Title</label>
             ^
114:         <input
115:                 class="search form-text form-element form-element--type-text form-element--api-textfield"
src/Search.svelte
121:     </div>
122:     <div class="views-exposed-form__item js-form-item form-item js-form-type-select form-type--select js-form-item-type form-item--type">
123:         <label class="form-item__label">Category</label>
             ^
124:         <select name="category" bind:value={category} on:change={onSelectCategory} class="form-select form-element form-element--type-select">
125:             {#await fetchEntity("https://www.drupal.org/api-d7/taxonomy_term.json?vocabulary=3")}
(!) Plugin svelte: A11y: on:blur must be used instead of on:change, unless absolutely necessary and it causes no negative consequences for keyboard only or screen reader users.
src/Search.svelte
122:     <div class="views-exposed-form__item js-form-item form-item js-form-type-select form-type--select js-form-item-type form-item--type">
123:         <label class="form-item__label">Category</label>
124:         <select name="category" bind:value={category} on:change={onSelectCategory} class="form-select form-element form-element--type-select">
             ^
125:             {#await fetchEntity("https://www.drupal.org/api-d7/taxonomy_term.json?vocabulary=3")}
126:                 <option value="">Loading...</option>
(!) Plugin svelte: Unused CSS selector ".views-exposed-form .form-item--no-label"
src/Search.svelte
 97:         box-shadow: 0 2px 4px rgb(0 0 0 / 10%);
 98:     }
 99:     .views-exposed-form .form-item--no-label, .views-exposed-form__item.views-exposed-form__item.views-exposed-form__item--actions {
         ^
100:         margin-top: 2.375rem;
101:     }
(!) Plugin svelte: 'drupalSettings' is not defined
src/Project/Image.svelte
26:     {/await}
27: {:else}
28:     <img src="/{drupalSettings.project_browser.module_path}/images/placeholder-image.png" alt="Placeholder image"/>
                    ^
29: {/if}
30: 
src/Project/SecurityCoverage.svelte
16: </style>
17: {#if coverage === 'covered'}
18:     <a href="https://www.drupal.org/security-advisory-policy" target="_blank" rel="noreferrer"><span class="security-covered" title="Covered by Drupal Security Team"><img src="/{drupalSettings.project_browser.module_path}/images/shield-icon-black.svg" /></span></a>
                                                                                                                                                                                      ^
19: {/if}
20: 
(!) Plugin svelte: A11y: Screenreaders already announce <img> elements as an image.
src/Project/Image.svelte
26:     {/await}
27: {:else}
28:     <img src="/{drupalSettings.project_browser.module_path}/images/placeholder-image.png" alt="Placeholder image"/>
        ^
29: {/if}
30: 
(!) Plugin svelte: Empty block
src/Project/SupportingOrganization.svelte
16:         <span>with support from</span>
17:         {#each field_supporting_organizations || [] as field_collection}
18:             {#await fetchEntity(field_collection.uri)}
                                                          ^
19:             {:then item}
20:                 {#await fetchEntity(item.field_supporting_organization.uri)}
src/Project/SupportingOrganization.svelte
18:             {#await fetchEntity(field_collection.uri)}
19:             {:then item}
20:                 {#await fetchEntity(item.field_supporting_organization.uri)}
                                                                                ^
21:                 {:then organization}
22:                     <span class="organization"><a href="{organization.url}" target="_blank" rel="noreferrer">{organization.title}</a>{#if field_supporting_organizations[field_supporting_organizations.length - 1].id !== field_collection.id},{/if}</span>
src/Project/Categories.svelte
30:         <ul>
31:             {#each taxonomy_vocabulary_3 || [] as category}
32:                 {#await fetchEntity(category.uri)}
                                                      ^
33:                 {:then term}
34:                     <li class="category">{term.name}</li>
(!) Plugin svelte: A11y: <img> element should have an alt attribute
src/Project/SecurityCoverage.svelte
16: </style>
17: {#if coverage === 'covered'}
18:     <a href="https://www.drupal.org/security-advisory-policy" target="_blank" rel="noreferrer"><span class="security-covered" title="Covered by Drupal Security Team"><img src="/{drupalSettings.project_browser.module_path}/images/shield-icon-black.svg" /></span></a>
                                                                                                                                                                          ^
19: {/if}
20: 
created public/build/bundle.js in 4.6s

Proposed resolution

Fix all the warnings and try to add a suppress message in case warnings cannot be fixed.

Remaining tasks

  • ✅ File an issue about this project
  • ☐ Addition/Change/Update/Fix to this project
  • ☐ Testing to ensure no regression
  • ☐ Automated unit/functional testing coverage
  • ☐ Developer Documentation support on feature change/addition
  • ☐ User Guide Documentation support on feature change/addition
  • ☐ Code review from 1 Drupal core team member
  • ☐ Full testing and approval
  • ☐ Credit contributors
  • ☐ Review with the product owner
  • ☐ Release
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gaurav.kapoor created an issue. See original summary.

gaurav.kapoor’s picture

Issue tags: +Novice

4reeman made their first commit to this issue’s fork.

guylyons made their first commit to this issue’s fork.

chrisfromredfin made their first commit to this issue’s fork.

chrisfromredfin’s picture

Status: Active » Reviewed & tested by the community
tim.plunkett’s picture

Status: Reviewed & tested by the community » Needs work

This MR contains changes to many many files, most of which are unrelated to this issue

git diff origin/1.0.x --stat         
 sveltejs/public/build/bundle.css             |    4 +-
 sveltejs/public/build/bundle.js              |    2 +-
 sveltejs/public/build/bundle.js.map          |    2 +-
 sveltejs/rollup.config.js                    |    7 +
 sveltejs/src/DownloadPopup.svelte            |    1 +
 sveltejs/src/Filter.svelte                   |   20 +-
 sveltejs/src/Pagination.svelte               |   10 +-
 sveltejs/src/Project/ActionButton.svelte     |    9 +-
 sveltejs/src/Project/Categories.svelte       |    1 +
 sveltejs/src/Project/Image.svelte            |    3 +-
 sveltejs/src/Project/MaintainedIcon.svelte   |    3 +-
 sveltejs/src/Project/SecurityCoverage.svelte |    3 +-
 sveltejs/src/ProjectBrowser.svelte           |    5 +-
 sveltejs/src/ProjectGrid.svelte              |    7 -
 sveltejs/src/Search.svelte                   |   15 +-
 sveltejs/yarn.lock                           | 1006 +++++++++++++++++++++++++++++++++++++++++++-------------------------------------------
 16 files changed, 542 insertions(+), 556 deletions(-)

This MR's commit history contains 3274335 four times, for example...

* b71983b 2022-04-27 | (HEAD -> 3245948-resolve-issues-shown, project_browser-3245948/3245948-resolve-issues-shown) Ignore 'on:blur' exceptions thrown in Rollup build process Note that this exception will cease as of Svelte 3.38.0 [Guy]
* 73f8043 2022-04-27 | Fix variable for logging warning [Guy]
* 5b8cce7 2022-04-27 | use onwarn to check warning message if it includes drupalSettings [Guy]
*   5953dfb 2022-04-27 | merge in 1.0.x [Christopher J. Wells]
|\  
| * 6926a7d 2022-04-27 | (origin/HEAD, origin/1.0.x) Issue #3274577 by srishti.bankar, chrisfromredfin, tim.plunkett: Not all Categories are listed on admin/modules/browse page [srishti.bankar]
| * fc31a08 2022-04-27 | Issue #3243019 by srishti.bankar, gaurav.kapoor, tim.plunkett, narendraR: Rewrite BrowserController.php to avoid direct usage of global services [srishti.bankar]
| * 7668798 2022-04-26 | (1.0.x) Issue #3274335: Make category names labels for the checkbox [srishti.bankar]
* | 699ec0e 2022-04-27 | Issue #3274577 by srishti.bankar, chrisfromredfin, tim.plunkett: Not all Categories are listed on admin/modules/browse page [srishti.bankar]
* | a50640c 2022-04-27 | Issue #3243019 by srishti.bankar, gaurav.kapoor, tim.plunkett, narendraR: Rewrite BrowserController.php to avoid direct usage of global services [srishti.bankar]
* | 2be1fb4 2022-04-26 | resolve Svelte exceptions [Guy]
* | 922bb61 2022-04-26 | Issue #3274335: Make category names labels for the checkbox [srishti.bankar]
* | 36f5335 2022-04-26 | resolve Svelte exceptions [Guy]
* | f89652c 2022-04-26 | Issue #3274335: Make category names labels for the checkbox [srishti.bankar]
* | f708a60 2022-04-26 | include css [Guy]
* | ae702de 2022-04-26 | include latest bundle [Guy]
* | 86d73ad 2022-04-26 | Issue #3245948 resolve Svelte exceptions [Guy]
* | 5db6b2b 2022-04-26 | Issue #3274335: Make category names labels for the checkbox [srishti.bankar]
* | 8ce8ae3 2022-04-26 | resolve Svelte exceptions [Guy]
|/  
* 18ba489 2022-04-25 | Issue #3270210 by Rajab Natshah, chrisfromredfin, tim.plunkett: Fix web path for icons and action button images in card and list display for sub directory and multilingual sites [tim.plunkett]
*
guylyons’s picture

Status: Needs work » Needs review
chrisfromredfin’s picture

Status: Needs review » Reviewed & tested by the community

@tim I think we've cleaned this up now; please confirm.

tim.plunkett’s picture

Status: Reviewed & tested by the community » Fixed

Not sure about those href="#0" parts, but it can't hurt and we can always fix later. Thanks!
And thanks for cleaning up the MR, looks perfect now. Merged!

guylyons’s picture

Thanks Tim!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.