1.0.0-alpha.1 • Published 9 years ago
spa-engine v1.0.0-alpha.1
Single Page Application Exercise
A simple Single Page Application engine.
Features and advantages of this project
- Unit tests.
- History management using the History API
- ES6 syntax
Am I missing some essential feature?
- Show a loading bar while the content is being loaded.
- Avoid SPA for links that have the "data-no-spa" data attribute.
Getting Started
Prerequisites
A running server is required for this library to work properly, it's really simple to create following the steps bellow:
In your project folder, create a package.json file:
$ npm initInstall http-server:
$ npm install --save http-serverAdd the following script in your package.json:
"start": "http-server"- Run the server:
$ npm start
Installing
$ npm install --save spa-engineOtherwise with cdn:
https://unpkg.com/spa-engine
Usage
- The library can be imported as
import spa-engine from 'spa-engine'orrequire('spa-engine'). - Can be accessed through global variable Engine when included through script tag.
Example:
const engine = new Engine({
routes: ['*.html', '/site/*'],
enabled: true,
});Running tests
npm test: run your tests in a single-run mode.npm run test:tdd: run and keep watching your test files.npm run test:coverage: prints coverage.
Linting
npm run lint: lint all files searching for errors.
Roadmap
A rough roadmap can be found on Trello
Library Architecture
The diagram bellow provides a general understanding of how the library is designed:

Authors
- Erick Bogarin - Initial work
1.0.0-alpha.1
9 years ago
1.0.0-alpha.0
9 years ago