0.5.0 • Published 3 years ago

uland-ssr v0.5.0

Weekly downloads
48
License
ISC
Repository
github
Last release
3 years ago

🦄 µland-ssr

tiny island

Social Media Photo by Ben Klea on Unsplash

micro land SSR, is µland API for SSR / DOM-less environments.

It allows using same components code on the client and the server, producing html or svg streams.

This module also exports uland-ssr/async, which is based on uland-nofx/async.

📣 Community Announcement

Please ask questions in the dedicated forum to help the community around this project grow ♥


API

import {Component, render, html, useState} from 'uland-ssr';

const Counter = Component((initialState) => {
  const [count, setCount] = useState(initialState);
  return html`
  <button onclick=${() => setCount(count + 1)}>
    Count: ${count}
  </button>`;
});

// basic example, creates the expected output
// minus online events (would need re-hydration)
render(String, () => html`
  <div>
    A bounce of counters.<hr>
    ${Counter(0)} ${Counter(1)}
  </div>
`);
0.5.0

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.3

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.0.0

3 years ago