You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/weaverse-component.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ published: true
12
12
Weaverse Components are the building blocks of your Hydrogen theme. They combine React's component model with Weaverse's powerful schema system to create customizable, performant sections for your storefront. This guide provides a comprehensive overview of how to create, configure, and optimize Weaverse components.
13
13
14
14
## Table of Contents
15
+
15
16
-[Getting Started](#getting-started)
16
17
-[Core Concepts](#core-concepts)
17
18
-[Component Structure](#component-structure)
@@ -290,13 +291,15 @@ export let schema = createSchema({
290
291
## Component Types
291
292
292
293
### 1. Content Sections
294
+
293
295
- Hero sections (images, videos)
294
296
- Text blocks and rich content
295
297
- Media galleries and sliders
296
298
- Feature sections
297
299
- Testimonial sections
298
300
299
301
### 2. E-commerce Components
302
+
300
303
- Product displays
301
304
- Collection grids
302
305
- Related products
@@ -305,6 +308,7 @@ export let schema = createSchema({
**Weaverse's `fetchWithCache`** is a convenient utility that simplifies cached data fetching from external APIs:
752
+
748
753
- Available through `context.weaverse.fetchWithCache`
749
754
- Automatically handles JSON parsing
750
755
- Applies the specified caching strategy
751
756
- Provides a cleaner syntax compared to Hydrogen's native `fetchSync`
752
757
753
758
Hydrogen provides several caching strategies out of the box:
759
+
754
760
-`CacheNone()`: No caching, always fetches fresh data
755
761
-`CacheShort()`: Short-term caching (a few minutes)
756
762
-`CacheLong()`: Long-term caching (1 day by default)
@@ -1287,4 +1293,3 @@ Remember that great components are:
1287
1293
-**Maintainable**: They follow clean code principles and are well-documented
1288
1294
1289
1295
As you build your Weaverse components, focus on creating a consistent user experience while enabling flexibility and customization through the schema system.
0 commit comments