@vizejs/vite-plugin 0.287.0 → 0.288.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
@@ -30,6 +30,7 @@ interface VizeConfig {
30
30
  */
31
31
  extends?: string | string[];
32
32
  compiler?: CompilerConfig;
33
+ experimentals?: Record<string, boolean | Record<string, unknown> | null>;
33
34
  vite?: VitePluginConfig;
34
35
  linter?: LinterConfig;
35
36
  typeChecker?: TypeCheckerConfig;
@@ -131,9 +132,6 @@ interface CompilerCompatibilityConfig {
131
132
  */
132
133
  webpackVersion?: 4 | 5;
133
134
  }
134
- /**
135
- * Vite plugin options
136
- */
137
135
  interface VitePluginConfig {
138
136
  /**
139
137
  * Files to include in compilation (glob patterns or strings)
@@ -182,9 +180,6 @@ interface LinterConfig {
182
180
  security?: "off" | "warn" | "error";
183
181
  };
184
182
  }
185
- /**
186
- * Type checker options
187
- */
188
183
  interface TypeCheckerConfig {
189
184
  /**
190
185
  * Enable type checking
@@ -572,6 +567,7 @@ interface VizeConfigEntry {
572
567
  */
573
568
  extends?: string | string[];
574
569
  compiler?: CompilerConfig;
570
+ experimentals?: Record<string, boolean | Record<string, unknown> | null>;
575
571
  vite?: VitePluginConfig;
576
572
  linter?: LinterConfig;
577
573
  typeChecker?: TypeCheckerConfig;
@@ -644,6 +640,28 @@ interface LoadConfigOptions {
644
640
  env?: ConfigEnv;
645
641
  }
646
642
  //#endregion
643
+ //#region src/experimental-options.d.ts
644
+ type ExperimentalSwitch = boolean | null | Record<string, unknown>;
645
+ interface ExperimentalOptions {
646
+ vapor?: ExperimentalSwitch;
647
+ jsxVapor?: ExperimentalSwitch;
648
+ intagComment?: ExperimentalSwitch;
649
+ inTagComment?: ExperimentalSwitch;
650
+ pattenedTemplate?: ExperimentalSwitch;
651
+ patternedTemplate?: ExperimentalSwitch;
652
+ serverScript?: ExperimentalSwitch;
653
+ "server script"?: ExperimentalSwitch;
654
+ }
655
+ interface ExperimentalCompileFlags {
656
+ experimentalInTagComments?: boolean;
657
+ experimentalPatternedTemplate?: boolean;
658
+ experimentalServerScript?: boolean;
659
+ }
660
+ interface ExperimentalPluginOptions extends ExperimentalCompileFlags {
661
+ /** Experimental RFC opt-ins. Values other than `false` or `null` enable keys. */
662
+ experimentals?: ExperimentalOptions;
663
+ }
664
+ //#endregion
647
665
  //#region src/types.d.ts
648
666
  interface MacroArtifact {
649
667
  kind: string;
@@ -682,7 +700,7 @@ interface VizeCompatibilityOptions {
682
700
  */
683
701
  webpackVersion?: 4 | 5;
684
702
  }
685
- interface VizeOptions {
703
+ interface VizeOptions extends ExperimentalPluginOptions {
686
704
  /**
687
705
  * Inline shared Vize config for Vite Plus-first projects.
688
706
  * Direct plugin options still take precedence over these values.
@@ -738,15 +756,8 @@ interface VizeOptions {
738
756
  * @default auto-detected from Vite config
739
757
  */
740
758
  isProduction?: boolean;
741
- /**
742
- * Enable SSR mode
743
- * @default false
744
- */
745
759
  ssr?: boolean;
746
- /**
747
- * Enable source map generation
748
- * @default true in development, false in production
749
- */
760
+ /** Enable source map generation */
750
761
  sourceMap?: boolean;
751
762
  /**
752
763
  * Enable Vapor mode compilation
package/dist/index.mjs CHANGED
@@ -536,6 +536,9 @@ function buildCompileFileOptions(filePath, options) {
536
536
  ssr: options.ssr,
537
537
  vapor: options.vapor,
538
538
  customRenderer: options.customRenderer ?? false,
539
+ experimentalInTagComments: options.experimentalInTagComments ?? false,
540
+ experimentalPatternedTemplate: options.experimentalPatternedTemplate ?? false,
541
+ experimentalServerScript: options.experimentalServerScript ?? false,
539
542
  scopeId: `data-v-${generateScopeId(filePath)}`,
540
543
  ...options.mode === void 0 ? {} : { mode: options.mode },
541
544
  ...options.templateSyntax === void 0 ? {} : { templateSyntax: options.templateSyntax },
@@ -549,6 +552,9 @@ function buildCompileBatchOptions(options) {
549
552
  ssr: options.ssr,
550
553
  vapor: options.vapor,
551
554
  customRenderer: options.customRenderer ?? false,
555
+ experimentalInTagComments: options.experimentalInTagComments ?? false,
556
+ experimentalPatternedTemplate: options.experimentalPatternedTemplate ?? false,
557
+ experimentalServerScript: options.experimentalServerScript ?? false,
552
558
  includeStyles: true,
553
559
  includeMacroArtifacts: true,
554
560
  includeHashes: true,
@@ -774,6 +780,9 @@ function getCompileOptionsForRequest(state, ssr) {
774
780
  if (state.mergedOptions?.runtimeModuleName !== void 0) options.runtimeModuleName = state.mergedOptions.runtimeModuleName;
775
781
  if (state.mergedOptions?.runtimeGlobalName !== void 0) options.runtimeGlobalName = state.mergedOptions.runtimeGlobalName;
776
782
  if (state.mergedOptions?.vueVersion !== void 0) options.vueVersion = state.mergedOptions.vueVersion;
783
+ if (state.mergedOptions?.experimentalInTagComments) options.experimentalInTagComments = true;
784
+ if (state.mergedOptions?.experimentalPatternedTemplate) options.experimentalPatternedTemplate = true;
785
+ if (state.mergedOptions?.experimentalServerScript) options.experimentalServerScript = true;
777
786
  return options;
778
787
  }
779
788
  function syncCollectedCssForFile(state, filePath, compiled) {
@@ -863,6 +872,9 @@ async function compileAll(state) {
863
872
  mode: state.mergedOptions.mode,
864
873
  customRenderer: state.mergedOptions.customRenderer ?? false,
865
874
  templateSyntax: state.mergedOptions.templateSyntax ?? "standard",
875
+ experimentalInTagComments: state.mergedOptions.experimentalInTagComments ?? false,
876
+ experimentalPatternedTemplate: state.mergedOptions.experimentalPatternedTemplate ?? false,
877
+ experimentalServerScript: state.mergedOptions.experimentalServerScript ?? false,
866
878
  runtimeModuleName: state.mergedOptions.runtimeModuleName,
867
879
  runtimeGlobalName: state.mergedOptions.runtimeGlobalName,
868
880
  vueVersion: state.mergedOptions.vueVersion
@@ -2361,6 +2373,32 @@ function formatUnknownError(error) {
2361
2373
  return error instanceof Error ? error.message : String(error);
2362
2374
  }
2363
2375
  //#endregion
2376
+ //#region src/plugin/experimentals.ts
2377
+ function isExperimentalEnabled(value) {
2378
+ return value !== void 0 && value !== null && value !== false;
2379
+ }
2380
+ function resolveExperimentalOptions(options, config) {
2381
+ const pick = (...values) => values.find((value) => value !== void 0);
2382
+ const enabled = (...values) => isExperimentalEnabled(pick(...values));
2383
+ return {
2384
+ vapor: enabled(options?.vapor, config?.vapor),
2385
+ jsxVapor: enabled(options?.jsxVapor, config?.jsxVapor),
2386
+ inTagComments: enabled(options?.intagComment, options?.inTagComment, config?.intagComment, config?.inTagComment),
2387
+ patternedTemplate: enabled(options?.pattenedTemplate, options?.patternedTemplate, config?.pattenedTemplate, config?.patternedTemplate),
2388
+ serverScript: enabled(options?.serverScript, options?.["server script"], config?.serverScript, config?.["server script"])
2389
+ };
2390
+ }
2391
+ function resolveExperimentalCompilerOptions(options, compilerConfig, config) {
2392
+ const experimentals = resolveExperimentalOptions(options.experimentals, config);
2393
+ return {
2394
+ vapor: options.vapor ?? compilerConfig?.vapor ?? experimentals.vapor,
2395
+ jsxMode: options.jsxMode ?? compilerConfig?.jsxMode ?? (experimentals.jsxVapor ? "vapor" : void 0),
2396
+ experimentalInTagComments: experimentals.inTagComments,
2397
+ experimentalPatternedTemplate: experimentals.patternedTemplate,
2398
+ experimentalServerScript: experimentals.serverScript
2399
+ };
2400
+ }
2401
+ //#endregion
2364
2402
  //#region src/plugin/vue-version.ts
2365
2403
  function isLegacyVueVersion(version) {
2366
2404
  return version === "legacy" || version === .11 || version === 1 || version === 2 || version === "2.7";
@@ -2549,8 +2587,7 @@ function vize(options = {}) {
2549
2587
  ...options,
2550
2588
  ssr: options.ssr ?? compilerConfig.ssr ?? false,
2551
2589
  sourceMap: options.sourceMap ?? compilerConfig.sourceMap,
2552
- vapor: options.vapor ?? compilerConfig.vapor ?? false,
2553
- jsxMode: options.jsxMode ?? compilerConfig.jsxMode,
2590
+ ...resolveExperimentalCompilerOptions(options, compilerConfig, sharedConfig?.experimentals),
2554
2591
  customRenderer: options.customRenderer ?? compilerConfig.customRenderer ?? false,
2555
2592
  templateSyntax,
2556
2593
  compatibility,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/vite-plugin",
3
- "version": "0.287.0",
3
+ "version": "0.288.0",
4
4
  "description": "High-performance native Vite plugin for Vue SFC compilation powered by Vize",
5
5
  "keywords": [
6
6
  "compiler",
@@ -40,9 +40,9 @@
40
40
  "access": "public"
41
41
  },
42
42
  "dependencies": {
43
- "@vizejs/native": "0.287.0",
43
+ "@vizejs/native": "0.288.0",
44
44
  "tinyglobby": "0.2.16",
45
- "vize": "0.287.0"
45
+ "vize": "0.288.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/node": "25.9.2",