govuk_publishing_components 12.13.0 → 12.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/accessible-autocomplete.js +37 -0
  3. data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +6 -5
  4. data/app/assets/javascripts/govuk_publishing_components/components/copy-to-clipboard.js +15 -15
  5. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +2 -4
  6. data/app/assets/javascripts/govuk_publishing_components/components/initial-focus.js +8 -8
  7. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +3 -3
  8. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_accessible-autocomplete.scss +16 -0
  10. data/app/views/govuk_publishing_components/components/_accessible_autocomplete.html.erb +24 -0
  11. data/app/views/govuk_publishing_components/components/docs/accessible_autocomplete.yml +42 -0
  12. data/config/initializers/assets.rb +1 -0
  13. data/lib/govuk_publishing_components/version.rb +1 -1
  14. data/node_modules/accessible-autocomplete/CHANGELOG.md +269 -0
  15. data/node_modules/accessible-autocomplete/CONTRIBUTING.md +150 -0
  16. data/node_modules/accessible-autocomplete/LICENSE.txt +20 -0
  17. data/node_modules/accessible-autocomplete/Procfile +1 -0
  18. data/node_modules/accessible-autocomplete/README.md +416 -0
  19. data/node_modules/accessible-autocomplete/accessibility-criteria.md +42 -0
  20. data/node_modules/accessible-autocomplete/app.json +15 -0
  21. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.css +1 -0
  22. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js +2 -0
  23. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js.map +1 -0
  24. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js +2 -0
  25. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js.map +1 -0
  26. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js +2 -0
  27. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js.map +1 -0
  28. data/node_modules/accessible-autocomplete/examples/form.html +671 -0
  29. data/node_modules/accessible-autocomplete/examples/index.html +616 -0
  30. data/node_modules/accessible-autocomplete/examples/preact/index.html +346 -0
  31. data/node_modules/accessible-autocomplete/examples/react/index.html +347 -0
  32. data/node_modules/accessible-autocomplete/package.json +192 -0
  33. data/node_modules/accessible-autocomplete/preact.js +1 -0
  34. data/node_modules/accessible-autocomplete/react.js +1 -0
  35. data/node_modules/accessible-autocomplete/scripts/check-staged.js +14 -0
  36. data/node_modules/accessible-autocomplete/src/autocomplete.css +141 -0
  37. data/node_modules/accessible-autocomplete/src/autocomplete.js +524 -0
  38. data/node_modules/accessible-autocomplete/src/dropdown-arrow-down.js +11 -0
  39. data/node_modules/accessible-autocomplete/src/status.js +80 -0
  40. data/node_modules/accessible-autocomplete/src/wrapper.js +60 -0
  41. data/node_modules/accessible-autocomplete/test/functional/dropdown-arrow-down.js +44 -0
  42. data/node_modules/accessible-autocomplete/test/functional/index.js +485 -0
  43. data/node_modules/accessible-autocomplete/test/functional/wrapper.js +267 -0
  44. data/node_modules/accessible-autocomplete/test/integration/index.js +188 -0
  45. data/node_modules/accessible-autocomplete/test/karma.config.js +42 -0
  46. data/node_modules/accessible-autocomplete/test/wdio.config.js +80 -0
  47. data/node_modules/accessible-autocomplete/webpack.config.babel.js +193 -0
  48. data/node_modules/preact/LICENSE +21 -0
  49. data/node_modules/preact/README.md +580 -0
  50. data/node_modules/preact/debug.js +112 -0
  51. data/node_modules/preact/debug.js.map +1 -0
  52. data/node_modules/preact/debug/index.js +121 -0
  53. data/node_modules/preact/devtools.js +403 -0
  54. data/node_modules/preact/devtools.js.map +1 -0
  55. data/node_modules/preact/devtools/devtools.js +395 -0
  56. data/node_modules/preact/devtools/index.js +4 -0
  57. data/node_modules/preact/dist/preact.d.ts +891 -0
  58. data/node_modules/preact/dist/preact.dev.js +718 -0
  59. data/node_modules/preact/dist/preact.dev.js.map +1 -0
  60. data/node_modules/preact/dist/preact.js +408 -0
  61. data/node_modules/preact/dist/preact.js.flow +13 -0
  62. data/node_modules/preact/dist/preact.js.map +1 -0
  63. data/node_modules/preact/dist/preact.min.js +2 -0
  64. data/node_modules/preact/dist/preact.min.js.map +1 -0
  65. data/node_modules/preact/dist/preact.mjs +715 -0
  66. data/node_modules/preact/dist/preact.mjs.map +1 -0
  67. data/node_modules/preact/package.json +218 -0
  68. data/node_modules/preact/src/clone-element.js +18 -0
  69. data/node_modules/preact/src/component.js +90 -0
  70. data/node_modules/preact/src/constants.js +17 -0
  71. data/node_modules/preact/src/dom/index.js +138 -0
  72. data/node_modules/preact/src/h.js +86 -0
  73. data/node_modules/preact/src/options.js +22 -0
  74. data/node_modules/preact/src/preact.d.ts +891 -0
  75. data/node_modules/preact/src/preact.js +26 -0
  76. data/node_modules/preact/src/preact.js.flow +13 -0
  77. data/node_modules/preact/src/render-queue.js +28 -0
  78. data/node_modules/preact/src/render.js +22 -0
  79. data/node_modules/preact/src/util.js +19 -0
  80. data/node_modules/preact/src/vdom/component-recycler.js +48 -0
  81. data/node_modules/preact/src/vdom/component.js +296 -0
  82. data/node_modules/preact/src/vdom/diff.js +336 -0
  83. data/node_modules/preact/src/vdom/index.js +54 -0
  84. data/node_modules/preact/src/vnode.js +9 -0
  85. data/node_modules/preact/typings.json +5 -0
  86. metadata +78 -2
