Skip to content

Commit 6e10ec2

Browse files
author
brucou
committed
Initial commit with gitkraken
1 parent 9695884 commit 6e10ec2

26 files changed

+5914
-0
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015"]
3+
}

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# JS files must always use LF for tools to work
5+
*.js eol=lf

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
.idea
3+
dist
4+
dist-node
5+
archive

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src

bower.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "rx-component-combinators",
3+
"version": "0.1.0",
4+
"authors": [
5+
"Olivier Couriol <olivier.couriol@gmail.com>"
6+
],
7+
"description": "Library providing combinators for reactive components",
8+
"main": "dist/rxcc.js",
9+
"moduleType": [
10+
"node"
11+
],
12+
"license": "Apache-2.0",
13+
"homepage": "https://github.com/brucou/rxcc",
14+
"ignore": [
15+
"**/.*",
16+
"node_modules",
17+
"bower_components",
18+
"test",
19+
"tests"
20+
]
21+
}

package.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "rx-component-combinators",
3+
"version": "0.1.0",
4+
"description": "Library providing combinators for reactive components",
5+
"author": "Olivier Couriol <olivier.couriol@gmail.com>",
6+
"license": "Apache-2.0",
7+
"repository": "https://github.com/brucou/rxcc.git",
8+
"main": "dist-node/index.js",
9+
"jsnext:main": "src/index.js",
10+
"jspm": {
11+
"main": "dist/rxcc.js"
12+
},
13+
"scripts": {
14+
"build-node": "babel src --out-dir dist-node",
15+
"build-node-test": "babel test --out-dir dist-node-test",
16+
"build-browser": "npm run browserify && npm run uglify",
17+
"browserify": "browserify -d --standalone rxcc dist-node | derequire > dist/rxcc.js",
18+
"uglify": "uglifyjs -mc < dist/rxcc.js > dist/rxcc.min.js",
19+
"clean": "rimraf dist dist-node && mkdirp dist dist-node",
20+
"clean-test": "rimraf dist-node-test && mkdirp dist-node-test",
21+
"build": "npm run clean && npm run build-node && npm run build-browser",
22+
"prepublish": "npm run build",
23+
"build-test2": "npm run clean-test && npm run build-node-test && npm run test",
24+
"build-test": "npm run build-node-test && npm run test",
25+
"test": "browserify -d --transform babelify dist-node-test | derequire > test/test-bundle.js"
26+
},
27+
"devDependencies": {
28+
"babel-preset-es2015": "^6.18.0",
29+
"browserify": "^11.2.0",
30+
"derequire": "^2.0.2",
31+
"mkdirp": "^0.5.1",
32+
"rimraf": "^2.4.3",
33+
"uglify-js": "^2.5.0",
34+
"jquery": "1.12.0",
35+
"mocha": "^2.2.4",
36+
"normalize.css": "3.0.3",
37+
"qunitjs": "^1.20.0",
38+
"sinon": "^1.17.2",
39+
"sinon-qunit": "^2.0.0"
40+
},
41+
"dependencies": {
42+
"babel-cli": "^6.18.0",
43+
"babel-polyfill": "^6.16.0",
44+
"babel-preset-es2015": "^6.18.0",
45+
"babel-register": "^6.18.0",
46+
"babelify": "^7.3.0",
47+
"mocha": "^3.1.2",
48+
"ramda": "^0.22.1",
49+
"snabbdom": "^0.5.0",
50+
"cycle-snabbdom": "^3.0.0",
51+
"rx": "^4.1.0",
52+
"mermaid": "^6.0.0"
53+
}
54+
}

roadmap.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Combinators
2+
## InjectSources
3+
## SwitchForEach
4+
## SwitchCase
5+
## List
6+
- all items will emit sinks
7+
- all item components should be passed an id in settings
8+
## Router
9+
## StateChart (EHFSM)
10+
```
11+
StateChart({
12+
intents : Hash{intentIdentifier :: sources -> settings -> source},
13+
actionResponses : [SinkIdentifier] - must match sinks returned by action,
14+
action : State a-> State b -> State err -> Event -> Guard -> Action
15+
where Action :: event -> model -> sinks
16+
})
17+
```
18+
Drivers for action must be wrapped into a higher-order function which will
19+
add a unique token serving to identify the request. The response will only be
20+
accepted as matching a request if both have the same token.
21+
## m
22+
23+
# Driver
24+
## Store Driver - for now likely key/value store
25+
26+
# Examples
27+
## TODO list app
28+
### Funcional specifications
29+
- three routes : active todos, completed todos, all todos
30+
- one field `what needs to be done?` to enter new todo
31+
- list of entered todos
32+
- for each entered todos, delete button, completed radio, text input with
33+
todo description
34+
- one label with `x` items left
35+
- three labels `All`, `Active`, `Completed` being emphasized according to route
36+
- authentication required to view active or all route
37+
- no authentication required to view completed route
38+
### Technical specifications
39+
#### Data structures
40+
TodoList :: [TodoItem]
41+
TodoItem :: {active : Boolean, description : String}
42+
AppState :: TodoList
43+
#### Drivers
44+
- auth$ : returns true or false if the user is logged in or not respectively
45+
- route$ : navigates to a given route, emit new route events
46+
- DOM
47+
- Store
48+
#### Constants and properties
49+
- IS_LOGGED_IN
50+
- ALL
51+
- ACTIVE
52+
- COMPLETED
53+
#### Components
54+
- LogIn : display a dummy message, one button which logs in and reroutes
55+
### Implementation through combinators
56+
const sinks = [TODO]
57+
App({sinks : sinks}, [
58+
OnRoute('/', SwitchCase({
59+
on : 'auth$'
60+
}, [
61+
Case({when: IS_LOGGED_IN}, [
62+
TodoComponent({routeState : ALL}) // actually will require flip or
63+
// curry and R.__
64+
]),
65+
Case({when: complement(IS_LOGGED_IN}, [
66+
LogIn({redirect: '/'})
67+
])
68+
]
69+
)),
70+
OnRoute('/active', SwitchCase({
71+
on : 'auth$', sinks : sinks
72+
}, [
73+
Case({when: IS_LOGGED_IN}, [
74+
TodoComponent({routeState : ACTIVE}) // actually will require flip or
75+
// curry and R.__
76+
]),
77+
Case({when: complement(IS_LOGGED_IN}, [
78+
LogIn({redirect: '/active'})
79+
])
80+
]
81+
)),
82+
OnRoute('/completed', TodoComponent({routeState: COMPLETED})
83+
)
84+
])
85+
TodoComponent=curry(flip(
86+
StateChart({
87+
intents :
88+
})
89+
))

0 commit comments

Comments
 (0)