1.0.0-alpha.1 • Published 7 years ago

spa-engine v1.0.0-alpha.1

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

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:

  1. In your project folder, create a package.json file:

    $ npm init
  2. Install http-server:

    $ npm install --save http-server
  3. Add the following script in your package.json:

    "start": "http-server"
  4. Run the server:
    $ npm start

Installing

$ npm install --save spa-engine

Otherwise with cdn:

  • https://unpkg.com/spa-engine

Usage

  • The library can be imported as import spa-engine from 'spa-engine' or require('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: LIbrary Architecture

Authors

  • Erick Bogarin - Initial work
1.0.0-alpha.1

7 years ago

1.0.0-alpha.0

7 years ago