@wevu/compiler 7.4.0 → 7.5.0

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/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
- import { n as StaticRouteValue, t as StaticPageDeclaration } from "./public-DEO6JWFi.mjs";
1
+ import { n as StaticPageMeta, r as StaticRouteValue, t as StaticPageDeclaration } from "./public-BqBfNRjA.mjs";
2
2
  import { WevuBindingUpdateMode, WevuBindingUpdateMode as WevuBindingUpdateMode$1, WevuRuntimeBindingManifestV1, WevuRuntimeBindingRecordV1 } from "@weapp-core/constants";
3
3
  import { LRUCache } from "lru-cache";
4
+ import MagicString from "magic-string";
4
5
  import { SFCBlock, SFCDescriptor, SFCParseResult, SFCStyleBlock } from "vue/compiler-sfc";
5
6
  import * as t from "@weapp-vite/ast/babelTypes";
6
7
  import { Expression, File } from "@weapp-vite/ast/babelTypes";
@@ -1898,6 +1899,10 @@ interface JsonMergeContext {
1898
1899
  filename?: string;
1899
1900
  kind?: 'app' | 'page' | 'component' | 'unknown';
1900
1901
  stage: JsonMergeStage;
1902
+ /** 当前 SFC 页面的静态路由声明。 */
1903
+ routeConfig?: StaticPageDeclaration;
1904
+ /** 整个页面元信息对象可静态提取时提供。 */
1905
+ pageMeta?: StaticPageMeta;
1901
1906
  }
1902
1907
  /**
1903
1908
  * JSON 合并函数。
@@ -1987,6 +1992,8 @@ interface MiniProgramDirectiveAttrs {
1987
1992
  */
