Skip to content

Commit 9e6a235

Browse files
johnjenkinsJohn Jenkins
andauthored
fix: wrong terms (#1550)
Co-authored-by: John Jenkins <john.jenkins@nanoporetech.com>
1 parent f946607 commit 9e6a235

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

docs/components/serialization-deserialization.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ console.log(myComponent.myNumber); // 43
5656
Most of the time Stencil's automatic serialization and deserialization is enough - especially with primitive data types, however there are cases where you might want to customize this behavior, especially when dealing with complex data.
5757

5858

59-
## The PropSerializer Decorator (`@PropSerializer()`)
59+
## The PropSerialize Decorator (`@PropSerialize()`)
6060

61-
The `@PropSerializer()` decorator allows you to define custom serialization logic; converting a JavaScript property to a attribute string. The decorator accepts a single argument; the name of the class member `@Prop()` it is associated with. A method decorated with `@PropSerializer()` will automatically run when its associated property changes.
61+
The `@PropSerialize()` decorator allows you to define custom serialization logic; converting a JavaScript property to a attribute string. The decorator accepts a single argument; the name of the class member `@Prop()` it is associated with. A method decorated with `@PropSerialize()` will automatically run when its associated property changes.
6262

6363
```tsx
64-
import { Component, Prop, PropSerializer } from '@stencil/core';
64+
import { Component, Prop, PropSerialize } from '@stencil/core';
6565

6666
@Component({
6767
tag: 'my-component',
6868
})
6969
export class MyComponent {
7070
@Prop() aStringArray: string[];
7171

72-
@PropSerializer('aStringArray')
72+
@PropSerialize('aStringArray')
7373
serializeStringArray(value: string[]) {
7474
try {
7575
return JSON.stringify(value); // must return a string
@@ -93,20 +93,20 @@ Becomes:
9393
<my-component a-string-array='["Hello","World"]'></my-component>
9494
```
9595

96-
## The AttrDeserializer Decorator (`@AttrDeserializer()`)
96+
## The AttrDeserialize Decorator (`@AttrDeserialize()`)
9797

98-
The `@AttrDeserializer()` decorator allows you to define custom deserialization logic; converting an attribute string to a JavaScript property. The decorator accepts a single argument; the name of the class member `@Prop()` it is associated with. A method decorated with `@AttrDeserializer()` will automatically run when its associated attribute changes.
98+
The `@AttrDeserialize()` decorator allows you to define custom deserialization logic; converting an attribute string to a JavaScript property. The decorator accepts a single argument; the name of the class member `@Prop()` it is associated with. A method decorated with `@AttrDeserialize()` will automatically run when its associated attribute changes.
9999

100100
```tsx
101-
import { Component, Prop, AttrDeserializer } from '@stencil/core';
101+
import { Component, Prop, AttrDeserialize } from '@stencil/core';
102102

103103
@Component({
104104
tag: 'my-component',
105105
})
106106
export class MyComponent {
107107
@Prop() aStringArray: string[];
108108

109-
@AttrDeserializer('aStringArray')
109+
@AttrDeserialize('aStringArray')
110110
deserializeStringArray(value: string): string[] | null {
111111
try {
112112
return JSON.parse(value);
@@ -132,13 +132,13 @@ const myComponent = document.querySelector('my-component');
132132
console.log(myComponent.aStringArray); // ['Hello', 'World']
133133
```
134134

135-
## Practical uses of PropSerializer
135+
## Practical uses of PropSerialize
136136

137-
Practically speaking, there is little disadvantage in using a `@AttrDeserializer()` on a complex property; it just adds another method for users to provide data to your component.
137+
Practically speaking, there is little disadvantage in using a `@AttrDeserialize()` on a complex property; it just adds another method for users to provide data to your component.
138138

139-
The use-cases around using `@PropSerializer()` is slightly less obvious as in general, [it is not considered best practice to reflect complex data (like objects or arrays) as attributes](https://web.dev/articles/custom-elements-best-practices#aim-to-only-accept-rich-data-objects,-arrays-as-properties.)
139+
The use-cases around using `@PropSerialize()` is slightly less obvious as in general, [it is not considered best practice to reflect complex data (like objects or arrays) as attributes](https://web.dev/articles/custom-elements-best-practices#aim-to-only-accept-rich-data-objects,-arrays-as-properties.)
140140

141-
The following example illustrates a practical use case for `@PropSerializer()` using the [hydrate script output](../guides/hydrate-app.md) on a server we can fetch and serialize complex data to an attribute. When the same component loads in a browser, the component can de-serialize the data immediately without having to do another fetch.
141+
The following example illustrates a practical use case for `@PropSerialize()` using the [hydrate script output](../guides/hydrate-app.md) on a server we can fetch and serialize complex data to an attribute. When the same component loads in a browser, the component can de-serialize the data immediately without having to do another fetch.
142142

143143
```tsx
144144
import { AttrDeserialize, Build, Component, h, Prop, PropSerialize } from '@stencil/core';

versioned_docs/version-v4.38/components/serialization-deserialization.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ console.log(myComponent.myNumber); // 43
5656
Most of the time Stencil's automatic serialization and deserialization is enough - especially with primitive data types, however there are cases where you might want to customize this behavior, especially when dealing with complex data.
5757

5858

59-
## The PropSerializer Decorator (`@PropSerializer()`)
59+
## The PropSerialize Decorator (`@PropSerialize()`)
6060

61-
The `@PropSerializer()` decorator allows you to define custom serialization logic; converting a JavaScript property to a attribute string. The decorator accepts a single argument; the name of the class member `@Prop()` it is associated with. A method decorated with `@PropSerializer()` will automatically run when its associated property changes.
61+
The `@PropSerialize()` decorator allows you to define custom serialization logic; converting a JavaScript property to a attribute string. The decorator accepts a single argument; the name of the class member `@Prop()` it is associated with. A method decorated with `@PropSerialize()` will automatically run when its associated property changes.
6262

6363
```tsx
64-
import { Component, Prop, PropSerializer } from '@stencil/core';
64+
import { Component, Prop, PropSerialize } from '@stencil/core';
6565

6666
@Component({
6767
tag: 'my-component',
6868
})
6969
export class MyComponent {
7070
@Prop() aStringArray: string[];
7171

72-
@PropSerializer('aStringArray')
72+
@PropSerialize('aStringArray')
7373
serializeStringArray(value: string[]) {
7474
try {
7575
return JSON.stringify(value); // must return a string
@@ -93,20 +93,20 @@ Becomes:
9393
<my-component a-string-array='["Hello","World"]'></my-component>
9494
```
9595

96-
## The AttrDeserializer Decorator (`@AttrDeserializer()`)
96+
## The AttrDeserialize Decorator (`@AttrDeserialize()`)
9797

98-
The `@AttrDeserializer()` decorator allows you to define custom deserialization logic; converting an attribute string to a JavaScript property. The decorator accepts a single argument; the name of the class member `@Prop()` it is associated with. A method decorated with `@AttrDeserializer()` will automatically run when its associated attribute changes.
98+
The `@AttrDeserialize()` decorator allows you to define custom deserialization logic; converting an attribute string to a JavaScript property. The decorator accepts a single argument; the name of the class member `@Prop()` it is associated with. A method decorated with `@AttrDeserialize()` will automatically run when its associated attribute changes.
9999

100100
```tsx
101-
import { Component, Prop, AttrDeserializer } from '@stencil/core';
101+
import { Component, Prop, AttrDeserialize } from '@stencil/core';
102102

103103
@Component({
104104
tag: 'my-component',
105105
})
106106
export class MyComponent {
107107
@Prop() aStringArray: string[];
108108

109-
@AttrDeserializer('aStringArray')
109+
@AttrDeserialize('aStringArray')
110110
deserializeStringArray(value: string): string[] | null {
111111
try {
112112
return JSON.parse(value);
@@ -132,13 +132,13 @@ const myComponent = document.querySelector('my-component');
132132
console.log(myComponent.aStringArray); // ['Hello', 'World']
133133
```
134134

135-
## Practical uses of PropSerializer
135+
## Practical uses of PropSerialize
136136

137-
Practically speaking, there is little disadvantage in using a `@AttrDeserializer()` on a complex property; it just adds another method for users to provide data to your component.
137+
Practically speaking, there is little disadvantage in using a `@AttrDeserialize()` on a complex property; it just adds another method for users to provide data to your component.
138138

139-
The use-cases around using `@PropSerializer()` is slightly less obvious as in general, [it is not considered best practice to reflect complex data (like objects or arrays) as attributes](https://web.dev/articles/custom-elements-best-practices#aim-to-only-accept-rich-data-objects,-arrays-as-properties.)
139+
The use-cases around using `@PropSerialize()` is slightly less obvious as in general, [it is not considered best practice to reflect complex data (like objects or arrays) as attributes](https://web.dev/articles/custom-elements-best-practices#aim-to-only-accept-rich-data-objects,-arrays-as-properties.)
140140

141-
The following example illustrates a practical use case for `@PropSerializer()` using the [hydrate script output](../guides/hydrate-app.md) on a server we can fetch and serialize complex data to an attribute. When the same component loads in a browser, the component can de-serialize the data immediately without having to do another fetch.
141+
The following example illustrates a practical use case for `@PropSerialize()` using the [hydrate script output](../guides/hydrate-app.md) on a server we can fetch and serialize complex data to an attribute. When the same component loads in a browser, the component can de-serialize the data immediately without having to do another fetch.
142142

143143
```tsx
144144
import { AttrDeserialize, Build, Component, h, Prop, PropSerialize } from '@stencil/core';

0 commit comments

Comments
 (0)