Skip to content

Commit bc84744

Browse files
author
Satoshi Amemiya
committed
Update README
1 parent cdc76b2 commit bc84744

File tree

1 file changed

+31
-20
lines changed

1 file changed

+31
-20
lines changed

README.md

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,41 @@
11
# squark
22

3-
[![crates.io](https://img.shields.io/crates/v/squark.svg)](https://crates.io/crates/squark)
4-
[![docs.rs](https://docs.rs/squark/badge.svg)](https://docs.rs/squark/*/squark/)
3+
Rust frontend framework, for web browser and more.
4+
5+
**Currently, we depend on `nightly` channel**
6+
7+
## Design
8+
9+
* Separating runtime definition and implemention
10+
+ `squark` crate has no dependency for specific platform
11+
* Architecture inspired from [Elm](https://elm-lang.org/) and [HyperApp](https://github.com/hyperapp/hyperapp/)
12+
+ Simplicy
13+
+ Elegant
14+
* Supporting futures-0.1
15+
+ reducer can emit task for async work such as fetch resource
516

6-
Virtual DOM implemention and definitions of Application and Runtime.
17+
## crates
718

8-
## Fertures
19+
### squark
920

10-
This repository includes
21+
[![crates.io](https://img.shields.io/crates/v/squark.svg)](https://crates.io/crates/squark)
22+
[![docs.rs](https://docs.rs/squark/badge.svg)](https://docs.rs/squark/*/squark/)
23+
24+
Core crate.
1125

1226
* Pure Rust virtual DOM implemention
13-
* Definition of application inspired from [HyperApp](https://github.com/hyperapp/hyperapp/)
27+
* Definition of GUI application
1428
* Definition of runtime to handle diffirence of virtual DOM
15-
* Runtime implementions for several platforms
16-
* For web browser by using [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen)
17-
+ Server side rendering within Rustic world *(now working)*
18-
* Macros like a JSX to help writing view
1929

20-
**Currently, we depend on `nightly` channel**
21-
22-
## squark-macros
30+
### squark-macros
2331

2432
[![crates.io](https://img.shields.io/crates/v/squark-macros.svg)](https://crates.io/crates/squark-macros)
2533
[![docs.rs](https://docs.rs/squark-macros/badge.svg)](https://docs.rs/squark-macros/*/squark_macros/)
2634

27-
Crate that providing JSX like macro by `proc_marco` and [pest](https://github.com/pest-parser/pest) parser.
35+
It provides macro like JSX for helping writing view.
36+
Very thanks to [pest](https://github.com/pest-parser/pest) parser.
2837

29-
### Syntax
38+
#### Syntax
3039

3140
```
3241
view! {
@@ -38,7 +47,8 @@ view! {
3847

3948
We can generate native Rust expression at compile-time.
4049

41-
## squark-web
50+
51+
### squark-web
4252

4353
[![crates.io](https://img.shields.io/crates/v/squark-web.svg)](https://crates.io/crates/squark-web)
4454
[![docs.rs](https://docs.rs/squark-web/badge.svg)](https://docs.rs/squark-web/*/squark_web/)
@@ -56,7 +66,7 @@ extern crate squark_web;
5666
extern crate wasm_bindgen;
5767
extern crate web_sys;
5868

59-
use squark::{App, Runtime, View};
69+
use squark::{App, Runtime, View, Task};
6070
use squark_macros::view;
6171
use squark_web::WebRuntime;
6272
use wasm_bindgen::prelude::*;
@@ -84,13 +94,13 @@ impl App for CounterApp {
8494
type State = State;
8595
type Action = Action;
8696

87-
fn reducer(&self, mut state: State, action: Action) -> State {
97+
fn reducer(&self, mut state: State, action: Action) -> (State, Task<Action>) {
8898
match action {
8999
Action::ChangeCount(c) => {
90100
state.count = c;
91101
}
92102
};
93-
state
103+
(state, Task::empty())
94104
}
95105

96106
fn view(&self, state: State) -> View<Action> {
@@ -133,4 +143,5 @@ pub fn run() {
133143

134144
Project dir is located at [examples/counter](./examples/counter).
135145

136-
There is also available TodoMVC example at [examples/todomvc](./examples/todomvc) and working on [https://rail44.github.io/squark/](https://rail44.github.io/squark/).
146+
There are some other examples available on [examples](./examples), most of them use [rust-webpack-template](https://github.com/rustwasm/rust-webpack-template).
147+
TodoMVC is working on [https://rail44.github.io/squark/](https://rail44.github.io/squark/).

0 commit comments

Comments
 (0)