@stencil/core 4.38.3-dev.1764651902.52bdcb8 → 4.38.3-dev.1764708888.c031e0a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/index.cjs +2 -1
- package/cli/index.js +2 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +16369 -5558
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +6 -5
- package/internal/app-data/index.cjs +1 -0
- package/internal/app-data/index.js +1 -0
- package/internal/app-data/package.json +1 -1
- package/internal/app-globals/package.json +1 -1
- package/internal/client/index.js +30 -8
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +35 -5
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.d.ts +12 -0
- package/internal/hydrate/runner.js +1357 -1330
- package/internal/package.json +1 -1
- package/internal/stencil-core/index.d.ts +2 -0
- package/internal/stencil-private.d.ts +3 -0
- package/internal/stencil-public-compiler.d.ts +13 -0
- package/internal/stencil-public-runtime.d.ts +22 -0
- package/internal/testing/index.js +30 -4
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +226 -226
- package/mock-doc/index.js +226 -226
- package/mock-doc/package.json +1 -1
- package/package.json +4 -1
- package/screenshot/index.js +2 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +3 -3
- package/sys/node/autoprefixer.js +2 -2
- package/sys/node/glob.js +1 -1
- package/sys/node/index.js +18 -18
- package/sys/node/node-fetch.js +1 -1
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +35 -7
- package/testing/package.json +1 -1
- package/testing/puppeteer/puppeteer-browser.d.ts +1 -1
package/internal/client/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Client Platform v4.38.3-dev.
|
|
2
|
+
Stencil Client Platform v4.38.3-dev.1764708888.c031e0a | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
@@ -166,9 +166,7 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
166
166
|
const dynamicImportPath = `./${bundleId}.entry.js${hmr}`;
|
|
167
167
|
return import(
|
|
168
168
|
/* @vite-ignore */
|
|
169
|
-
/*
|
|
170
|
-
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
171
|
-
/* webpackMode: "lazy" */
|
|
169
|
+
/* webpackIgnore: true */
|
|
172
170
|
dynamicImportPath
|
|
173
171
|
).then(
|
|
174
172
|
(importedModule) => {
|
|
@@ -1307,6 +1305,9 @@ var hydrateScopedToShadow = () => {
|
|
|
1307
1305
|
// src/runtime/vdom/h.ts
|
|
1308
1306
|
import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
|
|
1309
1307
|
var h = (nodeName, vnodeData, ...children) => {
|
|
1308
|
+
if (typeof nodeName === "string") {
|
|
1309
|
+
nodeName = transformTag(nodeName);
|
|
1310
|
+
}
|
|
1310
1311
|
let child = null;
|
|
1311
1312
|
let key = null;
|
|
1312
1313
|
let slotName = null;
|
|
@@ -1489,7 +1490,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1489
1490
|
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
1490
1491
|
const node = childRenderNode.$elm$;
|
|
1491
1492
|
if (!shadowRoot) {
|
|
1492
|
-
node["s-hn"] = tagName.toUpperCase();
|
|
1493
|
+
node["s-hn"] = transformTag(tagName).toUpperCase();
|
|
1493
1494
|
if (childRenderNode.$tag$ === "slot") {
|
|
1494
1495
|
node["s-cr"] = hostElm["s-cr"];
|
|
1495
1496
|
}
|
|
@@ -3083,7 +3084,7 @@ render() {
|
|
|
3083
3084
|
if (BUILD20.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3084
3085
|
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
3085
3086
|
for (const childNode of children) {
|
|
3086
|
-
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
3087
|
+
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"] && childNode.nodeType === 1 /* ElementNode */) {
|
|
3087
3088
|
if (isInitialLoad && childNode["s-ih"] == null) {
|
|
3088
3089
|
childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
|
|
3089
3090
|
}
|
|
@@ -3923,7 +3924,10 @@ var disconnectedCallback = async (elm) => {
|
|
|
3923
3924
|
|
|
3924
3925
|
// src/runtime/bootstrap-custom-element.ts
|
|
3925
3926
|
var defineCustomElement = (Cstr, compactMeta) => {
|
|
3926
|
-
customElements.define(
|
|
3927
|
+
customElements.define(
|
|
3928
|
+
transformTag(compactMeta[1]),
|
|
3929
|
+
proxyCustomElement(Cstr, compactMeta)
|
|
3930
|
+
);
|
|
3927
3931
|
};
|
|
3928
3932
|
var proxyCustomElement = (Cstr, compactMeta) => {
|
|
3929
3933
|
const cmpMeta = {
|
|
@@ -4114,7 +4118,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4114
4118
|
if (BUILD28.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
4115
4119
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
4116
4120
|
}
|
|
4117
|
-
const tagName = BUILD28.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName
|
|
4121
|
+
const tagName = BUILD28.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : transformTag(cmpMeta.$tagName$);
|
|
4118
4122
|
const HostElement = class extends HTMLElement {
|
|
4119
4123
|
// StencilLazyHost
|
|
4120
4124
|
constructor(self) {
|
|
@@ -4332,6 +4336,22 @@ function render(vnode, container) {
|
|
|
4332
4336
|
renderVdom(ref, vnode);
|
|
4333
4337
|
}
|
|
4334
4338
|
|
|
4339
|
+
// src/runtime/tag-transform.ts
|
|
4340
|
+
var tagTransformer = void 0;
|
|
4341
|
+
function transformTag(tag) {
|
|
4342
|
+
if (!tagTransformer) return tag;
|
|
4343
|
+
return tagTransformer(tag);
|
|
4344
|
+
}
|
|
4345
|
+
function setTagTransformer(transformer) {
|
|
4346
|
+
if (tagTransformer) {
|
|
4347
|
+
console.warn(`
|
|
4348
|
+
A tagTransformer has already been set.
|
|
4349
|
+
Overwriting it may lead to error and unexpected results if your components have already been defined.
|
|
4350
|
+
`);
|
|
4351
|
+
}
|
|
4352
|
+
tagTransformer = transformer;
|
|
4353
|
+
}
|
|
4354
|
+
|
|
4335
4355
|
// src/runtime/vdom/vdom-annotations.ts
|
|
4336
4356
|
var insertVdomAnnotations = (doc, staticComponents) => {
|
|
4337
4357
|
if (doc != null) {
|
|
@@ -4532,12 +4552,14 @@ export {
|
|
|
4532
4552
|
setPlatformHelpers,
|
|
4533
4553
|
setPlatformOptions,
|
|
4534
4554
|
setScopedSSR,
|
|
4555
|
+
setTagTransformer,
|
|
4535
4556
|
setValue,
|
|
4536
4557
|
styles,
|
|
4537
4558
|
supportsConstructableStylesheets,
|
|
4538
4559
|
supportsListenerOptions,
|
|
4539
4560
|
supportsMutableAdoptedStyleSheets,
|
|
4540
4561
|
supportsShadow,
|
|
4562
|
+
transformTag,
|
|
4541
4563
|
win,
|
|
4542
4564
|
writeTask
|
|
4543
4565
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/client",
|
|
3
|
-
"version": "4.38.3-dev.
|
|
3
|
+
"version": "4.38.3-dev.1764708888.c031e0a",
|
|
4
4
|
"description": "Stencil internal client platform to be imported by the Stencil Compiler and internal runtime. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"exports": "./index.js",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Hydrate Platform v4.38.3-dev.
|
|
2
|
+
Stencil Hydrate Platform v4.38.3-dev.1764708888.c031e0a | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
@@ -1070,6 +1070,9 @@ var hydrateScopedToShadow = () => {
|
|
|
1070
1070
|
// src/runtime/vdom/h.ts
|
|
1071
1071
|
import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
|
|
1072
1072
|
var h = (nodeName, vnodeData, ...children) => {
|
|
1073
|
+
if (typeof nodeName === "string") {
|
|
1074
|
+
nodeName = transformTag(nodeName);
|
|
1075
|
+
}
|
|
1073
1076
|
let child = null;
|
|
1074
1077
|
let key = null;
|
|
1075
1078
|
let slotName = null;
|
|
@@ -1252,7 +1255,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1252
1255
|
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
1253
1256
|
const node = childRenderNode.$elm$;
|
|
1254
1257
|
if (!shadowRoot) {
|
|
1255
|
-
node["s-hn"] = tagName.toUpperCase();
|
|
1258
|
+
node["s-hn"] = transformTag(tagName).toUpperCase();
|
|
1256
1259
|
if (childRenderNode.$tag$ === "slot") {
|
|
1257
1260
|
node["s-cr"] = hostElm["s-cr"];
|
|
1258
1261
|
}
|
|
@@ -2846,7 +2849,7 @@ render() {
|
|
|
2846
2849
|
if (BUILD14.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2847
2850
|
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
2848
2851
|
for (const childNode of children) {
|
|
2849
|
-
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
2852
|
+
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"] && childNode.nodeType === 1 /* ElementNode */) {
|
|
2850
2853
|
if (isInitialLoad && childNode["s-ih"] == null) {
|
|
2851
2854
|
childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
|
|
2852
2855
|
}
|
|
@@ -3686,7 +3689,10 @@ var disconnectedCallback = async (elm) => {
|
|
|
3686
3689
|
|
|
3687
3690
|
// src/runtime/bootstrap-custom-element.ts
|
|
3688
3691
|
var defineCustomElement = (Cstr, compactMeta) => {
|
|
3689
|
-
customElements.define(
|
|
3692
|
+
customElements.define(
|
|
3693
|
+
transformTag(compactMeta[1]),
|
|
3694
|
+
proxyCustomElement(Cstr, compactMeta)
|
|
3695
|
+
);
|
|
3690
3696
|
};
|
|
3691
3697
|
var proxyCustomElement = (Cstr, compactMeta) => {
|
|
3692
3698
|
const cmpMeta = {
|
|
@@ -3877,7 +3883,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3877
3883
|
if (BUILD22.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3878
3884
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
3879
3885
|
}
|
|
3880
|
-
const tagName = BUILD22.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName
|
|
3886
|
+
const tagName = BUILD22.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : transformTag(cmpMeta.$tagName$);
|
|
3881
3887
|
const HostElement = class extends HTMLElement {
|
|
3882
3888
|
// StencilLazyHost
|
|
3883
3889
|
constructor(self) {
|
|
@@ -4078,6 +4084,22 @@ function Mixin(...mixins) {
|
|
|
4078
4084
|
// src/runtime/nonce.ts
|
|
4079
4085
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
4080
4086
|
|
|
4087
|
+
// src/runtime/tag-transform.ts
|
|
4088
|
+
var tagTransformer = void 0;
|
|
4089
|
+
function transformTag(tag) {
|
|
4090
|
+
if (!tagTransformer) return tag;
|
|
4091
|
+
return tagTransformer(tag);
|
|
4092
|
+
}
|
|
4093
|
+
function setTagTransformer(transformer) {
|
|
4094
|
+
if (tagTransformer) {
|
|
4095
|
+
console.warn(`
|
|
4096
|
+
A tagTransformer has already been set.
|
|
4097
|
+
Overwriting it may lead to error and unexpected results if your components have already been defined.
|
|
4098
|
+
`);
|
|
4099
|
+
}
|
|
4100
|
+
tagTransformer = transformer;
|
|
4101
|
+
}
|
|
4102
|
+
|
|
4081
4103
|
// src/runtime/vdom/vdom-annotations.ts
|
|
4082
4104
|
var insertVdomAnnotations = (doc, staticComponents) => {
|
|
4083
4105
|
if (doc != null) {
|
|
@@ -4652,9 +4674,15 @@ var isMemberInElement = (elm, memberName) => {
|
|
|
4652
4674
|
var registerComponents = (Cstrs) => {
|
|
4653
4675
|
for (const Cstr of Cstrs) {
|
|
4654
4676
|
const exportName = Cstr.cmpMeta.$tagName$;
|
|
4677
|
+
const transformedTagName = everywhere.tagTransform(exportName);
|
|
4655
4678
|
cmpModules.set(exportName, {
|
|
4656
4679
|
[exportName]: Cstr
|
|
4657
4680
|
});
|
|
4681
|
+
if (transformedTagName !== exportName) {
|
|
4682
|
+
cmpModules.set(transformedTagName, {
|
|
4683
|
+
[transformedTagName]: Cstr
|
|
4684
|
+
});
|
|
4685
|
+
}
|
|
4658
4686
|
}
|
|
4659
4687
|
};
|
|
4660
4688
|
var win = window;
|
|
@@ -4803,12 +4831,14 @@ export {
|
|
|
4803
4831
|
setNonce,
|
|
4804
4832
|
setPlatformHelpers,
|
|
4805
4833
|
setScopedSSR,
|
|
4834
|
+
setTagTransformer,
|
|
4806
4835
|
setValue,
|
|
4807
4836
|
styles,
|
|
4808
4837
|
supportsConstructableStylesheets,
|
|
4809
4838
|
supportsListenerOptions,
|
|
4810
4839
|
supportsMutableAdoptedStyleSheets,
|
|
4811
4840
|
supportsShadow,
|
|
4841
|
+
transformTag,
|
|
4812
4842
|
win,
|
|
4813
4843
|
writeTask
|
|
4814
4844
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/hydrate",
|
|
3
|
-
"version": "4.38.3-dev.
|
|
3
|
+
"version": "4.38.3-dev.1764708888.c031e0a",
|
|
4
4
|
"description": "Stencil internal hydrate platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"private": true
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { Readable } from 'node:stream';
|
|
4
4
|
|
|
5
5
|
export declare function createWindowFromHtml(templateHtml: string, uniqueId: string): any;
|
|
6
|
+
export type TagTransformer = (tag: string) => string;
|
|
6
7
|
/**
|
|
7
8
|
* Serialize a value to a string that can be deserialized later.
|
|
8
9
|
* @param {unknown} value - The value to serialize.
|
|
@@ -271,5 +272,16 @@ export declare function renderToString(html: string | any, options: SerializeDoc
|
|
|
271
272
|
export declare function hydrateDocument(doc: any | string, options?: HydrateDocumentOptions): Promise<HydrateResults>;
|
|
272
273
|
export declare function hydrateDocument(doc: any | string, options: HydrateDocumentOptions | undefined, asStream?: boolean): Readable;
|
|
273
274
|
export declare function serializeDocumentToString(doc: Document, opts: HydrateFactoryOptions): string;
|
|
275
|
+
/**
|
|
276
|
+
* Transforms a tag name using the current tag transformer
|
|
277
|
+
* @param tag - the tag to transform e.g. `my-tag`
|
|
278
|
+
* @returns the transformed tag e.g. `new-my-tag`
|
|
279
|
+
*/
|
|
280
|
+
export declare function transformTag<T extends string>(tag: T): T;
|
|
281
|
+
/**
|
|
282
|
+
* Sets the tag transformer to be used when rendering custom elements
|
|
283
|
+
* @param transformer the transformer function to use. Must return a string
|
|
284
|
+
*/
|
|
285
|
+
export declare function setTagTransformer(transformer: TagTransformer): void;
|
|
274
286
|
|
|
275
287
|
export {};
|