basalplatten
Core components for building UIs the Fountainhead way
Last updated 3 years ago by warrenseymour .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install basalplatten 
SYNC missed versions from official npm registry.

Build Status Coverage Status

BasalPlatten

BasalPlatten ('Base Plate') is a collection of core components and utilities to help build UIs, the 'Fountainhead' way.

Much like a 'seed' or 'boilerplate' project, it is intended to offer a 'quick-start' way of initalizing a new project. However, unlike similar projects, it is not intended to be 'forked' each time you start a new project.

Instead, simply install BasalPlatten as an NPM module:

$ npm install --save basalplatten

BasalPlatten assumes the following architecture and conventions:

Webpack2 Configuration

Generate a Webpack2-compatible configuration using basalplatten/webpack/config:

// webpack.config.js
const {buildConfig} = require('basalplatten/webpack/config');

module.exports = buildConfig('myApp');

buildConfig accepts a second options object, which will be merged in with the default options. Alternatively, you may mutate the returned configuration object before exporting it.

Without any custom options or mutations, the webpack configuration will provide the following:

  • Hot Module Reloading (using React Hot Loader 3.0 Beta 6)
  • TypeScript 2.0 (using Awesome TypeScript Loader)
    • Entry point: src/index.tsx
    • Babel compilation step (required by Ant Design's homebrew tree-shaking strategy)
  • Less compilation
    • .less files ending in .inline.less will be embedded into index.html, useful for styling the IPL
  • Dev Server configuration
    • Sets up a proxy to a backend API running at localhost:8080 at /api

UI-Router

Create a UI-Router instance pre-configured with all of our favourite things using basalplatten/ui-router:

// AppEntryPoint.jsx
const {UIRouter} = require('@uirouter/react');
const {buildRouter} = require('basalplatten/ui-router');

var router = buildRouter();
router.stateRegistry.register({
  // ... your state definitions
});

<UIRouter router={router}>
  <UIView/>
</UIRouter>

The buildRouter factory provides you with a UI-Router instance preconfigured with our favourite things:

  • Reactive Extensions plugin so that you can .observe() state parameter changes directly from components
  • A default error handler that displays an Error Notification when a state transition fails
  • A URL routing handler that display a Notification and redirects to / when attempting to access a URL which does not match a state
  • Custom parameter types

UI-Router Parameter Types

A handful of custom parameter types that are useful for serializing state such as filter and order criteria from data tables into the URL. We use these types over the built-on json type as they're a little friendlier on the (human) eye.

If you use the buildRouter factory function in basalplatten/ui-router, then these types are already registered with the router instance and ready to use. Otherwise, you'll need to register them manually:

const {where} = require('basalplatten/ui-router/paramTypes');

router.urlMatcherFactory.type('where', where);

where

A parameter with the where type and following value:

{
  "user_id": "13",
  "owner_id": "37",
  "status": ["completed", "failed"]
}

Will be encoded into the URL as ?user_id:13!owner_id:37!~status:completed,failed.

order

A parameter with the order type and following value:

{
  "created_at": "desc"
}

Will be encoded into the URL as ?created_at:desc.

Current Tags

  • 1.30.0                                ...           latest (3 years ago)

42 Versions

  • 1.30.0                                ...           3 years ago
  • 1.29.0                                ...           3 years ago
  • 1.28.0                                ...           3 years ago
  • 1.27.0                                ...           3 years ago
  • 1.26.0                                ...           3 years ago
  • 1.25.0                                ...           3 years ago
  • 1.24.0                                ...           3 years ago
  • 1.23.0                                ...           3 years ago
  • 1.22.0                                ...           3 years ago
  • 1.21.0                                ...           3 years ago
  • 1.20.0                                ...           3 years ago
  • 1.19.0                                ...           3 years ago
  • 1.18.0                                ...           3 years ago
  • 1.17.0                                ...           3 years ago
  • 1.16.0                                ...           3 years ago
  • 1.15.0                                ...           3 years ago
  • 1.14.0                                ...           3 years ago
  • 1.13.0                                ...           3 years ago
  • 1.12.0                                ...           3 years ago
  • 1.11.0                                ...           3 years ago
  • 1.10.0                                ...           3 years ago
  • 1.9.0                                ...           3 years ago
  • 1.8.0                                ...           3 years ago
  • 1.7.0                                ...           3 years ago
  • 1.6.1                                ...           3 years ago
  • 1.6.0                                ...           3 years ago
  • 1.5.1                                ...           3 years ago
  • 1.5.0                                ...           3 years ago
  • 1.4.0                                ...           3 years ago
  • 1.3.0                                ...           3 years ago
  • 1.2.3                                ...           3 years ago
  • 1.2.2                                ...           3 years ago
  • 1.2.1                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.6                                ...           3 years ago
  • 1.1.5                                ...           3 years ago
  • 1.1.4                                ...           3 years ago
  • 1.1.3                                ...           3 years ago
  • 1.1.2                                ...           3 years ago
  • 1.1.1                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (40)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |