solid-js 1.9.7 → 1.9.9

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,7 +1,7 @@
1
1
  {
2
2
  "name": "solid-js",
3
3
  "description": "A declarative JavaScript library for building user interfaces.",
4
- "version": "1.9.7",
4
+ "version": "1.9.9",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "homepage": "https://solidjs.com",
@@ -284,9 +284,13 @@ function wrap(value) {
284
284
  const proto = Object.getPrototypeOf(value);
285
285
  const isClass = proto !== null && value !== null && typeof value === "object" && !Array.isArray(value) && proto !== Object.prototype;
286
286
  if (isClass) {
287
- const descriptors = Object.getOwnPropertyDescriptors(proto);
288
- keys.push(...Object.keys(descriptors));
289
- Object.assign(desc, descriptors);
287
+ let curProto = proto;
288
+ while (curProto != null) {
289
+ const descriptors = Object.getOwnPropertyDescriptors(curProto);
290
+ keys.push(...Object.keys(descriptors));
291
+ Object.assign(desc, descriptors);
292
+ curProto = Object.getPrototypeOf(curProto);
293
+ }
290
294
  }
291
295
  for (let i = 0, l = keys.length; i < l; i++) {
292
296
  const prop = keys[i];
@@ -336,12 +340,12 @@ function applyState(target, parent, property, merge, key) {
336
340
  if (isArray) {
337
341
  if (target.length && previous.length && (!merge || key && target[0] && target[0][key] != null)) {
338
342
  let i, j, start, end, newEnd, item, newIndicesNext, keyVal;
339
- for (start = 0, end = Math.min(previous.length, target.length); start < end && (previous[start] === target[start] || key && previous[start] && target[start] && previous[start][key] === target[start][key]); start++) {
343
+ for (start = 0, end = Math.min(previous.length, target.length); start < end && (previous[start] === target[start] || key && previous[start] && target[start] && previous[start][key] && previous[start][key] === target[start][key]); start++) {
340
344
  applyState(target[start], previous, start, merge, key);
341
345
  }
342
346
  const temp = new Array(target.length),
343
347
  newIndices = new Map();
344
- for (end = previous.length - 1, newEnd = target.length - 1; end >= start && newEnd >= start && (previous[end] === target[newEnd] || key && previous[end] && target[newEnd] && previous[end][key] === target[newEnd][key]); end--, newEnd--) {
348
+ for (end = previous.length - 1, newEnd = target.length - 1; end >= start && newEnd >= start && (previous[end] === target[newEnd] || key && previous[end] && target[newEnd] && previous[end][key] && previous[end][key] === target[newEnd][key]); end--, newEnd--) {
345
349
  temp[newEnd] = previous[end];
346
350
  }
347
351
  if (start > newEnd || start > end) {
package/store/dist/dev.js CHANGED
@@ -282,9 +282,13 @@ function wrap(value) {
282
282
  const proto = Object.getPrototypeOf(value);
283
283
  const isClass = proto !== null && value !== null && typeof value === "object" && !Array.isArray(value) && proto !== Object.prototype;
284
284
  if (isClass) {
285
- const descriptors = Object.getOwnPropertyDescriptors(proto);
286
- keys.push(...Object.keys(descriptors));
287
- Object.assign(desc, descriptors);
285
+ let curProto = proto;
286
+ while (curProto != null) {
287
+ const descriptors = Object.getOwnPropertyDescriptors(curProto);
288
+ keys.push(...Object.keys(descriptors));
289
+ Object.assign(desc, descriptors);
290
+ curProto = Object.getPrototypeOf(curProto);
291
+ }
288
292
  }
289
293
  for (let i = 0, l = keys.length; i < l; i++) {
290
294
  const prop = keys[i];
@@ -334,12 +338,12 @@ function applyState(target, parent, property, merge, key) {
334
338
  if (isArray) {
335
339
  if (target.length && previous.length && (!merge || key && target[0] && target[0][key] != null)) {
336
340
  let i, j, start, end, newEnd, item, newIndicesNext, keyVal;
337
- for (start = 0, end = Math.min(previous.length, target.length); start < end && (previous[start] === target[start] || key && previous[start] && target[start] && previous[start][key] === target[start][key]); start++) {
341
+ for (start = 0, end = Math.min(previous.length, target.length); start < end && (previous[start] === target[start] || key && previous[start] && target[start] && previous[start][key] && previous[start][key] === target[start][key]); start++) {
338
342
  applyState(target[start], previous, start, merge, key);
339
343
  }
340
344
  const temp = new Array(target.length),
341
345
  newIndices = new Map();
342
- for (end = previous.length - 1, newEnd = target.length - 1; end >= start && newEnd >= start && (previous[end] === target[newEnd] || key && previous[end] && target[newEnd] && previous[end][key] === target[newEnd][key]); end--, newEnd--) {
346
+ for (end = previous.length - 1, newEnd = target.length - 1; end >= start && newEnd >= start && (previous[end] === target[newEnd] || key && previous[end] && target[newEnd] && previous[end][key] && previous[end][key] === target[newEnd][key]); end--, newEnd--) {
343
347
  temp[newEnd] = previous[end];
344
348
  }
345
349
  if (start > newEnd || start > end) {
@@ -273,9 +273,13 @@ function wrap(value) {
273
273
  const proto = Object.getPrototypeOf(value);
274
274
  const isClass = proto !== null && value !== null && typeof value === "object" && !Array.isArray(value) && proto !== Object.prototype;
275
275
  if (isClass) {
276
- const descriptors = Object.getOwnPropertyDescriptors(proto);
277
- keys.push(...Object.keys(descriptors));
278
- Object.assign(desc, descriptors);
276
+ let curProto = proto;
277
+ while (curProto != null) {
278
+ const descriptors = Object.getOwnPropertyDescriptors(curProto);
279
+ keys.push(...Object.keys(descriptors));
280
+ Object.assign(desc, descriptors);
281
+ curProto = Object.getPrototypeOf(curProto);
282
+ }
279
283
  }
280
284
  for (let i = 0, l = keys.length; i < l; i++) {
281
285
  const prop = keys[i];
@@ -320,12 +324,12 @@ function applyState(target, parent, property, merge, key) {
320
324
  if (isArray) {
321
325
  if (target.length && previous.length && (!merge || key && target[0] && target[0][key] != null)) {
322
326
  let i, j, start, end, newEnd, item, newIndicesNext, keyVal;
323
- for (start = 0, end = Math.min(previous.length, target.length); start < end && (previous[start] === target[start] || key && previous[start] && target[start] && previous[start][key] === target[start][key]); start++) {
327
+ for (start = 0, end = Math.min(previous.length, target.length); start < end && (previous[start] === target[start] || key && previous[start] && target[start] && previous[start][key] && previous[start][key] === target[start][key]); start++) {
324
328
  applyState(target[start], previous, start, merge, key);
325
329
  }
326
330
  const temp = new Array(target.length),
327
331
  newIndices = new Map();
328
- for (end = previous.length - 1, newEnd = target.length - 1; end >= start && newEnd >= start && (previous[end] === target[newEnd] || key && previous[end] && target[newEnd] && previous[end][key] === target[newEnd][key]); end--, newEnd--) {
332
+ for (end = previous.length - 1, newEnd = target.length - 1; end >= start && newEnd >= start && (previous[end] === target[newEnd] || key && previous[end] && target[newEnd] && previous[end][key] && previous[end][key] === target[newEnd][key]); end--, newEnd--) {
329
333
  temp[newEnd] = previous[end];
330
334
  }
331
335
  if (start > newEnd || start > end) {
@@ -271,9 +271,13 @@ function wrap(value) {
271
271
  const proto = Object.getPrototypeOf(value);
272
272
  const isClass = proto !== null && value !== null && typeof value === "object" && !Array.isArray(value) && proto !== Object.prototype;
273
273
  if (isClass) {
274
- const descriptors = Object.getOwnPropertyDescriptors(proto);
275
- keys.push(...Object.keys(descriptors));
276
- Object.assign(desc, descriptors);
274
+ let curProto = proto;
275
+ while (curProto != null) {
276
+ const descriptors = Object.getOwnPropertyDescriptors(curProto);
277
+ keys.push(...Object.keys(descriptors));
278
+ Object.assign(desc, descriptors);
279
+ curProto = Object.getPrototypeOf(curProto);
280
+ }
277
281
  }
278
282
  for (let i = 0, l = keys.length; i < l; i++) {
279
283
  const prop = keys[i];
@@ -318,12 +322,12 @@ function applyState(target, parent, property, merge, key) {
318
322
  if (isArray) {
319
323
  if (target.length && previous.length && (!merge || key && target[0] && target[0][key] != null)) {
320
324
  let i, j, start, end, newEnd, item, newIndicesNext, keyVal;
321
- for (start = 0, end = Math.min(previous.length, target.length); start < end && (previous[start] === target[start] || key && previous[start] && target[start] && previous[start][key] === target[start][key]); start++) {
325
+ for (start = 0, end = Math.min(previous.length, target.length); start < end && (previous[start] === target[start] || key && previous[start] && target[start] && previous[start][key] && previous[start][key] === target[start][key]); start++) {
322
326
  applyState(target[start], previous, start, merge, key);
323
327
  }
324
328
  const temp = new Array(target.length),
325
329
  newIndices = new Map();
326
- for (end = previous.length - 1, newEnd = target.length - 1; end >= start && newEnd >= start && (previous[end] === target[newEnd] || key && previous[end] && target[newEnd] && previous[end][key] === target[newEnd][key]); end--, newEnd--) {
330
+ for (end = previous.length - 1, newEnd = target.length - 1; end >= start && newEnd >= start && (previous[end] === target[newEnd] || key && previous[end] && target[newEnd] && previous[end][key] && previous[end][key] === target[newEnd][key]); end--, newEnd--) {
327
331
  temp[newEnd] = previous[end];
328
332
  }
329
333
  if (start > newEnd || start > end) {
package/types/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { $DEVCOMP, $PROXY, $TRACK, batch, catchError, children, createComputed, createContext, createDeferred, createEffect, createMemo, createReaction, createRenderEffect, createResource, createRoot, createSelector, createSignal, enableExternalSource, enableScheduling, equalFn, getListener, getOwner, on, onCleanup, onError, onMount, runWithOwner, startTransition, untrack, useContext, useTransition } from "./reactive/signal.js";
2
- export type { Accessor, AccessorArray, ChildrenReturn, Context, ContextProviderComponent, EffectFunction, EffectOptions, InitializedResource, InitializedResourceOptions, InitializedResourceReturn, MemoOptions, NoInfer, OnEffectFunction, OnOptions, Owner, ResolvedChildren, ResolvedJSXElement, Resource, ResourceActions, ResourceFetcher, ResourceFetcherInfo, ResourceOptions, ResourceReturn, ResourceSource, ReturnTypes, Setter, Signal, SignalOptions } from "./reactive/signal.js";
2
+ export type { Accessor, AccessorArray, ChildrenReturn, Context, ContextProviderComponent, EffectFunction, EffectOptions, InitializedResource, InitializedResourceOptions, InitializedResourceReturn, MemoOptions, NoInfer, OnEffectFunction, OnOptions, Owner, ResolvedChildren, ResolvedJSXElement, Resource, ResourceActions, ResourceFetcher, ResourceFetcherInfo, ResourceOptions, ResourceReturn, ResourceSource, ReturnTypes, Setter, Signal, SignalOptions, Transition } from "./reactive/signal.js";
3
3
  export * from "./reactive/observable.js";
4
4
  export * from "./reactive/scheduler.js";
5
5
  export * from "./reactive/array.js";