The NGNX Chassis JS library extends the NGN platform. It consists of opinionated building blocks that are of use but do not fit the more generic nature of NGN.
Installation Options:
- CDN
- Bower
- npm
The easiest way (recommended for development) to use Chassis extensions is via a CDN.
<script src="//cdn.jsdelivr.net/chassis/latest/chassis.x.min.js"></script>
You can also specify a specific release instead
of using latest
.
Chassis extensions are relatively small, but they're growing in number. It is useful to have all extensions available during development, but production use will be more performant using only what is necessary.
You can generate a custom URL with the JSDelivr CDN.
You can see a list of all available individual components. Any file that doesn't begin
with chassis.___
is an individual component. Keep in mind that some components rely on
others. Since these dependencies may change as this library evolves, we've embedded
warnings. If something doesn't look right, your console output should give you
a clue.
If you use bower to manage UI dependencies, you can install & use it as follows:
bower install x-chassis
In your HTML:
<html>
<head>
<script src="bower_components/chassis/dist/chassis.x.min.js"></script>
</head>
<body>
...
</body>
</html>
The npm installation is designed for projects in a node-like environment, such as electron or NW.js. Usage is straightforward:
npm install ngnx-chassis
require('ngnx-chassis')(function () {
// ... code ...
})
This automatically creates the NGNX
global variable supporting the full Chassis
extension library. It dynamically adds the Chassis extension <script>
tag to
the head
of the rendered HTML page and executes the callback when complete.
Find an error in Chassis Extensions? Unminified versions are available (full library only) through the rawgit CDN. You must specify the version as shown below.
<script src="//cdn.rawgit.com/ngnjs/chassis-lib/<version>/dist/chassis.dev.js"></script>
If you encounter an issue, please file it in the issues. We'll do our best to fix problems in a timely manner, but remember this is software we voluntarily support (one of several projects).
If you want to expedite resolution, one of the most effective ways to do so is to write a regression test. By adding a regression test, you're recreating the issue, saving us alot of time.
If you want to hack on Chassis Extensions, fork the repository and make your changes. Make sure they pass the existing unit tests, and (if appropriate) add new unit tests.
Chassis uses karma and tap/tape for unit testing. For pre-production CI testing, we use Sauce Labs to test against a myriad of browsers. However; this can be a time consuming process when making lots of changes or simple small updates.
To make development easier, there is a separate npm script for running a "gut check" within your
local development environment: npm run-script localtest
. It only tests against Chrome, which
must be installed on your local computer to work. This opens a new Chrome window, runs the tests, then closes Chrome. Again, this is a "gut check" designed for rapid local development. Most tests
that pass in Chrome will pass is other modern browsers, but not everything. If you have concerns,
check caniuse.com to see what is supported and what isn't.
At this time, Chassis targets support for Chrome 40+, Firefox 31+, IE 11, Edge 13, Safari 9, and Opera 27. Since Opera tracks Chrome, we're not terribly concerned with Opera tests as long as Chrome tests pass. When Microsoft Edge support becomes more prevalent, we will eventually drop IE support.