15 | );
16 | }
17 | }
18 |
19 | export default App;
20 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import {render} from 'react-snapshot'
3 | import App from './App';
4 | import './index.css';
5 | import {Router, Route, browserHistory, IndexRoute} from 'react-router'
6 | import {Index, Login, About, Admin, FourOhFour} from './pages'
7 |
8 | render(
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | ,
18 | document.getElementById('root')
19 | );
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Create React App Snapshot
2 |
3 | A combination of [Create React App](https://github.com/facebookincubator/create-react-app) and [React Snapshot](https://github.com/geelen/react-snapshot)
4 |
5 | Visit the live site here: [create-react-app-snapshot.surge.sh](https://create-react-app-snapshot.surge.sh)
6 |
7 | See what it takes to convert one to the other by looking at this [diff](https://github.com/geelen/create-react-app-snapshot/compare/303f774...master)
8 |
9 | ### Try it out
10 |
11 | ```
12 | npm install
13 | npm run publish -- YOUR_DOMAIN_HERE.surge.sh
14 | ```
15 |
16 | That's it!
17 |
18 | ---
19 |
20 | Made with ♥️ and while too jetlagged to work on [frontend.center](https://frontend.center) by Glen Maddern
21 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "snapshotting",
3 | "version": "0.1.0",
4 | "private": true,
5 | "devDependencies": {
6 | "pushstate-server": "^1.14.0",
7 | "react-router": "^2.7.0",
8 | "react-snapshot": "^1.0.2",
9 | "surge": "^0.18.0",
10 | "react-scripts": "0.4.1"
11 | },
12 | "dependencies": {
13 | "react": "^15.3.1",
14 | "react-dom": "^15.3.1"
15 | },
16 | "scripts": {
17 | "start": "react-scripts start",
18 | "build": "react-scripts build && react-snapshot",
19 | "publish": "npm run build && surge build",
20 | "test": "react-scripts test --env=jsdom",
21 | "eject": "react-scripts eject"
22 | },
23 | "eslintConfig": {
24 | "extends": "./node_modules/react-scripts/config/eslint.js"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | React App
8 |
9 |
10 |
11 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016 Glen Maddern
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/src/pages.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Link } from 'react-router'
3 |
4 | export const Index = () => (
5 |
6 |
This is the index page!
7 |
If you have JS enabled, the links below should work instantaneously. If not, or if you JS is taking a long time to load, your site still works and is valid. Yay!