How to use the single-spa.declareChildApplication function in single-spa

To help you get started, we’ve selected a few single-spa examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CanopyTax / single-spa / examples / bootstrap.js View on Github external
import { declareChildApplication } from "single-spa";

declareChildApplication('/apps/jspm-with-angular-1.3.0/single-spa.config.js', () => window.location.pathname.startsWith('/legacy'));
declareChildApplication('/apps/jspm-with-angular-1.4.6/single-spa.config.js', () => window.location.pathname.startsWith('/v2'));
declareChildApplication('/apps/bower-angular-phonecat/single-spa.config.js', () => window.location.pathname.startsWith('/phonecat'));
github CanopyTax / single-spa-examples / bootstrap.js View on Github external
import { declareChildApplication } from "single-spa";

declareChildApplication('/apps/jspm-with-angular-1.3.0/single-spa.config.js', () => window.location.pathname.startsWith('/legacy'));
declareChildApplication('/apps/jspm-with-angular-1.4.6/single-spa.config.js', () => window.location.pathname.startsWith('/v2'));
declareChildApplication('/apps/bower-angular-phonecat/single-spa.config.js', () => window.location.pathname.startsWith('/phonecat'));
declareChildApplication('/apps/webpack-with-angular-1.4.7/single-spa.config.js', () => window.location.pathname.startsWith('/webpack1'));
declareChildApplication('/apps/another-webpack-with-angular-1.4.7/single-spa.config.js', () => window.location.pathname.startsWith('/webpack2'));
declareChildApplication('/apps/todomvc-react-0.13.3/single-spa.config.js', () => window.location.pathname.startsWith('/todomvc-react'));
declareChildApplication('/apps/react-router-examples-huge-app/single-spa.config.js', () => window.location.pathname.startsWith('/react-router-huge-app'));
github joeldenning / simple-single-spa-webpack-example / src / root-application / root-application.js View on Github external
import * as singleSpa from 'single-spa';

singleSpa.declareChildApplication('app-1', () => import('../app1/app1.js'), hashPrefix('/app1'));
singleSpa.declareChildApplication('app-2', () => import('../app2/app2.js'), hashPrefix('/app2'));
singleSpa.declareChildApplication('app-3', () => import('../app3/app3.js'), hashPrefix('/app3'));

singleSpa.start();

function hashPrefix(prefix) {
	return function(location) {
		return location.hash.startsWith(`#${prefix}`);
	}
}
github CanopyTax / single-spa-examples / src / single-spa-examples.js View on Github external
import {declareChildApplication, start} from 'single-spa';
import {loadEmberApp} from 'single-spa-ember';
import 'babel-polyfill';

declareChildApplication('navbar', () => import('./navbar/navbar.app.js'), () => true);
declareChildApplication('home', () => import('./home/home.app.js'), () => location.pathname === "" || location.pathname === "/");
declareChildApplication('angularjs', () => import('./angularjs/angularjs.app.js'), pathPrefix('/angularjs'));
declareChildApplication('react', () => import('./react/react.app.js'), pathPrefix('/react'));
declareChildApplication('angular', () => import('./angular/angular.app.js'), pathPrefix('/angular'));
declareChildApplication('vue', () => import('src/vue/vue.app.js'), pathPrefix('/vue'));
declareChildApplication('svelte', () => import('src/svelte/svelte.app.js'), pathPrefix('/svelte'));
declareChildApplication('preact', () => import('src/preact/preact.app.js'), pathPrefix('/preact'));
declareChildApplication('iframe-vanilla-js', () => import('src/vanillajs/vanilla.app.js'), pathPrefix('/vanilla'));
declareChildApplication('inferno', () => import('src/inferno/inferno.app.js'), pathPrefix('/inferno'));
declareChildApplication('cyclejs', () => import('src/cyclejs/cycle.app.js'), pathPrefix('/cycle'));
declareChildApplication('ember', () => loadEmberApp("ember-app", '/build/ember-app/assets/ember-app.js', '/build/ember-app/assets/vendor.js'), pathPrefix('/ember'));

start();

function pathPrefix(prefix) {
    return function(location) {
        return location.pathname.indexOf(`${prefix}`) === 0;
    }
}
github CanopyTax / single-spa-examples / src / single-spa-examples.js View on Github external
import {declareChildApplication, start} from 'single-spa';
import {loadEmberApp} from 'single-spa-ember';
import 'babel-polyfill';

declareChildApplication('navbar', () => import('./navbar/navbar.app.js'), () => true);
declareChildApplication('home', () => import('./home/home.app.js'), () => location.pathname === "" || location.pathname === "/");
declareChildApplication('angularjs', () => import('./angularjs/angularjs.app.js'), pathPrefix('/angularjs'));
declareChildApplication('react', () => import('./react/react.app.js'), pathPrefix('/react'));
declareChildApplication('angular', () => import('./angular/angular.app.js'), pathPrefix('/angular'));
declareChildApplication('vue', () => import('src/vue/vue.app.js'), pathPrefix('/vue'));
declareChildApplication('svelte', () => import('src/svelte/svelte.app.js'), pathPrefix('/svelte'));
declareChildApplication('preact', () => import('src/preact/preact.app.js'), pathPrefix('/preact'));
declareChildApplication('iframe-vanilla-js', () => import('src/vanillajs/vanilla.app.js'), pathPrefix('/vanilla'));
declareChildApplication('inferno', () => import('src/inferno/inferno.app.js'), pathPrefix('/inferno'));
declareChildApplication('cyclejs', () => import('src/cyclejs/cycle.app.js'), pathPrefix('/cycle'));
declareChildApplication('ember', () => loadEmberApp("ember-app", '/build/ember-app/assets/ember-app.js', '/build/ember-app/assets/vendor.js'), pathPrefix('/ember'));

