# uland-isomorphic

> Isomorphic exports of uland

Latest version **2.0.0** (published 2022-05-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install uland-isomorphic
pnpm add uland-isomorphic
yarn add uland-isomorphic
bun add uland-isomorphic
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2022-05-10 |
| First published | 2021-09-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 11.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Bret Comnes |
| Maintainers | bret |

## Links

- npm: https://www.npmjs.com/package/uland-isomorphic
- Repository: https://github.com/bcomnes/uland-isomorphic
- Issues: https://github.com/bcomnes/uland-isomorphic/issues
- Funding: https://github.com/sponsors/bcomnes
- npm.io page: https://npm.io/package/uland-isomorphic

## Dependencies (2)

- [uland](https://npm.io/package/uland.md) ^1.0.0
- [uland-ssr](https://npm.io/package/uland-ssr.md) ^0.5.0

## Recent versions

- 2.0.0 (latest) — 2022-05-10
- 1.1.0 — 2022-05-06
- 1.0.0 — 2021-09-06

## README

# uland-isomorphic
[![Actions Status](https://github.com/bcomnes/uland-isomorphic/workflows/tests/badge.svg)](https://github.com/bcomnes/uland-isomorphic/actions)

Isomorphic exports of [uland][uland]

```
npm install uland-isomorphic
```

## Usage

Use [uland][uland] or [uland-ssr][ssr] from a single import identifier depending on then environment you are running.

``` js
import {Component, render, html, useState} from 'uland-isomorphic';

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

// basic example, show two independent counters
render(document.body, () => html`
  <div>
    A bounce of counters.<hr>
    ${Counter(0)} ${Counter(1)}
  </div>
`);
```

## How

While @webreflection recomends [require-overrides](https://github.com/WebReflection/require-overrides/#readme) in the offical documentation, that requires special flags or transforms to work.

`uland-isomorphic` works by utilizing environment specific exports fields so that you can have dependency injection at the built-in module resolver layer.
It supports the following export fields:

- `main` (cjs node)
- `browser` (cjs browser)
- `exports.import` (esm node)
- `exports.reqire` (cjs node)
- `exports.browser` (esm browser)

## License

MIT

[uland]: https://github.com/WebReflection/uland
[ssr]: https://github.com/WebReflection/uland-ssr

---
_Source: https://npm.io/package/uland-isomorphic · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
