@vue/runtime-dom 3.3.0-beta.3 → 3.3.0-beta.5

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.
@@ -192,14 +192,13 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
192
192
  el[key] = value == null ? "" : value;
193
193
  return;
194
194
  }
195
- if (key === "value" && el.tagName !== "PROGRESS" && // custom elements may use _value internally
196
- !el.tagName.includes("-")) {
195
+ const tag = el.tagName;
196
+ if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
197
+ !tag.includes("-")) {
197
198
  el._value = value;
199
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
198
200
  const newValue = value == null ? "" : value;
199
- if (el.value !== newValue || // #4956: always set for OPTION elements because its value falls back to
200
- // textContent if no value attribute is present. And setting .value for
201
- // OPTION has no side effect
202
- el.tagName === "OPTION") {
201
+ if (oldValue !== newValue) {
203
202
  el.value = newValue;
204
203
  }
205
204
  if (value == null) {
@@ -225,7 +224,7 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
225
224
  } catch (e) {
226
225
  if (!needRemove) {
227
226
  runtimeCore.warn(
228
- `Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: value ${value} is invalid.`,
227
+ `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
229
228
  e
230
229
  );
231
230
  }
@@ -1424,7 +1423,7 @@ function injectCompilerOptionsCheck(app) {
1424
1423
  const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
1425
1424
  - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
1426
1425
  - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
1427
- - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-dom`;
1426
+ - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
1428
1427
  Object.defineProperty(app.config, "compilerOptions", {
1429
1428
  get() {
1430
1429
  runtimeCore.warn(msg);
@@ -184,14 +184,13 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
184
184
  el[key] = value == null ? "" : value;
185
185
  return;
186
186
  }
187
- if (key === "value" && el.tagName !== "PROGRESS" && // custom elements may use _value internally
188
- !el.tagName.includes("-")) {
187
+ const tag = el.tagName;
188
+ if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
189
+ !tag.includes("-")) {
189
190
  el._value = value;
191
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
190
192
  const newValue = value == null ? "" : value;
191
- if (el.value !== newValue || // #4956: always set for OPTION elements because its value falls back to
192
- // textContent if no value attribute is present. And setting .value for
193
- // OPTION has no side effect
194
- el.tagName === "OPTION") {
193
+ if (oldValue !== newValue) {
195
194
  el.value = newValue;
196
195
  }
197
196
  if (value == null) {
@@ -2542,7 +2542,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
2542
2542
  );
2543
2543
  setActiveBranch(suspense, vnode.ssFallback);
2544
2544
  } else {
2545
- suspense.resolve();
2545
+ suspense.resolve(false, true);
2546
2546
  }
2547
2547
  }
2548
2548
  function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
@@ -2701,7 +2701,6 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
2701
2701
  }
2702
2702
  let hasWarned = false;
2703
2703
  function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
2704
- var _a;
2705
2704
  if (!hasWarned) {
2706
2705
  hasWarned = true;
2707
2706
  console[console.info ? "info" : "log"](
@@ -2716,10 +2715,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2716
2715
  o: { parentNode, remove }
2717
2716
  } = rendererInternals;
2718
2717
  let parentSuspenseId;
2719
- const isSuspensible = ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
2718
+ const isSuspensible = isVNodeSuspensible(vnode);
2720
2719
  if (isSuspensible) {
2721
2720
  if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
2722
- parentSuspenseId = parentSuspense == null ? void 0 : parentSuspense.pendingId;
2721
+ parentSuspenseId = parentSuspense.pendingId;
2723
2722
  parentSuspense.deps++;
2724
2723
  }
2725
2724
  }
@@ -2744,7 +2743,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2744
2743
  isHydrating,
2745
2744
  isUnmounted: false,
2746
2745
  effects: [],
2747
- resolve(resume = false) {
2746
+ resolve(resume = false, sync = false) {
2748
2747
  {
2749
2748
  if (!resume && !suspense.pendingBranch) {
2750
2749
  throw new Error(
@@ -2806,7 +2805,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2806
2805
  if (isSuspensible) {
2807
2806
  if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
2808
2807
  parentSuspense.deps--;
2809
- if (parentSuspense.deps === 0) {
2808
+ if (parentSuspense.deps === 0 && !sync) {
2810
2809
  parentSuspense.resolve();
2811
2810
  }
2812
2811
  }
@@ -3016,6 +3015,10 @@ function setActiveBranch(suspense, branch) {
3016
3015
  updateHOCHostEl(parentComponent, el);
3017
3016
  }
3018
3017
  }
3018
+ function isVNodeSuspensible(vnode) {
3019
+ var _a;
3020
+ return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
3021
+ }
3019
3022
 
3020
3023
  function watchEffect(effect, options) {
3021
3024
  return doWatch(effect, null, options);
@@ -3626,7 +3629,11 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
3626
3629
  }
3627
3630
 
3628
3631
  function defineComponent(options, extraOptions) {
3629
- return isFunction(options) ? extend({}, extraOptions, { setup: options, name: options.name }) : options;
3632
+ return isFunction(options) ? (
3633
+ // #8326: extend call and options.name access are considered side-effects
3634
+ // by Rollup, so we have to wrap it in a pure-annotated IIFE.
3635
+ /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
3636
+ ) : options;
3630
3637
  }
3631
3638
 
3632
3639
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
@@ -8097,6 +8104,9 @@ const normalizeRef = ({
8097
8104
  ref_key,
8098
8105
  ref_for
8099
8106
  }) => {
8107
+ if (typeof ref === "number") {
8108
+ ref = "" + ref;
8109
+ }
8100
8110
  return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
8101
8111
  };
8102
8112
  function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
@@ -9018,7 +9028,7 @@ function isMemoSame(cached, memo) {
9018
9028
  return true;
9019
9029
  }
9020
9030
 
9021
- const version = "3.3.0-beta.3";
9031
+ const version = "3.3.0-beta.5";
9022
9032
  const ssrUtils = null;
9023
9033
  const resolveFilter = null;
9024
9034
  const compatUtils = null;
@@ -9210,14 +9220,13 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
9210
9220
  el[key] = value == null ? "" : value;
9211
9221
  return;
9212
9222
  }
9213
- if (key === "value" && el.tagName !== "PROGRESS" && // custom elements may use _value internally
9214
- !el.tagName.includes("-")) {
9223
+ const tag = el.tagName;
9224
+ if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
9225
+ !tag.includes("-")) {
9215
9226
  el._value = value;
9227
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
9216
9228
  const newValue = value == null ? "" : value;
9217
- if (el.value !== newValue || // #4956: always set for OPTION elements because its value falls back to
9218
- // textContent if no value attribute is present. And setting .value for
9219
- // OPTION has no side effect
9220
- el.tagName === "OPTION") {
9229
+ if (oldValue !== newValue) {
9221
9230
  el.value = newValue;
9222
9231
  }
9223
9232
  if (value == null) {
@@ -9243,7 +9252,7 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
9243
9252
  } catch (e) {
9244
9253
  if (!needRemove) {
9245
9254
  warn(
9246
- `Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: value ${value} is invalid.`,
9255
+ `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
9247
9256
  e
9248
9257
  );
9249
9258
  }
@@ -10456,7 +10465,7 @@ function injectCompilerOptionsCheck(app) {
10456
10465
  const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
10457
10466
  - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
10458
10467
  - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
10459
- - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-dom`;
10468
+ - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
10460
10469
  Object.defineProperty(app.config, "compilerOptions", {
10461
10470
  get() {
10462
10471
  warn(msg);