Take your UI off the main thread
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Update the service worker Aug 25, 2018
src Remove unused reference Aug 25, 2018
test Change the remaining tests to lit-html Aug 25, 2018
.gitignore Some initial work on handles Jun 24, 2018
Makefile Remove the windowed umd build Aug 25, 2018
README.md Update the readme Aug 25, 2018
package.json 4.0.1 Aug 25, 2018
rollup.config.js
window.js Some more work on converting the site over Jul 13, 2018
worker.js Remove unused reference Aug 25, 2018
worker.umd.js Remove unused reference Aug 25, 2018
yarn.lock Change the remaining tests to lit-html Aug 25, 2018

README.md

npm version

fritz

A library for rendering custom elements in a web worker.

worker.js

import { Component, html } from 'fritz';

class Hello extends Component {
  static get props() {
    return {
      name: { attribute: true }
    }
  }

  render({name}) {
    return html`
      <span>Hello ${name}</span>
    `;
  }
}

fritz.define('x-hello', Hello);

index.html

<!doctype html>

<x-hello name="world"></x-hello>

<script type="module">
  import fritz from 'https://unpkg.com/fritz/window.js';

  fritz.use(new Worker("./worker.js"));
</script>

Install

Yarn

yarn add fritz

npm

npm install fritz

License

BSD 2 Clause