0.2.4 • Published 7 years ago

next-library v0.2.4

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

Next.js Library

next-library

Next.js Library aims to provide a set of configs, queries and states for your Next.js project. The file structure follows Atomic Design because we're not designing pages, we're designing components. The goal is to not be restricted in the technologies used by offering a full modularity. Think of it like some of the Next.js official examples, available as HOCs through this package.


This package is a work in progress.

Code of conduct for contributions will follow. Many thanks to RAN for the inspiration.


NPM

next-library

Table of contents

Configs

initData

The default initData uses Apollo and Redux. initDataRelay will be available when possible. Open to suggestions for additionnal initial data HOCs.

Situation : automatic initData, initApollo and initRedux.

Solution : With the official Next.js example In pages/index.js replace withData by initData from this library.

import { initData } from 'next-library'
import App from '../components/App'
import Header from '../components/Header'
import Submit from '../components/Submit'
import PostList from '../components/PostList'

export default initData((props) => (
  <App>
    <Header pathname={props.url.pathname} />
    <Submit />
    <PostList />
  </App>
))

Your benefit : Voilà, Now all your apps using this will have this initData up-to-date through this package (feel free to contribute).

Note : initData is a customized version of withData from the with-apollo-and-redux next.js official example.

initRedux

Situation : custom initData automatic initRedux.

Solution : With the official Next.js example In lib/withData.js replace

import initRedux from './initRedux'

with

import {initRedux} from 'next-library'

Your benefit : Now all your apps using this will have this initRedux up-to-date through this package (feel free to contribute).

Note : initRedux is a customized version of initRedux from the with-apollo-and-redux next.js official example. It contains additional token authentication matters.

initApollo

Situation : custom initData automatic initApollo

Solution : With the official Next.js example In lib/withData.js replace

import initApollo from './initApollo'

with

import {initApollo} from 'next-library'

Your benefit : Now all your apps using this will have this initApollo up-to-date through this package (feel free to contribute).

Note : initApollo is a customized version of initApollo from the with-apollo-and-redux next.js official example. It contains additional token authentication matters and dispatchers.

States

WIP

Todo

  • Make initData available
  • Make initRedux available
  • Make initApollo available
  • Add ESLint rules
  • States check each HOC
  • Queries folder add GraphQL
  • Add Todo's (hah)
0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago