Skip to content

Commit 6b0bf9b

Browse files
johnjenkinsJohn Jenkins
andauthored
fix: transformTag (#1575)
Co-authored-by: John Jenkins <john.jenkins@nanoporetech.com>
1 parent 7d3f655 commit 6b0bf9b

File tree

12 files changed

+64
-64
lines changed

12 files changed

+64
-64
lines changed

docs/components/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,6 @@ The static-analysis that Stencil uses to find mixed-in classes does not work wit
305305
:::
306306

307307

308-
### [**setTagTransformer()** and **tagTransform()**](../guides/tag-transformation.md):
308+
### [**setTagTransformer()** and **transformTag()**](../guides/tag-transformation.md):
309309

310310
Manage tag name transformation at runtime. Refer to the [Tag Transformation](../guides/tag-transformation.md) page for usage info.

docs/config/extras.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,5 @@ You can turn this behavior off by setting this flag to `false`.
184184

185185
### additionalTagTransformers
186186

187-
Auto-apply `tagTransform` to most static tag names within your component library (including CSS selectors).
187+
Auto-apply `transformTag` to most static tag names within your component library (including CSS selectors).
188188
Refer to the [Tag Transformation](../guides/tag-transformation.md) page for more information.

docs/guides/tag-transformation.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ However at the time of writing [vendor adoption is limited](https://caniuse.com/
2727

2828
Until scoped custom element registries are more widely supported, Stencil provides runtime tag transformation utilities for use when authoring and consuming web components.
2929

30-
## `setTagTransformer` and `tagTransform`
30+
## `setTagTransformer` and `transformTag`
3131

3232
As of Stencil v4.39, Stencil makes available two utilities to help manage dynamic tag names:
3333

3434
1) `setTagTransformer` allows application developers (your component library consumers) to assign a tag transformer function.
35-
2) `tagTransform` is mainly used *within* your component libraries - transforming any static string tag names using the tag transformer function assigned via `setTagTransformer` (Alternatively, you can auto apply `tagTransform` to all tag names via the [`extras.additionalTagTransformers` config option](#extrasadditionaltagtransformers).)
35+
2) `transformTag` is mainly used *within* your component libraries - transforming any static string tag names using the tag transformer function assigned via `setTagTransformer` (Alternatively, you can auto apply `transformTag` to all tag names via the [`extras.additionalTagTransformers` config option](#extrasadditionaltagtransformers).)
3636

3737

3838
### Using `setTagTransformer`
@@ -124,14 +124,14 @@ return await renderToStringV2(
124124
).html;
125125
```
126126

127-
### Using `tagTransform`
127+
### Using `transformTag`
128128

129129
If you make `setTagTransformer` available,
130-
Stencil also exports `tagTransform` which you can use within your component code;
130+
Stencil also exports `transformTag` which you can use within your component code;
131131
transforming static tag names via any assigned tag transformer function.
132132

133133
```tsx
134-
import { h, Component, Element, tagTransform } from '@stencil/core';
134+
import { h, Component, Element, transformTag } from '@stencil/core';
135135

136136
@Component({
137137
tag: 'my-component',
@@ -141,8 +141,8 @@ export class MyComponent {
141141
@Element() host: HTMLElement;
142142

143143
connectedCallback() {
144-
const ele = this.host.querySelector(tagTransform('my-other-element'));
145-
const anotherEle = document.createElement(tagTransform('my-another-element'));
144+
const ele = this.host.querySelector(transformTag('my-other-element'));
145+
const anotherEle = document.createElement(transformTag('my-another-element'));
146146
...
147147
}
148148

@@ -207,22 +207,22 @@ export class MyComponent {
207207
## `extras.additionalTagTransformers`
208208

209209
Setting the experimental `extras.additionalTagTransformers` configuration option to `true` (or `prod` to only apply to production builds)
210-
will auto-wrap `tagTransform(...)` to most static tag names within your component library (including CSS selectors!).
210+
will auto-wrap `transformTag(...)` to most static tag names within your component library (including CSS selectors!).
211211

212212
Examples of auto-transformations include:
213213

214214
```js
215215
document.createElement('my-element');
216216
// becomes
217-
document.createElement(tagTransform('my-element'));
217+
document.createElement(transformTag('my-element'));
218218

219219
document.querySelectorAll('my-element');
220220
// becomes
221-
document.querySelectorAll(tagTransform('my-element'));
221+
document.querySelectorAll(transformTag('my-element'));
222222

223223
document.createElement('my-element');
224224
// becomes
225-
document.createElement(tagTransform('my-element'));
225+
document.createElement(transformTag('my-element'));
226226
```
227227

228228
Incoming CSS like:
@@ -238,9 +238,9 @@ my-element.active:hover {}
238238
Is transformed for use at runtime to:
239239

240240
```ts
241-
`:host ${tagTransform('my-element')} {}
241+
`:host ${transformTag('my-element')} {}
242242
243-
${tagTransform('my-element')}::before {}
243+
${transformTag('my-element')}::before {}
244244
245-
${tagTransform('my-element')}.active:hover {}
245+
${transformTag('my-element')}.active:hover {}
246246
```

versioned_docs/version-v4.39/components/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,6 @@ The static-analysis that Stencil uses to find mixed-in classes does not work wit
303303
:::
304304

305305

306-
### [**setTagTransformer()** and **tagTransform()**](../guides/tag-transformation.md):
306+
### [**setTagTransformer()** and **transformTag()**](../guides/tag-transformation.md):
307307

308308
Manage tag name transformation at runtime. Refer to the [Tag Transformation](../guides/tag-transformation.md) page for usage info.

versioned_docs/version-v4.39/config/extras.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,5 @@ You can turn this behavior off by setting this flag to `false`.
184184

185185
### additionalTagTransformers
186186

187-
Auto-apply `tagTransform` to most static tag names within your component library (including CSS selectors).
187+
Auto-apply `transformTag` to most static tag names within your component library (including CSS selectors).
188188
Refer to the [Tag Transformation](../guides/tag-transformation.md) page for more information.

versioned_docs/version-v4.39/guides/tag-transformation.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ However at the time of writing [vendor adoption is limited](https://caniuse.com/
2727

2828
Until scoped custom element registries are more widely supported, Stencil provides runtime tag transformation utilities for use when authoring and consuming web components.
2929

30-
## `setTagTransformer` and `tagTransform`
30+
## `setTagTransformer` and `transformTag`
3131

3232
As of Stencil v4.39, Stencil makes available two utilities to help manage dynamic tag names:
3333

3434
1) `setTagTransformer` allows application developers (your component library consumers) to assign a tag transformer function.
35-
2) `tagTransform` is mainly used *within* your component libraries - transforming any static string tag names using the tag transformer function assigned via `setTagTransformer` (Alternatively, you can auto apply `tagTransform` to all tag names via the [`extras.additionalTagTransformers` config option](#extrasadditionaltagtransformers).)
35+
2) `transformTag` is mainly used *within* your component libraries - transforming any static string tag names using the tag transformer function assigned via `setTagTransformer` (Alternatively, you can auto apply `transformTag` to all tag names via the [`extras.additionalTagTransformers` config option](#extrasadditionaltagtransformers).)
3636

3737

3838
### Using `setTagTransformer`
@@ -124,14 +124,14 @@ return await renderToStringV2(
124124
).html;
125125
```
126126

127-
### Using `tagTransform`
127+
### Using `transformTag`
128128

129129
If you make `setTagTransformer` available,
130-
Stencil also exports `tagTransform` which you can use within your component code;
130+
Stencil also exports `transformTag` which you can use within your component code;
131131
transforming static tag names via any assigned tag transformer function.
132132

133133
```tsx
134-
import { h, Component, Element, tagTransform } from '@stencil/core';
134+
import { h, Component, Element, transformTag } from '@stencil/core';
135135

136136
@Component({
137137
tag: 'my-component',
@@ -141,8 +141,8 @@ export class MyComponent {
141141
@Element() host: HTMLElement;
142142

143143
connectedCallback() {
144-
const ele = this.host.querySelector(tagTransform('my-other-element'));
145-
const anotherEle = document.createElement(tagTransform('my-another-element'));
144+
const ele = this.host.querySelector(transformTag('my-other-element'));
145+
const anotherEle = document.createElement(transformTag('my-another-element'));
146146
...
147147
}
148148

@@ -207,22 +207,22 @@ export class MyComponent {
207207
## `extras.additionalTagTransformers`
208208

209209
Setting the experimental `extras.additionalTagTransformers` configuration option to `true` (or `prod` to only apply to production builds)
210-
will auto-wrap `tagTransform(...)` to most static tag names within your component library (including CSS selectors!).
210+
will auto-wrap `transformTag(...)` to most static tag names within your component library (including CSS selectors!).
211211

212212
Examples of auto-transformations include:
213213

214214
```js
215215
document.createElement('my-element');
216216
// becomes
217-
document.createElement(tagTransform('my-element'));
217+
document.createElement(transformTag('my-element'));
218218

219219
document.querySelectorAll('my-element');
220220
// becomes
221-
document.querySelectorAll(tagTransform('my-element'));
221+
document.querySelectorAll(transformTag('my-element'));
222222

223223
document.createElement('my-element');
224224
// becomes
225-
document.createElement(tagTransform('my-element'));
225+
document.createElement(transformTag('my-element'));
226226
```
227227

228228
Incoming CSS like:
@@ -238,9 +238,9 @@ my-element.active:hover {}
238238
Is transformed for use at runtime to:
239239

240240
```ts
241-
`:host ${tagTransform('my-element')} {}
241+
`:host ${transformTag('my-element')} {}
242242
243-
${tagTransform('my-element')}::before {}
243+
${transformTag('my-element')}::before {}
244244
245-
${tagTransform('my-element')}.active:hover {}
245+
${transformTag('my-element')}.active:hover {}
246246
```

versioned_docs/version-v4.40/components/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,6 @@ The static-analysis that Stencil uses to find mixed-in classes does not work wit
303303
:::
304304

305305

306-
### [**setTagTransformer()** and **tagTransform()**](../guides/tag-transformation.md):
306+
### [**setTagTransformer()** and **transformTag()**](../guides/tag-transformation.md):
307307

308308
Manage tag name transformation at runtime. Refer to the [Tag Transformation](../guides/tag-transformation.md) page for usage info.

versioned_docs/version-v4.40/config/extras.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,5 @@ You can turn this behavior off by setting this flag to `false`.
184184

185185
### additionalTagTransformers
186186

187-
Auto-apply `tagTransform` to most static tag names within your component library (including CSS selectors).
187+
Auto-apply `transformTag` to most static tag names within your component library (including CSS selectors).
188188
Refer to the [Tag Transformation](../guides/tag-transformation.md) page for more information.

versioned_docs/version-v4.40/guides/tag-transformation.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ However at the time of writing [vendor adoption is limited](https://caniuse.com/
2727

2828
Until scoped custom element registries are more widely supported, Stencil provides runtime tag transformation utilities for use when authoring and consuming web components.
2929

30-
## `setTagTransformer` and `tagTransform`
30+
## `setTagTransformer` and `transformTag`
3131

3232
As of Stencil v4.39, Stencil makes available two utilities to help manage dynamic tag names:
3333

3434
1) `setTagTransformer` allows application developers (your component library consumers) to assign a tag transformer function.
35-
2) `tagTransform` is mainly used *within* your component libraries - transforming any static string tag names using the tag transformer function assigned via `setTagTransformer` (Alternatively, you can auto apply `tagTransform` to all tag names via the [`extras.additionalTagTransformers` config option](#extrasadditionaltagtransformers).)
35+
2) `transformTag` is mainly used *within* your component libraries - transforming any static string tag names using the tag transformer function assigned via `setTagTransformer` (Alternatively, you can auto apply `transformTag` to all tag names via the [`extras.additionalTagTransformers` config option](#extrasadditionaltagtransformers).)
3636

3737

3838
### Using `setTagTransformer`
@@ -124,14 +124,14 @@ return await renderToStringV2(
124124
).html;
125125
```
126126

127-
### Using `tagTransform`
127+
### Using `transformTag`
128128

129129
If you make `setTagTransformer` available,
130-
Stencil also exports `tagTransform` which you can use within your component code;
130+
Stencil also exports `transformTag` which you can use within your component code;
131131
transforming static tag names via any assigned tag transformer function.
132132

133133
```tsx
134-
import { h, Component, Element, tagTransform } from '@stencil/core';
134+
import { h, Component, Element, transformTag } from '@stencil/core';
135135

136136
@Component({
137137
tag: 'my-component',
@@ -141,8 +141,8 @@ export class MyComponent {
141141
@Element() host: HTMLElement;
142142

143143
connectedCallback() {
144-
const ele = this.host.querySelector(tagTransform('my-other-element'));
145-
const anotherEle = document.createElement(tagTransform('my-another-element'));
144+
const ele = this.host.querySelector(transformTag('my-other-element'));
145+
const anotherEle = document.createElement(transformTag('my-another-element'));
146146
...
147147
}
148148

@@ -207,22 +207,22 @@ export class MyComponent {
207207
## `extras.additionalTagTransformers`
208208

209209
Setting the experimental `extras.additionalTagTransformers` configuration option to `true` (or `prod` to only apply to production builds)
210-
will auto-wrap `tagTransform(...)` to most static tag names within your component library (including CSS selectors!).
210+
will auto-wrap `transformTag(...)` to most static tag names within your component library (including CSS selectors!).
211211

212212
Examples of auto-transformations include:
213213

214214
```js
215215
document.createElement('my-element');
216216
// becomes
217-
document.createElement(tagTransform('my-element'));
217+
document.createElement(transformTag('my-element'));
218218

219219
document.querySelectorAll('my-element');
220220
// becomes
221-
document.querySelectorAll(tagTransform('my-element'));
221+
document.querySelectorAll(transformTag('my-element'));
222222

223223
document.createElement('my-element');
224224
// becomes
225-
document.createElement(tagTransform('my-element'));
225+
document.createElement(transformTag('my-element'));
226226
```
227227

228228
Incoming CSS like:
@@ -238,9 +238,9 @@ my-element.active:hover {}
238238
Is transformed for use at runtime to:
239239

240240
```ts
241-
`:host ${tagTransform('my-element')} {}
241+
`:host ${transformTag('my-element')} {}
242242
243-
${tagTransform('my-element')}::before {}
243+
${transformTag('my-element')}::before {}
244244
245-
${tagTransform('my-element')}.active:hover {}
245+
${transformTag('my-element')}.active:hover {}
246246
```

versioned_docs/version-v4.41/components/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,6 @@ The static-analysis that Stencil uses to find mixed-in classes does not work wit
305305
:::
306306

307307

308-
### [**setTagTransformer()** and **tagTransform()**](../guides/tag-transformation.md):
308+
### [**setTagTransformer()** and **transformTag()**](../guides/tag-transformation.md):
309309

310310
Manage tag name transformation at runtime. Refer to the [Tag Transformation](../guides/tag-transformation.md) page for usage info.

0 commit comments

Comments
 (0)