You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+47-24Lines changed: 47 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Changelog
2
2
3
-
## 1.1.0
3
+
## 1.1.0 - 2021-08-09
4
4
5
5
Expanding Solid's concurrency to include scheduling. Bug fixes around Types and around reactive execution order guarantees.
6
6
@@ -9,50 +9,66 @@ Expanding Solid's concurrency to include scheduling. Bug fixes around Types and
9
9
### `createUniqueId`
10
10
11
11
A universal id generator that works across server/browser.
12
+
12
13
```js
13
14
constid=createUniqueId();
14
15
```
16
+
15
17
> **Note** on the server this only works under hydratable components
16
18
17
19
### `from`
18
20
19
21
A simple helper to make it easier to interopt with external producers like RxJS observables or with Svelte Stores. This basically turns any subscribable (object with a `subscribe` method) into a Signal and manages subscription and disposal.
20
22
21
23
```js
22
-
constsignal=from(obsv$)
24
+
constsignal=from(obsv$);
23
25
```
24
26
25
27
It can also take a custom producer function where the function is passed a setter function returns a unsubscribe function:
28
+
26
29
```js
27
-
constclock=from((set)=> {
28
-
constt=setInterval(() =>set(1), 1000)
30
+
constclock=from(set=> {
31
+
constt=setInterval(() =>set(1), 1000);
29
32
return () =>clearIntercal(t);
30
-
})
33
+
});
31
34
```
32
35
33
36
> Note: Signals created by `from` have equality checks turned off to interface better with external streams and sources.
37
+
34
38
### `enableScheduling` (experimental)
35
39
36
40
By default Solid's concurrent rendering/Transitions doesn't schedule work differently and just runs synchronously. It's purpose is to smooth out IO situations like Navigation. However now you can opt into similar to React's behavior by calling this once at your programs entry. I've yet to see a realworld scenario where this makes a big difference but now we can do cool demos too and start testing it.
41
+
37
42
#### `startTransition`
38
43
39
44
Works like it's counterpart in `useTransition`, this useful when you don't need pending state.
40
45
41
-
## 1.0.0
46
+
```js
47
+
import { startTransition } from"solid-js";
48
+
49
+
functionclickHandler(e) {
50
+
startTransition(() =>setSignal("Holla"));
51
+
}
52
+
```
53
+
54
+
## 1.0.0 - 2021-06-27
42
55
43
56
### Breaking Changes
44
57
45
58
### setSignal now supports function form
46
59
47
60
While that in itself is a great new feature as you can do:
61
+
48
62
```js
49
63
const [count, setCount] =createSignal(0);
50
64
51
65
setCount(c=> c +1);
52
66
```
67
+
53
68
This promotes immutable patterns, let's you access the previous value without it being tracked, and makes Signals consistent with State.
54
69
55
70
It means that when functions are stored in signals you need to use this form to remove ambiguity
@@ -122,14 +138,13 @@ export function createResource<T, U>(
122
138
3rd argument is now an options object instead of just the initial value. This breaking. But this also allows the first argument to be optional for the non-tracking case. Need a promise that only loads once? Don't have need to re-use the fetcher. Do this:
Types added for Namespace attributes. You probably won't need most of these because they are for more advanced usage. However to use them you need to extend the JSX Namespace:
147
163
148
164
```ts
149
165
declaremodule"solid-js" {
150
166
namespaceJSX {
151
-
interfaceDirectives {// use:____
152
-
167
+
interfaceDirectives {
168
+
// use:____
153
169
}
154
-
interfaceExplicitProperties {// prop:____
155
-
170
+
interfaceExplicitProperties {
171
+
// prop:____
156
172
}
157
-
interfaceExplicitAttributes {// attr:____
158
-
173
+
interfaceExplicitAttributes {
174
+
// attr:____
159
175
}
160
-
interfaceCustomEvents {// on:____
161
-
176
+
interfaceCustomEvents {
177
+
// on:____
162
178
}
163
-
interfaceCustomCaptureEvents {// oncapture:____
164
-
179
+
interfaceCustomCaptureEvents {
180
+
// oncapture:____
165
181
}
166
182
}
167
183
}
168
184
```
169
185
170
186
#### Lazy component preload
187
+
171
188
Lazy components now have a preload function so you can pre-emptively load them.
189
+
172
190
```js
173
-
constLazyComp=lazy(() =>import("./some-comp"))
191
+
constLazyComp=lazy(() =>import("./some-comp"));
174
192
175
193
// load ahead of time
176
194
LazyComp.preload();
177
195
```
178
196
179
197
#### Error Boundary reset
198
+
180
199
Error boundaries now have the ability to reset themselves and try again. It is the second argument to the fallback.
0 commit comments