@ryupold/vode 1.5.0 → 1.5.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryupold/vode",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "a minimalist web framework",
5
5
  "author": "Michael Scherbakow (ryupold)",
6
6
  "license": "MIT",
@@ -26,17 +26,16 @@
26
26
  "homepage": "https://github.com/ryupold/vode#readme",
27
27
  "module": "index.ts",
28
28
  "scripts": {
29
- "build": "bun build index.ts --outfile dist/vode.mjs",
30
- "build-min": "bun build index.ts --outfile dist/vode.min.mjs --minify",
31
- "build-classic": "esbuild index.ts --outfile=dist/vode.js --bundle --global-name=V",
32
- "build-classic-min": "esbuild index.ts --outfile=dist/vode.min.js --bundle --global-name=V --minify",
33
- "release": "bun run build && bun run build-min && bun run build-classic && bun run build-classic-min",
29
+ "build": "esbuild index.ts --bundle --format=esm --outfile=dist/vode.mjs ",
30
+ "build-min": "esbuild index.ts --bundle --format=esm --minify --outfile=dist/vode.min.mjs",
31
+ "build-classic": "esbuild index.ts --outfile=dist/vode.js --bundle --format=iife --global-name=V",
32
+ "build-classic-min": "esbuild index.ts --outfile=dist/vode.min.js --bundle --format=iife --global-name=V --minify",
33
+ "release": "npm run build && npm run build-min && npm run build-classic && npm run build-classic-min",
34
34
  "publish": "npm publish --access public",
35
35
  "clean": "tsc -b --clean",
36
36
  "watch": "tsc -b -w"
37
37
  },
38
38
  "devDependencies": {
39
- "bun": "1.3.1",
40
39
  "esbuild": "0.25.12",
41
40
  "typescript": "5.9.3"
42
41
  }
package/src/vode.ts CHANGED
@@ -301,6 +301,7 @@ export function defuse(container: ContainerNode<any>) {
301
301
  (<any>av.node)[key] = null;
302
302
  }
303
303
  }
304
+ (<any>av.node)['catch'] = null;
304
305
  }
305
306
  const kids = children(av);
306
307
  if (kids) {
@@ -542,6 +543,11 @@ function render<S>(state: S, patch: Dispatch<S>, parent: Element, childIndex: nu
542
543
 
543
544
  patchProperties(state, patch, newNode, undefined, properties);
544
545
 
546
+ if (!!properties && 'catch' in properties) {
547
+ (<any>newVode).node['catch'] = null;
548
+ (<any>newVode).node.removeAttribute('catch');
549
+ }
550
+
545
551
  if (oldNode) {
546
552
  (<any>oldNode).onUnmount && patch((<any>oldNode).onUnmount(oldNode));
547
553
  oldNode.replaceWith(newNode);
@@ -573,20 +579,24 @@ function render<S>(state: S, patch: Dispatch<S>, parent: Element, childIndex: nu
573
579
  const newvode = <Vode<S>>newVode;
574
580
  const oldvode = <Vode<S>>oldVode;
575
581
 
576
- let hasProps = false;
582
+ const properties = props(newVode);
583
+ let hasProps = !!properties;
584
+ const oldProps = props(oldVode);
585
+
577
586
  if ((<any>newvode[1])?.__memo) {
578
587
  const prev = newvode[1] as any;
579
588
  newvode[1] = remember(state, newvode[1], oldvode[1]) as Vode<S>;
580
589
  if (prev !== newvode[1]) {
581
- const properties = props(newVode);
582
- patchProperties(state, patch, oldNode!, props(oldVode), properties);
583
- hasProps = !!properties;
590
+ patchProperties(state, patch, oldNode!, oldProps, properties);
584
591
  }
585
592
  }
586
593
  else {
587
- const properties = props(newVode);
588
- patchProperties(state, patch, oldNode!, props(oldVode), properties);
589
- hasProps = !!properties;
594
+ patchProperties(state, patch, oldNode!, oldProps, properties);
595
+ }
596
+
597
+ if (!!properties?.catch && oldProps?.catch !== properties.catch) {
598
+ (<any>newVode).node['catch'] = null;
599
+ (<any>newVode).node.removeAttribute('catch');
590
600
  }
591
601
 
592
602
  const newKids = children(newVode);