├── .gitignore ├── README.md ├── google86bf114afc1faecb.html ├── package.json ├── src ├── client.js ├── components │ ├── Nav.html │ ├── Recorder.html │ └── Toast.html ├── routes │ ├── _error.html │ ├── _layout.html │ ├── demo │ │ ├── chat.html │ │ ├── checkout-form.html │ │ └── tetris.html │ ├── index.html │ └── replay.html ├── server.js ├── service-worker.js └── template.html ├── static ├── chat.png ├── checkout.png ├── demo │ ├── bootstrap-solid.svg │ ├── bootstrap.min.css │ ├── bootstrap.min.js │ ├── holder.min.js │ ├── jquery.slim.min.js │ ├── music.mp3 │ ├── popper.min.js │ ├── tetris-1.0.1.css │ ├── tetris-1.0.1.js │ └── tetris-loader.css ├── events.json ├── favicon.png ├── global.css ├── logos │ ├── highlight.png │ ├── posthog.png │ ├── record-once.png │ └── smartx.png ├── manifest.json ├── rrweb-player.css └── tetris.png ├── webpack.config.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | yarn-error.log 4 | /__sapper__ 5 | package-lock.json -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # sapper-template 2 | 3 | The default [Sapper](https://github.com/sveltejs/sapper) template. To clone it and get started: 4 | 5 | ```bash 6 | npx degit sveltejs/sapper-template my-app 7 | cd my-app 8 | npm install # or yarn! 9 | npm run dev 10 | ``` 11 | 12 | Open up [localhost:3000](http://localhost:3000) and start clicking around. 13 | 14 | Consult [sapper.svelte.technology](https://sapper.svelte.technology) for help getting started. 15 | 16 | *[Click here for the Rollup version of this template](https://github.com/sveltejs/sapper-template/tree/rollup)* 17 | 18 | ## Structure 19 | 20 | Sapper expects to find three directories in the root of your project — `app`, `assets` and `routes`. 21 | 22 | 23 | ### app 24 | 25 | The [app](app) directory contains the entry points for your app — `client.js`, `server.js` and (optionally) a `service-worker.js` — along with a `template.html` file. 26 | 27 | 28 | ### assets 29 | 30 | The [assets](assets) directory contains any static assets that should be available. These are served using [sirv](https://github.com/lukeed/sirv). 31 | 32 | In your [service-worker.js](app/service-worker.js) file, you can import these as `assets` from the generated manifest... 33 | 34 | ```js 35 | import { assets } from './manifest/service-worker.js'; 36 | ``` 37 | 38 | ...so that you can cache them (though you can choose not to, for example if you don't want to cache very large files). 39 | 40 | 41 | ### routes 42 | 43 | This is the heart of your Sapper app. There are two kinds of routes — *pages*, and *server routes*. 44 | 45 | **Pages** are Svelte components written in `.html` files. When a user first visits the application, they will be served a server-rendered version of the route in question, plus some JavaScript that 'hydrates' the page and initialises a client-side router. From that point forward, navigating to other pages is handled entirely on the client for a fast, app-like feel. (Sapper will preload and cache the code for these subsequent pages, so that navigation is instantaneous.) 46 | 47 | **Server routes** are modules written in `.js` files, that export functions corresponding to HTTP methods. Each function receives Express `request` and `response` objects as arguments, plus a `next` function. This is useful for creating a JSON API, for example. 48 | 49 | There are three simple rules for naming the files that define your routes: 50 | 51 | * A file called `routes/about.html` corresponds to the `/about` route. A file called `routes/blog/[slug].html` corresponds to the `/blog/:slug` route, in which case `params.slug` is available to the route 52 | * The file `routes/index.html` (or `routes/index.js`) corresponds to the root of your app. `routes/about/index.html` is treated the same as `routes/about.html`. 53 | * Files and directories with a leading underscore do *not* create routes. This allows you to colocate helper modules and components with the routes that depend on them — for example you could have a file called `routes/_helpers/datetime.js` and it would *not* create a `/_helpers/datetime` route 54 | 55 | 56 | ## Webpack config 57 | 58 | Sapper uses webpack to provide code-splitting, dynamic imports and hot module reloading, as well as compiling your Svelte components. As long as you don't do anything daft, you can edit the configuration files to add whatever loaders and plugins you'd like. 59 | 60 | 61 | ## Production mode and deployment 62 | 63 | To start a production version of your app, run `npm run build && npm start`. This will disable hot module replacement, and activate the appropriate webpack plugins. 64 | 65 | You can deploy your application to any environment that supports Node 8 or above. As an example, to deploy to [Now](https://zeit.co/now), run these commands: 66 | 67 | ```bash 68 | npm install -g now 69 | now 70 | ``` 71 | 72 | 73 | ## Using external components 74 | 75 | When using Svelte components installed from npm, such as [@sveltejs/svelte-virtual-list](https://github.com/sveltejs/svelte-virtual-list), Svelte needs the original component source (rather than any precompiled JavaScript that ships with the component). This allows the component to be rendered server-side, and also keeps your client-side app smaller. 76 | 77 | Because of that, it's essential that webpack doesn't treat the package as an *external dependency*. You can either modify the `externals` option in [webpack/server.config.js](webpack/server.config.js), or simply install the package to `devDependencies` rather than `dependencies`, which will cause it to get bundled (and therefore compiled) with your app: 78 | 79 | ```bash 80 | yarn add -D @sveltejs/svelte-virtual-list 81 | ``` 82 | 83 | 84 | ## Bugs and feedback 85 | 86 | Sapper is in early development, and may have the odd rough edge here and there. Please be vocal over on the [Sapper issue tracker](https://github.com/sveltejs/sapper/issues). 87 | -------------------------------------------------------------------------------- /google86bf114afc1faecb.html: -------------------------------------------------------------------------------- 1 | google-site-verification: google86bf114afc1faecb.html -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rrweb-io", 3 | "description": "rrweb homepage source code", 4 | "version": "0.0.1", 5 | "scripts": { 6 | "dev": "sapper dev", 7 | "build": "sapper build", 8 | "export": "sapper export", 9 | "start": "node __sapper__/build" 10 | }, 11 | "dependencies": { 12 | "compression": "^1.7.1", 13 | "conversational-form": "^0.9.90", 14 | "polka": "^0.4.0", 15 | "rrweb": "^1.0.1", 16 | "rrweb-player": "^0.7.3", 17 | "sirv": "^0.2.0" 18 | }, 19 | "devDependencies": { 20 | "npm-run-all": "^4.1.5", 21 | "sapper": "^0.22.1", 22 | "svelte": "^2.16.0", 23 | "svelte-loader": "^2.9.0", 24 | "webpack": "^4.28.1" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/client.js: -------------------------------------------------------------------------------- 1 | import * as sapper from '../__sapper__/client.js'; 2 | import { Store } from 'svelte/store.js'; 3 | 4 | sapper.start({ 5 | target: document.querySelector('#sapper'), 6 | store: data => { 7 | const store = new Store(data) 8 | // for debug 9 | window.store = store 10 | 11 | return store 12 | } 13 | }); -------------------------------------------------------------------------------- /src/components/Nav.html: -------------------------------------------------------------------------------- 1 | 78 | 79 | 85 | -------------------------------------------------------------------------------- /src/components/Recorder.html: -------------------------------------------------------------------------------- 1 |
2 | < back 3 | replay 4 |
5 | 6 | 26 | -------------------------------------------------------------------------------- /src/components/Toast.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 19 | 20 | 34 | -------------------------------------------------------------------------------- /src/routes/_error.html: -------------------------------------------------------------------------------- 1 | 2 | {status} 3 | 4 | 5 |

