Skip to content

Commit 4a9b4ec

Browse files
committed
Installed Recoil; updated README.
1 parent e365cfc commit 4a9b4ec

File tree

5 files changed

+37
-3
lines changed

5 files changed

+37
-3
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
This is an opinionated base [Sails v1](https://sailsjs.com) application, using Webpack to handle Bootstrap (SASS) and React.
66

7+
# Preface
8+
The `master` branch is experimental, and the [`releases section`](https://github.com/neonexus/sails-react-bootstrap-webpack/releases) is where one should base their use of the template (or simply change the tag to the most recent, stable release in the top left). `master` is **volatile**, likely to change at any time, for any reason; this includes `git push --force`.
9+
10+
**FINAL WARNING: DO NOT RELY ON THE MASTER BRANCH!**
11+
712
## Main Features
813

914
+ Automatic (incoming) request logging, via Sails models / hooks.

assets/src/Main/Main.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
import React from 'react';
22

3+
import {useRecoilValue} from 'recoil';
4+
35
function Main() {
46
return (
57
<>
68
<h1>Main "application"</h1>
79
<div>The marketing site, if you will.</div>
10+
<br />
11+
<br />
12+
{
13+
14+
}
815
</>
916
);
1017
}

assets/src/index.jsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,30 @@ import {
99
import AdminRouter from './Admin/AdminRouter';
1010
import MainRouter from './Main/MainRouter';
1111

12+
import {
13+
RecoilRoot
14+
} from 'recoil';
15+
1216
function IndexApp() {
17+
const adminInit = {
18+
isAuthenticated: false,
19+
user: null
20+
};
21+
22+
const mainInit = {};
23+
1324
return (
1425
<Router>
1526
<Switch>
1627
<Route path="/admin">
17-
<AdminRouter />
28+
<RecoilRoot initializeState={adminInit}>
29+
<AdminRouter />
30+
</RecoilRoot>
1831
</Route>
1932
<Route path="/main">
20-
<MainRouter />
33+
<RecoilRoot initializeState={mainInit}>
34+
<MainRouter />
35+
</RecoilRoot>
2136
</Route>
2237
<Route>
2338
<Redirect to={{pathname: '/main/'}} />

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sails-react-bootstrap-webpack",
3-
"version": "1.4.0",
3+
"version": "1.5.0",
44
"description": "An opinionated base configuration of Sails, with Webpack for React support, and Bootstrap for styling.",
55
"keywords": [
66
"sails",
@@ -21,6 +21,7 @@
2121
"react-dom": "^16.13.1",
2222
"react-router-dom": "^5.2.0",
2323
"react-transition-group": "^4.4.1",
24+
"recoil": "0.0.10",
2425
"sails": "^1.2.4",
2526
"sails-hook-orm": "^3.0.1",
2627
"sails-hook-sockets": "^2.0.0",
@@ -75,6 +76,7 @@
7576
"clean": "rimraf .tmp && mkdirp .tmp/public",
7677
"lift": "node app.js",
7778
"debug": "node --inspect app.js",
79+
"blah": "node app.js",
7880
"lines": "git ls-files --exclude-standard -- ':!:**/*.[pjs][npv]g' ':!:**/*.ai' ':!:.idea' ':!:test/coverage/*' ':!:config/*' ':!:.babelrc' ':!:.editorconfig' ':!:.eslintrc' ':!:.eslintignore' ':!:.gitignore' ':!:.mocharc.yaml' ':!:.npmrc' ':!:.nycrc' ':!:.sailsrc' ':!:LICENSE' ':!:package-lock.json' | xargs wc -l"
7981
},
8082
"main": "app.js",

0 commit comments

Comments
 (0)