0.30.0 • Published 8 months ago

@greenwood/plugin-import-jsx v0.30.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@greenwood/plugin-import-jsx

Overview

Enables usage of import syntax for loading JSX rendering Web Components compatible with WCC. (This is not React JSX!)

This package assumes you already have @greenwood/cli installed.

Installation

You can use your favorite JavaScript package manager to install this package.

examples:

# npm
npm install @greenwood/plugin-import-jsx --save-dev

# yarn
yarn add @greenwood/plugin-import-jsx --dev

Usage

Add this plugin to your greenwood.config.js.

import { greenwoodPluginImportJsx } from '@greenwood/plugin-import-jsx';

export default {
  ...

  plugins: [
    greenwoodPluginImportJsx()
  ]
}

This will then allow you to use import to include WCC compatible JSX rendering Web Components.

export default class FooterComponent extends HTMLElement {
  connectedCallback() {
    this.render();
  }

  render() {
    return (
      <footer>
        <h4>My Blog</h4>
      </footer>
    );
  }
}

customElements.define('app-footer', FooterComponent);

Notes

  • For SSR and prerender use cases, follow these steps
  • For client side / browser code specifically, it is recommended to use import attributes syntax, e.g.
    import '../path/to/footer.jsx' with { type: 'jsx' };
0.30.0-alpha.8

8 months ago

0.30.0

8 months ago

0.30.0-alpha.7

8 months ago

0.30.0-alpha.3

1 year ago

0.30.0-alpha.6

10 months ago

0.30.0-alpha.4

12 months ago

0.30.0-alpha.5

11 months ago

0.29.4

1 year ago

0.30.0-alpha.2

1 year ago

0.29.3

1 year ago

0.30.0-alpha.1

1 year ago

0.30.0-alpha.0

1 year ago

0.29.2

1 year ago

0.29.1

2 years ago

0.29.0-alpha.6

2 years ago

0.29.0

2 years ago

0.29.0-alpha.1

2 years ago

0.29.0-alpha.4

2 years ago

0.28.5

2 years ago

0.29.0-alpha.5

2 years ago

0.29.0-alpha.2

2 years ago

0.29.0-alpha.3

2 years ago

0.29.0-alpha.0

2 years ago

0.28.4

2 years ago

0.28.3

2 years ago

0.28.2

2 years ago

0.28.1

2 years ago

0.28.0

2 years ago

0.28.0-alpha.5

2 years ago