{status}

6 | 7 |

{error.message}

8 | 9 | {#if dev && error.stack} 10 |
{error.stack}
11 | {/if} 12 | 13 | 34 | 35 | 42 | -------------------------------------------------------------------------------- /src/routes/_layout.html: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 |
14 | -------------------------------------------------------------------------------- /src/routes/demo/chat.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | rrweb.ui | Conversational Form 4 | 5 | 6 |
7 | 8 |
9 | 12 | 13 | 16 | 17 | 20 |
21 | 22 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
35 | 36 | 37 | 39 | 40 | 41 |
42 | 43 | 44 | 45 | 47 | 48 |
49 | 50 | 51 | 52 | 53 | 54 | 56 | 57 |
58 | 59 | 60 | 61 | 63 | 64 |
65 | 66 | 67 | 69 | 70 | 71 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 83 | 84 |
85 | 86 | 87 | 88 | 89 | 90 |
91 | 92 | 93 |
94 |
95 | 96 | {#if message} 97 | 98 | { message } 99 | 100 | {/if} 101 | 102 | 103 | 104 | 147 | 148 | -------------------------------------------------------------------------------- /src/routes/demo/checkout-form.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | rrweb.io | Checkout form demo 4 | 5 | 6 | 7 |
8 |
9 | 10 |

Checkout form

11 |

Below is an example form built entirely with Bootstrap's form controls. Each required form group has 12 | a validation state that can be triggered by attempting to submit the form without completing it.

13 |
14 | 15 |
16 |
17 |

18 | Your cart 19 | 3 20 |

21 |
    22 |
  • 23 |
    24 |
    Product name
    25 | Brief description 26 |
    27 | $12 28 |
  • 29 |
  • 30 |
    31 |
    Second product
    32 | Brief description 33 |
    34 | $8 35 |
  • 36 |
  • 37 |
    38 |
    Third item
    39 | Brief description 40 |
    41 | $5 42 |
  • 43 |
  • 44 |
    45 |
    Promo code
    46 | EXAMPLECODE 47 |
    48 | -$5 49 |
  • 50 |
  • 51 | Total (USD) 52 | $20 53 |
  • 54 |
55 | 56 |
57 |
58 | 59 |
60 | 61 |
62 |
63 |
64 |
65 |
66 |

Billing address

67 |
68 |
69 |
70 | 71 | 72 |
73 | Valid first name is required. 74 |
75 |
76 |
77 | 78 | 79 |
80 | Valid last name is required. 81 |
82 |
83 |
84 | 85 |
86 | 87 |
88 |
89 | @ 90 |
91 | 92 |
93 | Your username is required. 94 |
95 |
96 |
97 | 98 |
99 | 100 | 101 |
102 | Please enter a valid email address for shipping updates. 103 |
104 |
105 | 106 |
107 | 108 | 109 |
110 | Please enter your shipping address. 111 |
112 |
113 | 114 |
115 | 116 | 117 |
118 | 119 |
120 |
121 | 122 | 126 |
127 | Please select a valid country. 128 |
129 |
130 |
131 | 132 | 136 |
137 | Please provide a valid state. 138 |
139 |
140 |
141 | 142 | 143 |
144 | Zip code required. 145 |
146 |
147 |
148 |
149 |
150 | 151 | 152 |
153 |
154 | 155 | 156 |
157 |
158 | 159 |

Payment

160 | 161 |
162 |
163 | 164 | 165 |
166 |
167 | 168 | 169 |
170 |
171 | 172 | 173 |
174 |
175 |
176 |
177 | 178 | 179 | Full name as displayed on card 180 |
181 | Name on card is required 182 |
183 |
184 |
185 | 186 | 187 |
188 | Credit card number is required 189 |
190 |
191 |
192 |
193 |
194 | 195 | 196 |
197 | Expiration date required 198 |
199 |
200 |
201 | 202 | 203 |
204 | Security code required 205 |
206 |
207 |
208 |
209 | 210 |
211 |
212 |
213 |
214 | You can click the replay button to replay your actions. 215 |
216 |
217 | 218 | {#if message} 219 | 220 | { message } 221 | 222 | {/if} 223 | 224 | 225 | 226 | 269 | 270 | -------------------------------------------------------------------------------- /src/routes/demo/tetris.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | rrweb.io | Tetris game demo 4 | 5 | 6 | 7 | 8 | 9 |
10 |
11 |
加载中...
12 |
13 |
14 | 15 | 16 | 17 | 44 | -------------------------------------------------------------------------------- /src/routes/index.html: -------------------------------------------------------------------------------- 1 | 2 | rrweb.io | Open source web session replay library 3 | 4 | 5 |