Skip to content

Commit 59f8780

Browse files
committed
doc: add missing docs here and there
1 parent 0b629d6 commit 59f8780

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

projects/storefrontstyles/scss/components/content/media/_media.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
display: block;
44

55
img {
6-
// SPIKE NEW - necessary for responsive images, but it's a breaking change. needs feature toggle.
6+
// SPIKE NEW - necessary for responsive images
7+
// SPIKE TODO: it's a breaking change so needs extensive testing and a feature toggle.
78
width: 100%;
89
height: auto;
910
// SPIKE END

projects/storefrontstyles/scss/theme/sparta/_fonts.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPIKE TODO UNCOMMENT AND FIX/OPTIMIZE - now removed temporarily to improve LCP
1+
// SPIKE TODO UNCOMMENT AND FIX/OPTIMIZE OTHER WAY - now removed to improve LCP
22
// @import '@fontsource/open-sans/300.css';
33
// @import '@fontsource/open-sans/400.css';
44
// @import '@fontsource/open-sans/600.css';

test-app/src/custom/CUSTOMIZATIONS-OUTSIDE-THIS-FOLDER.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@ All customizations of the `test-app` should be kept in the folder `src/app/custo
22

33
Any exceptional customizations made outside of the folder `src/app/custom` should be documented in this file:
44

5-
- `src/app/app.module.ts`: include all our `customProviders` from this folder `src/app/custom`
6-
- `src/styles.scss`: include all our custom styles from this folder `src/app/custom`
5+
### `src/app/app.module.ts`
6+
Provide all our `customProviders` from this folder `src/app/custom`
7+
8+
### `src/styles.scss`
9+
Import all our custom styles from this folder `src/app/custom`
10+
11+
### `angular.json`
12+
Generate source maps also for _vendor_ libs (in this case `@spartacus` libs are vendor coming from `test-app/node_modules`) - both in dev and prod mode build.

test-app/src/custom/workaround-extract-banner-dimensions-from-url.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ export class CustomOccCmsPageNormalizer extends OccCmsPageNormalizer {
9595
} {
9696
// Banner images in our sample data happen to follow the pattern `somename-WIDTHxHEIGHT-somename...`
9797
// so we can leverage it to extract the dimensions
98-
// (yes it's a workaround! ideally dimensions should be defined in CMS!)
9998
const pattern = /\/medias\/[^-]+-(\d+)x(\d+)-[^-]+/;
10099
const match = url.match(pattern);
101100
if (match) {

test-app/src/custom/workaround-mark-certain-banners-as-lcp.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ import { Injectable, Provider } from '@angular/core';
22
import { CmsBannerComponent } from '@spartacus/core';
33
import { BannerComponentService } from '@spartacus/storefront';
44

5+
/**
6+
* Marks certain banners as LCP (Largest Contentful Paint), making them
7+
* fetched with high priority.
8+
*
9+
* (yes it's a workaround! ideally such information should not be hardcoded in Spartacus
10+
* by "component name" but rather defined in CMS!)
11+
*/
512
@Injectable({ providedIn: 'root' })
613
export class CustomBannerComponentService extends BannerComponentService {
714
override getImageFetchPriority(

0 commit comments

Comments
 (0)