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/storefront/stencil/cli/install.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ There are different options for installing Stencil CLI and its dependencies on a
22
22
* Node.js 20+ (Stencil CLI supported version)
23
23
24
24
Note: If the Python version is more than 3.12, then you should install distutils using the following command:
25
-
```pip install setuptools```
25
+
`pip install setuptools`
26
26
27
27
To install Stencil CLI and its dependencies on Mac, open a terminal and run the following commands. For the latest `node` version supported, refer to [Stencil CLI README.MD](https://github.com/bigcommerce/stencil-cli).
On MacOS, we have tested Stencil CLI most robustly on Node.js version 4.4.0. On Linux, we have tested most robustly on version 4.1.2. On Windows, we have tested most robustly on version 4.6.1. You’ll find detailed steps (for each operating system) in these instructions' Installing Stencil Prerequisites by OS section.
61
+
On macOS, we have tested Stencil CLI most robustly on Node.js version 4.4.0. On Linux, we have tested most robustly on version 4.1.2. On Windows, we have tested most robustly on version 4.6.1. You’ll find detailed steps (for each operating system) in these instructions' Installing Stencil Prerequisites by OS section.
62
62
63
63
## npm install errors
64
64
@@ -126,7 +126,7 @@ This error typically occurs when your `package.json` file includes an outdated v
126
126
127
127
### Running stencil bundle errors
128
128
129
-
Nowadays, `stencil bundle` runs several validation checks on a theme before it can be bundled and pushed to the store.
129
+
Nowadays, `stencil bundle` runs several validation checks on a theme before it can be bundled and pushed to the store.
130
130
131
131
You may see those errors because your theme has some missing properties in its translations files or frontmatter that have recently become required.
132
132
@@ -155,7 +155,7 @@ The following error indicates that there is a trailing comma in the frontmatter
155
155
Error: Found unallowed trailing symbol in: "4,", while parsing frontmatter at ".....templates/pages/home.html".
156
156
```
157
157
158
-
### Node support
158
+
### Node support
159
159
160
160
When you update the Node.js version, you can check to see whether you can update other theme packages, such as webpack, for updated feature support.
161
161
@@ -197,7 +197,7 @@ If you receive the same error again after running `npm install`, you should comp
197
197
198
198
## MacOS: Xcode/iOS license... errors
199
199
200
-
On MacOS, if you have recently installed a new version of Xcode, the command line will display the following error when you next try to use or reinstall Stencil:
200
+
On macOS, if you have recently installed a new version of Xcode, the command line will display the following error when you next try to use or reinstall Stencil:
201
201
202
202
```text
203
203
error: Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
@@ -249,7 +249,7 @@ If executing the `stencil start` command generates an `Unauthorized, please use
249
249
250
250
### 403 errors
251
251
252
-
If the Stencil server responds with a `403` error and you are using a proxy-based domain service like Cloudflare or Amazon Cloudfront, modify your hosts file to map the localhost to your BigCommerce store IP address.
252
+
If the Stencil server responds with a `403` error, and you are using a proxy-based domain service like Cloudflare or Amazon CloudFront, modify your hosts file to map the localhost to your BigCommerce store IP address.
Copy file name to clipboardExpand all lines: docs/storefront/stencil/deployment/performance-optimization.mdx
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,9 +27,9 @@ When importing images, ensure your images are high quality, the appropriate dime
27
27
28
28
Injecting JavaScript context variables allow you to access store data through your theme. You can inject JavaScript context variables using the `{{inject}}` Handlebars helper. Be sure to assign a custom variable name to the injected variable.
29
29
30
-
You can then use the `{{jsContext}}` Handlebars helper to access a stringified JSON object containing all injected data with your assigned custom variable names as keys in the key-value pairs. For more information, see [injection helpers](/docs/storefront/stencil/themes/context/handlebars-reference#inject).
30
+
You can then use the `{{jsContext}}` Handlebars helper to access a stringified JSON object containing all injected data with your assigned custom variable names as keys in the key-value pairs. For more information, see [injection helpers](/docs/storefront/stencil/themes/context/handlebars-reference#inject).
31
31
32
-
The code example below uses `{{inject}}` and `{{jsContext}}` to log the product name to your browser's console when added to Cornerstone's `product.html` file:
32
+
The code example below uses `{{inject}}` and `{{jsContext}}` to log the product name to your browser's console when added to Cornerstone's `product.html` file:
@@ -43,7 +43,7 @@ The code example below uses `{{inject}}` and `{{jsContext}}` to log the product
43
43
</script>
44
44
```
45
45
46
-
We recommend injecting only the variables you need. If you inject all settings, you could accidentlly inject PII (Personally-Identifying Information) and cause performance issues with your site.
46
+
We recommend injecting only the variables you need. If you inject all settings, you could accidentally inject PII (Personally-Identifying Information) and cause performance issues with your site.
47
47
48
48
## Using Lighthouse
49
49
@@ -59,7 +59,7 @@ Largest Contentful Paint (LCP) is the metric that reports the time it takes to d
59
59
60
60
<Callouttype="info">
61
61
#### Good score
62
-
The optimal LCP score is 2.5 seconds or faster.
62
+
The optimal LCP score is 2.5 seconds or faster.
63
63
</Callout>
64
64
65
65
To improve LCP:
@@ -93,7 +93,7 @@ Cumulative Layout Shift (CLS) is the metric that measures visual stability. This
93
93
94
94
<Callouttype="info">
95
95
#### Good score
96
-
The optimal CLS score is 0.1 seconds or less.
96
+
The optimal CLS score is 0.1 seconds or less.
97
97
</Callout>
98
98
99
99
To improve CLS:
@@ -108,7 +108,7 @@ In this example, the performance score is currently 47. The LCP score is 6.2 s,
To improve performance, let's start by measuring usused JavaScript. In Chrome DevTools, the **Lighthouse** and **Coverage** tabs offer suggestions of unused JavaScript code that you can potentially remove. The red section of the bar represents unused bytes; the green section represents used bytes. It is important to note that unused JavaScript means your page has not used it yet. The JavaScript in red might be connected to event listeners that only fire when a user interacts with your page.
111
+
To improve performance, let's start by measuring unused JavaScript. In Chrome DevTools, the **Lighthouse** and **Coverage** tabs offer suggestions of unused JavaScript code that you can potentially remove. The red section of the bar represents unused bytes; the green section represents used bytes. It is important to note that unused JavaScript means your page has not used it yet. The JavaScript in red might be connected to event listeners that only fire when a user interacts with your page.
Bitstream Vera Sans Mono, Courier New, monospace, serif;
122
122
background-color: #eeeeee;}
123
123
```
@@ -128,14 +128,14 @@ background-color: #eeeeee;}
128
128
129
129
Lighthouse displays information relevant to elements contributing to the CLS score. In this example, the banner above the carousel causes a loading issue. Once the image is resized or removed the CLS score improves.
130
130
131
-
After removing some unused bytes, minifying JavaScript files, and resizing an image, the performance score is 77. The LCP score is now 4.3 s, the TBT score is 120 ms and the CLS score is 0.001. You can continue to remove additional unused bytes to improve your performance score and metrics.
131
+
After removing some unused bytes, minifying JavaScript files, and resizing an image, the performance score is 77. The LCP score is now 4.3 s, the TBT score is 120 ms and the CLS score is 0.001. You can continue to remove additional unused bytes to improve your performance score and metrics.
Using Lighthouse is an important step in optimizing your site and improving the user experience. It is an easy to use best practice tip that provides powerful insights.
135
+
Using Lighthouse is an important step in optimizing your site and improving the user experience. It is an easy to use best practice tip that provides powerful insights.
136
136
137
137
## Using error detections and optimization tools
138
-
Tools that automatically record errors and provide session playback and optimization suggestions often benefit from having access to the themes' source maps in production.
138
+
Tools that automatically record errors and provide session playback and optimization suggestions often benefit from having access to the themes' source maps in production.
139
139
They provide a way to translate between minified code, designed to decrease webpage load times and the source code the developer writes.
140
140
141
141
[Stencil CLI](/docs/storefront/stencil/cli/options-and-commands) provides convenient options for bundling the production-ready theme with source maps included.
Copy file name to clipboardExpand all lines: docs/storefront/stencil/deployment/theme-images.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
## Displaying theme thumbnail images
6
6
7
7
8
-
A complete Stencil theme includes screenshots to display the theme on cards that appear in two locations within a nonactive MSF BigCommerce control panel:
8
+
A complete Stencil theme includes screenshots to display the theme on cards that appear in two locations within a non-active MSF BigCommerce control panel:
9
9
10
10
11
11
***Storefront** › **Themes**: Each individual card displays a composite which is an image that contains combination of screenshots of the theme's multiple variations.
Copy file name to clipboardExpand all lines: docs/storefront/stencil/deployment/upload-errors.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Troubleshooting Theme Uploads
2
2
3
-
3
+
4
4
5
5
## Restrictions
6
6
@@ -27,7 +27,7 @@ Custom theme uploads must meet these restrictions:
27
27
| TR-800 | There was a problem processing the contained `config.json` file. Please check the `config.json` documentation for the required keys and for keys that require values. |
28
28
| TR-900 | The contained `config.json` file is missing the required developer information. |
29
29
| TR-901 | A theme variation defined in the contained config.json file is missing its required external ID. |
30
-
| TR-902 | Two or more theme variations defined in the contained config.json file share an external ID. All external IDs must be unique. |
30
+
| TR-902 | Two or more theme variations defined in the contained config.json file share an external ID. All external IDs must be unique. |
31
31
| TR-1000 | There was a problem processing the contained <ahref="https://github.com/bigcommerce/cornerstone/blob/master/schema.json">schema.json</a> file. |
32
32
| TR-1001 | The theme is missing its required <ahref="https://github.com/bigcommerce/cornerstone/blob/master/schema.json">schema.json</a> file. |
33
33
| TR-1400 | There was a problem processing template <ahref="/docs/storefront/stencil/themes/context/frontmatter">front matter</a>. |
@@ -63,6 +63,6 @@ Warnings will not block a theme's upload, but these onscreen and/or log messages
63
63
## Workarounds and further info
64
64
* When using a Windows machine, it is necessary to close PowerShell and re-open as admin before installing nvm.
65
65
66
-
* If a custom theme does not render properly after you upload and apply it to a storefront, make sure you have created the theme's zip file using the `stencil bundle` command, on a Mac OS, Linux computer, or virtual machine. Using the `stencil bundle` command will exclude Windows-specific errors that have occurred on some bundles.
66
+
* If a custom theme does not render properly after you upload and apply it to a storefront, make sure you have created the theme's zip file using the `stencil bundle` command, on a macOS, Linux computer, or virtual machine. Using the `stencil bundle` command will exclude Windows-specific errors that have occurred on some bundles.
67
67
68
68
* If you repeatedly encounter the same error or warning and neither this page nor our KB resolves the problem, see support resources for theme developers in our [Developer Community](/community).
Copy file name to clipboardExpand all lines: docs/storefront/stencil/draft/dynamic-content-rendering.mdx
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Dynamic Content Rendering on Stencil Storefronts
3
-
keywords: js, javascript, if,
3
+
keywords: js, javascript, if,
4
4
---
5
5
6
6
# Dynamic Content Rendering on Stencil Storefronts
@@ -11,7 +11,7 @@ _We're gratefully sharing techniques devised by Ken Utting, Web Developer for Bi
11
11
12
12
At GORUCK, we've customized our Stencil theme (currently using the [Merchant](https://www.bigcommerce.com/theme/merchant-light/?_ga=2.52710120.1984523106.1539568940-967431010.1523308107) theme) to provide several ways to update our site content without requiring changes to the theme itself. This allows our content folks to make changes to our theme without having to wait on our software developers.
13
13
14
-
Also, by pushing content out of the theme, these techniques reduce the differences between our customized theme and the out-of-the-box (base) theme – which makes it easier to integrate ongoing updates into our theme. Finally, these techniques allow us share identical content across pages without copying and pasting.
14
+
Also, by pushing content out of the theme, these techniques reduce the differences between our customized theme and the out-of-the-box (base) theme – which makes it easier to integrate ongoing updates into our theme. Finally, these techniques allow us to share identical content across pages without copying and pasting.
15
15
16
16
Three techniques in particular have proven useful to us. We call them Dropzones, Dynamic Tabs, and Snippets. There is nothing particularly special to GORUCK about these techniques, so there is no reason you can't adopt them for your own store/theme.
17
17
@@ -104,8 +104,8 @@ In the example below, we use this technique to place the `RIGHT BY YOU` tab in t
104
104
There are two versions of the HTML. The first is designed for a tab you want to drop in using a page's own HTML:
<p>Our goal is to run a company our grandfathers would be proud of. And the central tenet
186
+
<p>Our goal is to run a company our grandfathers would be proud of. And the central tenet
187
187
— an oldie but a goodie — is that we do whatever it takes to do right by people.
188
188
Contact us at <a href="https://goruck.zendesk.com/hc/en-us/requests/new" target="_blank">
189
189
team@goruck.com</a> with any questions and we'll get back to you ASAP.</p>
@@ -193,7 +193,7 @@ Here are the contents of our `dynamicTab1.html` file:
193
193
</div>
194
194
```
195
195
196
-
### Dynamic Tabs JavaScript
196
+
### Dynamic Tabs JavaScript
197
197
198
198
Again, the JavaScript code to implement Dynamic Tabs is invoked in the PageManager class' before method. The Dynamic Tabs code is more complex, and it relies on other classes we wrote to get content from the external server and cache it in the browser.
199
199
@@ -225,7 +225,7 @@ The external file can contain any arbitrary HTML and CSS, and the styled HTML is
225
225
226
226
Like Dropzones and Dynamic Tabs, the Snippets code is invoked in `PageManager`'s `before` method. Snippets adds just another 50 lines of JavaScript code to the theme, also relying on the same code that Dynamic Tabs uses to get the external file and cache it in the browser.
227
227
228
-
## Recap
228
+
## Recap
229
229
230
230
At GORUCK, we've developed a number of techniques that allow us to separate our content from our theme. These techniques have proved valuable to us, because they allow us to:
0 commit comments