@sanillajs/sanilla
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Sanilla

Why do we have to study new grammar for make SPA?

This is very easy and simple framework for make single page application.

We don't need another grammer.

Sanilla is SPA + Vanilla(JS).

Install

npm

npm install @sanillajs/sanilla

yarn

yarn add @sanillajs/sanilla

How to use Sanilla

Hello World

src/index.js

import Sanilla from '@sanillajs/sanilla';
import app from './app.html';

Sanilla.mount('#root', app);

src/app.html

<h1>Hello Sanilla!</h1>
<script>
	setTimeout(() => document.querySelector('h1').innerText = 'Awesome Sanilla!', 5000);
</script>

public/index.html

<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Sanilla Application</title>
	</head>
	<body>
		<div id="root"></div>
	</body>
</html>

Sanilla-Router

import Sanilla from '@sanillajs/sanilla';
import SanillaRouter from '@sanillajs/sanilla-router';

import app from './app.html';
import home from './views/home.html';
import about from './views/about.html';
import hello from './views/hello.html';

Sanilla.append('#root', app);
Sanilla.router = new SanillaRouter('#router', {
	'/': home,
	'/about': about,
	'/hello': hello,
});

Sanilla-Cli

sanilla-cli init my-project
cd my-project
npm install
npm run dev

Package Sidebar

Install

npm i @sanillajs/sanilla

Weekly Downloads

4

Version

1.0.4

License

MIT

Unpacked Size

12.6 kB

Total Files

14

Last publish

Collaborators

  • tree-some