Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge ceviche repo 🎉 #1302

Merged
merged 981 commits into from
Mar 4, 2019
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
981 commits
Select commit Hold shift + click to select a range
a37e20c
Merge pull request #205 from developit/create-context-type
marvinhagemeister Jan 31, 2019
19bf0b7
Skip failing createContext tests
marvinhagemeister Jan 31, 2019
50ee2b7
Enable fragment DOM logs & improve sibling array children test
andrewiggins Jan 31, 2019
ba2ca59
Add test for components that conditionally return Fragments
andrewiggins Jan 31, 2019
e7d7989
Determine first childDom inside diffChildren (-10 B)
andrewiggins Jan 31, 2019
09ffff9
WIP: Add `_wrapsFragment` comparison
andrewiggins Jan 31, 2019
582b358
Simplify _lastDomChild tracking (+0 B)
andrewiggins Jan 31, 2019
935a300
Remove parentVNode tracking from `diff` (-16 B)
andrewiggins Jan 31, 2019
8ff7cb9
Pass parent vnodes into diffChildren instead of children arrays (-16 B)
andrewiggins Jan 31, 2019
67967d5
Combine hydrate and render to both call diffChildren (-27 B)
andrewiggins Jan 31, 2019
86c96df
Remove diff "append" parameter and inline append code in the only pla…
andrewiggins Jan 31, 2019
b257110
Merge remote-tracking branch 'origin/create-context' into create-cont…
ForsakenHarmony Feb 1, 2019
9e34da5
fix eslint
ForsakenHarmony Feb 1, 2019
9c6c1e0
Merge pull request #204 from developit/create-context-nested
ForsakenHarmony Feb 1, 2019
ddb5612
don't put the whole component into context
ForsakenHarmony Feb 1, 2019
c1c8191
enable tests again
ForsakenHarmony Feb 1, 2019
9e06a55
Merge remote-tracking branch 'origin/master' into create-context
ForsakenHarmony Feb 1, 2019
014f033
Update isRoot check for wrapped Fragment
marvinhagemeister Jan 31, 2019
b7afff4
Remove patched virtual wrapper node
marvinhagemeister Jan 31, 2019
867b81b
Fix missing events due to root Fragment
marvinhagemeister Feb 2, 2019
eae1d1d
Make sure that rootCommitted is a root node
marvinhagemeister Feb 2, 2019
d60c481
Refactor root handling to account for root Fragment
marvinhagemeister Feb 2, 2019
3878582
Fix checkJs types in devtool tests
marvinhagemeister Feb 2, 2019
e83986a
Add PubSub to createContext
marvinhagemeister Feb 2, 2019
34c8a89
minimal golf
marvinhagemeister Feb 2, 2019
e94e9eb
Remove unneeded constructor call
marvinhagemeister Feb 2, 2019
8eb4520
Golf by assigning prototype -2
marvinhagemeister Feb 2, 2019
0cad57a
Mangle internal state name -3b
marvinhagemeister Feb 2, 2019
d8ea0bd
Golf var creation -3b
marvinhagemeister Feb 2, 2019
b34e9b2
Merge #208: Adapt devtools to root Fragment node
andrewiggins Feb 4, 2019
e6ae7fa
Merge branch 'master' into simplify-hooks
andrewiggins Feb 4, 2019
ea83be7
golf create context 🙃
ForsakenHarmony Feb 5, 2019
8e84d64
forgot about "normal" components
ForsakenHarmony Feb 6, 2019
821fe01
add the useContext hook
ForsakenHarmony Feb 6, 2019
f5d2bea
Merge pull request #209 from developit/create-context-pubsub
marvinhagemeister Feb 6, 2019
68dc7d1
Initialize hook state once in `getHookState` (+ 14 B)
andrewiggins Feb 7, 2019
e4fc67b
Fix mixed tabs and spaces in mangle.json
marvinhagemeister Feb 9, 2019
3c1d7a9
Merge pull request #210 from developit/create-context-hook
marvinhagemeister Feb 9, 2019
8f0dafe
Reapply dangerouslySetInnerHTML only when is changing
cristianbote Feb 9, 2019
64486fc
Adding the eslint skip for dangerouslySetInnerHTML and single quotes
cristianbote Feb 9, 2019
1f59a8e
Remove useless braces
marvinhagemeister Feb 10, 2019
ed6a71e
Fix linting errors in context demo
marvinhagemeister Feb 10, 2019
531e9c8
Make context demo more interactive
marvinhagemeister Feb 10, 2019
c04618b
Fix formatting
marvinhagemeister Feb 10, 2019
0fbe322
Remove unrelated changes and spaces around ==
cristianbote Feb 10, 2019
b3bbf0c
Fix small typos from CHANGELOG
cristianbote Feb 10, 2019
e06281f
Merge pull request #219 from developit/changelog_small_typos
marvinhagemeister Feb 10, 2019
1c77f58
Merge branch 'master' into reapplying_dangerouslysetinnerhtml
marvinhagemeister Feb 10, 2019
cb09cfb
Merge pull request #217 from developit/reapplying_dangerouslysetinner…
marvinhagemeister Feb 10, 2019
bfdbcb4
Merge branch 'master' into simplify-hooks
andrewiggins Feb 10, 2019
b9b24d6
Merge branch 'master' into create-context
marvinhagemeister Feb 10, 2019
af5b7c9
Minor code formatting changes
marvinhagemeister Feb 10, 2019
a02ca38
Verify that cWU is called with contextType
marvinhagemeister Feb 10, 2019
71ccab5
Merge pull request #135 from developit/create-context
marvinhagemeister Feb 11, 2019
273e4cc
Merge branch 'master' into simplify-hooks
andrewiggins Feb 11, 2019
4131ab7
Rework useContext
andrewiggins Feb 11, 2019
179a72a
Remove failed golf ideas
andrewiggins Feb 12, 2019
872b964
Add tests verifying dispatch and setState can be called from another …
andrewiggins Feb 12, 2019
71c3db6
Add the `useContext` hook to the ts definition
ForsakenHarmony Feb 12, 2019
445ec8d
Merge pull request #221 from developit/context-hook-doc
ForsakenHarmony Feb 12, 2019
012c5ce
Remove commented out golf explorations
andrewiggins Feb 12, 2019
5505011
Merge branch 'master' into simplify-hooks
andrewiggins Feb 12, 2019
eb3f2a5
Merge #211: Reduce size of hooks implementation
andrewiggins Feb 12, 2019
9dc5be4
Remove stateChanged tracking (-23 B)
andrewiggins Feb 12, 2019
e4071d8
Remove callback identity check in useMemo (-10 B)
andrewiggins Feb 12, 2019
1c3e18a
Update useReducer lazy init (+0 B)
andrewiggins Feb 12, 2019
9826e7d
Only queue a component to afterPaintEffects once (+13 B)
andrewiggins Feb 13, 2019
d3d1b2e
Merge branch 'master' into golf-diff-children
andrewiggins Feb 13, 2019
1b8ab94
Add comments describing Fragment diffing
andrewiggins Feb 13, 2019
133c9a1
Remove commented golf attempts and disable Fragment DOM log assertions
andrewiggins Feb 13, 2019
f3e42db
Add more focus tests
andrewiggins Jan 4, 2019
7f3b8c2
Separate adding and removing children around input tests
andrewiggins Jan 4, 2019
3e3f013
Remove useless tests
andrewiggins Jan 18, 2019
0c86efa
Fix validateFocus function definition
andrewiggins Jan 18, 2019
3e4f5c8
Improve 'move input around' test
andrewiggins Jan 18, 2019
9523330
Merge #174: Add more focus tests
andrewiggins Feb 13, 2019
71ee75f
Fix a bug with hooks
ForsakenHarmony Feb 13, 2019
71e5a77
Switch package name from ceviche to preact
marvinhagemeister Feb 10, 2019
b60c122
Remove debugging leftovers from way back
marvinhagemeister Feb 13, 2019
8f8a7a4
Merge pull request #218 from developit/ceviche_preact
marvinhagemeister Feb 13, 2019
8e11738
Merge branch 'master' into hooks-ideas-2
marvinhagemeister Feb 13, 2019
537f7b1
Merge pull request #222 from developit/hooks-ideas-2
marvinhagemeister Feb 13, 2019
5321eab
Merge branch 'master' into golf-diff-children
andrewiggins Feb 13, 2019
9be5559
Merge pull request #207 from developit/golf-diff-children
marvinhagemeister Feb 13, 2019
5e66f52
Rename forgotten ceviche import to preact
marvinhagemeister Feb 13, 2019
2117ece
Merge branch 'master' into fix-hook-bug
marvinhagemeister Feb 13, 2019
44064be
Merge pull request #224 from developit/fix-hook-bug
marvinhagemeister Feb 13, 2019
20685da
Merge branch 'master' into ceviche_rename
marvinhagemeister Feb 13, 2019
304f307
Merge pull request #226 from developit/ceviche_rename
ForsakenHarmony Feb 13, 2019
3292281
Move compat into core
marvinhagemeister Dec 29, 2018
28f2b2e
Fix findDOMNode eslint warning
marvinhagemeister Dec 29, 2018
1d772f3
Partially port legacy and cleanup old vnode props
marvinhagemeister Dec 29, 2018
d3c12b7
Refactor compat cloneElement
marvinhagemeister Dec 29, 2018
742ccb2
Port unstable_renderSubtreeIntoContainer
marvinhagemeister Dec 29, 2018
bc7411f
Fix event normalization
marvinhagemeister Dec 29, 2018
576f9fe
Skip invalid findDOMNode test
marvinhagemeister Dec 29, 2018
7e66a9a
Remove propTypes test in compat
marvinhagemeister Dec 29, 2018
3e2260c
Remove unused code
marvinhagemeister Dec 29, 2018
94e5f7a
Fix Children api
marvinhagemeister Dec 29, 2018
8c03e3a
Remove useless wrapper
marvinhagemeister Dec 29, 2018
79e6bf0
Fix string refs
marvinhagemeister Dec 29, 2018
7491c7e
Add back event hook
marvinhagemeister Dec 29, 2018
39b045a
Move compat to multi-entry setup
marvinhagemeister Jan 27, 2019
477ceac
Move to multi-entry setup part #2
marvinhagemeister Jan 28, 2019
c9ff7e8
Optimize export generation for ReactPerf
marvinhagemeister Jan 28, 2019
7bd84c6
Simplify render implementation
marvinhagemeister Jan 28, 2019
de9f46a
Simplify React.Children implementation
marvinhagemeister Jan 28, 2019
3ae61e3
Move DOM factories to legacy
marvinhagemeister Jan 28, 2019
144d901
Move PropTypes to legacy
marvinhagemeister Jan 28, 2019
f550f8e
Remove string ref api
marvinhagemeister Feb 2, 2019
583b2d6
Remove deprecated createClass api
marvinhagemeister Feb 2, 2019
2db184d
Remove multihook helper
marvinhagemeister Feb 2, 2019
a4c3dbf
Remove defaultProps handling (already in core)
marvinhagemeister Feb 2, 2019
7fced98
Remove useless tests
marvinhagemeister Feb 2, 2019
3136b17
Inline vnode hook
marvinhagemeister Feb 2, 2019
c2fc379
Fix cloneElement to add $$typeof symbol
marvinhagemeister Feb 2, 2019
f27d0dc
Remove legacy entry
marvinhagemeister Feb 2, 2019
9e7e622
Remove private lib imports for old apis
marvinhagemeister Feb 2, 2019
1f7ea2c
Remove deprecated __spread export
marvinhagemeister Feb 2, 2019
2e85b49
Remove deprecated unstable_ exports
marvinhagemeister Feb 2, 2019
b19d2f4
Remove unmountComponentAtNode export
marvinhagemeister Feb 2, 2019
c236aae
Fix linting errors
marvinhagemeister Feb 2, 2019
a5aa062
Remove unused symbol property
marvinhagemeister Feb 2, 2019
2405bdb
Inline portal code
marvinhagemeister Feb 2, 2019
5e54718
Update fake react version number
marvinhagemeister Feb 5, 2019
cd14405
Add support for UNSAFE_ lifecycle methods
marvinhagemeister Feb 5, 2019
f0fa79d
Change compat imports from ceviche -> preact
marvinhagemeister Feb 15, 2019
f10dc51
Convert PureComponent to class syntax
marvinhagemeister Feb 15, 2019
6f88511
Import h directly instead of aliasing createElement
marvinhagemeister Feb 15, 2019
2bd113b
Re-export createContext
marvinhagemeister Feb 15, 2019
c9e56a7
Enable passing skipped tests
marvinhagemeister Feb 15, 2019
1b80d2a
Remove legacy api test
marvinhagemeister Feb 15, 2019
bfb6c6d
Fix hydrate not replacing text nodes
marvinhagemeister Feb 16, 2019
b167734
Update remove text node test
marvinhagemeister Feb 16, 2019
344fa21
Update compat hydrate test
marvinhagemeister Feb 16, 2019
bdba08d
Use map thisArg -3 B
marvinhagemeister Feb 16, 2019
03122b7
Add JSDoc comments to compat
marvinhagemeister Feb 16, 2019
a38d244
Remove leftover compat legacy test
marvinhagemeister Feb 16, 2019
09cf087
Add all necessary compat exports
marvinhagemeister Feb 16, 2019
2b6276b
Merge pull request #170 from developit/compat2
marvinhagemeister Feb 17, 2019
0eca705
Renamed the test files to use .test. extension
cristianbote Feb 17, 2019
44fcf6f
Merge pull request #228 from developit/rename_test_files
marvinhagemeister Feb 18, 2019
97ee8ed
Make devtools warnings fail tests
marvinhagemeister Feb 18, 2019
e5d2eae
Fix devtool exception caused by empty root
marvinhagemeister Feb 18, 2019
5c4759b
Merge pull request #230 from developit/devtools_warning
marvinhagemeister Feb 18, 2019
40a33a3
Port memo to compat
marvinhagemeister Feb 17, 2019
fad3162
Integrate memo into devtools
marvinhagemeister Feb 17, 2019
33f3956
Add _memo to mangle.json
marvinhagemeister Feb 17, 2019
1a1bac3
Add demo page to test devtools memo integration
marvinhagemeister Feb 17, 2019
c75a9e0
Add comment to explain memo tag
marvinhagemeister Feb 17, 2019
74a4b59
Add test to verify memo args
marvinhagemeister Feb 17, 2019
5915b2c
Remove support for classes in memo
marvinhagemeister Feb 17, 2019
6e9fd6a
Simplify memo displayName
marvinhagemeister Feb 17, 2019
1667774
Revert changes to getDisplayName
marvinhagemeister Feb 17, 2019
6d90ccb
Rename memo.js -> memo.test.js
marvinhagemeister Feb 18, 2019
f1063ee
Fix duplicate import
marvinhagemeister Feb 18, 2019
b801672
Inline if-statement -1 B
marvinhagemeister Feb 20, 2019
2545252
Merge pull request #227 from developit/memo_compat
marvinhagemeister Feb 20, 2019
c8b325e
Re-export hooks in compat
marvinhagemeister Feb 20, 2019
5912226
Merge pull request #231 from developit/compat_hooks
ForsakenHarmony Feb 20, 2019
e7b5015
Add failing hydrate test
andrewiggins Dec 19, 2018
2c828a3
Merge pull request #223 from developit/add-failing-hydrate-test
marvinhagemeister Feb 20, 2019
f52d670
add `contextType` to component typescript def
ForsakenHarmony Feb 20, 2019
7b906b9
rename `cevicheRenderer` to `preactRenderer`
ForsakenHarmony Feb 20, 2019
f55aa7f
remove unused (?) tsconfig
ForsakenHarmony Feb 20, 2019
63553ab
use `preact` instead of `ceviche` as a keyword
ForsakenHarmony Feb 20, 2019
8c322fe
Merge branch 'master' into small_fixes
marvinhagemeister Feb 20, 2019
c9e0f16
Merge pull request #232 from developit/small_fixes
marvinhagemeister Feb 20, 2019
8292028
Add preact/hooks alias in demo app
marvinhagemeister Feb 22, 2019
69a39b0
Add OpenCollective postinstall script
marvinhagemeister Feb 22, 2019
a884720
Merge pull request #236 from developit/opencollective_postinstall
marvinhagemeister Feb 22, 2019
d9bd5c1
Merge branch 'master' into hook_alias
marvinhagemeister Feb 22, 2019
4e5a069
Merge pull request #234 from developit/hook_alias
marvinhagemeister Feb 23, 2019
8e1d45f
debug: allow complex `key` values
developit Feb 23, 2019
d704dd9
Always use string styles
marvinhagemeister Feb 7, 2019
0d66698
Add test for css custom properties
marvinhagemeister Feb 7, 2019
eb8653d
Perf extract css regex
marvinhagemeister Feb 7, 2019
50d0d81
Improve css custom properties test
marvinhagemeister Feb 7, 2019
92b69d3
Fix invalid spacing in css property in test
marvinhagemeister Feb 13, 2019
ef4e817
Switch from cssText to setProperty/removeProperty
marvinhagemeister Feb 13, 2019
e0b9764
Replace removeProperty with setProperty -4 B
developit Feb 23, 2019
bf5d5f1
Inline property css regex
marvinhagemeister Feb 23, 2019
1b85dfd
Move forwardRef tests to compat
marvinhagemeister Feb 18, 2019
6dd3314
Port forwardRef to compat
marvinhagemeister Feb 18, 2019
587c1e0
Fix exception when checking for forwardRef
marvinhagemeister Feb 18, 2019
d3f2493
Add test for forwardRef display name in devtools
marvinhagemeister Feb 18, 2019
c188802
Remove unneeded afterDif hook
marvinhagemeister Feb 18, 2019
6d42a36
Inline isForwardRef
marvinhagemeister Feb 18, 2019
cdaa230
Switch to vnode hook for forwardRef patch
marvinhagemeister Feb 18, 2019
ca2243c
Optimitze forwardRef detection -16 B
marvinhagemeister Feb 23, 2019
510decd
Merge pull request #229 from developit/forwardref_compat
marvinhagemeister Feb 23, 2019
26c6390
Merge branch 'master' into debug-allow-complex-keys
marvinhagemeister Feb 23, 2019
3e6ddfc
Merge branch 'master' into css_style
marvinhagemeister Feb 23, 2019
f04e86a
Avoid capture by using a positive lookahead -1 B
developit Feb 24, 2019
f172e0a
Fix missing this binding for memo components
marvinhagemeister Feb 24, 2019
ec26406
Merge pull request #213 from developit/css_style
marvinhagemeister Feb 24, 2019
26e4f39
Merge branch 'master' into debug-allow-complex-keys
marvinhagemeister Feb 24, 2019
8c0c442
Merge pull request #237 from developit/debug-allow-complex-keys
marvinhagemeister Feb 24, 2019
a45222b
Merge branch 'master' into memo_this
marvinhagemeister Feb 25, 2019
d1c257d
Merge pull request #239 from developit/memo_this
marvinhagemeister Feb 25, 2019
09c1924
Silence karma webpack stats output (#238)
marvinhagemeister Feb 25, 2019
54a5ff2
Add back unmountComponentAtNode to compat (#241)
marvinhagemeister Feb 25, 2019
2f5c973
Port forwardRef tests from react (#242)
marvinhagemeister Feb 27, 2019
884af2b
Remove unused test certificate (#245)
marvinhagemeister Feb 28, 2019
4667e75
Fix devtools crashing on empty Fragment
marvinhagemeister Feb 21, 2019
df893e9
Simplify root handling
marvinhagemeister Feb 28, 2019
d00e200
Merge pull request #235 from developit/devtools_empty_fragment
marvinhagemeister Mar 1, 2019
112c88a
Update version to 10.0.0-alpha.0
marvinhagemeister Mar 1, 2019
3a9a937
Remove unused prop-types dep from compat
marvinhagemeister Mar 1, 2019
54cce05
Update package descriptions
marvinhagemeister Mar 1, 2019
d3c5c0c
Align compat amd name with other packages
marvinhagemeister Mar 1, 2019
d632efa
Merge pull request #246 from developit/npm_package
marvinhagemeister Mar 2, 2019
bbec74b
Work around V8 performance cliff (#247)
marvinhagemeister Mar 2, 2019
d7bf0cb
Merge ceviche repo
marvinhagemeister Mar 2, 2019
e49a9f8
Remove 8.x build pipeline + tests
marvinhagemeister Mar 2, 2019
bcd323c
Remove 8.x code
marvinhagemeister Mar 2, 2019
ca71cad
Remove 8.x authoring configs
marvinhagemeister Mar 2, 2019
40ce533
Port setState type to ceviche typings
marvinhagemeister Mar 2, 2019
f25de85
Remove 8.x TS typings
marvinhagemeister Mar 2, 2019
32ba027
Remove abstruse CI config
marvinhagemeister Mar 2, 2019
f225aaa
Enable Typescript to understand JSX default props
Alexendoo Aug 10, 2018
72d3913
Add boolean to ComponentChild in preact.d.ts and add test cases
Sep 24, 2018
9a982bd
Add onError to Image Events
jackmoore Sep 25, 2018
26dac38
use Key type for Attributes interface key property
wojtczal Oct 28, 2018
7af0f62
Added "onInvalid" form event in TS (#1221)
namankheterpal Nov 13, 2018
d5b222c
Allow desc element for SVGs
programbo Feb 8, 2019
526184b
Fix formatting
andrewiggins Mar 3, 2019
8a489b4
Give ComponentFactory a default generic value and add a test for it
andrewiggins Mar 3, 2019
c6453f8
Fix editorconfig to not compete with other tools on formatting mangle…
andrewiggins Mar 3, 2019
f3b8f93
Reverse order of overloaded h() type definitions
garybernhardt Sep 19, 2018
3272f39
Skip unnecessary TS tests
marvinhagemeister Mar 3, 2019
1c5f3dc
Fix incorrect TSDoc comment
marvinhagemeister Mar 3, 2019
8d48e82
Increase code coverage in compat
marvinhagemeister Mar 3, 2019
6f89c26
Remove useless check if props is null
marvinhagemeister Mar 3, 2019
640db41
Ignore coverage for old vnode hook
marvinhagemeister Mar 3, 2019
5313ad6
Add test for Portal
marvinhagemeister Mar 3, 2019
359972e
Add PureComponent test for removed props
marvinhagemeister Mar 3, 2019
528a129
Remove unnecessary hasOwnProperty check
marvinhagemeister Mar 3, 2019
7ae5d0b
Add test for defaultValue when value is 0
marvinhagemeister Mar 3, 2019
c8ddcf2
Remove old vnode.children access
marvinhagemeister Mar 3, 2019
bf0dc5b
Add test for component className normalization
marvinhagemeister Mar 3, 2019
e9a1c0c
Fix incorrect comment
marvinhagemeister Mar 3, 2019
a4dc810
Add more tests for UNSAFE_* methods
marvinhagemeister Mar 3, 2019
a9b22a3
Remove className setter for immutable props
marvinhagemeister Mar 3, 2019
7318efb
Remove unused normalization branch
marvinhagemeister Mar 3, 2019
9ab2ea7
Fix missing text nodes in compat
marvinhagemeister Mar 3, 2019
dfea2d3
Remove unsupported Children.map this arg
marvinhagemeister Mar 3, 2019
f8c0927
Fix incorrect Children tests
marvinhagemeister Mar 3, 2019
3ae1889
Remove incomplete and outdated CHANGELOG.md
marvinhagemeister Mar 4, 2019
e5fbdad
Add compat to npm files
marvinhagemeister Mar 4, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{*.json,.*rc,*.yml}]
[{package.json,.*rc,*.yml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

# Uglify (or some other tool) always rewrites this file
# without a final newline on build, so disabling that
# editorconfig feature specifically for this file
[mangle.json]
insert_final_newline = false
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
test/fixtures
test/ts/
23 changes: 7 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
/node_modules
/npm-debug.log
.DS_Store
/dist
/_dev
/coverage
node_modules
npm-debug.log
dist
package-lock.json
/test/ts/**/*.js

# Additional bundles
/devtools.js
/devtools.js.map
/debug.js
/debug.js.map

# Editor and IDE configuration
.vscode/
.idea/
.vscode
.idea
test/ts/**/*.js
coverage
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Changelog

## Differences from Preact

### Major changes

1. The VNode shape has changed
1. `attributes` has been renamed to `props`
2. `nodeName` is now `type`
3. `props.children`
1. The children of a VNode are no longer guaranteed to be a flat array. It could be `undefined`
or it could be a nested array of children. use newly exported helper `toChildArray` to
always get an array back. It takes `props.children` as an argument and always returns an array
2. A Component with no children will not have a `children` prop defined on `props`. Preact v8
guaranteed an empty list would always be there. That can no longer be relied on.
3. `children` is only stored as a property on the `props` property (i.e. `props.children`).
`vnode.children` no longer exists
4. `null`, `undefined`, `true`, and `false` are not removed from the children array stored as
props. Use the newly exported helper `toChildArray` to flatten and remove non-renderables.
2. `h` has been renamed to `createElement`. To continue to use `h`, alias `createElement` to `h` in
your import statement to h: `import { createElement as h } from 'preact';`.
3. The root `render` function (the one you import from `preact`) has changed:
1. `render` no longer returns the newly created DOM element. Its return type is now `void`
2. `render` no longer supports a third argument to hydrate the DOM. Use the new `hydrate`
function to hydrate a server rendered DOM tree
3. Calling `render` multiple times on the same element merges the trees together. It no longer
just appends to the DOM
4. Preact no longer guarantees elements not created by Preact will preserved
4. `setState` no longer modifies `this.state` synchronously
5. 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
6. The Component constructor no longer initializes state to an empty object. If state has not been
previously set, it will be set to an empty object the first time the component is rendered, after
the constructor has been called
7. We no longer have a default export. Use `import * as preact from "preact"` for similar behavior.
8. `options.debounceRendering` has been moved to `Component.debounce`

### Minor changes

1. `addEventListener` and `removeEventListener` are called every time an event handler is changed
2. `render(null, container)` no longer renders an empty text node but instead renders nothing
3. We longer support a synchronous `Component.debounce` (formerly `options.debounceRendering`).
The value of `Component.debounce` must asynchronously invoke the passed in callback. It is
important that contributors to Preact can consistently reason about what calls to `setState`, etc.
do, and when their effects will be applied. See the links below for some further reading on designing
asynchronous APIs.
* [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)
* [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)

### For contributors

1. `scratch.innerHTML = ''` no longer is an effective technique to clear the DOM during testing. If you think you need to
clear the DOM during a test, consider breaking your tests into multiple individual tests to cover your feature.
23 changes: 23 additions & 0 deletions compat/mangle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"help": {
"what is this file?": "It controls protected/private property mangling so that minified builds have consistent property names.",
"why are there duplicate minified properties?": "Most properties are only used on one type of objects, so they can have the same name since they will never collide. Doing this reduces size."
},
"props": {
"cname": 6,
"props": {
"$_dirty": "__d",
"$_nextState": "__s",
"$_renderCallbacks": "__h",
"$_vnode": "__v",
"$_children": "__k",
"$_dom": "__e",
"$_component": "__c",
"$_constructor": "__c",
"$_prevVNode": "__t",
"$__html": "__html",
"$_ancestorComponent": "__a",
"$_processingException": "__p"
}
}
}
18 changes: 18 additions & 0 deletions compat/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "preact-compat",
"amdName": "preactCompat",
"version": "4.0.0",
"private": true,
"description": "A React compatibility layer for Preact",
"main": "dist/compat.js",
"module": "dist/compat.mjs",
"umd:main": "dist/compat.umd.js",
"source": "src/index.js",
"license": "MIT",
"mangle": {
"regex": "^_"
},
"peerDependencies": {
"preact": "10.0.0-alpha.0"
}
}
9 changes: 9 additions & 0 deletions compat/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* eslint-disable */
var renderToString = dep(require('preact-render-to-string'));

function dep(obj) { return obj['default'] || obj; }

module.exports = {
renderToString: renderToString,
renderToStaticMarkup: renderToString
};
Loading