@solidjs/universal 2.0.0-experimental.0 → 2.0.0-experimental.3

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2016-2023 Ryan Carniato
3
+ Copyright (c) 2016-2025 Ryan Carniato
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/dev.cjs CHANGED
@@ -64,7 +64,7 @@ function createRenderer({
64
64
  doNotUnwrap
65
65
  });
66
66
  if (doNotUnwrap && typeof value === "function") return value;
67
- if (multi && value != null && !Array.isArray(value)) value = [value];
67
+ if (multi && !Array.isArray(value)) value = [value != null ? value : ""];
68
68
  if (Array.isArray(value)) {
69
69
  for (let i = 0, len = value.length; i < len; i++) {
70
70
  const item = value[i],
package/dist/dev.js CHANGED
@@ -75,7 +75,7 @@ function createRenderer({
75
75
  doNotUnwrap
76
76
  });
77
77
  if (doNotUnwrap && typeof value === "function") return value;
78
- if (multi && value != null && !Array.isArray(value)) value = [value];
78
+ if (multi && !Array.isArray(value)) value = [value != null ? value : ""];
79
79
  if (Array.isArray(value)) {
80
80
  for (let i = 0, len = value.length; i < len; i++) {
81
81
  const item = value[i],
@@ -64,7 +64,7 @@ function createRenderer({
64
64
  doNotUnwrap
65
65
  });
66
66
  if (doNotUnwrap && typeof value === "function") return value;
67
- if (multi && value != null && !Array.isArray(value)) value = [value];
67
+ if (multi && !Array.isArray(value)) value = [value != null ? value : ""];
68
68
  if (Array.isArray(value)) {
69
69
  for (let i = 0, len = value.length; i < len; i++) {
70
70
  const item = value[i],
package/dist/universal.js CHANGED
@@ -75,7 +75,7 @@ function createRenderer({
75
75
  doNotUnwrap
76
76
  });
77
77
  if (doNotUnwrap && typeof value === "function") return value;
78
- if (multi && value != null && !Array.isArray(value)) value = [value];
78
+ if (multi && !Array.isArray(value)) value = [value != null ? value : ""];
79
79
  if (Array.isArray(value)) {
80
80
  for (let i = 0, len = value.length; i < len; i++) {
81
81
  const item = value[i],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@solidjs/universal",
3
3
  "description": "Solid's universal runtime for creating custom renderers",
4
- "version": "2.0.0-experimental.0",
4
+ "version": "2.0.0-experimental.3",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "homepage": "https://solidjs.com",
@@ -37,10 +37,10 @@
37
37
  "./types/*": "./types/*"
38
38
  },
39
39
  "peerDependencies": {
40
- "solid-js": "^2.0.0-experimental.0"
40
+ "solid-js": "^2.0.0-experimental.3"
41
41
  },
42
42
  "devDependencies": {
43
- "solid-js": "2.0.0-experimental.0"
43
+ "solid-js": "2.0.0-experimental.3"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "npm-run-all -nl build:*",
package/types/index.d.ts DELETED
@@ -1,29 +0,0 @@
1
- export interface RendererOptions<NodeType> {
2
- createElement(tag: string): NodeType;
3
- createTextNode(value: string): NodeType;
4
- replaceText(textNode: NodeType, value: string): void;
5
- isTextNode(node: NodeType): boolean;
6
- setProperty<T>(node: NodeType, name: string, value: T, prev?: T): void;
7
- insertNode(parent: NodeType, node: NodeType, anchor?: NodeType): void;
8
- removeNode(parent: NodeType, node: NodeType): void;
9
- getParentNode(node: NodeType): NodeType | undefined;
10
- getFirstChild(node: NodeType): NodeType | undefined;
11
- getNextSibling(node: NodeType): NodeType | undefined;
12
- }
13
-
14
- export interface Renderer<NodeType> {
15
- render(code: () => NodeType, node: NodeType): () => void;
16
- effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void, init?: T): void;
17
- memo<T>(fn: () => T, equal: boolean): () => T;
18
- createComponent<T>(Comp: (props: T) => NodeType, props: T): NodeType;
19
- createElement(tag: string): NodeType;
20
- createTextNode(value: string): NodeType;
21
- insertNode(parent: NodeType, node: NodeType, anchor?: NodeType): void;
22
- insert<T>(parent: any, accessor: (() => T) | T, marker?: any | null): NodeType;
23
- spread<T>(node: any, accessor: (() => T) | T, skipChildren?: Boolean): void;
24
- setProp<T>(node: NodeType, name: string, value: T, prev?: T): T;
25
- mergeProps(...sources: unknown[]): unknown;
26
- use<A, T>(fn: (element: NodeType, arg: A) => T, element: NodeType, arg: A): T;
27
- }
28
-
29
- export function createRenderer<NodeType>(options: RendererOptions<NodeType>): Renderer<NodeType>;