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
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,22 @@
1
1
# Changelog
2
+
## 0.17.0 - 2020-03-??
3
+
A lot of consolidation in preparation for release candidate
4
+
* Big refactor of core reactive system and render list reconciler
5
+
* Significantly smaller reducing core by atleast 3kb minified
6
+
* Better handling of nested reactive nodes in Fragments
7
+
* Update SSR mechanisms, added progressive event hydration, created repo for SSR environment (`solid-ssr`)
8
+
*`@once` compiler hint to statically bind values
9
+
* Better wrapping hueristics for booleans and ternaries in JSX
10
+
11
+
Breaking Changes
12
+
* Removed `transform` prop from control flow. Idiomatic approach is to make a HOC for transformations of this nature.
13
+
* Removed selectWhen/selectEach control flow transforms.
14
+
* Changed event system
15
+
*`on____` prop to stop differentiating on case. Super confusing.Instead will try to delegate unless unable. Made TypeScript all CamelCase (although technically both forms behave identically)
16
+
* Removed `model` event delegation approach. Instead to create bound event use array: `onClick={[handler, row.id]}`. Inspired by Inferno's `linkEvent` helper.
17
+
* Renamed `events` prop to `on` prop
18
+
* Added `onCapture` prop for capture events
19
+
2
20
## 0.16.0 - 2020-01-14
3
21
Big changes to experimental features:
4
22
* New resource API `createResource` and `createResourceState` to replace `loadResource`. These are built to prioritize read capabilities and simplify implementation.
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,7 +139,7 @@ The easiest way to get setup is add `babel-preset-solid` to your .babelrc, or ba
139
139
140
140
Remember even though the syntax is almost identical, there are significant differences between how Solid's JSX works and a library like React. Refer to [JSX Rendering](../master/documentation/rendering.md) for more information.
141
141
142
-
Alternatively in non-compiled environments you can use Tagged Template Literals [Lit DOM Expressions](https://github.com/ryansolid/lit-dom-expressions) or even HyperScript with [Hyper DOM Expressions](https://github.com/ryansolid/hyper-dom-expressions).
142
+
Alternatively in non-compiled environments you can use Tagged Template Literals [Lit DOM Expressions](https://github.com/ryansolid/dom-expressions/tree/master/packages/lit-dom-expressions) or even HyperScript with [Hyper DOM Expressions](https://github.com/ryansolid/dom-expressions/tree/master/packages/hyper-dom-expressions).
143
143
144
144
For convenience Solid exports interfaces to runtimes for these as:
145
145
@@ -196,11 +196,11 @@ Remember you still need to install the library separately for these to work.
196
196
Functional Reactive Programming extensions to Solid.js.
Copy file name to clipboardExpand all lines: documentation/rendering.md
+33-9Lines changed: 33 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Rendering involves precompilation of JSX templates into optimized native js code
8
8
9
9
This approach both is more performant and produces less code then creating each element one by one with document.createElement.
10
10
11
-
More documentation is available at: [babel-plugin-jsx-dom-expressions](https://github.com/ryansolid/babel-plugin-jsx-dom-expressions)
11
+
More documentation is available at: [babel-plugin-jsx-dom-expressions](https://github.com/ryansolid/dom-expressions/tree/master/packages/babel-plugin-jsx-dom-expressions)
on**\_** properties get added (addEventListener) as event handlers on the element. Camel Case events will be delegated by default and the second argument will be the model property or (nearest parent's). Use all lowercase for directly bound native events.
35
+
`on_____` handlers are event handlers expecting a function. The compiler will delegate events where possible (Events that can be composed and bubble) else it will fall back to Level 1 spec "on**\_**" events.
36
36
37
-
If you need to use non-lowercase or hyphenated event names use the events binding.
37
+
If you wish to bind a value to your delegated event pass an array handler instead and the second argument will be passed to your event handler as the first argument (the event will be second). This can improve performance in large lists.
This delegation solution works with Web Components and the Shadow DOM as well if the events are composed. That limits the list to custom events and most UA UI events like onClick, onKeyUp, onKeyDown, onDblClick, onInput, onMouseDown, onMouseUp, etc..
48
+
49
+
To allow for casing to work all custom events should follow the all lowercase convention of native events. If you want to use different event convention (or use Level 3 Events "addEventListener") use the "on" or "onCapture" binding.
50
+
51
+
```jsx
52
+
<div on={{ "Weird-Event":e=>alert(e.detail) }} />
53
+
```
38
54
39
55
## Control Flow
40
56
@@ -123,45 +139,53 @@ _Note these are designed to handle more complex scenarios like Component inserti
123
139
Refs come in 2 flavours. `ref` which directly assigns the value, and `forwardRef` which calls a callback `(ref) => void` with the reference. To support forwarded properties on spreads, both `ref` and `forwardRef` are called as functions.
124
140
125
141
### `ref`
142
+
126
143
```jsx
127
144
functionMyComp() {
128
145
let myDiv;
129
146
setTimeout(() =>console.log(myDiv.clientWidth));
130
-
return<div ref={myDiv} />
147
+
return<div ref={myDiv} />;
131
148
}
132
149
```
150
+
133
151
On a native intrinsic element as the element executes the provided variable will be assigned. This form usually is used in combination with `setTimeout` (same timing as React's `useEffect`) or `afterEffects`(same timing as React's `useLayoutEffect`) to do work after the component has mounted. Like do a DOM measurement or attach DOM plugins etc...
134
152
135
153
When applied to a Component it acts similarly but also passes a prop in that is a function that is expected to be called with a ref to forward the ref (more on this in the next section):
154
+
136
155
```jsx
137
156
functionApp() {
138
157
let myDiv;
139
158
setTimeout(() =>console.log(myDiv.clientWidth));
140
-
return<MyComp ref={myDiv} />
159
+
return<MyComp ref={myDiv} />;
141
160
}
142
161
```
143
162
144
163
### `forwardRef`
164
+
145
165
This form expects a function like React's callback refs. Original use case is like described above:
This just passes the function through as `props.ref` again and work similar to the example above except it would run synchronously during render. You can use this to chain as many `forwardRef` up a Component chain as you wish.
164
188
165
189
## Server Side Rendering (Experimental)
166
190
167
-
See [solid-ssr](https://github.com/ryansolid/solid/blob/master/packages/solid-ssr)
191
+
See [solid-ssr](https://github.com/ryansolid/solid/blob/master/packages/solid-ssr)
0 commit comments