Simple SPA alternative for small web pages in 2 kB.
- 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
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>
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,
});
Sprint's big proposition is to provide a familiar API and simple to implement on any static website.
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.
First of all, thank you for your contribution.
Now, remember the priority is simplicity to use and size.
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.
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.