This is a package of shared react client components and utilities for build packages that work with IMS.
bash
$ npm install --save ims-shared-client
`Application Bootstrapping
Version 3.5 introduces a bootstrapper to simplify wiring up the react application and to make that process more consistent. For details on using the application bootstrapper see the IMS Application Bootstrapper documentation. Version 3.0 Breaking change
Version 3.0 introduces a PackageInformation object that must be created at the app launch. You must call PackageInformation.configure with your package information.`js
import { PackageInformation } from 'ims-shared-client'
const packageInfo = require('../../shared/ims')
PackageInformation.configure(packageInfo)
`If you do not, BaseComponent, ScopedComponent, request, and SecureLink will not work correctly.
To do:
- ~~Refactor FeedbackButton to use PackageInformation~~ Completed in 3.0.12
- ~~Refactor ReleaseNotesButton to use PackageInformation~~ Compelted in 3.0.12
Version 2.0 Breaking change
Version 2.0 introduces a new version of the request library that is connected with the redux store. Components from the shared library such as UserAutosuggest and AreaPicker require the request library be prepared to be used.Example: app/store/createStore.js
`js
/// Other imports here
import { prepareRequest } from 'ims-shared-client/request'/// Later in file...
// ======================================================
// Store Instantiation and HMR Setup
// ======================================================
const store = createStore(
makeRootReducer(),
fromJS(initialState),
compose(
applyMiddleware(...middleware),
...enhancers
)
)
prepareRequest(store, 'global.tokens')
`$3
`js
import request from 'ims-shared-client/request'
function* mySaga (action) {
yield call(request, '/api/endpoint', requestOptions)
}
`Sample Usage
`js
import React from 'react'
import { LoadingIndicator } from 'ims-shared-client'class MyComponent extends React.Component {
render () {
return (
)
}
}
`$3
This package requires that Twitter Bootstrap (e.g. `bootstrap.min.css`` ) be included in your page to render properly.