Skip to content

⚛️ Simple SPA alternative for small web pages in 2 kB.

License

Notifications You must be signed in to change notification settings

matuzalemsteles/sprint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sprint
npm Build Status Coverage Status gzip

Simple SPA alternative for small web pages in 2 kB.

Sprint

  • Tiny: under 2 kB of ES3 gzipped

🤔 What's Missing?

  • Use container to wrap new pages.
  • Simple virtual DOM or reconciliation, call as you wish. 😁
  • Test Creation
  • Create lifecycle

Table of Contents

Install

Install via yarn:

$ yarn add sprintjs

Install via npm:

$ npm install --save sprintjs

With a bundler module as a rollup or webpack, use:

// using ES6 modules
import sprintjs from 'sprintjs'

// using CommonJS modules
var sprintjs = require('sprintjs')

The UMD build is also available on unpkg:

<script src="//unpkg.com/sprintjs"></script>

Usage

Use from HTML tag.

<script>
  var Sprint = new sprintjs(
    {
      routes: [
        '*.html',
        '/site/*'
      ],
      enabled: true,
    }
  )
</script>

Or use Sprint package.

import Sprint from 'sprintjs';

const engine = new Sprint({
  routes: [
    '*.html',
    '/site/*'
  ],
  enabled: true,
});

Examples & Demos

API

Sprint's big proposition is to provide a familiar API and simple to implement on any static website.

sprintj(options: Object)

Sprint contains the following properties in options:

  • routes: An array, routes are added to enable Sprint. Use of the * before or after the / or . The mechanism understands and will process anything forward.
  • enabled: A boolean, true, or false to activate the engine.

Contribute

First of all, thank you for your contribution.

Now, remember the priority is simplicity to use and size.

Reporting Issues

Did you find a problem? Do you want a new feature? First check if your problem or idea has been reported. If there is a new question, please be clear and descriptive.

🚨 Check issue open and closed.

Submitting pull requests

Make sure your pull requests are within scope and that you follow the project assumptions.

🚨 Submit your pull solipsies with tests if necessary.

  • Fork it!
  • Clone your fork: git clone https://github.com/<your-username>/sprint
  • Navigate to the newly cloned directory: cd sprint
  • Create a new branch for the new feature: git checkout -b new-feature
  • Install the tools necessary for development: yarn
  • Make your changes.
  • yarn run build to verify your change doesn't increase output size.
  • Commit your changes: git commit -am 'Add new feature'
  • Push to the branch: git push origin new-feature
  • Submit a pull request with full remarks documenting your changes.

License

MIT License © Matuzalém Teles

About

⚛️ Simple SPA alternative for small web pages in 2 kB.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published