riot-starter/README.md

84 lines
2.8 KiB
Markdown
Raw Normal View History

2018-11-30 10:17:45 +00:00
# RiotJS App Starter
> A Rapid Application Starter kit for RiotJS
2018-03-22 20:37:34 +00:00
Rapidly prototype your next single-page application, with a `zero-build` out-of-the-box web-component solution. Need to go beyond the prototype stage, fret not, the tools are in-place to take you to production.
2018-11-30 10:17:45 +00:00
This is built as simple as possible, but no simplier
2018-03-22 20:37:34 +00:00
### Features
- `RiotJS` 3.x
- `Web Components` for reuseable UI
2018-11-30 10:17:45 +00:00
- `Events` for communication
2018-04-01 07:19:55 +00:00
- `Route` for url navigation
2018-11-30 10:17:45 +00:00
- `HTML5Boilerplate` 6.x static file base
- `ESLint` for coding style
2018-03-22 20:37:34 +00:00
- `Gulp` for production builds
2018-11-30 10:17:45 +00:00
### Requirements
[NodeJS](https://nodejs.org/) is used to install `vendor/` dependencies and a method to `build` your project for production via `gulp`
2018-03-22 20:37:34 +00:00
## Getting Started
2018-11-30 10:17:45 +00:00
1. Run `npm install` to load vendor dependencies
2. Start coding in `src/public`
3. run the `public/index.html` from your favorite web server\*
> \* try `live-server` from `npm` or via [Visual Studio Code]() plug-in
2018-03-22 20:37:34 +00:00
## Why Zero-Build?
**SPEED!**
A production pipe-line should *NOT* be in your way while developing...
2018-11-30 10:17:45 +00:00
...however, `npm build` is there when you need it
2018-03-22 20:37:34 +00:00
## How
2018-11-30 10:17:45 +00:00
`RiotJS` is blazing fast, outside of a production build, this project uses the `runtime-compiler` that can easily handle thousands of tags/actions in hundreds of milliseconds.
### Build
When you are ready to move to production you can run `npm build`. This will create a `dist` folder with all your optimized assets, web-components, vendor dependencies and remove the riot `runtime-compiler` to shave off another 100kb
Check out the [gulpfile]('gulpfile.js') for all the build options if you do not want to build everything. Every task is commented, and split-up so you can grep it easily.
2018-03-22 20:37:34 +00:00
## Project Structure
2018-11-30 10:17:45 +00:00
```
docs/ <-- additional documentation
src/
public/ <-- development is done here
css/ <-- your css files
js/ <-- your javascript files
images/ <-- your images
tags/ <-- web-components
vendor/ <-- vendor dependencies, ie code you did not write
index.html <-- start here
... <-- web meta files
test/ <-- tests (one day)
gulpfile.js <-- task runner
README.md
... <-- project meta files
```
2018-03-22 20:37:34 +00:00
## Polyfills
Todays "Evergreens" browsers support 99% of `ES6`, providing a pethra of capabilities, such as `import`, `class`, `fetch`, and `promise`. Depending on your desired browser support, you may find a polyfill to suit your needs...
...but such is beyond the scope of *this* starter kit.
2018-11-30 10:17:45 +00:00
## Testing
- TBD
2018-03-22 20:37:34 +00:00
2018-11-30 10:17:45 +00:00
## TODO
2018-03-22 20:37:34 +00:00
2018-11-30 10:17:45 +00:00
- integrate Jasmine for tests
- bring in ajax lib (n2geoff/riot-http) for non-es6 environments?
- add routing example