@vue-jsx-vapor/compiler 2.4.1 → 2.4.3
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.cjs +21 -15
- package/dist/index.d.cts +0 -19
- package/dist/index.d.ts +0 -19
- package/dist/index.js +22 -16
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
@@ -137,7 +137,12 @@ function getLiteralExpressionValue(exp) {
|
|
137
137
|
}
|
138
138
|
const isConstant = (node) => {
|
139
139
|
if (!node) return false;
|
140
|
-
if (node.type === "Identifier") return node.name === "undefined";
|
140
|
+
if (node.type === "Identifier") return node.name === "undefined" || (0, __vue_shared.isGloballyAllowed)(node.name);
|
141
|
+
if ([
|
142
|
+
"JSXElement",
|
143
|
+
"JSXFragment",
|
144
|
+
"NullLiteral"
|
145
|
+
].includes(node.type)) return true;
|
141
146
|
if (node.type === "ArrayExpression") {
|
142
147
|
const { elements } = node;
|
143
148
|
return elements.every((element) => element && isConstant(element));
|
@@ -166,13 +171,14 @@ function resolveSimpleExpressionNode(exp) {
|
|
166
171
|
}
|
167
172
|
return exp;
|
168
173
|
}
|
169
|
-
const resolvedExpressions = new WeakSet();
|
174
|
+
const resolvedExpressions = /* @__PURE__ */ new WeakSet();
|
170
175
|
function resolveExpression(node, context, effect = false) {
|
171
|
-
node
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
const
|
176
|
+
if (!node) return (0, __vue_compiler_dom.createSimpleExpression)("", true);
|
177
|
+
node = (0, __vue_compiler_dom.unwrapTSNode)(node.type === "JSXExpressionContainer" ? node.expression : node);
|
178
|
+
const isStatic = node.type === "StringLiteral" || node.type === "JSXText" || node.type === "JSXIdentifier";
|
179
|
+
let source = node.type === "JSXEmptyExpression" ? "" : node.type === "JSXIdentifier" ? node.name : node.type === "StringLiteral" ? node.value : node.type === "JSXText" ? resolveJSXText(node) : node.type === "Identifier" ? node.name : context.ir.source.slice(node.start, node.end);
|
180
|
+
const location = node.loc;
|
181
|
+
const isResolved = resolvedExpressions.has(node);
|
176
182
|
if (source && !isStatic && effect && !isConstant(node)) {
|
177
183
|
source = `() => (${source})`;
|
178
184
|
if (location && node && !isResolved) {
|
@@ -180,7 +186,7 @@ function resolveExpression(node, context, effect = false) {
|
|
180
186
|
node.start -= 7;
|
181
187
|
}
|
182
188
|
}
|
183
|
-
if (
|
189
|
+
if (!isResolved) {
|
184
190
|
const offset = node.start - 1;
|
185
191
|
(0, __vue_compiler_dom.walkIdentifiers)(node, (id) => {
|
186
192
|
if (!id.loc) return;
|
@@ -436,8 +442,8 @@ function transform(node, options = {}) {
|
|
436
442
|
node,
|
437
443
|
source: node.source,
|
438
444
|
template: [],
|
439
|
-
component: new Set(),
|
440
|
-
directive: new Set(),
|
445
|
+
component: /* @__PURE__ */ new Set(),
|
446
|
+
directive: /* @__PURE__ */ new Set(),
|
441
447
|
block: newBlock(node),
|
442
448
|
hasTemplateRef: false
|
443
449
|
};
|
@@ -687,7 +693,7 @@ function transformProp(prop, node, context) {
|
|
687
693
|
}
|
688
694
|
}
|
689
695
|
function dedupeProperties(results) {
|
690
|
-
const knownProps = new Map();
|
696
|
+
const knownProps = /* @__PURE__ */ new Map();
|
691
697
|
const deduped = [];
|
692
698
|
for (const result of results) {
|
693
699
|
const prop = resolveDirectiveResult(result);
|
@@ -794,9 +800,9 @@ function processLogicalExpression(node, context) {
|
|
794
800
|
|
795
801
|
//#endregion
|
796
802
|
//#region src/transforms/transformText.ts
|
797
|
-
const seen = new WeakMap();
|
803
|
+
const seen = /* @__PURE__ */ new WeakMap();
|
798
804
|
const transformText = (node, context) => {
|
799
|
-
if (!seen.has(context.root)) seen.set(context.root, new WeakSet());
|
805
|
+
if (!seen.has(context.root)) seen.set(context.root, /* @__PURE__ */ new WeakSet());
|
800
806
|
if (seen.get(context.root).has(node)) {
|
801
807
|
context.dynamic.flags |= DynamicFlag.NON_TEMPLATE;
|
802
808
|
return;
|
@@ -836,7 +842,7 @@ function processInterpolation(context) {
|
|
836
842
|
return;
|
837
843
|
}
|
838
844
|
const id = context.reference();
|
839
|
-
if (isFragmentNode(parent)) context.registerOperation({
|
845
|
+
if (isFragmentNode(parent) || findProp(parent, "v-slot")) context.registerOperation({
|
840
846
|
type: IRNodeTypes.CREATE_NODES,
|
841
847
|
id,
|
842
848
|
values
|
@@ -984,7 +990,7 @@ const transformVIf = createStructuralDirectiveTransform([
|
|
984
990
|
"else",
|
985
991
|
"else-if"
|
986
992
|
], processIf);
|
987
|
-
const transformedIfNode = new WeakMap();
|
993
|
+
const transformedIfNode = /* @__PURE__ */ new WeakMap();
|
988
994
|
function processIf(node, attribute, context) {
|
989
995
|
const dir = resolveDirective(attribute, context);
|
990
996
|
if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) {
|
package/dist/index.d.cts
CHANGED
@@ -49,7 +49,6 @@ declare class TransformContext<T extends BlockIRNode['node'] = BlockIRNode['node
|
|
49
49
|
declare function transform(node: RootNode, options?: TransformOptions): RootIRNode;
|
50
50
|
declare function transformNode(context: TransformContext<BlockIRNode['node']>): void;
|
51
51
|
declare function createStructuralDirectiveTransform(name: string | string[], fn: StructuralDirectiveTransform): NodeTransform;
|
52
|
-
|
53
52
|
//#endregion
|
54
53
|
//#region src/ir/component.d.ts
|
55
54
|
interface IRProp extends Omit<DirectiveTransformResult, 'value'> {
|
@@ -107,7 +106,6 @@ interface IRSlotsExpression {
|
|
107
106
|
}
|
108
107
|
type IRSlotDynamic = IRSlotDynamicBasic | IRSlotDynamicLoop | IRSlotDynamicConditional;
|
109
108
|
type IRSlots = IRSlotsStatic | IRSlotDynamic | IRSlotsExpression;
|
110
|
-
|
111
109
|
//#endregion
|
112
110
|
//#region src/ir/index.d.ts
|
113
111
|
declare enum IRNodeTypes {
|
@@ -343,7 +341,6 @@ type VaporDirectiveNode = Overwrite<DirectiveNode, {
|
|
343
341
|
}>;
|
344
342
|
type InsertionStateTypes = IfIRNode | ForIRNode | SlotOutletIRNode | CreateComponentIRNode;
|
345
343
|
declare function isBlockOperation(op: OperationNode): op is InsertionStateTypes;
|
346
|
-
|
347
344
|
//#endregion
|
348
345
|
//#region src/compile.d.ts
|
349
346
|
interface VaporCodegenResult$1 extends Omit<VaporCodegenResult, 'ast'> {
|
@@ -355,66 +352,50 @@ type CompilerOptions = HackOptions<CompilerOptions$1> & {
|
|
355
352
|
source?: string;
|
356
353
|
};
|
357
354
|
type TransformPreset = [NodeTransform[], Record<string, DirectiveTransform>];
|
358
|
-
|
359
355
|
//#endregion
|
360
356
|
//#region src/transforms/transformText.d.ts
|
361
357
|
declare const transformText: NodeTransform;
|
362
|
-
|
363
358
|
//#endregion
|
364
359
|
//#region src/transforms/transformElement.d.ts
|
365
360
|
declare const transformElement: NodeTransform;
|
366
|
-
|
367
361
|
//#endregion
|
368
362
|
//#region src/transforms/transformChildren.d.ts
|
369
363
|
declare const transformChildren: NodeTransform;
|
370
|
-
|
371
364
|
//#endregion
|
372
365
|
//#region src/transforms/transformTemplateRef.d.ts
|
373
366
|
declare const transformTemplateRef: NodeTransform;
|
374
|
-
|
375
367
|
//#endregion
|
376
368
|
//#region src/transforms/vBind.d.ts
|
377
369
|
declare const transformVBind: DirectiveTransform;
|
378
|
-
|
379
370
|
//#endregion
|
380
371
|
//#region src/transforms/vOn.d.ts
|
381
372
|
declare const transformVOn: DirectiveTransform;
|
382
|
-
|
383
373
|
//#endregion
|
384
374
|
//#region src/transforms/vSlot.d.ts
|
385
375
|
declare const transformVSlot: NodeTransform;
|
386
|
-
|
387
376
|
//#endregion
|
388
377
|
//#region src/transforms/vSlots.d.ts
|
389
378
|
declare const transformVSlots: DirectiveTransform;
|
390
|
-
|
391
379
|
//#endregion
|
392
380
|
//#region src/transforms/vModel.d.ts
|
393
381
|
declare const transformVModel: DirectiveTransform;
|
394
|
-
|
395
382
|
//#endregion
|
396
383
|
//#region src/transforms/vShow.d.ts
|
397
384
|
declare const transformVShow: DirectiveTransform;
|
398
|
-
|
399
385
|
//#endregion
|
400
386
|
//#region src/transforms/vHtml.d.ts
|
401
387
|
declare const transformVHtml: DirectiveTransform;
|
402
|
-
|
403
388
|
//#endregion
|
404
389
|
//#region src/transforms/vFor.d.ts
|
405
390
|
declare const transformVFor: NodeTransform;
|
406
|
-
|
407
391
|
//#endregion
|
408
392
|
//#region src/transforms/vIf.d.ts
|
409
393
|
declare const transformVIf: NodeTransform;
|
410
|
-
|
411
394
|
//#endregion
|
412
395
|
//#region src/transforms/vOnce.d.ts
|
413
396
|
declare const transformVOnce: NodeTransform;
|
414
|
-
|
415
397
|
//#endregion
|
416
398
|
//#region src/transforms/vText.d.ts
|
417
399
|
declare const transformVText: DirectiveTransform;
|
418
|
-
|
419
400
|
//#endregion
|
420
401
|
export { BaseIRNode, BlockIRNode, CompilerOptions, CreateComponentIRNode, CreateNodesIRNode, DeclareOldRefIRNode, DirectiveIRNode, DirectiveTransform, DirectiveTransformResult, DynamicFlag, ForIRNode, GetTextChildIRNode, HackOptions, IRDynamicInfo, IRDynamicPropsKind, IREffect, IRFor, IRNode, IRNodeTypes, IRProp, IRProps, IRPropsDynamicAttribute, IRPropsDynamicExpression, IRPropsStatic, IRSlotDynamic, IRSlotDynamicBasic, IRSlotDynamicConditional, IRSlotDynamicLoop, IRSlotType, IRSlots, IRSlotsExpression, IRSlotsStatic, IfIRNode, InsertNodeIRNode, InsertionStateTypes, KeyOverride, NodeTransform, OperationNode, PrependNodeIRNode, RootIRNode, RootNode, SetDynamicEventsIRNode, SetDynamicPropsIRNode, SetEventIRNode, SetHtmlIRNode, SetNodesIRNode, SetPropIRNode, SetTemplateRefIRNode, SetTextIRNode, SlotBlockIRNode, SlotOutletIRNode, StructuralDirectiveTransform, TransformContext, TransformOptions, TransformPreset, VaporDirectiveNode, compile, createStructuralDirectiveTransform, generate, isBlockOperation, transform, transformChildren, transformElement, transformNode, transformTemplateRef, transformText, transformVBind, transformVFor, transformVHtml, transformVIf, transformVModel, transformVOn, transformVOnce, transformVShow, transformVSlot, transformVSlots, transformVText };
|
package/dist/index.d.ts
CHANGED
@@ -49,7 +49,6 @@ declare class TransformContext<T extends BlockIRNode['node'] = BlockIRNode['node
|
|
49
49
|
declare function transform(node: RootNode, options?: TransformOptions): RootIRNode;
|
50
50
|
declare function transformNode(context: TransformContext<BlockIRNode['node']>): void;
|
51
51
|
declare function createStructuralDirectiveTransform(name: string | string[], fn: StructuralDirectiveTransform): NodeTransform;
|
52
|
-
|
53
52
|
//#endregion
|
54
53
|
//#region src/ir/component.d.ts
|
55
54
|
interface IRProp extends Omit<DirectiveTransformResult, 'value'> {
|
@@ -107,7 +106,6 @@ interface IRSlotsExpression {
|
|
107
106
|
}
|
108
107
|
type IRSlotDynamic = IRSlotDynamicBasic | IRSlotDynamicLoop | IRSlotDynamicConditional;
|
109
108
|
type IRSlots = IRSlotsStatic | IRSlotDynamic | IRSlotsExpression;
|
110
|
-
|
111
109
|
//#endregion
|
112
110
|
//#region src/ir/index.d.ts
|
113
111
|
declare enum IRNodeTypes {
|
@@ -343,7 +341,6 @@ type VaporDirectiveNode = Overwrite<DirectiveNode, {
|
|
343
341
|
}>;
|
344
342
|
type InsertionStateTypes = IfIRNode | ForIRNode | SlotOutletIRNode | CreateComponentIRNode;
|
345
343
|
declare function isBlockOperation(op: OperationNode): op is InsertionStateTypes;
|
346
|
-
|
347
344
|
//#endregion
|
348
345
|
//#region src/compile.d.ts
|
349
346
|
interface VaporCodegenResult$1 extends Omit<VaporCodegenResult, 'ast'> {
|
@@ -355,66 +352,50 @@ type CompilerOptions = HackOptions<CompilerOptions$1> & {
|
|
355
352
|
source?: string;
|
356
353
|
};
|
357
354
|
type TransformPreset = [NodeTransform[], Record<string, DirectiveTransform>];
|
358
|
-
|
359
355
|
//#endregion
|
360
356
|
//#region src/transforms/transformText.d.ts
|
361
357
|
declare const transformText: NodeTransform;
|
362
|
-
|
363
358
|
//#endregion
|
364
359
|
//#region src/transforms/transformElement.d.ts
|
365
360
|
declare const transformElement: NodeTransform;
|
366
|
-
|
367
361
|
//#endregion
|
368
362
|
//#region src/transforms/transformChildren.d.ts
|
369
363
|
declare const transformChildren: NodeTransform;
|
370
|
-
|
371
364
|
//#endregion
|
372
365
|
//#region src/transforms/transformTemplateRef.d.ts
|
373
366
|
declare const transformTemplateRef: NodeTransform;
|
374
|
-
|
375
367
|
//#endregion
|
376
368
|
//#region src/transforms/vBind.d.ts
|
377
369
|
declare const transformVBind: DirectiveTransform;
|
378
|
-
|
379
370
|
//#endregion
|
380
371
|
//#region src/transforms/vOn.d.ts
|
381
372
|
declare const transformVOn: DirectiveTransform;
|
382
|
-
|
383
373
|
//#endregion
|
384
374
|
//#region src/transforms/vSlot.d.ts
|
385
375
|
declare const transformVSlot: NodeTransform;
|
386
|
-
|
387
376
|
//#endregion
|
388
377
|
//#region src/transforms/vSlots.d.ts
|
389
378
|
declare const transformVSlots: DirectiveTransform;
|
390
|
-
|
391
379
|
//#endregion
|
392
380
|
//#region src/transforms/vModel.d.ts
|
393
381
|
declare const transformVModel: DirectiveTransform;
|
394
|
-
|
395
382
|
//#endregion
|
396
383
|
//#region src/transforms/vShow.d.ts
|
397
384
|
declare const transformVShow: DirectiveTransform;
|
398
|
-
|
399
385
|
//#endregion
|
400
386
|
//#region src/transforms/vHtml.d.ts
|
401
387
|
declare const transformVHtml: DirectiveTransform;
|
402
|
-
|
403
388
|
//#endregion
|
404
389
|
//#region src/transforms/vFor.d.ts
|
405
390
|
declare const transformVFor: NodeTransform;
|
406
|
-
|
407
391
|
//#endregion
|
408
392
|
//#region src/transforms/vIf.d.ts
|
409
393
|
declare const transformVIf: NodeTransform;
|
410
|
-
|
411
394
|
//#endregion
|
412
395
|
//#region src/transforms/vOnce.d.ts
|
413
396
|
declare const transformVOnce: NodeTransform;
|
414
|
-
|
415
397
|
//#endregion
|
416
398
|
//#region src/transforms/vText.d.ts
|
417
399
|
declare const transformVText: DirectiveTransform;
|
418
|
-
|
419
400
|
//#endregion
|
420
401
|
export { BaseIRNode, BlockIRNode, CompilerOptions, CreateComponentIRNode, CreateNodesIRNode, DeclareOldRefIRNode, DirectiveIRNode, DirectiveTransform, DirectiveTransformResult, DynamicFlag, ForIRNode, GetTextChildIRNode, HackOptions, IRDynamicInfo, IRDynamicPropsKind, IREffect, IRFor, IRNode, IRNodeTypes, IRProp, IRProps, IRPropsDynamicAttribute, IRPropsDynamicExpression, IRPropsStatic, IRSlotDynamic, IRSlotDynamicBasic, IRSlotDynamicConditional, IRSlotDynamicLoop, IRSlotType, IRSlots, IRSlotsExpression, IRSlotsStatic, IfIRNode, InsertNodeIRNode, InsertionStateTypes, KeyOverride, NodeTransform, OperationNode, PrependNodeIRNode, RootIRNode, RootNode, SetDynamicEventsIRNode, SetDynamicPropsIRNode, SetEventIRNode, SetHtmlIRNode, SetNodesIRNode, SetPropIRNode, SetTemplateRefIRNode, SetTextIRNode, SlotBlockIRNode, SlotOutletIRNode, StructuralDirectiveTransform, TransformContext, TransformOptions, TransformPreset, VaporDirectiveNode, compile, createStructuralDirectiveTransform, generate, isBlockOperation, transform, transformChildren, transformElement, transformNode, transformTemplateRef, transformText, transformVBind, transformVFor, transformVHtml, transformVIf, transformVModel, transformVOn, transformVOnce, transformVShow, transformVSlot, transformVSlots, transformVText };
|
package/dist/index.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { parse, parseExpression } from "@babel/parser";
|
2
2
|
import { NEWLINE, genCall, genExpression, generate } from "@vue/compiler-vapor";
|
3
3
|
import { EMPTY_OBJ, NOOP, camelize, extend, isArray, isBuiltInDirective, isGloballyAllowed, isHTMLTag, isSVGTag, isString, isVoidTag, makeMap } from "@vue/shared";
|
4
|
-
import { DOMErrorCodes, ErrorCodes, NodeTypes, createCompilerError, createDOMCompilerError, createSimpleExpression, defaultOnError, defaultOnWarn, isConstantNode, isLiteralWhitelisted, isMemberExpression, isStaticNode, isValidHTMLNesting, resolveModifiers, walkIdentifiers } from "@vue/compiler-dom";
|
4
|
+
import { DOMErrorCodes, ErrorCodes, NodeTypes, createCompilerError, createDOMCompilerError, createSimpleExpression, defaultOnError, defaultOnWarn, isConstantNode, isLiteralWhitelisted, isMemberExpression, isStaticNode, isValidHTMLNesting, resolveModifiers, unwrapTSNode, walkIdentifiers } from "@vue/compiler-dom";
|
5
5
|
import { isLiteral, jsxClosingFragment, jsxExpressionContainer, jsxFragment, jsxOpeningFragment } from "@babel/types";
|
6
6
|
|
7
7
|
//#region src/ir/component.ts
|
@@ -114,7 +114,12 @@ function getLiteralExpressionValue(exp) {
|
|
114
114
|
}
|
115
115
|
const isConstant = (node) => {
|
116
116
|
if (!node) return false;
|
117
|
-
if (node.type === "Identifier") return node.name === "undefined";
|
117
|
+
if (node.type === "Identifier") return node.name === "undefined" || isGloballyAllowed(node.name);
|
118
|
+
if ([
|
119
|
+
"JSXElement",
|
120
|
+
"JSXFragment",
|
121
|
+
"NullLiteral"
|
122
|
+
].includes(node.type)) return true;
|
118
123
|
if (node.type === "ArrayExpression") {
|
119
124
|
const { elements } = node;
|
120
125
|
return elements.every((element) => element && isConstant(element));
|
@@ -143,13 +148,14 @@ function resolveSimpleExpressionNode(exp) {
|
|
143
148
|
}
|
144
149
|
return exp;
|
145
150
|
}
|
146
|
-
const resolvedExpressions = new WeakSet();
|
151
|
+
const resolvedExpressions = /* @__PURE__ */ new WeakSet();
|
147
152
|
function resolveExpression(node, context, effect = false) {
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
const
|
153
|
+
if (!node) return createSimpleExpression("", true);
|
154
|
+
node = unwrapTSNode(node.type === "JSXExpressionContainer" ? node.expression : node);
|
155
|
+
const isStatic = node.type === "StringLiteral" || node.type === "JSXText" || node.type === "JSXIdentifier";
|
156
|
+
let source = node.type === "JSXEmptyExpression" ? "" : node.type === "JSXIdentifier" ? node.name : node.type === "StringLiteral" ? node.value : node.type === "JSXText" ? resolveJSXText(node) : node.type === "Identifier" ? node.name : context.ir.source.slice(node.start, node.end);
|
157
|
+
const location = node.loc;
|
158
|
+
const isResolved = resolvedExpressions.has(node);
|
153
159
|
if (source && !isStatic && effect && !isConstant(node)) {
|
154
160
|
source = `() => (${source})`;
|
155
161
|
if (location && node && !isResolved) {
|
@@ -157,7 +163,7 @@ function resolveExpression(node, context, effect = false) {
|
|
157
163
|
node.start -= 7;
|
158
164
|
}
|
159
165
|
}
|
160
|
-
if (
|
166
|
+
if (!isResolved) {
|
161
167
|
const offset = node.start - 1;
|
162
168
|
walkIdentifiers(node, (id) => {
|
163
169
|
if (!id.loc) return;
|
@@ -413,8 +419,8 @@ function transform(node, options = {}) {
|
|
413
419
|
node,
|
414
420
|
source: node.source,
|
415
421
|
template: [],
|
416
|
-
component: new Set(),
|
417
|
-
directive: new Set(),
|
422
|
+
component: /* @__PURE__ */ new Set(),
|
423
|
+
directive: /* @__PURE__ */ new Set(),
|
418
424
|
block: newBlock(node),
|
419
425
|
hasTemplateRef: false
|
420
426
|
};
|
@@ -664,7 +670,7 @@ function transformProp(prop, node, context) {
|
|
664
670
|
}
|
665
671
|
}
|
666
672
|
function dedupeProperties(results) {
|
667
|
-
const knownProps = new Map();
|
673
|
+
const knownProps = /* @__PURE__ */ new Map();
|
668
674
|
const deduped = [];
|
669
675
|
for (const result of results) {
|
670
676
|
const prop = resolveDirectiveResult(result);
|
@@ -771,9 +777,9 @@ function processLogicalExpression(node, context) {
|
|
771
777
|
|
772
778
|
//#endregion
|
773
779
|
//#region src/transforms/transformText.ts
|
774
|
-
const seen = new WeakMap();
|
780
|
+
const seen = /* @__PURE__ */ new WeakMap();
|
775
781
|
const transformText = (node, context) => {
|
776
|
-
if (!seen.has(context.root)) seen.set(context.root, new WeakSet());
|
782
|
+
if (!seen.has(context.root)) seen.set(context.root, /* @__PURE__ */ new WeakSet());
|
777
783
|
if (seen.get(context.root).has(node)) {
|
778
784
|
context.dynamic.flags |= DynamicFlag.NON_TEMPLATE;
|
779
785
|
return;
|
@@ -813,7 +819,7 @@ function processInterpolation(context) {
|
|
813
819
|
return;
|
814
820
|
}
|
815
821
|
const id = context.reference();
|
816
|
-
if (isFragmentNode(parent)) context.registerOperation({
|
822
|
+
if (isFragmentNode(parent) || findProp(parent, "v-slot")) context.registerOperation({
|
817
823
|
type: IRNodeTypes.CREATE_NODES,
|
818
824
|
id,
|
819
825
|
values
|
@@ -961,7 +967,7 @@ const transformVIf = createStructuralDirectiveTransform([
|
|
961
967
|
"else",
|
962
968
|
"else-if"
|
963
969
|
], processIf);
|
964
|
-
const transformedIfNode = new WeakMap();
|
970
|
+
const transformedIfNode = /* @__PURE__ */ new WeakMap();
|
965
971
|
function processIf(node, attribute, context) {
|
966
972
|
const dir = resolveDirective(attribute, context);
|
967
973
|
if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vue-jsx-vapor/compiler",
|
3
|
-
"version": "2.4.
|
3
|
+
"version": "2.4.3",
|
4
4
|
"description": "Vue JSX Vapor Compiler",
|
5
5
|
"type": "module",
|
6
6
|
"keywords": [
|
@@ -34,11 +34,11 @@
|
|
34
34
|
"./*": "./*"
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
|
-
"@babel/parser": "^7.
|
38
|
-
"@babel/types": "^7.
|
39
|
-
"@vue/compiler-dom": "https://pkg.pr.new/@vue/compiler-dom@
|
40
|
-
"@vue/compiler-vapor": "https://pkg.pr.new/@vue/compiler-vapor@
|
41
|
-
"@vue/shared": "https://pkg.pr.new/@vue/shared@
|
37
|
+
"@babel/parser": "^7.27.3",
|
38
|
+
"@babel/types": "^7.27.3",
|
39
|
+
"@vue/compiler-dom": "https://pkg.pr.new/@vue/compiler-dom@280bc48",
|
40
|
+
"@vue/compiler-vapor": "https://pkg.pr.new/@vue/compiler-vapor@280bc48",
|
41
|
+
"@vue/shared": "https://pkg.pr.new/@vue/shared@280bc48"
|
42
42
|
},
|
43
43
|
"scripts": {
|
44
44
|
"build": "tsdown",
|