@vue/runtime-core 3.4.0-beta.2 → 3.4.0-beta.4

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.
@@ -412,8 +412,10 @@ function checkRecursiveUpdates(seen, fn) {
412
412
  if (count > RECURSION_LIMIT) {
413
413
  const instance = fn.ownerInstance;
414
414
  const componentName = instance && getComponentName(instance.type);
415
- warn(
416
- `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`
415
+ handleError(
416
+ `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
417
+ null,
418
+ 10
417
419
  );
418
420
  return true;
419
421
  } else {
@@ -1091,6 +1093,8 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
1091
1093
  return false;
1092
1094
  }
1093
1095
  function updateHOCHostEl({ vnode, parent }, el) {
1096
+ if (!el)
1097
+ return;
1094
1098
  while (parent) {
1095
1099
  const root = parent.subTree;
1096
1100
  if (root.suspense && root.suspense.activeBranch === vnode) {
@@ -3262,24 +3266,30 @@ function useModel(props, name) {
3262
3266
  warn(`useModel() called with prop "${name}" which is not declared.`);
3263
3267
  return reactivity.ref();
3264
3268
  }
3265
- let localValue;
3266
- watchSyncEffect(() => {
3267
- localValue = props[name];
3268
- });
3269
- return reactivity.customRef((track, trigger) => ({
3270
- get() {
3271
- track();
3272
- return localValue;
3273
- },
3274
- set(value) {
3275
- const rawProps = i.vnode.props;
3276
- if (!(rawProps && name in rawProps) && shared.hasChanged(value, localValue)) {
3277
- localValue = value;
3269
+ return reactivity.customRef((track, trigger) => {
3270
+ let localValue;
3271
+ watchSyncEffect(() => {
3272
+ const propValue = props[name];
3273
+ if (shared.hasChanged(localValue, propValue)) {
3274
+ localValue = propValue;
3278
3275
  trigger();
3279
3276
  }
3280
- i.emit(`update:${name}`, value);
3281
- }
3282
- }));
3277
+ });
3278
+ return {
3279
+ get() {
3280
+ track();
3281
+ return localValue;
3282
+ },
3283
+ set(value) {
3284
+ const rawProps = i.vnode.props;
3285
+ if (!(rawProps && name in rawProps) && shared.hasChanged(value, localValue)) {
3286
+ localValue = value;
3287
+ trigger();
3288
+ }
3289
+ i.emit(`update:${name}`, value);
3290
+ }
3291
+ };
3292
+ });
3283
3293
  }
3284
3294
  function getContext() {
3285
3295
  const i = getCurrentInstance();
@@ -5045,7 +5055,7 @@ function propHasMismatch(el, key, clientValue) {
5045
5055
  let actual;
5046
5056
  let expected;
5047
5057
  if (key === "class") {
5048
- actual = el.className;
5058
+ actual = el.getAttribute("class");
5049
5059
  expected = shared.normalizeClass(clientValue);
5050
5060
  if (actual !== expected) {
5051
5061
  mismatchType = mismatchKey = `class`;
@@ -7935,7 +7945,7 @@ function isMemoSame(cached, memo) {
7935
7945
  return true;
7936
7946
  }
7937
7947
 
7938
- const version = "3.4.0-beta.2";
7948
+ const version = "3.4.0-beta.4";
7939
7949
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
7940
7950
  const _ssrUtils = {
7941
7951
  createComponentInstance,
@@ -607,6 +607,8 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
607
607
  return false;
608
608
  }
609
609
  function updateHOCHostEl({ vnode, parent }, el) {
610
+ if (!el)
611
+ return;
610
612
  while (parent) {
611
613
  const root = parent.subTree;
612
614
  if (root.suspense && root.suspense.activeBranch === vnode) {
@@ -2511,24 +2513,30 @@ function useAttrs() {
2511
2513
  }
2512
2514
  function useModel(props, name) {
2513
2515
  const i = getCurrentInstance();
2514
- let localValue;
2515
- watchSyncEffect(() => {
2516
- localValue = props[name];
2517
- });
2518
- return reactivity.customRef((track, trigger) => ({
2519
- get() {
2520
- track();
2521
- return localValue;
2522
- },
2523
- set(value) {
2524
- const rawProps = i.vnode.props;
2525
- if (!(rawProps && name in rawProps) && shared.hasChanged(value, localValue)) {
2526
- localValue = value;
2516
+ return reactivity.customRef((track, trigger) => {
2517
+ let localValue;
2518
+ watchSyncEffect(() => {
2519
+ const propValue = props[name];
2520
+ if (shared.hasChanged(localValue, propValue)) {
2521
+ localValue = propValue;
2527
2522
  trigger();
2528
2523
  }
2529
- i.emit(`update:${name}`, value);
2530
- }
2531
- }));
2524
+ });
2525
+ return {
2526
+ get() {
2527
+ track();
2528
+ return localValue;
2529
+ },
2530
+ set(value) {
2531
+ const rawProps = i.vnode.props;
2532
+ if (!(rawProps && name in rawProps) && shared.hasChanged(value, localValue)) {
2533
+ localValue = value;
2534
+ trigger();
2535
+ }
2536
+ i.emit(`update:${name}`, value);
2537
+ }
2538
+ };
2539
+ });
2532
2540
  }
2533
2541
  function getContext() {
2534
2542
  const i = getCurrentInstance();
@@ -6224,7 +6232,7 @@ function isMemoSame(cached, memo) {
6224
6232
  return true;
6225
6233
  }
6226
6234
 
6227
- const version = "3.4.0-beta.2";
6235
+ const version = "3.4.0-beta.4";
6228
6236
  const ErrorTypeStrings = null;
6229
6237
  const _ssrUtils = {
6230
6238
  createComponentInstance,
@@ -416,8 +416,10 @@ function checkRecursiveUpdates(seen, fn) {
416
416
  if (count > RECURSION_LIMIT) {
417
417
  const instance = fn.ownerInstance;
418
418
  const componentName = instance && getComponentName(instance.type);
419
- warn(
420
- `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`
419
+ handleError(
420
+ `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
421
+ null,
422
+ 10
421
423
  );
422
424
  return true;
423
425
  } else {
@@ -1095,6 +1097,8 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
1095
1097
  return false;
1096
1098
  }
1097
1099
  function updateHOCHostEl({ vnode, parent }, el) {
1100
+ if (!el)
1101
+ return;
1098
1102
  while (parent) {
1099
1103
  const root = parent.subTree;
1100
1104
  if (root.suspense && root.suspense.activeBranch === vnode) {
@@ -3268,24 +3272,30 @@ function useModel(props, name) {
3268
3272
  warn(`useModel() called with prop "${name}" which is not declared.`);
3269
3273
  return ref();
3270
3274
  }
3271
- let localValue;
3272
- watchSyncEffect(() => {
3273
- localValue = props[name];
3274
- });
3275
- return customRef((track, trigger) => ({
3276
- get() {
3277
- track();
3278
- return localValue;
3279
- },
3280
- set(value) {
3281
- const rawProps = i.vnode.props;
3282
- if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
3283
- localValue = value;
3275
+ return customRef((track, trigger) => {
3276
+ let localValue;
3277
+ watchSyncEffect(() => {
3278
+ const propValue = props[name];
3279
+ if (hasChanged(localValue, propValue)) {
3280
+ localValue = propValue;
3284
3281
  trigger();
3285
3282
  }
3286
- i.emit(`update:${name}`, value);
3287
- }
3288
- }));
3283
+ });
3284
+ return {
3285
+ get() {
3286
+ track();
3287
+ return localValue;
3288
+ },
3289
+ set(value) {
3290
+ const rawProps = i.vnode.props;
3291
+ if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
3292
+ localValue = value;
3293
+ trigger();
3294
+ }
3295
+ i.emit(`update:${name}`, value);
3296
+ }
3297
+ };
3298
+ });
3289
3299
  }
3290
3300
  function getContext() {
3291
3301
  const i = getCurrentInstance();
@@ -5065,7 +5075,7 @@ function propHasMismatch(el, key, clientValue) {
5065
5075
  let actual;
5066
5076
  let expected;
5067
5077
  if (key === "class") {
5068
- actual = el.className;
5078
+ actual = el.getAttribute("class");
5069
5079
  expected = normalizeClass(clientValue);
5070
5080
  if (actual !== expected) {
5071
5081
  mismatchType = mismatchKey = `class`;
@@ -8009,7 +8019,7 @@ function isMemoSame(cached, memo) {
8009
8019
  return true;
8010
8020
  }
8011
8021
 
8012
- const version = "3.4.0-beta.2";
8022
+ const version = "3.4.0-beta.4";
8013
8023
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8014
8024
  const _ssrUtils = {
8015
8025
  createComponentInstance,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.4.0-beta.2",
3
+ "version": "3.4.0-beta.4",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
34
34
  "dependencies": {
35
- "@vue/shared": "3.4.0-beta.2",
36
- "@vue/reactivity": "3.4.0-beta.2"
35
+ "@vue/shared": "3.4.0-beta.4",
36
+ "@vue/reactivity": "3.4.0-beta.4"
37
37
  }
38
38
  }