Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable lazy loading skip on custom sections (#2654)
## What's the purpose of this pull request? Enable the store to decide if a new custom section will skip lazy loading. It's important because otherwise all sections are inside the `LazyLoadingSection` and `ViewportObserver` for performance purposes, which makes the section structure not show on the first HTML - that being said, sometimes it's important to appear on the first HTML for SEO purposes. ## How it works? If the section has a property called `skipLazyLoadingSection` set to `true` it'll bypass `LazyLoadingSection`. ## How to test it? I've added a custom section called `Custom H1` in the `playground.store`, this section is composed by a simple h1 that shows the collection name. It's already added to the PLP template on hCMS there, so you can test it through https://sfj-6854f82--playground.preview.vtex.app/just-arrived - a collection page on `playground`. | | | | ---- | ---- | | Custom section with `skipLazyLoadingSection` property | ![image](https://github.com/user-attachments/assets/8f3f2130-8168-4d3a-a65d-d0a406388047) | | Custom section example | ![image](https://github.com/user-attachments/assets/2ae04efa-42d2-4a82-9d93-a5ae31280ced) | | Custom section added to PLP template on hCMS | ![image](https://github.com/user-attachments/assets/79144009-a2f5-4fcf-bbb7-63e6f7263659) | | Custom section structure being shown on the 1st HTML | ![image](https://github.com/user-attachments/assets/b0d9ea7b-5bdf-40da-9d40-601f1bd35cf5) | ### Starters Deploy Preview https://sfj-6854f82--playground.preview.vtex.app/ ([PR](vtex-sites/playground.store#134)) ## References - [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2089) ## Checklist **Documentation** - Opened a [doc request](https://vtex.slack.com/archives/C01664JGV43/p1738258909141509) with Mari
- Loading branch information