Skip to content

Calling app instance's "destroy" is broken when using this addon #158

@roberkules

Description

@roberkules

Hi,

we're trying to use single-spa with angular and ember side by side, according to the route, either ember or angular is active. when ember is unmounted, single-spa calls opts.applicationInstance.destroy();

this works until ember-destroyable-polyfill is added. then the app instance continues to exist even after destroy() is called on it.

I tested the behavior in an empty ember app (without the single-spa-ember or any other addon). without ember-destroyable-polyfill upon calling destroy() on the app, all DOM nodes are removed and the app instance (in our case EmberLeak) is undefined. but adding this addon causes the EmberLeak instance to continue to exist, and no content is removed from the DOM.

this actually results in a weird state when using in single-spa when switching back and forth between angular and ember. each time there's another app instance added and all ajax requests get multiplied. (also causes other issues)

{
  "devDependencies": {
    "@ember/jquery": "^0.5.2",
    "@ember/optional-features": "^0.6.3",
    "ember-destroyable-polyfill": "^2.0.2",
    "broccoli-asset-rev": "^2.7.0",
    "ember-auto-import": "^1.11.3",
    "ember-cli": "~3.17.0",
    "ember-cli-app-version": "^3.2.0",
    "ember-cli-babel": "^7.22.1",
    "ember-cli-dependency-checker": "^3.1.0",
    "ember-cli-eslint": "^4.2.3",
    "ember-cli-htmlbars": "^3.0.0",
    "ember-cli-htmlbars-inline-precompile": "^1.0.3",
    "ember-cli-inject-live-reload": "^1.8.2",
    "ember-cli-sri": "^2.1.1",
    "ember-cli-template-lint": "^1.0.0-beta.1",
    "ember-cli-uglify": "^2.1.0",
    "ember-export-application-global": "^2.0.0",
    "ember-fetch": "^8.0.4",
    "ember-load-initializers": "^1.1.0",
    "ember-maybe-import-regenerator": "^0.1.6",
    "ember-qunit": "^3.4.1",
    "ember-resolver": "^5.0.1",
    "ember-source": "~3.17.0",
    "eslint-plugin-ember": "^5.2.0",
    "loader.js": "^4.7.0",
    "qunit-dom": "^0.8.0"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions