Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uland-isomorphic

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uland-isomorphic

Isomorphic exports of uland

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
44
decreased by-12%
Maintainers
1
Weekly downloads
 
Created
Source

uland-isomorphic

Actions Status

Isomorphic exports of uland

npm install uland-isomorphic

Usage

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

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 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

FAQs

Package last updated on 10 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc