Skip to content

Make it work again #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .babelrc

This file was deleted.

26 changes: 3 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Have you ever wondered if you could take advantage of Web Workers to render a Vi

# How It Works

The implementation is split into [renderer/dom.js](https://github.com/developit/preact-worker-demo/blob/master/src/renderer/dom.js) and [renderer/worker.js](https://github.com/developit/preact-worker-demo/blob/master/src/renderer/worker.js). These modules live outside and inside the Worker (respectively), and communicate with eachother asynchronously via `postMessage()`.
The implementation is split into [renderer/dom.js](https://github.com/developit/preact-worker-demo/blob/master/src/renderer/dom.mjs) and [renderer/worker.js](https://github.com/developit/preact-worker-demo/blob/master/src/renderer/worker.mjs). These modules live outside and inside the Worker (respectively), and communicate with eachother asynchronously via `postMessage()`.

The app's code, components, libraries and DOM are all isolated in a single Worker (background thread). This means even [Preact]'s diff algorithm and component instantiation is done in the worker. The main (UI) thread simply applies a stream of serialized DOM change descriptions ([MutationRecords]), and proxies events back to the Worker to be handled off the main thread.

Expand Down Expand Up @@ -54,33 +54,13 @@ npm install
## Development Workflow


**3. Start a live-reload development server:**
**3. Start a development server:**

```sh
PORT=8080 npm run dev
npm run dev
```


**4. Generate a production build in `./build`:**

```sh
npm run build
```

> You can now deploy the contents of the `build` directory to production!
>
> **[Surge.sh](https://surge.sh) Example:** `surge ./build -d my-app.surge.sh`


**5. Start local production server with `superstatic`:**

```sh
npm start
```

> This is to simulate a production (CDN) server with gzip. It just serves up the contents of `./build`.


---


Expand Down
Loading