@stencil/core 5.0.0-beta.26 → 5.0.0-beta.28

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.
@@ -3356,7 +3356,9 @@ interface CopyTask {
3356
3356
  /**
3357
3357
  * Additional glob patterns to exclude from the copy operation, merged with
3358
3358
  * the built-in defaults: `__mocks__`, `__fixtures__`, `dist`, hidden dirs,
3359
- * `.ds_store`, `.gitignore`, `desktop.ini`, `thumbs.db`.
3359
+ * `.ds_store`, `.gitignore`, `desktop.ini`, `thumbs.db`. For a directory
3360
+ * `src`, patterns match paths relative to that directory; an explicitly
3361
+ * named `src` file is never ignored.
3360
3362
  */
3361
3363
  ignore?: string[];
3362
3364
  /**
@@ -4500,7 +4502,7 @@ interface TranspileOptions {
4500
4502
  * transpile time — config-driven flags that are not derived from component
4501
4503
  * scanning or runtime environment detection.
4502
4504
  */
4503
- type BuildOverrideKeys = 'hotModuleReplacement' | 'signalBacking' | 'vdomSignals' | 'lightDomPatches' | 'slotChildNodes' | 'slotCloneNode' | 'slotDomMutations' | 'slotTextContent' | 'lifecycleDOMEvents' | 'initializeNextTick';
4505
+ type BuildOverrideKeys = 'isDev' | 'isTesting' | 'hotModuleReplacement' | 'signalBacking' | 'vdomSignals' | 'lightDomPatches' | 'slotChildNodes' | 'slotCloneNode' | 'slotDomMutations' | 'slotTextContent' | 'lifecycleDOMEvents' | 'initializeNextTick';
4504
4506
  /**
4505
4507
  * Subset of Stencil's BUILD feature flags that can be overridden at transpile
4506
4508
  * time. Derived from {@link BuildConditionals} via `Pick` so the field list
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { C as Build, S as setErrorHandler, _ as getAssetPath, a as transformTag, b as writeTask, c as Mixin, d as Host, f as h, g as getShadowRoot, h as getElement, i as setTagTransformer, l as getMode, m as getRenderingRef, o as render, p as forceUpdate, s as ReactiveControllerHost, u as setMode, v as setAssetPath, x as setPlatformHelpers, y as readTask } from "./client-CVXS3JZ-.mjs";
1
+ import { C as Build, S as setErrorHandler, _ as getAssetPath, a as transformTag, b as writeTask, c as Mixin, d as Host, f as h, g as getShadowRoot, h as getElement, i as setTagTransformer, l as getMode, m as getRenderingRef, o as render, p as forceUpdate, s as ReactiveControllerHost, u as setMode, v as setAssetPath, x as setPlatformHelpers, y as readTask } from "./client-BYvfR_Hx.mjs";
2
2
  import { t as Fragment } from "./fragment-Di1hWOC8.mjs";
3
3
  //#region src/client/client-decorators.ts
4
4
  /**
@@ -1,3 +1,3 @@
1
- import { n as jsxDEV, r as jsxs, t as jsx } from "./client-CVXS3JZ-.mjs";
1
+ import { n as jsxDEV, r as jsxs, t as jsx } from "./client-BYvfR_Hx.mjs";
2
2
  import { t as Fragment } from "./fragment-Di1hWOC8.mjs";
3
3
  export { Fragment, jsx, jsxDEV, jsxs };
@@ -1,10 +1,11 @@
1
1
  import { n as __require } from "./rolldown-runtime-BhDjJH2R.mjs";
2
- import "./client-CVXS3JZ-.mjs";
2
+ import "./client-BYvfR_Hx.mjs";
3
3
  import { c as isFunction, f as isString, m as noop, r as flatOne } from "./helpers-Cpp3qc3u.mjs";
4
4
  import { $ as catchError, K as normalizePath, X as buildError, Y as TASK_CANCELED_MSG, nt as shouldIgnoreError, rt as isGlob } from "./util-IKfWWLJo.mjs";
5
5
  import fs from "node:fs";
6
6
  import nodePath from "node:path";
7
7
  import { pathToFileURL } from "node:url";
8
+ import picomatch from "picomatch";
8
9
  import path from "path";
9
10
  import chalk from "chalk";
10
11
  import { createHash } from "node:crypto";
@@ -766,7 +767,13 @@ async function nodeCopyTasks(copyTasks, srcDir) {
766
767
  filePaths: []
767
768
  };
768
769
  try {
769
- copyTasks = flatOne(await Promise.all(copyTasks.map((task) => processGlobs(task, srcDir))));
770
+ copyTasks = flatOne(await Promise.all(copyTasks.map(async (task) => {
771
+ const fileTasks = await processGlobs(task, srcDir);
772
+ if (!fileTasks.some(escapesDest)) return fileTasks;
773
+ const err = buildError(results.diagnostics);
774
+ err.messageText = `Copy task "${task.src}" would write outside its destination "${task.dest}". Set "dest" (without "keepDirStructure") when copying from outside the src directory.`;
775
+ return [];
776
+ })));
770
777
  const allCopyTasks = [];
771
778
  while (copyTasks.length > 0) {
772
779
  const tasks = copyTasks.splice(0, 100);
@@ -791,9 +798,21 @@ async function processGlobs(copyTask, srcDir) {
791
798
  dest: copyTask.keepDirStructure ? path.join(copyTask.dest, copyTask.src) : copyTask.dest,
792
799
  warn: copyTask.warn,
793
800
  ignore: copyTask.ignore,
794
- keepDirStructure: copyTask.keepDirStructure
801
+ keepDirStructure: copyTask.keepDirStructure,
802
+ destRoot: copyTask.dest
795
803
  }];
796
804
  }
805
+ /**
806
+ * Keeping the directory structure of a `src` outside `srcDir` (`../x`) would carry the `../`
807
+ * into the destination path.
808
+ *
809
+ * @param task a per-file copy task
810
+ * @returns `true` if the task would write outside its destination directory
811
+ */
812
+ function escapesDest({ dest, destRoot }) {
813
+ const rel = path.relative(destRoot, dest);
814
+ return rel.startsWith("..") || path.isAbsolute(rel);
815
+ }
797
816
  function getSrcAbsPath(srcDir, src) {
798
817
  if (path.isAbsolute(src)) return src;
799
818
  return path.join(srcDir, src);
@@ -812,17 +831,25 @@ function createGlobCopyTask(copyTask, srcDir, globRelPath) {
812
831
  dest,
813
832
  ignore: copyTask.ignore,
814
833
  warn: copyTask.warn,
815
- keepDirStructure: copyTask.keepDirStructure
834
+ keepDirStructure: copyTask.keepDirStructure,
835
+ destRoot: copyTask.dest
816
836
  };
817
837
  }
818
- async function processCopyTask(results, allCopyTasks, copyTask) {
838
+ const createDirectoryWalk = ({ src, ignore = [] }) => ({
839
+ root: src,
840
+ isIgnored: picomatch(ignore, {
841
+ dot: true,
842
+ nocase: true
843
+ })
844
+ });
845
+ async function processCopyTask(results, allCopyTasks, copyTask, walk) {
819
846
  try {
820
847
  copyTask.src = normalizePath(copyTask.src);
821
848
  copyTask.dest = normalizePath(copyTask.dest);
822
849
  if ((await stat(copyTask.src)).isDirectory()) {
823
850
  if (!results.dirPaths.includes(copyTask.dest)) results.dirPaths.push(copyTask.dest);
824
- await processCopyTaskDirectory(results, allCopyTasks, copyTask);
825
- } else if (!shouldIgnore(copyTask)) {
851
+ await processCopyTaskDirectory(results, allCopyTasks, copyTask, walk ?? createDirectoryWalk(copyTask));
852
+ } else if (!walk || !walk.isIgnored(path.posix.relative(walk.root, copyTask.src))) {
826
853
  if (!results.filePaths.includes(copyTask.dest)) results.filePaths.push(copyTask.dest);
827
854
  allCopyTasks.push(copyTask);
828
855
  }
@@ -833,7 +860,7 @@ async function processCopyTask(results, allCopyTasks, copyTask) {
833
860
  }
834
861
  }
835
862
  }
836
- async function processCopyTaskDirectory(results, allCopyTasks, copyTask) {
863
+ async function processCopyTaskDirectory(results, allCopyTasks, copyTask, walk) {
837
864
  try {
838
865
  const dirItems = await readdir(copyTask.src);
839
866
  await Promise.all(dirItems.map(async (dirItem) => {
@@ -841,7 +868,7 @@ async function processCopyTaskDirectory(results, allCopyTasks, copyTask) {
841
868
  src: path.join(copyTask.src, dirItem),
842
869
  dest: path.join(copyTask.dest, dirItem),
843
870
  warn: copyTask.warn
844
- });
871
+ }, walk);
845
872
  }));
846
873
  } catch (e) {
847
874
  catchError(results.diagnostics, e);
@@ -869,10 +896,6 @@ function addMkDir(mkDirs, destDir) {
869
896
  if (!mkDirs.includes(destDir)) mkDirs.push(destDir);
870
897
  }
871
898
  const ROOT_DIR = normalizePath(path.resolve("/"));
872
- function shouldIgnore({ src, ignore = [] }) {
873
- const filePath = src.trim().toLowerCase();
874
- return ignore.some((ignoreFile) => filePath.endsWith(ignoreFile));
875
- }
876
899
  function asyncGlob(pattern, opts = {}) {
877
900
  const { nodir, ...rest } = opts;
878
901
  return glob(pattern, {
@@ -77,11 +77,19 @@ const FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
77
77
  ];
78
78
  //#endregion
79
79
  //#region src/client/client-build.ts
80
+ /**
81
+ * `isDev` / `isTesting` are getters, not copies: the transpile path (e.g. `@stencil/unplugin`)
82
+ * sets `BUILD.*` overrides from each component module, which runs after this module is evaluated.
83
+ */
80
84
  const Build = {
81
85
  isBrowser: true,
82
86
  isServer: false,
83
- isDev: BUILD.isDev,
84
- isTesting: BUILD.isTesting
87
+ get isDev() {
88
+ return BUILD.isDev;
89
+ },
90
+ get isTesting() {
91
+ return BUILD.isTesting;
92
+ }
85
93
  };
86
94
  //#endregion
87
95
  //#region src/client/client-decorators.ts
@@ -3297,17 +3305,23 @@ const vdomFnUtils = {
3297
3305
  * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
3298
3306
  * friendlier public interface (hence, 'convertToPublic').
3299
3307
  *
3300
- * @param node the virtual DOM node to convert
3308
+ * Functional components receive primitive children unwrapped, so those
3309
+ * become text-only child nodes.
3310
+ *
3311
+ * @param node the virtual DOM node (or primitive child) to convert
3301
3312
  * @returns a converted child node
3302
3313
  */
3303
- const convertToPublic = (node) => ({
3314
+ const convertToPublic = (node) => typeof node !== "object" ? {
3315
+ vtag: null,
3316
+ vtext: String(node)
3317
+ } : {
3304
3318
  vattrs: node.$attrs$,
3305
3319
  vchildren: node.$children$,
3306
3320
  vkey: node.$key$,
3307
3321
  vname: node.$name$,
3308
3322
  vtag: node.$tag$,
3309
3323
  vtext: node.$text$
3310
- });
3324
+ };
3311
3325
  /**
3312
3326
  * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
3313
3327
  * order to use the resulting object in the virtual DOM. The initial object was
@@ -3324,11 +3338,11 @@ const convertToPrivate = (node) => {
3324
3338
  if (node.vname) vnodeData.name = node.vname;
3325
3339
  return h(node.vtag, vnodeData, ...node.vchildren || []);
3326
3340
  }
3327
- const vnode = newVNode(node.vtag, node.vtext);
3328
- vnode.$attrs$ = node.vattrs;
3329
- vnode.$children$ = node.vchildren;
3330
- vnode.$key$ = node.vkey;
3331
- vnode.$name$ = node.vname;
3341
+ const vnode = newVNode(node.vtag ?? null, node.vtext);
3342
+ vnode.$attrs$ = node.vattrs ?? null;
3343
+ vnode.$children$ = node.vchildren ?? null;
3344
+ vnode.$key$ = node.vkey ?? null;
3345
+ vnode.$name$ = node.vname ?? null;
3332
3346
  return vnode;
3333
3347
  };
3334
3348
  /**
@@ -2142,6 +2142,10 @@ interface VNodeProdData {
2142
2142
  }
2143
2143
  //#endregion
2144
2144
  //#region src/client/client-build.d.ts
2145
+ /**
2146
+ * `isDev` / `isTesting` are getters, not copies: the transpile path (e.g. `@stencil/unplugin`)
2147
+ * sets `BUILD.*` overrides from each component module, which runs after this module is evaluated.
2148
+ */
2145
2149
  declare const Build: UserBuildConditionals;
2146
2150
  //#endregion
2147
2151
  //#region src/client/client-decorators.d.ts
@@ -71,11 +71,19 @@ const FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
71
71
  ];
72
72
  //#endregion
73
73
  //#region src/client/client-build.ts
74
+ /**
75
+ * `isDev` / `isTesting` are getters, not copies: the transpile path (e.g. `@stencil/unplugin`)
76
+ * sets `BUILD.*` overrides from each component module, which runs after this module is evaluated.
77
+ */
74
78
  const Build = {
75
79
  isBrowser: true,
76
80
  isServer: false,
77
- isDev: BUILD$1.isDev,
78
- isTesting: BUILD$1.isTesting
81
+ get isDev() {
82
+ return BUILD$1.isDev;
83
+ },
84
+ get isTesting() {
85
+ return BUILD$1.isTesting;
86
+ }
79
87
  };
80
88
  //#endregion
81
89
  //#region src/client/client-decorators.ts
@@ -3291,17 +3299,23 @@ const vdomFnUtils = {
3291
3299
  * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
3292
3300
  * friendlier public interface (hence, 'convertToPublic').
3293
3301
  *
3294
- * @param node the virtual DOM node to convert
3302
+ * Functional components receive primitive children unwrapped, so those
3303
+ * become text-only child nodes.
3304
+ *
3305
+ * @param node the virtual DOM node (or primitive child) to convert
3295
3306
  * @returns a converted child node
3296
3307
  */
3297
- const convertToPublic = (node) => ({
3308
+ const convertToPublic = (node) => typeof node !== "object" ? {
3309
+ vtag: null,
3310
+ vtext: String(node)
3311
+ } : {
3298
3312
  vattrs: node.$attrs$,
3299
3313
  vchildren: node.$children$,
3300
3314
  vkey: node.$key$,
3301
3315
  vname: node.$name$,
3302
3316
  vtag: node.$tag$,
3303
3317
  vtext: node.$text$
3304
- });
3318
+ };
3305
3319
  /**
3306
3320
  * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
3307
3321
  * order to use the resulting object in the virtual DOM. The initial object was
@@ -3318,11 +3332,11 @@ const convertToPrivate = (node) => {
3318
3332
  if (node.vname) vnodeData.name = node.vname;
3319
3333
  return h(node.vtag, vnodeData, ...node.vchildren || []);
3320
3334
  }
3321
- const vnode = newVNode(node.vtag, node.vtext);
3322
- vnode.$attrs$ = node.vattrs;
3323
- vnode.$children$ = node.vchildren;
3324
- vnode.$key$ = node.vkey;
3325
- vnode.$name$ = node.vname;
3335
+ const vnode = newVNode(node.vtag ?? null, node.vtext);
3336
+ vnode.$attrs$ = node.vattrs ?? null;
3337
+ vnode.$children$ = node.vchildren ?? null;
3338
+ vnode.$key$ = node.vkey ?? null;
3339
+ vnode.$name$ = node.vname ?? null;
3326
3340
  return vnode;
3327
3341
  };
3328
3342
  /**
@@ -71,11 +71,19 @@ const FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
71
71
  ];
72
72
  //#endregion
73
73
  //#region src/client/client-build.ts
74
+ /**
75
+ * `isDev` / `isTesting` are getters, not copies: the transpile path (e.g. `@stencil/unplugin`)
76
+ * sets `BUILD.*` overrides from each component module, which runs after this module is evaluated.
77
+ */
74
78
  const Build = {
75
79
  isBrowser: true,
76
80
  isServer: false,
77
- isDev: BUILD.isDev,
78
- isTesting: BUILD.isTesting
81
+ get isDev() {
82
+ return BUILD.isDev;
83
+ },
84
+ get isTesting() {
85
+ return BUILD.isTesting;
86
+ }
79
87
  };
80
88
  const MEMBER_FLAGS = {
81
89
  String: 1,
@@ -3163,17 +3171,23 @@ const vdomFnUtils = {
3163
3171
  * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
3164
3172
  * friendlier public interface (hence, 'convertToPublic').
3165
3173
  *
3166
- * @param node the virtual DOM node to convert
3174
+ * Functional components receive primitive children unwrapped, so those
3175
+ * become text-only child nodes.
3176
+ *
3177
+ * @param node the virtual DOM node (or primitive child) to convert
3167
3178
  * @returns a converted child node
3168
3179
  */
3169
- const convertToPublic = (node) => ({
3180
+ const convertToPublic = (node) => typeof node !== "object" ? {
3181
+ vtag: null,
3182
+ vtext: String(node)
3183
+ } : {
3170
3184
  vattrs: node.$attrs$,
3171
3185
  vchildren: node.$children$,
3172
3186
  vkey: node.$key$,
3173
3187
  vname: node.$name$,
3174
3188
  vtag: node.$tag$,
3175
3189
  vtext: node.$text$
3176
- });
3190
+ };
3177
3191
  /**
3178
3192
  * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
3179
3193
  * order to use the resulting object in the virtual DOM. The initial object was
@@ -3190,11 +3204,11 @@ const convertToPrivate = (node) => {
3190
3204
  if (node.vname) vnodeData.name = node.vname;
3191
3205
  return h(node.vtag, vnodeData, ...node.vchildren || []);
3192
3206
  }
3193
- const vnode = newVNode(node.vtag, node.vtext);
3194
- vnode.$attrs$ = node.vattrs;
3195
- vnode.$children$ = node.vchildren;
3196
- vnode.$key$ = node.vkey;
3197
- vnode.$name$ = node.vname;
3207
+ const vnode = newVNode(node.vtag ?? null, node.vtext);
3208
+ vnode.$attrs$ = node.vattrs ?? null;
3209
+ vnode.$children$ = node.vchildren ?? null;
3210
+ vnode.$key$ = node.vkey ?? null;
3211
+ vnode.$name$ = node.vname ?? null;
3198
3212
  return vnode;
3199
3213
  };
3200
3214
  /**
@@ -2933,17 +2933,23 @@ const vdomFnUtils = {
2933
2933
  * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
2934
2934
  * friendlier public interface (hence, 'convertToPublic').
2935
2935
  *
2936
- * @param node the virtual DOM node to convert
2936
+ * Functional components receive primitive children unwrapped, so those
2937
+ * become text-only child nodes.
2938
+ *
2939
+ * @param node the virtual DOM node (or primitive child) to convert
2937
2940
  * @returns a converted child node
2938
2941
  */
2939
- const convertToPublic = (node) => ({
2942
+ const convertToPublic = (node) => typeof node !== "object" ? {
2943
+ vtag: null,
2944
+ vtext: String(node)
2945
+ } : {
2940
2946
  vattrs: node.$attrs$,
2941
2947
  vchildren: node.$children$,
2942
2948
  vkey: node.$key$,
2943
2949
  vname: node.$name$,
2944
2950
  vtag: node.$tag$,
2945
2951
  vtext: node.$text$
2946
- });
2952
+ };
2947
2953
  /**
2948
2954
  * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
2949
2955
  * order to use the resulting object in the virtual DOM. The initial object was
@@ -2960,11 +2966,11 @@ const convertToPrivate = (node) => {
2960
2966
  if (node.vname) vnodeData.name = node.vname;
2961
2967
  return h(node.vtag, vnodeData, ...node.vchildren || []);
2962
2968
  }
2963
- const vnode = newVNode(node.vtag, node.vtext);
2964
- vnode.$attrs$ = node.vattrs;
2965
- vnode.$children$ = node.vchildren;
2966
- vnode.$key$ = node.vkey;
2967
- vnode.$name$ = node.vname;
2969
+ const vnode = newVNode(node.vtag ?? null, node.vtext);
2970
+ vnode.$attrs$ = node.vattrs ?? null;
2971
+ vnode.$children$ = node.vchildren ?? null;
2972
+ vnode.$key$ = node.vkey ?? null;
2973
+ vnode.$name$ = node.vname ?? null;
2968
2974
  return vnode;
2969
2975
  };
2970
2976
  /**
@@ -102,7 +102,6 @@ const BUILD = {
102
102
  asyncLoading: true,
103
103
  asyncQueue: false
104
104
  };
105
- BUILD.isDev, BUILD.isTesting;
106
105
  //#endregion
107
106
  //#region src/client/client-log.ts
108
107
  const STENCIL_DEV_MODE = BUILD.isTesting ? ["STENCIL:"] : ["%cstencil", "color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"];
@@ -1,4 +1,4 @@
1
- import { Bt as Logger, nt as CompilerSystem } from "../../index-C41EOWaQ.mjs";
1
+ import { Bt as Logger, nt as CompilerSystem } from "../../index-BogZpjP2.mjs";
2
2
  //#region src/sys/node/logger/index.d.ts
3
3
  /**
4
4
  * Create a logger to run in a Node environment
@@ -1,2 +1,2 @@
1
- import { n as setupNodeProcess, r as createNodeLogger, t as createNodeSys } from "../../node-Bz2SOK7_.mjs";
1
+ import { n as setupNodeProcess, r as createNodeLogger, t as createNodeSys } from "../../node-CvPPhnWO.mjs";
2
2
  export { createNodeLogger, createNodeSys, setupNodeProcess };
@@ -1,5 +1,5 @@
1
- import { l as createWorkerMessageHandler } from "../../compiler-D7LTP5Hp.mjs";
2
- import { t as createNodeSys } from "../../node-Bz2SOK7_.mjs";
1
+ import { l as createWorkerMessageHandler } from "../../compiler-BQcDWWEp.mjs";
2
+ import { t as createNodeSys } from "../../node-CvPPhnWO.mjs";
3
3
  //#region src/sys/node/node-worker-thread.ts
4
4
  /**
5
5
  * Initialize a worker thread, setting up various machinery for managing
@@ -2112,7 +2112,9 @@ interface CopyTask {
2112
2112
  /**
2113
2113
  * Additional glob patterns to exclude from the copy operation, merged with
2114
2114
  * the built-in defaults: `__mocks__`, `__fixtures__`, `dist`, hidden dirs,
2115
- * `.ds_store`, `.gitignore`, `desktop.ini`, `thumbs.db`.
2115
+ * `.ds_store`, `.gitignore`, `desktop.ini`, `thumbs.db`. For a directory
2116
+ * `src`, patterns match paths relative to that directory; an explicitly
2117
+ * named `src` file is never ignored.
2116
2118
  */
2117
2119
  ignore?: string[];
2118
2120
  /**
@@ -33,7 +33,7 @@ import "@rollup/pluginutils";
33
33
  import { createHash } from "crypto";
34
34
  import { afterAll, vi } from "vitest";
35
35
  //#region src/version.ts
36
- const version = "5.0.0-beta.26";
36
+ const version = "5.0.0-beta.28";
37
37
  const MEMBER_FLAGS = {
38
38
  String: 1,
39
39
  Number: 2,
@@ -3690,17 +3690,23 @@ const vdomFnUtils = {
3690
3690
  * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
3691
3691
  * friendlier public interface (hence, 'convertToPublic').
3692
3692
  *
3693
- * @param node the virtual DOM node to convert
3693
+ * Functional components receive primitive children unwrapped, so those
3694
+ * become text-only child nodes.
3695
+ *
3696
+ * @param node the virtual DOM node (or primitive child) to convert
3694
3697
  * @returns a converted child node
3695
3698
  */
3696
- const convertToPublic = (node) => ({
3699
+ const convertToPublic = (node) => typeof node !== "object" ? {
3700
+ vtag: null,
3701
+ vtext: String(node)
3702
+ } : {
3697
3703
  vattrs: node.$attrs$,
3698
3704
  vchildren: node.$children$,
3699
3705
  vkey: node.$key$,
3700
3706
  vname: node.$name$,
3701
3707
  vtag: node.$tag$,
3702
3708
  vtext: node.$text$
3703
- });
3709
+ };
3704
3710
  /**
3705
3711
  * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
3706
3712
  * order to use the resulting object in the virtual DOM. The initial object was
@@ -3717,11 +3723,11 @@ const convertToPrivate = (node) => {
3717
3723
  if (node.vname) vnodeData.name = node.vname;
3718
3724
  return h(node.vtag, vnodeData, ...node.vchildren || []);
3719
3725
  }
3720
- const vnode = newVNode(node.vtag, node.vtext);
3721
- vnode.$attrs$ = node.vattrs;
3722
- vnode.$children$ = node.vchildren;
3723
- vnode.$key$ = node.vkey;
3724
- vnode.$name$ = node.vname;
3726
+ const vnode = newVNode(node.vtag ?? null, node.vtext);
3727
+ vnode.$attrs$ = node.vattrs ?? null;
3728
+ vnode.$children$ = node.vchildren ?? null;
3729
+ vnode.$key$ = node.vkey ?? null;
3730
+ vnode.$name$ = node.vname ?? null;
3725
3731
  return vnode;
3726
3732
  };
3727
3733
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core",
3
- "version": "5.0.0-beta.26",
3
+ "version": "5.0.0-beta.28",
4
4
  "description": "A Compiler for Web Components and Progressive Web Apps",
5
5
  "keywords": [
6
6
  "components",
@@ -126,9 +126,9 @@
126
126
  "terser": "^5.50.0",
127
127
  "tinyglobby": "^0.2.17",
128
128
  "typescript": ">5.0.0 <7.0.0",
129
- "@stencil/cli": "5.0.0-beta.26",
130
- "@stencil/dev-server": "5.0.0-beta.26",
131
- "@stencil/mock-doc": "5.0.0-beta.26"
129
+ "@stencil/dev-server": "5.0.0-beta.28",
130
+ "@stencil/cli": "5.0.0-beta.28",
131
+ "@stencil/mock-doc": "5.0.0-beta.28"
132
132
  },
133
133
  "devDependencies": {
134
134
  "@ionic/prettier-config": "^4.0.0",