0.15.13 • Published 11 months ago

piral-single-spa v0.15.13

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

Piral Logo

Piral single-spa · GitHub License npm version tested with jest Gitter Chat

This is a plugin that only has a peer dependency to piral-core. What piral-single-spa brings to the table is a set of Pilet API extensions that can be used with piral or piral-core.

The set includes a single-spa converter for any component registration, as well as a fromSingleSpa shortcut.

By default, these API extensions are not integrated in piral, so you'd need to add them to your Piral instance.

Documentation

The following functions are brought to the Pilet API.

fromSingleSpa()

Transforms a standard single-spa component/microfrontend into a component that can be used in Piral, essentially wrapping it with a reference to the corresponding converter.

Usage

::: summary: For pilet authors

You can use the fromSingleSpa function from the Pilet API to convert your single-spa components to components usable by your Piral instance.

Example use:

import { PiletApi } from '<name-of-piral-instance>';
import * as spaComponent from './root';

export function setup(piral: PiletApi) {
  piral.registerPage('/sample', piral.fromSingleSpa(spaComponent));
}

Alternatively, if piral-single-spa has not been added to the Piral instance you can install and use the package also from a pilet directly.

import { PiletApi } from '<name-of-piral-instance>';
import { fromSingleSpa } from 'piral-single-spa/convert';
import * as spaComponent from './root';

export function setup(piral: PiletApi) {
  piral.registerPage('/sample', fromSingleSpa(spaComponent));
}

:::

::: summary: For Piral instance developers

Using single-spa with Piral is as simple as installing piral-single-spa.

import { createSingleSpaApi } from 'piral-single-spa';

The integration looks like:

const instance = createInstance({
  // important part
  plugins: [createSingleSpaApi()],
  // ...
});

:::

License

Piral is released using the MIT license. For more information see the license file.

0.15.12-beta.5538

12 months ago

0.15.12-beta.5535

12 months ago

0.15.13-beta.5560

12 months ago

0.15.12-beta.5541

12 months ago

0.15.13-beta.5556

12 months ago

0.15.13

11 months ago

0.15.12

12 months ago

0.15.13-beta.5591

11 months ago

0.15.13-beta.5583

11 months ago

0.15.13-beta.5575

12 months ago

0.15.11-beta.5506

12 months ago

0.15.12-beta.5528

12 months ago

0.15.12-beta.5531

12 months ago

0.15.10

12 months ago

0.15.11

12 months ago

0.15.9

1 year ago

0.15.5

1 year ago

0.15.6

1 year ago

0.15.7

1 year ago

0.15.8

1 year ago

0.15.0-beta.4790

2 years ago

0.15.4

1 year ago

0.15.0-beta.4756

2 years ago

0.15.0-beta.4751

2 years ago

0.15.0-beta.4798

2 years ago

0.15.0

1 year ago

0.15.0-beta.4791

2 years ago

0.15.1

1 year ago

0.15.2

1 year ago

0.15.3

1 year ago

0.15.0-beta.4739

2 years ago

0.15.0-beta.4803

2 years ago

0.15.0-beta.4801

2 years ago

0.15.0-beta.4708

2 years ago

0.15.0-beta.4715

2 years ago

0.15.0-beta.4696

2 years ago

0.15.0-beta.4630

2 years ago

0.15.0-beta.4699

2 years ago

0.15.0-beta.4633

2 years ago

0.15.0-beta.4670

2 years ago

0.15.0-beta.4672

2 years ago

0.15.0-beta.4607

2 years ago

0.15.0-beta.4725

2 years ago

0.15.0-beta.4579

2 years ago

0.15.0-beta.4574

2 years ago

0.15.0-beta.4560

2 years ago

0.15.0-beta.4549

2 years ago

0.15.0-beta.4544

2 years ago

0.15.0-beta.4512

2 years ago

0.15.0-beta.4472

2 years ago

0.15.0-beta.4466

2 years ago

0.15.0-beta.4465

2 years ago

0.15.0-beta.4411

2 years ago