See the docs at https://adslot.github.io/adslot-ui/
A library of core components used to develop our Adslot and Symphony products. This includes Alexandria and third-party restyled components, e.g. Bootstrap.
Technology:
-
Take a look at our Contributing guidelines
-
Clone the repo:
git clone git@github.com:Adslot/adslot-ui.git
-
Install NPM dependencies:
npm i
# Start for development
npm start
# Start the dev-server without automatic refresh
npm run start:cold
# Just build the dist version and copy static files
npm run dist
# Lint all files in src (also automatically run after tests)
npm run lint
# Run tests and posttest linting
npm run test [-- --no-coverage]
# Run tests and rebuild on file changes.
npm run test:watch [--file=<path>] [--coverage]
Adslot UI:
As simple as running the scaffold
command which will create your new Adslot UI component from /component-template
.
npm run scaffold MyComponentName
You'll get an index.jsx
, index.spec.jsx
and styles.scss
created under src/components/adslot-ui/MyComponentName
.
Alexandria:
We don't have a command for generating Alexandria components.
Create a directory for the component, and put all related files in there. You can copy /component-template
to help.
To generate a profile: npm run profile
Upload the new stats.json
file to Webpack Analyse Tool.
Add the following to /docs/Layout/index.jsx:
import Perf from 'react-addons-perf';
window.Perf = Perf;
- In the browser, run
Perf.start()
to start recording. - Interact the component in the way that feels slow.
- Run
Perf.stop()
to stop recording. - Run
Perf.printWasted()
to see the nodes that are re–rendering but do not change the DOM. - Use fastStatelessWrapper to wrap this component, passing in the properties to check.
- Re-test to make sure you're improving performance.