@@ -0,0 +1,42 @@
1
+ require('@babel/register')({
2
+ cwd: require('path').resolve(__dirname, '../')
3
+ })
4
+ var puppeteer = require('puppeteer')
5
+ var webpack = require('../webpack.config.babel.js')[0]
6
+
7
+ // Use Chrome headless
8
+ process.env.CHROME_BIN = puppeteer.executablePath()
9
+
10
+ module.exports = function (config) {
11
+ config.set({
12
+ basePath: '../',
13
+ frameworks: ['mocha', 'chai-sinon'],
14
+ reporters: ['mocha', 'coverage'],
15
+ coverageReporter: {
16
+ dir: 'coverage',
17
+ reporters: [
18
+ { type: 'text-summary' },
19
+ { type: 'html', subdir: 'html' },
20
+ { type: 'lcov', subdir: 'lcov' }
21
+ ]
22
+ },
23
+
24
+ browsers: ['ChromeHeadless'],
25
+
26
+ files: [
27
+ 'test/functional/**/*.js'
28
+ ],
29
+
30
+ preprocessors: {
31
+ 'test/**/*.js': ['webpack'],
32
+ 'src/**/*.js': ['webpack'],
33
+ '**/*.js': ['sourcemap']
34
+ },
35
+
36
+ webpack: webpack,
37
+ webpackMiddleware: {
38
+ logLevel: 'error',
39
+ stats: 'errors-only'
40
+ }
41
+ })
42
+ }
@@ -0,0 +1,80 @@
1
+ require('@babel/register')({
2
+ cwd: require('path').resolve(__dirname, '../')
3
+ })
4
+ require('dotenv').config()
5
+ const puppeteer = require('puppeteer')
6
+ const webpackConfig = require('../webpack.config.babel.js')
7
+ const webpackPort = webpackConfig[0].devServer.port
8
+ const staticServerPort = process.env.PORT || 4567
9
+ const services = ['webpack-dev-server', 'static-server']
10
+
11
+ const sauceEnabled = process.env.SAUCE_ENABLED === 'true'
12
+ const sauceUser = process.env.SAUCE_USERNAME
13
+ const sauceKey = process.env.SAUCE_ACCESS_KEY
14
+ const buildNumber = process.env.TRAVIS_BUILD_NUMBER
15
+ const sauceConfig = sauceEnabled
16
+ ? {
17
+ user: sauceUser,
18
+ key: sauceKey,
19
+ capabilities: [
20
+ {
21
+ browserName: 'chrome',
22
+ build: buildNumber,
23
+ platform: 'Windows 10'
24
+ },
25
+ {
26
+ browserName: 'firefox',
27
+ build: buildNumber,
28
+ platform: 'Windows 10',
29
+ version: '55.0'
30
+ },
31
+ {
32
+ browserName: 'internet explorer',
33
+ build: buildNumber,
34
+ platform: 'Windows 10',
35
+ version: '11.103'
36
+ },
37
+ {
38
+ browserName: 'internet explorer',
39
+ build: buildNumber,
40
+ platform: 'Windows 7',
41
+ version: '10'
42
+ },
43
+ {
44
+ browserName: 'internet explorer',
45
+ build: buildNumber,
46
+ platform: 'Windows 7',
47
+ version: '9'
48
+ }
49
+ ],
50
+ services: services.concat(['sauce']),
51
+ sauceConnect: true
52
+ }
53
+ : {}
54
+
55
+ exports.config = Object.assign({
56
+ specs: ['./test/integration/**/*.js'],
57
+ capabilities: [
58
+ // { browserName: 'firefox' },
59
+ {
60
+ browserName: 'chrome',
61
+ chromeOptions: {
62
+ args: ['--headless'],
63
+ binary: puppeteer.executablePath()
64
+ }
65
+ }
66
+ ],
67
+ baseUrl: 'http://localhost:' + staticServerPort,
68
+ screenshotPath: './screenshots/',
69
+ services: services.concat(['selenium-standalone']),
70
+ reporters: ['spec'],
71
+ framework: 'mocha',
72
+ mochaOpts: { timeout: 30 * 1000 },
73
+ webpackConfig,
74
+ webpackPort,
75
+ staticServerFolders: [
76
+ { mount: '/', path: './examples' },
77
+ { mount: '/dist/', path: './dist' }
78
+ ],
79
+ staticServerPort
80
+ }, sauceConfig)
@@ -0,0 +1,193 @@
1
+ import webpack from 'webpack'
2
+ import path from 'path'
3
+ import CopyWebpackPlugin from 'copy-webpack-plugin'
4
+ import UglifyJsPlugin from 'uglifyjs-webpack-plugin'
5
+ const ENV = process.env.NODE_ENV || 'development'
6
+
7
+ const plugins = [
8
+ new webpack.NoEmitOnErrorsPlugin(),
9
+ new webpack.DefinePlugin({
10
+ 'process.env.NODE_ENV': JSON.stringify(ENV)
11
+ })
12
+ ]
13
+
14
+ const developmentPlugins = [
15
+ new CopyWebpackPlugin([
16
+ { from: './autocomplete.css', to: 'accessible-autocomplete.min.css' }
17
+ ])
18
+ ]
19
+
20
+ const config = {
21
+ context: path.resolve(__dirname, 'src'),
22
+
23
+ optimization: {
24
+ minimize: ENV === 'production',
25
+ minimizer: [new UglifyJsPlugin({
26
+ cache: true,
27
+ parallel: true,
28
+ sourceMap: true,
29
+ uglifyOptions: {
30
+ compress: {
31
+ negate_iife: false,
32
+ properties: false,
33
+ ie8: true
34
+ },
35
+ mangle: {
36
+ ie8: true
37
+ },
38
+ output: {
39
+ comments: false,
40
+ ie8: true
41
+ }
42
+ }
43
+ })]
44
+ },
45
+
46
+ resolve: {
47
+ extensions: ['.js'],
48
+ modules: [
49
+ path.resolve(__dirname, 'node_modules'),
50
+ 'node_modules'
51
+ ]
52
+ },
53
+
54
+ module: {
55
+ rules: [
56
+ {
57
+ test: /\.js$/,
58
+ include: path.resolve(__dirname, 'src'),
59
+ enforce: 'pre',
60
+ loader: 'source-map-loader'
61
+ },
62
+ {
63
+ test: /\.js$/,
64
+ exclude: /node_modules/,
65
+ loader: 'babel-loader'
66
+ }
67
+ ]
68
+ },
69
+
70
+ stats: { colors: true },
71
+
72
+ node: {
73
+ global: true,
74
+ process: false,
75
+ Buffer: false,
76
+ __filename: false,
77
+ __dirname: false,
78
+ setImmediate: false
79
+ },
80
+
81
+ mode: ENV === 'production' ? 'production' : 'development',
82
+ devtool: ENV === 'production' ? 'source-map' : 'cheap-module-eval-source-map',
83
+
84
+ devServer: {
85
+ setup (app) {
86
+ // Grab potential subdirectory with :dir*?
87
+ app.get('/dist/:dir*?/:filename', (request, response) => {
88
+ if (!request.params.dir || request.params.dir === undefined) {
89
+ response.redirect('/' + request.params.filename)
90
+ } else {
91
+ response.redirect('/' + request.params.dir + '/' + request.params.filename)
92
+ }
93
+ })
94
+ },
95
+ port: process.env.PORT || 8080,
96
+ host: '0.0.0.0',
97
+ publicPath: '/dist/',
98
+ contentBase: ['./examples', './src'],
99
+ historyApiFallback: true,
100
+ open: true,
101
+ watchContentBase: true,
102
+ disableHostCheck: true
103
+ }
104
+ }
105
+
106
+ const bundleStandalone = {
107
+ ...config,
108
+ entry: {
109
+ 'accessible-autocomplete.min': './wrapper.js'
110
+ },
111
+ output: {
112
+ path: path.resolve(__dirname, 'dist'),
113
+ publicPath: '/',
114
+ filename: '[name].js',
115
+ library: 'accessibleAutocomplete',
116
+ libraryExport: 'default',
117
+ libraryTarget: 'umd'
118
+ },
119
+ plugins: plugins
120
+ .concat([new webpack.DefinePlugin({
121
+ 'process.env.COMPONENT_LIBRARY': '"PREACT"'
122
+ })])
123
+ .concat(ENV === 'development'
124
+ ? developmentPlugins
125
+ : []
126
+ )
127
+ }
128
+
129
+ const bundlePreact = {
130
+ ...config,
131
+ entry: {
132
+ 'lib/accessible-autocomplete.preact.min': './autocomplete.js'
133
+ },
134
+ output: {
135
+ path: path.resolve(__dirname, 'dist'),
136
+ publicPath: '/',
137
+ filename: '[name].js',
138
+ library: 'Autocomplete',
139
+ libraryTarget: 'umd'
140
+ },
141
+ externals: {
142
+ preact: {
143
+ amd: 'preact',
144
+ commonjs: 'preact',
145
+ commonjs2: 'preact',
146
+ root: 'preact'
147
+ }
148
+ },
149
+ plugins: plugins
150
+ .concat([new webpack.DefinePlugin({
151
+ 'process.env.COMPONENT_LIBRARY': '"PREACT"'
152
+ })])
153
+ .concat(ENV === 'development'
154
+ ? developmentPlugins
155
+ : []
156
+ )
157
+ }
158
+
159
+ const bundleReact = {
160
+ ...config,
161
+ entry: {
162
+ 'lib/accessible-autocomplete.react.min': './autocomplete.js'
163
+ },
164
+ output: {
165
+ path: path.resolve(__dirname, 'dist'),
166
+ publicPath: '/',
167
+ filename: '[name].js',
168
+ library: 'Autocomplete',
169
+ libraryTarget: 'umd'
170
+ },
171
+ externals: {
172
+ preact: {
173
+ amd: 'react',
174
+ commonjs: 'react',
175
+ commonjs2: 'react',
176
+ root: 'React'
177
+ }
178
+ },
179
+ plugins: plugins
180
+ .concat([new webpack.DefinePlugin({
181
+ 'process.env.COMPONENT_LIBRARY': '"REACT"'
182
+ })])
183
+ .concat(ENV === 'development'
184
+ ? developmentPlugins
185
+ : []
186
+ )
187
+ }
188
+
189
+ module.exports = [
190
+ bundleStandalone,
191
+ bundlePreact,
192
+ bundleReact
193
+ ]
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-present Jason Miller
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,580 @@
1
+ <p align="center">
2
+ <a href="https://preactjs.com" target="_blank">
3
+ <img alt="Preact" title="Preact" src="https://cdn.rawgit.com/developit/b4416d5c92b743dbaec1e68bc4c27cda/raw/3235dc508f7eb834ebf48418aea212a05df13db1/preact-logo-trans.svg" width="550">
4
+ </a>
5
+ </p>
6
+ <p align="center">Fast <b>3kB</b> alternative to React with the same modern API.</p>
7
+
8
+ **All the power of Virtual DOM components, without the overhead:**
9
+
10
+ - Familiar React API & patterns: [ES6 Class] and [Functional Components]
11
+ - Extensive React compatibility via a simple [preact-compat] alias
12
+ - Everything you need: JSX, <abbr title="Virtual DOM">VDOM</abbr>, React DevTools, <abbr title="Hot Module Replacement">HMR</abbr>, <abbr title="Server-Side Rendering">SSR</abbr>..
13
+ - A highly optimized diff algorithm and seamless Server Side Rendering
14
+ - Transparent asynchronous rendering with a pluggable scheduler
15
+ - 🆕💥 **Instant no-config app bundling with [Preact CLI](https://github.com/developit/preact-cli)**
16
+
17
+ ### 💁 More information at the [Preact Website ➞](https://preactjs.com)
18
+
19
+
20
+ ---
21
+
22
+ <!-- TOC depthFrom:2 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->
23
+
24
+ - [Demos](#demos)
25
+ - [Libraries & Add-ons](#libraries--add-ons)
26
+ - [Getting Started](#getting-started)
27
+ - [Import what you need](#import-what-you-need)
28
+ - [Rendering JSX](#rendering-jsx)
29
+ - [Components](#components)
30
+ - [Props & State](#props--state)
31
+ - [Linked State](#linked-state)
32
+ - [Examples](#examples)
33
+ - [Extensions](#extensions)
34
+ - [Debug Mode](#debug-mode)
35
+ - [Backers](#backers)
36
+ - [Sponsors](#sponsors)
37
+ - [License](#license)
38
+
39
+ <!-- /TOC -->
40
+
41
+
42
+ # Preact
43
+
44
+ [![npm](https://img.shields.io/npm/v/preact.svg)](http://npm.im/preact)
45
+ [![CDNJS](https://img.shields.io/cdnjs/v/preact.svg)](https://cdnjs.com/libraries/preact)
46
+ [![Preact Slack Community](https://preact-slack.now.sh/badge.svg)](https://preact-slack.now.sh)
47
+ [![OpenCollective Backers](https://opencollective.com/preact/backers/badge.svg)](#backers)
48
+ [![OpenCollective Sponsors](https://opencollective.com/preact/sponsors/badge.svg)](#sponsors)
49
+ [![travis](https://travis-ci.org/developit/preact.svg?branch=master)](https://travis-ci.org/developit/preact)
50
+ [![coveralls](https://img.shields.io/coveralls/developit/preact/master.svg)](https://coveralls.io/github/developit/preact)
51
+ [![gzip size](http://img.badgesize.io/https://unpkg.com/preact/dist/preact.min.js?compression=gzip)](https://unpkg.com/preact/dist/preact.min.js)
52
+ [![install size](https://packagephobia.now.sh/badge?p=preact)](https://packagephobia.now.sh/result?p=preact)
53
+
54
+ Preact supports modern browsers and IE9+:
55
+
56
+ [![Browsers](https://saucelabs.com/browser-matrix/preact.svg)](https://saucelabs.com/u/preact)
57
+
58
+
59
+ ---
60
+
61
+
62
+ ## Demos
63
+
64
+ #### Real-World Apps
65
+
66
+ - [**Preact Hacker News**](https://hn.kristoferbaxter.com) _([GitHub Project](https://github.com/kristoferbaxter/preact-hn))_
67
+ - [**Play.cash**](https://play.cash) :notes: _([GitHub Project](https://github.com/feross/play.cash))_
68
+ - [**BitMidi**](https://bitmidi.com/) 🎹 Wayback machine for free MIDI files _([GitHub Project](https://github.com/feross/bitmidi.com))_
69
+ - [**ESBench**](http://esbench.com) is built using Preact.
70
+ - [**BigWebQuiz**](https://bigwebquiz.com) _([GitHub Project](https://github.com/jakearchibald/big-web-quiz))_
71
+ - [**Nectarine.rocks**](http://nectarine.rocks) _([GitHub Project](https://github.com/developit/nectarine))_ :peach:
72
+ - [**TodoMVC**](https://preact-todomvc.surge.sh) _([GitHub Project](https://github.com/developit/preact-todomvc))_
73
+ - [**OSS.Ninja**](https://oss.ninja) _([GitHub Project](https://github.com/developit/oss.ninja))_
74
+ - [**GuriVR**](https://gurivr.com) _([GitHub Project](https://github.com/opennewslabs/guri-vr))_
75
+ - [**Color Picker**](https://colors.now.sh) _([GitHub Project](https://github.com/lukeed/colors-app))_ :art:
76
+ - [**Rainbow Explorer**](https://use-the-platform.com/rainbow-explorer/) _([GitHub Project](https://github.com/vaneenige/rainbow-explorer/))_ :rainbow:
77
+ - [**Offline Gallery**](https://use-the-platform.com/offline-gallery/) _([GitHub Project](https://github.com/vaneenige/offline-gallery/))_ :balloon:
78
+ - [**Periodic Weather**](https://use-the-platform.com/periodic-weather/) _([GitHub Project](https://github.com/vaneenige/periodic-weather/))_ :sunny:
79
+ - [**Rugby News Board**](http://nbrugby.com) _[(GitHub Project)](https://github.com/rugby-board/rugby-board-node)_
80
+ - [**Preact Gallery**](https://preact.gallery/) an 8KB photo gallery PWA built using Preact.
81
+ - [**Rainbow Explorer**](https://use-the-platform.com/rainbow-explorer/) Preact app to translate real life color to digital color _([Github project](https://github.com/vaneenige/rainbow-explorer))_.
82
+ - [**YASCC**](https://carlosqsilva.github.io/YASCC/#/) Yet Another SoundCloud Client _([Github project](https://github.com/carlosqsilva/YASCC))_.
83
+ - [**Journalize**](https://preact-journal.herokuapp.com/) 14k offline-capable journaling PWA using preact. _([Github project](https://github.com/jpodwys/preact-journal))_.
84
+
85
+
86
+ #### Runnable Examples
87
+
88
+ - [**Flickr Browser**](http://codepen.io/developit/full/VvMZwK/) (@ CodePen)
89
+ - [**Animating Text**](http://codepen.io/developit/full/LpNOdm/) (@ CodePen)
90
+ - [**60FPS Rainbow Spiral**](http://codepen.io/developit/full/xGoagz/) (@ CodePen)
91
+ - [**Simple Clock**](http://jsfiddle.net/developit/u9m5x0L7/embedded/result,js/) (@ JSFiddle)
92
+ - [**3D + ThreeJS**](http://codepen.io/developit/pen/PPMNjd?editors=0010) (@ CodePen)
93
+ - [**Stock Ticker**](http://codepen.io/developit/pen/wMYoBb?editors=0010) (@ CodePen)
94
+ - [*Create your Own!*](https://jsfiddle.net/developit/rs6zrh5f/embedded/result/) (@ JSFiddle)
95
+
96
+ ### Starter Projects
97
+
98
+ - [**Preact Boilerplate**](https://preact-boilerplate.surge.sh) _([GitHub Project](https://github.com/developit/preact-boilerplate))_ :zap:
99
+ - [**Preact Offline Starter**](https://preact-starter.now.sh) _([GitHub Project](https://github.com/lukeed/preact-starter))_ :100:
100
+ - [**Preact PWA**](https://preact-pwa-yfxiijbzit.now.sh/) _([GitHub Project](https://github.com/ezekielchentnik/preact-pwa))_ :hamburger:
101
+ - [**Parcel + Preact + Unistore Starter**](https://github.com/hwclass/parcel-preact-unistore-starter)
102
+ - [**Preact Mobx Starter**](https://awaw00.github.io/preact-mobx-starter/) _([GitHub Project](https://github.com/awaw00/preact-mobx-starter))_ :sunny:
103
+ - [**Preact Redux Example**](https://github.com/developit/preact-redux-example) :star:
104
+ - [**Preact Redux/RxJS/Reselect Example**](https://github.com/continuata/preact-seed)
105
+ - [**V2EX Preact**](https://github.com/yanni4night/v2ex-preact)
106
+ - [**Preact Coffeescript**](https://github.com/crisward/preact-coffee)
107
+ - [**Preact + TypeScript + Webpack**](https://github.com/k1r0s/bleeding-preact-starter)
108
+ - [**0 config => Preact + Poi**](https://github.com/k1r0s/preact-poi-starter)
109
+ - [**Zero configuration => Preact + Typescript + Parcel**](https://github.com/aalises/preact-typescript-parcel-starter)
110
+
111
+ ---
112
+
113
+ ## Libraries & Add-ons
114
+
115
+ - :raised_hands: [**preact-compat**](https://git.io/preact-compat): use any React library with Preact *([full example](http://git.io/preact-compat-example))*
116
+ - :twisted_rightwards_arrows: [**preact-context**](https://github.com/valotas/preact-context): React's `createContext` api for Preact
117
+ - :page_facing_up: [**preact-render-to-string**](https://git.io/preact-render-to-string): Universal rendering.
118
+ - :eyes: [**preact-render-spy**](https://github.com/mzgoddard/preact-render-spy): Enzyme-lite: Renderer with access to the produced virtual dom for testing.
119
+ - :loop: [**preact-render-to-json**](https://git.io/preact-render-to-json): Render for Jest Snapshot testing.
120
+ - :earth_americas: [**preact-router**](https://git.io/preact-router): URL routing for your components
121
+ - :bookmark_tabs: [**preact-markup**](https://git.io/preact-markup): Render HTML & Custom Elements as JSX & Components
122
+ - :satellite: [**preact-portal**](https://git.io/preact-portal): Render Preact components into (a) SPACE :milky_way:
123
+ - :pencil: [**preact-richtextarea**](https://git.io/preact-richtextarea): Simple HTML editor component
124
+ - :bookmark: [**preact-token-input**](https://github.com/developit/preact-token-input): Text field that tokenizes input, for things like tags
125
+ - :card_index: [**preact-virtual-list**](https://github.com/developit/preact-virtual-list): Easily render lists with millions of rows ([demo](https://jsfiddle.net/developit/qqan9pdo/))
126
+ - :repeat: [**preact-cycle**](https://git.io/preact-cycle): Functional-reactive paradigm for Preact
127
+ - :triangular_ruler: [**preact-layout**](https://download.github.io/preact-layout/): Small and simple layout library
128
+ - :thought_balloon: [**preact-socrates**](https://github.com/matthewmueller/preact-socrates): Preact plugin for [Socrates](http://github.com/matthewmueller/socrates)
129
+ - :rowboat: [**preact-flyd**](https://github.com/xialvjun/preact-flyd): Use [flyd](https://github.com/paldepind/flyd) FRP streams in Preact + JSX
130
+ - :speech_balloon: [**preact-i18nline**](https://github.com/download/preact-i18nline): Integrates the ecosystem around [i18n-js](https://github.com/everydayhero/i18n-js) with Preact via [i18nline](https://github.com/download/i18nline).
131
+ - :microscope: [**preact-jsx-chai**](https://git.io/preact-jsx-chai): JSX assertion testing _(no DOM, right in Node)_
132
+ - :tophat: [**preact-classless-component**](https://github.com/ld0rman/preact-classless-component): create preact components without the class keyword
133
+ - :hammer: [**preact-hyperscript**](https://github.com/queckezz/preact-hyperscript): Hyperscript-like syntax for creating elements
134
+ - :white_check_mark: [**shallow-compare**](https://github.com/tkh44/shallow-compare): simplified `shouldComponentUpdate` helper.
135
+ - :shaved_ice: [**preact-codemod**](https://github.com/vutran/preact-codemod): Transform your React code to Preact.
136
+ - :construction_worker: [**preact-helmet**](https://github.com/download/preact-helmet): A document head manager for Preact
137
+ - :necktie: [**preact-delegate**](https://github.com/NekR/preact-delegate): Delegate DOM events
138
+ - :art: [**preact-stylesheet-decorator**](https://github.com/k1r0s/preact-stylesheet-decorator): Add Scoped Stylesheets to your Preact Components
139
+ - :electric_plug: [**preact-routlet**](https://github.com/k1r0s/preact-routlet): Simple `Component Driven` Routing for Preact using ES7 Decorators
140
+ - :fax: [**preact-bind-group**](https://github.com/k1r0s/preact-bind-group): Preact Forms made easy, Group Events into a Single Callback
141
+ - :hatching_chick: [**preact-habitat**](https://github.com/zouhir/preact-habitat): Declarative Preact widgets renderer in any CMS or DOM host ([demo](https://codepen.io/zouhir/pen/brrOPB)).
142
+ - :tada: [**proppy-preact**](https://github.com/fahad19/proppy): Functional props composition for Preact components
143
+
144
+ #### UI Component Libraries
145
+
146
+ > Want to prototype something or speed up your development? Try one of these toolkits:
147
+
148
+ - [**preact-material-components**](https://github.com/prateekbh/preact-material-components): Material Design Components for Preact ([website](https://material.preactjs.com/))
149
+ - [**preact-mdc**](https://github.com/BerndWessels/preact-mdc): Material Design Components for Preact ([demo](https://github.com/BerndWessels/preact-mdc-demo))
150
+ - [**preact-mui**](https://git.io/v1aVO): The MUI CSS Preact library.
151
+ - [**preact-photon**](https://git.io/preact-photon): build beautiful desktop UI with [photon](http://photonkit.com)
152
+ - [**preact-mdl**](https://git.io/preact-mdl): [Material Design Lite](https://getmdl.io) for Preact
153
+ - [**preact-weui**](https://github.com/afeiship/preact-weui): [Weui](https://github.com/afeiship/preact-weui) for Preact
154
+
155
+
156
+ ---
157
+
158
+ ## Getting Started
159
+
160
+ > 💁 _**Note:** You [don't need ES2015 to use Preact](https://github.com/developit/preact-in-es3)... but give it a try!_
161
+
162
+ The easiest way to get started with Preact is to install [Preact CLI](https://github.com/developit/preact-cli). This simple command-line tool wraps up the best possible Webpack and Babel setup for you, and even keeps you up-to-date as the underlying tools change. Best of all, it's easy to understand! It builds your app in a single command (`preact build`), doesn't need any configuration, and bakes in best-practises 🙌.
163
+
164
+ The following guide assumes you have some sort of ES2015 build set up using babel and/or webpack/browserify/gulp/grunt/etc.
165
+
166
+ You can also start with [preact-boilerplate] or a [CodePen Template](http://codepen.io/developit/pen/pgaROe?editors=0010).
167
+
168
+
169
+ ### Import what you need
170
+
171
+ The `preact` module provides both named and default exports, so you can either import everything under a namespace of your choosing, or just what you need as locals:
172
+
173
+ ##### Named:
174
+
175
+ ```js
176
+ import { h, render, Component } from 'preact';
177
+
178
+ // Tell Babel to transform JSX into h() calls:
179
+ /** @jsx h */
180
+ ```
181
+
182
+ ##### Default:
183
+
184
+ ```js
185
+ import preact from 'preact';
186
+
187
+ // Tell Babel to transform JSX into preact.h() calls:
188
+ /** @jsx preact.h */
189
+ ```
190
+
191
+ > Named imports work well for highly structured applications, whereas the default import is quick and never needs to be updated when using different parts of the library.
192
+ >
193
+ > Instead of declaring the `@jsx` pragma in your code, it's best to configure it globally in a `.babelrc`:
194
+ >
195
+ > **For Babel 5 and prior:**
196
+ >
197
+ > ```json
198
+ > { "jsxPragma": "h" }
199
+ > ```
200
+ >
201
+ > **For Babel 6:**
202
+ >
203
+ > ```json
204
+ > {
205
+ > "plugins": [
206
+ > ["transform-react-jsx", { "pragma":"h" }]
207
+ > ]
208
+ > }
209
+ > ```
210
+ > **For using Preact along with TypeScript add to `tsconfig.json`:**
211
+ >
212
+ > ```json
213
+ > {
214
+ > "jsx": "react",
215
+ > "jsxFactory": "h",
216
+ > }
217
+ > ```
218
+
219
+
220
+ ### Rendering JSX
221
+
222
+ Out of the box, Preact provides an `h()` function that turns your JSX into Virtual DOM elements _([here's how](http://jasonformat.com/wtf-is-jsx))_. It also provides a `render()` function that creates a DOM tree from that Virtual DOM.
223
+
224
+ To render some JSX, just import those two functions and use them like so:
225
+
226
+ ```js
227
+ import { h, render } from 'preact';
228
+
229
+ render((
230
+ <div id="foo">
231
+ <span>Hello, world!</span>
232
+ <button onClick={ e => alert("hi!") }>Click Me</button>
233
+ </div>
234
+ ), document.body);
235
+ ```
236
+
237
+ This should seem pretty straightforward if you've used hyperscript or one of its many friends. If you're not, the short of it is that the `h()` function import gets used in the final, transpiled code as a drop in replacement for `React.createElement()`, and so needs to be imported even if you don't explicitly use it in the code you write. Also note that if you're the kind of person who likes writing your React code in "pure JavaScript" (you know who you are) you will need to use `h()` wherever you would otherwise use `React.createElement()`.
238
+
239
+ Rendering hyperscript with a virtual DOM is pointless, though. We want to render components and have them updated when data changes - that's where the power of virtual DOM diffing shines. :star2:
240
+
241
+
242
+ ### Components
243
+
244
+ Preact exports a generic `Component` class, which can be extended to build encapsulated, self-updating pieces of a User Interface. Components support all of the standard React [lifecycle methods], like `shouldComponentUpdate()` and `componentWillReceiveProps()`. Providing specific implementations of these methods is the preferred mechanism for controlling _when_ and _how_ components update.
245
+
246
+ Components also have a `render()` method, but unlike React this method is passed `(props, state)` as arguments. This provides an ergonomic means to destructure `props` and `state` into local variables to be referenced from JSX.
247
+
248
+ Let's take a look at a very simple `Clock` component, which shows the current time.
249
+
250
+ ```js
251
+ import { h, render, Component } from 'preact';
252
+
253
+ class Clock extends Component {
254
+ render() {
255
+ let time = new Date();
256
+ return <time datetime={time.toISOString()}>{ time.toLocaleTimeString() }</time>;
257
+ }
258
+ }
259
+
260
+ // render an instance of Clock into <body>:
261
+ render(<Clock />, document.body);
262
+ ```
263
+
264
+
265
+ That's great. Running this produces the following HTML DOM structure:
266
+
267
+ ```html
268
+ <span>10:28:57 PM</span>
269
+ ```
270
+
271
+ In order to have the clock's time update every second, we need to know when `<Clock>` gets mounted to the DOM. _If you've used HTML5 Custom Elements, this is similar to the `attachedCallback` and `detachedCallback` lifecycle methods._ Preact invokes the following lifecycle methods if they are defined for a Component:
272
+
273
+ | Lifecycle method | When it gets called |
274
+ |-----------------------------|--------------------------------------------------|
275
+ | `componentWillMount` | before the component gets mounted to the DOM |
276
+ | `componentDidMount` | after the component gets mounted to the DOM |
277
+ | `componentWillUnmount` | prior to removal from the DOM |
278
+ | `componentWillReceiveProps` | before new props get accepted |
279
+ | `shouldComponentUpdate` | before `render()`. Return `false` to skip render |
280
+ | `componentWillUpdate` | before `render()` |
281
+ | `componentDidUpdate` | after `render()` |
282
+
283
+
284
+
285
+ So, we want to have a 1-second timer start once the Component gets added to the DOM, and stop if it is removed. We'll create the timer and store a reference to it in `componentDidMount()`, and stop the timer in `componentWillUnmount()`. On each timer tick, we'll update the component's `state` object with a new time value. Doing this will automatically re-render the component.
286
+
287
+ ```js
288
+ import { h, render, Component } from 'preact';
289
+
290
+ class Clock extends Component {
291
+ constructor() {
292
+ super();
293
+ // set initial time:
294
+ this.state = {
295
+ time: Date.now()
296
+ };
297
+ }
298
+
299
+ componentDidMount() {
300
+ // update time every second
301
+ this.timer = setInterval(() => {
302
+ this.setState({ time: Date.now() });
303
+ }, 1000);
304
+ }
305
+
306
+ componentWillUnmount() {
307
+ // stop when not renderable
308
+ clearInterval(this.timer);
309
+ }
310
+
311
+ render(props, state) {
312
+ let time = new Date(state.time).toLocaleTimeString();
313
+ return <span>{ time }</span>;
314
+ }
315
+ }
316
+
317
+ // render an instance of Clock into <body>:
318
+ render(<Clock />, document.body);
319
+ ```
320
+
321
+ Now we have [a ticking clock](http://jsfiddle.net/developit/u9m5x0L7/embedded/result,js/)!
322
+
323
+
324
+ ### Props & State
325
+
326
+ The concept (and nomenclature) for `props` and `state` is the same as in React. `props` are passed to a component by defining attributes in JSX, `state` is internal state. Changing either triggers a re-render, though by default Preact re-renders Components asynchronously for `state` changes and synchronously for `props` changes. You can tell Preact to render `prop` changes asynchronously by setting `options.syncComponentUpdates` to `false`.
327
+
328
+
329
+ ---
330
+
331
+
332
+ ## Linked State
333
+
334
+ One area Preact takes a little further than React is in optimizing state changes. A common pattern in ES2015 React code is to use Arrow functions within a `render()` method in order to update state in response to events. Creating functions enclosed in a scope on every render is inefficient and forces the garbage collector to do more work than is necessary.
335
+
336
+ One solution to this is to bind component methods declaratively.
337
+ Here is an example using [decko](http://git.io/decko):
338
+
339
+ ```js
340
+ class Foo extends Component {
341
+ @bind
342
+ updateText(e) {
343
+ this.setState({ text: e.target.value });
344
+ }
345
+ render({ }, { text }) {
346
+ return <input value={text} onInput={this.updateText} />;
347
+ }
348
+ }
349
+ ```
350
+
351
+ While this achieves much better runtime performance, it's still a lot of unnecessary code to wire up state to UI.
352
+
353
+ Fortunately there is a solution, in the form of a module called [linkstate](https://github.com/developit/linkstate). Calling `linkState(component, 'text')` returns a function that accepts an Event and uses its associated value to update the given property in your component's state. Calls to `linkState()` with the same arguments are cached, so there is no performance penalty. Here is the previous example rewritten using _Linked State_:
354
+
355
+ ```js
356
+ import linkState from 'linkstate';
357
+
358
+ class Foo extends Component {
359
+ render({ }, { text }) {
360
+ return <input value={text} onInput={linkState(this, 'text')} />;
361
+ }
362
+ }
363
+ ```
364
+
365
+ Simple and effective. It handles linking state from any input type, or an optional second parameter can be used to explicitly provide a keypath to the new state value.
366
+
367
+ > **Note:** In Preact 7 and prior, `linkState()` was built right into Component. In 8.0, it was moved to a separate module. You can restore the 7.x behavior by using linkstate as a polyfill - see [the linkstate docs](https://github.com/developit/linkstate#usage).
368
+
369
+
370
+
371
+ ## Examples
372
+
373
+ Here is a somewhat verbose Preact `<Link>` component:
374
+
375
+ ```js
376
+ class Link extends Component {
377
+ render(props, state) {
378
+ return <a href={props.href}>{props.children}</a>;
379
+ }
380
+ }
381
+ ```
382
+
383
+ Since this is ES6/ES2015, we can further simplify:
384
+
385
+ ```js
386
+ class Link extends Component {
387
+ render({ href, children }) {
388
+ return <a {...{ href, children }} />;
389
+ }
390
+ }
391
+
392
+ // or, for wide-open props support:
393
+ class Link extends Component {
394
+ render(props) {
395
+ return <a {...props} />;
396
+ }
397
+ }
398
+
399
+ // or, as a stateless functional component:
400
+ const Link = ({ children, ...props }) => (
401
+ <a {...props}>{ children }</a>
402
+ );
403
+ ```
404
+
405
+
406
+ ## Extensions
407
+
408
+ It is likely that some projects based on Preact would wish to extend Component with great new functionality.
409
+
410
+ Perhaps automatic connection to stores for a Flux-like architecture, or mixed-in context bindings to make it feel more like `React.createClass()`. Just use ES2015 inheritance:
411
+
412
+ ```js
413
+ class BoundComponent extends Component {
414
+ constructor(props) {
415
+ super(props);
416
+ this.bind();
417
+ }
418
+ bind() {
419
+ this.binds = {};
420
+ for (let i in this) {
421
+ this.binds[i] = this[i].bind(this);
422
+ }
423
+ }
424
+ }
425
+
426
+ // example usage
427
+ class Link extends BoundComponent {
428
+ click() {
429
+ open(this.href);
430
+ }
431
+ render() {
432
+ let { click } = this.binds;
433
+ return <span onclick={ click }>{ children }</span>;
434
+ }
435
+ }
436
+ ```
437
+
438
+
439
+ The possibilities are pretty endless here. You could even add support for rudimentary mixins:
440
+
441
+ ```js
442
+ class MixedComponent extends Component {
443
+ constructor() {
444
+ super();
445
+ (this.mixins || []).forEach( m => Object.assign(this, m) );
446
+ }
447
+ }
448
+ ```
449
+
450
+ ## Debug Mode
451
+
452
+ You can inspect and modify the state of your Preact UI components at runtime using the
453
+ [React Developer Tools](https://github.com/facebook/react-devtools) browser extension.
454
+
455
+ 1. Install the [React Developer Tools](https://github.com/facebook/react-devtools) extension
456
+ 2. Import the "preact/debug" module in your app
457
+ 3. Set `process.env.NODE_ENV` to 'development'
458
+ 4. Reload and go to the 'React' tab in the browser's development tools
459
+
460
+
461
+ ```js
462
+ import { h, Component, render } from 'preact';
463
+
464
+ // Enable debug mode. You can reduce the size of your app by only including this
465
+ // module in development builds. eg. In Webpack, wrap this with an `if (module.hot) {...}`
466
+ // check.
467
+ require('preact/debug');
468
+ ```
469
+
470
+ ### Runtime Error Checking
471
+
472
+ To enable debug mode, you need to set `process.env.NODE_ENV=development`. You can do this
473
+ with webpack via a builtin plugin.
474
+
475
+ ```js
476
+ // webpack.config.js
477
+
478
+ // Set NODE_ENV=development to enable error checking
479
+ new webpack.DefinePlugin({
480
+ 'process.env': {
481
+ 'NODE_ENV': JSON.stringify('development')
482
+ }
483
+ });
484
+ ```
485
+
486
+ When enabled, warnings are logged to the console when undefined components or string refs
487
+ are detected.
488
+
489
+ ### Developer Tools
490
+
491
+ If you only want to include devtool integration, without runtime error checking, you can
492
+ replace `preact/debug` in the above example with `preact/devtools`. This option doesn't
493
+ require setting `NODE_ENV=development`.
494
+
495
+
496
+
497
+ ## Backers
498
+ Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/preact#backer)]
499
+
500
+ <a href="https://opencollective.com/preact/backer/0/website" target="_blank"><img src="https://opencollective.com/preact/backer/0/avatar.svg"></a>
501
+ <a href="https://opencollective.com/preact/backer/1/website" target="_blank"><img src="https://opencollective.com/preact/backer/1/avatar.svg"></a>
502
+ <a href="https://opencollective.com/preact/backer/2/website" target="_blank"><img src="https://opencollective.com/preact/backer/2/avatar.svg"></a>
503
+ <a href="https://opencollective.com/preact/backer/3/website" target="_blank"><img src="https://opencollective.com/preact/backer/3/avatar.svg"></a>
504
+ <a href="https://opencollective.com/preact/backer/4/website" target="_blank"><img src="https://opencollective.com/preact/backer/4/avatar.svg"></a>
505
+ <a href="https://opencollective.com/preact/backer/5/website" target="_blank"><img src="https://opencollective.com/preact/backer/5/avatar.svg"></a>
506
+ <a href="https://opencollective.com/preact/backer/6/website" target="_blank"><img src="https://opencollective.com/preact/backer/6/avatar.svg"></a>
507
+ <a href="https://opencollective.com/preact/backer/7/website" target="_blank"><img src="https://opencollective.com/preact/backer/7/avatar.svg"></a>
508
+ <a href="https://opencollective.com/preact/backer/8/website" target="_blank"><img src="https://opencollective.com/preact/backer/8/avatar.svg"></a>
509
+ <a href="https://opencollective.com/preact/backer/9/website" target="_blank"><img src="https://opencollective.com/preact/backer/9/avatar.svg"></a>
510
+ <a href="https://opencollective.com/preact/backer/10/website" target="_blank"><img src="https://opencollective.com/preact/backer/10/avatar.svg"></a>
511
+ <a href="https://opencollective.com/preact/backer/11/website" target="_blank"><img src="https://opencollective.com/preact/backer/11/avatar.svg"></a>
512
+ <a href="https://opencollective.com/preact/backer/12/website" target="_blank"><img src="https://opencollective.com/preact/backer/12/avatar.svg"></a>
513
+ <a href="https://opencollective.com/preact/backer/13/website" target="_blank"><img src="https://opencollective.com/preact/backer/13/avatar.svg"></a>
514
+ <a href="https://opencollective.com/preact/backer/14/website" target="_blank"><img src="https://opencollective.com/preact/backer/14/avatar.svg"></a>
515
+ <a href="https://opencollective.com/preact/backer/15/website" target="_blank"><img src="https://opencollective.com/preact/backer/15/avatar.svg"></a>
516
+ <a href="https://opencollective.com/preact/backer/16/website" target="_blank"><img src="https://opencollective.com/preact/backer/16/avatar.svg"></a>
517
+ <a href="https://opencollective.com/preact/backer/17/website" target="_blank"><img src="https://opencollective.com/preact/backer/17/avatar.svg"></a>
518
+ <a href="https://opencollective.com/preact/backer/18/website" target="_blank"><img src="https://opencollective.com/preact/backer/18/avatar.svg"></a>
519
+ <a href="https://opencollective.com/preact/backer/19/website" target="_blank"><img src="https://opencollective.com/preact/backer/19/avatar.svg"></a>
520
+ <a href="https://opencollective.com/preact/backer/20/website" target="_blank"><img src="https://opencollective.com/preact/backer/20/avatar.svg"></a>
521
+ <a href="https://opencollective.com/preact/backer/21/website" target="_blank"><img src="https://opencollective.com/preact/backer/21/avatar.svg"></a>
522
+ <a href="https://opencollective.com/preact/backer/22/website" target="_blank"><img src="https://opencollective.com/preact/backer/22/avatar.svg"></a>
523
+ <a href="https://opencollective.com/preact/backer/23/website" target="_blank"><img src="https://opencollective.com/preact/backer/23/avatar.svg"></a>
524
+ <a href="https://opencollective.com/preact/backer/24/website" target="_blank"><img src="https://opencollective.com/preact/backer/24/avatar.svg"></a>
525
+ <a href="https://opencollective.com/preact/backer/25/website" target="_blank"><img src="https://opencollective.com/preact/backer/25/avatar.svg"></a>
526
+ <a href="https://opencollective.com/preact/backer/26/website" target="_blank"><img src="https://opencollective.com/preact/backer/26/avatar.svg"></a>
527
+ <a href="https://opencollective.com/preact/backer/27/website" target="_blank"><img src="https://opencollective.com/preact/backer/27/avatar.svg"></a>
528
+ <a href="https://opencollective.com/preact/backer/28/website" target="_blank"><img src="https://opencollective.com/preact/backer/28/avatar.svg"></a>
529
+ <a href="https://opencollective.com/preact/backer/29/website" target="_blank"><img src="https://opencollective.com/preact/backer/29/avatar.svg"></a>
530
+
531
+
532
+ ## Sponsors
533
+ Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor](https://opencollective.com/preact#sponsor)]
534
+
535
+ <a href="https://opencollective.com/preact/sponsor/0/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/0/avatar.svg"></a>
536
+ <a href="https://opencollective.com/preact/sponsor/1/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/1/avatar.svg"></a>
537
+ <a href="https://opencollective.com/preact/sponsor/2/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/2/avatar.svg"></a>
538
+ <a href="https://opencollective.com/preact/sponsor/3/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/3/avatar.svg"></a>
539
+ <a href="https://opencollective.com/preact/sponsor/4/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/4/avatar.svg"></a>
540
+ <a href="https://opencollective.com/preact/sponsor/5/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/5/avatar.svg"></a>
541
+ <a href="https://opencollective.com/preact/sponsor/6/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/6/avatar.svg"></a>
542
+ <a href="https://opencollective.com/preact/sponsor/7/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/7/avatar.svg"></a>
543
+ <a href="https://opencollective.com/preact/sponsor/8/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/8/avatar.svg"></a>
544
+ <a href="https://opencollective.com/preact/sponsor/9/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/9/avatar.svg"></a>
545
+ <a href="https://opencollective.com/preact/sponsor/10/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/10/avatar.svg"></a>
546
+ <a href="https://opencollective.com/preact/sponsor/11/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/11/avatar.svg"></a>
547
+ <a href="https://opencollective.com/preact/sponsor/12/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/12/avatar.svg"></a>
548
+ <a href="https://opencollective.com/preact/sponsor/13/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/13/avatar.svg"></a>
549
+ <a href="https://opencollective.com/preact/sponsor/14/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/14/avatar.svg"></a>
550
+ <a href="https://opencollective.com/preact/sponsor/15/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/15/avatar.svg"></a>
551
+ <a href="https://opencollective.com/preact/sponsor/16/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/16/avatar.svg"></a>
552
+ <a href="https://opencollective.com/preact/sponsor/17/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/17/avatar.svg"></a>
553
+ <a href="https://opencollective.com/preact/sponsor/18/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/18/avatar.svg"></a>
554
+ <a href="https://opencollective.com/preact/sponsor/19/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/19/avatar.svg"></a>
555
+ <a href="https://opencollective.com/preact/sponsor/20/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/20/avatar.svg"></a>
556
+ <a href="https://opencollective.com/preact/sponsor/21/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/21/avatar.svg"></a>
557
+ <a href="https://opencollective.com/preact/sponsor/22/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/22/avatar.svg"></a>
558
+ <a href="https://opencollective.com/preact/sponsor/23/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/23/avatar.svg"></a>
559
+ <a href="https://opencollective.com/preact/sponsor/24/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/24/avatar.svg"></a>
560
+ <a href="https://opencollective.com/preact/sponsor/25/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/25/avatar.svg"></a>
561
+ <a href="https://opencollective.com/preact/sponsor/26/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/26/avatar.svg"></a>
562
+ <a href="https://opencollective.com/preact/sponsor/27/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/27/avatar.svg"></a>
563
+ <a href="https://opencollective.com/preact/sponsor/28/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/28/avatar.svg"></a>
564
+ <a href="https://opencollective.com/preact/sponsor/29/website" target="_blank"><img src="https://opencollective.com/preact/sponsor/29/avatar.svg"></a>
565
+
566
+ ## License
567
+
568
+ MIT
569
+
570
+
571
+
572
+ [![Preact](http://i.imgur.com/YqCHvEW.gif)](https://preactjs.com)
573
+
574
+
575
+ [preact-compat]: https://github.com/developit/preact-compat
576
+ [ES6 Class]: https://facebook.github.io/react/docs/reusable-components.html#es6-classes
577
+ [Functional Components]: https://facebook.github.io/react/blog/2015/10/07/react-v0.14.html#stateless-functional-components
578
+ [hyperscript]: https://github.com/dominictarr/hyperscript
579
+ [preact-boilerplate]: https://github.com/developit/preact-boilerplate
580
+ [lifecycle methods]: https://facebook.github.io/react/docs/component-specs.html