start();

function pathPrefix(prefix) {
    return function(location) {
        return location.pathname.indexOf(`${prefix}`) === 0;
    }
}
github CanopyTax / single-spa-examples / bootstrap.js View on Github external
import { declareChildApplication } from "single-spa";

declareChildApplication('/apps/jspm-with-angular-1.3.0/single-spa.config.js', () => window.location.pathname.startsWith('/legacy'));
declareChildApplication('/apps/jspm-with-angular-1.4.6/single-spa.config.js', () => window.location.pathname.startsWith('/v2'));
declareChildApplication('/apps/bower-angular-phonecat/single-spa.config.js', () => window.location.pathname.startsWith('/phonecat'));
declareChildApplication('/apps/webpack-with-angular-1.4.7/single-spa.config.js', () => window.location.pathname.startsWith('/webpack1'));
declareChildApplication('/apps/another-webpack-with-angular-1.4.7/single-spa.config.js', () => window.location.pathname.startsWith('/webpack2'));
declareChildApplication('/apps/todomvc-react-0.13.3/single-spa.config.js', () => window.location.pathname.startsWith('/todomvc-react'));
declareChildApplication('/apps/react-router-examples-huge-app/single-spa.config.js', () => window.location.pathname.startsWith('/react-router-huge-app'));
github CanopyTax / single-spa-angularjs / examples / multiple-angular-versions / bootstrap.js View on Github external
import { declareChildApplication } from "single-spa";

declareChildApplication('/apps/1.2.0/1.2.0-app.js', () => window.location.pathname.startsWith('/legacy'));
declareChildApplication('/apps/1.4.5/1.4.5-app.js', () => window.location.pathname.startsWith('/v2'));
github CanopyTax / single-spa-angularjs / examples / multiple-angular-versions / bootstrap.js View on Github external
import { declareChildApplication } from "single-spa";

declareChildApplication('/apps/1.2.0/1.2.0-app.js', () => window.location.pathname.startsWith('/legacy'));
declareChildApplication('/apps/1.4.5/1.4.5-app.js', () => window.location.pathname.startsWith('/v2'));
github CanopyTax / single-spa-examples / src / single-spa-examples.js View on Github external
import {declareChildApplication, start} from 'single-spa';
import {loadEmberApp} from 'single-spa-ember';
import 'babel-polyfill';

declareChildApplication('navbar', () => import('./navbar/navbar.app.js'), () => true);
declareChildApplication('home', () => import('./home/home.app.js'), () => location.pathname === "" || location.pathname === "/");
declareChildApplication('angularjs', () => import('./angularjs/angularjs.app.js'), pathPrefix('/angularjs'));
declareChildApplication('react', () => import('./react/react.app.js'), pathPrefix('/react'));
declareChildApplication('angular', () => import('./angular/angular.app.js'), pathPrefix('/angular'));
declareChildApplication('vue', () => import('src/vue/vue.app.js'), pathPrefix('/vue'));
declareChildApplication('svelte', () => import('src/svelte/svelte.app.js'), pathPrefix('/svelte'));
declareChildApplication('preact', () => import('src/preact/preact.app.js'), pathPrefix('/preact'));
declareChildApplication('iframe-vanilla-js', () => import('src/vanillajs/vanilla.app.js'), pathPrefix('/vanilla'));
declareChildApplication('inferno', () => import('src/inferno/inferno.app.js'), pathPrefix('/inferno'));
declareChildApplication('cyclejs', () => import('src/cyclejs/cycle.app.js'), pathPrefix('/cycle'));
declareChildApplication('ember', () => loadEmberApp("ember-app", '/build/ember-app/assets/ember-app.js', '/build/ember-app/assets/vendor.js'), pathPrefix('/ember'));

start();

function pathPrefix(prefix) {
    return function(location) {
        return location.pathname.indexOf(`${prefix}`) === 0;
    }
}
github CanopyTax / single-spa-examples / bootstrap.js View on Github external
import { declareChildApplication } from "single-spa";

declareChildApplication('/apps/jspm-with-angular-1.3.0/single-spa.config.js', () => window.location.pathname.startsWith('/legacy'));
declareChildApplication('/apps/jspm-with-angular-1.4.6/single-spa.config.js', () => window.location.pathname.startsWith('/v2'));
declareChildApplication('/apps/bower-angular-phonecat/single-spa.config.js', () => window.location.pathname.startsWith('/phonecat'));
declareChildApplication('/apps/webpack-with-angular-1.4.7/single-spa.config.js', () => window.location.pathname.startsWith('/webpack1'));
declareChildApplication('/apps/another-webpack-with-angular-1.4.7/single-spa.config.js', () => window.location.pathname.startsWith('/webpack2'));
declareChildApplication('/apps/todomvc-react-0.13.3/single-spa.config.js', () => window.location.pathname.startsWith('/todomvc-react'));
declareChildApplication('/apps/react-router-examples-huge-app/single-spa.config.js', () => window.location.pathname.startsWith('/react-router-huge-app'));