vue 3.2.40 → 3.2.42

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/vue.cjs.js CHANGED
@@ -20,59 +20,59 @@ function _interopNamespace(e) {
20
20
 
21
21
  var runtimeDom__namespace = /*#__PURE__*/_interopNamespace(runtimeDom);
22
22
 
23
- // This entry is the "full-build" that includes both the runtime
24
- const compileCache = Object.create(null);
25
- function compileToFunction(template, options) {
26
- if (!shared.isString(template)) {
27
- if (template.nodeType) {
28
- template = template.innerHTML;
29
- }
30
- else {
31
- runtimeDom.warn(`invalid template option: `, template);
32
- return shared.NOOP;
33
- }
34
- }
35
- const key = template;
36
- const cached = compileCache[key];
37
- if (cached) {
38
- return cached;
39
- }
40
- if (template[0] === '#') {
41
- const el = document.querySelector(template);
42
- if (!el) {
43
- runtimeDom.warn(`Template element not found or is empty: ${template}`);
44
- }
45
- // __UNSAFE__
46
- // Reason: potential execution of JS expressions in in-DOM template.
47
- // The user must make sure the in-DOM template is trusted. If it's rendered
48
- // by the server, the template should not contain any user data.
49
- template = el ? el.innerHTML : ``;
50
- }
51
- const opts = shared.extend({
52
- hoistStatic: true,
53
- onError: onError ,
54
- onWarn: e => onError(e, true)
55
- }, options);
56
- if (!opts.isCustomElement && typeof customElements !== 'undefined') {
57
- opts.isCustomElement = tag => !!customElements.get(tag);
58
- }
59
- const { code } = compilerDom.compile(template, opts);
60
- function onError(err, asWarning = false) {
61
- const message = asWarning
62
- ? err.message
63
- : `Template compilation error: ${err.message}`;
64
- const codeFrame = err.loc &&
65
- shared.generateCodeFrame(template, err.loc.start.offset, err.loc.end.offset);
66
- runtimeDom.warn(codeFrame ? `${message}\n${codeFrame}` : message);
67
- }
68
- // The wildcard import results in a huge object with every export
69
- // with keys that cannot be mangled, and can be quite heavy size-wise.
70
- // In the global build we know `Vue` is available globally so we can avoid
71
- // the wildcard object.
72
- const render = (new Function('Vue', code)(runtimeDom__namespace));
73
- render._rc = true;
74
- return (compileCache[key] = render);
75
- }
23
+ // This entry is the "full-build" that includes both the runtime
24
+ const compileCache = Object.create(null);
25
+ function compileToFunction(template, options) {
26
+ if (!shared.isString(template)) {
27
+ if (template.nodeType) {
28
+ template = template.innerHTML;
29
+ }
30
+ else {
31
+ runtimeDom.warn(`invalid template option: `, template);
32
+ return shared.NOOP;
33
+ }
34
+ }
35
+ const key = template;
36
+ const cached = compileCache[key];
37
+ if (cached) {
38
+ return cached;
39
+ }
40
+ if (template[0] === '#') {
41
+ const el = document.querySelector(template);
42
+ if (!el) {
43
+ runtimeDom.warn(`Template element not found or is empty: ${template}`);
44
+ }
45
+ // __UNSAFE__
46
+ // Reason: potential execution of JS expressions in in-DOM template.
47
+ // The user must make sure the in-DOM template is trusted. If it's rendered
48
+ // by the server, the template should not contain any user data.
49
+ template = el ? el.innerHTML : ``;
50
+ }
51
+ const opts = shared.extend({
52
+ hoistStatic: true,
53
+ onError: onError ,
54
+ onWarn: e => onError(e, true)
55
+ }, options);
56
+ if (!opts.isCustomElement && typeof customElements !== 'undefined') {
57
+ opts.isCustomElement = tag => !!customElements.get(tag);
58
+ }
59
+ const { code } = compilerDom.compile(template, opts);
60
+ function onError(err, asWarning = false) {
61
+ const message = asWarning
62
+ ? err.message
63
+ : `Template compilation error: ${err.message}`;
64
+ const codeFrame = err.loc &&
65
+ shared.generateCodeFrame(template, err.loc.start.offset, err.loc.end.offset);
66
+ runtimeDom.warn(codeFrame ? `${message}\n${codeFrame}` : message);
67
+ }
68
+ // The wildcard import results in a huge object with every export
69
+ // with keys that cannot be mangled, and can be quite heavy size-wise.
70
+ // In the global build we know `Vue` is available globally so we can avoid
71
+ // the wildcard object.
72
+ const render = (new Function('Vue', code)(runtimeDom__namespace));
73
+ render._rc = true;
74
+ return (compileCache[key] = render);
75
+ }
76
76
  runtimeDom.registerRuntimeCompiler(compileToFunction);
77
77
 
78
78
  Object.keys(runtimeDom).forEach(function (k) {
@@ -20,47 +20,47 @@ function _interopNamespace(e) {
20
20
 
21
21
  var runtimeDom__namespace = /*#__PURE__*/_interopNamespace(runtimeDom);
22
22
 
23
- // This entry is the "full-build" that includes both the runtime
24
- const compileCache = Object.create(null);
25
- function compileToFunction(template, options) {
26
- if (!shared.isString(template)) {
27
- if (template.nodeType) {
28
- template = template.innerHTML;
29
- }
30
- else {
31
- return shared.NOOP;
32
- }
33
- }
34
- const key = template;
35
- const cached = compileCache[key];
36
- if (cached) {
37
- return cached;
38
- }
39
- if (template[0] === '#') {
40
- const el = document.querySelector(template);
41
- // __UNSAFE__
42
- // Reason: potential execution of JS expressions in in-DOM template.
43
- // The user must make sure the in-DOM template is trusted. If it's rendered
44
- // by the server, the template should not contain any user data.
45
- template = el ? el.innerHTML : ``;
46
- }
47
- const opts = shared.extend({
48
- hoistStatic: true,
49
- onError: undefined,
50
- onWarn: shared.NOOP
51
- }, options);
52
- if (!opts.isCustomElement && typeof customElements !== 'undefined') {
53
- opts.isCustomElement = tag => !!customElements.get(tag);
54
- }
55
- const { code } = compilerDom.compile(template, opts);
56
- // The wildcard import results in a huge object with every export
57
- // with keys that cannot be mangled, and can be quite heavy size-wise.
58
- // In the global build we know `Vue` is available globally so we can avoid
59
- // the wildcard object.
60
- const render = (new Function('Vue', code)(runtimeDom__namespace));
61
- render._rc = true;
62
- return (compileCache[key] = render);
63
- }
23
+ // This entry is the "full-build" that includes both the runtime
24
+ const compileCache = Object.create(null);
25
+ function compileToFunction(template, options) {
26
+ if (!shared.isString(template)) {
27
+ if (template.nodeType) {
28
+ template = template.innerHTML;
29
+ }
30
+ else {
31
+ return shared.NOOP;
32
+ }
33
+ }
34
+ const key = template;
35
+ const cached = compileCache[key];
36
+ if (cached) {
37
+ return cached;
38
+ }
39
+ if (template[0] === '#') {
40
+ const el = document.querySelector(template);
41
+ // __UNSAFE__
42
+ // Reason: potential execution of JS expressions in in-DOM template.
43
+ // The user must make sure the in-DOM template is trusted. If it's rendered
44
+ // by the server, the template should not contain any user data.
45
+ template = el ? el.innerHTML : ``;
46
+ }
47
+ const opts = shared.extend({
48
+ hoistStatic: true,
49
+ onError: undefined,
50
+ onWarn: shared.NOOP
51
+ }, options);
52
+ if (!opts.isCustomElement && typeof customElements !== 'undefined') {
53
+ opts.isCustomElement = tag => !!customElements.get(tag);
54
+ }
55
+ const { code } = compilerDom.compile(template, opts);
56
+ // The wildcard import results in a huge object with every export
57
+ // with keys that cannot be mangled, and can be quite heavy size-wise.
58
+ // In the global build we know `Vue` is available globally so we can avoid
59
+ // the wildcard object.
60
+ const render = (new Function('Vue', code)(runtimeDom__namespace));
61
+ render._rc = true;
62
+ return (compileCache[key] = render);
63
+ }
64
64
  runtimeDom.registerRuntimeCompiler(compileToFunction);
65
65
 
66
66
  Object.keys(runtimeDom).forEach(function (k) {