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

feat: use aem.js #255

Merged
merged 5 commits into from
Oct 2, 2023
Merged

feat: use aem.js #255

merged 5 commits into from
Oct 2, 2023

Conversation

kptdobe
Copy link
Contributor

@kptdobe kptdobe commented Sep 7, 2023

Use aem.js built from https://github.com/adobe/aem-lib.

Requires a rename of the repo from helix-project-boilerplate to aem-boilerplate right after merging.

Test URLs:

@aem-code-sync
Copy link

aem-code-sync bot commented Sep 7, 2023

Hello, I'm Franklin Bot and I will run some test suites that validate the page speed.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-run PSI Checks

@aem-code-sync
Copy link

aem-code-sync bot commented Sep 7, 2023

Page Scores Audits Google
/ PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@aem-code-sync
Copy link

aem-code-sync bot commented Sep 14, 2023

Page Scores Audits Google
/ PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@aem-code-sync
Copy link

aem-code-sync bot commented Sep 14, 2023

Page Scores Audits Google
/ PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@aem-code-sync
Copy link

aem-code-sync bot commented Sep 14, 2023

Page Scores Audits Google
/ PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@aem-code-sync
Copy link

aem-code-sync bot commented Oct 2, 2023

Hello, I'm the AEM Code Sync Bot and I will run some test suites that validate the page speed.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-run PSI Checks

@aem-code-sync
Copy link

aem-code-sync bot commented Oct 2, 2023

Page Scores Audits Google
/ PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@aem-code-sync
Copy link

aem-code-sync bot commented Oct 2, 2023

Page Scores Audits Google
/ PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@kptdobe kptdobe marked this pull request as ready for review October 2, 2023 06:16
@kptdobe kptdobe merged commit f5ab4df into main Oct 2, 2023
3 checks passed
@kptdobe kptdobe deleted the aem-lib branch October 2, 2023 06:17
const iconName = Array.from(span.classList)
.find((c) => c.startsWith('icon-'))
.substring(5);
const img = document.createElement('img');
Copy link

Choose a reason for hiding this comment

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

@trieloff @kptdobe

By using the img tag to load the SVG, you lose the ability to apply CSS to change its color and other properties. This is a common use case for small icons that for example should match the surrounding text. For example on https://blog.adobe.com/en/publish/2023/10/11/max-sneaks-2023, checkout the share icons.

In some cases, using the img tag to load larger SVG illustrations makes sense as you don't want to increase the DOM size unnecessarily.

So depending on the use case, ideally you should be able to decide whether you want to load the SVG with <svg> or with <img> WDYT ?

Copy link

Choose a reason for hiding this comment

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

Also this change should have been done in a separate PR IMO. It's hidden behind the franklin to aem rename currently.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@icaraps We've had many issues and edge cases with the SVG sprite approach we had introduced earlier and the decision was taken to go back to a simple decoration that non-experts can leverage out-of-the-box for GA.
(check adobe/aem-lib#15 for more details)

Since styling icons essentially requires that the SVG file be modified from the OOTB export that apps like Illustrator give you, it is assumed to be a developer use case that can be done directly at the project level for now. And we are planning to introduce a plugin system in the near future that would allow you to pull in the sprite logic back on-demand.

Copy link

Choose a reason for hiding this comment

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

@ramboz Ok thanks for the details. Do you have recommendations on how to best migrate projects using svg icons to images instead ? For example, the icon selector Sidekick plugin built for Nokia uses svg icons https://main--nokia--hlxsites.hlx.page/tools/sidekick/library.html?plugin=icons. Do you foresee any issues if they switch to use images instead ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

First, I'd try to use the new logic and see if it actually breaks anything. As far as I can see from the code, you weren't using the SVG sprite approach that we removed, and the change for you is just inline svg to SVG wrapped in an <img/> tag. It's likely the only impact would be the currentcolor inheritance from the spectrum themes, which might be easily searched/replaced globally if you don't use multiple variations of it.

If you do see regressions with the change, I'd suggest just copying over your current decorateIcons logic into the project code and leverage that instead of the central default one.

Copy link

Choose a reason for hiding this comment

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

@ramboz sounds good thanks !

github-actions bot pushed a commit that referenced this pull request Nov 30, 2023
# [1.3.0](v1.2.2...v1.3.0) (2023-11-30)

### Bug Fixes

* attempt to fix release ([5bb8f73](5bb8f73))
* **build:** fix org in issues URL ([7226d84](7226d84))
* **build:** no double slashes in issues url ([1191064](1191064))
* **github:** increase default permissions for cleanup action ([f8ed051](f8ed051))
* **github:** restrict running of action to initial commit on main branch ([1a990c2](1a990c2))
* icons no more svgs ([#267](#267)) ([2d4cfa7](2d4cfa7))
* **lib:** update scripts/aem.js to [email protected] ([#266](#266)) ([2d61c6a](2d61c6a))
* rescope icon identifiers to avoid clashing references across icons ([#241](#241)) ([e8dc533](e8dc533)), closes [#235](#235)
* sampleRUM always for checkpoint to be called even if RUM not selected ([fcca39d](fcca39d))
* trigger release ([afbd201](afbd201))

### Features

* add capability to patch block config at runtime ([#246](#246)) ([a774acc](a774acc))
* enable listeners to all RUM events, not just the sampled ones ([871ede4](871ede4))
* use aem.js ([#255](#255)) ([f5ab4df](f5ab4df))
Copy link

🎉 This PR is included in version 1.3.0 🎉

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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants