@open-pioneer/runtime
TypeScript icon, indicating that this package has built-in type declarations

2.3.0 • Public • Published

@open-pioneer/runtime

Implements the runtime environment for Open Pioneer Trails apps.

Quick start

Import the createCustomElement function from this package to create your application as a Web Component:

// my-app/app.js
import { createCustomElement } from "@open-pioneer/runtime";
import * as appMetadata from "open-pioneer:app";
import { AppUI } from "./AppUI";

const Element = createCustomElement({
    component: AppUI,
    appMetadata
});

customElements.define("my-app", Element);

In this example, Element is a custom web component class registered as <my-app>. The application renders the AppUI (a react component) and automatically contains services, styles etc. its package dependencies. HTML sites or JavaScript code can now instantiate the application by creating a DOM-Element:

<!-- some-site/index.html -->
<!doctype html>
<html>
    <body>
        <!-- Contains the app once the script has been loaded -->
        <my-app></my-app>
        <script type="module" src="/apps/my-app/app.ts"></script>
    </body>
</html>

License

Apache-2.0 (see LICENSE file)

Readme

Keywords

Package Sidebar

Install

npm i @open-pioneer/runtime

Weekly Downloads

20

Version

2.3.0

License

Apache-2.0

Unpacked Size

282 kB

Total Files

66

Last publish

Collaborators

  • open_pioneer
  • antoniave_conterra
  • jessebluemr
  • mbeckem_conterra