1988
1993
  interface MiniProgramPlatform {
1989
1994
  name: string;
1995
+ /** 非微信宿主复用 WXML 语法时,显式关闭原生插槽上下文协议。 */
1996
+ nativeSlotContext?: boolean;
1990
1997
  directives: MiniProgramDirectiveAttrs;
1991
1998
  wrapIf: (exp: string, content: string, renderMustache: (exp: string) => string) => string;
1992
1999
  wrapElseIf: (exp: string, content: string, renderMustache: (exp: string) => string) => string;
@@ -2094,6 +2101,17 @@ interface ForParseResult {
2094
2101
  index?: string;
2095
2102
  key?: string;
2096
2103
  itemAliases?: Record<string, string>;
2104
+ /** 原生声明寻址使用实际 wx:key,不重新计算用户 key 表达式。 */
2105
+ effectiveNativeKey?: {
2106
+ kind: 'field';
2107
+ field: string;
2108
+ } | {
2109
+ kind: 'self';
2110
+ } | {
2111
+ kind: 'position';
2112
+ };
2113
+ /** 源码循环别名与避开祖先及编译器内建标识符的原生别名。 */
2114
+ nativeAliases?: Record<string, string>;
2097
2115
  /** 需要在逻辑层完整执行的原始循环项模式。 */
2098
2116
  itemPattern?: string;
2099
2117
  /** 当前循环项模式是否需要投影,避免模板层近似执行。 */
@@ -2113,6 +2131,8 @@ interface TemplateCompileOptions {
2113
2131
  propsAliases?: Record<string, string>;
2114
2132
  propsDerivedKeys?: string[];
2115
2133
  scriptSetupBindings?: Record<string, unknown>;
2134
+ /** 可能与宿主属性同名的 setup 绑定,通过独立计算字段交付模板。 */
2135
+ scriptSetupPropConflicts?: readonly string[];
2116
2136
  htmlTagToWxml?: boolean | Record<string, string>;
2117
2137
  htmlTagToWxmlTagClass?: boolean;
2118
2138
  scopedSlotsCompiler?: ScopedSlotsCompilerMode;
@@ -2316,6 +2336,8 @@ interface VueTransformResult {
2316
2336
  componentGenerics?: TemplateCompileResult['componentGenerics'];
2317
2337
  classStyleWxs?: boolean;
2318
2338
  meta?: {
2339
+ routeConfig?: JsonMergeContext['routeConfig'];
2340
+ pageMeta?: JsonMergeContext['pageMeta'];
2319
2341
  /** @internal */
2320
2342
  componentStyleOptions?: ComponentStyleOptions;
2321
2343
  /** @internal */
@@ -2325,6 +2347,8 @@ interface VueTransformResult {
2325
2347
  jsonMacroHash?: string;
2326
2348
  defineOptionsHash?: string;
2327
2349
  sfcSrcDeps?: string[];
2350
+ /** 模板和脚本外部块的编译输入,变化时必须失效完整编译结果。@internal */
2351
+ sfcSrcCompilationDeps?: string[];
2328
2352
  /** 已解析样式中的 CSS 变量表达式快照。@internal */
2329
2353
  cssVars?: string[];
2330
2354
  styleBlocks?: SFCStyleBlock[];
@@ -2821,6 +2845,12 @@ interface TransformScriptOptions {
2821
2845
  * 当前组件模板包含 scoped slot outlet,需要接收 scoped slot 桥接属性。
2822
2846
  */
2823
2847
  scopedSlotHostProperties?: boolean;
2848
+ /**
2849
+ * 微信原生插槽上下文协议,由 SFC 编译期平台与插槽配置决定。
2850
+ *
2851
+ * @internal
2852
+ */
2853
+ nativeSlotContext?: boolean;
2824
2854
  /**
2825
2855
  * 当前 SFC 的 CSS Modules 映射。
2826
2856
  */
@@ -3009,4 +3039,4 @@ interface CollectVueTemplateTagsOptions {
3009
3039
  */
3010
3040
  export declare function collectVueTemplateTags(template: string, options: CollectVueTemplateTagsOptions): Set<string>;
3011
3041
  //#endregion
3012
- export { type AstEngineName, type AutoImportTagsOptions, type AutoUsingComponentsOptions, type BindingCondition, type ClassStyleBinding, type ClassStyleRuntime, type CollectVueTemplateTagsOptions, type CompileVueFileOptions, type CompilerAppShell, type CompilerDiagnostic, type CompilerDiagnosticCode, type CompilerDiagnosticSeverity, type CompilerDiagnosticSource, type CompilerLayoutPropValue, type CompilerPageLayout, type CompilerPageLayoutPlan, type ComponentStyleOptions, type ComponentStylePrimitive, type ExtractPageDeclarationWithDependenciesResult, type ForParseResult, type InlineExpressionAsset, type JsLikeLang, type JsonConfig, type JsonMergeContext, type JsonMergeStage, type JsonMergeStrategy, type MiniProgramPlatform, type ModuleResolver, type MpPlatform, type ReadAndParseSfcOptions, type ResolveSfcBlockSrcOptions, type ResolvedUsingComponentInfo, type ResolvedUsingComponentPath, type ScopedSlotComponentAsset, type SlotFallbackWrapperComponentAsset, type SlotFallbackWrapperStrategy, type SourcePosition, type SourceSpan, type StaticComponentStyleOption, type StaticPageDeclaration, type StaticRouteValue, type StyleCompileOptions, type StyleCompileResult, type TemplateCompileOptions, type TemplateCompileResult, type TemplateRefBinding, type TransformResult, type TransformScriptOptions, type TransformUniAppSourceOptions, type UniAppCompatibilityTarget, type VueSfcBlockChanges, type VueSfcBlockSignatures, type VueSfcBlockType, type VueSfcHmrSignatures, type VueTransformResult, type WevuBindingDependencyV1, type WevuBindingKind, type WevuBindingManifestFeaturesV1, type WevuBindingManifestV1, type WevuBindingRecordV1, type WevuBindingScopeV1, type WevuBindingUpdateMode, type WevuDefaults, type WevuRuntimeBindingManifestMode, type WevuRuntimeBindingManifestV1, type WevuRuntimeBindingRecordV1, compileVueFile as compileSfc, compileVueStyleToWxss as compileStyle, compileVueTemplateToWxml as compileTemplate, transformScript as transformSfcScript };
3042
+ export { type AstEngineName, type AutoImportTagsOptions, type AutoUsingComponentsOptions, type BindingCondition, type ClassStyleBinding, type ClassStyleRuntime, type CollectVueTemplateTagsOptions, type CompileVueFileOptions, type CompilerAppShell, type CompilerDiagnostic, type CompilerDiagnosticCode, type CompilerDiagnosticSeverity, type CompilerDiagnosticSource, type CompilerLayoutPropValue, type CompilerPageLayout, type CompilerPageLayoutPlan, type ComponentStyleOptions, type ComponentStylePrimitive, type ExtractPageDeclarationWithDependenciesResult, type ForParseResult, type InlineExpressionAsset, type JsLikeLang, type JsonConfig, type JsonMergeContext, type JsonMergeFunction, type JsonMergeStage, type JsonMergeStrategy, type MiniProgramPlatform, type ModuleResolver, type MpPlatform, type ReadAndParseSfcOptions, type ResolveSfcBlockSrcOptions, type ResolvedUsingComponentInfo, type ResolvedUsingComponentPath, type ScopedSlotComponentAsset, type SlotFallbackWrapperComponentAsset, type SlotFallbackWrapperStrategy, type SourcePosition, type SourceSpan, type StaticComponentStyleOption, type StaticPageDeclaration, type StaticPageMeta, type StaticRouteValue, type StyleCompileOptions, type StyleCompileResult, type TemplateCompileOptions, type TemplateCompileResult, type TemplateRefBinding, type TransformResult, type TransformScriptOptions, type TransformUniAppSourceOptions, type UniAppCompatibilityTarget, type VueSfcBlockChanges, type VueSfcBlockSignatures, type VueSfcBlockType, type VueSfcHmrSignatures, type VueTransformResult, type WevuBindingDependencyV1, type WevuBindingKind, type WevuBindingManifestFeaturesV1, type WevuBindingManifestV1, type WevuBindingRecordV1, type WevuBindingScopeV1, type WevuBindingUpdateMode, type WevuDefaults, type WevuRuntimeBindingManifestMode, type WevuRuntimeBindingManifestV1, type WevuRuntimeBindingRecordV1, compileVueFile as compileSfc, compileVueStyleToWxss as compileStyle, compileVueTemplateToWxml as compileTemplate, transformScript as transformSfcScript };