@stencil/core 5.0.0-alpha.3 → 5.0.0-alpha.4
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/dist/{client-CSm3x5ke.mjs → client-Dti6fFpE.mjs} +27 -9
- package/dist/compiler/index.d.mts +2 -2
- package/dist/compiler/index.mjs +2 -2
- package/dist/compiler/utils/index.d.mts +1 -1
- package/dist/{compiler-D6iP7Bzb.mjs → compiler-BYRrEeD-.mjs} +265 -65
- package/dist/declarations/stencil-public-compiler.d.ts +54 -0
- package/dist/{index-CXHCTQNt.d.mts → index-9LTuoSiw.d.mts} +5 -1
- package/dist/{index-tUR6pD3J.d.mts → index-BwTaN1Nq.d.mts} +55 -1
- package/dist/index.mjs +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/{node-Bg-mO5dw.mjs → node-BF2jSfWg.mjs} +1 -1
- package/dist/runtime/client/index.d.ts +4 -0
- package/dist/runtime/client/index.js +27 -9
- package/dist/runtime/index.d.ts +4 -0
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/server/index.d.mts +17 -4
- package/dist/runtime/server/index.mjs +25 -10
- package/dist/{runtime-BBCnuprF.js → runtime-COEYYPyw.js} +27 -9
- package/dist/sys/node/index.d.mts +1 -1
- package/dist/sys/node/index.mjs +1 -1
- package/dist/sys/node/worker.mjs +2 -2
- package/dist/testing/index.d.mts +2 -2
- package/dist/testing/index.mjs +5 -4
- package/package.json +4 -4
|
@@ -868,6 +868,25 @@ interface CollectionCompilerVersion {
|
|
|
868
868
|
version: string;
|
|
869
869
|
typescriptVersion?: string;
|
|
870
870
|
}
|
|
871
|
+
/**
|
|
872
|
+
* A memoized result of the SASS + Lightning CSS transformation for a single stylesheet, keyed by
|
|
873
|
+
* the annotated Rolldown import id (e.g. `/path/to/comp.scss?tag=ion-button&encapsulation=shadow`).
|
|
874
|
+
*
|
|
875
|
+
* Storing this allows all output targets (customElements, lazy, hydrate) that process the same
|
|
876
|
+
* stylesheets to share a single computation instead of repeating it N times.
|
|
877
|
+
*/
|
|
878
|
+
interface CssTransformCacheEntry {
|
|
879
|
+
/** Resolved file ID after plugin (SASS) transforms */
|
|
880
|
+
pluginTransformId: string;
|
|
881
|
+
/** CSS source produced by the SASS / plugin pipeline */
|
|
882
|
+
pluginTransformCode: string;
|
|
883
|
+
/** File dependencies discovered during the SASS transform (e.g. `@import`-ed partials) */
|
|
884
|
+
pluginTransformDependencies: string[];
|
|
885
|
+
/** Diagnostics emitted during the plugin transform pass */
|
|
886
|
+
pluginTransformDiagnostics: Diagnostic[];
|
|
887
|
+
/** Full output of the subsequent `transformCssToEsm` call */
|
|
888
|
+
cssTransformOutput: TransformCssToEsmOutput;
|
|
889
|
+
}
|
|
871
890
|
interface CompilerCtx {
|
|
872
891
|
version: number;
|
|
873
892
|
activeBuildId: number;
|
|
@@ -902,6 +921,16 @@ interface CompilerCtx {
|
|
|
902
921
|
changedFiles: Set<string>;
|
|
903
922
|
worker?: CompilerWorkerContext;
|
|
904
923
|
rolldownCache: Map<string, any>;
|
|
924
|
+
/**
|
|
925
|
+
* Cross-output-target cache for the SASS + Lightning CSS computation.
|
|
926
|
+
* Keyed by the annotated Rolldown import id. Null entries indicate that the
|
|
927
|
+
* source file could not be read (propagated as a `null` return from the
|
|
928
|
+
* transform hook).
|
|
929
|
+
*
|
|
930
|
+
* Entries are invalidated in `invalidateRolldownCaches` whenever a
|
|
931
|
+
* source file or one of its SASS dependencies is modified.
|
|
932
|
+
*/
|
|
933
|
+
cssTransformCache: Map<string, CssTransformCacheEntry | null>;
|
|
905
934
|
reset(): void;
|
|
906
935
|
}
|
|
907
936
|
type NodeMap = WeakMap<any, ComponentCompilerMeta>;
|
|
@@ -3982,6 +4011,27 @@ interface TranspileOptions {
|
|
|
3982
4011
|
* Adds `transformTag` calls to css strings and querySelector(All) calls
|
|
3983
4012
|
*/
|
|
3984
4013
|
additionalTagTransformers?: boolean;
|
|
4014
|
+
/**
|
|
4015
|
+
* A map of virtual file paths to source text for modules that the component
|
|
4016
|
+
* under transpilation extends from. When provided, `transpile()` builds a
|
|
4017
|
+
* minimal multi-file TypeScript program from these sources so that
|
|
4018
|
+
* {@link https://stenciljs.com/docs/component-lifecycle inheritance chains}
|
|
4019
|
+
* can be resolved without requiring the parent files to exist on disk.
|
|
4020
|
+
*
|
|
4021
|
+
* Keys are the same import paths used in the component's `import` statements
|
|
4022
|
+
* (relative paths are resolved against `currentDirectory`). Values are the
|
|
4023
|
+
* TypeScript/JavaScript source text of that module.
|
|
4024
|
+
*
|
|
4025
|
+
* @example
|
|
4026
|
+
* ```ts
|
|
4027
|
+
* transpile(myComponentCode, {
|
|
4028
|
+
* extraFiles: {
|
|
4029
|
+
* './base-component.ts': baseComponentSourceText,
|
|
4030
|
+
* },
|
|
4031
|
+
* });
|
|
4032
|
+
* ```
|
|
4033
|
+
*/
|
|
4034
|
+
extraFiles?: Record<string, string>;
|
|
3985
4035
|
}
|
|
3986
4036
|
type CompileTarget = 'latest' | 'esnext' | 'es2020' | 'es2019' | 'es2018' | 'es2017' | 'es2015' | string | undefined;
|
|
3987
4037
|
interface TranspileResults {
|
|
@@ -4008,6 +4058,10 @@ interface TransformOptions {
|
|
|
4008
4058
|
style: 'static' | null;
|
|
4009
4059
|
styleImportData: 'queryparams' | null;
|
|
4010
4060
|
target?: string;
|
|
4061
|
+
/**
|
|
4062
|
+
* @see {@link TranspileOptions.extraFiles}
|
|
4063
|
+
*/
|
|
4064
|
+
extraFiles?: Record<string, string>;
|
|
4011
4065
|
}
|
|
4012
4066
|
interface CompileScriptMinifyOptions {
|
|
4013
4067
|
target?: CompileTarget;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Tt as HostElement, ca as FunctionalComponent, da as TagTransformer, fa as UserBuildConditionals, hn as RuntimeRef, la as RafCallback, p as ChildType, pa as VNode, sa as ErrorHandler, ua as ResolutionHandler } from "./index-BwTaN1Nq.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/client/client-build.d.ts
|
|
4
4
|
declare const Build: UserBuildConditionals;
|
|
@@ -149,6 +149,10 @@ declare const getMode: (ref: RuntimeRef) => string;
|
|
|
149
149
|
/**
|
|
150
150
|
* Method to render a virtual DOM tree to a container element.
|
|
151
151
|
*
|
|
152
|
+
* Supports efficient re-renders: calling `render()` again on the same container
|
|
153
|
+
* will diff the new VNode tree against the previous one and only update what changed,
|
|
154
|
+
* preserving existing DOM elements and their state.
|
|
155
|
+
*
|
|
152
156
|
* @example
|
|
153
157
|
* ```tsx
|
|
154
158
|
* import { render } from '@stencil/core';
|
|
@@ -4173,6 +4173,27 @@ interface TranspileOptions {
|
|
|
4173
4173
|
* Adds `transformTag` calls to css strings and querySelector(All) calls
|
|
4174
4174
|
*/
|
|
4175
4175
|
additionalTagTransformers?: boolean;
|
|
4176
|
+
/**
|
|
4177
|
+
* A map of virtual file paths to source text for modules that the component
|
|
4178
|
+
* under transpilation extends from. When provided, `transpile()` builds a
|
|
4179
|
+
* minimal multi-file TypeScript program from these sources so that
|
|
4180
|
+
* {@link https://stenciljs.com/docs/component-lifecycle inheritance chains}
|
|
4181
|
+
* can be resolved without requiring the parent files to exist on disk.
|
|
4182
|
+
*
|
|
4183
|
+
* Keys are the same import paths used in the component's `import` statements
|
|
4184
|
+
* (relative paths are resolved against `currentDirectory`). Values are the
|
|
4185
|
+
* TypeScript/JavaScript source text of that module.
|
|
4186
|
+
*
|
|
4187
|
+
* @example
|
|
4188
|
+
* ```ts
|
|
4189
|
+
* transpile(myComponentCode, {
|
|
4190
|
+
* extraFiles: {
|
|
4191
|
+
* './base-component.ts': baseComponentSourceText,
|
|
4192
|
+
* },
|
|
4193
|
+
* });
|
|
4194
|
+
* ```
|
|
4195
|
+
*/
|
|
4196
|
+
extraFiles?: Record<string, string>;
|
|
4176
4197
|
}
|
|
4177
4198
|
type CompileTarget = 'latest' | 'esnext' | 'es2020' | 'es2019' | 'es2018' | 'es2017' | 'es2015' | string | undefined;
|
|
4178
4199
|
interface TranspileResults {
|
|
@@ -4199,6 +4220,10 @@ interface TransformOptions {
|
|
|
4199
4220
|
style: 'static' | null;
|
|
4200
4221
|
styleImportData: 'queryparams' | null;
|
|
4201
4222
|
target?: string;
|
|
4223
|
+
/**
|
|
4224
|
+
* @see {@link TranspileOptions.extraFiles}
|
|
4225
|
+
*/
|
|
4226
|
+
extraFiles?: Record<string, string>;
|
|
4202
4227
|
}
|
|
4203
4228
|
interface CompileScriptMinifyOptions {
|
|
4204
4229
|
target?: CompileTarget;
|
|
@@ -4612,6 +4637,25 @@ interface CollectionDependencyData {
|
|
|
4612
4637
|
name: string;
|
|
4613
4638
|
tags: string[];
|
|
4614
4639
|
}
|
|
4640
|
+
/**
|
|
4641
|
+
* A memoized result of the SASS + Lightning CSS transformation for a single stylesheet, keyed by
|
|
4642
|
+
* the annotated Rolldown import id (e.g. `/path/to/comp.scss?tag=ion-button&encapsulation=shadow`).
|
|
4643
|
+
*
|
|
4644
|
+
* Storing this allows all output targets (customElements, lazy, hydrate) that process the same
|
|
4645
|
+
* stylesheets to share a single computation instead of repeating it N times.
|
|
4646
|
+
*/
|
|
4647
|
+
interface CssTransformCacheEntry {
|
|
4648
|
+
/** Resolved file ID after plugin (SASS) transforms */
|
|
4649
|
+
pluginTransformId: string;
|
|
4650
|
+
/** CSS source produced by the SASS / plugin pipeline */
|
|
4651
|
+
pluginTransformCode: string;
|
|
4652
|
+
/** File dependencies discovered during the SASS transform (e.g. `@import`-ed partials) */
|
|
4653
|
+
pluginTransformDependencies: string[];
|
|
4654
|
+
/** Diagnostics emitted during the plugin transform pass */
|
|
4655
|
+
pluginTransformDiagnostics: Diagnostic$1[];
|
|
4656
|
+
/** Full output of the subsequent `transformCssToEsm` call */
|
|
4657
|
+
cssTransformOutput: TransformCssToEsmOutput;
|
|
4658
|
+
}
|
|
4615
4659
|
interface CompilerCtx {
|
|
4616
4660
|
version: number;
|
|
4617
4661
|
activeBuildId: number;
|
|
@@ -4646,6 +4690,16 @@ interface CompilerCtx {
|
|
|
4646
4690
|
changedFiles: Set<string>;
|
|
4647
4691
|
worker?: CompilerWorkerContext;
|
|
4648
4692
|
rolldownCache: Map<string, any>;
|
|
4693
|
+
/**
|
|
4694
|
+
* Cross-output-target cache for the SASS + Lightning CSS computation.
|
|
4695
|
+
* Keyed by the annotated Rolldown import id. Null entries indicate that the
|
|
4696
|
+
* source file could not be read (propagated as a `null` return from the
|
|
4697
|
+
* transform hook).
|
|
4698
|
+
*
|
|
4699
|
+
* Entries are invalidated in `invalidateRolldownCaches` whenever a
|
|
4700
|
+
* source file or one of its SASS dependencies is modified.
|
|
4701
|
+
*/
|
|
4702
|
+
cssTransformCache: Map<string, CssTransformCacheEntry | null>;
|
|
4649
4703
|
reset(): void;
|
|
4650
4704
|
}
|
|
4651
4705
|
type NodeMap = WeakMap<any, ComponentCompilerMeta>;
|
|
@@ -6251,4 +6305,4 @@ interface ValidateTypesResults {
|
|
|
6251
6305
|
filePaths: string[];
|
|
6252
6306
|
}
|
|
6253
6307
|
//#endregion
|
|
6254
|
-
export { ComponentCompilerVirtualProperty as $, escapeRegExpSpecialCharacters as $a, TranspileOptions as $i, CompilerEventBuildFinish as $n, dashToPascalCase as $o, LoggerLineUpdater as $r, byteSize as $s, PluginTransformResults as $t, CompilerStyleDoc as A, StyleDoc as Aa, PrerenderConfig as Ai, UpdatedLazyBuildCtx as An, isOutputTargetStats as Ao, CopyResults as Ar, DIST_GLOBAL_STYLES as As, HydrateResults as At, ComponentCompilerMeta as B, isJsFile as Ba, RolldownInputOptions as Bi, BuildNoChangeResults as Bn, hasError as Bo, FsWatchResults as Br, EVENT_FLAGS as Bs, ModuleFormat as Bt, CompilerBuildStatBundle as C, JsonDocsProp as Ca, OutputTargetDocsVscode as Ci, TransformCssToEsmInput as Cn, isOutputTargetDocs as Co, CompilerSystemRenameResults as Cr, COLLECTION_MANIFEST_FILE_NAME as Cs, ExternalStyleCompiler as Ct, CompilerJsDoc as D, JsonDocsTypeLibrary as Da, PageReloadStrategy as Di, TypesImportData as Dn, isOutputTargetDocsReadme as Do, Config as Dr, DIST as Ds, HydrateComponent as Dt, CompilerCtx as E, JsonDocsTag as Ea, OutputTargetWww as Ei, TypeInfo as En, isOutputTargetDocsJson as Eo, CompilerWatcher as Er, DEFAULT_STYLE_MODE as Es, HydrateAnchorElement as Et, ComponentCompilerData as F, createJsVarName as Fa, ResolveModuleIdResults as Fi, WorkerMsgHandler as Fn, TASK_CANCELED_MSG as Fo, DevServer as Fr, DOCS_CUSTOM as Fs, JSDocTagInfo as Ft, ComponentCompilerPropertyType as G, readOnlyArrayHasStringMember as Ga, SitemapXmpOpts as Gi, CacheStorage as Gn, splitLineBreaks as Go, HydrateFactoryOptions as Gr, MEMBER_FLAGS as Gs, NodeMap as Gt, ComponentCompilerMethodComplexType as H, isTsFile as Ha, RolldownOutputOptions as Hi, BuildOnEvents as Hn, shouldIgnoreError as Ho, HmrStyleUpdate as Hr, HOST_FLAGS as Hs, MsgFromWorker as Ht, ComponentCompilerEvent as I, generatePreamble as Ia, ResolveModuleOptions as Ii, AutoprefixerOptions as In, buildError as Io, DevServerConfig as Ir, DOCS_CUSTOM_ELEMENTS_MANIFEST as Is, JsDoc as It, ComponentCompilerStaticEvent as J, getInlineSourceMappingUrlLinker as Ja, StencilDevServerConfig as Ji, CompileTarget as Jn, loadTypeScriptDiagnostics as Jo, LazyRequire as Jr, SVG_NS as Js, ParsedImport as Jt, ComponentCompilerReferencedType as K, readPackageJson as Ka, SitemapXmpResults as Ki, CliInitOptions as Kn, augmentDiagnosticWithNode as Ko, HydratedFlag as Kr, NODE_TYPES as Ks, OptimizeJsResult as Kt, ComponentCompilerEventComplexType as L, getTextDocs as La, RobotsTxtOpts as Li, BuildEmitEvents as Ln, buildJsonFileError as Lo, DevServerEditor as Lr, DOCS_JSON as Ls, LazyBundleRuntimeData as Lt, CompilerWorkerTask as M, validateComponentTag as Ma, PrerenderResults as Mi, ValidateTypesResults as Mn, isValidConfigOutputTarget as Mo, Credentials as Mr, DIST_LAZY as Ms, HydrateStaticData as Mt, ComponentCompilerChangeHandler as N, ParsePackageJsonResult as Na, PrerenderStartOptions as Ni, Workbox as Nn, relativeImport as No, CustomElementsExportBehavior as Nr, DIST_LAZY_LOADER as Ns, HydrateStyleElement as Nt, CompilerJsDocTagInfo as O, JsonDocsUsage as Oa, ParsedPath as Oi, TypesMemberNameData as On, isOutputTargetDocsVscode as Oo, ConfigBundle as Or, DIST_COLLECTION as Os, HydrateElement as Ot, ComponentCompilerCustomState as P, addDocBlock as Pa, ResolveModuleIdOptions as Pi, WorkerContextMethod as Pn, shouldExcludeComponent as Po, CustomElementsExportBehaviorOptions as Pr, DIST_TYPES as Ps, ImportData as Pt, ComponentCompilerTypeReferences as Q, result_d_exports as Qa, TranspileOnlyResults as Qi, CompilerDependency as Qn, isGlob as Qo, Logger as Qr, XLINK_NS as Qs, PluginCtx as Qt, ComponentCompilerFeatures as R, hasDependency as Ra, RobotsTxtResults as Ri, BuildEvents as Rn, buildWarn as Ro, Diagnostic$1 as Rr, DOCS_README as Rs, LazyBundlesRuntimeData as Rt, CompilerAssetDir as S, JsonDocsPart as Sa, OutputTargetDocsReadme as Si, StyleMap as Sn, isOutputTargetDistTypes as So, CompilerSystemRemoveFileResults as Sr, CMP_FLAGS as Ss, EventInitDict as St, CompilerBuildStats as T, JsonDocsStyle as Ta, OutputTargetStats as Ti, TranspileModuleResults as Tn, isOutputTargetDocsCustomElementsManifest as To, CompilerSystemWriteFileResults as Tr, CUSTOM as Ts, HostRef as Tt, ComponentCompilerProperty as U, isTsxFile as Ua, SerializeDocumentOptions as Ui, BuildOutput as Un, escapeHtml as Uo, HotModuleReplacement as Ur, HTML_NS as Us, MsgToWorker as Ut, ComponentCompilerMethod as V, isJsxFile as Va, RolldownInterface as Vi, BuildOnEventRemove as Vn, hasWarning as Vo, HistoryApiFallback as Vr, GENERATED_DTS as Vs, ModuleMap as Vt, ComponentCompilerPropertyComplexType as W, parsePackageJson as Wa, ServiceWorkerConfig as Wi, BuildResultsComponentGraph as Wn, normalizeDiagnostics as Wo, HydrateDocumentOptions as Wr, LISTENER_FLAGS as Ws, NewSpecPageOptions as Wt, ComponentCompilerStaticProperty as X, getSourceMappingUrlLinker as Xa, SystemDetails as Xi, CompilerBuildResults as Xn, loadRolldownDiagnostics as Xo, LoadConfigResults as Xr, WATCH_FLAGS as Xs, PlatformRuntime as Xt, ComponentCompilerStaticMethod as Y, getSourceMappingUrlForEndOfFile as Ya, StencilDocsConfig as Yi, Compiler as Yn, createOnWarnFn as Yo, LoadConfigInit as Yr, VALID_CONFIG_OUTPUT_TARGETS as Ys, PatchedSlotNode as Yt, ComponentCompilerTypeReference as Z, rolldownToStencilSourceMap as Za, TransformOptions as Zi, CompilerBuildStart as Zn, isRootPath as Zo, LogLevel as Zr, WWW as Zs, Plugin as Zt, CollectionCompilerVersion as _, JsonDocsDependencyGraph as _a, OutputTargetDistLazyLoader as _i, SourceMap$1 as _n, isOutputTargetDistCollection as _o, CompilerSystemCreateDirectoryOptions as _r, toTitleCase as _s, CssImportData as _t, BuildCtx as a, WorkerOptions as aa, OptimizeJsOutput as ai, PropsType as an, normalizePath as ao, CompilerEventFileAdd as ar, isDef as as, ComponentConstructorProperties as at, CollectionDependencyManifest as b, JsonDocsMethod as ba, OutputTargetDocsCustomElementsManifest as bi, StencilDocument as bn, isOutputTargetDistLazy as bo, CompilerSystemRemoveDirectoryOptions as br, formatLazyBundleRuntimeMeta as bs, Encapsulation as bt, BuildStyleUpdate as c, RafCallback as ca, OutputTargetBaseNext as ci, RolldownChunkResult as cn, FilterComponentsResult as co, CompilerEventFsChange as cr, isNumber as cs, ComponentNativeConstructor as ct, BundleModuleOutput as d, UserBuildConditionals as da, OutputTargetCustom as di, RolldownResults as dn, getComponentsDtsTypesFilePath as do, CompilerFileWatcherCallback as dr, mergeIntoWith as ds, ComponentRuntimeMember as dt, TranspileResults as ea, LoggerTimeSpan as ei, PluginTransformationDescriptor as en, queryNonceMetaTagContent as eo, CompilerEventBuildLog as er, escapeWithPattern as es, ComponentConstructor as et, Cache as f, VNode as fa, OutputTargetDist as fi, RolldownSourceMap as fn, getComponentsFromModules as fo, CompilerFileWatcherEvent as fr, noop as fs, ComponentRuntimeMembers as ft, CollectionCompilerMeta as g, JsonDocsCustomState as ga, OutputTargetDistLazy as gi, SerializedEvent as gn, isOutputTargetDist as go, CompilerSystem as gr, toDashCase as gs, ComponentTestingConstructor as gt, CollectionCompiler as h, JsonDocsComponent as ha, OutputTargetDistGlobalStyles as hi, SerializeImportData as hn, isOutputTargetCustom as ho, CompilerRequestResponse as hr, toCamelCase as hs, ComponentRuntimeReflectingAttr as ht, BuildConditionals as i, WorkerMainController as ia, OptimizeJsInput as ii, PrintLine as in, normalizeFsPathQuery as io, CompilerEventDirDelete as ir, isComplexType as is, ComponentConstructorListener as it, CompilerWorkerContext as j, FsWriteResults as ja, PrerenderHydrateOptions as ji, VNodeProdData as jn, isOutputTargetWww as jo, CopyTask as jr, DIST_HYDRATE_SCRIPT as js, HydrateScriptElement as jt, CompilerModeStyles as k, JsonDocsValue as ka, PlatformPath as ki, TypesModule as kn, isOutputTargetHydrate as ko, ConfigExtras as kr, DIST_CUSTOM_ELEMENTS as ks, HydrateImgElement as kt, BuildTask as l, ResolutionHandler as la, OutputTargetBuild as li, RolldownResult as ln, filterExcludedComponents as lo, CompilerEventName as lr, isObject as ls, ComponentPatches as lt, CollectionBundleManifest as m, JsonDocs as ma, OutputTargetDistCustomElements as mi, RuntimeRef as mn, isOutputTargetCopy as mo, CompilerRequest as mr, sortBy as ms, ComponentRuntimeMetaCompact as mt, AssetsMeta as n, ValidatedConfig as na, OptimizeCssInput as ni, PrerenderUrlRequest as nn, normalize as no, CompilerEventBuildStart as nr, fromEntries as ns, ComponentConstructorEncapsulation as nt, BuildFeatures as o, ErrorHandler as oa, OutputTarget as oi, RenderNode as on, relative as oo, CompilerEventFileDelete as or, isFunction as os, ComponentConstructorProperty as ot, ChildType as p, JsonDocMethodParameter as pa, OutputTargetDistCollection as pi, RootAppliedStyleMap as pn, isEligiblePrimaryPackageOutputTarget as po, CompilerFsStats as pr, pluck as ps, ComponentRuntimeMeta as pt, ComponentCompilerState as q, isRemoteUrl as qa, StencilConfig as qi, CompileScriptMinifyOptions as qn, loadTypeScriptDiagnostic as qo, LOG_LEVELS as qr, STATS as qs, PackageJsonData as qt, BuildComponent as r, WatcherCloseResults as ra, OptimizeCssOutput as ri, PrerenderUrlResults as rn, normalizeFsPath as ro, CompilerEventDirAdd as rr, isBoolean as rs, ComponentConstructorEvent as rt, BuildSourceGraph as s, FunctionalComponent as sa, OutputTargetBase as si, RolldownAssetResult as sn, resolve as so, CompilerEventFileUpdate as sr, isIterable as ss, ComponentConstructorPropertyType as st, AnyHTMLElement as t, UnvalidatedConfig as ta, NodeResolveConfig as ti, PrerenderManager as tn, join as to, CompilerEventBuildNoChange as tr, flatOne as ts, ComponentConstructorChangeHandlers as tt, BundleModule as u, TagTransformer as ua, OutputTargetCopy as ui, RolldownResultModule as un, getComponentsDtsSrcFilePath as uo, CompilerFileWatcher as ur, isString as us, ComponentRuntimeHostListener as ut, CollectionComponentEntryPath as v, JsonDocsEvent as va, OutputTargetDistTypes as vi, SourceTarget as vn, isOutputTargetDistCustomElements as vo, CompilerSystemCreateDirectoryResults as vr, unique as vs, CssToEsmImportData as vt, CompilerBuildStatCollection as w, JsonDocsSlot as wa, OutputTargetHydrate as wi, TransformCssToEsmOutput as wn, isOutputTargetDocsCustom as wo, CompilerSystemRenamedPath as wr, COPY as ws, HostElement as wt, CollectionManifest as x, JsonDocsMethodReturn as xa, OutputTargetDocsJson as xi, StyleCompiler as xn, isOutputTargetDistLazyLoader as xo, CompilerSystemRemoveDirectoryResults as xr, stringifyRuntimeData as xs, EntryModule as xt, CollectionDependencyData as y, JsonDocsListener as ya, OutputTargetDocsCustom as yi, SpecPage as yn, isOutputTargetDistGlobalStyles as yo, CompilerSystemRealpathResults as yr, formatComponentRuntimeMeta as ys, DocData as yt, ComponentCompilerListener as z, isDtsFile as za, RolldownConfig as zi, BuildLog as zn, catchError as zo, EligiblePrimaryPackageOutputTarget as zr, DOCS_VSCODE as zs, Module as zt };
|
|
6308
|
+
export { ComponentCompilerVirtualProperty as $, result_d_exports as $a, TranspileOnlyResults as $i, CompilerDependency as $n, isGlob as $o, Logger as $r, XLINK_NS as $s, PluginCtx as $t, CompilerStyleDoc as A, JsonDocsValue as Aa, PlatformPath as Ai, TypesModule as An, isOutputTargetHydrate as Ao, ConfigExtras as Ar, DIST_CUSTOM_ELEMENTS as As, HydrateImgElement as At, ComponentCompilerMeta as B, isDtsFile as Ba, RolldownConfig as Bi, BuildLog as Bn, catchError as Bo, EligiblePrimaryPackageOutputTarget as Br, DOCS_VSCODE as Bs, Module as Bt, CompilerBuildStatBundle as C, JsonDocsPart as Ca, OutputTargetDocsReadme as Ci, StyleMap as Cn, isOutputTargetDistTypes as Co, CompilerSystemRemoveFileResults as Cr, CMP_FLAGS as Cs, EventInitDict as Ct, CompilerJsDoc as D, JsonDocsTag as Da, OutputTargetWww as Di, TypeInfo as Dn, isOutputTargetDocsJson as Do, CompilerWatcher as Dr, DEFAULT_STYLE_MODE as Ds, HydrateAnchorElement as Dt, CompilerCtx as E, JsonDocsStyle as Ea, OutputTargetStats as Ei, TranspileModuleResults as En, isOutputTargetDocsCustomElementsManifest as Eo, CompilerSystemWriteFileResults as Er, CUSTOM as Es, HostRef as Et, ComponentCompilerData as F, addDocBlock as Fa, ResolveModuleIdOptions as Fi, WorkerContextMethod as Fn, shouldExcludeComponent as Fo, CustomElementsExportBehaviorOptions as Fr, DIST_TYPES as Fs, ImportData as Ft, ComponentCompilerPropertyType as G, parsePackageJson as Ga, ServiceWorkerConfig as Gi, BuildResultsComponentGraph as Gn, normalizeDiagnostics as Go, HydrateDocumentOptions as Gr, LISTENER_FLAGS as Gs, NewSpecPageOptions as Gt, ComponentCompilerMethodComplexType as H, isJsxFile as Ha, RolldownInterface as Hi, BuildOnEventRemove as Hn, hasWarning as Ho, HistoryApiFallback as Hr, GENERATED_DTS as Hs, ModuleMap as Ht, ComponentCompilerEvent as I, createJsVarName as Ia, ResolveModuleIdResults as Ii, WorkerMsgHandler as In, TASK_CANCELED_MSG as Io, DevServer as Ir, DOCS_CUSTOM as Is, JSDocTagInfo as It, ComponentCompilerStaticEvent as J, isRemoteUrl as Ja, StencilConfig as Ji, CompileScriptMinifyOptions as Jn, loadTypeScriptDiagnostic as Jo, LOG_LEVELS as Jr, STATS as Js, PackageJsonData as Jt, ComponentCompilerReferencedType as K, readOnlyArrayHasStringMember as Ka, SitemapXmpOpts as Ki, CacheStorage as Kn, splitLineBreaks as Ko, HydrateFactoryOptions as Kr, MEMBER_FLAGS as Ks, NodeMap as Kt, ComponentCompilerEventComplexType as L, generatePreamble as La, ResolveModuleOptions as Li, AutoprefixerOptions as Ln, buildError as Lo, DevServerConfig as Lr, DOCS_CUSTOM_ELEMENTS_MANIFEST as Ls, JsDoc as Lt, CompilerWorkerTask as M, FsWriteResults as Ma, PrerenderHydrateOptions as Mi, VNodeProdData as Mn, isOutputTargetWww as Mo, CopyTask as Mr, DIST_HYDRATE_SCRIPT as Ms, HydrateScriptElement as Mt, ComponentCompilerChangeHandler as N, validateComponentTag as Na, PrerenderResults as Ni, ValidateTypesResults as Nn, isValidConfigOutputTarget as No, Credentials as Nr, DIST_LAZY as Ns, HydrateStaticData as Nt, CompilerJsDocTagInfo as O, JsonDocsTypeLibrary as Oa, PageReloadStrategy as Oi, TypesImportData as On, isOutputTargetDocsReadme as Oo, Config as Or, DIST as Os, HydrateComponent as Ot, ComponentCompilerCustomState as P, ParsePackageJsonResult as Pa, PrerenderStartOptions as Pi, Workbox as Pn, relativeImport as Po, CustomElementsExportBehavior as Pr, DIST_LAZY_LOADER as Ps, HydrateStyleElement as Pt, ComponentCompilerTypeReferences as Q, rolldownToStencilSourceMap as Qa, TransformOptions as Qi, CompilerBuildStart as Qn, isRootPath as Qo, LogLevel as Qr, WWW as Qs, Plugin as Qt, ComponentCompilerFeatures as R, getTextDocs as Ra, RobotsTxtOpts as Ri, BuildEmitEvents as Rn, buildJsonFileError as Ro, DevServerEditor as Rr, DOCS_JSON as Rs, LazyBundleRuntimeData as Rt, CompilerAssetDir as S, JsonDocsMethodReturn as Sa, OutputTargetDocsJson as Si, StyleCompiler as Sn, isOutputTargetDistLazyLoader as So, CompilerSystemRemoveDirectoryResults as Sr, stringifyRuntimeData as Ss, EntryModule as St, CompilerBuildStats as T, JsonDocsSlot as Ta, OutputTargetHydrate as Ti, TransformCssToEsmOutput as Tn, isOutputTargetDocsCustom as To, CompilerSystemRenamedPath as Tr, COPY as Ts, HostElement as Tt, ComponentCompilerProperty as U, isTsFile as Ua, RolldownOutputOptions as Ui, BuildOnEvents as Un, shouldIgnoreError as Uo, HmrStyleUpdate as Ur, HOST_FLAGS as Us, MsgFromWorker as Ut, ComponentCompilerMethod as V, isJsFile as Va, RolldownInputOptions as Vi, BuildNoChangeResults as Vn, hasError as Vo, FsWatchResults as Vr, EVENT_FLAGS as Vs, ModuleFormat as Vt, ComponentCompilerPropertyComplexType as W, isTsxFile as Wa, SerializeDocumentOptions as Wi, BuildOutput as Wn, escapeHtml as Wo, HotModuleReplacement as Wr, HTML_NS as Ws, MsgToWorker as Wt, ComponentCompilerStaticProperty as X, getSourceMappingUrlForEndOfFile as Xa, StencilDocsConfig as Xi, Compiler as Xn, createOnWarnFn as Xo, LoadConfigInit as Xr, VALID_CONFIG_OUTPUT_TARGETS as Xs, PatchedSlotNode as Xt, ComponentCompilerStaticMethod as Y, getInlineSourceMappingUrlLinker as Ya, StencilDevServerConfig as Yi, CompileTarget as Yn, loadTypeScriptDiagnostics as Yo, LazyRequire as Yr, SVG_NS as Ys, ParsedImport as Yt, ComponentCompilerTypeReference as Z, getSourceMappingUrlLinker as Za, SystemDetails as Zi, CompilerBuildResults as Zn, loadRolldownDiagnostics as Zo, LoadConfigResults as Zr, WATCH_FLAGS as Zs, PlatformRuntime as Zt, CollectionCompilerVersion as _, JsonDocsCustomState as _a, OutputTargetDistLazy as _i, SerializedEvent as _n, isOutputTargetDist as _o, CompilerSystem as _r, toDashCase as _s, CssImportData as _t, BuildCtx as a, WorkerMainController as aa, OptimizeJsInput as ai, PrintLine as an, normalizeFsPathQuery as ao, CompilerEventDirDelete as ar, isComplexType as as, ComponentConstructorProperties as at, CollectionDependencyManifest as b, JsonDocsListener as ba, OutputTargetDocsCustom as bi, SpecPage as bn, isOutputTargetDistGlobalStyles as bo, CompilerSystemRealpathResults as br, formatComponentRuntimeMeta as bs, DocData as bt, BuildStyleUpdate as c, FunctionalComponent as ca, OutputTargetBase as ci, RolldownAssetResult as cn, resolve as co, CompilerEventFileUpdate as cr, isIterable as cs, ComponentNativeConstructor as ct, BundleModuleOutput as d, TagTransformer as da, OutputTargetCopy as di, RolldownResultModule as dn, getComponentsDtsSrcFilePath as do, CompilerFileWatcher as dr, isString as ds, ComponentRuntimeMember as dt, TranspileOptions as ea, byteSize as ec, LoggerLineUpdater as ei, PluginTransformResults as en, escapeRegExpSpecialCharacters as eo, CompilerEventBuildFinish as er, dashToPascalCase as es, ComponentConstructor as et, Cache as f, UserBuildConditionals as fa, OutputTargetCustom as fi, RolldownResults as fn, getComponentsDtsTypesFilePath as fo, CompilerFileWatcherCallback as fr, mergeIntoWith as fs, ComponentRuntimeMembers as ft, CollectionCompilerMeta as g, JsonDocsComponent as ga, OutputTargetDistGlobalStyles as gi, SerializeImportData as gn, isOutputTargetCustom as go, CompilerRequestResponse as gr, toCamelCase as gs, ComponentTestingConstructor as gt, CollectionCompiler as h, JsonDocs as ha, OutputTargetDistCustomElements as hi, RuntimeRef as hn, isOutputTargetCopy as ho, CompilerRequest as hr, sortBy as hs, ComponentRuntimeReflectingAttr as ht, BuildConditionals as i, WatcherCloseResults as ia, OptimizeCssOutput as ii, PrerenderUrlResults as in, normalizeFsPath as io, CompilerEventDirAdd as ir, isBoolean as is, ComponentConstructorListener as it, CompilerWorkerContext as j, StyleDoc as ja, PrerenderConfig as ji, UpdatedLazyBuildCtx as jn, isOutputTargetStats as jo, CopyResults as jr, DIST_GLOBAL_STYLES as js, HydrateResults as jt, CompilerModeStyles as k, JsonDocsUsage as ka, ParsedPath as ki, TypesMemberNameData as kn, isOutputTargetDocsVscode as ko, ConfigBundle as kr, DIST_COLLECTION as ks, HydrateElement as kt, BuildTask as l, RafCallback as la, OutputTargetBaseNext as li, RolldownChunkResult as ln, FilterComponentsResult as lo, CompilerEventFsChange as lr, isNumber as ls, ComponentPatches as lt, CollectionBundleManifest as m, JsonDocMethodParameter as ma, OutputTargetDistCollection as mi, RootAppliedStyleMap as mn, isEligiblePrimaryPackageOutputTarget as mo, CompilerFsStats as mr, pluck as ms, ComponentRuntimeMetaCompact as mt, AssetsMeta as n, UnvalidatedConfig as na, NodeResolveConfig as ni, PrerenderManager as nn, join as no, CompilerEventBuildNoChange as nr, flatOne as ns, ComponentConstructorEncapsulation as nt, BuildFeatures as o, WorkerOptions as oa, OptimizeJsOutput as oi, PropsType as on, normalizePath as oo, CompilerEventFileAdd as or, isDef as os, ComponentConstructorProperty as ot, ChildType as p, VNode as pa, OutputTargetDist as pi, RolldownSourceMap as pn, getComponentsFromModules as po, CompilerFileWatcherEvent as pr, noop as ps, ComponentRuntimeMeta as pt, ComponentCompilerState as q, readPackageJson as qa, SitemapXmpResults as qi, CliInitOptions as qn, augmentDiagnosticWithNode as qo, HydratedFlag as qr, NODE_TYPES as qs, OptimizeJsResult as qt, BuildComponent as r, ValidatedConfig as ra, OptimizeCssInput as ri, PrerenderUrlRequest as rn, normalize as ro, CompilerEventBuildStart as rr, fromEntries as rs, ComponentConstructorEvent as rt, BuildSourceGraph as s, ErrorHandler as sa, OutputTarget as si, RenderNode as sn, relative as so, CompilerEventFileDelete as sr, isFunction as ss, ComponentConstructorPropertyType as st, AnyHTMLElement as t, TranspileResults as ta, LoggerTimeSpan as ti, PluginTransformationDescriptor as tn, queryNonceMetaTagContent as to, CompilerEventBuildLog as tr, escapeWithPattern as ts, ComponentConstructorChangeHandlers as tt, BundleModule as u, ResolutionHandler as ua, OutputTargetBuild as ui, RolldownResult as un, filterExcludedComponents as uo, CompilerEventName as ur, isObject as us, ComponentRuntimeHostListener as ut, CollectionComponentEntryPath as v, JsonDocsDependencyGraph as va, OutputTargetDistLazyLoader as vi, SourceMap$1 as vn, isOutputTargetDistCollection as vo, CompilerSystemCreateDirectoryOptions as vr, toTitleCase as vs, CssToEsmImportData as vt, CompilerBuildStatCollection as w, JsonDocsProp as wa, OutputTargetDocsVscode as wi, TransformCssToEsmInput as wn, isOutputTargetDocs as wo, CompilerSystemRenameResults as wr, COLLECTION_MANIFEST_FILE_NAME as ws, ExternalStyleCompiler as wt, CollectionManifest as x, JsonDocsMethod as xa, OutputTargetDocsCustomElementsManifest as xi, StencilDocument as xn, isOutputTargetDistLazy as xo, CompilerSystemRemoveDirectoryOptions as xr, formatLazyBundleRuntimeMeta as xs, Encapsulation as xt, CollectionDependencyData as y, JsonDocsEvent as ya, OutputTargetDistTypes as yi, SourceTarget as yn, isOutputTargetDistCustomElements as yo, CompilerSystemCreateDirectoryResults as yr, unique as ys, CssTransformCacheEntry as yt, ComponentCompilerListener as z, hasDependency as za, RobotsTxtResults as zi, BuildEvents as zn, buildWarn as zo, Diagnostic$1 as zr, DOCS_README as zs, LazyBundlesRuntimeData as zt };
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as Element, C as setPlatformHelpers, D as AttachInternals, F as PropSerialize, I as State, L as Watch, M as Listen, N as Method, O as AttrDeserialize, P as Prop, R as resolveVar, S as writeTask, T as setErrorHandler, _ as getElement, a as Mixin, b as setAssetPath, c as forceUpdate, f as getMode, g as h, h as Host, i as render, j as Event, k as Component, l as getRenderingRef, n as setTagTransformer, o as Fragment, p as setMode, r as transformTag, v as getShadowRoot, x as readTask, y as getAssetPath, z as Build } from "./client-
|
|
1
|
+
import { A as Element, C as setPlatformHelpers, D as AttachInternals, F as PropSerialize, I as State, L as Watch, M as Listen, N as Method, O as AttrDeserialize, P as Prop, R as resolveVar, S as writeTask, T as setErrorHandler, _ as getElement, a as Mixin, b as setAssetPath, c as forceUpdate, f as getMode, g as h, h as Host, i as render, j as Event, k as Component, l as getRenderingRef, n as setTagTransformer, o as Fragment, p as setMode, r as transformTag, v as getShadowRoot, x as readTask, y as getAssetPath, z as Build } from "./client-Dti6fFpE.mjs";
|
|
2
2
|
export { AttachInternals, AttrDeserialize, Build, Component, Element, Event, Fragment, Host, Listen, Method, Mixin, Prop, PropSerialize, State, Watch, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, getShadowRoot, h, readTask, render, resolveVar, setAssetPath, setErrorHandler, setMode, setPlatformHelpers, setTagTransformer, transformTag, writeTask };
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { d as Fragment, n as jsx, r as jsxs } from "./runtime-
|
|
1
|
+
import { d as Fragment, n as jsx, r as jsxs } from "./runtime-COEYYPyw.js";
|
|
2
2
|
export { Fragment, jsx, jsxs };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as __require } from "./chunk-CjcI7cDX.mjs";
|
|
2
|
-
import "./client-
|
|
2
|
+
import "./client-Dti6fFpE.mjs";
|
|
3
3
|
import { h as noop, i as flatOne, l as isFunction, p as isString } from "./regular-expression-D5pGVpCu.mjs";
|
|
4
4
|
import { bt as isGlob, dt as TASK_CANCELED_MSG, ft as buildError, ht as catchError, rt as normalizePath, vt as shouldIgnoreError } from "./validation-Byxie0Uk.mjs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -2269,6 +2269,10 @@ declare const proxyComponent: (Cstr: ComponentConstructor, cmpMeta: ComponentRun
|
|
|
2269
2269
|
/**
|
|
2270
2270
|
* Method to render a virtual DOM tree to a container element.
|
|
2271
2271
|
*
|
|
2272
|
+
* Supports efficient re-renders: calling `render()` again on the same container
|
|
2273
|
+
* will diff the new VNode tree against the previous one and only update what changed,
|
|
2274
|
+
* preserving existing DOM elements and their state.
|
|
2275
|
+
*
|
|
2272
2276
|
* @example
|
|
2273
2277
|
* ```tsx
|
|
2274
2278
|
* import { render } from '@stencil/core';
|
|
@@ -3993,9 +3993,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
3993
3993
|
return;
|
|
3994
3994
|
}
|
|
3995
3995
|
const propFlags = members.find(([m]) => m === propName);
|
|
3996
|
-
|
|
3996
|
+
const isBooleanTarget = propFlags && propFlags[1][0] & MEMBER_FLAGS.Boolean;
|
|
3997
|
+
const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
|
|
3998
|
+
if (isBooleanTarget) newValue = !(newValue === null || newValue === "false");
|
|
3997
3999
|
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
3998
|
-
if (newValue != this[propName] && (!propDesc.get || !!propDesc.set)) this[propName] = newValue;
|
|
4000
|
+
if (!isSpuriousBooleanRemoval && newValue != this[propName] && (!propDesc.get || !!propDesc.set)) this[propName] = newValue;
|
|
3999
4001
|
});
|
|
4000
4002
|
};
|
|
4001
4003
|
Cstr.observedAttributes = Array.from(new Set([...Object.keys(cmpMeta.$watchers$ ?? {}), ...members.filter(([_, m]) => m[0] & MEMBER_FLAGS.HasAttribute).map(([propName, m]) => {
|
|
@@ -4524,8 +4526,19 @@ const setPlatformOptions = (opts) => Object.assign(plt, opts);
|
|
|
4524
4526
|
//#endregion
|
|
4525
4527
|
//#region src/runtime/render.ts
|
|
4526
4528
|
/**
|
|
4529
|
+
* A WeakMap to persist HostRef objects across multiple render() calls to the
|
|
4530
|
+
* same container. This enables VNode diffing on re-renders — without it, each
|
|
4531
|
+
* call creates a fresh HostRef with no previous VNode, causing renderVdom to
|
|
4532
|
+
* replace the entire DOM subtree instead of patching only what changed.
|
|
4533
|
+
*/
|
|
4534
|
+
const hostRefCache = /* @__PURE__ */ new WeakMap();
|
|
4535
|
+
/**
|
|
4527
4536
|
* Method to render a virtual DOM tree to a container element.
|
|
4528
4537
|
*
|
|
4538
|
+
* Supports efficient re-renders: calling `render()` again on the same container
|
|
4539
|
+
* will diff the new VNode tree against the previous one and only update what changed,
|
|
4540
|
+
* preserving existing DOM elements and their state.
|
|
4541
|
+
*
|
|
4529
4542
|
* @example
|
|
4530
4543
|
* ```tsx
|
|
4531
4544
|
* import { render } from '@stencil/core';
|
|
@@ -4542,14 +4555,19 @@ const setPlatformOptions = (opts) => Object.assign(plt, opts);
|
|
|
4542
4555
|
* @param container - The container element to render the virtual DOM tree to
|
|
4543
4556
|
*/
|
|
4544
4557
|
function render(vnode, container) {
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4558
|
+
let ref = hostRefCache.get(container);
|
|
4559
|
+
if (!ref) {
|
|
4560
|
+
ref = {
|
|
4548
4561
|
$flags$: 0,
|
|
4549
|
-
$
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4562
|
+
$cmpMeta$: {
|
|
4563
|
+
$flags$: 0,
|
|
4564
|
+
$tagName$: container.tagName
|
|
4565
|
+
},
|
|
4566
|
+
$hostElement$: container
|
|
4567
|
+
};
|
|
4568
|
+
hostRefCache.set(container, ref);
|
|
4569
|
+
}
|
|
4570
|
+
renderVdom(ref, vnode);
|
|
4553
4571
|
}
|
|
4554
4572
|
//#endregion
|
|
4555
4573
|
//#region src/runtime/tag-transform.ts
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -117,6 +117,10 @@ declare const proxyComponent: (Cstr: ComponentConstructor, cmpMeta: ComponentRun
|
|
|
117
117
|
/**
|
|
118
118
|
* Method to render a virtual DOM tree to a container element.
|
|
119
119
|
*
|
|
120
|
+
* Supports efficient re-renders: calling `render()` again on the same container
|
|
121
|
+
* will diff the new VNode tree against the previous one and only update what changed,
|
|
122
|
+
* preserving existing DOM elements and their state.
|
|
123
|
+
*
|
|
120
124
|
* @example
|
|
121
125
|
* ```tsx
|
|
122
126
|
* import { render } from '@stencil/core';
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as h, C as postUpdateComponent, D as getMode, E as parsePropertyValue, F as HYDRATED_STYLE_ID, M as getShadowRoot, N as getAssetPath, O as setMode, P as setAssetPath, S as getRenderingRef, T as createEvent, _ as connectedCallback, a as transformTag, b as setValue, c as setNonce, d as Fragment, f as bootstrapLazy, g as disconnectedCallback, h as proxyCustomElement, i as setTagTransformer, j as getElement, k as Host, l as Mixin, m as forceModeUpdate, n as jsx, o as render, p as defineCustomElement, r as jsxs, s as setPlatformOptions, t as insertVdomAnnotations, u as addHostEventListeners, v as proxyComponent, w as renderVdom, x as forceUpdate, y as getValue } from "../runtime-
|
|
1
|
+
import { A as h, C as postUpdateComponent, D as getMode, E as parsePropertyValue, F as HYDRATED_STYLE_ID, M as getShadowRoot, N as getAssetPath, O as setMode, P as setAssetPath, S as getRenderingRef, T as createEvent, _ as connectedCallback, a as transformTag, b as setValue, c as setNonce, d as Fragment, f as bootstrapLazy, g as disconnectedCallback, h as proxyCustomElement, i as setTagTransformer, j as getElement, k as Host, l as Mixin, m as forceModeUpdate, n as jsx, o as render, p as defineCustomElement, r as jsxs, s as setPlatformOptions, t as insertVdomAnnotations, u as addHostEventListeners, v as proxyComponent, w as renderVdom, x as forceUpdate, y as getValue } from "../runtime-COEYYPyw.js";
|
|
2
2
|
export { Fragment, HYDRATED_STYLE_ID, Host, Mixin, addHostEventListeners, bootstrapLazy, connectedCallback, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, getShadowRoot, getValue, h, insertVdomAnnotations, jsx, jsxs, parsePropertyValue, postUpdateComponent, proxyComponent, proxyCustomElement, render, renderVdom, setAssetPath, setMode, setNonce, setPlatformOptions, setTagTransformer, setValue, transformTag };
|
|
@@ -931,10 +931,6 @@ declare const hAsync: (nodeName: any, vnodeData: any, ...children: ChildType[])
|
|
|
931
931
|
//#region src/server/platform/hydrate-app.d.ts
|
|
932
932
|
declare function hydrateApp(win: Window & typeof globalThis, opts: HydrateFactoryOptions, results: HydrateResults, afterHydrate: (win: Window, opts: HydrateFactoryOptions, results: HydrateResults, resolve: (results: HydrateResults) => void) => void, resolve: (results: HydrateResults) => void): void;
|
|
933
933
|
//#endregion
|
|
934
|
-
//#region src/runtime/asset-path.d.ts
|
|
935
|
-
declare const getAssetPath: (path: string) => string;
|
|
936
|
-
declare const setAssetPath: (path: string) => string;
|
|
937
|
-
//#endregion
|
|
938
934
|
//#region src/runtime/bootstrap-custom-element.d.ts
|
|
939
935
|
declare const defineCustomElement: (Cstr: any, compactMeta: ComponentRuntimeMetaCompact) => void;
|
|
940
936
|
declare const proxyCustomElement: (Cstr: any, compactMeta: ComponentRuntimeMetaCompact) => any;
|
|
@@ -1134,6 +1130,23 @@ declare const registerHost: (elm: HostElement, cmpMeta: ComponentRuntimeMeta) =>
|
|
|
1134
1130
|
declare const Build: UserBuildConditionals;
|
|
1135
1131
|
declare const styles: StyleMap;
|
|
1136
1132
|
declare const modeResolutionChain: ResolutionHandler[];
|
|
1133
|
+
/**
|
|
1134
|
+
* Server-side implementation of getAssetPath.
|
|
1135
|
+
*
|
|
1136
|
+
* Unlike the client-side version, this doesn't use import.meta.url as a fallback
|
|
1137
|
+
* because it doesn't make sense in the bundled hydrate factory context.
|
|
1138
|
+
* The base URL must come from plt.$resourcesUrl$ (set via hydration options).
|
|
1139
|
+
* @param path - The relative path to the asset
|
|
1140
|
+
* @returns The resolved asset path, which may be an absolute URL if resourcesUrl is set to an external URL, or a relative path if resourcesUrl is a relative path or not set at all
|
|
1141
|
+
*/
|
|
1142
|
+
declare const getAssetPath: (path: string) => string;
|
|
1143
|
+
/**
|
|
1144
|
+
* Sets the base URL for resolving asset paths in the server/hydrate context.
|
|
1145
|
+
* @param path - The base URL to use for resolving asset paths. This should typically be set to the same value as the `resourcesUrl` option passed to `hydrateDocument` to ensure that asset paths are resolved correctly in the server/hydrate context.
|
|
1146
|
+
* If not set, it defaults to './', which is a reasonable default for server-side rendering.
|
|
1147
|
+
* @returns void
|
|
1148
|
+
*/
|
|
1149
|
+
declare const setAssetPath: (path: string) => string;
|
|
1137
1150
|
/**
|
|
1138
1151
|
* Checks to see any components are rendered with `scoped`
|
|
1139
1152
|
* @param opts - SSR options
|
|
@@ -173,14 +173,6 @@ const reWireGetterSetter = (instance, hostRef) => {
|
|
|
173
173
|
});
|
|
174
174
|
};
|
|
175
175
|
//#endregion
|
|
176
|
-
//#region src/runtime/asset-path.ts
|
|
177
|
-
const getAssetPath = (path) => {
|
|
178
|
-
const base = plt.$resourcesUrl$ || new URL(".", import.meta.url).href;
|
|
179
|
-
const assetUrl = new URL(path, base);
|
|
180
|
-
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
181
|
-
};
|
|
182
|
-
const setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
183
|
-
//#endregion
|
|
184
176
|
//#region src/runtime/runtime-constants.ts
|
|
185
177
|
/**
|
|
186
178
|
* Bit flags for recording various properties of VDom nodes
|
|
@@ -3660,9 +3652,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
3660
3652
|
return;
|
|
3661
3653
|
}
|
|
3662
3654
|
const propFlags = members.find(([m]) => m === propName);
|
|
3663
|
-
|
|
3655
|
+
const isBooleanTarget = propFlags && propFlags[1][0] & MEMBER_FLAGS.Boolean;
|
|
3656
|
+
const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
|
|
3657
|
+
if (isBooleanTarget) newValue = !(newValue === null || newValue === "false");
|
|
3664
3658
|
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
3665
|
-
if (newValue != this[propName] && (!propDesc.get || !!propDesc.set)) this[propName] = newValue;
|
|
3659
|
+
if (!isSpuriousBooleanRemoval && newValue != this[propName] && (!propDesc.get || !!propDesc.set)) this[propName] = newValue;
|
|
3666
3660
|
});
|
|
3667
3661
|
};
|
|
3668
3662
|
Cstr.observedAttributes = Array.from(new Set([...Object.keys(cmpMeta.$watchers$ ?? {}), ...members.filter(([_, m]) => m[0] & MEMBER_FLAGS.HasAttribute).map(([propName, m]) => {
|
|
@@ -4844,6 +4838,27 @@ const Build = {
|
|
|
4844
4838
|
const styles = /* @__PURE__ */ new Map();
|
|
4845
4839
|
const modeResolutionChain = [];
|
|
4846
4840
|
/**
|
|
4841
|
+
* Server-side implementation of getAssetPath.
|
|
4842
|
+
*
|
|
4843
|
+
* Unlike the client-side version, this doesn't use import.meta.url as a fallback
|
|
4844
|
+
* because it doesn't make sense in the bundled hydrate factory context.
|
|
4845
|
+
* The base URL must come from plt.$resourcesUrl$ (set via hydration options).
|
|
4846
|
+
* @param path - The relative path to the asset
|
|
4847
|
+
* @returns The resolved asset path, which may be an absolute URL if resourcesUrl is set to an external URL, or a relative path if resourcesUrl is a relative path or not set at all
|
|
4848
|
+
*/
|
|
4849
|
+
const getAssetPath = (path) => {
|
|
4850
|
+
const base = plt.$resourcesUrl$ || "./";
|
|
4851
|
+
const assetUrl = new URL(path, base);
|
|
4852
|
+
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
4853
|
+
};
|
|
4854
|
+
/**
|
|
4855
|
+
* Sets the base URL for resolving asset paths in the server/hydrate context.
|
|
4856
|
+
* @param path - The base URL to use for resolving asset paths. This should typically be set to the same value as the `resourcesUrl` option passed to `hydrateDocument` to ensure that asset paths are resolved correctly in the server/hydrate context.
|
|
4857
|
+
* If not set, it defaults to './', which is a reasonable default for server-side rendering.
|
|
4858
|
+
* @returns void
|
|
4859
|
+
*/
|
|
4860
|
+
const setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
4861
|
+
/**
|
|
4847
4862
|
* Checks to see any components are rendered with `scoped`
|
|
4848
4863
|
* @param opts - SSR options
|
|
4849
4864
|
*/
|
|
@@ -3875,9 +3875,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
3875
3875
|
return;
|
|
3876
3876
|
}
|
|
3877
3877
|
const propFlags = members.find(([m]) => m === propName);
|
|
3878
|
-
|
|
3878
|
+
const isBooleanTarget = propFlags && propFlags[1][0] & MEMBER_FLAGS.Boolean;
|
|
3879
|
+
const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
|
|
3880
|
+
if (isBooleanTarget) newValue = !(newValue === null || newValue === "false");
|
|
3879
3881
|
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
3880
|
-
if (newValue != this[propName] && (!propDesc.get || !!propDesc.set)) this[propName] = newValue;
|
|
3882
|
+
if (!isSpuriousBooleanRemoval && newValue != this[propName] && (!propDesc.get || !!propDesc.set)) this[propName] = newValue;
|
|
3881
3883
|
});
|
|
3882
3884
|
};
|
|
3883
3885
|
Cstr.observedAttributes = Array.from(new Set([...Object.keys(cmpMeta.$watchers$ ?? {}), ...members.filter(([_, m]) => m[0] & MEMBER_FLAGS.HasAttribute).map(([propName, m]) => {
|
|
@@ -4406,8 +4408,19 @@ const setPlatformOptions = (opts) => Object.assign(plt, opts);
|
|
|
4406
4408
|
//#endregion
|
|
4407
4409
|
//#region src/runtime/render.ts
|
|
4408
4410
|
/**
|
|
4411
|
+
* A WeakMap to persist HostRef objects across multiple render() calls to the
|
|
4412
|
+
* same container. This enables VNode diffing on re-renders — without it, each
|
|
4413
|
+
* call creates a fresh HostRef with no previous VNode, causing renderVdom to
|
|
4414
|
+
* replace the entire DOM subtree instead of patching only what changed.
|
|
4415
|
+
*/
|
|
4416
|
+
const hostRefCache = /* @__PURE__ */ new WeakMap();
|
|
4417
|
+
/**
|
|
4409
4418
|
* Method to render a virtual DOM tree to a container element.
|
|
4410
4419
|
*
|
|
4420
|
+
* Supports efficient re-renders: calling `render()` again on the same container
|
|
4421
|
+
* will diff the new VNode tree against the previous one and only update what changed,
|
|
4422
|
+
* preserving existing DOM elements and their state.
|
|
4423
|
+
*
|
|
4411
4424
|
* @example
|
|
4412
4425
|
* ```tsx
|
|
4413
4426
|
* import { render } from '@stencil/core';
|
|
@@ -4424,14 +4437,19 @@ const setPlatformOptions = (opts) => Object.assign(plt, opts);
|
|
|
4424
4437
|
* @param container - The container element to render the virtual DOM tree to
|
|
4425
4438
|
*/
|
|
4426
4439
|
function render(vnode, container) {
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4440
|
+
let ref = hostRefCache.get(container);
|
|
4441
|
+
if (!ref) {
|
|
4442
|
+
ref = {
|
|
4430
4443
|
$flags$: 0,
|
|
4431
|
-
$
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4444
|
+
$cmpMeta$: {
|
|
4445
|
+
$flags$: 0,
|
|
4446
|
+
$tagName$: container.tagName
|
|
4447
|
+
},
|
|
4448
|
+
$hostElement$: container
|
|
4449
|
+
};
|
|
4450
|
+
hostRefCache.set(container, ref);
|
|
4451
|
+
}
|
|
4452
|
+
renderVdom(ref, vnode);
|
|
4435
4453
|
}
|
|
4436
4454
|
//#endregion
|
|
4437
4455
|
//#region src/runtime/tag-transform.ts
|
package/dist/sys/node/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as setupNodeProcess, r as createNodeLogger, t as createNodeSys } from "../../node-
|
|
1
|
+
import { n as setupNodeProcess, r as createNodeLogger, t as createNodeSys } from "../../node-BF2jSfWg.mjs";
|
|
2
2
|
export { createNodeLogger, createNodeSys, setupNodeProcess };
|
package/dist/sys/node/worker.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as createWorkerMessageHandler } from "../../compiler-
|
|
2
|
-
import { t as createNodeSys } from "../../node-
|
|
1
|
+
import { l as createWorkerMessageHandler } from "../../compiler-BYRrEeD-.mjs";
|
|
2
|
+
import { t as createNodeSys } from "../../node-BF2jSfWg.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
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as Env, c as getMode, d as Fragment, f as createEvent, g as setAssetPath, h as getAssetPath, i as getRenderingRef, n as h, p as getElement, r as forceUpdate, t as Host, u as Mixin } from "../index-
|
|
1
|
+
import { $r as Logger, B as ComponentCompilerMeta, Bt as Module, E as CompilerCtx, Et as HostRef, Gt as NewSpecPageOptions, Qr as LogLevel, Tt as HostElement, Xr as LoadConfigInit, _r as CompilerSystem, a as BuildCtx, bn as SpecPage, fa as UserBuildConditionals, hn as RuntimeRef, la as RafCallback, na as UnvalidatedConfig, pt as ComponentRuntimeMeta, ra as ValidatedConfig, sa as ErrorHandler, ti as LoggerTimeSpan, zr as Diagnostic } from "../index-BwTaN1Nq.mjs";
|
|
2
|
+
import { _ as Env, c as getMode, d as Fragment, f as createEvent, g as setAssetPath, h as getAssetPath, i as getRenderingRef, n as h, p as getElement, r as forceUpdate, t as Host, u as Mixin } from "../index-9LTuoSiw.mjs";
|
|
3
3
|
import { Mock } from "vitest";
|
|
4
4
|
|
|
5
5
|
//#region src/testing/testing-logger.d.ts
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { B as BUILD, E as reWireGetterSetter, V as Env, _ as getElement, a as Mixin, b as setAssetPath, c as forceUpdate, d as createEvent, f as getMode, g as h, h as Host, l as getRenderingRef, o as Fragment, s as bootstrapLazy, t as insertVdomAnnotations, u as renderVdom, y as getAssetPath } from "../client-
|
|
1
|
+
import { B as BUILD, E as reWireGetterSetter, V as Env, _ as getElement, a as Mixin, b as setAssetPath, c as forceUpdate, d as createEvent, f as getMode, g as h, h as Host, l as getRenderingRef, o as Fragment, s as bootstrapLazy, t as insertVdomAnnotations, u as renderVdom, y as getAssetPath } from "../client-Dti6fFpE.mjs";
|
|
2
2
|
import { C as CMP_FLAGS, V as EVENT_FLAGS, h as noop } from "../regular-expression-D5pGVpCu.mjs";
|
|
3
|
-
import { _ as getBuildFeatures, c as createWorkerContext, h as BuildContext, i as createSystem, m as Cache, p as createInMemoryFs } from "../compiler-
|
|
3
|
+
import { _ as getBuildFeatures, c as createWorkerContext, h as BuildContext, i as createSystem, m as Cache, p as createInMemoryFs } from "../compiler-BYRrEeD-.mjs";
|
|
4
4
|
import { St as formatLazyBundleRuntimeMeta } from "../validation-Byxie0Uk.mjs";
|
|
5
|
-
import { o as buildEvents } from "../node-
|
|
5
|
+
import { o as buildEvents } from "../node-BF2jSfWg.mjs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import path$1 from "path";
|
|
8
8
|
import { MockWindow, setupGlobal } from "@stencil/mock-doc";
|
|
@@ -387,7 +387,8 @@ function mockCompilerCtx(config) {
|
|
|
387
387
|
rolldownCacheLazy: null,
|
|
388
388
|
rolldownCacheNative: null,
|
|
389
389
|
styleModeNames: /* @__PURE__ */ new Set(),
|
|
390
|
-
worker: createWorkerContext(innerConfig.sys)
|
|
390
|
+
worker: createWorkerContext(innerConfig.sys),
|
|
391
|
+
cssTransformCache: /* @__PURE__ */ new Map()
|
|
391
392
|
};
|
|
392
393
|
Object.defineProperty(compilerCtx, "fs", { get() {
|
|
393
394
|
if (this._fs == null) this._fs = createInMemoryFs(innerConfig.sys);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.4",
|
|
4
4
|
"description": "A Compiler for Web Components and Progressive Web Apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -109,9 +109,9 @@
|
|
|
109
109
|
"semver": "^7.7.4",
|
|
110
110
|
"terser": "5.37.0",
|
|
111
111
|
"typescript": "~6.0.2",
|
|
112
|
-
"@stencil/cli": "5.0.0-alpha.
|
|
113
|
-
"@stencil/
|
|
114
|
-
"@stencil/
|
|
112
|
+
"@stencil/cli": "5.0.0-alpha.4",
|
|
113
|
+
"@stencil/dev-server": "5.0.0-alpha.4",
|
|
114
|
+
"@stencil/mock-doc": "5.0.0-alpha.4"
|
|
115
115
|
},
|
|
116
116
|
"devDependencies": {
|
|
117
117
|
"@ionic/prettier-config": "^4.0.0",
|