solid-js 1.5.0-beta.6 → 1.5.0-beta.7
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 +1 -1
- package/dist/dev.js +1 -1
- package/dist/server.cjs +3 -3
- package/dist/server.js +3 -3
- package/dist/solid.cjs +1 -1
- package/dist/solid.js +1 -1
- package/jsx-runtime.d.ts +1 -0
- package/package.json +4 -1
- package/types/index.d.ts +1 -1
- package/types/jsx.d.ts +1 -1
- package/types/reactive/signal.d.ts +1 -1
- package/types/server/rendering.d.ts +2 -2
package/dist/dev.cjs
CHANGED
|
@@ -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.
|
|
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) {
|
package/dist/dev.js
CHANGED
|
@@ -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.
|
|
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) {
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
@@ -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.
|
|
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) {
|
package/dist/solid.js
CHANGED
|
@@ -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.
|
|
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) {
|
package/jsx-runtime.d.ts
ADDED
|
@@ -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.
|
|
4
|
+
"version": "1.5.0-beta.7",
|
|
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
|
@@ -247,7 +247,7 @@ export declare type ResourceOptions<T, S = unknown> = {
|
|
|
247
247
|
initialValue?: T;
|
|
248
248
|
name?: string;
|
|
249
249
|
deferStream?: boolean;
|
|
250
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
};
|