-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from developit/render-ut-fixes-update1
Add support for features from Preact render tests
- Loading branch information
Showing
7 changed files
with
390 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Changelog | ||
|
||
## Differences from Preact | ||
|
||
### Major changes | ||
|
||
1. `h` has been renamed to `createElement` | ||
2. The VNode shape has changed | ||
1. The children of a VNode are no longer normalized `h` and could be a nested array of children. | ||
2. `attributes` has been renamed to `props` | ||
3. `nodeName` is now `tag` | ||
4. `children` is now only stored as a property on `props`: `props.children` | ||
3. `render` no longer returns the newly created DOM element. Its return type is now `void` | ||
4. Use the new `hydrate` to function to hydrate a server rendered DOM tree | ||
5. Setting the DOM `style` attribute to a string is not supported | ||
6. `setState` no longer modifies `this.state` synchronously | ||
7. Falsy attributes values are no longer removed from the DOM. For some attributes (e.g. `spellcheck`, | ||
the values `false` and `''` have different meaning so being able to render `false` is important. | ||
|
||
### Minor changes | ||
|
||
1. `addEventListener` and `removeEventListner` are called everytime an event handler is changed | ||
2. `render(null, container)` no longer renders an empty text node but instead renders nothing | ||
|
||
### For contributors | ||
|
||
1. `scratch.innerHTML = ''` no longer is an effective technique to clear the DOM during testing. If you thin you need to | ||
clear the DOM during a test, consider breaking your tests into multiple individual tests to cover your function. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.