@vue-jsx-vapor/compiler 2.4.7 → 2.4.8

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 CHANGED
@@ -186,16 +186,7 @@ function resolveExpression(node, context, effect = false) {
186
186
  node.start -= 7;
187
187
  }
188
188
  }
189
- if (!isResolved) {
190
- const offset = node.start - 1;
191
- (0, __vue_compiler_dom.walkIdentifiers)(node, (id) => {
192
- if (!id.loc) return;
193
- id.start = id.loc.start.index - offset;
194
- id.end = id.loc.end.index - offset;
195
- }, true);
196
- resolvedExpressions.add(node);
197
- }
198
- return resolveSimpleExpression(source, isStatic, location, node);
189
+ return resolveSimpleExpression(source, isStatic, location, isStatic ? void 0 : (0, __babel_parser.parseExpression)(`(${source})`, { plugins: context.options.expressionPlugins }));
199
190
  }
200
191
  function resolveSimpleExpression(source, isStatic, location, ast) {
201
192
  const result = (0, __vue_compiler_dom.createSimpleExpression)(source, isStatic, resolveLocation(location, source));
@@ -264,7 +255,7 @@ function resolveDirective(node, context, withFn = false) {
264
255
  }
265
256
  function resolveExpressionWithFn(node, context) {
266
257
  const text = getText(node, context);
267
- return node.type === "Identifier" ? resolveSimpleExpression(text, false, node.loc) : resolveSimpleExpression(text, false, node.loc, (0, __babel_parser.parseExpression)(`(${text})=>{}`, { plugins: ["typescript"] }));
258
+ return node.type === "Identifier" ? resolveSimpleExpression(text, false, node.loc) : resolveSimpleExpression(text, false, node.loc, (0, __babel_parser.parseExpression)(`(${text})=>{}`, { plugins: context.options.expressionPlugins }));
268
259
  }
269
260
  function isJSXComponent(node) {
270
261
  if (node.type !== "JSXElement") return false;
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, unwrapTSNode, walkIdentifiers } from "@vue/compiler-dom";
4
+ import { DOMErrorCodes, ErrorCodes, NodeTypes, createCompilerError, createDOMCompilerError, createSimpleExpression, defaultOnError, defaultOnWarn, isConstantNode, isLiteralWhitelisted, isMemberExpression, isStaticNode, isValidHTMLNesting, resolveModifiers, unwrapTSNode } from "@vue/compiler-dom";
5
5
  import { isLiteral, jsxClosingFragment, jsxExpressionContainer, jsxFragment, jsxOpeningFragment } from "@babel/types";
6
6
 
7
7
  //#region src/ir/component.ts
@@ -163,16 +163,7 @@ function resolveExpression(node, context, effect = false) {
163
163
  node.start -= 7;
164
164
  }
165
165
  }
166
- if (!isResolved) {
167
- const offset = node.start - 1;
168
- walkIdentifiers(node, (id) => {
169
- if (!id.loc) return;
170
- id.start = id.loc.start.index - offset;
171
- id.end = id.loc.end.index - offset;
172
- }, true);
173
- resolvedExpressions.add(node);
174
- }
175
- return resolveSimpleExpression(source, isStatic, location, node);
166
+ return resolveSimpleExpression(source, isStatic, location, isStatic ? void 0 : parseExpression(`(${source})`, { plugins: context.options.expressionPlugins }));
176
167
  }
177
168
  function resolveSimpleExpression(source, isStatic, location, ast) {
178
169
  const result = createSimpleExpression(source, isStatic, resolveLocation(location, source));
@@ -241,7 +232,7 @@ function resolveDirective(node, context, withFn = false) {
241
232
  }
242
233
  function resolveExpressionWithFn(node, context) {
243
234
  const text = getText(node, context);
244
- return node.type === "Identifier" ? resolveSimpleExpression(text, false, node.loc) : resolveSimpleExpression(text, false, node.loc, parseExpression(`(${text})=>{}`, { plugins: ["typescript"] }));
235
+ return node.type === "Identifier" ? resolveSimpleExpression(text, false, node.loc) : resolveSimpleExpression(text, false, node.loc, parseExpression(`(${text})=>{}`, { plugins: context.options.expressionPlugins }));
245
236
  }
246
237
  function isJSXComponent(node) {
247
238
  if (node.type !== "JSXElement") return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-jsx-vapor/compiler",
3
- "version": "2.4.7",
3
+ "version": "2.4.8",
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.27.7",
38
- "@babel/types": "^7.27.7",
39
- "@vue/compiler-dom": "https://pkg.pr.new/@vue/compiler-dom@715b798",
40
- "@vue/compiler-vapor": "https://pkg.pr.new/@vue/compiler-vapor@715b798",
41
- "@vue/shared": "https://pkg.pr.new/@vue/shared@715b798"
37
+ "@babel/parser": "^7.28.0",
38
+ "@babel/types": "^7.28.0",
39
+ "@vue/compiler-dom": "https://pkg.pr.new/@vue/compiler-dom@51677cd",
40
+ "@vue/compiler-vapor": "https://pkg.pr.new/@vue/compiler-vapor@51677cd",
41
+ "@vue/shared": "https://pkg.pr.new/@vue/shared@51677cd"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "tsdown",