{"id":43845,"library":"single-spa-aurelia-framework","title":"single-spa-aurelia-framework","description":"Adapter that exposes Aurelia v1 application lifecycle methods (bootstrap, mount, unmount) to single-spa. Version 1.0.10 is the current stable release. It manually bootstraps Aurelia, starts it, and sets the root on mount; for unmount it removes, detaches, and unbinds the root component (since Aurelia has no teardown API). Requires Aurelia v1, single-spa, and explicit dependency injection via Container.instance. Differentiates by providing a custom singleton (SingleSpaAureliaCustomProps) for passing customProps to Aurelia views, and supports debug logging. Known limitation: no official teardown means manual cleanup is used, which can lead to memory leaks if not handled carefully.","status":"active","version":"1.0.10","language":"javascript","source_language":"en","source_url":"https://github.com/peterpolman/single-spa-aurelia-framework","tags":["javascript","singlespa","aurelia","typescript"],"install":[{"cmd":"npm install single-spa-aurelia-framework","lang":"bash","label":"npm"},{"cmd":"yarn add single-spa-aurelia-framework","lang":"bash","label":"yarn"},{"cmd":"pnpm add single-spa-aurelia-framework","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer – requires single-spa lifecycle integration","package":"single-spa","optional":false},{"reason":"peer – requires Aurelia v1 framework for bootstrapping and DI","package":"aurelia-framework","optional":false},{"reason":"peer – manual bootstrap function required","package":"aurelia-bootstrapper","optional":false},{"reason":"peer – used to obtain Aurelia instance via Container.instance","package":"aurelia-dependency-injection","optional":false}],"imports":[{"note":"ESM default export – not a named export. CommonJS require() works but is not recommended.","wrong":"const singleSpaAureliaFramework = require('single-spa-aurelia-framework')","symbol":"default (singleSpaAureliaFramework)","correct":"import singleSpaAureliaFramework from 'single-spa-aurelia-framework'"},{"note":"bootstrap, mount, unmount are returned by calling the default export with options, not directly exported from the package.","wrong":"import { bootstrap } from 'single-spa-aurelia-framework'","symbol":"bootstrap","correct":"const { bootstrap } = singleSpaAureliaFramework(...)"},{"note":"TypeScript type exported for custom props injection.","wrong":"","symbol":"SingleSpaAureliaCustomProps","correct":"import { SingleSpaAureliaCustomProps } from 'single-spa-aurelia-framework'"}],"quickstart":{"code":"import singleSpaAureliaFramework from 'single-spa-aurelia-framework';\nimport { bootstrap as aureliaBootstrap } from 'aurelia-bootstrapper';\nimport { Container } from 'aurelia-dependency-injection';\nimport { Aurelia, PLATFORM } from 'aurelia-framework';\n\nexport async function configure(aurelia: Aurelia) {\n  aurelia.use.standardConfiguration();\n  // Do not call aurelia.start() or aurelia.setRoot() here\n}\n\nconst lifecycles = singleSpaAureliaFramework({\n  configure,\n  getInstance: () => Container.instance.get(Aurelia),\n  bootstrap: aureliaBootstrap,\n  component: PLATFORM.moduleName('app'),\n  debug: false,\n});\n\nexport const bootstrap = lifecycles.bootstrap;\nexport const mount = lifecycles.mount;\nexport const unmount = lifecycles.unmount;","lang":"typescript","description":"Exposes single-spa lifecycle methods from an Aurelia v1 application using the adapter."},"warnings":[{"fix":"Manually clean up subscriptions, timers, and event listeners in your Aurelia view models or use a framework that supports proper teardown.","message":"Unmount does not fully teardown Aurelia; it only removes, detaches, and unbinds the root component. This may cause memory leaks if applications are mounted/unmounted repeatedly.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Pass customProps as { payload: { user: ..., locale: ... } } in registerApplication().","message":"The customProps object must have a top-level 'payload' property; other keys are ignored.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Replace PLATFORM.moduleName('app') with 'app'.","message":"PLATFORM.moduleName() is deprecated in Aurelia v1. Use a direct string path instead.","severity":"deprecated","affected_versions":">=1.0"},{"fix":"Ensure your configure() only sets up plugins and features, not start/setRoot.","message":"The configure function must NOT call aurelia.start() or aurelia.setRoot(); the adapter does that on mount.","severity":"gotcha","affected_versions":">=1.0"}],"env_vars":null,"search_vec":"'1.0.10':22 'adapt':6 'api':55 'applic':11 'aurelia':4,9,31,51,57,79,107 'bootstrap':14,30 'care':104 'cleanup':92 'compon':49 'container.instance':67 'current':25 'custom':72 'customprop':77 'debug':83 'depend':64 'detach':44 'differenti':68 'explicit':63 'expos':8 'framework':5 'handl':103 'inject':65 'javascript':105 'known':85 'lead':97 'leak':100 'lifecycl':12 'limit':86 'log':84 'manual':29,91 'mean':90 'memori':99 'method':13 'mount':15,39 'offici':88 'pass':76 'provid':70 'releas':27 'remov':43 'requir':56 'root':37,48 'set':35 'sinc':50 'singl':2,19,60 'single-spa':18,59 'single-spa-aurelia-framework':1 'singlespa':106 'singlespaaureliacustomprop':74 'singleton':73 'spa':3,20,61 'stabl':26 'start':32 'support':82 'teardown':54,89 'typescript':108 'unbind':46 'unmount':16,41 'use':94 'v1':10,58 'version':21 'via':66 'view':80","created_at":"2026-06-05T17:01:45.005227+00:00","updated_at":"2026-06-05T17:01:45.005227+00:00","problems":[{"fix":"Ensure aurelia-dependency-injection is imported and Container is available before calling getInstance.","cause":"Container.instance is undefined if aurelia-dependency-injection is not configured or loaded too early.","error":"TypeError: Cannot read properties of undefined (reading 'get')"},{"fix":"Remove aurelia.start() and aurelia.setRoot() from the configure function.","cause":"The configure function called aurelia.start() or aurelia.setRoot(), conflicting with the adapter's lifecycle.","error":"Error: aurelia is already started"},{"fix":"Ensure mount lifecycle completes before unmount is triggered, and check the component option.","cause":"The root component was not set properly, or unmount was called before mount completed.","error":"Uncaught (in promise) TypeError: Cannot read property 'root' of null"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/peterpolman/single-spa-aurelia-framework#readme","github":"https://github.com/peterpolman/single-spa-aurelia-framework","docs":null,"changelog":null,"pypi":null,"npm":"single-spa-aurelia-framework","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}