Skip to content

Commit 5b13f4a

Browse files
committed
Small tweaks to changelog
1 parent 865642f commit 5b13f4a

File tree

1 file changed

+47
-24
lines changed

1 file changed

+47
-24
lines changed

CHANGELOG.md

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## 1.1.0
3+
## 1.1.0 - 2021-08-09
44

55
Expanding Solid's concurrency to include scheduling. Bug fixes around Types and around reactive execution order guarantees.
66

@@ -9,50 +9,66 @@ Expanding Solid's concurrency to include scheduling. Bug fixes around Types and
99
### `createUniqueId`
1010

1111
A universal id generator that works across server/browser.
12+
1213
```js
1314
const id = createUniqueId();
1415
```
16+
1517
> **Note** on the server this only works under hydratable components
1618
1719
### `from`
1820

1921
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.
2022

2123
```js
22-
const signal = from(obsv$)
24+
const signal = from(obsv$);
2325
```
2426

2527
It can also take a custom producer function where the function is passed a setter function returns a unsubscribe function:
28+
2629
```js
27-
const clock = from((set) => {
28-
const t = setInterval(() => set(1), 1000)
30+
const clock = from(set => {
31+
const t = setInterval(() => set(1), 1000);
2932
return () => clearIntercal(t);
30-
})
33+
});
3134
```
3235

3336
> Note: Signals created by `from` have equality checks turned off to interface better with external streams and sources.
37+
3438
### `enableScheduling` (experimental)
3539

3640
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+
3742
#### `startTransition`
3843

3944
Works like it's counterpart in `useTransition`, this useful when you don't need pending state.
4045

41-
## 1.0.0
46+
```js
47+
import { startTransition } from "solid-js";
48+
49+
function clickHandler(e) {
50+
startTransition(() => setSignal("Holla"));
51+
}
52+
```
53+
54+
## 1.0.0 - 2021-06-27
4255

4356
### Breaking Changes
4457

4558
### setSignal now supports function form
4659

4760
While that in itself is a great new feature as you can do:
61+
4862
```js
4963
const [count, setCount] = createSignal(0);
5064

5165
setCount(c => c + 1);
5266
```
67+
5368
This promotes immutable patterns, let's you access the previous value without it being tracked, and makes Signals consistent with State.
5469

5570
It means that when functions are stored in signals you need to use this form to remove ambiguity
71+
5672
```js
5773
const [count, setCount] = createSignal(ComponentA);
5874

@@ -122,14 +138,13 @@ export function createResource<T, U>(
122138
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:
123139

124140
```js
125-
const [data] = createResource(
126-
async () => (await fetch(`https://someapi.com/info`)).json()
127-
);
141+
const [data] = createResource(async () => (await fetch(`https://someapi.com/info`)).json());
128142
```
129143

130144
#### on/onCapture
131145

132146
These are an escape hatch for unusual events. Previously these were custom attributes but now they are namespaced like:
147+
133148
```jsx
134149
<div on:someUnusualEvent={e => console.log(e.target)} />
135150
```
@@ -143,47 +158,55 @@ https://github.com/solidjs/solid-jest
143158
### New Features
144159

145160
#### Namespace Types
161+
146162
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:
147163

148164
```ts
149165
declare module "solid-js" {
150166
namespace JSX {
151-
interface Directives { // use:____
152-
167+
interface Directives {
168+
// use:____
153169
}
154-
interface ExplicitProperties { // prop:____
155-
170+
interface ExplicitProperties {
171+
// prop:____
156172
}
157-
interface ExplicitAttributes { // attr:____
158-
173+
interface ExplicitAttributes {
174+
// attr:____
159175
}
160-
interface CustomEvents { // on:____
161-
176+
interface CustomEvents {
177+
// on:____
162178
}
163-
interface CustomCaptureEvents { // oncapture:____
164-
179+
interface CustomCaptureEvents {
180+
// oncapture:____
165181
}
166182
}
167183
}
168184
```
169185

170186
#### Lazy component preload
187+
171188
Lazy components now have a preload function so you can pre-emptively load them.
189+
172190
```js
173-
const LazyComp = lazy(() => import("./some-comp"))
191+
const LazyComp = lazy(() => import("./some-comp"));
174192

175193
// load ahead of time
176194
LazyComp.preload();
177195
```
178196

179197
#### Error Boundary reset
198+
180199
Error boundaries now have the ability to reset themselves and try again. It is the second argument to the fallback.
181200

182201
```js
183-
<ErrorBoundary fallback={(err, reset) => {
184-
if (count++ < 3) return reset();
185-
return "Failure";
186-
}}><Component /></ErrorBoundary>
202+
<ErrorBoundary
203+
fallback={(err, reset) => {
204+
if (count++ < 3) return reset();
205+
return "Failure";
206+
}}
207+
>
208+
<Component />
209+
</ErrorBoundary>
187210
```
188211

189212
## 0.24.0 - 2021-02-03

0 commit comments

Comments
 (0)