diff --git a/package.json b/package.json index a0e81e4..74484ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "snabbdom-react-components", - "version": "0.1.0-pre", + "version": "0.1.1-pre", "description": "React like, Snabbdom based, Virtual Dom framework for JavaScript Web Applications", "keywords": ["React", "Snabbdom", "VNode", "VDom", "Virtual Dom", "Virtual Node", "Styled Components", "Redux"], "main": "prod/src.cjs.js", diff --git a/prod/src.cjs.js b/prod/src.cjs.js index f1d936a..5770d2a 100644 --- a/prod/src.cjs.js +++ b/prod/src.cjs.js @@ -8454,30 +8454,17 @@ var styled$1 = styled_1.styled, css$1 = styled_1.css, cssWithProps$1 = styled_1.cssWithProps, cssWithPropsPlain$1 = styled_1.cssWithPropsPlain; -var src = component; -var h_1 = h; -var css_1 = css$1; -var lazy_1$1 = lazy_1; -var patch_1 = patch; -var styled_1$1 = styled$1; -var cssWithProps_1 = cssWithProps$1; -var cssWithPropsPlain_1 = cssWithPropsPlain$1; -var createAsyncComponent_1 = componentAsync; -src.h = h_1; -src.css = css_1; -src.lazy = lazy_1$1; -src.patch = patch_1; -src.styled = styled_1$1; -src.cssWithProps = cssWithProps_1; -src.cssWithPropsPlain = cssWithPropsPlain_1; -src.createAsyncComponent = createAsyncComponent_1; +var snabbomReactComponents = { + h: h, + css: css$1, + lazy: lazy_1, + patch: patch, + styled: styled$1, + cssWithProps: cssWithProps$1, + createComponent: component, + cssWithPropsPlain: cssWithPropsPlain$1, + createAsyncComponent: componentAsync +}; +var src = snabbomReactComponents; exports.default = src; -exports.h = h_1; -exports.css = css_1; -exports.lazy = lazy_1$1; -exports.patch = patch_1; -exports.styled = styled_1$1; -exports.cssWithProps = cssWithProps_1; -exports.cssWithPropsPlain = cssWithPropsPlain_1; -exports.createAsyncComponent = createAsyncComponent_1; diff --git a/prod/src.js b/prod/src.js index 467e351..690d70a 100644 --- a/prod/src.js +++ b/prod/src.js @@ -8448,23 +8448,17 @@ var styled$1 = styled_1.styled, css$1 = styled_1.css, cssWithProps$1 = styled_1.cssWithProps, cssWithPropsPlain$1 = styled_1.cssWithPropsPlain; -var src = component; -var h_1 = h; -var css_1 = css$1; -var lazy_1$1 = lazy_1; -var patch_1 = patch; -var styled_1$1 = styled$1; -var cssWithProps_1 = cssWithProps$1; -var cssWithPropsPlain_1 = cssWithPropsPlain$1; -var createAsyncComponent_1 = componentAsync; -src.h = h_1; -src.css = css_1; -src.lazy = lazy_1$1; -src.patch = patch_1; -src.styled = styled_1$1; -src.cssWithProps = cssWithProps_1; -src.cssWithPropsPlain = cssWithPropsPlain_1; -src.createAsyncComponent = createAsyncComponent_1; +var snabbomReactComponents = { + h: h, + css: css$1, + lazy: lazy_1, + patch: patch, + styled: styled$1, + cssWithProps: cssWithProps$1, + createComponent: component, + cssWithPropsPlain: cssWithPropsPlain$1, + createAsyncComponent: componentAsync +}; +var src = snabbomReactComponents; export default src; -export { h_1 as h, css_1 as css, lazy_1$1 as lazy, patch_1 as patch, styled_1$1 as styled, cssWithProps_1 as cssWithProps, cssWithPropsPlain_1 as cssWithPropsPlain, createAsyncComponent_1 as createAsyncComponent }; diff --git a/readme.md b/readme.md index 6ddca54..b22b87d 100644 --- a/readme.md +++ b/readme.md @@ -28,7 +28,7 @@ To render siplest **SRC** component, we will use Snabbdom vnode, eg. paragraph. Find more about `createComponent` function [here](#createComponent). ```javascript -import createComponent, { h, patch } from 'snabbdom-react-components' +import { createComponent, h, patch } from 'snabbdom-react-components' const myComponent = createComponent({ render: () => { @@ -45,7 +45,7 @@ One of the biggers benefits for using **SRC** is the React Based lifecycle mecha In this example, we will render a list of all the users, but for the time we don't have them, we will render loading message ```javascript -import createComponent, { h } from 'snabbdom-react-components' +import { createComponent, h } from 'snabbdom-react-components' const myComponent = createComponent({ state: { @@ -72,7 +72,7 @@ const myComponent = createComponent({ Along with component builder, **SRC** have build in [Styled Components](https://styled-components.com) builder we all love from React. It is not as powerfull yet. Yet 😇 ```javascript -import createComponent, { styled } from 'snabbdom-react-components' +import { createComponent, styled } from 'snabbdom-react-components' const Button = styled.button` color: ${props => !props.toggled ? '#fff' : '#4f4f4f'}; @@ -104,7 +104,7 @@ const myComponent = createComponent({ Redux for good become one of the best state managing liblaries. Based on that, **SRC** has build-in simpler and easier, but powerfull reducer functionality ```javascript -import createComponent, { styled } from 'snabbdom-react-components' +import { createComponent, styled } from 'snabbdom-react-components' const Info = styled.div` color: #4f4f4f; @@ -241,7 +241,7 @@ This is the more advanced version of simple `createComponent` method. **Is is hi The main diffrence between `createComponent` function is that this component by default is returned as `async` function throught the `lazy` helper. That's allow you to organize your code even more! Look at example. We will get the list of all the users and display as a list: ```javascript -import createComponent, { styled, createAsyncComponent } from 'snabbdom-react-components' +import { createComponent, styled, createAsyncComponent } from 'snabbdom-react-components' const Info = styled.div` color: #4f4f4f; diff --git a/src.js b/src.js index 4c93d8b..c0be964 100644 --- a/src.js +++ b/src.js @@ -5,13 +5,16 @@ const createComponent = require('./modules/component.js') const createAsyncComponent = require('./modules/component-async.js') const { styled, css, cssWithProps, cssWithPropsPlain } = require('./modules/styled') -module.exports = createComponent +const snabbomReactComponents = { + h: h, + css: css, + lazy: lazy, + patch: patch, + styled: styled, + cssWithProps: cssWithProps, + createComponent: createComponent, + cssWithPropsPlain: cssWithPropsPlain, + createAsyncComponent: createAsyncComponent +} -module.exports.h = h -module.exports.css = css -module.exports.lazy = lazy -module.exports.patch = patch -module.exports.styled = styled -module.exports.cssWithProps = cssWithProps -module.exports.cssWithPropsPlain = cssWithPropsPlain -module.exports.createAsyncComponent = createAsyncComponent +module.exports = snabbomReactComponents