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

refactor #7

Open
jimdebeer opened this issue Apr 6, 2017 · 5 comments
Open

refactor #7

jimdebeer opened this issue Apr 6, 2017 · 5 comments

Comments

@jimdebeer
Copy link
Contributor

jimdebeer commented Apr 6, 2017

COMPILER

  • COMPONENT TARGET
    • all combinations of subs
  • STATE ANALYSIS
    • find all uses of state and map it to a subscription

RENDER-FN

  • RENDER TARGETS (ENGINE)
    • SERVER
    • DOM
  • ORDER
  • STYLE
  • EVENTS

use this repo to refactor to final version of brisky
brisky will become a 1 - 1 react compatible framework

@jimdebeer
Copy link
Contributor Author

jimdebeer commented Apr 6, 2017

will do stateless components only

@jimdebeer
Copy link
Contributor Author

propTypes -- maybe add this

@jimdebeer
Copy link
Contributor Author

jimdebeer commented Apr 6, 2017

@jimdebeer
Copy link
Contributor Author

jimdebeer commented Apr 6, 2017

hard part, and essential

passing components as props -- very common pattern in react land

mixing switch with non state props (that do not live on the hub)

@youzi
Copy link
Contributor

youzi commented Apr 6, 2017

import { App, Head, Body, Page, Menu } from '@vigour-io/swan'

const Carousel = props => <div>
  <div>{ props.title }</div>
  <div>{ props.items.map(p => <div>{ p.title }</div>) }</div>
</div>

const Grid = props => <div>
  <div>{ props.title }</div>
  <div>{ props.items.map(p => <div>{ p.title }</div>) }</div>
</div>

export default props => <App>
  <Head />
  <Body>
    <Menu />
    <Page>
      { props.currentPage.map(p => {
        if (p.component === 'Carousel') {
          return <Carousel title={p.title} items={p.items} />
        } else {
          return <Grid {...p} />
        }
      }) }
    </Page>
  </Body>
</App>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants