Comparing version 0.5.0 to 0.5.1
@@ -0,0 +0,0 @@ import { render, TemplateResult } from 'lit-html'; |
import { render } from 'lit-html'; | ||
import { render as shadyRender } from 'lit-html/lib/shady-render'; | ||
import isFunction from 'lodash-es/isFunction'; | ||
import { bindActionCreators } from 'redux'; | ||
@@ -60,5 +59,6 @@ /* tslint:disable:max-line-length */ | ||
while (node = node.parentNode || node.host) { | ||
if (isReduxStore(node._store || node.reduxStore)) { | ||
this._store = node._store || node.reduxStore; | ||
return this._store; | ||
const maybeStore = node._store || node.reduxStore; | ||
if (isReduxStore(maybeStore)) { | ||
this._store = maybeStore; | ||
return maybeStore; | ||
} | ||
@@ -92,2 +92,6 @@ } | ||
} | ||
// tslint:disable-next-line:ban-types | ||
function isFunction(f) { | ||
return typeof f === 'function'; | ||
} | ||
function isReduxStore(obj) { | ||
@@ -94,0 +98,0 @@ return obj && obj.getState && obj.dispatch && obj.subscribe; |
@@ -0,0 +0,0 @@ export { default as connect } from './connect'; |
@@ -0,0 +0,0 @@ import { Store } from 'redux'; |
@@ -0,0 +0,0 @@ import { ClassConstructor } from '.'; |
{ | ||
"name": "fit-html", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "5KB functional Web Components without bloat", | ||
@@ -11,4 +11,20 @@ "main": "dist/index.js", | ||
"private": false, | ||
"bundlesize": [ | ||
{ | ||
"path": "dist/bundle.min.js", | ||
"maxSize": "2 kb" | ||
}, | ||
{ | ||
"path": "dist/bundle+deps.min.js", | ||
"maxSize": "5 kb" | ||
} | ||
], | ||
"devDependencies": { | ||
"@types/lodash-es": "^4.17.0", | ||
"bundlesize": "^0.16.0", | ||
"rollup": "^0.56.2", | ||
"rollup-plugin-babel-minify": "^4.0.0", | ||
"rollup-plugin-commonjs": "^8.3.0", | ||
"rollup-plugin-node-resolve": "^3.0.3", | ||
"rollup-plugin-typescript2": "^0.11.1", | ||
"tslint": "^5.9.1", | ||
@@ -19,3 +35,2 @@ "typescript": "^2.5.3" | ||
"lit-html": "^0.9.0", | ||
"lodash-es": "^4.17.4", | ||
"redux": "^3.7.2" | ||
@@ -25,2 +40,3 @@ }, | ||
"build": "yarn lint && tsc", | ||
"check-size": "rollup -c && bundlesize && rm dist/bundle*", | ||
"fix": "tslint -p tsconfig.json --fix", | ||
@@ -27,0 +43,0 @@ "lint": "tslint -p tsconfig.json" |
@@ -10,3 +10,3 @@ # 💪 fit-html | ||
fit-html is a combination of [lit-html](https://github.com/PolymerLabs/lit-html), web components and [redux](http://redux.js.org/) bringing efficient rendering and a functional application architecture together. Yet, it still manages to keep the total size of the framework below 5KB<sup>1</sup>, including dependencies. | ||
fit-html is a combination of [lit-html](https://github.com/Polymer/lit-html), web components and [redux](http://redux.js.org/) bringing efficient rendering and a functional application architecture together. Yet, the total size of the framework is below 5KB<sup>1</sup>, including dependencies. | ||
@@ -18,3 +18,3 @@ ## Small Example | ||
import { connect, createProvider, withExtended } from 'fit-html'; | ||
import { html } from 'lit-html'; | ||
import { html } from 'lit-html/lib/lit-extended'; | ||
import { createStore } from 'redux'; | ||
@@ -62,7 +62,7 @@ ``` | ||
const TodosApp = withExtended(connect( | ||
const TodosApp = connect( | ||
state => ({ todos: state }), | ||
{ addTodo }, | ||
render | ||
)); | ||
); | ||
@@ -88,2 +88,6 @@ customElements.define('todo-app', TodosApp); | ||
## Compatibility | ||
💪-html is written for use with evergreen browsers. Not so much for Internet Explorer (though we strive to become compatible with IE11 once lit-html itself is). | ||
## License | ||
@@ -93,2 +97,2 @@ | ||
<sup>1</sup>: Actually 4k right now | ||
<sup>1</sup>: fit-html weighs in at about 3.2kb right now |
import { render, PartCallback, TemplateResult } from 'lit-html'; | ||
import { render as shadyRender } from 'lit-html/lib/shady-render'; | ||
import isFunction from 'lodash-es/isFunction'; | ||
import { bindActionCreators, ActionCreatorsMapObject, Dispatch, Store, Unsubscribe } from 'redux'; | ||
@@ -158,5 +157,6 @@ | ||
while (node = node.parentNode || node.host) { | ||
if (isReduxStore<S>(node._store || node.reduxStore)) { | ||
this._store = node._store || node.reduxStore; | ||
return this._store; | ||
const maybeStore = node._store || node.reduxStore; | ||
if (isReduxStore<S>(maybeStore)) { | ||
this._store = maybeStore; | ||
return maybeStore; | ||
} | ||
@@ -204,2 +204,7 @@ } | ||
// tslint:disable-next-line:ban-types | ||
function isFunction(f: any): f is Function { | ||
return typeof f === 'function'; | ||
} | ||
function isReduxStore<S>(obj: any): obj is Store<S> { | ||
@@ -206,0 +211,0 @@ return obj && obj.getState && obj.dispatch && obj.subscribe; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114558
2
24
820
94
9
- Removedlodash-es@^4.17.4