tutuca 0.9.35 → 0.9.36

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.
@@ -3010,8 +3010,6 @@ function applyProperties(node, props, previous) {
3010
3010
  node.setAttribute(propName, propValue);
3011
3011
  else if (propName === "dangerouslySetInnerHTML")
3012
3012
  node.innerHTML = propValue.__html ?? "";
3013
- else if (isObject(propValue))
3014
- patchObject(node, previous, propName, propValue);
3015
3013
  else if (propName === "className")
3016
3014
  node.setAttribute("class", propValue);
3017
3015
  else
@@ -3031,18 +3029,6 @@ function removeProperty(node, propName, previous) {
3031
3029
  else
3032
3030
  node[propName] = null;
3033
3031
  }
3034
- function patchObject(node, previous, propName, propValue) {
3035
- const previousValue = previous?.[propName];
3036
- if (isObject(previousValue) && prototypesDiffer(previousValue, propValue)) {
3037
- node[propName] = propValue;
3038
- return;
3039
- }
3040
- if (!isObject(node[propName]))
3041
- node[propName] = {};
3042
- const target = node[propName];
3043
- for (const k in propValue)
3044
- target[k] = propValue[k];
3045
- }
3046
3032
 
3047
3033
  class VBase {
3048
3034
  }
@@ -3080,26 +3066,9 @@ function diffProps(a, b) {
3080
3066
  if (!Object.hasOwn(b, aKey)) {
3081
3067
  diff ??= {};
3082
3068
  diff[aKey] = undefined;
3083
- continue;
3084
- }
3085
- const aValue = a[aKey];
3086
- const bValue = b[aKey];
3087
- if (aValue === bValue)
3088
- continue;
3089
- if (isObject(aValue) && isObject(bValue)) {
3090
- if (prototypesDiffer(bValue, aValue)) {
3091
- diff ??= {};
3092
- diff[aKey] = bValue;
3093
- } else {
3094
- const objectDiff = diffProps(aValue, bValue);
3095
- if (objectDiff) {
3096
- diff ??= {};
3097
- diff[aKey] = objectDiff;
3098
- }
3099
- }
3100
- } else {
3069
+ } else if (a[aKey] !== b[aKey]) {
3101
3070
  diff ??= {};
3102
- diff[aKey] = bValue;
3071
+ diff[aKey] = b[aKey];
3103
3072
  }
3104
3073
  }
3105
3074
  for (const bKey in b) {
@@ -3252,7 +3221,7 @@ function h(tagName, properties, children) {
3252
3221
  addChild(normalizedChildren, children);
3253
3222
  return new VNode(tag, props, normalizedChildren, key, namespace);
3254
3223
  }
3255
- var isHtmlAttribute = (propName) => propName[4] === "-" && (propName[0] === "d" || propName[0] === "a"), isObject = (v) => v !== null && typeof v === "object", prototypesDiffer = (a, b) => Object.getPrototypeOf(a) !== Object.getPrototypeOf(b), getKey = (child) => child instanceof VNode ? child.key : undefined, isIterable = (obj) => obj != null && typeof obj !== "string" && typeof obj[Symbol.iterator] === "function", VText, VComment, VFragment, VNode;
3224
+ var isHtmlAttribute = (propName) => propName[4] === "-" && (propName[0] === "d" || propName[0] === "a"), getKey = (child) => child instanceof VNode ? child.key : undefined, isIterable = (obj) => obj != null && typeof obj !== "string" && typeof obj[Symbol.iterator] === "function", VText, VComment, VFragment, VNode;
3256
3225
  var init_vdom = __esm(() => {
3257
3226
  VText = class VText extends VBase {
3258
3227
  constructor(text) {
@@ -8440,7 +8409,9 @@ async function createNodeEnv() {
8440
8409
  return;
8441
8410
  console.error(err.message);
8442
8411
  });
8443
- const dom = new JSDOM("<!DOCTYPE html><html><head></head><body></body></html>", { virtualConsole });
8412
+ const dom = new JSDOM("<!DOCTYPE html><html><head></head><body></body></html>", {
8413
+ virtualConsole
8414
+ });
8444
8415
  const { document: document2, Text, Comment } = dom.window;
8445
8416
  globalThis.document = document2;
8446
8417
 
@@ -2876,8 +2876,6 @@ class PathChanges extends PathBuilder {
2876
2876
 
2877
2877
  // src/vdom.js
2878
2878
  var isHtmlAttribute = (propName) => propName[4] === "-" && (propName[0] === "d" || propName[0] === "a");
2879
- var isObject = (v) => v !== null && typeof v === "object";
2880
- var prototypesDiffer = (a, b) => Object.getPrototypeOf(a) !== Object.getPrototypeOf(b);
2881
2879
  function applyProperties(node, props, previous) {
2882
2880
  for (const propName in props) {
2883
2881
  const propValue = props[propName];
@@ -2887,8 +2885,6 @@ function applyProperties(node, props, previous) {
2887
2885
  node.setAttribute(propName, propValue);
2888
2886
  else if (propName === "dangerouslySetInnerHTML")
2889
2887
  node.innerHTML = propValue.__html ?? "";
2890
- else if (isObject(propValue))
2891
- patchObject(node, previous, propName, propValue);
2892
2888
  else if (propName === "className")
2893
2889
  node.setAttribute("class", propValue);
2894
2890
  else
@@ -2908,18 +2904,6 @@ function removeProperty(node, propName, previous) {
2908
2904
  else
2909
2905
  node[propName] = null;
2910
2906
  }
2911
- function patchObject(node, previous, propName, propValue) {
2912
- const previousValue = previous?.[propName];
2913
- if (isObject(previousValue) && prototypesDiffer(previousValue, propValue)) {
2914
- node[propName] = propValue;
2915
- return;
2916
- }
2917
- if (!isObject(node[propName]))
2918
- node[propName] = {};
2919
- const target = node[propName];
2920
- for (const k in propValue)
2921
- target[k] = propValue[k];
2922
- }
2923
2907
 
2924
2908
  class VBase {
2925
2909
  }
@@ -3059,26 +3043,9 @@ function diffProps(a, b) {
3059
3043
  if (!Object.hasOwn(b, aKey)) {
3060
3044
  diff ??= {};
3061
3045
  diff[aKey] = undefined;
3062
- continue;
3063
- }
3064
- const aValue = a[aKey];
3065
- const bValue = b[aKey];
3066
- if (aValue === bValue)
3067
- continue;
3068
- if (isObject(aValue) && isObject(bValue)) {
3069
- if (prototypesDiffer(bValue, aValue)) {
3070
- diff ??= {};
3071
- diff[aKey] = bValue;
3072
- } else {
3073
- const objectDiff = diffProps(aValue, bValue);
3074
- if (objectDiff) {
3075
- diff ??= {};
3076
- diff[aKey] = objectDiff;
3077
- }
3078
- }
3079
- } else {
3046
+ } else if (a[aKey] !== b[aKey]) {
3080
3047
  diff ??= {};
3081
- diff[aKey] = bValue;
3048
+ diff[aKey] = b[aKey];
3082
3049
  }
3083
3050
  }
3084
3051
  for (const bKey in b) {