0.5.1 • Published 1 year ago

@fullstackjosh/web-components v0.5.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

web-components

Web components structured in such a way which enables both server side and client side rendering. These components support not only the apps in this repo, but other repos of mine too.

Warning

This package is in early early access. Don't install it into anything long-lived.

Storybook

There is a Storybook app for these components here. It wraps each component with a Vue component because that's easier than trying to get Storybook to play nice with web components (afaik). The components do not actually depend on Vue.

Installation

npm i @fullstackjosh/web-components

Usage

Import and the client-side version of any component:

import { registerXYZComponent } from "@fullstackjosh/web-components/XYZComponent";

registerXYZComponent();

// this is a web component which relies on the shadow dom and therefore cannot be rendered server-side
return <fsj-xyz-component></fsj-xyz-component>;

And the equivalent server-side version:

import { getXYZComponentTemplate } from "@fullstackjosh/web-components/XYZComponentTemplate";

const template = getXYZComponentTemplate();

// this is a html string with styles included which you can serve to the user
const html = template({
  ...props,
});
0.3.0

1 year ago

0.2.0

1 year ago

0.5.0

1 year ago

0.4.0

1 year ago

0.5.1

1 year ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago