Skip to content

Commit ed3f34a

Browse files
committed
Update section "Build considerations"
1 parent 1603f7c commit ed3f34a

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

docs/_guide/you-will-need.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ Catalyst uses modern browser standards, and so requires evergreen browsers or ma
1818
- [`MutationObserver`](https://caniuse.com/#search=MutationObserver). [`mutation-observer`](https://github.com/webmodules/mutation-observer) can polyfill this.
1919

2020
Please note this list may increase over time. Catalyst will never ship with polyfills that add missing browser functionality, but will continue to use the latest Web Standards, and so may require more polyfills as new releases come out.
21+
22+
### Build considerations
23+
24+
When using build tools, some JavaScript minifiers modify the class name that Catalyst relies on. You know you have an issue if you encounter the error `"c" is not a valid custom element name`.
25+
26+
A best practice is to allow class names that end with `Element`. For instance, for Terser, you can use the following config: `{ keep_classnames: /Element$/ }`

docs/_guide/your-first-component.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ By convention Catalyst controllers end in `Element`; Catalyst will omit this whe
3333
Remember! A class name _must_ include at least two CamelCased words (not including the `Element` suffix). One-word elements will raise exceptions. Example of good names: `UserListElement`, `SubTaskElement`, `PagerContainerElement`
3434
{% endcapture %}{% include callout.md %}
3535

36-
{% capture callout %}
37-
When using build tools, some JavaScript minifiers might modify the class name that Catalyst relies on. A best-practice is to allow classnames that end with `Element`. In particular, for Terser, you can use the following config: `{ keep_classnames: /Element$/ }`
38-
{% endcapture %}{% include callout.md %}
39-
4036

4137
### What does `@controller` do?
4238

0 commit comments

Comments
 (0)