solid-js 1.5.0-beta.6 → 1.5.1

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/dist/dev.cjs CHANGED
@@ -147,7 +147,6 @@ const UNOWNED = {
147
147
  owner: null
148
148
  };
149
149
  const NO_INIT = {};
150
- const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
151
150
  var Owner = null;
152
151
  let Transition = null;
153
152
  let Scheduler = null;
@@ -157,6 +156,7 @@ let Updates = null;
157
156
  let Effects = null;
158
157
  let ExecCount = 0;
159
158
  let rootCount = 0;
159
+ const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
160
160
  function createRoot(fn, detachedOwner) {
161
161
  const listener = Listener,
162
162
  owner = Owner,
@@ -272,7 +272,7 @@ function createResource(pSource, pFetcher, pOptions) {
272
272
  if (sharedConfig.context) {
273
273
  id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;
274
274
  let v;
275
- if (options.ssrValue === "initial") initP = options.initialValue;else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v[0];
275
+ if (options.ssrLoadFrom === "initial") initP = options.initialValue;else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v[0];
276
276
  }
277
277
  function loadEnd(p, v, success, key) {
278
278
  if (pr === p) {
@@ -532,7 +532,7 @@ function devComponent(Comp, props) {
532
532
  }
533
533
  function hashValue(v) {
534
534
  const s = new Set();
535
- return `s${typeof v === "string" ? hash(v) : hash(JSON.stringify(v, (k, v) => {
535
+ return `s${typeof v === "string" ? hash(v) : hash(untrack(() => JSON.stringify(v, (k, v) => {
536
536
  if (typeof v === "object" && v != null) {
537
537
  if (s.has(v)) return;
538
538
  s.add(v);
@@ -549,7 +549,7 @@ function hashValue(v) {
549
549
  return `${v.toString()}n`;
550
550
  }
551
551
  return v;
552
- }) || "")}`;
552
+ }) || ""))}`;
553
553
  }
554
554
  function registerGraph(name, value) {
555
555
  let tryName = name;
@@ -871,9 +871,7 @@ function runUserEffects(queue) {
871
871
  if (!e.user) runTop(e);else queue[userLength++] = e;
872
872
  }
873
873
  if (sharedConfig.context) setHydrateContext();
874
- Effects = [];
875
874
  for (i = 0; i < userLength; i++) runTop(queue[i]);
876
- if (Effects.length) runUserEffects(Effects);
877
875
  }
878
876
  function lookUpstream(node, ignore) {
879
877
  const runningTransition = Transition && Transition.running;
package/dist/dev.js CHANGED
@@ -143,7 +143,6 @@ const UNOWNED = {
143
143
  owner: null
144
144
  };
145
145
  const NO_INIT = {};
146
- const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
147
146
  var Owner = null;
148
147
  let Transition = null;
149
148
  let Scheduler = null;
@@ -153,6 +152,7 @@ let Updates = null;
153
152
  let Effects = null;
154
153
  let ExecCount = 0;
155
154
  let rootCount = 0;
155
+ const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
156
156
  function createRoot(fn, detachedOwner) {
157
157
  const listener = Listener,
158
158
  owner = Owner,
@@ -268,7 +268,7 @@ function createResource(pSource, pFetcher, pOptions) {
268
268
  if (sharedConfig.context) {
269
269
  id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;
270
270
  let v;
271
- if (options.ssrValue === "initial") initP = options.initialValue;else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v[0];
271
+ if (options.ssrLoadFrom === "initial") initP = options.initialValue;else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v[0];
272
272
  }
273
273
  function loadEnd(p, v, success, key) {
274
274
  if (pr === p) {
@@ -528,7 +528,7 @@ function devComponent(Comp, props) {
528
528
  }
529
529
  function hashValue(v) {
530
530
  const s = new Set();
531
- return `s${typeof v === "string" ? hash(v) : hash(JSON.stringify(v, (k, v) => {
531
+ return `s${typeof v === "string" ? hash(v) : hash(untrack(() => JSON.stringify(v, (k, v) => {
532
532
  if (typeof v === "object" && v != null) {
533
533
  if (s.has(v)) return;
534
534
  s.add(v);
@@ -545,7 +545,7 @@ function hashValue(v) {
545
545
  return `${v.toString()}n`;
546
546
  }
547
547
  return v;
548
- }) || "")}`;
548
+ }) || ""))}`;
549
549
  }
550
550
  function registerGraph(name, value) {
551
551
  let tryName = name;
@@ -867,9 +867,7 @@ function runUserEffects(queue) {
867
867
  if (!e.user) runTop(e);else queue[userLength++] = e;
868
868
  }
869
869
  if (sharedConfig.context) setHydrateContext();
870
- Effects = [];
871
870
  for (i = 0; i < userLength; i++) runTop(queue[i]);
872
- if (Effects.length) runUserEffects(Effects);
873
871
  }
874
872
  function lookUpstream(node, ignore) {
875
873
  const runningTransition = Transition && Transition.running;
package/dist/server.cjs CHANGED
@@ -399,7 +399,7 @@ function createResource(source, fetcher, options = {}) {
399
399
  let value = options.storage ? options.storage(options.initialValue)[0]() : options.initialValue;
400
400
  let p;
401
401
  let error;
402
- if (sharedConfig.context.async && options.ssrValue !== "initial") {
402
+ if (sharedConfig.context.async && options.ssrLoadFrom !== "initial") {
403
403
  resource = sharedConfig.context.resources[id] || (sharedConfig.context.resources[id] = {});
404
404
  if (resource.ref) {
405
405
  if (!resource.data && !resource.ref[0].loading && !resource.ref[0].error) resource.ref[1].refetch();
@@ -409,7 +409,7 @@ function createResource(source, fetcher, options = {}) {
409
409
  const read = () => {
410
410
  if (error) throw error;
411
411
  if (resourceContext && p) resourceContext.push(p);
412
- const resolved = options.ssrValue !== "initial" && sharedConfig.context.async && "data" in sharedConfig.context.resources[id];
412
+ const resolved = options.ssrLoadFrom !== "initial" && sharedConfig.context.async && "data" in sharedConfig.context.resources[id];
413
413
  if (!resolved && read.loading) {
414
414
  const ctx = useContext(SuspenseContext);
415
415
  if (ctx) {
@@ -472,7 +472,7 @@ function createResource(source, fetcher, options = {}) {
472
472
  p = null;
473
473
  return ctx.resources[id].data;
474
474
  }
475
- if (options.ssrValue !== "initial") load();
475
+ if (options.ssrLoadFrom !== "initial") load();
476
476
  return resource.ref = [read, {
477
477
  refetch: load,
478
478
  mutate: v => value = v
package/dist/server.js CHANGED
@@ -395,7 +395,7 @@ function createResource(source, fetcher, options = {}) {
395
395
  let value = options.storage ? options.storage(options.initialValue)[0]() : options.initialValue;
396
396
  let p;
397
397
  let error;
398
- if (sharedConfig.context.async && options.ssrValue !== "initial") {
398
+ if (sharedConfig.context.async && options.ssrLoadFrom !== "initial") {
399
399
  resource = sharedConfig.context.resources[id] || (sharedConfig.context.resources[id] = {});
400
400
  if (resource.ref) {
401
401
  if (!resource.data && !resource.ref[0].loading && !resource.ref[0].error) resource.ref[1].refetch();
@@ -405,7 +405,7 @@ function createResource(source, fetcher, options = {}) {
405
405
  const read = () => {
406
406
  if (error) throw error;
407
407
  if (resourceContext && p) resourceContext.push(p);
408
- const resolved = options.ssrValue !== "initial" && sharedConfig.context.async && "data" in sharedConfig.context.resources[id];
408
+ const resolved = options.ssrLoadFrom !== "initial" && sharedConfig.context.async && "data" in sharedConfig.context.resources[id];
409
409
  if (!resolved && read.loading) {
410
410
  const ctx = useContext(SuspenseContext);
411
411
  if (ctx) {
@@ -468,7 +468,7 @@ function createResource(source, fetcher, options = {}) {
468
468
  p = null;
469
469
  return ctx.resources[id].data;
470
470
  }
471
- if (options.ssrValue !== "initial") load();
471
+ if (options.ssrLoadFrom !== "initial") load();
472
472
  return resource.ref = [read, {
473
473
  refetch: load,
474
474
  mutate: v => value = v
package/dist/solid.cjs CHANGED
@@ -147,7 +147,6 @@ const UNOWNED = {
147
147
  owner: null
148
148
  };
149
149
  const NO_INIT = {};
150
- const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
151
150
  var Owner = null;
152
151
  let Transition = null;
153
152
  let Scheduler = null;
@@ -156,6 +155,7 @@ let Listener = null;
156
155
  let Updates = null;
157
156
  let Effects = null;
158
157
  let ExecCount = 0;
158
+ const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
159
159
  function createRoot(fn, detachedOwner) {
160
160
  const listener = Listener,
161
161
  owner = Owner,
@@ -264,7 +264,7 @@ function createResource(pSource, pFetcher, pOptions) {
264
264
  if (sharedConfig.context) {
265
265
  id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;
266
266
  let v;
267
- if (options.ssrValue === "initial") initP = options.initialValue;else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v[0];
267
+ if (options.ssrLoadFrom === "initial") initP = options.initialValue;else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v[0];
268
268
  }
269
269
  function loadEnd(p, v, success, key) {
270
270
  if (pr === p) {
@@ -810,9 +810,7 @@ function runUserEffects(queue) {
810
810
  if (!e.user) runTop(e);else queue[userLength++] = e;
811
811
  }
812
812
  if (sharedConfig.context) setHydrateContext();
813
- Effects = [];
814
813
  for (i = 0; i < userLength; i++) runTop(queue[i]);
815
- if (Effects.length) runUserEffects(Effects);
816
814
  }
817
815
  function lookUpstream(node, ignore) {
818
816
  const runningTransition = Transition && Transition.running;
package/dist/solid.js CHANGED
@@ -143,7 +143,6 @@ const UNOWNED = {
143
143
  owner: null
144
144
  };
145
145
  const NO_INIT = {};
146
- const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
147
146
  var Owner = null;
148
147
  let Transition = null;
149
148
  let Scheduler = null;
@@ -152,6 +151,7 @@ let Listener = null;
152
151
  let Updates = null;
153
152
  let Effects = null;
154
153
  let ExecCount = 0;
154
+ const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
155
155
  function createRoot(fn, detachedOwner) {
156
156
  const listener = Listener,
157
157
  owner = Owner,
@@ -260,7 +260,7 @@ function createResource(pSource, pFetcher, pOptions) {
260
260
  if (sharedConfig.context) {
261
261
  id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;
262
262
  let v;
263
- if (options.ssrValue === "initial") initP = options.initialValue;else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v[0];
263
+ if (options.ssrLoadFrom === "initial") initP = options.initialValue;else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v[0];
264
264
  }
265
265
  function loadEnd(p, v, success, key) {
266
266
  if (pr === p) {
@@ -806,9 +806,7 @@ function runUserEffects(queue) {
806
806
  if (!e.user) runTop(e);else queue[userLength++] = e;
807
807
  }
808
808
  if (sharedConfig.context) setHydrateContext();
809
- Effects = [];
810
809
  for (i = 0; i < userLength; i++) runTop(queue[i]);
811
- if (Effects.length) runUserEffects(Effects);
812
810
  }
813
811
  function lookUpstream(node, ignore) {
814
812
  const runningTransition = Transition && Transition.running;
@@ -0,0 +1 @@
1
+ export * from "./types/jsx";
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.5.0-beta.6",
4
+ "version": "1.5.1",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "homepage": "https://solidjs.com",
@@ -197,6 +197,9 @@
197
197
  "compiler",
198
198
  "performance"
199
199
  ],
200
+ "dependencies": {
201
+ "csstype": "^3.1.0"
202
+ },
200
203
  "scripts": {
201
204
  "build": "npm-run-all -nl build:*",
202
205
  "build:clean": "rimraf dist/ coverage/ store/dist/ web/dist/ h/dist/ h/jsx-runtime/dist html/dist/",
package/types/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { createRoot, createSignal, createEffect, createRenderEffect, createComputed, createReaction, createDeferred, createSelector, createMemo, createResource, onMount, onCleanup, onError, untrack, batch, on, enableScheduling, enableExternalSource, startTransition, useTransition, createContext, useContext, children, getListener, getOwner, runWithOwner, equalFn, $DEVCOMP, $PROXY, $TRACK } from "./reactive/signal.js";
2
- export type { Accessor, Setter, Signal, Resource, ResourceOptions, ResourceReturn, ResourceFetcher, ResourceFetcherInfo, ChildrenReturn, Context, ReturnTypes, Owner, InitializedResource, InitializedResourceOptions, InitializedResourceReturn } from "./reactive/signal.js";
2
+ export type { Accessor, Setter, Signal, Resource, ResourceActions, ResourceSource, ResourceOptions, ResourceReturn, ResourceFetcher, ResourceFetcherInfo, ChildrenReturn, Context, ReturnTypes, Owner, InitializedResource, InitializedResourceOptions, InitializedResourceReturn } 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";
package/types/jsx.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as csstype from 'csstype';
1
+ import * as csstype from 'csstype/index.js';
2
2
 
3
3
  /**
4
4
  * Based on JSX types for Surplus and Inferno and adapted for `dom-expressions`.
@@ -247,7 +247,7 @@ export declare type ResourceOptions<T, S = unknown> = {
247
247
  initialValue?: T;
248
248
  name?: string;
249
249
  deferStream?: boolean;
250
- ssrValue?: "initial" | "server";
250
+ ssrLoadFrom?: "initial" | "server";
251
251
  storage?: (init: T | undefined) => [Accessor<T | undefined>, Setter<T | undefined>];
252
252
  onHydrated?: (k: S | undefined, info: {
253
253
  value: T | undefined;
@@ -100,14 +100,14 @@ export declare type ResourceOptions<T> = undefined extends T ? {
100
100
  initialValue?: T;
101
101
  name?: string;
102
102
  deferStream?: boolean;
103
- ssrValue?: "initial" | "server";
103
+ ssrLoadFrom?: "initial" | "server";
104
104
  storage?: () => Signal<T | undefined>;
105
105
  onHydrated?: <S, T>(k: S, info: ResourceFetcherInfo<T>) => void;
106
106
  } : {
107
107
  initialValue: T;
108
108
  name?: string;
109
109
  deferStream?: boolean;
110
- ssrValue?: "initial" | "server";
110
+ ssrLoadFrom?: "initial" | "server";
111
111
  storage?: (v?: T) => Signal<T | undefined>;
112
112
  onHydrated?: <S, T>(k: S, info: ResourceFetcherInfo<T>) => void;
113
113
  };