1"use strict" 2define("dummy/adapters/-addon-docs",["exports","ember-cli-addon-docs/adapters/-addon-docs"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/adapters/class",["exports","ember-cli-addon-docs/adapters/class"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/adapters/component",["exports","ember-cli-addon-docs/adapters/component"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/adapters/module",["exports","ember-cli-addon-docs/adapters/module"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/adapters/project",["exports","ember-cli-addon-docs/adapters/project"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/app",["exports","@ember/application","ember-resolver","ember-load-initializers","dummy/config/environment"],function(e,n,t,o,s){function i(e,n,t){return(n=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e 3var t=e[Symbol.toPrimitive] 4if(void 0!==t){var o=t.call(e,n||"default") 5if("object"!=typeof o)return o 6throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string") 7return"symbol"==typeof n?n:n+""}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 8class r extends n.default{constructor(...e){super(...e),i(this,"modulePrefix",s.default.modulePrefix),i(this,"podModulePrefix",s.default.podModulePrefix),i(this,"Resolver",t.default)}}e.default=r,(0,o.default)(r,s.default.modulePrefix)}),define("dummy/application",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 9e.default=(0,n.createTemplateFactory)({id:"cee6jQn/",block:'[[[8,[39,0],[[24,3,"Engines"]],null,null],[1,"\\n\\n"],[46,[28,[37,2],null,null],null,null,null],[1,"\\n\\n"],[8,[39,3],null,null,null]],[],["docs-header","component","-outlet","docs-keyboard-shortcuts"]]',moduleName:"dummy/application.hbs",isStrictMode:!1})}),define("dummy/component-managers/glimmer",["exports","@glimmer/component/-private/ember-component-manager"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/api/x-class",["exports","ember-cli-addon-docs/components/api/x-class"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/api/x-component",["exports","ember-cli-addon-docs/components/api/x-component"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/api/x-import-path",["exports","ember-cli-addon-docs/components/api/x-import-path"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/api/x-meta-panel",["exports","ember-cli-addon-docs/components/api/x-meta-panel"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/api/x-meta-panel/header",["exports","ember-cli-addon-docs/components/api/x-meta-panel/header"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}
9),define("dummy/components/api/x-module",["exports","ember-cli-addon-docs/components/api/x-module"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/api/x-section",["exports","ember-cli-addon-docs/components/api/x-section"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/api/x-sections",["exports","ember-cli-addon-docs/components/api/x-sections"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/api/x-toggles",["exports","ember-cli-addon-docs/components/api/x-toggles"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/copy-button",["exports","ember-cli-clipboard/components/copy-button"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-code-highlight",["exports","ember-cli-addon-docs/components/docs-code-highlight"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-demo",["exports","ember-cli-addon-docs/components/docs-demo"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-demo/x-example",["exports","ember-cli-addon-docs/components/docs-demo/x-example"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-demo/x-snippet",["exports","ember-cli-addon-docs/components/docs-demo/x-snippet"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-header",["exports","ember-cli-addon-docs/components/docs-header"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-header/link",["exports","ember-cli-addon-docs/components/docs-header/link"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-header/search-box",["exports","ember-cli-addon-docs/components/docs-header/search-box"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-header/search-result",["exports","ember-cli-addon-docs/components/docs-header/search-result"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-header/search-results",["exports","ember-cli-addon-docs/components/docs-header/search-results"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-header/version-selector",["exports","ember-cli-addon-docs/components/docs-header/version-selector"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-hero",["exports","ember-cli-addon-docs/components/docs-hero"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-keyboard-shortcuts",["exports","ember-cli-addon-docs/components/docs-keyboard-shortcuts"],function(e,n){Object.defineProperty(e,"__esMo
9dule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}) 10define("dummy/components/docs-link",["exports","ember-cli-addon-docs/components/docs-link"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-logo",["exports","ember-cli-addon-docs/components/docs-logo"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-modal-dialog",["exports","ember-cli-addon-docs/components/docs-modal-dialog"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-snippet",["exports","ember-cli-addon-docs/components/docs-snippet"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-viewer",["exports","ember-cli-addon-docs/components/docs-viewer"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-viewer/x-autogenerated-api-docs",["exports","ember-cli-addon-docs/components/docs-viewer/x-autogenerated-api-docs"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-viewer/x-autogenerated-api-docs/module-nav",["exports","ember-cli-addon-docs/components/docs-viewer/x-autogenerated-api-docs/module-nav"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-viewer/x-current-page-index",["exports","ember-cli-addon-docs/components/docs-viewer/x-current-page-index"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-viewer/x-main",["exports","ember-cli-addon-docs/components/docs-viewer/x-main"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-viewer/x-nav-item",["exports","ember-cli-addon-docs/components/docs-viewer/x-nav-item"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-viewer/x-nav-list",["exports","ember-cli-addon-docs/components/docs-viewer/x-nav-list"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-viewer/x-nav",["exports","ember-cli-addon-docs/components/docs-viewer/x-nav"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/docs-viewer/x-section",["exports","ember-cli-addon-docs/components/docs-viewer/x-section"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/ember-modal-dialog-positioned-container",["exports","ember-modal-dialog/components/positioned-container"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/ember-modal-dialog/-basic-dialog",["exports","ember-modal-dialog/components/basic-dialog"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/ember-modal-dialog/-in-place-dialog",["exports","ember-modal-dialog/components/in-place-dialog"],function(e,n){Object.defineProperty(e,"__esMo
10dule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/ember-modal-dialog/-liquid-dialog",["exports","ember-modal-dialog/components/liquid-dialog"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/ember-modal-dialog/-liquid-tether-dialog",["exports","ember-modal-dialog/components/liquid-tether-dialog"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/ember-modal-dialog/-tether-dialog",["exports","ember-modal-dialog/components/tether-dialog"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/ember-modal-dialog/overlay",["exports","ember-modal-dialog/components/overlay"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/ember-tether",["exports","ember-tether/components/ember-tether"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/ember-wormhole",["exports","ember-wormhole/components/ember-wormhole"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/components/modal-dialog",["exports","ember-modal-dialog/components/modal-dialog"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/data-adapter",["exports","@ember-data/debug/data-adapter"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/deprecation-workflow",["ember-cli-deprecation-workflow"],function(e){(0,e.default)({throwOnUnhandled:!1,workflow:[]})}),define("dummy/docs",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 11e.default=(0,n.createTemplateFactory)({id:"Z4GrIUsn",block:'[[[8,[39,0],null,null,[["default"],[[[[1,"\\n "],[8,[30,1,["nav"]],null,null,[["default"],[[[[1,"\\n "],[8,[30,2,["section"]],null,[["@label"],["Getting Started"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["What are Engines?","docs.index"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Installation","docs.installation"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Quickstart","docs.quickstart"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Embroider","docs.embroider"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Deploying","docs.deploying"]],null],[1,"\\n\\n "],[8,[30,2,["section"]],null,[["@label"],["Core Concepts"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Isolation","docs.isolation"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Routable vs. Routeless","docs.routable-vs-routeless"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Lazy loading","docs.lazy-loading"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Addons","docs.addons"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Services","docs.services"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Sharing code","docs.sharing-code"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Dependencies","docs.dependencies"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Bundling","docs.bundling"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Links","docs.links"]],null],[1,"\\n\\n "],[8,[30,2,["section"]],null,[["@label"],["Components"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["link-to-external","docs.link-to-external"]],null],[1,"\\n\\n "],[8,[30,2,["section"]],null,[["@label"],["Testing"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Introduction","docs.testing-intro"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Unit Tests","docs.testing-unit"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Rendering Tests","docs.testing-integration"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Application Tests","docs.testing-acceptance"]],null],[1,"\\n\\n "],[8,[30,2,["section"]],null,[["@label"],["Migrating"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Migrations","docs.migrations"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Deprecations","docs.deprecations"]],null],[1,"\\n "]],[2]]]]],[1,"\\n\\n "],[8,[30,1,["main"]],null,null,[["default"],[[[[1,"\\n "],[46,[28,[37,2],null,
11null],null,null,null],[1,"\\n "]],[]]]]],[1,"\\n"]],[1]]]]]],["viewer","nav"],["docs-viewer","component","-outlet"]]',moduleName:"dummy/docs.hbs",isStrictMode:!1})}),define("dummy/docs/addons",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 12e.default=(0,n.createTemplateFactory)({id:"hDayYPN0",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"addons"],[14,0,"docs-md__h1"],[12],[1,"Addons"],[13],[1,"\\n "],[10,2],[12],[1,"As mentioned before, Engines are created as a specific type of "],[10,3],[14,6,"https://cli.emberjs.com/release/writing-addons/"],[14,0,"docs-md__a"],[12],[1,"Ember Addon"],[13],[1,". This makes sense given that Addons are Ember\'s way to easily share common or reusable code. Since Engines are intended to package logical applications that can be composed, they fit nicely into the paradigm of shareable addons."],[13],[1,"\\n"],[10,2],[12],[1,"Addons come in two distinct flavors: "],[10,"em"],[12],[1,"Standard"],[13],[1," and "],[10,"em"],[12],[1,"In-Repo"],[13],[1,". Standard Addons (normally just referred to as Addons) are full-fledged NPM packages that can be distributed and installed in other Ember applications. In-repo-addons, on the other hand, live within the repository of an Ember Application and are only used by that specific application."],[13],[1,"\\n"],[10,2],[12],[1,"This distinction is important for Engines, as it is fairly likely to want a logical application represented by an Engine but only use it with a specific Ember Application. In those cases, using an in-repo-engine is a good alternative to consider instead of maintaining two separate repositories."],[13],[1,"\\n"],[10,2],[12],[1,"It is recommended to read through the \\""],[10,3],[14,6,"https://cli.emberjs.com/release/writing-addons/"],[14,0,"docs-md__a"],[12],[1,"Writing Addons"],[13],[1,"\\" portion of the Ember-CLI user guide before moving onto the \\""],[10,3],[14,6,"./creating-an-engine"],[14,0,"docs-md__a"],[12],[1,"Creating An Engine"],[13],[1,"\\" portion of the guide."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"in-repo-addons"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#in-repo-addons"],[14,0,"heading-anchor"],[12],[1,"In-repo-addons"],[13],[13],[1,"\\n "],[10,2],[12],[1,"If you want to use an addon in an engine, you have to add it to the engines "],[10,"code"],[12],[1,"dependencies"],[13],[1,". This is necessary for the following types of addons:"],[13],[1,"\\n\\n "],[10,"ul"],[14,0,"docs-list-disc"],[12],[10,"li"],[12],[1,"Addons that provide components or helpers that you want to use in the engine"],[13],[1,"\\n"],[10,"li"],[12],[1,"Addons that provide other utils or similar that you want to use in the engine"],[13],[1,"\\n"],[10,"li"],[12],[1,"Addons that provide services that are not passed through from the host app"],[13],[1,"\\n"],[13],[1,"\\n "],[10,2],[12],[1,"The following types of addons should be placed in the "],[10,"code"],[12],[1,"devDependencies"],[13],[1,":"],[13],[1,"\\n\\n "],[10,"ul"],[14,0,"docs-list-disc"],[12],[10,"li"],[12],[1,"Addons that provide services that are passed through from the host app"],[13],[1,"\\n"],[10,"li"],[12],[1,"Addons that do build adaptions"],[13],[1,"\\n"],[13],[1,"\\n \\n "],[10,"h3"],[14,1,"using-ember-data"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#using-ember-data"],[14,0,"heading-anchor"],[12],[1,"Using Ember Data"],[13],[13],[1,"\\n "],[10,2],[12],[1,"When working with Ember Data, the models are defined in the host app, and you will need to pass the "],[10,"code"],[12],[1,"store"],[13],[1," service through to the engine as a dependency. This way, the host app and the engine use the same store and models. You then need to add "],[10,"code"],[12],[1,"ember-data"],[13],[1," as a "],[10,"code"],[12],[1,"devDependency"],[13],[1," to your engine."],[13],[1,"\\n"],[10,2],[12],[1,"The easiest way to realise this is to define your models in a shared addon, which is included by both your host app and your engine."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"addon-deduplication"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#addon-deduplication"],[14,0,"heading-anchor"],[12],[1,"Addon deduplication"],[13],[13],[1,"\\n "],[10,2],[12],[1,"If you are using ember engines "],[10,"strong"],[12],[1,"v0.7.1 or higher"],[13],[1,": Use "],[10,"code"],[12],[1,"EMBER_ENGINES_ADDON_DEDUPE"],[13],[1," environment variable to deduplicate the nested addons of lazy engine which are also host app addons. More details at "],[10,3],[14,6,"https://github.com/ember-engines/ember-engines/pull/595"],[14,0,"docs-md__a"],[12],[1,"#595"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"If you are using ember engines "],[10,"strong"],[12],[1,"v0.7.0 or less"],[13],[1,", follow the explanation bellow:"],[13],[1,"\\n"],[10,2],[12],[1,"ember-engines will automatically try to deduplicate addons used by your host app and (lazy loaded) engine(s). This means that addons that both the host app and an engine rely on, are only included in the vendor bundle of the host app. This ensures that you do not ship the addon code multiple times to your users."],[13],[1,"\\n"],[10,2],[12],[1,"If addons are not included in the host app, they will be included in the engine\'s vendor bundle."],[13],[1,"\\n"],[10,2],[12],[1,"Note that the deduplication between host app and addon depends on the "],[10,"code"],[12],[1,"cacheKeyForTree()"],[13],[1," method of the addon. It will only deduplicate if the cache key returned by that method is the same. This will by default be the case, unless the addon provides a custom "],[10,"code"],[12],[1,"treeForAddon()"],[13],[1," hook. If that is the case, the addon should provide a custom "],[10,"code"],[12],[1,"cacheKeyForTree()"],[13],[1," method that returns a static key - for example:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"const"],[13],[1," calculateCacheKeyForTree = "],[10,1],[14,0,"hljs-built_in"],[12],[1,"require"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'calculate-cache-key-for-tree\'"],[13],[1,");\\n\\n"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"exports"],[13],[1," = {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"name"],[13],[1,": "],[10,1],[14,0,"hljs-built_in"],[12],[1,"require"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'./package\'"],[13],[1,")."],[10,1],[14,0,"hljs-property"],[12],[1,"name"],[13],[1,",\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"treeForAddon"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// returns custom tree - overwriting this hook disables the default caching!"],[13],[1,"\\n },\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"cacheKeyForTree"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"treeType"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"if"],[13],[1," (treeType === "],[10,1],[14,0,"hljs-string"],[12],[1,"\'addon\'"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"calculateCacheKeyForTree"],[13],[1,"(treeType, "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,");\\n }\\n\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"_super"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"cacheKeyForTree"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"apply"],[13],[1,"("],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,", "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"arguments"],[13],[1,");\\n }\\n};\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Isolation and separation of responsibilities is generally hard to solve. The most recurrent scenario in a composable app with Ember Engines is: "],[10,"code"],[12],[1,"Imagine the css or components that are only used by engine-a, engine-b and engine-c"],[13],[1," all possible cases have down sides here:"],[13],[1,"\\n\\n "],[10,"ol"],[14,0,"docs-list-decimal"],[12],[10,"li"],[12],[10,2],[12],[1,"Include shared deps into the host app - Downside: Increases initial bundle size."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"Include shared deps into each engine bundle - Downside: Duplicated stuff in multiple engine bundles."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"Somehow split out shared deps into dedicated bundles "],[10,"code"],[12],[1,"(e.g. /engine-assets/shared-by-a-and-b.js)"],[13],[1," - Downside: You might end up with 20 bundles "],[10,"code"],[12],[1,"(e.g. shared-by-a-and-b, shared-by-b-and-c-, shared-by-a-b-and-c, ...)"],[13],[1,", and it is probably pretty complicated from a built step perspective."],[13],[1,"\\n"],[13],[1,"\\n"],[13],[1,"\\n "],[10,2],[12],[1,"Engines currently take the second approach, but may allow more options in the future."],[13],[1,"\\n"],[13]],[],["div","h1","p","a","em","h2","code","ul","li","h3","strong","pre","span","ol"]]',moduleName:"dummy/docs/addons.hbs",isStrictMode:!1})}),define("dummy/docs/bundling",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
12dule",{value:!0}),e.default=void 0 13e.default=(0,n.createTemplateFactory)({id:"k4Ns3wtP",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"bundling"],[14,0,"docs-md__h1"],[12],[1,"Bundling"],[13],[1,"\\n "],[10,2],[12],[10,"em"],[12],[1,"Ember Engines"],[13],[1," not only provides isolation principles for how your code is run, but also how it is bundled."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"host-engine-dependencies"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#host-engine-dependencies"],[14,0,"heading-anchor"],[12],[1,"Host / Engine Dependencies"],[13],[13],[1,"\\n "],[10,2],[12],[1,"In the following examples:"],[13],[1,"\\n\\n "],[10,"ul"],[14,0,"docs-list-disc"],[12],[10,"li"],[12],[10,2],[12],[1,"If the dependency required by the "],[10,"em"],[12],[1,"Engine A"],[13],[1," is different than the "],[10,"em"],[12],[1,"Host"],[13],[1," it will resolve the top level dependency. In this case "],[10,"code"],[12],[1,"Foo"],[13],[1," will resolve to "],[10,"code"],[12],[1,"Foo@2"],[13],[1,"."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"If that dependency is not in the host and only in the Engine. In this this case "],[10,"code"],[12],[1,"Bar"],[13],[1,", it will be bundled in "],[10,"code"],[12],[1,"engine-vendor-{hash}.js"],[13],[1,"."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"For the case of "],[10,"code"],[12],[1,"Baz"],[13],[1,", since both "],[10,"em"],[12],[1,"Engine A"],[13],[1," and the "],[10,"em"],[12],[1,"Host"],[13],[1," require the same dependency it will be bundled into "],[10,"code"],[12],[1,"vendor-{hash}.js"],[13],[1,"."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"For the case of "],[10,"code"],[12],[1,"Qux"],[13],[1,", since both "],[10,"em"],[12],[1,"Engine A"],[13],[1," and the "],[10,"em"],[12],[1,"Host"],[13],[1," require the same dependency it will be bundled into "],[10,"code"],[12],[1,"vendor-{hash}.js"],[13],[1," and will be deduped out of the "],[10,"code"],[12],[1,"engine-vendor-{hash}.js"],[13],[1," output."],[13],[1,"\\n"],[13],[1,"\\n"],[13],[1,"\\n "],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[12],[1,"| Dependency Name | Engine A | Host |\\n|=================|==========|======|\\n| Foo | v2 | v1 |\\n| Bar | v1 | N\\\\A |\\n| Baz | v1 | v2 |\\n| Qux | v2 | v2 |\\n"],[13],[13],[1,"\\n"],[13]],[],["div","h1","p","em","h2","a","ul","li","code","pre"]]',moduleName:"dummy/docs/bundling.hbs",isStrictMode:!1})}),define("dummy/docs/dependencies",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 14e.default=(0,n.createTemplateFactory)({id:"IeDBgeyp",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"dependencies"],[14,0,"docs-md__h1"],[12],[1,"Dependencies"],[13],[1,"\\n \\n "],[10,"h2"],[14,1,"using-yarn-workspaces"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#using-yarn-workspaces"],[14,0,"heading-anchor"],[12],[1,"Using Yarn workspaces"],[13],[13],[1,"\\n "],[10,2],[12],[1,"One way to work with engines is to use "],[10,3],[14,6,"https://yarnpkg.com/lang/en/docs/workspaces"],[14,0,"docs-md__a"],[12],[1,"Yarn workspaces"],[13],[1,". You could set up your app like this:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[12],[1,"- my-app (workspace)\\n - packages\\n - host-app\\n - engine-a\\n - engine-b\\n - shared-addon\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"In this example, the actual app would be in the "],[10,"code"],[12],[1,"my-app/packages/host-app"],[13],[1," directory, while "],[10,"code"],[12],[1,"my-app/packages/engine-a"],[13],[1," and "],[10,"code"],[12],[1,"my-app/packages/engine-b"],[13],[1," would be engines. "],[10,"code"],[12],[1,"my-app/packages/shared-addon"],[13],[1," could be a shared addon that is used by the host app & all engines, including for example common components, services or Ember Data models."],[13],[1,"\\n"],[10,2],[12],[1,"The advantage of this approach is that all of these dependencies will always be in sync and up to date. If you change something in the shared addon, it will immediately be reflected in the host app and all engines. It also makes it easier to ensure all engines depen
14d on the same versions of addons."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"managing-multiple-addon-versions"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#managing-multiple-addon-versions"],[14,0,"heading-anchor"],[12],[1,"Managing multiple addon versions"],[13],[13],[1,"\\n "],[10,2],[12],[1,"When working with engines, it is important to avoid including different versions of the same addon. Currently, only one addon version can actually be loaded at a time. If your host app and engines depend on different versions of an addon, you will run into hard to control issues."],[13],[1,"\\n"],[10,2],[12],[1," For example, imagine the host app depends on "],[10,"code"],[12],[1,"ember-power-select^1.0.0"],[13],[1,", engine-a depends on "],[10,"code"],[12],[1,"ember-power-select~2.0.0"],[13],[1," and engine-b depends on "],[10,"code"],[12],[1,"ember-power-select~2.1.0"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1," Now, three different versions of ember-power-select would be included in the respective vendor bundles. But which version would actually be used in your app/engine would depend on the order in which the bundles are loaded."],[13],[1,"\\n"],[10,2],[12],[1," Generally, you should ensure that only one version of a given addon is included across your host app and engines. A great way to ensure this is to use "],[10,3],[14,6,"https://github.com/salsify/ember-cli-dependency-lint"],[14,0,"docs-md__a"],[12],[1,"ember-cli-dependency-lint"],[13],[1,", which will tell you if multiple versions of an addon are installed."],[13],[1,"\\n"],[10,2],[12],[1," If you use Yarn, you can use "],[10,3],[14,6,"https://yarnpkg.com/lang/en/docs/selective-version-resolutions/"],[14,0,"docs-md__a"],[12],[1,"resolutions"],[13],[1," to force a specific version to be used by an addon. In the above example, you could add the following to your host apps "],[10,"code"],[12],[1,"package.json"],[13],[1,":"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-json"],[12],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"dependencies\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,","],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"devDependencies\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,","],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"resolutions\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"**/ember-power-select\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"^1.0.0\\""],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n"],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"This would force this version on all addons. Please use this feature with caution, as it is then up to you to make sure that all apps and engines actually work with this version of the addon."],[13],[1,"\\n"],[13]],[],["div","h1","h2","a","p","pre","code","span"]]',moduleName:"dummy/docs/dependencies.hbs",isStrictMode:!1})}),define("dummy/docs/deploying",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 15e.default=(0,n.createTemplateFactory)({id:"hTp7qZTu",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"deploying"],[14,0,"docs-md__h1"],[12],[1,"Deploying"],[13],[1,"\\n \\n "],[10,"h2"],[14,1,"deploying-an-engine"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#deploying-an-engine"],[14,0,"heading-anchor"],[12],[1,"Deploying An Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"In many cases, your engine code may be served from a static server, typically a CDN; this server will probably not share the same root location as your application. In order to specify the location to get the engine assets, you can implement a "],[10,"code"],[12],[1,"generateURI"],[13],[1," function in the host application\'s "],[10,"code"],[12],[1,"ember-cli-build.js"],[13],[1," file:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// host-app/ember-cli-build.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"let"],[13],[1," app = "],[10,1],[14,0,"hljs-keyword"],[12],[1,"new"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"EmberApp"],[13],[1,"(defaults, {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"assetLoader"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"generateURI"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"filePath"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"if"],[13],[1," ("],[10,1],[14,0,"hljs-title class_"],[12],[1,"EmberApp"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"env"],[13],[1,"() === "],[10,1],[14,0,"hljs-string"],[12],[1,"\'production\'"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"`https://production.cdn.com/"],[10,1],[14,0,"hljs-subst"],[12],[1,"${filePath}"],[13],[1,"`"],[13],[1,";\\n } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"else"],[13],[1," {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"`local/static/"],[10,1],[14,0,"hljs-subst"],[12],[1,"${filePath}"],[13],[1,"`"],[13],[1,";\\n }\\n }\\n }\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"The "],[10,"code"],[12],[1,"generateURI"],[13],[1," function receives the "],[10,"code"],[12],[1,"filePath"],[13],[1," for each asset and must return a string of the asset\'s location. For more info, see the "],[10,3],[14,6,"https://github.com/ember-engines/ember-asset-loader#generating-custom-uris"],[14,0,"docs-md__a"],[12],[1,"ember-asset-loader documentation"],[13],[1,"."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"fastboot"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#fastboot"],[14,0,"heading-anchor"],[12],[1,"Fastboot"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Ember Engines is perfect for combining with server-side rendering solution and works with "],[10,3],[14,6,"https://ember-fastboot.com/"],[14,0,"docs-md__a"],[12],[1,"FastBoot"],[13],[1," out of the box."],[13],[1,"\\n"],[10,2],[12],[1,"All Engine builds (regardless of whether they are lazy-loaded or not) will generate a "],[10,"code"],[12],[1,"engines-dist/engine-name/config/environment.js"],[13],[1," file. This is because we need to load that file in FastBoot for both eager and lazy engines."],[13],[1,"\\n"],[13]],[],["div","h1","h2","a","p","code","pre","span"]]',moduleName:"dummy/docs/deploying.hbs",isStrictMode:!1})}) 16define("dummy/docs/deprecations",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
16dule",{value:!0}),e.default=void 0 17e.default=(0,n.createTemplateFactory)({id:"iDOUZMTI",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"deprecations"],[14,0,"docs-md__h1"],[12],[1,"Deprecations"],[13],[1,"\\n \\n "],[10,"h3"],[14,1,"-transition-methods-of-controller-and-route"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-transition-methods-of-controller-and-route"],[14,0,"heading-anchor"],[12],[1,"§ Transition methods of Controller and Route"],[13],[13],[1,"\\n "],[10,2],[12],[10,"strong"],[12],[1,"until"],[13],[1,": 1.0.0"],[13],[1,"\\n"],[10,2],[12],[10,"strong"],[12],[1,"id"],[13],[1,": ember-engines.transition-methods"],[13],[1,"\\n"],[10,2],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/674"],[14,0,"docs-md__a"],[12],[1,"RFC #674"],[13],[1," has deprecated the methods "],[10,"code"],[12],[1,"transitionTo"],[13],[1," and "],[10,"code"],[12],[1,"replaceWith"],[13],[1,"\\nof the "],[10,"code"],[12],[1,"Route"],[13],[1," and the methods "],[10,"code"],[12],[1,"transitionToRoute"],[13],[1," and "],[10,"code"],[12],[1,"replaceRoute"],[13],[1," of "],[10,"code"],[12],[1,"Controller"],[13],[1,".\\nThese methods have been removed in v5.0.0 of Ember.js, and developers encouraged to use "],[10,"code"],[12],[1,"RouterService"],[13],[1," instead."],[13],[1,"\\n"],[10,2],[12],[1,"The methods "],[10,"code"],[12],[1,"transitionToExternal"],[13],[1," and "],[10,"code"],[12],[1,"replaceWithExternal"],[13],[1," of the "],[10,"code"],[12],[1,"Route"],[13],[1," and the method "],[10,"code"],[12],[1,"transitionToExternalRoute"],[13],[1," of the "],[10,"code"],[12],[1,"Controller"],[13],[1,"\\nshare the same underlying code and follow the same spirit as ones deprecated in Ember.js.\\nDevelopers encouraged to use "],[10,"code"],[12],[1,"EnginesRouterService"],[13],[1," provided by "],[10,3],[14,6,"https://github.com/villander/ember-engines-router-service"],[14,0,"docs-md__a"],[12],[10,"code"],[12],[1,"ember-engines-router-service"],[13],[13],[1," instead."],[13],[1,"\\n"],[10,2],[12],[1,"Before:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// my-engine/routes/foo.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Route"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/routing/route\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { inject "],[10,1],[14,0,"hljs-keyword"],[12],[1,"as"],[13],[1," service } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/service\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"FooRoute"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Route"],[13],[1," {\\n @service session;\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"beforeModel"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"if"],[13],[1," (!"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"session"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"isAuthenticated"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"transitionToExternal"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'login\'"],[13],[1,");\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"After:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// my-engine/routes/foo.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Route"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/routing/route\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { inject "],[10,1],[14,0,"hljs-keyword"],[12],[1,"as"],[13],[1," service } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/service\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"FooRoute"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Route"],[13],[1," {\\n @service router;\\n @service session;\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"beforeModel"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"if"],[13],[1," (!"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"session"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"isAuthenticated"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"transitionToExternal"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'login\'"],[13],[1,");\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Before:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// my-engine/routes/foo.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Route"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/routing/route\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { inject "],[10,1],[14,0,"hljs-keyword"],[12],[1,"as"],[13],[1," service } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/service\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"FooRoute"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Route"],[13],[1," {\\n @service session;\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"beforeModel"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"if"],[13],[1," (!"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"session"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"isAuthenticated"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"replaceWithExternal"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'login\'"],[13],[1,");\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"After:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// my-engine/routes/foo.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Route"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/routing/route\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { inject "],[10,1],[14,0,"hljs-keyword"],[12],[1,"as"],[13],[1," service } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/service\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"FooRoute"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Route"],[13],[1," {\\n @service router;\\n @service session;\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"beforeModel"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"if"],[13],[1," (!"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"session"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"isAuthenticated"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"replaceWithExternal"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'login\'"],[13],[1,");\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Before:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// my-engine/controllers/foo.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Controller"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/controller\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"FooController"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Controller"],[13],[1," {\\n @action\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"async"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"save"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"{ title, text }"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"let"],[13],[1," post = "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"store"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"createRecord"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'post\'"],[13],[1,", { title, text });\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," post."],[10,1],[14,0,"hljs-title function_"],[12],[1,"save"],[13],[1,"();\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"transitionToExternalRoute"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'post\'"],[13],[1,", post."],[10,1],[14,0,"hljs-property"],[12],[1,"id"],[13],[1,");\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"After:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// my-engine/controllers/foo.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Route"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/routing/route\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { inject "],[10,1],[14,0,"hljs-keyword"],[12],[1,"as"],[13],[1," service } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/service\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"FooRoute"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Route"],[13],[1," {\\n @service router;\\n\\n @action\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"async"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"save"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"{ title, text }"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"let"],[13],[1," post = "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"store"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"createRecord"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'post\'"],[13],[1,", { title, text });\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," post."],[10,1],[14,0,"hljs-title function_"],[12],[1,"save"],[13],[1,"();\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"transitionToExternal"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'post\'"],[13],[1,", post."],[10,1],[14,0,"hljs-property"],[12],[1,"id"],[13],[1,");\\n }\\n}\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"-use-alias-for-inject-router-service-from-host-application"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-use-alias-for-inject-router-service-from-host-application"],[14,0,"heading-anchor"],[12],[1,"§ Use alias for inject router service from host application"],[13],[13],[1,"\\n "],[10,2],[12],[10,"strong"],[12],[1,"until"],[13],[1,": 0.9.0"],[13],[1,"\\n"],[10,2],[12],[10,"strong"],[12],[1,"id"],[13],[1,": ember-engines.deprecation-router-service-from-host"],[13],[1,"\\n"],[10,2],[12],[1,"Unintentionally an Engine can inherit the "],[10,"code"],[12],[1,"router"],[13],[1," service from host application breaking the encapsulation that is the main goal of this project. Instead you must pass the host\'s "],[10,"code"],[12],[1,"router"],[13],[1," with an alias."],[13],[1,"\\n"],[10,2],[12],[1,"Before:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"App"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Application"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n engines = {\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"dependencies"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"services"],[13],[1,": [\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'router\'"],[13],[1,"\\n ]\\n }\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"After:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"App"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Application"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n engines = {\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"dependencies"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"services"],[13],[1,": [\\n { "],[10,1],[14,0,"hljs-string"],[12],[1,"\'host-router\'"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'router\'"],[13],[1," }\\n ]\\n }\\n }\\n }\\n}\\n"],[13],
17[13],[1,"\\n\\n "],[10,"h3"],[14,1,"-camelized-engine-names-in-engine-config"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-camelized-engine-names-in-engine-config"],[14,0,"heading-anchor"],[12],[1,"§ Camelized engine names in Engine Config"],[13],[13],[1,"\\n "],[10,2],[12],[10,"strong"],[12],[1,"until"],[13],[1,": 0.9.0"],[13],[1,"\\n"],[10,2],[12],[10,"strong"],[12],[1,"id"],[13],[1,": ember-engines.deprecation-camelized-engine-names"],[13],[1,"\\n"],[10,2],[12],[1,"In the host application, we\'re asked to build out engine configurations using camel cases for package names.\\nThis is error-prone and awkward - especially for scoped packages. Awkward because our packages already have names used by npm/Yarn/pnpm, e.g. \\"my-blog\\", or "],[10,"code"],[12],[1,"my-super-awesome-engine"],[13],[1,"\\nwhereas ember-engines asked us to introduce camel case rules and use "],[10,"code"],[12],[1,"myBlog"],[13],[1," or "],[10,"code"],[12],[1,"mySuperAwesomeEngine"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"Before:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"App"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Application"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n engines = {\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'superBlog\'"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"dependencies"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"services"],[13],[1,": [\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'store\'"],[13],[1,"\\n ]\\n }\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"After:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"App"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Application"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n engines = {\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"dependencies"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"services"],[13],[1,": [\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'store\'"],[13],[1,"\\n ]\\n }\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[13]],[],["div","h1","h3","a","p","strong","code","pre","span"]]',moduleName:"dummy/docs/deprecations.hbs",isStrictMode:!1})}),define("dummy/docs/embroider",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 18e.default=(0,n.createTemplateFactory)({id:"yJVEXtGU",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"embroider-vite-webpack"],[14,0,"docs-md__h1"],[12],[1,"Embroider Vite/Webpack"],[13],[1,"\\n "],[10,2],[12],[1,"As of v0.13.0, Ember Engines is compatible with the new default Ember build system based on "],[10,3],[14,6,"https://vite.dev"],[14,0,"docs-md__a"],[12],[1,"Vite"],[13],[1," and "],[10,3],[14,6,"https://github.com/embroider-build/embroider"],[14,0,"docs-md__a"],[12],[1,"Embroider"],[13],[1,". For your engines to work with Embroider you will need to make sure you are suing at least "],[10,"code"],[12],[1,"[email protected]"],[13],[1," and you will need to update your "],[10,"code"],[12],[1,"engine.js"],[13],[1," entrypoint to pass "],[10,"code"],[12],[1,"compatModules"],[13],[1," to the resolver."],[13],[1,"\\n"],[10,2],[12],[1,"This method of using the "],[10,"code"],[12],[1,"ember-resolver"],[13],[1," with "],[10,"code"],[12],[1,"compatModules"],[13],[1," is usually not compatible with the Classic build system but "],[10,"code"],[12],[1,"ember-engines"],[13],[1," automatically provides a polyfill so that an engine that has been updated to work with Embroider+Vite will continue to work with a Classic app that is still using "],[10,"code"],[12],[1,"ember-cli"],[13],[1," for its build."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"how-to-update-your-engine-js-entrypoint-to-support-embroider-vite"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#how-to-update-your-engine-js-entrypoint-to-support-embroider-vite"],[14,0,"heading-anchor"],[12],[1,"How to update your "],[10,"code"],[12],[1,"engine.js"],[13],[1," entrypoint to supp
18ort Embroider+Vite"],[13],[13],[1,"\\n "],[10,2],[12],[1,"To support Embroider+Vite you need to first import "],[10,"code"],[12],[1,"compatModules"],[13],[1," from the virtual entrypoint "],[10,"code"],[12],[1,"@embroider/virtual/compat-modules"],[13],[1," and then pass it to your resolver using the "],[10,"code"],[12],[1,"withModules()"],[13],[1," function. You also need to pass "],[10,"code"],[12],[1,"compatModules"],[13],[1," to the "],[10,"code"],[12],[1,"loadInitializers()"],[13],[1," function."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-diff"],[12],[1,"// addon/engine.js\\nimport Engine from \'ember-engines/engine\';\\nimport Resolver from \'ember-resolver\';\\nimport loadInitializers from \'ember-load-initializers\';\\nimport config from \'./config/environment\';\\n"],[10,1],[14,0,"hljs-addition"],[12],[1,"+ import compatModules from \'@embroider/virtual/compat-modules\';"],[13],[1,"\\n\\nconst { modulePrefix } = config;\\n\\nclass Eng extends Engine {\\nmodulePrefix = config.modulePrefix;\\n"],[10,1],[14,0,"hljs-deletion"],[12],[1,"- Resolver = Resolver;"],[13],[1,"\\n"],[10,1],[14,0,"hljs-addition"],[12],[1,"+ Resolver = Resolver.withModules(compatModules);"],[13],[1,"\\n}\\n\\n"],[10,1],[14,0,"hljs-deletion"],[12],[1,"- loadInitializers(Eng, modulePrefix);"],[13],[1,"\\n"],[10,1],[14,0,"hljs-addition"],[12],[1,"+ loadInitializers(Eng, modulePrefix, compatModules);"],[13],[1,"\\n\\nexport default Eng;\\n"],[13],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"lazy-engines"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#lazy-engines"],[14,0,"heading-anchor"],[12],[1,"Lazy Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"With the new Embroider+Vite build system you are required to use "],[10,3],[14,6,"https://github.com/embroider-build/embroider/blob/main/packages/router/"],[14,0,"docs-md__a"],[12],[10,"code"],[12],[1,"@embroider/router"],[13],[13],[1," as a replacement for your regular Ember Router if you want to maintain the behaviour of your Lazy Engines. All bundle splitting is handled by Embroider and the "],[10,"code"],[12],[1,"@embroider/router"],[13],[1," controls loading bundles as you navigate between routes that may have been split by the build, or a lazy engine that may be mounted on a particular route."],[13],[1,"\\n"],[10,2],[12],[1,"The "],[10,"code"],[12],[1,"@embroider/router"],[13],[1," is the default for new applications but if you are upgrading an existing app you will need to update your router to use the new drop-in replacement:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-diff"],[12],[1,"// <your app>/app/router.js\\n"],[10,1],[14,0,"hljs-deletion"],[12],[1,"-import EmberRouter from \'@ember/routing/router\';"],[13],[1,"\\n"],[10,1],[14,0,"hljs-addition"],[12],[1,"+import EmberRouter from \'@embroider/router\';"],[13],[1,"\\n"],[13],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"legacy-embroider"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#legacy-embroider"],[14,0,"heading-anchor"],[12],[1,"Legacy Embroider"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Before Embroider+Vite became the default for newly generated applications, there was a previous Embroider version that used a mixture of a classic build (with AMD) and Webpack. This version of Embroider is no longer being actively maintained so anyone still using it should actively try to upgrade to Embroider+Vite."],[13],[1,"\\n"],[10,2],[12],[1,"Since "],[10,"code"],[12],[1,"ember-engines"],[13],[1," is providing an automatic polyfill that supports classic builds, that same polyfill allows Engines that have been updated to work with Vite to work with the legacy Emberoider@3 build system that relies on Webpack."],[13],[1,"\\n"],[13]],[],["div","h1","p","a","code","h2","pre","span"]]',moduleName:"dummy/docs/embroider.hbs",isStrictMode:!1})}),define("dummy/docs/index",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 19e.default=(0,n.createTemplateFactory)({id:"XDvqbycP",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"what-are-engines-"],[14,0,"docs-md__h1"],[12],[1,"What are Engines?"],[13],[1,"\\n "],[10,2],[12],[1,"Engines allow multiple logical applications to be composed together into a single application from the user\'s perspective. The key term here is \\"logical application\\". That is, an Engine represents a set of functionality and user experiences that could logically be considered an application. However, they differ from normal Ember applications in that they are intended to be composed within a host application in order to create a single, cohesive user experience."],[13],[1,"\\n"],[10,2],[12],[1,"On a technical level, engines and applications are remarkably similar: they each have their own container, registry, context, and namespace. However, unlike an application, an engine does not boot itself nor does it control its own router. Engines rely on their hosts to fulfill these responsibilities."],[13],[1,"\\n"],[10,2],[12],[1,"The often used example of this is a \\"blogging\\" application. While a blog itself could be a full-fledged application, you may also wish to use it as a specific subsection of your overall application. If you threw a \\"news feed\\" engine into that mix, you might get an application structure that looks something like this:"],[13],[1,"\\n\\n"],[10,2],[12],[10,"img"],[14,"src","/images/app-engine-diagram.jpeg"],[14,"alt","Diagram of Application with two Engines"],[14,"width","850"],[12],[13],[13],[1,"\\n"],[10,2],[12],[1,"This host application relies upon Engines to control different \\"zones\\" of functionality. However, from the user\'s perspective, the host application and its engines appear to be a single application."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"why-use-engines-"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#why-use-engines-"],[14,0,"heading-anchor"],[12],[1,"Why use Engines?"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Large organizations often use Ember.js to power sophisticated web applications. These apps may require collaboration among several teams, sometimes distributed around the world. Typically, responsibility is shared by dividing the application into one or more \\"sections\\". How this division is actually implemented varies from team to team."],[13],[1,"\\n"],[10,2],[12],[1,"Maintaining large monolithic applications poses the following challenges:"],[13],[1,"\\n\\n "],[10,"ul"],[14,0,"docs-list-disc"],[12],[10,"li"],[12],[10,"code"],[12],[1,"Side effects"],[13],[1," - if you change something, it may be unclear how it could affect the rest of platform."],[13],[1,"\\n"],[10,"li"],[12],[10,"code"],[12],[1,"Coordination"],[13],[1," - when you develop a new feature or make big changes, many teams may need to be in sync to approve it."],[13],[1,"\\n"],[10,"li"],[12],[10,"code"],[12],[1,"Complexity"],[13],[1," - with a huge dependency tree and many layers of abstraction, developers cannot iterate quickly, and features suffer as a result."],[13],[1,"\\n"],[10,"li"],[12],[10,"code"],[12],[1,"Killing Innovation"],[13],[1," - a/b testing a cutting-edge feature is hard to do without disrupting the rest of the app and the teams working on it."],[13],[1,"\\n"],[10,"li"],[12],[10,"code"],[12],[1,"Slow Onboarding"],[13],[1," - new people coming into the team are overwhelmed."],[13],[1,"\\n"],[13],[1,"\\n "],[10,2],[12],[1,"Engines provide an antidote to these problems by allowing for distributed development, testing, and packaging of logically-grouped pieces of an application."],[13],[1,"\\n"],[10,2],[12],[1,"Engines are good for organizations that have multiple teams, where each team has their own area that is clearly separated from the others. The isolation is good when it matches organizational boundaries, but adds unnecessary complexity when there is not a good match."],[13],[1,"\\n"],[10,2],[12],[1,"Engines are used by a number of organizations, including "],[10,3],[14,6,"https://www.linkedin.com"],[14,0,"docs-md__a"],[12],[1,"LinkedIn"],[13],[1,", "],[10,3],[14,6,"https://www.chase.com/"],[14,0,"docs-md__a"],[12],[1,"Chase"],[13],[1,", and "],[10,3],[14,6,"https://squareup.com"],[14,0,"docs-md__a"],[12],[1,"Square"],[13],[1,", to power sites with million of users."],[13],[1,"\\n"],[10,2],[12],[1,"If you are considering splitting up your application into engines just to reduce the amount of data that needs to be initially downloaded and increase the performance, Engines are not the right solution. Please check out the section on tree shaking and code splitting in projects like "],[10,3],[14,6,"https://github.com/embroider-build/embroider"],[14,0,"docs-md__a"],[12],[1,"Embroider"],[13],[1,"."],[13],[1,"\\n"],[13]],[],["div","h1","p","img","h2","a","ul","li","code"]]',moduleName:"dummy/docs/index.hbs",isStrictMode:!1})}),define("dummy/docs/installation",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
19dule",{value:!0}),e.default=void 0 20e.default=(0,n.createTemplateFactory)({id:"wBO3uUhp",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"installation"],[14,0,"docs-md__h1"],[12],[1,"Installation"],[13],[1,"\\n "],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-sh"],[12],[1,"ember install ember-engines\\n"],[13],[13],[1,"\\n"],[13]],[],["div","h1","pre","code"]]',moduleName:"dummy/docs/installation.hbs",isStrictMode:!1})}),define("dummy/docs/introduction",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 21e.default=(0,n.createTemplateFactory)({id:"SATLSck+",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"introduction"],[14,0,"docs-md__h1"],[12],[1,"Introduction"],[13],[1,"\\n "],[10,2],[12],[1,"Welcome to the official guide for Ember Engines! This guide is intended to get you up and running with Engines as implemented in the "],[10,3],[14,6,"https://www.npmjs.com/package/ember-engines"],[14,0,"docs-md__a"],[12],[10,"code"],[12],[1,"ember-engines"],[13],[13],[1," addon and give you background on various concepts and ideas related to Engines. It is intended to be read from start to finish, but has been broken down in case you want to come back and re-read a specific topic."],[13],[1,"\\n"],[10,2],[12],[1,"Do note that since Engines have not had a 1.0.0 release the APIs and examples given in this guide are subject to change."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"get-help-contribute"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#get-help-contribute"],[14,0,"heading-anchor"],[12],[1,"Get Help & Contribute"],[13],[13],[1,"\\n "],[10,2],[12],[1,"The Ember Engines source code (including this website) is available on "],[10,3],[14,6,"http://github.com/ember-engines"],[14,0,"docs-md__a"],[12],[1,"GitHub"],[13],[1,". If you run into an error with the Engines code itself or think a feature is missing, please "],[10,3],[14,6,"https://github.com/ember-engines/ember-engines/issues"],[14,0,"docs-md__a"],[12],[1,"file an issue"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"The best way to get help for project-specific issues is via the "],[10,3],[14,6,"https://discordapp.com/invite/zT3asNS"],[14,0,"docs-md__a"],[12],[1,"Ember Community Discord"],[13],[1,". Once youâve signed up, join the "],[10,3],[14,6,"https://discordapp.com/channels/480462759797063690/487221820638887947"],[14,0,"docs-md__a"],[12],[1,"#ember-engines"],[13],[1," channel."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"engines-roadmap"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#engines-roadmap"],[14,0,"heading-anchor"],[12],[1,"Engines Roadmap"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Ember Engines are currently pre-1.0 software and under active development. Check out our "],[10,3],[14,6,"https://discuss.emberjs.com/t/engines-1-0-roadmap/14914"],[14,0,"docs-md__a"],[12],[1,"roadmap to 1.0"],[13],[1,"."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"additional-resources"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#additional-resources"],[14,0,"heading-anchor"],[12],[1,"Additional Resources"],[13],[13],[1,"\\n \\n "],[10,"ul"],[14,0,"docs-list-disc"],[12],[10,"li"],[12],[10,3],[14,6,"https://github.com/ember-engines/ember-engines"],[14,0,"docs-md__a"],[12],[1,"Ember Engines on GitHub"],[13],[13],[1,"\\n"],[10,"li"],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/10"],[14,0,"docs-md__a"],[12],[1,"Engines RFC"],[13],[13],[1,"\\n"],[10,"li"],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/122"],[14,0,"docs-md__a"],[12],[1,"Engine Linking RFC"],[13],[13],[1,"\\n"],[10,"li"],[12],[10,3],[14,6,"https://github.com/ember-engines/ember-asset-loader"],[14,0,"docs-md__a"],[12],[1,"Ember Asset Loader on GitHub"],[13],[13],[1,"\\n"],[10,"li"],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/153"],[14,0,"docs-md__a"],[12],[1,"Asset Manifest RFC"],[13],[13],[1,"\\n"],[10,"li"],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/158"],[14,0,"docs-md__a"],[12],[1,"Asset Loader Service RFC"],[13],[13],[1,"\\n"],[13],[1,"\\n "],[10,2],[12],[10,"em"],[12],[1,"Note: this guide is accurate as of the 0.8.x release of ember-engines"],[13],[1,"."],[13],[1,"\\n"],[13]],[],["div","h1","p","a","code","h2","ul","li","em"]]',moduleName:"dummy/docs/introduction.hbs",isStrictMode:!1})}),define("dummy/docs/isolation",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
21dule",{value:!0}),e.default=void 0 22e.default=(0,n.createTemplateFactory)({id:"p7YJ4UG4",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"isolation"],[14,0,"docs-md__h1"],[12],[1,"Isolation"],[13],[1,"\\n "],[10,2],[12],[1,"The next concept is a bit abstract, but talked about frequently when discussing Engines: "],[10,"em"],[12],[1,"isolation"],[13],[1,". When discussing Engines, isolation refers to the idea of "],[10,"em"],[12],[1,"logical run-time separation"],[13],[1,"; that is, separating the code which an Engine can reference from the code which an Application can reference."],[13],[1,"\\n"],[10,2],[12],[1,"In practice this means that Engines cannot access or communicate with their host (often referred to as their \\"parent\\"), except through a few well-defined interfaces. Attempting to access code from the host without explicitly importing it will result in a run-time error. So, things that you might have gotten \\"for free\\" in an application, now must have ceremony in order to be used by your Engine."],[13],[1,"\\n"],[10,2],[12],[1,"At first, and even after working with it for a while, this isolation may seem a bit cumbersome as it requires you to write more code and do more work to use something that you previously got with little effort. This \\"ceremony\\" of importing, however, is very important as it enables build and run time optimizations that are not possible without those constraints."],[13],[1,"\\n"],[10,2],[12],[1,"In particular, one huge benefit of Engines is the ability to lazy-load them. This is only made possible by having explicit interfaces with the consuming application and dependencies so that a dependency graph can be constructed at build time to allow for proper bundling of assets."],[13],[1,"\\n"],[13]],[],["div","h1","p","em"]]',moduleName:"dummy/docs/isolation.hbs",isStrictMode:!1})}),define("dummy/docs/lazy-loading",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 23e.default=(0,n.createTemplateFactory)({id:"2ZJTs8Cu",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"lazy-loading"],[14,0,"docs-md__h1"],[12],[1,"Lazy Loading"],[13],[1,"\\n "],[10,2],[12],[1,"The moment we\'ve all be waiting for, let\'s talk about lazy loading!"],[13],[1,"\\n"],[10,2],[12],[1,"If you\'ve been following along and paying attention, we\'ve stressed frequently the idea that Engine\'s are isolated. Well, assuming you haven\'t violated those isolations principles anywhere, enabling lazy loading for your Engine is as simple as setting a flag:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// super-blog/index.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"const"],[13],[1," { buildEngine } = "],[10,1],[14,0,"hljs-built_in"],[12],[1,"require"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-engines/lib/engine-addon\'"],[13],[1,");\\n\\n"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"exports"],[13],[1," = "],[10,1],[14,0,"hljs-title function_"],[12],[1,"buildEngine"],[13],[1,"({\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"name"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,",\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"lazyLoading"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"enabled"],[13],[1,": "],[10,1],[14,0,"hljs-literal"],[12],[1,"true"],[13],[1,"\\n }\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Next time you build your application, you should have a lazy loading Engine!"],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"route-less-lazy-engines"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#route-less-lazy-engines"],[14,0,"heading-anchor"],[12],[1,"Route-less Lazy Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Currently, lazy loading is not supported natively for route-less Engines. But you can use "],[10,3],[14,6,"https://github.com/buschtoens/ember-lazy-mount"],[14,0,"docs-md__a"],[12],[1,"ember-lazy-mount"],[13],[1," as solution for while. Progress can be tracked at "],[10,3],[14,6,"https://github.com/ember-engines/ember-engines/issues/232"],[14,0,"docs-md__a"],[12],[1,"this issue"],[13],[1,"."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"routing-considerations"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#routing-considerations"],[14,0,"heading-anchor"],[12],[1,"Routing Considerations"],[13],[13],[1,"\\n "],[10,2],[12],[1,"When routing into a routable Engine that is lazily loaded there are some special considerations and subtle differences from how rout
23ing works in a normal Ember application."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"serialization-of-urls"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#serialization-of-urls"],[14,0,"heading-anchor"],[12],[1,"Serialization of URLs"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Since the links to your Engine are constructed before the Engine itself is loaded, you need to make sure the application has the necessary code to serialize data into the URLs. To that end, you need to replace any "],[10,"code"],[12],[1,"Route#serialize"],[13],[1," functions with route serializers, as defined in "],[10,3],[14,6,"https://github.com/emberjs/rfcs/blob/master/text/0120-route-serializers.md"],[14,0,"docs-md__a"],[12],[1,"the Route Serializers RFC"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"For example, if you had a "],[10,"code"],[12],[1,"Post"],[13],[1," route defined like so:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Route"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"@ember/routing/route\\""],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"PostRoute"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Route"],[13],[1," {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"serialize"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"model"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," { "],[10,1],[14,0,"hljs-attr"],[12],[1,"post_id"],[13],[1,": model."],[10,1],[14,0,"hljs-property"],[12],[1,"id"],[13],[1," };\\n }\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"You would need to remove that function and inline it into your "],[10,"code"],[12],[1,"routes.js"],[13],[1," map, which is loaded pre-emptively with the application:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"serializePost"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"model"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," { "],[10,1],[14,0,"hljs-attr"],[12],[1,"post_id"],[13],[1,": model."],[10,1],[14,0,"hljs-property"],[12],[1,"id"],[13],[1," };\\n}\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"buildRoutes"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"route"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'post\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"serialize"],[13],[1,": serializePost });\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Note that route serializers are unique to Engines and won\'t work in normal applications. In a normal Ember application you should continue to use "],[10,"code"],[12],[1,"Route#serialize"],[13],[1,"."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"loading-error-substates"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#loading-error-substates"],[14,0,"heading-anchor"],[12],[1,"Loading / Error Substates"],[13],[13],[1,"\\n "],[10,2],[12],[1,"The loading and error substates work in a similar fashion to "],[10,3],[14,6,"https://guides.emberjs.com/release/routing/loading-and-error-substates/"],[14,0,"docs-md__a"],[12],[1,"substates in a normal Ember app"],[13],[1,". The only difference is that lazily loaded Engines will enter a loading state while the assets for the Engine are loaded and can enter an error state when an asset fails to load."],[13],[1,"\\n\\n "],[10,"h1"],[14,1,"built-engine-output"],[14,0,"docs-md__h1"],[12],[1,"Built Engine Output"],[13],[1,"\\n \\n "],[10,"h2"],[14,1,"eager-engines"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#eager-engines"],[14,0,"heading-anchor"],[12],[1,"Eager Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Eager engines are built approximately the same as existing addons. Differences are limited to consolidating the namespace of "],[10,"code"],[12],[1,"app"],[13],[1," code inside of an engine into the engine\'s namespace instead of the host application."],[13],[1,"\\n"],[10,2],[12],[1,"Beyond that it adds in a configuration module for the engine, and n
23othing else. It is a remarkably straightforward process."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"lazy-engines"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#lazy-engines"],[14,0,"heading-anchor"],[12],[1,"Lazy Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Lazy engines are built in the same way as eager engines, but their assets are not combined back into the host application\'s "],[10,"code"],[12],[1,"vendor-{hash}.js"],[13],[1," file. This means that they are run through a separate and unique build process from what a default addon will go through, though it reaches out to the upstream implementation in Ember CLI where possible."],[13],[1,"\\n"],[10,2],[12],[1,"A lazy engine\'s output ("],[10,"code"],[12],[1,"lazy-engine"],[13],[1,") looks like this:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[12],[1,"dist\\nâââ assets\\nâ âââ host-application.css\\nâ âââ host-application.js\\nâ âââ vendor-{hash}.css\\nâ âââ vendor-{hash}.js\\nâââ engines-dist\\nâ âââ lazy-engine\\n| âââ config\\nâ | âââ enviroment.js\\nâ âââ assets\\nâ â âââ engine-vendor-{hash}.css\\nâ â âââ engine-vendor-{hash}.js\\nâ â âââ engine.css\\nâ â âââ engine.js\\nâ âââ public-asset.jpg\\nâââ asset-manifest.json\\nâââ crossdomain.xml\\nâââ index.html\\nâââ robots.txt\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"-routes-js"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-routes-js"],[14,0,"heading-anchor"],[12],[10,"code"],[12],[1,"/routes.js"],[13],[13],[13],[1,"\\n "],[10,2],[12],[1," The "],[10,"code"],[12],[1,"routes.js"],[13],[1," file and anything it "],[10,"code"],[12],[1,"import"],[13],[1,"s must be present at boot time of\\nthe host application. It will be bundled into the host application\'s "],[10,"code"],[12],[1,"vendor-132494d7db189dd536628ad1ed751251.js"],[13],[1,"\\nfile. This location should be considered "],[10,"code"],[12],[1,"undefined"],[13],[1," behavior and should not be\\nrelied upon as it may change in the future."],[13],[1,"\\n"],[10,2],[12],[1," Its module name inside of the host application will be "],[10,"code"],[12],[1,"lazy-engine/routes"],[13],[1,". Any\\n"],[10,"code"],[12],[1,"import"],[13],[1,"s will also be in the "],[10,"code"],[12],[1,"lazy-engine"],[13],[1," module path."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"-app"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-app"],[14,0,"heading-anchor"],[12],[10,"code"],[12],[1,"/app"],[13],[13],[13],[1,"\\n "],[10,2],[12],[1," Assets in this folder don\'t make sense, it\'s a bad idea to use them because they break the\\nisolation guarantees of engines."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"-addon"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-addon"],[14,0,"heading-anchor"],[12],[10,"code"],[12],[1,"/addon"],[13],[13],[13],[1,"\\n "],[10,2],[12],[1,"JavaScript assets in this folder will be processed as per normal addon behavior\\nexcept that they will end up inside of the "],[10,"code"],[12],[1,"engine.js"],[13],[1," file. Their module\\ndefinition will be rooted to the engine name."],[13],[1,"\\n"],[10,2],[12],[1," For example, "],[10,"code"],[12],[1,"/addon/routes/application.js"],[13],[1," will result in a JavaScript module\\nnamed "],[10,"code"],[12],[1,"lazy-engine/routes/application"],[13],[1," inside of the\\n"],[10,"code"],[12],[1,"/dist/engines-dist/lazy-engine/engine.js"],[13],[1," file."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"-addon-templates"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-addon-templates"],[14,0,"heading-anchor"],[12],[10,"code"],[12],[1,"/addon/templates"],[13],[13],[13],[1,"\\n "],[10,2],[12],[1," Templates will be compiled by your engine but they must include\\n"],[10,"code"],[12],[1,"ember-cli-htmlbars"],[13],[1," inside of "],[10,"code"],[12],[1,"dependencies"],[13],[1," in the engine\'s "],[10,"code"],[12],[1,"package.json"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1," As an example, "],[10,"code"],[12],[1,"/addon/templates/application.hbs"],[13],[1," will result in a JavaScript\\nmodule named "],[10,"code"],[12],[1,"lazy-engine/templates/application"],[13],[1," inside of the\\n"],[10,"code"],[12],[1,"/dist/engines-dist/lazy-engine/engine.js"],[13],[1," file."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"-addon-styles-css"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-addon-styles-css"],[14,0,"heading-anchor"],[12],[10,"code"],[12],[1,"/addon/styles/**/*.css"],[13],[13],[13],[1,"\\n "],[10,2],[12],[1,"CSS files will be built similarly to how they are processed inside of typical\\nadddons. Typical addon behavior is as follows:"],[13],[1,"\\n\\n "],[10,"ol"],[14,0,"docs-list-decimal"],[12],[10,"li"],[12],[10,2],[12],[1,"All nested addons are processed. Each of them may return a "],[10,"code"],[12],[1,"style"],[13],[1," tree. By\\ndefault these style trees only contain the contents of "],[10,"code"],[12],[1,"addon/styles/addon.css"],[13],[1,".\\nThe contents of the "],[10,"code"],[12],[1,"addon/styles/addon.css"],[13],[1," file is moved inside of the\\nBroccoli tree to "],[10,"code"],[12],[1,"${addon-name}.css"],[13],[1,". This can be modified if the addon\\nspecifies a custom "],[10,"code"],[12],[1,"treeForStyle"],[13],[1," hook."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"All top-level addons (those directly depended upon by the host) have all of\\n"],[10,"code"],[12],[1,"addon/styles/**/*.css"],[13],[1," included into the host\'s "],[10,"code"],[12],[1,"vendor-bf23a3cb9e1fe7e55fa54e9a1176f74
23c.css"],[13],[1," file. For example\\n"],[10,"code"],[12],[1,"addon/styles/foo.css"],[13],[1," will appear in the output Broccoli tree at "],[10,"code"],[12],[1,"foo.css"],[13],[1,"."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"If you name a CSS file in one of the top-level addons the same as an addon\\nname (e.g. addon name is "],[10,"code"],[12],[1,"alpha"],[13],[1,"), any top-level addon which has a CSS file\\nof the same name as that addon ("],[10,"code"],[12],[1,"alpha.css"],[13],[1,") and is provided by an addon\\nlexicographically after it ("],[10,"code"],[12],[1,"zeta"],[13],[1,") will clobber the contents of\\n"],[10,"code"],[12],[1,"alpha/addon/styles/addon.css"],[13],[1," (from anywhere in the dependency graph) with\\n"],[10,"code"],[12],[1,"zeta/addon/styles/alpha.css"],[13],[1,". (This is also a possible consequence of DAG\\ntopsorting.)"],[13],[1,"\\n"],[13],[1,"\\n"],[13],[1,"\\n "],[10,2],[12],[1,"Lazy engines will use a variation of this approach:"],[13],[1,"\\n\\n "],[10,"ol"],[14,0,"docs-list-decimal"],[12],[10,"li"],[12],[10,2],[12],[1,"The engine itself will be treated as if it is a top-level dependency. This\\nmeans that "],[10,"code"],[12],[1,"addon/styles/**/*.css"],[13],[1," will end up inside of "],[10,"code"],[12],[1,"engine.css"],[13],[1,"."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"Child addons of a lazy engine will be treated as if they are top-level\\naddons. This means that they will have their "],[10,"code"],[12],[1,"treeForStyle"],[13],[1," hook executed and\\nthe result of that hook will be merged into "],[10,"code"],[12],[1,"engine-vendor-bf23a3cb9e1fe7e55fa54e9a1176f74c.css"],[13],[1," in\\nDAG/lexicographic order."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"Nested lazy engine boundaries will not be crossed when calculating the child\\n"],[10,"code"],[12],[1,"treeForStyle"],[13],[1," hook."],[13],[1,"\\n"],[13],[1,"\\n"],[13],[1,"\\n \\n "],[10,"h3"],[14,1,"-public"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-public"],[14,0,"heading-anchor"],[12],[10,"code"],[12],[1,"/public"],[13],[13],[13],[1,"\\n "],[10,2],[12],[1,"Assets appearing in the public folder will appear at the root of the engine\\noutput with no transformation. For example "],[10,"code"],[12],[1,"/public/public-asset.jpg"],[13],[1," appears at\\nthe root level of the "],[10,"code"],[12],[1,"/dist/engines-dist/lazy-engine/"],[13],[1," output folder. Assets in\\nthis folder have no default behavior and you are responsible for any custom\\nbehavior."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"asset-manifest"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#asset-manifest"],[14,0,"heading-anchor"],[12],[1,"Asset Manifest"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Further, the engine must enumerate its primary bundles (JS and CSS) in order to\\nbe loaded by the asset loading service. That will be generated at\\n"],[10,"code"],[12],[1,"/dist/asset-manifest.json"],[13],[1," at build time. It will also by default be inserted\\ninto a meta tag config inside of the host application\'s "],[10,"code"],[12],[1,"index.html"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"A asset manifest output looks like this:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-json"],[12],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"bundles\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"guide\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"assets\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"["],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"uri\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"/engines-dist/<lazy-engine>/assets/engine-vendor-132494d7db189dd536628ad1ed751251.js\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,","],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"type\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"js\\""],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,","],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"uri\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"/engines-dist/<lazy-engine>/assets/engine.js\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,","],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"type\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"js\\""],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"]"],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n"],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n"],[13],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"nested-eager-engines"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#nested-eager-engines"],[14,0,"heading-anchor"],[12],[1,"Nested Eager Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Nested eager engines will be built into their host engine or application.\\nModules will be deduplicated within the engine boundary and with the host\\napplication."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"nested-lazy-engines"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#nested-lazy-engines"],[14,0,"heading-anchor"],[12],[1,"Nested Lazy Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Nested lazy engines will be promoted to "],[10,"code"],[12],[1,"/dist/engines-dist/"],[13],[1," folder in the\\nbuild output. Module deduplication will only be done with the host application."],[13],[1,"\\n"],[13]],[],["div","h1","p","pre","code","span","h2","a","h3","ol","li"]]',moduleName:"dummy/docs/lazy-loading.hbs",isStrictMode:!1})}),define("dummy/docs/link-to-external",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
23dule",{value:!0}),e.default=void 0 24e.default=(0,n.createTemplateFactory)({id:"l46NDEWc",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"linking-to-an-external-context"],[14,0,"docs-md__h1"],[12],[1,"Linking To An External Context"],[13],[1,"\\n "],[10,2],[12],[1,"In order to deal with this, Engines allow you to specify external routes as dependencies:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// super-blog/addon/engine.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"SuperBlog"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Engine"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n dependencies = {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"externalRoutes"],[13],[1,": [\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'home\'"],[13],[1,",\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'settings\'"],[13],[1,"\\n ]\\n };\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"External routes define things that your Engine needs to link to. The host is then responsible for telling you where those things are. In other words, the Engine defines "],[10,"em"],[12],[1,"what"],[13],[1," it would like to go to and the application tells it "],[10,"em"],[12],[1,"where"],[13],[1," that is."],[13],[1,"\\n"],[10,2],[12],[1,"This is an important mental shift. Normal links define "],[10,"em"],[12],[1,"where"],[13],[1," they want to go to, but external links define "],[10,"em"],[12],[1,"what"],[13],[1," they want to go to and the host application tells it "],[10,"em"],[12],[1,"where"],[13],[1," that is."],[13],[1,"\\n"],[10,2],[12],[1,"So, when you mount your Engine, you\'ll need to make sure the host specifies appropriate paths for each of the external routes the Engine needs:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// dummy/app/app.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Application"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/application\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"App"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Application"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n engines = {\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"dependencies"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"externalRoutes"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"home"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'home.index\'"],[13],[1,",\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"settings"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'settings.blog.index\'"],[13],[1,"\\n }\\n }\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"You can use these external routes within your Engine via the "],[10,"code"],[12],[1,"<LinkToExternal/>"],[13],[1," component:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-hbs"],[12],[10,1],[14,0,"language-xml"],[12],[10,1],[14,0,"hljs-tag"],[12],[1,"<"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkToExternal"],[13],[1," @"],[10,1],[14,0,"hljs-attr"],[12],[1,"route"],[13],[1,"="],[10,1],[14,0,"hljs-string"],[12],[1,"\\"home\\""],[13],[1,">"],[13],[1,"Go Home"],[10,1],[14,0,"hljs-tag"],[12],[1,"</"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkToExternal"],[13],[1,">"],[13],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Or, one of the programmatic APIs, such as "],[10,"code"],[12],[1,"Route#transitionToExternal"],[13],[1,", "],[10,"code"],[12],[1,"Route#replaceWithExternal"],[13],[1," and "],[10,"code"],[12],[1,"Controller#transitionToExternalRoute"],[13],[1,":"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Route"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"@ember/routing/route\\""],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { action } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/object\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"YourRoute"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Route"],[13],[1," {\\n @action\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"goHome"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"transitionToExternal"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'home\'"],[13],[1,");\\n }\\n});\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"using-external-routes-for-internal-locations"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#using-external-routes-for-internal-locations"],[14,0,"heading-anchor"],[12],[1,"Using External Routes for Internal locations"],[13],[13],[1,"\\n "],[10,2],[12],[1,"In most cases, you should only need to use external routes to link to locations that you expect to be outside of your Engine. However, there are instances where you might need a link that could potentially be internal to your Engine. In which case, external routes can still work effectively, since they represent "],[10,"em"],[12],[1,"what"],[13],[1," you want to link to. If the host then tells you that the thing is at a path internal to your Engine, that will still work fine."],[13],[1,"\\n"],[13]],[],["div","h1","p","pre","code","span","em","h3","a"]]',moduleName:"dummy/docs/link-to-external.hbs",isStrictMode:!1})}),define("dummy/docs/links",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
24dule",{value:!0}),e.default=void 0 25e.default=(0,n.createTemplateFactory)({id:"9ADPctsg",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"linking-between-engines-and-applications-"],[14,0,"docs-md__h1"],[12],[1,"Linking Between Engines (and Applications)"],[13],[1,"\\n "],[10,2],[12],[1,"Routing and linking within and between Engines is a bit more complicated than with normal Ember applications. This is because Engines are isolated and thus don\'t know about routes beyond their own borders. Let\'s look at what this means practically."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"linking-within-an-engine"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#linking-within-an-engine"],[14,0,"heading-anchor"],[12],[1,"Linking Within An Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Within a routable Engine (i.e "],[10,"code"],[12],[1,"super-blog"],[13],[1,"), route paths are relative to the Engine\'s \\"mount point\\". That is, the route path at which it is mounted."],[13],[1,"\\n"],[10,2],[12],[1,"In other words, if you\'re trying to go to route "],[10,"code"],[12],[1,"super-blog.posts.index"],[13],[1,", you might do the following from the host application:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-hbs"],[12],[10,1],[14,0,"language-xml"],[12],[10,1],[14,0,"hljs-tag"],[12],[1,"<"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkTo"],[13],[1," @"],[10,1],[14,0,"hljs-attr"],[12],[1,"route"],[13],[1,"="],[10,1],[14,0,"hljs-string"],[12],[1,"\\"super-blog.posts.index\\""],[13],[1,">"],[13],[1,"Comments"],[10,1],[14,0,"hljs-tag"],[12],[1,"</"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkTo"],[13],[1,">"],[13],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"However, if you are inside the "],[10,"code"],[12],[1,"super-blog"],[13],[1," Engine, you would need to do the following:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-hbs"],[12],[10,1],[14,0,"language-xml"],[12],[10,1],[14,0,"hljs-tag"],[12],[1,"<"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkTo"],[13],[1," @"],[10,1],[14,0,"hljs-attr"],[12],[1,"route"],[13],[1,"="],[10,1],[14,0,"hljs-string"],[12],[1,"\\"posts.index\\""],[13],[1,">"],[13],[1,"Comments"],[10,1],[14,0,"hljs-tag"],[12],[1,"</"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkTo"],[13],[1,">"],[13],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Notice that the "],[10,"code"],[12],[1,"super-blog"],[13],[1," portion of the path is now missing, this is because that is the Engine\'s mount point."],[13],[1,"\\n"],[10,2],[12],[1,"Previously we mentioned that each Engine has it\'s own "],[10,"code"],[12],[1,"application"],[13],[1," route, that route corresponds to the mount point when within the Engine. So, if you wanted to go to "],[10,"code"],[12],[1,"super-blog"],[13],[1," (or the root of the Engine) from within the Engine itself, you would do something like:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-hbs"],[12],[10,1],[14,0,"language-xml"],[12],[10,1],[14,0,"hljs-tag"],[12],[1,"<"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkTo"],[13],[1," @"],[10,1],[14,0,"hljs-attr"],[12],[1,"route"],[13],[1,"="],[10,1],[14,0,"hljs-string"],[12],[1,"\\"application\\""],[13],[1,">"],[13],[1,"Goes to Blog Home"],[10,1],[14,0,"hljs-tag"],[12],[1,"</"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkTo"],[13],[1,">"],[13],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Or, maybe even:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-hbs"],[12],[10,1],[14,0,"language-xml"],[12],[10,1],[14,0,"hljs-tag"],[12],[1,"<"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkTo"],[13],[1," @"],[10,1],[14,0,"hljs-attr"],[12],[1,"route"],[13],[1,"="],[10,1],[14,0,"hljs-string"],[12],[1,"\\"index\\""],[13],[1,">"],[13],[1,"Also goes to Blog Home"],[10,1],[14,0,"hljs-tag"],[12],[1,"</"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkTo"],[13],[1,">"],[13],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"It\'s a little confusing at first, but the gist is to think of the route paths as if the Engine were it\'s own application."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"link-to-external-engine-application"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#link-to-external-engine-application"],[14,0,"heading-anchor"],[12],[1,"Link to External Engine/Application"],[13],[13],[1,"\\n "],[10,2],[12],[1,"If route paths are scoped to an Engine\'s mount point, then the next logical question is \\"what if you need to link to a path that isn\'t below the mount point?\\""],[13],[1,"\\n"],[10,2],[12],[1,"We refer to any routes that don\'t use the Engine\'s mount point as \\"external routes\\", because they are effectively \\"external\\" or \\"outside\\" the Engine. Since Engines are intended to be isolated, they shouldn\'t have intimate knowledge of the paths to external routes as they may change depending on where the Engine is mounted. That said, there are legitimate use cases where Engines need to link to routes outside, such as a consuming Application or sibling Engine. See futher details on "],[10,3],[14,6,"./link-to-external"],[14,0,"docs-md__a"],[12],[10,"code"],[12],[1,"<LinkToExternal/>"],[13],[13],[1,"."],[13],[1,"\\n"],[13]],[],["div","h1","p","h2","a","code","pre","span"]]',moduleName:"dummy/docs/links.hbs",isStrictMode:!1})}),define("dummy/docs/migrations",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
25dule",{value:!0}),e.default=void 0 26e.default=(0,n.createTemplateFactory)({id:"I6OIVqqh",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"migrations"],[14,0,"docs-md__h1"],[12],[1,"Migrations"],[13],[1,"\\n \\n "],[10,"h3"],[14,1,"v0-12-v0-13"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#v0-12-v0-13"],[14,0,"heading-anchor"],[12],[1,"v0.12 -> v0.13"],[13],[13],[1,"\\n \\n "],[10,"ol"],[14,0,"docs-list-decimal"],[12],[10,"li"],[12],[10,2],[12],[1,"Update engine.js to gain vite support for engines"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-diff"],[12],[1,"// addon/engine.js\\nimport Engine from \'ember-engines/engine\';\\nimport Resolver from \'ember-resolver\';\\nimport loadInitializers from \'ember-load-initializers\';\\nimport config from \'./config/environment\';\\n"],[10,1],[14,0,"hljs-addition"],[12],[1,"+ import compatModules from \'@embroider/virtual/compat-modules\';"],[13],[1,"\\n\\nconst { modulePrefix } = config;\\n\\nclass Eng extends Engine {\\nmodulePrefix = config.modulePrefix;\\n"],[10,1],[14,0,"hljs-deletion"],[12],[1,"- Resolver = Resolver;"],[13],[1,"\\n"],[10,1],[14,0,"hljs-addition"],[12],[1,"+ Resolver = Resolver.withModules(compatModules);"],[13],[1,"\\n}\\n\\n"],[10,1],[14,0,"hljs-deletion"],[12],[1,"- loadInitializers(Eng, modulePrefix);"],[13],[1,"\\n"],[10,1],[14,0,"hljs-addition"],[12],[1,"+ loadInitializers(Eng, modulePrefix, compatModules);"],[13],[1,"\\n\\nexport default Eng;\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1," this change is compatible with classic apps that have not upgraded to vite as long as they also upgrade to "],[10,"code"],[12],[1,"ember-engines@^0.13.0"],[13],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"Only on classic apps (not being built with Vite - the default for new apps since 6.8)\\n Add "],[10,"code"],[12],[1,"ember-asset-loader"],[13],[1," as a dev dependency"],[13],[1,"\\n"],[13],[1,"\\n"],[13],[1,"\\n \\n "],[10,"h3"],[14,1,"v0-10-v0-11"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#v0-10-v0-11"],[14,0,"heading-anchor"],[12],[1,"v0.10 -> v0.11"],[13],[13],[1,"\\n \\n "],[10,"ol"],[14,0,"docs-list-decimal"],[12],[10,"li"],[12],[10,2],[12],[10,"code"],[12],[1,"@ember/legacy-built-in-components"],[13],[1," no longer required for ember engines.\\n It can be safely removed from your app if it\'s the only reason it was added."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-diff"],[12],[1,"# package.json\\n{\\n \\"dependencies\\": {\\n"],[10,1],[14,0,"hljs-deletion"],[12],[1,"- \\"@ember/legacy-built-in-components\\": \\"^0.5.0\\","],[13],[1,"\\n ...\\n }\\n}\\n"],[13],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"Add "],[10,3],[14,6,"https://github.com/villander/ember-engines-router-service"],[14,0,"docs-md__a"],[12],[1,"ember-engines-router-service"],[13],[1," to "],[10,"code"],[12],[1,"dependencies"],[13],[1,"\\nin package.json of your engine to enable "],[10,"code"],[12],[1,"@service router;"],[13],[1," injection. Besides that you\'ll have the full "],[10,3],[14,6,"https://api.emberjs.com/ember/release/classes/routerservice/"],[14,0,"docs-md__a"],[12],[1,"RouterService"],[13],[1," API inside each engine as promised by the "],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/122"],[14,0,"docs-md__a"],[12],[1,"Engine Linking RFC"],[13],[1,"."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-diff"],[12],[1,"# package.json\\n{\\n \\"dependencies\\": {\\n"],[10,1],[14,0,"hljs-addition"],[12],[1,"+ \\"ember-engines-router-service\\": \\"^0.6.0\\","],[13],[1,"\\n ...\\n }\\n}\\n"],[13],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"In line with "],[10,3],[14,6,"https://rfcs.emberjs.com/id/0674-deprecate-transition-methods-of-controller-and-route/"],[14,0,"docs-md__a"],[12],[1,"RFC 674"],[13],[1,"\\ntransition methods of Controller and Route were removed.\\nFollow "],[10,3],[14,6,"/docs/deprecations#-transition-methods-of-controller-and-route"],[14,0,"docs-md__a"],[12],[1,"deprecation guide"],[13],[1," for migration examples."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"Dropped supp
26ort for query param only router service transitions until it\'s resolved upstream "],[10,3],[14,6,"https://github.com/villander/ember-engines-router-service/issues/74"],[14,0,"docs-md__a"],[12],[1,"https://github.com/villander/ember-engines-router-service/issues/74"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"Example for unsupported syntax â:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"transitionTo"],[13],[1,"({ "],[10,1],[14,0,"hljs-attr"],[12],[1,"queryParams"],[13],[1,": { "],[10,1],[14,0,"hljs-attr"],[12],[1,"page"],[13],[1,": "],[10,1],[14,0,"hljs-number"],[12],[1,"1"],[13],[1," }});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Example for unchanged syntax â :"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"transitionTo"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'posts\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"queryParams"],[13],[1,": { "],[10,1],[14,0,"hljs-attr"],[12],[1,"page"],[13],[1,": "],[10,1],[14,0,"hljs-number"],[12],[1,"1"],[13],[1," }});\\n"],[13],[13],[1,"\\n"],[13],[1,"\\n"],[13],[1,"\\n "],[13]],[],["div","h1","h3","a","ol","li","p","pre","code","span"]]',moduleName:"dummy/docs/migrations.hbs",isStrictMode:!1})}),define("dummy/docs/quickstart",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 27e.default=(0,n.createTemplateFactory)({id:"eYdVju3W",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"quickstart"],[14,0,"docs-md__h1"],[12],[1,"Quickstart"],[13],[1,"\\n \\n "],[10,"h2"],[14,1,"creating-an-engine"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#creating-an-engine"],[14,0,"heading-anchor"],[12],[1,"Creating An Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Now that we have all the conceptual and theoretical talk out of the way, let\'s actually make an Engine!"],[13],[1,"\\n"],[10,2],[12],[1,"As discussed previously, Engines are distributed as Addons and In-Repo-Addons."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"create-as-in-repo-engine"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#create-as-in-repo-engine"],[14,0,"heading-anchor"],[12],[1,"Create as In-Repo-Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"To create an engine within an existing application\'s project, run the\\n"],[10,"code"],[12],[1,"in-repo-engine"],[13],[1," generator:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember g in-repo-engine <engine-name>\\n"],[13],[13],[1,"\\n"],[10,"blockquote"],[14,0,"docs-md__blockquote"],[12],[10,2],[12],[1,"Note: In-repo addons currently are created in the "],[10,"code"],[12],[1,"/lib"],[13],[1," directory (e.g. "],[10,"code"],[12],[1,"/lib/my-addon"],[13],[1,"). Unit tests and integration tests are currently co-mingled with tests for the main application. A separate repo should be used for your engine if you wish to avoid this co-mingling."],[13],[1,"\\n"],[13],[10,2],[12],[1,"So, if we name our Engine "],[10,"code"],[12],[1,"super-blog"],[13],[1,", we just do the following:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember g in-repo-engine super-blog\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"This has added a directory named "],[10,"code"],[12],[1,"lib"],[13],[1," and an app addon directory structure named for "],[10,"code"],[12],[1,"super-blog"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"Using the blueprint in-repo-engine, ember-cli has added all the appropriate files to create a new app structure."],[13],[1,"\\n"],[10,2],[12],[1,"If you want to share elements between an in-repo engine and application, you could do so with an in-repo addon. For example, the following in-repo engine\'s package ("],[10,"code"],[12],[1,"lib/super-blog/package.json"],[13],[1,") references the "],[10,"code"],[12],[1,"common"],[13],[1," in-repo addon:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-json"],[12],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"name\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"super-blog\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,","],[13],[1,"\\n\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"dependencies\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"ember-cli-htmlbars\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"*\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,","],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"ember-cli-babel\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"*\\""],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,","],[13],[1,"\\n\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"ember-
27addon\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"paths\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"["],[13],[1,"\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"../common\\""],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"]"],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n"],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"generate-in-an-in-repo-engine"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#generate-in-an-in-repo-engine"],[14,0,"heading-anchor"],[12],[1,"Generate in an In-Repo-Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Using the right flags, generating routes, components (etc) in an in-repo engine is the same as in a regular Ember application."],[13],[1,"\\n"],[10,2],[12],[1,"To create a route within an in-repo-engine, you can run:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember generate route <route-name> --in-repo <in-repo-name>\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"To create a component within an in-repo-engine, you can run:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember generate component <component-name> --in-repo <in-repo-name>\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"To generate helpers, controllers and other things, you can use the "],[10,"code"],[12],[1,"--in-repo"],[13],[1," flag like above."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"using-the-in-flag"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#using-the-in-flag"],[14,0,"heading-anchor"],[12],[1,"Using the --in flag"],[13],[13],[1,"\\n "],[10,2],[12],[1,"As of "],[10,3],[14,6,"mailto:[email protected]"],[14,0,"docs-md__a"],[12],[1,"[email protected]"],[13],[1," and higher the generate command includes an "],[10,"code"],[12],[1,"--in"],[13],[1," flag that allows you to specify the directory to generate into.\\nFor example, given an in-repo addon at lib/my-foo/:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember generate component awesome-sauce --in ./lib/foo\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Will generate the following files:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"lib/foo/addon/components/awesome-sauce.js\\nlib/foo/addon/templates/components/awesome-sauce.hbs\\ntests/integration/components/awesome-sauce-test.js\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"remove-from-in-repo-engine"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#remove-from-in-repo-engine"],[14,0,"heading-anchor"],[12],[1,"Remove from In-Repo-Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"For removing the above generated routes (components and other things) from your engine, replace "],[10,"code"],[12],[1,"generate"],[13],[1," with "],[10,"code"],[12],[1,"destroy"],[13],[1," in the shell command"],[13],[1,"\\n"],[10,2],[12],[1,"Removing a route from an in-repo engine:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember destroy route <route-name> --in-repo <in-repo-name>\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Removing a component from an in-repo engine:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember destroy component <component-name> --in-repo <in-repo-name>\\n"],[13],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"create-as-addon"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#create-as-addon"],[14,0,"heading-anchor"],[12],[1,"Create as Addon"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Separate addon projects can be created with the addon command:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember addon <engine-name>\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"So, if we name our Engine "],[10,"code"],[12],[1,"super-blog"],[13],[1,", we just do the following:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember addon super-blog\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Using a vanilla addon we still need turn it into an engine, follow the steps below."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"install-engine-dependencies"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#install-engine-dependencies"],[14,0,"heading-anchor"],[12],[1,"Install Engine Dependencies"],[13],[13],[1,"\\n "],[10,2],[12],[1,"At this point, you have a vanilla Addon which is not yet an Engine, so let\'s introduce the remaining pieces needed for it to function as one."],[13],[1,"\\n"],[10,2],[12],[1,"First, we need to install the "],[10,"code"],[12],[1,"ember-engines"],[13],[1," addon, which provides support for all the Engines features which haven\'t been accepted into Ember core yet. Installation is as simple as:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"cd super-blog/\\nember install ember-engines\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"A quick note, Engines should have "],[10,"code"],[12],[1,"ember-engines"],[13],[1," listed as a "],[10,"code"],[12],[1,"devDependency"],[13],[1," and "],[10,"code"],[12],[1,"peerDepen
27dency"],[13],[1,". The reason for this is that if you include "],[10,"code"],[12],[1,"ember-engines"],[13],[1," as a "],[10,"code"],[12],[1,"dependency"],[13],[1," of both the host application and the Engine, you\'ll wind up duplicating some crucial functionality which can cause problems. Therefore, it is best that the host application provide the copy to be used."],[13],[1,"\\n"],[10,2],[12],[1,"Finally, we need to ensure "],[10,"code"],[12],[1,"ember-cli-htmlbars"],[13],[1," is listed as a dependency for compiling our templates:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-json"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// package.json"],[13],[1,"\\n"],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"dependencies\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"ember-cli-htmlbars\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"^1.1.0\\""],[13],[1,"\\n"],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Pretty simple so far. At this point, we have everything needed to actually create an Engine, but we don\'t have an Engine itself."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"configuring-your-engine"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#configuring-your-engine"],[14,0,"heading-anchor"],[12],[1,"Configuring your Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Within your Engine\'s root directory, modify "],[10,"code"],[12],[1,"index.js"],[13],[1," so that your addon is configured as an Engine using the "],[10,"code"],[12],[1,"buildEngine"],[13],[1," function:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// index.js"],[13],[1,"\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"const"],[13],[1," { buildEngine } = "],[10,1],[14,0,"hljs-built_in"],[12],[1,"require"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-engines/lib/engine-addon\'"],[13],[1,");\\n\\n"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"exports"],[13],[1," = "],[10,1],[14,0,"hljs-title function_"],[12],[1,"buildEngine"],[13],[1,"({\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"name"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,",\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"lazyLoading"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"enabled"],[13],[1,": "],[10,1],[14,0,"hljs-literal"],[12],[1,"false"],[13],[1,"\\n }\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"We\'ll leave the "],[10,"code"],[12],[1,"lazyLoading.enabled"],[13],[1," flag as "],[10,"code"],[12],[1,"false"],[13],[1," for now, as we\'ll be discussing the topic of lazy-loading engines in depth later on in this guide."],[13],[1,"\\n"],[10,2],[12],[1,"Within your Engine\'s "],[10,"code"],[12],[1,"config"],[13],[1," directory, modify the "],[10,"code"],[12],[1,"environment.js"],[13],[1," file:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// config/environment.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-meta"],[12],[1,"\\n\'use strict\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"exports"],[13],[1," = "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"environment"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"const"],[13],[1," "],[10,1],[14,0,"hljs-variable constant_"],[12],[1,"ENV"],[13],[1," = {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"modulePrefix"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,",\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"environment"],[13],[1,": environment\\n }\\n\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-variable constant_"],[12],[1,"ENV"],[13],[1,";\\n};\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Finally, to make this addon an actual Engine, create a "],[10,"code"],[12],[1,"engine.js"],[13],[1," file under the "],[10,"code"],[12],[1,"addon"],[13],[1," directory:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"touch addon/engine.js\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"The "],[10,"code"],[12],[1,"engine.js"],[13],[1," file lives inside the "],[10,"code"],[12],[1,"addon"],[13],[1," directory because we want it to be within the Addon\'s/Engine\'s namespace. We\'ll explore this idea more later, but it is important to note for now."],[13],[1,"\\n"],[10,2],[12],[1,"Next, add the following code to "],[10,"code"],[12],[1,"engine.js"],[13],[1,":"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// addon/engine.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Engine"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/engine\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," loadInitializer
27s "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-load-initializers\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Resolver"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-resolver\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," config "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'./config/environment\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"const"],[13],[1," { modulePrefix } = config;\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"YourEngine"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Engine"],[13],[1," {\\n modulePrefix = modulePrefix;\\n "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Resolver"],[13],[1," = "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Resolver"],[13],[1,";\\n}\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"loadInitializers"],[13],[1,"("],[10,1],[14,0,"hljs-title class_"],[12],[1,"YourEngine"],[13],[1,", modulePrefix);\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"This code will look familiar to anyone that\'s seen an Ember Application\'s "],[10,"code"],[12],[1,"app.js"],[13],[1," file before. Since Engines are so closely related to Applications, it makes sense that their initial files look similar."],[13],[1,"\\n"],[10,2],[12],[1,"There are four important points from the "],[10,"code"],[12],[1,"engine.js"],[13],[1," file:"],[13],[1,"\\n\\n "],[10,"ol"],[14,0,"docs-list-decimal"],[12],[10,"li"],[12],[10,"strong"],[12],[10,"code"],[12],[1,"config"],[13],[13],[1,": Each Engine has its own configuration file, similar to the one Ember Applications normally have. It\'s even found in the same location - "],[10,"code"],[12],[1,"config/environment.js"],[13],[13],[1,"\\n"],[10,"li"],[12],[10,"strong"],[12],[10,"code"],[12],[1,"Resolver"],[13],[13],[1,": Engines have their own Resolver. This means they look things up independently of their host application."],[13],[1,"\\n"],[10,"li"],[12],[10,"strong"],[12],[10,"code"],[12],[1,"modulePrefix"],[13],[13],[1,": Since Engines have their own Resolver, they also must have their own "],[10,"code"],[12],[1,"modulePrefix"],[13],[1," to define which modules belong to their namespace. Since the "],[10,"code"],[12],[1,"config"],[13],[1," is empty by default, you\'ll want to add this to your "],[10,"code"],[12],[1,"config/environment.js"],[13],[1," file."],[13],[1,"\\n"],[10,"li"],[12],[10,"strong"],[12],[10,"code"],[12],[1,"loadInitializers"],[13],[13],[1,": Again, since Engines have their own Resolver and thus their own Container, we want to make sure we run initializers against the Engine on boot-up so they can perform tasks like injections."],[13],[1,"\\n"],[13],[1,"\\n "],[10,"hr"],[14,0,"docs-md__hr"],[12],[13],[1,"\\n "],[10,"h3"],[14,1,"aside-app-vs-addon-namespace"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#aside-app-vs-addon-namespace"],[14,0,"heading-anchor"],[12],[10,"strong"],[12],[1,"Aside"],[13],[1,": App Vs Addon Namespace"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Let\'s take a moment to talk about namespaces."],[13],[1,"\\n"],[10,2],[12],[1,"Every Ember Application has a namespace defined by its "],[10,"code"],[12],[1,"modulePrefix"],[13],[1," value. This namespace allows your "],[10,"code"],[12],[1,"Resolver"],[13],[1," to find the modules created by Ember-CLI at runtime. You\'ll likely have noticed before that if you try to import a module that is in your "],[10,"code"],[12],[1,"app"],[13],[1," directory, then you need to use the "],[10,"code"],[12],[1,"modulePrefix"],[13],[1," instead."],[13],[1,"\\n"],[10,2],[12],[1,"So, if you have the file "],[10,"code"],[12],[1,"app/components/foo-bar.js"],[13],[1," and the "],[10,"code"],[12],[1,"modulePrefix"],[13],[1," "],[10,"code"],[12],[1,"baz"],[13],[1,", you\'ll have to look it up using "],[10,"code"],[12],[1,"baz/components/foo-bar"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"Similarly, Addons, and therefore Engines, have their own namespace defined by their "],[10,"code"],[12],[1,"name"],[13],[1," value in their "],[10,"code"],[12],[1,"index.js"],[13],[1,". Anything in the "],[10,"code"],[12],[1,"addon"],[13],[1," directory, gets put into the Addon\'s namespace. Having a separate namespace is one of the primary ways\\nEngines achieve code isolation."],[13],[1,"\\n"],[10,2],[12],[1,"As long as the "],[10,"code"],[12],[1,"modulePrefix"],[13],[1," for your application doesn\'t match the "],[10,"code"],[12],[1,"name"],[13],[1," of an Addon, then your application won\'t be able to resolve modules living in y
27our Addon. This is why it is important that Engines have their own "],[10,"code"],[12],[1,"Resolver"],[13],[1," with a separate "],[10,"code"],[12],[1,"modulePrefix"],[13],[1," that matches the Addon\'s "],[10,"code"],[12],[1,"name"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"Observant developers might also note that Addon\'s have an "],[10,"code"],[12],[1,"app"],[13],[1," directory in addition to their "],[10,"code"],[12],[1,"addon"],[13],[1," directory. The "],[10,"code"],[12],[1,"app"],[13],[1," directory from an Addon gets merged into the host\'s namespace. This allows Addons to \\"re-export\\" modules from their own namespace into the namespace of the consumer so that they can be used as if part of the host. Engines, however, should never re-export modules into their host, and so anything placed into the "],[10,"code"],[12],[1,"app"],[13],[1," directory of an Engine Addon will not be included in the build."],[13],[1,"\\n"],[10,"hr"],[14,0,"docs-md__hr"],[12],[13],[1,"\\n "],[10,"h2"],[14,1,"adding-routes-for-routable-engines"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#adding-routes-for-routable-engines"],[14,0,"heading-anchor"],[12],[1,"Adding Routes for Routable Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"At this point, if you\'re building a Route-less Engine, then you\'re done and can skip ahead to the \\""],[10,3],[14,6,"#mounting-an-engine"],[14,0,"docs-md__a"],[12],[1,"Mounting An Engine"],[13],[1,"\\" section. If, however, you\'re building a Routable Engine, then you need to create one more file:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"touch addon/routes.js\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"The "],[10,"code"],[12],[1,"routes.js"],[13],[1," file defines the route map for a routable Engine. The contents are fairly simple:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," buildRoutes "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-engines/routes\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"buildRoutes"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// route map"],[13],[1,"\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"The callback passed to "],[10,"code"],[12],[1,"buildRoutes"],[13],[1," functions the same way as "],[10,3],[14,6,"https://api.emberjs.com/ember/release/classes/EmberRouter"],[14,0,"docs-md__a"],[12],[10,"code"],[12],[1,"Router#map"],[13],[13],[1," does in a normal application. This means, the "],[10,"code"],[12],[1,"routes.js"],[13],[1," file for our "],[10,"code"],[12],[1,"super-blog"],[13],[1," might look something like:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," buildRoutes "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-engines/routes\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"buildRoutes"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"route"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'new\'"],[13],[1,");\\n\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"route"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'post\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"path"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'post/:id\'"],[13],[1," }, "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"route"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'comments\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"route"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'comment\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"path"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\':id\'"],[13],[1," });\\n });\\n });\\n});\\n"],[13],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"mounting-an-engine"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#mounting-an-engine"],[14,0,"heading-anchor"],[12],[1,"Mounting An Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Now that we have our Engine created, we need to \\"mount\\" it in our application so that we can use it. First, however, we should probably talk about templates and top-level routes."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"engine-templates-top-level-routes"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#engine-templates-top-level-routes"],[14,0,"heading-anchor"],[12],[1,"Engine Templates & Top-Level Routes"],[13],[13],[1,"\\n "],[10,2],[12],[1,"In order to actually verify that our Engine renders properly, we need to add a template."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"mkdir addon/templates\\ntouch addon/templates/application.hbs\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Note that the template we added is called "],[10,"code"],[12],[1,"application"],[13],[1,". This is because the top-level route and template in an Engine are known as "],[10,"code"],[12],[1,"application"],[13],[1,", similar to what happens with the top-level in a normal application."],[13],[1,"\\n"],[10,2],[12],[1,"This means that from within an Engine, if you want to transition to the first route, you would use "],[10,"code"],[12],[1,"application"],[13],[1," as the name instead of the location that the host application knows about."],[13],[1,"\\n"],[10,2],[12],[1,"Anyway, let\'s add something super simple to our template:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-hbs"],[12],[10,1],[14,0,"language-xml"],[12],[10,1],[14,0,"hljs-tag"],[12],[1,"<"],[10,1],[14,0,"hljs-name"],[12],[1,"h3"],[13],[1,">"],[13],[1,"Hello World!"],[10,1],[14,0,"hljs-tag"],[12],[1,"</"],[10,1],[14,0,"hljs-name"],[12],[1,"h3"],[13],[1,">"],[13],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Now we\'ll be able to verify that our Engine renders when we mount it."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"loading-phases"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#loading-phases"],[14,0,"heading-anchor"],[12],[1,"Loading phases"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Engines can exist in several phases:"],[13],[1,"\\n"],[10,2],[12],[1," "],[10,"strong"],[12],[1,"Booted"],[13],[1," - an engine that\'s been installed in a parent application will have its dependencies loaded and its (non-instance) initializer
27s invoked when the parent application boots."],[13],[1,"\\n"],[10,2],[12],[1," "],[10,"strong"],[12],[1,"Mounted"],[13],[1," - Routable and route-less engines have slightly different concepts of \\"mounting\\". A routable engine is considered mounted when it has been included by a router at one or more mount-points. A route-less engine is considered mounted as soon as a route\'s "],[10,"code"],[12],[1,"mount"],[13],[1," call resolves."],[13],[1,"\\n"],[10,2],[12],[1," "],[10,"strong"],[12],[1,"Instantiated"],[13],[1," - When an engine is instantiated, an "],[10,"code"],[12],[1,"EngineInstance"],[13],[1," is created and an engine\'s instance initializers are invoked. A routable engine is instantiated when a route is visited at or beyond its mount-point. A route-less engine is instantiated as soon as it is mounted."],[13],[1,"\\n"],[10,2],[12],[1,"Special "],[10,"code"],[12],[1,"before"],[13],[1," and "],[10,"code"],[12],[1,"after"],[13],[1," hooks could be added to application instance initializers that allow them to be ordered relative to engine instance "],[10,3],[14,6,"https://guides.emberjs.com/release/applications/initializers/"],[14,0,"docs-md__a"],[12],[1,"initializers"],[13],[1,"."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"routable-engines"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#routable-engines"],[14,0,"heading-anchor"],[12],[1,"Routable Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"The technique to mount an Engine into your application varies by the type of Engine you\'re using. We\'ll cover routable Engines first."],[13],[1,"\\n"],[10,2],[12],[1,"Mounting a Routable Engine is done through the consumer\'s "],[10,"code"],[12],[1,"Router"],[13],[1," map, like so:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"map"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"mount"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,");\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Pretty straightforward. The "],[10,"code"],[12],[1,"mount"],[13],[1," method is very similar to the "],[10,"code"],[12],[1,"route"],[13],[1," method you would normally use to define routes. You can specify a "],[10,"code"],[12],[1,"path"],[13],[1," and "],[10,"code"],[12],[1,"resetNamespace"],[13],[1," options like you normally would:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"map"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"mount"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"resetNamespace"],[13],[1,": "],[10,1],[14,0,"hljs-literal"],[12],[1,"true"],[13],[1,", "],[10,1],[14,0,"hljs-attr"],[12],[1,"path"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'/blog\'"],[13],[1," });\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"You can also specify a special property, "],[10,"code"],[12],[1,"as"],[13],[1,", which allows you to mount more than one instance of an Engine by specifying the route name it\'ll live under:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"map"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"mount"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"path"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'/blog\'"],[13],[1," });\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"mount"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"as"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'dev-blog\'"],[13],[1,", "],[10,1],[14,0,"hljs-attr"],[12],[1,"path"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'/dev-blog\'"],[13],[1," });\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"This means that if you transitioned to "],[10,"code"],[12],[1,"super-blog"],[13],[1,", you\'ll land on "],[10,"code"],[12],[1,"/blog"],[13],[1,", but if you transition to "],[10,"code"],[12],[1,"dev-blog"],[13],[1,", you\'ll land on "],[10,"code"],[12],[1,"/dev-blog"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"Other than "],[10,"code"],[12],[1,"as"],[13],[1,", the key difference between "],[10,"code"],[12],[1,"mount"],[13],[1," and "],[10,"code"],[12],[1,"route"],[13],[1," is how you specify child routes. For "],[10,"code"],[12],[1,"route"],[13],[1," you would normally pass a callback function as an additional argument. With Engines, though, we want our routing structure to be isolated from the host application, and so child routes are defined in the Engines "],[10,"code"],[12],[1,"routes.js"],[13],[1," file discussed in the previous section."],[13],[1,"\\n"],[10,2],[12],[1,"Thus, when using "],[10,"code"],[12],[1,"this.mount"],[13],[1,", the "],[10,"code"],[12],[1,"buildRoutes"],[13],[1," function exported from "],[10,"code"],[12],[1,"routes.js"],[13],[1," gets used as the callback y
27ou would normally pass to "],[10,"code"],[12],[1,"this.route"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"That about covers it for routable Engines, let\'s talk about route-less Engines now."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"route-less-engines"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#route-less-engines"],[14,0,"heading-anchor"],[12],[1,"Route-less Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Route-less Engines are much more straightforward to mount in an application."],[13],[1,"\\n"],[10,2],[12],[1,"To mount a route-less Engine, you use the "],[10,"code"],[12],[1,"{{mount}}"],[13],[1," keyword in any of your templates:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-hbs"],[12],[10,1],[14,0,"hljs-template-variable"],[12],[1,"{{"],[10,1],[14,0,"hljs-name"],[12],[1,"mount"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"super-blog\\""],[13],[1,"}}"],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"And that\'s it! The Engine\'s "],[10,"code"],[12],[1,"application.hbs"],[13],[1," will be rendered into the DOM at the mount location."],[13],[1,"\\n"],[10,2],[12],[1,"Prior to Ember 2.16, the "],[10,"code"],[12],[1,"{{mount}}"],[13],[1," helper only accepts an Engine\'s name, no other variables are supported. As of Ember 2.16 a "],[10,"code"],[12],[1,"model"],[13],[1," argument can be used to pass state and/or context directly to an engine. An inline "],[10,"code"],[12],[1,"hash"],[13],[1," can even be used to pass components via "],[10,"code"],[12],[1,"model"],[13],[1,". For more information, please see "],[10,3],[14,6,"https://www.emberjs.com/api/ember/3.7/classes/Ember.Templates.helpers/methods/mount?anchor=mount"],[14,0,"docs-md__a"],[12],[1,"the documentation"],[13],[1," for this helper."],[13],[1,"\\n"],[13]],[],["div","h1","h2","a","p","code","pre","blockquote","span","h3","ol","li","strong","hr"]]',moduleName:"dummy/docs/quickstart.hbs",isStrictMode:!1})}),define("dummy/docs/routable-vs-routeless",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 28e.default=(0,n.createTemplateFactory)({id:"WEtKo5ZY",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"routable-vs-route-less"],[14,0,"docs-md__h1"],[12],[1,"Routable Vs. Route-less"],[13],[1,"\\n "],[10,2],[12],[1,"Finally, there are two types of Engines that you could potentially encounter: "],[10,"em"],[12],[1,"routable"],[13],[1," and "],[10,"em"],[12],[1,"route-less"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"Routable Engines are, as the name implies, Engines which are able to be routed to. This means that they live at a designated route in your application and can have their own internal routes which you can navigate to. Examples of good candidates for routable Engines are admin control panels or blogging systems."],[13],[1,"\\n"],[10,2],[12],[1,"Route-less Engines, on the other hand, are Engines which are not able to be routed to. This means that they don\'t live at a specific route, but are instead mounted within a template or your application. Examples of good candidates for route-less Engines are chat boxes or complex forms."],[13],[1,"\\n"],[13]],[],["div","h1","p","em"]]',moduleName:"dummy/docs/routable-vs-routeless.hbs",isStrictMode:!1})}),define("dummy/docs/services",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 29e.default=(0,n.createTemplateFactory)({id:"lud3iLY4",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"services"],[14,0,"docs-md__h1"],[12],[1,"Services"],[13],[1,"\\n "],[10,2],[12],[1,"In addition to external routes, you can also specify Services as dependencies of your Engine which are provided from the host application. For example:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// super-blog/addon/engine.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"SuperBlog"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Engine"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n dependencies = {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"services"],[13],[1,": [\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'store\'"],[13],[1,",\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'session\'"],[13],[1,"\\n ]\\n }\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"This means that your Engine will expect the host application to provide both the "],[10,"code"],[12],[1,"store"],[13],[1," service and "],[10,"code"],[12],[1,"session"],[13],[1," service that it uses. The host application can then specify the services it provides like so:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// dummy/app/app.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"App"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Application"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n engines = {\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"dependencies"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"services"],[13],[1,": [\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'store\'"],[13],[1,",\\n { "],[10,1],[14,0,"hljs-string"],[12],[1,"\'session\'"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'user-session\'"],[13],[1," }\\n ]\\n }\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"In this example, the host provides its "],[10,"code"],[12],[1,"store"],[13],[1," service for the Engine\'s "],[10,"code"],[12],[1,"store"],[13],[1,". The Engine\'s "],[10,"code"],[12],[1,"session"],[13],[1," service, however, is actually the "],[10,"code"],[12],[1,"user-session"],[13],[1," service of the host. Thus, you can provide a re-mapping of service names by using an object instead of a simple string."],[13],[1,"\\n"],[10,2],[12],[1,"However, if you have "],[10,"code"],[12],[1,"ServiceX"],[13],[1," in "],[10,"code"],[12],[1,"Engine B"],[13],[1,", and want to share that service with "],[10,"code"],[12],[1,"Engine A"],[13],[1,", you\'d need to create a separate addon (likely an in-repo addon in the host app) to share those services accross."],[13],[1,"\\n"],[10,2],[12],[1,"Currently, Services are the sanctioned way of passing state and data between the host and the Engine. Since Services are singletons and only passed from host-to-child, there is little risk of coupling and violation of isolation. That said, you should keep the number of services your Engine relies on to a minimum so that your host does not need to provide services fulfilling all of those interfaces."],[13],[1,"\\n"],[13]],[],["div","h1","p","pre","code","span"]]',moduleName:"dummy/docs/services.hbs",isStrictMode:!1})}),define("dummy/docs/sharing-code",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
29dule",{value:!0}),e.default=void 0 30e.default=(0,n.createTemplateFactory)({id:"EXzJjy2V",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"sharing-code"],[14,0,"docs-md__h1"],[12],[1,"Sharing code"],[13],[1,"\\n "],[10,2],[12],[1,"For Engines, globally relevant constructs, such as Services and Route paths, make sense to cross Engine boundaries because they should be unique throughout the system. Non-global constructs, such as Components, Helpers, and Utilities should be handled carefully to avoid incidental coupling with a specific host design/architecture."],[13],[1,"\\n"],[10,2],[12],[1,"For instance, having to provide several route paths and services, such as Ember Data\'s Store, creates a relatively easy to fulfill API for consumers of your Engine. If your Engine also required specific components, helpers, and utilities, all needing to conform to the API usage inside your Engine, then you all of a sudden have substantially more coupling involved. This is bad for isolation and does not give you flexibility in developing your Engine independently of your host."],[13],[1,"\\n"],[10,2],[12],[1,"However, there are use cases for needing to share components and more across Engine boundaries. In those instances, the proper solution is to move the shared constructs into an addon."],[13],[1,"\\n"],[13]],[],["div","h1","p"]]',moduleName:"dummy/docs/sharing-code.hbs",isStrictMode:!1})}),define("dummy/docs/testing-acceptance",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 31e.default=(0,n.createTemplateFactory)({id:"nFwQQl+x",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"application-testing"],[14,0,"docs-md__h1"],[12],[1,"Application Testing"],[13],[1,"\\n \\n "],[10,"h2"],[14,1,"testing-standalone-engine"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#testing-standalone-engine"],[14,0,"heading-anchor"],[12],[1,"Testing Standalone Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"The first step is mounting the engine on the dummy app:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// admin-engine/tests/dummy/app/router.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"EmberRouter"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/routing/router\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," config "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'./config/environment\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"EmberRouter"],[13],[1," {\\n location = config."],[10,1],[14,0,"hljs-property"],[12],[1,"locationType"],[13],[1,";\\n rootURL = config."],[10,1],[14,0,"hljs-property"],[12],[1,"rootURL"],[13],[1,";\\n}\\n\\n"],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"map"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"mount"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'admin-engine\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"path"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'/\'"],[13],[1," });\\n});\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1,";\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Now you can write tests in the same way as in a normal "],[10,3],[14,6,"https://guides.emberjs.com/release/testing/testing-application/"],[14,0,"docs-md__a"],[12],[1,"Ember application"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"Suppose that we are setting "],[10,"code"],[12],[1,"users"],[13],[1," route on engine router:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," buildRoutes "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-engines/routes\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"buildRoutes"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"route"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'users\'"],[13],[1,");\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Here is an application test for routing:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// admin-engine/tests/acceptance/basic-test.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,", test } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupApplicationTest } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { visit, click, currentURL } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/test-helpers\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"module"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'basic acceptance test\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"hooks"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupApplicationTest"],[13],[1,"(hooks);\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"test"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'the user can visit home page\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"async"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"assert"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"visit"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'/\'"],[13],[1,");\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"click"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'.user-menu-item\'"],[13],[1,");\\n\\n assert."],[10,1],[14,0,"hljs-title function_"],[12],[1,"equal"],[13],[1,"("],[10,1],[14,0,"hljs-title function_"],[12],[1,"currentURL"],[13],[1,"(), "],[10,1],[14,0,"hljs-string"],[12],[1,"\'/users\'"],[13],[1,");\\n });\\n});\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"stubbing-services"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#stubbing-services"],[14,0,"heading-anchor"],[12],[1,"Stubbing services"],[13],[13],[1,"\\n "],[10,2],[12],[1,"In cases where engines have "],[10,"code"],[12],[1,"services"],[13],[1," dependencies, it is possible to stub these dependencies for application tests. "],[13],[1,"\\n"],[10,2],[12],[1,"The first step is to specify on the dummy app the services provided by host-app like so:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// admin-engine/tests/dummy/app/app.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Application"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/application\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"App"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Application"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n engines = {\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'admin-engine\'"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"dependencies"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"services"],[13],[1,": [\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'location-service\'"],[13],[1,"\\n ]\\n }\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"To stub the location service in your test, create a local stub object that extends "],[10,"code"],[12],[1,"Service from @ember/service"],[13],[1,", and register the stub as the service your test."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// admin-engine/tests/acceptance/basic-test.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,", test } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupApplicationTest } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { visit, click, currentURL } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/test-helpers\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Service"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/service\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-comment"],[12],[1,"//Stub location service"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"LocationStub"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Service"],[13],[1," {\\n city = "],[10,1],[14,0,"hljs-string"],[12],[1,"\'New York\'"],[13],[1,";\\n country = "],[10,1],[14,0,"hljs-string"],[12],[1,"\'USA\'"],[13],[1,";\\n currentLocation = {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"x"],[13],[1,": "],[10,1],[14,0,"hljs-number"],[12],[1,"1234"],[13],[1,",\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"y"],[13],[1,": "],[10,1],[14,0,"hljs-number"],[12],[1,"5678"],[13],[1,"\\n };\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"getCurrentCity"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"city"],[13],[1,";\\n }\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"getCurrentCountry"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"country"],[13],[1,";\\n }\\n}\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"module"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'basic acceptance test\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"hooks"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupApplicationTest"],[13],[1,"(hooks);\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"test"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'the user can visit home page\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"async"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"assert"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"owner"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"register"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'service:location-service\'"],[13],[1,", "],[10,1],[14,0,"hljs-title class_"],[12],[1,"LocationStub"],[13],[1,");\\n\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"visit"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'/\'"],[13],[1,");\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"click"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'.user-menu-item\'"],[13],[1,");\\n\\n assert."],[10,1],[14,0,"hljs-title function_"],[12],[1,"equal"],[13],[1,"("],[10,1],[14,0,"hljs-title function_"],[12],[1,"currentURL"],[13],[1,"(), "],[10,1],[14,0,"hljs-string"],[12],[1,"\'/users\'"],[13],[1,");\\n });\\n});\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"stubbing-external-routes"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#stubbing-external-routes"],[14,0,"heading-anchor"],[12],[1,"Stubbing external routes"],[13],[13],[1,"\\n "],[10,2],[12],[1,"In cases where engines have "],[10,"code"],[12],[1,"externalRoutes"],[13],[1," dependencies, it is possible to stub these dependencies for application tests."],[13],[1,"\\n"],[10,2],[12],[1,"The first step is to specify on the dummy app the external routes provided by host-app like so:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// admin-engine/tests/dummy/app/app.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Application"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/application\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"App"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Application"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n engines = {\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'admin-engine\'"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"dependencies"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"externalRoutes"],[13],[1,": [\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'home\'"],[13],[1,"\\n ]\\n }\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"To stub the external route service in your test, create a local stub object that extends "],[10,"code"],[12],[1,"Service from @ember/service"],[13],[1,", and register the stub as the service your test."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// admin-engine/tests/acceptance/basic-test.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,", test } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'
31qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupApplicationTest } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { visit, click, currentURL } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/test-helpers\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Service"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/service\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"module"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'basic acceptance test\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"hooks"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupApplicationTest"],[13],[1,"(hooks);\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"test"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'the user can click on the home button and trigger external transition\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"async"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"assert"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"owner"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"unregister"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'service:router\'"],[13],[1,");\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"owner"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"register"],[13],[1,"(\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'service:router\'"],[13],[1,",\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Service"],[13],[1," {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"transitionToExternal"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"actual"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"let"],[13],[1," expected = "],[10,1],[14,0,"hljs-string"],[12],[1,"\'home\'"],[13],[1,";\\n assert."],[10,1],[14,0,"hljs-title function_"],[12],[1,"equal"],[13],[1,"(actual, expected);\\n }\\n }\\n );\\n\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"visit"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'/\'"],[13],[1,");\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"click"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'.back-to-home\'"],[13],[1,");\\n });\\n});\\n"],[13],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"testing-host-application"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#testing-host-application"],[14,0,"heading-anchor"],[12],[1,"Testing Host Application"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Sometimes it is necessary to write application tests on the host app because some engines have flows that depend on the host app such as "],[10,"code"],[12],[1,"services"],[13],[1," that interact a lot with a host app or a redirect to an external context by "],[10,3],[14,6,"./links#external-routes"],[14,0,"docs-md__a"],[12],[1,"external routes"],[13],[1,". Therefore, in application tests normally we try to avoid mocking external dependencies, since this kind of test is supposed to test things as close to \\"real life\\" as possible."],[13],[1,"\\n"],[10,2],[12],[1,"Suppose that we are mouting "],[10,"code"],[12],[1,"admin-engine"],[13],[1," on host-app router:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// <app-name>/app/router.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"EmberRouter"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/routing/router\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," config "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'./config/environment\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"EmberRouter"],[13],[1," {\\n location = config."],[10,1],[14,0,"hljs-property"],[12],[1,"locationType"],[13],[1,";\\n rootURL = config."],[10,1],[14,0,"hljs-property"],[12],[1,"rootURL"],[13],[1,";\\n}\\n\\n"],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"map"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"mount"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'admin-engine\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"path"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'/admin\'"],[13],[1," });\\n});\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1,";\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Here is an acceptance test for routing:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// <app-name>/tests/acceptance/basic-test.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,", test } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupApplicationTest } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { visit, click, currentURL } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/test-helpers\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"module"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'basic acceptance test\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"hooks"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupApplicationTest"],[13],[1,"(hooks);\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"test"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'the user can visit /admin page\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"async"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"assert"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"visit"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'/\'"],[13],[1,");\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"click"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'.admin-menu-item\'"],[13],[1,");\\n\\n assert."],[10,1],[14,0,"hljs-title function_"],[12],[1,"equal"],[13],[1,"("],[10,1],[14,0,"hljs-title function_"],[12],[1,"currentURL"],[13],[1,"(), "],[10,1],[14,0,"hljs-string"],[12],[1,"\'/admin\'"],[13],[1,");\\n });\\n});\\n"],[13],[13],[1,"\\n"],[13]],[],["div","h1","h2","a","p","pre","code","span","h3"]]',moduleName:"dummy/docs/testing-acceptance.hbs",isStrictMode:!1})}),define("dummy/docs/testing-integration",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
31dule",{value:!0}),e.default=void 0 32e.default=(0,n.createTemplateFactory)({id:"5y7Q8nBm",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"rendering-testing"],[14,0,"docs-md__h1"],[12],[1,"Rendering Testing"],[13],[1,"\\n "],[10,2],[12],[1,"Suppose that our engine has a component:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-hbs"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"{{!-- admin-engine/addon/components/hello-name.hbs --}}"],[13],[10,1],[14,0,"language-xml"],[12],[1,"\\nHello, "],[13],[10,1],[14,0,"hljs-template-variable"],[12],[1,"{{@"],[10,1],[14,0,"hljs-name"],[12],[1,"name"],[13],[1,"}}"],[13],[10,1],[14,0,"language-xml"],[12],[1,"!"],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Here\'s an example rendering test for that component:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// <app-name>/tests/integration/components/hello-name-test.js"],[13],[1,"\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,", test } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupRenderingTest } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { render } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/test-helpers\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," hbs "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'htmlbars-inline-precompile\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupEngine } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-engines/test-support\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"module"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'Integration | Component | hello-name\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"hooks"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupRenderingTest"],[13],[1,"(hooks);\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupEngine"],[13],[1,"(hooks, "],[10,1],[14,0,"hljs-string"],[12],[1,"\'admin-engine\'"],[13],[1,")\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"test"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'it renders\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"async"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"assert"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"render"],[13],[1,"(hbs"],[10,1],[14,0,"hljs-string"],[12],[1,"`<HelloName @name=\\"Tom\\"/>`"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"owner"],[13],[1,": "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"engine"],[13],[1," });\\n\\n assert."],[10,1],[14,0,"hljs-title function_"],[12],[1,"equal"],[13],[1,"("],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"element"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"textContent"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"trim"],[13],[1,"(), "],[10,1],[14,0,"hljs-string"],[12],[1,"\'Hello, Tom!\'"],[13],[1,");\\n });\\n});\\n"],[13],[13],[1,"\\n"],[13]],[],["div","h1","p","pre","code","span"]]',moduleName:"dummy/docs/testing-integration.hbs",isStrictMode:!1})}),define("dummy/docs/testing-intro",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
32dule",{value:!0}),e.default=void 0 33e.default=(0,n.createTemplateFactory)({id:"sv3i5WvE",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"testing"],[14,0,"docs-md__h1"],[12],[1,"Testing"],[13],[1,"\\n "],[10,2],[12],[1,"Just like other addons, engines must be tested differently depending upon whether they are \\"in-repo\\" or \\"standalone\\":"],[13],[1,"\\n\\n "],[10,"ul"],[14,0,"docs-list-disc"],[12],[10,"li"],[12],[10,2],[12],[1,"To test an in-repo engine, co-locate the engine\'s tests with the host app\'s tests, just like any other in-repo addon."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"To test a standalone engine, use the dummy app, just like any other standalone addon project."],[13],[1,"\\n"],[13],[1,"\\n"],[13],[1,"\\n \\n "],[10,"h2"],[14,1,"setup"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#setup"],[14,0,"heading-anchor"],[12],[1,"Setup"],[13],[13],[1,"\\n \\n "],[10,"h3"],[14,1,"lazy-engines"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#lazy-engines"],[14,0,"heading-anchor"],[12],[1,"Lazy Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"If you have a lazy engine, you\'ll need to ensure that your "],[10,"code"],[12],[1,"tests/test-helper.js"],[13],[1," is configured to preload your engine\'s assets:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// <app-name>/tests/test-helper.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Application"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'../app\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," config "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'../config/environment\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setApplication } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/test-helpers\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { start } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," preloadAssets "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-asset-loader/test-support/preload-assets\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," manifest "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'<app-name>/config/asset-manifest\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"setApplication"],[13],[1,"("],[10,1],[14,0,"hljs-title class_"],[12],[1,"Application"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"create"],[13],[1,"(config."],[10,1],[14,0,"hljs-property"],[12],[1,"APP"],[13],[1,"));\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"preloadAssets"],[13],[1,"(manifest)."],[10,1],[14,0,"hljs-title function_"],[12],[1,"then"],[13],[1,"(start); "],[10,1],[14,0,"hljs-comment"],[12],[1,"// This ensures all engine resources are loaded before the tests"],[13],[1,"\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"rendering-unit-tests"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#rendering-unit-tests"],[14,0,"heading-anchor"],[12],[1,"Rendering/Unit tests"],[13],[13],[1,"\\n "],[10,2],[12],[1,"When you deal with "],[10,"code"],[12],[1,"ember-engines"],[13],[1," and you would like to test your engine code (e.g. components and services), you need to make sure that the test environment instantiates the engine. The "],[10,"code"],[12],[1,"setupEngine"],[13],[1," helper can be used to automatically load, instantiate, and provide access to the engine."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// tests/<integration or unit>/â¦"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupEngine } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-engines/test-support\'"],[13],[1,";\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"To use it, include it in your test module with the name of your engine."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupEngine"],[13],[1,"(hooks, "],[10,1],[14,0,"hljs-string"],[12],[1,"\'<engine-name>\'"],[13],[1,");\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"The engine owner can be accessed in tests through "],[10,"code"],[12],[1,"this.engine"],[13],[1,"."],[13],[1,"\\n"],[13]],[],["div","h1","p","ul","li","h2","a","h3","code","pre","span"]]',moduleName:"dummy/docs/testing-intro.hbs",isStrictMode:!1})}),define("dummy/docs/testing-unit",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
33dule",{value:!0}),e.default=void 0 34e.default=(0,n.createTemplateFactory)({id:"N2kvkqWR",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"unit-testing"],[14,0,"docs-md__h1"],[12],[1,"Unit Testing"],[13],[1,"\\n "],[10,2],[12],[1,"To test candidates for unit/integration (e.g. components, services and controllers) declared inside an engine, you need to set up the engine using the "],[10,"code"],[12],[1,"setupEngine"],[13],[1," helper. This helper provides access to the engine in the test environment via "],[10,"code"],[12],[1,"this.engine"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"What does it look like to test a component from a host app or dummy app? Let\'s go over some examples in the next section. In the following tests, "],[10,"code"],[12],[1,"admin-engine"],[13],[1," is an engine, "],[10,"code"],[12],[1,"hello-name"],[13],[1," is a component, and "],[10,"code"],[12],[1,"some-thing"],[13],[1," is a service. (Note: the same tests will apply whether "],[10,"code"],[12],[1,"admin-engine"],[13],[1," is an in-repo or standalone engine)."],[13],[1,"\\n"],[10,2],[12],[1,"Suppose that we have in the engine a service that has a "],[10,"code"],[12],[1,"computedFoo"],[13],[1," computed property based on a "],[10,"code"],[12],[1,"foo"],[13],[1," property."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// admin-engine/services/some-thing-test.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Service"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/service\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { computed } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/object\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"SomeService"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Service"],[13],[1," {\\n foo = "],[10,1],[14,0,"hljs-string"],[12],[1,"\'bar\'"],[13],[1,";\\n\\n @"],[10,1],[14,0,"hljs-title function_"],[12],[1,"computed"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'foo\'"],[13],[1,")\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"get"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"computedFoo"],[13],[1,"() {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"`computed "],[10,1],[14,0,"hljs-subst"],[12],[1,"${"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,".foo}"],[13],[1,"`"],[13],[1,";\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"The unit test will be like this:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// <app-name>/tests/unit/services/some-thing-test.js"],[13],[1,"\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,", test } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupTest } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupEngine } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-engines/test-support\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"module"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'Unit | Service | some thing\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"hooks"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupTest"],[13],[1,"(hooks);\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupEngine"],[13],[1,"(hooks, "],[10,1],[14,0,"hljs-string"],[12],[1,"\'admin-engine\'"],[13],[1,")\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"test"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'should correctly concat foo\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"assert"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"const"],[13],[1," someThing = "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"engine"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"lookup"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'service:some-thing\'"],[13],[1,");\\n someThing."],[10,1],[14,0,"hljs-title function_"],[12],[1,"set"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'foo\'"],[13],[1,", "],[10,1],[14,0,"hljs-string"],[12],[1,"\'baz\'"],[13],[1,");\\n\\n assert."],[10,1],[14,0,"hljs-title function_"],[12],[1,"equal"],[13],[1,"(someThing."],[10,1],[14,0,"hljs-title function_"],[12],[1,"get"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'computedFoo\'"],[13],[1,"), "],[10,1],[14,0,"hljs-string"],[12],[1,"\'computed baz\'"],[13],[1,");\\n });\\n});\\n"],[13],[13],[1,"\\n"],[13]],[],["div","h1","p","code","pre","span"]]',moduleName:"dummy/docs/testing-unit.hbs",isStrictMode:!1})}),define("dummy/helpers/and",["exports","ember-truth-helpers/helpers/and"],function(e,n){Object.defineProperty(e,"__esMo
34dule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/append",["exports","ember-composable-helpers/helpers/append"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"append",{enumerable:!0,get:function(){return n.append}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/break-on",["exports","ember-cli-addon-docs/helpers/break-on"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/call",["exports","ember-composable-helpers/helpers/call"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"call",{enumerable:!0,get:function(){return n.call}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/cancel-all",["exports","ember-concurrency/helpers/cancel-all"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/capitalize",["exports","ember-cli-addon-docs/helpers/capitalize"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/chunk",["exports","ember-composable-helpers/helpers/chunk"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"chunk",{enumerable:!0,get:function(){return n.chunk}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/compact",["exports","ember-composable-helpers/helpers/compact"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/compute",["exports","ember-composable-helpers/helpers/compute"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"compute",{enumerable:!0,get:function(){return n.compute}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/dec",["exports","ember-composable-helpers/helpers/dec"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"dec",{enumerable:!0,get:function(){return n.dec}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/drop",["exports","ember-composable-helpers/helpers/drop"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/ensure-safe-component",["exports","@embroider/util"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.EnsureSafeComponentHelper}})}) 35define("dummy/helpers/entries",["exports","ember-composable-helpers/helpers/entries"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"entries",{enumerable:!0,get:function(){return n.entries}})}),define("dummy/helpers/eq",["exports","ember-truth-helpers/helpers/eq"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/filter-by",["exports","ember-composable-helpers/helpers/filter-by"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/filter",["exports","ember-composable-helpers/helpers/filter"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/find-by",["exports","ember-composable-helpers/helpers/find-by"],function(e,n){Object.defineProperty(e,"__esMo
35dule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/flatten",["exports","ember-composable-helpers/helpers/flatten"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"flatten",{enumerable:!0,get:function(){return n.flatten}})}),define("dummy/helpers/from-entries",["exports","ember-composable-helpers/helpers/from-entries"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"fromEntries",{enumerable:!0,get:function(){return n.fromEntries}})}),define("dummy/helpers/get-code-snippet",["exports","ember-code-snippet/helpers/get-code-snippet"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/group-by",["exports","ember-composable-helpers/helpers/group-by"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/gt",["exports","ember-truth-helpers/helpers/gt"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/gte",["exports","ember-truth-helpers/helpers/gte"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/has-next",["exports","ember-composable-helpers/helpers/has-next"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"hasNext",{enumerable:!0,get:function(){return n.hasNext}})}),define("dummy/helpers/has-previous",["exports","ember-composable-helpers/helpers/has-previous"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"hasPrevious",{enumerable:!0,get:function(){return n.hasPrevious}})}),define("dummy/helpers/if-key",["exports","ember-keyboard/helpers/if-key"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/ignore-children",["exports","ember-modal-dialog/helpers/ignore-children"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/inc",["exports","ember-composable-helpers/helpers/inc"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"inc",{enumerable:!0,get:function(){return n.inc}})}),define("dummy/helpers/includes",["exports","ember-composable-helpers/helpers/includes"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"includes",{enumerable:!0,get:function(){return n.includes}})}),define("dummy/helpers/intersect",["exports","ember-composable-helpers/helpers/intersect"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/invoke",["exports","ember-composable-helpers/helpers/invoke"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"invoke",{enumerable:!0,get:function(){return n.invoke}})}),define("dummy/helpers/is-array",["exports","ember-truth-helpers/helpers/is-array"],function(e,n){Object.defineProperty(e,"__esMo
35dule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/is-clipboard-supported",["exports","ember-cli-clipboard/helpers/is-clipboard-supported"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/is-empty",["exports","ember-truth-helpers/helpers/is-empty"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/is-equal",["exports","ember-truth-helpers/helpers/is-equal"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/join",["exports","ember-composable-helpers/helpers/join"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/keys",["exports","ember-composable-helpers/helpers/keys"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"keys",{enumerable:!0,get:function(){return n.keys}})}),define("dummy/helpers/lt",["exports","ember-truth-helpers/helpers/lt"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/lte",["exports","ember-truth-helpers/helpers/lte"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/map-by",["exports","ember-composable-helpers/helpers/map-by"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/map",["exports","ember-composable-helpers/helpers/map"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/next",["exports","ember-composable-helpers/helpers/next"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"next",{enumerable:!0,get:function(){return n.next}})}) 36define("dummy/helpers/noop",["exports","ember-composable-helpers/helpers/noop"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"noop",{enumerable:!0,get:function(){return n.noop}})}),define("dummy/helpers/not-eq",["exports","ember-truth-helpers/helpers/not-eq"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/not",["exports","ember-truth-helpers/helpers/not"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/object-at",["exports","ember-composable-helpers/helpers/object-at"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"objectAt",{enumerable:!0,get:function(){return n.objectAt}})}),define("dummy/helpers/on-key",["exports","ember-keyboard/helpers/on-key"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/optional",["exports","ember-composable-helpers/helpers/optional"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return n.optional}})}),define("dummy/helpers/or",["exports","ember-truth-helpers/helpers/or"],function(e,n){Object.defineProperty(e,"__esMo
36dule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/page-title",["exports","ember-page-title/helpers/page-title"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/perform",["exports","ember-concurrency/helpers/perform"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/pick",["exports","ember-composable-helpers/helpers/pick"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"pick",{enumerable:!0,get:function(){return n.pick}})}),define("dummy/helpers/pipe-action",["exports","ember-composable-helpers/helpers/pipe-action"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/pipe",["exports","ember-composable-helpers/helpers/pipe"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"pipe",{enumerable:!0,get:function(){return n.pipe}})}),define("dummy/helpers/pluralize",["exports","ember-inflector/helpers/pluralize"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/previous",["exports","ember-composable-helpers/helpers/previous"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"previous",{enumerable:!0,get:function(){return n.previous}})}),define("dummy/helpers/queue",["exports","ember-composable-helpers/helpers/queue"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"queue",{enumerable:!0,get:function(){return n.queue}})}),define("dummy/helpers/range",["exports","ember-composable-helpers/helpers/range"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"range",{enumerable:!0,get:function(){return n.range}})}),define("dummy/helpers/reduce",["exports","ember-composable-helpers/helpers/reduce"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/reject-by",["exports","ember-composable-helpers/helpers/reject-by"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/repeat",["exports","ember-composable-helpers/helpers/repeat"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"repeat",{enumerable:!0,get:function(){return n.repeat}})}),define("dummy/helpers/reverse",["exports","ember-composable-helpers/helpers/reverse"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/set",["exports","ember-set-helper/helpers/set"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/shuffle",["exports","ember-composable-helpers/helpers/shuffle"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"shuffle",{enumerable:!0,get:function(){return n.shuffle}})}),define("dummy/helpers/singularize",["exports","ember-inflector/helpers/singularize"],function(e,n){Object.defineProperty(e,"__esMo
36dule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/slice",["exports","ember-composable-helpers/helpers/slice"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/sort-by",["exports","ember-composable-helpers/helpers/sort-by"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/svg-jar",["exports","ember-svg-jar/helpers/svg-jar"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"svgJar",{enumerable:!0,get:function(){return n.svgJar}})}),define("dummy/helpers/take",["exports","ember-composable-helpers/helpers/take"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/task",["exports","ember-concurrency/helpers/task"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/toggle-action",["exports","ember-composable-helpers/helpers/toggle-action"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/toggle",["exports","ember-composable-helpers/helpers/toggle"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"toggle",{enumerable:!0,get:function(){return n.toggle}})}) 37define("dummy/helpers/type-signature",["exports","ember-cli-addon-docs/helpers/type-signature"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/union",["exports","ember-composable-helpers/helpers/union"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/helpers/values",["exports","ember-composable-helpers/helpers/values"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"values",{enumerable:!0,get:function(){return n.values}})}),define("dummy/helpers/without",["exports","ember-composable-helpers/helpers/without"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"without",{enumerable:!0,get:function(){return n.without}})}),define("dummy/helpers/xor",["exports","ember-truth-helpers/helpers/xor"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/index",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 38e.default=(0,n.createTemplateFactory)({id:"9H9Vd+I2",block:'[[[10,0],[15,0,[29,["docs-bg-brand docs-text-white docs-px-4 docs-py-16 docs-text-center ",[30,0,["class"]]," "]]],[12],[1,"\\n "],[10,0],[14,0,"docs-max-w-sm docs-mx-auto"],[12],[1,"\\n "],[10,"h1"],[14,0,"docs-font-title docs-font-normal docs-text-jumbo-1 md:docs-text-jumbo-2 xl:docs-text-jumbo-3 docs-leading-none docs-tracking-tight"],[12],[1,"\\n "],[10,1],[14,0,"docs-block docs-text-large-5 md:docs-text-large-6 xl:docs-text-large-7"],[12],[1,"\\n Ember Engines\\n "],[13],[1,"\\n "],[13],[1,"\\n\\n "],[10,2],[14,0,"docs-mt-4 xl:
38docs-mt-6 docs-mb-2 docs-leading-small docs-mx-auto docs-tracking-tight docs-text-large-1 md:docs-text-large-2 xl:docs-text-large-3"],[12],[1,"\\n Composable applications for ambitious user experiences.\\n "],[13],[1,"\\n\\n "],[10,0],[14,0,"docs-mt-8"],[12],[1,"\\n "],[8,[39,4],[[24,0,"docs-no-underline docs-bg-white docs-text-brand docs-text-xs docs-px-3 docs-py-2 docs-rounded docs-mt-4 docs-shadow-md hover:docs-shadow-lg docs-transition hover:docs-nudge-t docs-font-bold docs-inline-block docs-uppercase"]],[["@route"],["docs"]],[["default"],[[[[1,"\\n Read the docs\\n "]],[]]]]],[1,"\\n "],[13],[1,"\\n\\n "],[18,1,null],[1,"\\n "],[13],[1,"\\n"],[13],[1,"\\n\\n"],[10,0],[14,0,"docs-bg-white"],[12],[1,"\\n "],[10,0],[14,0,"docs-container docs-md"],[12],[1,"\\n "],[10,"section"],[14,0,"docs-max-w-md docs-mx-auto docs-pb-8"],[12],[1,"\\n "],[10,"aside"],[12],[1,"Looking for the quickstart?\\n "],[6,[39,8],["docs.quickstart"],null,[["default"],[[[[1,"Click here"]],[]]]]],[1,"."],[13],[1,"\\n\\n "],[10,"h1"],[14,1,"introduction"],[12],[1,"Introduction"],[13],[1,"\\n "],[10,2],[12],[1,"Welcome to the official guide for Ember Engines! This guide is intended to get you up and running with Engines\\n as implemented in the\\n "],[10,3],[14,6,"https://www.npmjs.com/package/ember-engines"],[12],[10,"code"],[12],[1,"ember-engines"],[13],[13],[1,"\\n addon and give you background on various concepts and ideas related to Engines. It is intended to be read from\\n start to finish, but has been broken down in case you want to come back and re-read a specific topic."],[13],[1,"\\n "],[10,2],[12],[1,"Do note that since Engines have not had a 1.0.0 release the APIs and examples given in this guide are subject\\n to change."],[13],[1,"\\n "],[10,"h2"],[14,1,"get-help-amp-contribute"],[12],[1,"Get Help & Contribute"],[13],[1,"\\n "],[10,2],[12],[1,"The Ember Engines source code (including this website) is available on\\n "],[10,3],[14,6,"http://github.com/ember-engines"],[12],[1,"GitHub"],[13],[1,". If you run into an error with the Engines code itself or\\n think a feature is missing, please\\n "],[10,3],[14,6,"https://github.com/ember-engines/ember-engines/issues"],[12],[1,"file an issue"],[13],[1,"."],[13],[1,"\\n "],[10,2],[12],[1,"The best way to get help for project-specific issues is via the\\n "],[10,3],[14,6,"https://discordapp.com/invite/zT3asNS"],[12],[1,"Ember Community Discord"],[13],[1,". Once youâve signed up, join the\\n "],[10,3],[14,6,"https://discordapp.com/channels/480462759797063690/487221820638887947"],[12],[1,"#ember-engines"],[13],[1,"\\n channel."],[13],[1,"\\n "],[10,"h2"],[14,1,"engines-roadmap"],[12],[1,"Engines Roadmap"],[13],[1,"\\n "],[10,2],[12],[1,"Ember Engines are currently pre-1.0 software and under active development. Check out our\\n "],[10,3],[14,6,"https://discuss.emberjs.com/t/engines-1-0-roadmap/14914"],[12],[1,"roadmap to 1.0"],[13],[1,"."],[13],[1,"\\n "],[10,"h2"],[14,1,"additional-resources"],[12],[1,"Additional Resources"],[13],[1,"\\n "],[10,"ul"],[12],[1,"\\n "],[10,"li"],[12],[10,3],[14,6,"https://github.com/ember-engines/ember-engines"],[12],[1,"Ember Engines on GitHub"],[13],[13],[1,"\\n "],[10,"li"],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/10"],[12],[1,"Engines RFC"],[13],[13],[1,"\\n "],[10,"li"],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/122"],[12],[1,"Engine Linking RFC"],[13],[13],[1,"\\n "],[10,"li"],[12],[10,3],[14,6,"https://github.com/ember-engines/ember-asset-loader"],[12],[1,"Ember Asset Loader on GitHub"],[13],[13],[1,"\\n "],[10,"li"],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/153"],[12],[1,"Asset Manifest RFC"],[13],[13],[1,"\\n "],[10,"li"],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/158"],[12],[1,"Asset Loader Service RFC"],[13],[13],[1,"\\n "],[13],[1,"\\n "],[10,2],[12],[10,"em"],[12],[1,"Note: this guide is accurate as of the 0.8.x release of ember-engines"],[13],[1,"."],[13],[1,"\\n\\n "],[10,0],[14,0,"docs-my-16 docs-text-right"],[12],[1,"\\n "],[8,[39,4],[[24,0,"docs-bg-grey-darkest hover:
38docs-bg-black docs-text-white docs-py-2 docs-px-4 docs-no-underline docs-rounded"]],[["@route"],["docs"]],[["default"],[[[[1,"\\n Read the docs â\\n "]],[]]]]],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"],[13]],["&default"],["div","h1","span","p","link-to","yield","section","aside","docs-link","a","code","h2","ul","li","em"]]',moduleName:"dummy/index.hbs",isStrictMode:!1})}),define("dummy/initializers/ember-data",["exports","@ember-data/request-utils/deprecation-support"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 39e.default={name:"ember-data",initialize(e){e.registerOptionsForType("serializer",{singleton:!1}),e.registerOptionsForType("adapter",{singleton:!1})}}}),define("dummy/initializers/route-anchor-jump",["exports","ember-cli-addon-docs/initializers/route-anchor-jump"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"initialize",{enumerable:!0,get:function(){return n.initialize}})}),define("dummy/instance-initializers/add-modals-container",["exports","ember-modal-dialog/instance-initializers/add-modals-container"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 40e.default={name:"add-modals-container",initialize:n.default}}),define("dummy/instance-initializers/ember-router-scroll",["exports","@nullvoxpopuli/ember-router-scroll/instance-initializers/ember-router-scroll"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/models/class",["exports","ember-cli-addon-docs/models/class"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/models/component",["exports","ember-cli-addon-docs/models/component"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/models/module",["exports","ember-cli-addon-docs/models/module"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/models/project",["exports","ember-cli-addon-docs/models/project"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/modifiers/clipboard",["exports","ember-cli-clipboard/modifiers/clipboard"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/modifiers/did-insert",["exports","@ember/render-modifiers/modifiers/did-insert"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/modifiers/did-update",["exports","@ember/render-modifiers/modifiers/did-update"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/modifiers/on-key",["exports","ember-keyboard/modifiers/on-key"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/modifiers/will-destroy",["exports","@ember/render-modifiers/modifiers/will-destroy"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/not-found",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 41e.default=(0,n.createTemplateFactory)({id:"gsfAejBB",block:'[[[10,0],[14,0,"docs-container"],[12],[1,"\\n "],[10,"h1"],[12],[1,"Not found"],[13],[1,"\\n "],[10,2],[12],[1,"This page doesn\'t exist. "],[8,[39,3],null,[["@route"],["index"]],[["default"],[[[[1,"Head home?"]],[]]]]],[13],[1,"\\n"],[13]],[],["div","h1","p","link-to"]]',moduleName:"dummy/not-found.hbs",isStrictMode:!1})}),define("dummy/router",["exports","ember-cli-addon-docs/router","dummy/config/environment"],function(e,n,t){Object.defineProperty(e,"__esMo
41dule",{value:!0}),e.default=void 0 42const o=n.default.extend({location:t.default.locationType,rootURL:t.default.rootURL}) 43o.map(function(){(0,n.docsRoute)(this,function(){this.route("installation"),this.route("quickstart"),this.route("deploying"),this.route("dependencies"),this.route("bundling"),this.route("isolation"),this.route("routable-vs-routeless"),this.route("addons"),this.route("lazy-loading"),this.route("services"),this.route("sharing-code"),this.route("link-to-external"),this.route("testing-intro"),this.route("testing-unit"),this.route("testing-integration"),this.route("testing-acceptance"),this.route("links"),this.route("migrations"),this.route("embroider"),this.route("deprecations")}),this.route("guide"),this.route("not-found",{path:"/*path"})}) 44e.default=o}),define("dummy/routes/docs",["exports","ember-cli-addon-docs/routes/docs"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/routes/docs/api/item",["exports","ember-cli-addon-docs/routes/docs/api/item"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/routes/guide",["exports","@ember/routing/route","@ember/service"],function(e,n,t){var o,s 45Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 46e.default=(o=class extends n.default{constructor(...e){var n,t,o,i 47super(...e),n=this,t="router",i=this,(o=s)&&Object.defineProperty(n,t,{enumerable:o.enumerable,configurable:o.configurable,writable:o.writable,value:o.initializer?o.initializer.call(i):void 0})}beforeModel(){this.router.replaceWith("docs")}},i=o.prototype,r="router",a=[t.service],l={configurable:!0,enumerable:!0,writable:!0,initializer:null},c={},Object.keys(l).forEach(function(e){c[e]=l[e]}),c.enumerable=!!c.enumerable,c.configurable=!!c.configurable,("value"in c||c.initializer)&&(c.writable=!0),c=a.slice().reverse().reduce(function(e,n){return n(i,r,e)||e},c),d&&void 0!==c.initializer&&(c.value=c.initializer?c.initializer.call(d):void 0,c.initializer=void 0),s=void 0===c.initializer?(Object.defineProperty(i,r,c),null):c,o) 48var i,r,a,l,d,c}),define("dummy/serializers/-addon-docs",["exports","ember-cli-addon-docs/serializers/-addon-docs"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/serializers/class",["exports","ember-cli-addon-docs/serializers/class"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/serializers/component",["exports","ember-cli-addon-docs/serializers/component"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/serializers/module",["exports","ember-cli-addon-docs/serializers/module"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/serializers/project",["exports","ember-cli-addon-docs/serializers/project"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/services/-ensure-registered",["exports","@embroider/util/services/ensure-registered"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}) 49define("dummy/services/docs-routes",["exports","ember-cli-addon-docs/services/docs-routes"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/services/docs-search",["exports","ember-cli-addon-docs/services/docs-search"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/services/keyboard",["exports","ember-keyboard/services/keyboard"],function(e,n){Object.defineProperty(e,"__esMo
49dule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/services/modal-dialog",["exports","@ember/object","@ember/service","dummy/config/environment","ember-modal-dialog/utils/config-utils"],function(e,n,t,o,s){function i(e){return(0,n.computed)(function(){return o.default["ember-modal-dialog"]&&o.default["ember-modal-dialog"][e]})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 50e.default=t.default.extend({hasEmberTether:i("hasEmberTether"),hasLiquidWormhole:i("hasLiquidWormhole"),hasLiquidTether:i("hasLiquidTether"),destinationElementId:(0,n.computed)(function(){return(0,s.getDestinationElementIdFromConfig)(o.default)})})}),define("dummy/services/page-title",["exports","ember-page-title/services/page-title"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/services/project-version",["exports","ember-cli-addon-docs/services/project-version"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/services/router-scroll",["exports","@nullvoxpopuli/ember-router-scroll/services/router-scroll"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n.default}})}),define("dummy/services/store",["exports","@ember/debug","ember-data/store"],function(e,n,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 51class o extends t.default{constructor(...e){super(...e)}}e.default=o}),define("dummy/templates/application",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 52e.default=(0,n.createTemplateFactory)({id:"M7iEdaxs",block:'[[[8,[39,0],[[24,3,"Engines"]],null,null],[1,"\\n\\n"],[46,[28,[37,2],null,null],null,null,null],[1,"\\n\\n"],[8,[39,3],null,null,null]],[],["docs-header","component","-outlet","docs-keyboard-shortcuts"]]',moduleName:"dummy/templates/application.hbs",isStrictMode:!1})}),define("dummy/templates/docs",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 53e.default=(0,n.createTemplateFactory)({id:"R8MAohfy",block:'[[[8,[39,0],null,null,[["default"],[[[[1,"\\n "],[8,[30,1,["nav"]],null,null,[["default"],[[[[1,"\\n "],[8,[30,2,["section"]],null,[["@label"],["Getting Started"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["What are Engines?","docs.index"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Installation","docs.installation"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Quickstart","docs.quickstart"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Embroider","docs.embroider"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Deploying","docs.deploying"]],null],[1,"\\n\\n "],[8,[30,2,["section"]],null,[["@label"],["Core Concepts"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Isolation","docs.isolation"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Routable vs. Routeless","docs.routable-vs-routeless"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Lazy loading","docs.lazy-loading"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Addons","docs.addons"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Services","docs.services"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Sharing code","docs.sharing-code"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Dependencies","docs.dependencies"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Bundling","docs.bundling"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Links","docs.links"]],null],[1,"\\n\\n "],[8,[30,2,["section"]],null,[["@label"],["Components"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["link-to-external","docs.link-to-external"]],null],[1,"\\n\\n "],[8,[30,2,["section"]],null,[["@label"],["Testing"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Introduction","docs.testing-intro"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Unit Tests","docs.testing-unit"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Rendering Tests","docs.testing-integration"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Application Tests","docs.testing-acceptance"]],null],[1,"\\n\\n "],[8,[30,2,["section"]],null,[["@label"],["Migrating"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Migrations","docs.migrations"]],null],[1,"\\n "],[8,[30,2,["item"]],null,[["@label","@route"],["Deprecations","docs.deprecations"]],null],[1,"\\n "]],[2]]]]],[1,"\\n\\n "],[8,[30,1,["main"]],null,null,[["default"],[[[[1,"\\n "],[46,[28,[37,2],null,
53null],null,null,null],[1,"\\n "]],[]]]]],[1,"\\n"]],[1]]]]]],["viewer","nav"],["docs-viewer","component","-outlet"]]',moduleName:"dummy/templates/docs.hbs",isStrictMode:!1})}),define("dummy/templates/docs/addons",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 54e.default=(0,n.createTemplateFactory)({id:"nHqLM3gG",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"addons"],[14,0,"docs-md__h1"],[12],[1,"Addons"],[13],[1,"\\n "],[10,2],[12],[1,"As mentioned before, Engines are created as a specific type of "],[10,3],[14,6,"https://cli.emberjs.com/release/writing-addons/"],[14,0,"docs-md__a"],[12],[1,"Ember Addon"],[13],[1,". This makes sense given that Addons are Ember\'s way to easily share common or reusable code. Since Engines are intended to package logical applications that can be composed, they fit nicely into the paradigm of shareable addons."],[13],[1,"\\n"],[10,2],[12],[1,"Addons come in two distinct flavors: "],[10,"em"],[12],[1,"Standard"],[13],[1," and "],[10,"em"],[12],[1,"In-Repo"],[13],[1,". Standard Addons (normally just referred to as Addons) are full-fledged NPM packages that can be distributed and installed in other Ember applications. In-repo-addons, on the other hand, live within the repository of an Ember Application and are only used by that specific application."],[13],[1,"\\n"],[10,2],[12],[1,"This distinction is important for Engines, as it is fairly likely to want a logical application represented by an Engine but only use it with a specific Ember Application. In those cases, using an in-repo-engine is a good alternative to consider instead of maintaining two separate repositories."],[13],[1,"\\n"],[10,2],[12],[1,"It is recommended to read through the \\""],[10,3],[14,6,"https://cli.emberjs.com/release/writing-addons/"],[14,0,"docs-md__a"],[12],[1,"Writing Addons"],[13],[1,"\\" portion of the Ember-CLI user guide before moving onto the \\""],[10,3],[14,6,"./creating-an-engine"],[14,0,"docs-md__a"],[12],[1,"Creating An Engine"],[13],[1,"\\" portion of the guide."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"in-repo-addons"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#in-repo-addons"],[14,0,"heading-anchor"],[12],[1,"In-repo-addons"],[13],[13],[1,"\\n "],[10,2],[12],[1,"If you want to use an addon in an engine, you have to add it to the engines "],[10,"code"],[12],[1,"dependencies"],[13],[1,". This is necessary for the following types of addons:"],[13],[1,"\\n\\n "],[10,"ul"],[14,0,"docs-list-disc"],[12],[10,"li"],[12],[1,"Addons that provide components or helpers that you want to use in the engine"],[13],[1,"\\n"],[10,"li"],[12],[1,"Addons that provide other utils or similar that you want to use in the engine"],[13],[1,"\\n"],[10,"li"],[12],[1,"Addons that provide services that are not passed through from the host app"],[13],[1,"\\n"],[13],[1,"\\n "],[10,2],[12],[1,"The following types of addons should be placed in the "],[10,"code"],[12],[1,"devDependencies"],[13],[1,":"],[13],[1,"\\n\\n "],[10,"ul"],[14,0,"docs-list-disc"],[12],[10,"li"],[12],[1,"Addons that provide services that are passed through from the host app"],[13],[1,"\\n"],[10,"li"],[12],[1,"Addons that do build adaptions"],[13],[1,"\\n"],[13],[1,"\\n \\n "],[10,"h3"],[14,1,"using-ember-data"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#using-ember-data"],[14,0,"heading-anchor"],[12],[1,"Using Ember Data"],[13],[13],[1,"\\n "],[10,2],[12],[1,"When working with Ember Data, the models are defined in the host app, and you will need to pass the "],[10,"code"],[12],[1,"store"],[13],[1," service through to the engine as a dependency. This way, the host app and the engine use the same store and models. You then need to add "],[10,"code"],[12],[1,"ember-data"],[13],[1," as a "],[10,"code"],[12],[1,"devDependency"],[13],[1," to your engine."],[13],[1,"\\n"],[10,2],[12],[1,"The easiest way to realise this is to define your models in a shared addon, which is included by both your host app and your engine."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"addon-deduplication"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#addon-deduplication"],[14,0,"heading-anchor"],[12],[1,"Addon deduplication"],[13],[13],[1,"\\n "],[10,2],[12],[1,"If you are using ember engines "],[10,"strong"],[12],[1,"v0.7.1 or higher"],[13],[1,": Use "],[10,"code"],[12],[1,"EMBER_ENGINES_ADDON_DEDUPE"],[13],[1," environment variable to deduplicate the nested addons of lazy engine which are also host app addons. More details at "],[10,3],[14,6,"https://github.com/ember-engines/ember-engines/pull/595"],[14,0,"docs-md__a"],[12],[1,"#595"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"If you are using ember engines "],[10,"strong"],[12],[1,"v0.7.0 or less"],[13],[1,", follow the explanation bellow:"],[13],[1,"\\n"],[10,2],[12],[1,"ember-engines will automatically try to deduplicate addons used by your host app and (lazy loaded) engine(s). This means that addons that both the host app and an engine rely on, are only included in the vendor bundle of the host app. This ensures that you do not ship the addon code multiple times to your users."],[13],[1,"\\n"],[10,2],[12],[1,"If addons are not included in the host app, they will be included in the engine\'s vendor bundle."],[13],[1,"\\n"],[10,2],[12],[1,"Note that the deduplication between host app and addon depends on the "],[10,"code"],[12],[1,"cacheKeyForTree()"],[13],[1," method of the addon. It will only deduplicate if the cache key returned by that method is the same. This will by default be the case, unless the addon provides a custom "],[10,"code"],[12],[1,"treeForAddon()"],[13],[1," hook. If that is the case, the addon should provide a custom "],[10,"code"],[12],[1,"cacheKeyForTree()"],[13],[1," method that returns a static key - for example:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"const"],[13],[1," calculateCacheKeyForTree = "],[10,1],[14,0,"hljs-built_in"],[12],[1,"require"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'calculate-cache-key-for-tree\'"],[13],[1,");\\n\\n"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"exports"],[13],[1," = {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"name"],[13],[1,": "],[10,1],[14,0,"hljs-built_in"],[12],[1,"require"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'./package\'"],[13],[1,")."],[10,1],[14,0,"hljs-property"],[12],[1,"name"],[13],[1,",\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"treeForAddon"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// returns custom tree - overwriting this hook disables the default caching!"],[13],[1,"\\n },\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"cacheKeyForTree"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"treeType"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"if"],[13],[1," (treeType === "],[10,1],[14,0,"hljs-string"],[12],[1,"\'addon\'"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"calculateCacheKeyForTree"],[13],[1,"(treeType, "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,");\\n }\\n\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"_super"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"cacheKeyForTree"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"apply"],[13],[1,"("],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,", "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"arguments"],[13],[1,");\\n }\\n};\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Isolation and separation of responsibilities is generally hard to solve. The most recurrent scenario in a composable app with Ember Engines is: "],[10,"code"],[12],[1,"Imagine the css or components that are only used by engine-a, engine-b and engine-c"],[13],[1," all possible cases have down sides here:"],[13],[1,"\\n\\n "],[10,"ol"],[14,0,"docs-list-decimal"],[12],[10,"li"],[12],[10,2],[12],[1,"Include shared deps into the host app - Downside: Increases initial bundle size."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"Include shared deps into each engine bundle - Downside: Duplicated stuff in multiple engine bundles."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"Somehow split out shared deps into dedicated bundles "],[10,"code"],[12],[1,"(e.g. /engine-assets/shared-by-a-and-b.js)"],[13],[1," - Downside: You might end up with 20 bundles "],[10,"code"],[12],[1,"(e.g. shared-by-a-and-b, shared-by-b-and-c-, shared-by-a-b-and-c, ...)"],[13],[1,", and it is probably pretty complicated from a built step perspective."],[13],[1,"\\n"],[13],[1,"\\n"],[13],[1,"\\n "],[10,2],[12],[1,"Engines currently take the second approach, but may allow more options in the future."],[13],[1,"\\n"],[13]],[],["div","h1","p","a","em","h2","code","ul","li","h3","strong","pre","span","ol"]]',moduleName:"dummy/templates/docs/addons.hbs",isStrictMode:!1})}),define("dummy/templates/docs/api/item",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
54dule",{value:!0}),e.default=void 0 55e.default=(0,n.createTemplateFactory)({id:"ko1X54C3",block:'[[[41,[30,0,["model","isComponent"]],[[[1," "],[8,[39,1],null,[["@component"],[[30,0,["model"]]]],null],[1,"\\n"]],[]],[[[41,[30,0,["model","isClass"]],[[[1," "],[8,[39,2],null,[["@class"],[[30,0,["model"]]]],null],[1,"\\n"]],[]],[[[1," "],[8,[39,3],null,[["@module"],[[30,0,["model"]]]],null],[1,"\\n"]],[]]]],[]]]],[],["if","api/x-component","api/x-class","api/x-module"]]',moduleName:"dummy/templates/docs/api/item.hbs",isStrictMode:!1})}),define("dummy/templates/docs/bundling",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 56e.default=(0,n.createTemplateFactory)({id:"K7LNT03d",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"bundling"],[14,0,"docs-md__h1"],[12],[1,"Bundling"],[13],[1,"\\n "],[10,2],[12],[10,"em"],[12],[1,"Ember Engines"],[13],[1," not only provides isolation principles for how your code is run, but also how it is bundled."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"host-engine-dependencies"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#host-engine-dependencies"],[14,0,"heading-anchor"],[12],[1,"Host / Engine Dependencies"],[13],[13],[1,"\\n "],[10,2],[12],[1,"In the following examples:"],[13],[1,"\\n\\n "],[10,"ul"],[14,0,"docs-list-disc"],[12],[10,"li"],[12],[10,2],[12],[1,"If the dependency required by the "],[10,"em"],[12],[1,"Engine A"],[13],[1," is different than the "],[10,"em"],[12],[1,"Host"],[13],[1," it will resolve the top level dependency. In this case "],[10,"code"],[12],[1,"Foo"],[13],[1," will resolve to "],[10,"code"],[12],[1,"Foo@2"],[13],[1,"."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"If that dependency is not in the host and only in the Engine. In this this case "],[10,"code"],[12],[1,"Bar"],[13],[1,", it will be bundled in "],[10,"code"],[12],[1,"engine-vendor-{hash}.js"],[13],[1,"."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"For the case of "],[10,"code"],[12],[1,"Baz"],[13],[1,", since both "],[10,"em"],[12],[1,"Engine A"],[13],[1," and the "],[10,"em"],[12],[1,"Host"],[13],[1," require the same dependency it will be bundled into "],[10,"code"],[12],[1,"vendor-{hash}.js"],[13],[1,"."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"For the case of "],[10,"code"],[12],[1,"Qux"],[13],[1,", since both "],[10,"em"],[12],[1,"Engine A"],[13],[1," and the "],[10,"em"],[12],[1,"Host"],[13],[1," require the same dependency it will be bundled into "],[10,"code"],[12],[1,"vendor-{hash}.js"],[13],[1," and will be deduped out of the "],[10,"code"],[12],[1,"engine-vendor-{hash}.js"],[13],[1," output."],[13],[1,"\\n"],[13],[1,"\\n"],[13],[1,"\\n "],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[12],[1,"| Dependency Name | Engine A | Host |\\n|=================|==========|======|\\n| Foo | v2 | v1 |\\n| Bar | v1 | N\\\\A |\\n| Baz | v1 | v2 |\\n| Qux | v2 | v2 |\\n"],[13],[13],[1,"\\n"],[13]],[],["div","h1","p","em","h2","a","ul","li","code","pre"]]',moduleName:"dummy/templates/docs/bundling.hbs",isStrictMode:!1})}),define("dummy/templates/docs/dependencies",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 57e.default=(0,n.createTemplateFactory)({id:"mBdMiHJA",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"dependencies"],[14,0,"docs-md__h1"],[12],[1,"Dependencies"],[13],[1,"\\n \\n "],[10,"h2"],[14,1,"using-yarn-workspaces"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#using-yarn-workspaces"],[14,0,"heading-anchor"],[12],[1,"Using Yarn workspaces"],[13],[13],[1,"\\n "],[10,2],[12],[1,"One way to work with engines is to use "],[10,3],[14,6,"https://yarnpkg.com/lang/en/docs/workspaces"],[14,0,"docs-md__a"],[12],[1,"Yarn workspaces"],[13],[1,". You could set up your app like this:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[12],[1,"- my-app (workspace)\\n - packages\\n - host-app\\n - engine-a\\
57n - engine-b\\n - shared-addon\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"In this example, the actual app would be in the "],[10,"code"],[12],[1,"my-app/packages/host-app"],[13],[1," directory, while "],[10,"code"],[12],[1,"my-app/packages/engine-a"],[13],[1," and "],[10,"code"],[12],[1,"my-app/packages/engine-b"],[13],[1," would be engines. "],[10,"code"],[12],[1,"my-app/packages/shared-addon"],[13],[1," could be a shared addon that is used by the host app & all engines, including for example common components, services or Ember Data models."],[13],[1,"\\n"],[10,2],[12],[1,"The advantage of this approach is that all of these dependencies will always be in sync and up to date. If you change something in the shared addon, it will immediately be reflected in the host app and all engines. It also makes it easier to ensure all engines depend on the same versions of addons."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"managing-multiple-addon-versions"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#managing-multiple-addon-versions"],[14,0,"heading-anchor"],[12],[1,"Managing multiple addon versions"],[13],[13],[1,"\\n "],[10,2],[12],[1,"When working with engines, it is important to avoid including different versions of the same addon. Currently, only one addon version can actually be loaded at a time. If your host app and engines depend on different versions of an addon, you will run into hard to control issues."],[13],[1,"\\n"],[10,2],[12],[1," For example, imagine the host app depends on "],[10,"code"],[12],[1,"ember-power-select^1.0.0"],[13],[1,", engine-a depends on "],[10,"code"],[12],[1,"ember-power-select~2.0.0"],[13],[1," and engine-b depends on "],[10,"code"],[12],[1,"ember-power-select~2.1.0"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1," Now, three different versions of ember-power-select would be included in the respective vendor bundles. But which version would actually be used in your app/engine would depend on the order in which the bundles are loaded."],[13],[1,"\\n"],[10,2],[12],[1," Generally, you should ensure that only one version of a given addon is included across your host app and engines. A great way to ensure this is to use "],[10,3],[14,6,"https://github.com/salsify/ember-cli-dependency-lint"],[14,0,"docs-md__a"],[12],[1,"ember-cli-dependency-lint"],[13],[1,", which will tell you if multiple versions of an addon are installed."],[13],[1,"\\n"],[10,2],[12],[1," If you use Yarn, you can use "],[10,3],[14,6,"https://yarnpkg.com/lang/en/docs/selective-version-resolutions/"],[14,0,"docs-md__a"],[12],[1,"resolutions"],[13],[1," to force a specific version to be used by an addon. In the above example, you could add the following to your host apps "],[10,"code"],[12],[1,"package.json"],[13],[1,":"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-json"],[12],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"dependencies\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,","],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"devDependencies\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,","],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"resolutions\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"**/ember-power-select\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"^1.0.0\\""],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n"],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"This would force this version on all addons. Please use this feature with caution, as it is then up to you to make sure that all apps and engines actually work with this version of the addon."],[13],[1,"\\n"],[13]],[],["div","h1","h2","a","p","pre","code","span"]]',moduleName:"dummy/templates/docs/dependencies.hbs",isStrictMode:!1})}),define("dummy/templates/docs/deploying",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
57dule",{value:!0}),e.default=void 0 58e.default=(0,n.createTemplateFactory)({id:"Elx3KY5j",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"deploying"],[14,0,"docs-md__h1"],[12],[1,"Deploying"],[13],[1,"\\n \\n "],[10,"h2"],[14,1,"deploying-an-engine"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#deploying-an-engine"],[14,0,"heading-anchor"],[12],[1,"Deploying An Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"In many cases, your engine code may be served from a static server, typically a CDN; this server will probably not share the same root location as your application. In order to specify the location to get the engine assets, you can implement a "],[10,"code"],[12],[1,"generateURI"],[13],[1," function in the host application\'s "],[10,"code"],[12],[1,"ember-cli-build.js"],[13],[1," file:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// host-app/ember-cli-build.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"let"],[13],[1," app = "],[10,1],[14,0,"hljs-keyword"],[12],[1,"new"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"EmberApp"],[13],[1,"(defaults, {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"assetLoader"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"generateURI"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"filePath"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"if"],[13],[1," ("],[10,1],[14,0,"hljs-title class_"],[12],[1,"EmberApp"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"env"],[13],[1,"() === "],[10,1],[14,0,"hljs-string"],[12],[1,"\'production\'"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"`https://production.cdn.com/"],[10,1],[14,0,"hljs-subst"],[12],[1,"${filePath}"],[13],[1,"`"],[13],[1,";\\n } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"else"],[13],[1," {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"`local/static/"],[10,1],[14,0,"hljs-subst"],[12],[1,"${filePath}"],[13],[1,"`"],[13],[1,";\\n }\\n }\\n }\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"The "],[10,"code"],[12],[1,"generateURI"],[13],[1," function receives the "],[10,"code"],[12],[1,"filePath"],[13],[1," for each asset and must return a string of the asset\'s location. For more info, see the "],[10,3],[14,6,"https://github.com/ember-engines/ember-asset-loader#generating-custom-uris"],[14,0,"docs-md__a"],[12],[1,"ember-asset-loader documentation"],[13],[1,"."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"fastboot"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#fastboot"],[14,0,"heading-anchor"],[12],[1,"Fastboot"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Ember Engines is perfect for combining with server-side rendering solution and works with "],[10,3],[14,6,"https://ember-fastboot.com/"],[14,0,"docs-md__a"],[12],[1,"FastBoot"],[13],[1," out of the box."],[13],[1,"\\n"],[10,2],[12],[1,"All Engine builds (regardless of whether they are lazy-loaded or not) will generate a "],[10,"code"],[12],[1,"engines-dist/engine-name/config/environment.js"],[13],[1," file. This is because we need to load that file in FastBoot for both eager and lazy engines."],[13],[1,"\\n"],[13]],[],["div","h1","h2","a","p","code","pre","span"]]',moduleName:"dummy/templates/docs/deploying.hbs",isStrictMode:!1})}),define("dummy/templates/docs/deprecations",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 59e.default=(0,n.createTemplateFactory)({id:"ZEzv1Wpq",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"deprecations"],[14,0,"docs-md__h1"],[12],[1,"Deprecations"],[13],[1,"\\n \\n "],[10,"h3"],[14,1,"-transition-methods-of-controller-and-route"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-transition-methods-of-controller-and-route"],[14,0,"heading-anchor"],[12],[1,"§ Transition methods of Controller and Route"],[13],[13],[1,"\\n "],[10,2],[12],[10,"strong"],[12],[1,"until"],[13],[1,": 1.0.0"],[13],[1,"\\n"],[10,2],[12],[10,"strong"],[12],[1,"id"],[13],[1,": ember-engines.transition-methods"],[13],[1,"\\n"],[10,2],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/674"],[14,0,"docs-md__a"],[12],[1,"RFC #674"],[13],[1," has deprecated the methods "],[10,"code"],[12],[1,"transitionTo"],[13],[1," and "],[10,"code"],[12],[1,"replaceWith"],[13],[1,"\\nof the "],[10,"code"],[12],[1,"Route"],[13],[1," and the methods "],[10,"code"],[12],[1,"transitionToRoute"],[13],[1," and "],[10,"code"],[12],[1,"replaceRoute"],[13],[1," of "],[10,"code"],[12],[1,"Controller"],[13],[1,".\\nThese methods have been removed in v5.0.0 of Ember.js, and developers encouraged to use "],[10,"code"],[12],[1,"RouterService"],[13],[1," instead."],[13],[1,"\\n"],[10,2],[12],[1,"The methods "],[10,"code"],[12],[1,"transitionToExternal"],[13],[1," and "],[10,"code"],[12],[1,"replaceWithExternal"],[13],[1," of the "],[10,"code"],[12],[1,"Route"],[13],[1," and the method "],[10,"code"],[12],[1,"transitionToExternalRoute"],[13],[1," of the "],[10,"code"],[12],[1,"Controller"],[13],[1,"\\nshare the same underlying code and follow the same spirit as ones deprecated
59in Ember.js.\\nDevelopers encouraged to use "],[10,"code"],[12],[1,"EnginesRouterService"],[13],[1," provided by "],[10,3],[14,6,"https://github.com/villander/ember-engines-router-service"],[14,0,"docs-md__a"],[12],[10,"code"],[12],[1,"ember-engines-router-service"],[13],[13],[1," instead."],[13],[1,"\\n"],[10,2],[12],[1,"Before:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// my-engine/routes/foo.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Route"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/routing/route\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { inject "],[10,1],[14,0,"hljs-keyword"],[12],[1,"as"],[13],[1," service } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/service\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"FooRoute"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Route"],[13],[1," {\\n @service session;\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"beforeModel"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"if"],[13],[1," (!"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"session"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"isAuthenticated"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"transitionToExternal"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'login\'"],[13],[1,");\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"After:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// my-engine/routes/foo.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Route"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/routing/route\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { inject "],[10,1],[14,0,"hljs-keyword"],[12],[1,"as"],[13],[1," service } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/service\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"FooRoute"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Route"],[13],[1," {\\n @service router;\\n @service session;\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"beforeModel"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"if"],[13],[1," (!"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"session"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"isAuthenticated"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"transitionToExternal"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'login\'"],[13],[1,");\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Before:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// my-engine/routes/foo.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Route"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/routing/route\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { inject "],[10,1],[14,0,"hljs-keyword"],[12],[1,"as"],[13],[1," service } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/service\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"FooRoute"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Route"],[13],[1," {\\n @service session;\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"beforeModel"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"if"],[13],[1," (!"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"session"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"isAuthenticated"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"replaceWithExternal"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'login\'"],[13],[1,");\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"After:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// my-engine/routes/foo.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Route"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/routing/route\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { inject "],[10,1],[14,0,"hljs-keyword"],[12],[1,"as"],[13],[1," service } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/service\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"FooRoute"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Route"],[13],[1," {\\n @service router;\\n @service session;\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"beforeModel"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"if"],[13],[1," (!"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"session"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"isAuthenticated"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"replaceWithExternal"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'login\'"],[13],[1,");\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Before:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// my-engine/controllers/foo.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Controller"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/controller\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"FooController"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Controller"],[13],[1," {\\n @action\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"async"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"save"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"{ title, text }"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"let"],[13],[1," post = "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"store"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"createRecord"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'post\'"],[13],[1,", { title, text });\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," post."],[10,1],[14,0,"hljs-title function_"],[12],[1,"save"],[13],[1,"();\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"transitionToExternalRoute"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'post\'"],[13],[1,", post."],[10,1],[14,0,"hljs-property"],[12],[1,"id"],[13],[1,");\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"After:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// my-engine/controllers/foo.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Route"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/routing/route\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { inject "],[10,1],[14,0,"hljs-keyword"],[12],[1,"as"],[13],[1," service } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/service\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"FooRoute"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Route"],[13],[1," {\\n @service router;\\n\\n @action\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"async"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"save"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"{ title, text }"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"let"],[13],[1," post = "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"store"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"createRecord"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'post\'"],[13],[1,", { title, text });\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," post."],[10,1],[14,0,"hljs-title function_"],[12],[1,"save"],[13],[1,"();\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"transitionToExternal"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'post\'"],[13],[1,", post."],[10,1],[14,0,"hljs-property"],[12],[1,"id"],[13],[1,");\\n }\\n}\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"-use-alias-for-inject-router-service-from-host-application"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-use-alias-for-inject-router-service-from-host-application"],[14,0,"heading-anchor"],[12],[1,"§ Use alias for inject router service from host application"],[13],[13],[1,"\\n "],[10,2],[12],[10,"strong"],[12],[1,"until"],[13],[1,": 0.9.0"],[13],[1,"\\n"],[10,2],[12],[10,"strong"],[12],[1,"id"],[13],[1,": ember-engines.deprecation-router-service-from-host"],[13],[1,"\\n"],[10,2],[12],[1,"Unintentionally an Engine can inherit the "],[10,"code"],[12],[1,"router"],[13],[1," service from host application breaking the encapsulation that is the main goal of this project. Instead you must pass the host\'s "],[10,"code"],[12],[1,"router"],[13],[1," with an alias."],[13],[1,"\\n"],[10,2],[12],[1,"Before:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"App"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Application"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n engines = {\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"dependencies"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"services"],[13],[1,": [\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'router\'"],[13],[1,"\\n ]\\n }\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"After:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"App"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Application"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n engines = {\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"dependencies"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"services"],[13],[1,": [\\n { "],[10,1],[14,0,"hljs-string"],[12],[1,"\'host-router\'"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'router\'"],[13],[1," }\\n ]\\n }\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"-camelized-e
59ngine-names-in-engine-config"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-camelized-engine-names-in-engine-config"],[14,0,"heading-anchor"],[12],[1,"§ Camelized engine names in Engine Config"],[13],[13],[1,"\\n "],[10,2],[12],[10,"strong"],[12],[1,"until"],[13],[1,": 0.9.0"],[13],[1,"\\n"],[10,2],[12],[10,"strong"],[12],[1,"id"],[13],[1,": ember-engines.deprecation-camelized-engine-names"],[13],[1,"\\n"],[10,2],[12],[1,"In the host application, we\'re asked to build out engine configurations using camel cases for package names.\\nThis is error-prone and awkward - especially for scoped packages. Awkward because our packages already have names used by npm/Yarn/pnpm, e.g. \\"my-blog\\", or "],[10,"code"],[12],[1,"my-super-awesome-engine"],[13],[1,"\\nwhereas ember-engines asked us to introduce camel case rules and use "],[10,"code"],[12],[1,"myBlog"],[13],[1," or "],[10,"code"],[12],[1,"mySuperAwesomeEngine"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"Before:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"App"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Application"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n engines = {\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'superBlog\'"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"dependencies"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"services"],[13],[1,": [\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'store\'"],[13],[1,"\\n ]\\n }\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"After:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"App"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Application"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n engines = {\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"dependencies"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"services"],[13],[1,": [\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'store\'"],[13],[1,"\\n ]\\n }\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[13]],[],["div","h1","h3","a","p","strong","code","pre","span"]]',moduleName:"dummy/templates/docs/deprecations.hbs",isStrictMode:!1})}),define("dummy/templates/docs/embroider",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 60e.default=(0,n.createTemplateFactory)({id:"BrbqZsDi",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"embroider-vite-webpack"],[14,0,"docs-md__h1"],[12],[1,"Embroider Vite/Webpack"],[13],[1,"\\n "],[10,2],[12],[1,"As of v0.13.0, Ember Engines is compatible with the new default Ember build system based on "],[10,3],[14,6,"https://vite.dev"],[14,0,"docs-md__a"],[12],[1,"Vite"],[13],[1," and "],[10,3],[14,6,"https://github.com/embroider-build/embroider"],[14,0,"docs-md__a"],[12],[1,"Embroider"],[13],[1,". For your engines to work with Embroider you will need to make sure you are suing at least "],[10,"code"],[12],[1,"[email protected]"],[13],[1," and you will need to update your "],[10,"code"],[12],[1,"engine.js"],[13],[1," entrypoint to pass "],[10,"code"],[12],[1,"compatModules"],[13],[1," to the resolver."],[13],[1,"\\n"],[10,2],[12],[1,"This method of using the "],[10,"code"],[12],[1,"ember-resolver"],[13],[1," with "],[10,"code"],[12],[1,"compatModules"],[13],[1," is usually not compatible with the Classic build system but "],[10,"code"],[12],[1,"ember-engines"],[13],[1," automatically provides a polyfill so that an engine that has been updated to work with Embroider+Vite will continue to work with a Classic app that is still using "],[10,"code"],[12],[1,"ember-cli"],[13],[1," for its build."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"how-to-update-your-engine-js-entrypoint-to-support-embroider-vite"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#how-to-update-your-engine-js-entrypoint-to-support-embroider-vite"],[14,0,"heading-anchor"],[12],[1,"How to update your "],[10,"code"],[12],[1,"engine.js"],[13],[1," entrypoint to supp
60ort Embroider+Vite"],[13],[13],[1,"\\n "],[10,2],[12],[1,"To support Embroider+Vite you need to first import "],[10,"code"],[12],[1,"compatModules"],[13],[1," from the virtual entrypoint "],[10,"code"],[12],[1,"@embroider/virtual/compat-modules"],[13],[1," and then pass it to your resolver using the "],[10,"code"],[12],[1,"withModules()"],[13],[1," function. You also need to pass "],[10,"code"],[12],[1,"compatModules"],[13],[1," to the "],[10,"code"],[12],[1,"loadInitializers()"],[13],[1," function."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-diff"],[12],[1,"// addon/engine.js\\nimport Engine from \'ember-engines/engine\';\\nimport Resolver from \'ember-resolver\';\\nimport loadInitializers from \'ember-load-initializers\';\\nimport config from \'./config/environment\';\\n"],[10,1],[14,0,"hljs-addition"],[12],[1,"+ import compatModules from \'@embroider/virtual/compat-modules\';"],[13],[1,"\\n\\nconst { modulePrefix } = config;\\n\\nclass Eng extends Engine {\\nmodulePrefix = config.modulePrefix;\\n"],[10,1],[14,0,"hljs-deletion"],[12],[1,"- Resolver = Resolver;"],[13],[1,"\\n"],[10,1],[14,0,"hljs-addition"],[12],[1,"+ Resolver = Resolver.withModules(compatModules);"],[13],[1,"\\n}\\n\\n"],[10,1],[14,0,"hljs-deletion"],[12],[1,"- loadInitializers(Eng, modulePrefix);"],[13],[1,"\\n"],[10,1],[14,0,"hljs-addition"],[12],[1,"+ loadInitializers(Eng, modulePrefix, compatModules);"],[13],[1,"\\n\\nexport default Eng;\\n"],[13],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"lazy-engines"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#lazy-engines"],[14,0,"heading-anchor"],[12],[1,"Lazy Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"With the new Embroider+Vite build system you are required to use "],[10,3],[14,6,"https://github.com/embroider-build/embroider/blob/main/packages/router/"],[14,0,"docs-md__a"],[12],[10,"code"],[12],[1,"@embroider/router"],[13],[13],[1," as a replacement for your regular Ember Router if you want to maintain the behaviour of your Lazy Engines. All bundle splitting is handled by Embroider and the "],[10,"code"],[12],[1,"@embroider/router"],[13],[1," controls loading bundles as you navigate between routes that may have been split by the build, or a lazy engine that may be mounted on a particular route."],[13],[1,"\\n"],[10,2],[12],[1,"The "],[10,"code"],[12],[1,"@embroider/router"],[13],[1," is the default for new applications but if you are upgrading an existing app you will need to update your router to use the new drop-in replacement:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-diff"],[12],[1,"// <your app>/app/router.js\\n"],[10,1],[14,0,"hljs-deletion"],[12],[1,"-import EmberRouter from \'@ember/routing/router\';"],[13],[1,"\\n"],[10,1],[14,0,"hljs-addition"],[12],[1,"+import EmberRouter from \'@embroider/router\';"],[13],[1,"\\n"],[13],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"legacy-embroider"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#legacy-embroider"],[14,0,"heading-anchor"],[12],[1,"Legacy Embroider"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Before Embroider+Vite became the default for newly generated applications, there was a previous Embroider version that used a mixture of a classic build (with AMD) and Webpack. This version of Embroider is no longer being actively maintained so anyone still using it should actively try to upgrade to Embroider+Vite."],[13],[1,"\\n"],[10,2],[12],[1,"Since "],[10,"code"],[12],[1,"ember-engines"],[13],[1," is providing an automatic polyfill that supports classic builds, that same polyfill allows Engines that have been updated to work with Vite to work with the legacy Emberoider@3 build system that relies on Webpack."],[13],[1,"\\n"],[13]],[],["div","h1","p","a","code","h2","pre","span"]]',moduleName:"dummy/templates/docs/embroider.hbs",isStrictMode:!1})}),define("dummy/templates/docs/index",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 61e.default=(0,n.createTemplateFactory)({id:"nPDW97gt",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"what-are-engines-"],[14,0,"docs-md__h1"],[12],[1,"What are Engines?"],[13],[1,"\\n "],[10,2],[12],[1,"Engines allow multiple logical applications to be composed together into a single application from the user\'s perspective. The key term here is \\"logical application\\". That is, an Engine represents a set of functionality and user experiences that could logically be considered an application. However, they differ from normal Ember applications in that they are intended to be composed within a host application in order to create a single, cohesive user experience."],[13],[1,"\\n"],[10,2],[12],[1,"On a technical level, engines and applications are remarkably similar: they each have their own container, registry, context, and namespace. However, unlike an application, an engine does not boot itself nor does it control its own router. Engines rely on their hosts to fulfill these responsibilities."],[13],[1,"\\n"],[10,2],[12],[1,"The often used example of this is a \\"blogging\\" application. While a blog itself could be a full-fledged application, you may also wish to use it as a specific subsection of your overall application. If you threw a \\"news feed\\" engine into that mix, you might get an application structure that looks something like this:"],[13],[1,"\\n\\n"],[10,2],[12],[10,"img"],[14,"src","/images/app-engine-diagram.jpeg"],[14,"alt","Diagram of Application with two Engines"],[14,"width","850"],[12],[13],[13],[1,"\\n"],[10,2],[12],[1,"This host application relies upon Engines to control different \\"zones\\" of functionality. However, from the user\'s perspective, the host application and its engines appear to be a single application."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"why-use-engines-"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#why-use-engines-"],[14,0,"heading-anchor"],[12],[1,"Why use Engines?"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Large organizations often use Ember.js to power sophisticated web applications. These apps may require collaboration among several teams, sometimes distributed around the world. Typically, responsibility is shared by dividing the application into one or more \\"sections\\". How this division is actually implemented varies from team to team."],[13],[1,"\\n"],[10,2],[12],[1,"Maintaining large monolithic applications poses the following challenges:"],[13],[1,"\\n\\n "],[10,"ul"],[14,0,"docs-list-disc"],[12],[10,"li"],[12],[10,"code"],[12],[1,"Side effects"],[13],[1," - if you change something, it may be unclear how it could affect the rest of platform."],[13],[1,"\\n"],[10,"li"],[12],[10,"code"],[12],[1,"Coordination"],[13],[1," - when you develop a new feature or make big changes, many teams may need to be in sync to approve it."],[13],[1,"\\n"],[10,"li"],[12],[10,"code"],[12],[1,"Complexity"],[13],[1," - with a huge dependency tree and many layers of abstraction, developers cannot iterate quickly, and features suffer as a result."],[13],[1,"\\n"],[10,"li"],[12],[10,"code"],[12],[1,"Killing Innovation"],[13],[1," - a/b testing a cutting-edge feature is hard to do without disrupting the rest of the app and the teams working on it."],[13],[1,"\\n"],[10,"li"],[12],[10,"code"],[12],[1,"Slow Onboarding"],[13],[1," - new people coming into the team are overwhelmed."],[13],[1,"\\n"],[13],[1,"\\n "],[10,2],[12],[1,"Engines provide an antidote to these problems by allowing for distributed development, testing, and packaging of logically-grouped pieces of an application."],[13],[1,"\\n"],[10,2],[12],[1,"Engines are good for organizations that have multiple teams, where each team has their own area that is clearly separated from the others. The isolation is good when it matches organizational boundaries, but adds unnecessary complexity when there is not a good match."],[13],[1,"\\n"],[10,2],[12],[1,"Engines are used by a number of organizations, including "],[10,3],[14,6,"https://www.linkedin.com"],[14,0,"docs-md__a"],[12],[1,"LinkedIn"],[13],[1,", "],[10,3],[14,6,"https://www.chase.com/"],[14,0,"docs-md__a"],[12],[1,"Chase"],[13],[1,", and "],[10,3],[14,6,"https://squareup.com"],[14,0,"docs-md__a"],[12],[1,"Square"],[13],[1,", to power sites with million of users."],[13],[1,"\\n"],[10,2],[12],[1,"If you are considering splitting up your application into engines just to reduce the amount of data that needs to be initially downloaded and increase the performance, Engines are not the right solution. Please check out the section on tree shaking and code splitting in projects like "],[10,3],[14,6,"https://github.com/embroider-build/embroider"],[14,0,"docs-md__a"],[12],[1,"Embroider"],[13],[1,"."],[13],[1,"\\n"],[13]],[],["div","h1","p","img","h2","a","ul","li","code"]]',moduleName:"dummy/templates/docs/index.hbs",isStrictMode:!1})}),define("dummy/templates/docs/installation",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
61dule",{value:!0}),e.default=void 0 62e.default=(0,n.createTemplateFactory)({id:"Q3yLlfI3",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"installation"],[14,0,"docs-md__h1"],[12],[1,"Installation"],[13],[1,"\\n "],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-sh"],[12],[1,"ember install ember-engines\\n"],[13],[13],[1,"\\n"],[13]],[],["div","h1","pre","code"]]',moduleName:"dummy/templates/docs/installation.hbs",isStrictMode:!1})}),define("dummy/templates/docs/introduction",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 63e.default=(0,n.createTemplateFactory)({id:"WxT4OR9M",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"introduction"],[14,0,"docs-md__h1"],[12],[1,"Introduction"],[13],[1,"\\n "],[10,2],[12],[1,"Welcome to the official guide for Ember Engines! This guide is intended to get you up and running with Engines as implemented in the "],[10,3],[14,6,"https://www.npmjs.com/package/ember-engines"],[14,0,"docs-md__a"],[12],[10,"code"],[12],[1,"ember-engines"],[13],[13],[1," addon and give you background on various concepts and ideas related to Engines. It is intended to be read from start to finish, but has been broken down in case you want to come back and re-read a specific topic."],[13],[1,"\\n"],[10,2],[12],[1,"Do note that since Engines have not had a 1.0.0 release the APIs and examples given in this guide are subject to change."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"get-help-contribute"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#get-help-contribute"],[14,0,"heading-anchor"],[12],[1,"Get Help & Contribute"],[13],[13],[1,"\\n "],[10,2],[12],[1,"The Ember Engines source code (including this website) is available on "],[10,3],[14,6,"http://github.com/ember-engines"],[14,0,"docs-md__a"],[12],[1,"GitHub"],[13],[1,". If you run into an error with the Engines code itself or think a feature is missing, please "],[10,3],[14,6,"https://github.com/ember-engines/ember-engines/issues"],[14,0,"docs-md__a"],[12],[1,"file an issue"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"The best way to get help for project-specific issues is via the "],[10,3],[14,6,"https://discordapp.com/invite/zT3asNS"],[14,0,"docs-md__a"],[12],[1,"Ember Community Discord"],[13],[1,". Once youâve signed up, join the "],[10,3],[14,6,"https://discordapp.com/channels/480462759797063690/487221820638887947"],[14,0,"docs-md__a"],[12],[1,"#ember-engines"],[13],[1," channel."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"engines-roadmap"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#engines-roadmap"],[14,0,"heading-anchor"],[12],[1,"Engines Roadmap"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Ember Engines are currently pre-1.0 software and under active development. Check out our "],[10,3],[14,6,"https://discuss.emberjs.com/t/engines-1-0-roadmap/14914"],[14,0,"docs-md__a"],[12],[1,"roadmap to 1.0"],[13],[1,"."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"additional-resources"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#additional-resources"],[14,0,"heading-anchor"],[12],[1,"Additional Resources"],[13],[13],[1,"\\n \\n "],[10,"ul"],[14,0,"docs-list-disc"],[12],[10,"li"],[12],[10,3],[14,6,"https://github.com/ember-engines/ember-engines"],[14,0,"docs-md__a"],[12],[1,"Ember Engines on GitHub"],[13],[13],[1,"\\n"],[10,"li"],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/10"],[14,0,"docs-md__a"],[12],[1,"Engines RFC"],[13],[13],[1,"\\n"],[10,"li"],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/122"],[14,0,"docs-md__a"],[12],[1,"Engine Linking RFC"],[13],[13],[1,"\\n"],[10,"li"],[12],[10,3],[14,6,"https://github.com/ember-engines/ember-asset-loader"],[14,0,"docs-md__a"],[12],[1,"Ember Asset Loader on GitHub"],[13],[13],[1,"\\n"],[10,"li"],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/153"],[14,0,"docs-md__a"],[12],[1,"Asset Manifest RFC"],[13],[13],[1,"\\n"],[10,"li"],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/158"],[14,0,"docs-md__a"],[12],[1,"Asset Loader Service RFC"],[13],[13],[1,"\\n"],[13],[1,"\\n "],[10,2],[12],[10,"em"],[12],[1,"Note: this guide is accurate as of the 0.8.x release of ember-engines"],[13],[1,"."],[13],[1,"\\n"],[13]],[],["div","h1","p","a","code","h2","ul","li","em"]]',moduleName:"dummy/templates/docs/introduction.hbs",isStrictMode:!1})}),define("dummy/templates/docs/isolation",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
63dule",{value:!0}),e.default=void 0 64e.default=(0,n.createTemplateFactory)({id:"zhgge1WN",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"isolation"],[14,0,"docs-md__h1"],[12],[1,"Isolation"],[13],[1,"\\n "],[10,2],[12],[1,"The next concept is a bit abstract, but talked about frequently when discussing Engines: "],[10,"em"],[12],[1,"isolation"],[13],[1,". When discussing Engines, isolation refers to the idea of "],[10,"em"],[12],[1,"logical run-time separation"],[13],[1,"; that is, separating the code which an Engine can reference from the code which an Application can reference."],[13],[1,"\\n"],[10,2],[12],[1,"In practice this means that Engines cannot access or communicate with their host (often referred to as their \\"parent\\"), except through a few well-defined interfaces. Attempting to access code from the host without explicitly importing it will result in a run-time error. So, things that you might have gotten \\"for free\\" in an application, now must have ceremony in order to be used by your Engine."],[13],[1,"\\n"],[10,2],[12],[1,"At first, and even after working with it for a while, this isolation may seem a bit cumbersome as it requires you to write more code and do more work to use something that you previously got with little effort. This \\"ceremony\\" of importing, however, is very important as it enables build and run time optimizations that are not possible without those constraints."],[13],[1,"\\n"],[10,2],[12],[1,"In particular, one huge benefit of Engines is the ability to lazy-load them. This is only made possible by having explicit interfaces with the consuming application and dependencies so that a dependency graph can be constructed at build time to allow for proper bundling of assets."],[13],[1,"\\n"],[13]],[],["div","h1","p","em"]]',moduleName:"dummy/templates/docs/isolation.hbs",isStrictMode:!1})}),define("dummy/templates/docs/lazy-loading",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 65e.default=(0,n.createTemplateFactory)({id:"XvNRLnda",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"lazy-loading"],[14,0,"docs-md__h1"],[12],[1,"Lazy Loading"],[13],[1,"\\n "],[10,2],[12],[1,"The moment we\'ve all be waiting for, let\'s talk about lazy loading!"],[13],[1,"\\n"],[10,2],[12],[1,"If you\'ve been following along and paying attention, we\'ve stressed frequently the idea that Engine\'s are isolated. Well, assuming you haven\'t violated those isolations principles anywhere, enabling lazy loading for your Engine is as simple as setting a flag:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// super-blog/index.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"const"],[13],[1," { buildEngine } = "],[10,1],[14,0,"hljs-built_in"],[12],[1,"require"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-engines/lib/engine-addon\'"],[13],[1,");\\n\\n"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"exports"],[13],[1," = "],[10,1],[14,0,"hljs-title function_"],[12],[1,"buildEngine"],[13],[1,"({\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"name"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,",\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"lazyLoading"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"enabled"],[13],[1,": "],[10,1],[14,0,"hljs-literal"],[12],[1,"true"],[13],[1,"\\n }\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Next time you build your application, you should have a lazy loading Engine!"],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"route-less-lazy-engines"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#route-less-lazy-engines"],[14,0,"heading-anchor"],[12],[1,"Route-less Lazy Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Currently, lazy loading is not supported natively for route-less Engines. But you can use "],[10,3],[14,6,"https://github.com/buschtoens/ember-lazy-mount"],[14,0,"docs-md__a"],[12],[1,"ember-lazy-mount"],[13],[1," as solution for while. Progress can be tracked at "],[10,3],[14,6,"https://github.com/ember-engines/ember-engines/issues/232"],[14,0,"docs-md__a"],[12],[1,"this issue"],[13],[1,"."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"routing-considerations"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#routing-considerations"],[14,0,"heading-anchor"],[12],[1,"Routing Considerations"],[13],[13],[1,"\\n "],[10,2],[12],[1,"When routing into a routable Engine that is lazily loaded there are some special considerations and subtle differences from how rout
65ing works in a normal Ember application."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"serialization-of-urls"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#serialization-of-urls"],[14,0,"heading-anchor"],[12],[1,"Serialization of URLs"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Since the links to your Engine are constructed before the Engine itself is loaded, you need to make sure the application has the necessary code to serialize data into the URLs. To that end, you need to replace any "],[10,"code"],[12],[1,"Route#serialize"],[13],[1," functions with route serializers, as defined in "],[10,3],[14,6,"https://github.com/emberjs/rfcs/blob/master/text/0120-route-serializers.md"],[14,0,"docs-md__a"],[12],[1,"the Route Serializers RFC"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"For example, if you had a "],[10,"code"],[12],[1,"Post"],[13],[1," route defined like so:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Route"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"@ember/routing/route\\""],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"PostRoute"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Route"],[13],[1," {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"serialize"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"model"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," { "],[10,1],[14,0,"hljs-attr"],[12],[1,"post_id"],[13],[1,": model."],[10,1],[14,0,"hljs-property"],[12],[1,"id"],[13],[1," };\\n }\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"You would need to remove that function and inline it into your "],[10,"code"],[12],[1,"routes.js"],[13],[1," map, which is loaded pre-emptively with the application:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"serializePost"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"model"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," { "],[10,1],[14,0,"hljs-attr"],[12],[1,"post_id"],[13],[1,": model."],[10,1],[14,0,"hljs-property"],[12],[1,"id"],[13],[1," };\\n}\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"buildRoutes"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"route"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'post\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"serialize"],[13],[1,": serializePost });\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Note that route serializers are unique to Engines and won\'t work in normal applications. In a normal Ember application you should continue to use "],[10,"code"],[12],[1,"Route#serialize"],[13],[1,"."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"loading-error-substates"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#loading-error-substates"],[14,0,"heading-anchor"],[12],[1,"Loading / Error Substates"],[13],[13],[1,"\\n "],[10,2],[12],[1,"The loading and error substates work in a similar fashion to "],[10,3],[14,6,"https://guides.emberjs.com/release/routing/loading-and-error-substates/"],[14,0,"docs-md__a"],[12],[1,"substates in a normal Ember app"],[13],[1,". The only difference is that lazily loaded Engines will enter a loading state while the assets for the Engine are loaded and can enter an error state when an asset fails to load."],[13],[1,"\\n\\n "],[10,"h1"],[14,1,"built-engine-output"],[14,0,"docs-md__h1"],[12],[1,"Built Engine Output"],[13],[1,"\\n \\n "],[10,"h2"],[14,1,"eager-engines"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#eager-engines"],[14,0,"heading-anchor"],[12],[1,"Eager Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Eager engines are built approximately the same as existing addons. Differences are limited to consolidating the namespace of "],[10,"code"],[12],[1,"app"],[13],[1," code inside of an engine into the engine\'s namespace instead of the host application."],[13],[1,"\\n"],[10,2],[12],[1,"Beyond that it adds in a configuration module for the engine, and n
65othing else. It is a remarkably straightforward process."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"lazy-engines"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#lazy-engines"],[14,0,"heading-anchor"],[12],[1,"Lazy Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Lazy engines are built in the same way as eager engines, but their assets are not combined back into the host application\'s "],[10,"code"],[12],[1,"vendor-{hash}.js"],[13],[1," file. This means that they are run through a separate and unique build process from what a default addon will go through, though it reaches out to the upstream implementation in Ember CLI where possible."],[13],[1,"\\n"],[10,2],[12],[1,"A lazy engine\'s output ("],[10,"code"],[12],[1,"lazy-engine"],[13],[1,") looks like this:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[12],[1,"dist\\nâââ assets\\nâ âââ host-application.css\\nâ âââ host-application.js\\nâ âââ vendor-{hash}.css\\nâ âââ vendor-{hash}.js\\nâââ engines-dist\\nâ âââ lazy-engine\\n| âââ config\\nâ | âââ enviroment.js\\nâ âââ assets\\nâ â âââ engine-vendor-{hash}.css\\nâ â âââ engine-vendor-{hash}.js\\nâ â âââ engine.css\\nâ â âââ engine.js\\nâ âââ public-asset.jpg\\nâââ asset-manifest.json\\nâââ crossdomain.xml\\nâââ index.html\\nâââ robots.txt\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"-routes-js"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-routes-js"],[14,0,"heading-anchor"],[12],[10,"code"],[12],[1,"/routes.js"],[13],[13],[13],[1,"\\n "],[10,2],[12],[1," The "],[10,"code"],[12],[1,"routes.js"],[13],[1," file and anything it "],[10,"code"],[12],[1,"import"],[13],[1,"s must be present at boot time of\\nthe host application. It will be bundled into the host application\'s "],[10,"code"],[12],[1,"vendor-132494d7db189dd536628ad1ed751251.js"],[13],[1,"\\nfile. This location should be considered "],[10,"code"],[12],[1,"undefined"],[13],[1," behavior and should not be\\nrelied upon as it may change in the future."],[13],[1,"\\n"],[10,2],[12],[1," Its module name inside of the host application will be "],[10,"code"],[12],[1,"lazy-engine/routes"],[13],[1,". Any\\n"],[10,"code"],[12],[1,"import"],[13],[1,"s will also be in the "],[10,"code"],[12],[1,"lazy-engine"],[13],[1," module path."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"-app"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-app"],[14,0,"heading-anchor"],[12],[10,"code"],[12],[1,"/app"],[13],[13],[13],[1,"\\n "],[10,2],[12],[1," Assets in this folder don\'t make sense, it\'s a bad idea to use them because they break the\\nisolation guarantees of engines."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"-addon"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-addon"],[14,0,"heading-anchor"],[12],[10,"code"],[12],[1,"/addon"],[13],[13],[13],[1,"\\n "],[10,2],[12],[1,"JavaScript assets in this folder will be processed as per normal addon behavior\\nexcept that they will end up inside of the "],[10,"code"],[12],[1,"engine.js"],[13],[1," file. Their module\\ndefinition will be rooted to the engine name."],[13],[1,"\\n"],[10,2],[12],[1," For example, "],[10,"code"],[12],[1,"/addon/routes/application.js"],[13],[1," will result in a JavaScript module\\nnamed "],[10,"code"],[12],[1,"lazy-engine/routes/application"],[13],[1," inside of the\\n"],[10,"code"],[12],[1,"/dist/engines-dist/lazy-engine/engine.js"],[13],[1," file."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"-addon-templates"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-addon-templates"],[14,0,"heading-anchor"],[12],[10,"code"],[12],[1,"/addon/templates"],[13],[13],[13],[1,"\\n "],[10,2],[12],[1," Templates will be compiled by your engine but they must include\\n"],[10,"code"],[12],[1,"ember-cli-htmlbars"],[13],[1," inside of "],[10,"code"],[12],[1,"dependencies"],[13],[1," in the engine\'s "],[10,"code"],[12],[1,"package.json"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1," As an example, "],[10,"code"],[12],[1,"/addon/templates/application.hbs"],[13],[1," will result in a JavaScript\\nmodule named "],[10,"code"],[12],[1,"lazy-engine/templates/application"],[13],[1," inside of the\\n"],[10,"code"],[12],[1,"/dist/engines-dist/lazy-engine/engine.js"],[13],[1," file."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"-addon-styles-css"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-addon-styles-css"],[14,0,"heading-anchor"],[12],[10,"code"],[12],[1,"/addon/styles/**/*.css"],[13],[13],[13],[1,"\\n "],[10,2],[12],[1,"CSS files will be built similarly to how they are processed inside of typical\\nadddons. Typical addon behavior is as follows:"],[13],[1,"\\n\\n "],[10,"ol"],[14,0,"docs-list-decimal"],[12],[10,"li"],[12],[10,2],[12],[1,"All nested addons are processed. Each of them may return a "],[10,"code"],[12],[1,"style"],[13],[1," tree. By\\ndefault these style trees only contain the contents of "],[10,"code"],[12],[1,"addon/styles/addon.css"],[13],[1,".\\nThe contents of the "],[10,"code"],[12],[1,"addon/styles/addon.css"],[13],[1," file is moved inside of the\\nBroccoli tree to "],[10,"code"],[12],[1,"${addon-name}.css"],[13],[1,". This can be modified if the addon\\nspecifies a custom "],[10,"code"],[12],[1,"treeForStyle"],[13],[1," hook."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"All top-level addons (those directly depended upon by the host) have all of\\n"],[10,"code"],[12],[1,"addon/styles/**/*.css"],[13],[1," included into the host\'s "],[10,"code"],[12],[1,"vendor-bf23a3cb9e1fe7e55fa54e9a1176f74
65c.css"],[13],[1," file. For example\\n"],[10,"code"],[12],[1,"addon/styles/foo.css"],[13],[1," will appear in the output Broccoli tree at "],[10,"code"],[12],[1,"foo.css"],[13],[1,"."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"If you name a CSS file in one of the top-level addons the same as an addon\\nname (e.g. addon name is "],[10,"code"],[12],[1,"alpha"],[13],[1,"), any top-level addon which has a CSS file\\nof the same name as that addon ("],[10,"code"],[12],[1,"alpha.css"],[13],[1,") and is provided by an addon\\nlexicographically after it ("],[10,"code"],[12],[1,"zeta"],[13],[1,") will clobber the contents of\\n"],[10,"code"],[12],[1,"alpha/addon/styles/addon.css"],[13],[1," (from anywhere in the dependency graph) with\\n"],[10,"code"],[12],[1,"zeta/addon/styles/alpha.css"],[13],[1,". (This is also a possible consequence of DAG\\ntopsorting.)"],[13],[1,"\\n"],[13],[1,"\\n"],[13],[1,"\\n "],[10,2],[12],[1,"Lazy engines will use a variation of this approach:"],[13],[1,"\\n\\n "],[10,"ol"],[14,0,"docs-list-decimal"],[12],[10,"li"],[12],[10,2],[12],[1,"The engine itself will be treated as if it is a top-level dependency. This\\nmeans that "],[10,"code"],[12],[1,"addon/styles/**/*.css"],[13],[1," will end up inside of "],[10,"code"],[12],[1,"engine.css"],[13],[1,"."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"Child addons of a lazy engine will be treated as if they are top-level\\naddons. This means that they will have their "],[10,"code"],[12],[1,"treeForStyle"],[13],[1," hook executed and\\nthe result of that hook will be merged into "],[10,"code"],[12],[1,"engine-vendor-bf23a3cb9e1fe7e55fa54e9a1176f74c.css"],[13],[1," in\\nDAG/lexicographic order."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"Nested lazy engine boundaries will not be crossed when calculating the child\\n"],[10,"code"],[12],[1,"treeForStyle"],[13],[1," hook."],[13],[1,"\\n"],[13],[1,"\\n"],[13],[1,"\\n \\n "],[10,"h3"],[14,1,"-public"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#-public"],[14,0,"heading-anchor"],[12],[10,"code"],[12],[1,"/public"],[13],[13],[13],[1,"\\n "],[10,2],[12],[1,"Assets appearing in the public folder will appear at the root of the engine\\noutput with no transformation. For example "],[10,"code"],[12],[1,"/public/public-asset.jpg"],[13],[1," appears at\\nthe root level of the "],[10,"code"],[12],[1,"/dist/engines-dist/lazy-engine/"],[13],[1," output folder. Assets in\\nthis folder have no default behavior and you are responsible for any custom\\nbehavior."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"asset-manifest"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#asset-manifest"],[14,0,"heading-anchor"],[12],[1,"Asset Manifest"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Further, the engine must enumerate its primary bundles (JS and CSS) in order to\\nbe loaded by the asset loading service. That will be generated at\\n"],[10,"code"],[12],[1,"/dist/asset-manifest.json"],[13],[1," at build time. It will also by default be inserted\\ninto a meta tag config inside of the host application\'s "],[10,"code"],[12],[1,"index.html"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"A asset manifest output looks like this:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-json"],[12],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"bundles\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"guide\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"assets\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"["],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"uri\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"/engines-dist/<lazy-engine>/assets/engine-vendor-132494d7db189dd536628ad1ed751251.js\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,","],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"type\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"js\\""],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,","],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"uri\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"/engines-dist/<lazy-engine>/assets/engine.js\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,","],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"type\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"js\\""],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"]"],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n"],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n"],[13],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"nested-eager-engines"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#nested-eager-engines"],[14,0,"heading-anchor"],[12],[1,"Nested Eager Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Nested eager engines will be built into their host engine or application.\\nModules will be deduplicated within the engine boundary and with the host\\napplication."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"nested-lazy-engines"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#nested-lazy-engines"],[14,0,"heading-anchor"],[12],[1,"Nested Lazy Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Nested lazy engines will be promoted to "],[10,"code"],[12],[1,"/dist/engines-dist/"],[13],[1," folder in the\\nbuild output. Module deduplication will only be done with the host application."],[13],[1,"\\n"],[13]],[],["div","h1","p","pre","code","span","h2","a","h3","ol","li"]]',moduleName:"dummy/templates/docs/lazy-loading.hbs",isStrictMode:!1})}),define("dummy/templates/docs/link-to-external",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
65dule",{value:!0}),e.default=void 0 66e.default=(0,n.createTemplateFactory)({id:"vJElgJNn",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"linking-to-an-external-context"],[14,0,"docs-md__h1"],[12],[1,"Linking To An External Context"],[13],[1,"\\n "],[10,2],[12],[1,"In order to deal with this, Engines allow you to specify external routes as dependencies:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// super-blog/addon/engine.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"SuperBlog"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Engine"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n dependencies = {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"externalRoutes"],[13],[1,": [\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'home\'"],[13],[1,",\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'settings\'"],[13],[1,"\\n ]\\n };\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"External routes define things that your Engine needs to link to. The host is then responsible for telling you where those things are. In other words, the Engine defines "],[10,"em"],[12],[1,"what"],[13],[1," it would like to go to and the application tells it "],[10,"em"],[12],[1,"where"],[13],[1," that is."],[13],[1,"\\n"],[10,2],[12],[1,"This is an important mental shift. Normal links define "],[10,"em"],[12],[1,"where"],[13],[1," they want to go to, but external links define "],[10,"em"],[12],[1,"what"],[13],[1," they want to go to and the host application tells it "],[10,"em"],[12],[1,"where"],[13],[1," that is."],[13],[1,"\\n"],[10,2],[12],[1,"So, when you mount your Engine, you\'ll need to make sure the host specifies appropriate paths for each of the external routes the Engine needs:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// dummy/app/app.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Application"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/application\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"App"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Application"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n engines = {\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"dependencies"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"externalRoutes"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"home"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'home.index\'"],[13],[1,",\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"settings"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'settings.blog.index\'"],[13],[1,"\\n }\\n }\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"You can use these external routes within your Engine via the "],[10,"code"],[12],[1,"<LinkToExternal/>"],[13],[1," component:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-hbs"],[12],[10,1],[14,0,"language-xml"],[12],[10,1],[14,0,"hljs-tag"],[12],[1,"<"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkToExternal"],[13],[1," @"],[10,1],[14,0,"hljs-attr"],[12],[1,"route"],[13],[1,"="],[10,1],[14,0,"hljs-string"],[12],[1,"\\"home\\""],[13],[1,">"],[13],[1,"Go Home"],[10,1],[14,0,"hljs-tag"],[12],[1,"</"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkToExternal"],[13],[1,">"],[13],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Or, one of the programmatic APIs, such as "],[10,"code"],[12],[1,"Route#transitionToExternal"],[13],[1,", "],[10,"code"],[12],[1,"Route#replaceWithExternal"],[13],[1," and "],[10,"code"],[12],[1,"Controller#transitionToExternalRoute"],[13],[1,":"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Route"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"@ember/routing/route\\""],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { action } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/object\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"YourRoute"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Route"],[13],[1," {\\n @action\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"goHome"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"transitionToExternal"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'home\'"],[13],[1,");\\n }\\n});\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"using-external-routes-for-internal-locations"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#using-external-routes-for-internal-locations"],[14,0,"heading-anchor"],[12],[1,"Using External Routes for Internal locations"],[13],[13],[1,"\\n "],[10,2],[12],[1,"In most cases, you should only need to use external routes to link to locations that you expect to be outside of your Engine. However, there are instances where you might need a link that could potentially be internal to your Engine. In which case, external routes can still work effectively, since they represent "],[10,"em"],[12],[1,"what"],[13],[1," you want to link to. If the host then tells you that the thing is at a path internal to your Engine, that will still work fine."],[13],[1,"\\n"],[13]],[],["div","h1","p","pre","code","span","em","h3","a"]]',moduleName:"dummy/templates/docs/link-to-external.hbs",isStrictMode:!1})}),define("dummy/templates/docs/links",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
66dule",{value:!0}),e.default=void 0 67e.default=(0,n.createTemplateFactory)({id:"uFU3FEbB",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"linking-between-engines-and-applications-"],[14,0,"docs-md__h1"],[12],[1,"Linking Between Engines (and Applications)"],[13],[1,"\\n "],[10,2],[12],[1,"Routing and linking within and between Engines is a bit more complicated than with normal Ember applications. This is because Engines are isolated and thus don\'t know about routes beyond their own borders. Let\'s look at what this means practically."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"linking-within-an-engine"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#linking-within-an-engine"],[14,0,"heading-anchor"],[12],[1,"Linking Within An Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Within a routable Engine (i.e "],[10,"code"],[12],[1,"super-blog"],[13],[1,"), route paths are relative to the Engine\'s \\"mount point\\". That is, the route path at which it is mounted."],[13],[1,"\\n"],[10,2],[12],[1,"In other words, if you\'re trying to go to route "],[10,"code"],[12],[1,"super-blog.posts.index"],[13],[1,", you might do the following from the host application:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-hbs"],[12],[10,1],[14,0,"language-xml"],[12],[10,1],[14,0,"hljs-tag"],[12],[1,"<"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkTo"],[13],[1," @"],[10,1],[14,0,"hljs-attr"],[12],[1,"route"],[13],[1,"="],[10,1],[14,0,"hljs-string"],[12],[1,"\\"super-blog.posts.index\\""],[13],[1,">"],[13],[1,"Comments"],[10,1],[14,0,"hljs-tag"],[12],[1,"</"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkTo"],[13],[1,">"],[13],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"However, if you are inside the "],[10,"code"],[12],[1,"super-blog"],[13],[1," Engine, you would need to do the following:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-hbs"],[12],[10,1],[14,0,"language-xml"],[12],[10,1],[14,0,"hljs-tag"],[12],[1,"<"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkTo"],[13],[1," @"],[10,1],[14,0,"hljs-attr"],[12],[1,"route"],[13],[1,"="],[10,1],[14,0,"hljs-string"],[12],[1,"\\"posts.index\\""],[13],[1,">"],[13],[1,"Comments"],[10,1],[14,0,"hljs-tag"],[12],[1,"</"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkTo"],[13],[1,">"],[13],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Notice that the "],[10,"code"],[12],[1,"super-blog"],[13],[1," portion of the path is now missing, this is because that is the Engine\'s mount point."],[13],[1,"\\n"],[10,2],[12],[1,"Previously we mentioned that each Engine has it\'s own "],[10,"code"],[12],[1,"application"],[13],[1," route, that route corresponds to the mount point when within the Engine. So, if you wanted to go to "],[10,"code"],[12],[1,"super-blog"],[13],[1," (or the root of the Engine) from within the Engine itself, you would do something like:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-hbs"],[12],[10,1],[14,0,"language-xml"],[12],[10,1],[14,0,"hljs-tag"],[12],[1,"<"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkTo"],[13],[1," @"],[10,1],[14,0,"hljs-attr"],[12],[1,"route"],[13],[1,"="],[10,1],[14,0,"hljs-string"],[12],[1,"\\"application\\""],[13],[1,">"],[13],[1,"Goes to Blog Home"],[10,1],[14,0,"hljs-tag"],[12],[1,"</"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkTo"],[13],[1,">"],[13],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Or, maybe even:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-hbs"],[12],[10,1],[14,0,"language-xml"],[12],[10,1],[14,0,"hljs-tag"],[12],[1,"<"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkTo"],[13],[1," @"],[10,1],[14,0,"hljs-attr"],[12],[1,"route"],[13],[1,"="],[10,1],[14,0,"hljs-string"],[12],[1,"\\"index\\""],[13],[1,">"],[13],[1,"Also goes to Blog Home"],[10,1],[14,0,"hljs-tag"],[12],[1,"</"],[10,1],[14,0,"hljs-name"],[12],[1,"LinkTo"],[13],[1,">"],[13],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"It\'s a little confusing at first, but the gist is to think of the route paths as if the Engine were it\'s own application."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"link-to-external-engine-application"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#link-to-external-engine-application"],[14,0,"heading-anchor"],[12],[1,"Link to External Engine/Application"],[13],[13],[1,"\\n "],[10,2],[12],[1,"If route paths are scoped to an Engine\'s mount point, then the next logical question is \\"what if you need to link to a path that isn\'t below the mount point?\\""],[13],[1,"\\n"],[10,2],[12],[1,"We refer to any routes that don\'t use the Engine\'s mount point as \\"external routes\\", because they are effectively \\"external\\" or \\"outside\\" the Engine. Since Engines are intended to be isolated, they shouldn\'t have intimate knowledge of the paths to external routes as they may change depending on where the Engine is mounted. That said, there are legitimate use cases where Engines need to link to routes outside, such as a consuming Application or sibling Engine. See futher details on "],[10,3],[14,6,"./link-to-external"],[14,0,"docs-md__a"],[12],[10,"code"],[12],[1,"<LinkToExternal/>"],[13],[13],[1,"."],[13],[1,"\\n"],[13]],[],["div","h1","p","h2","a","code","pre","span"]]',moduleName:"dummy/templates/docs/links.hbs",isStrictMode:!1})}),define("dummy/templates/docs/migrations",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
67dule",{value:!0}),e.default=void 0 68e.default=(0,n.createTemplateFactory)({id:"txDfeeTx",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"migrations"],[14,0,"docs-md__h1"],[12],[1,"Migrations"],[13],[1,"\\n \\n "],[10,"h3"],[14,1,"v0-12-v0-13"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#v0-12-v0-13"],[14,0,"heading-anchor"],[12],[1,"v0.12 -> v0.13"],[13],[13],[1,"\\n \\n "],[10,"ol"],[14,0,"docs-list-decimal"],[12],[10,"li"],[12],[10,2],[12],[1,"Update engine.js to gain vite support for engines"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-diff"],[12],[1,"// addon/engine.js\\nimport Engine from \'ember-engines/engine\';\\nimport Resolver from \'ember-resolver\';\\nimport loadInitializers from \'ember-load-initializers\';\\nimport config from \'./config/environment\';\\n"],[10,1],[14,0,"hljs-addition"],[12],[1,"+ import compatModules from \'@embroider/virtual/compat-modules\';"],[13],[1,"\\n\\nconst { modulePrefix } = config;\\n\\nclass Eng extends Engine {\\nmodulePrefix = config.modulePrefix;\\n"],[10,1],[14,0,"hljs-deletion"],[12],[1,"- Resolver = Resolver;"],[13],[1,"\\n"],[10,1],[14,0,"hljs-addition"],[12],[1,"+ Resolver = Resolver.withModules(compatModules);"],[13],[1,"\\n}\\n\\n"],[10,1],[14,0,"hljs-deletion"],[12],[1,"- loadInitializers(Eng, modulePrefix);"],[13],[1,"\\n"],[10,1],[14,0,"hljs-addition"],[12],[1,"+ loadInitializers(Eng, modulePrefix, compatModules);"],[13],[1,"\\n\\nexport default Eng;\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1," this change is compatible with classic apps that have not upgraded to vite as long as they also upgrade to "],[10,"code"],[12],[1,"ember-engines@^0.13.0"],[13],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"Only on classic apps (not being built with Vite - the default for new apps since 6.8)\\n Add "],[10,"code"],[12],[1,"ember-asset-loader"],[13],[1," as a dev dependency"],[13],[1,"\\n"],[13],[1,"\\n"],[13],[1,"\\n \\n "],[10,"h3"],[14,1,"v0-10-v0-11"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#v0-10-v0-11"],[14,0,"heading-anchor"],[12],[1,"v0.10 -> v0.11"],[13],[13],[1,"\\n \\n "],[10,"ol"],[14,0,"docs-list-decimal"],[12],[10,"li"],[12],[10,2],[12],[10,"code"],[12],[1,"@ember/legacy-built-in-components"],[13],[1," no longer required for ember engines.\\n It can be safely removed from your app if it\'s the only reason it was added."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-diff"],[12],[1,"# package.json\\n{\\n \\"dependencies\\": {\\n"],[10,1],[14,0,"hljs-deletion"],[12],[1,"- \\"@ember/legacy-built-in-components\\": \\"^0.5.0\\","],[13],[1,"\\n ...\\n }\\n}\\n"],[13],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"Add "],[10,3],[14,6,"https://github.com/villander/ember-engines-router-service"],[14,0,"docs-md__a"],[12],[1,"ember-engines-router-service"],[13],[1," to "],[10,"code"],[12],[1,"dependencies"],[13],[1,"\\nin package.json of your engine to enable "],[10,"code"],[12],[1,"@service router;"],[13],[1," injection. Besides that you\'ll have the full "],[10,3],[14,6,"https://api.emberjs.com/ember/release/classes/routerservice/"],[14,0,"docs-md__a"],[12],[1,"RouterService"],[13],[1," API inside each engine as promised by the "],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/122"],[14,0,"docs-md__a"],[12],[1,"Engine Linking RFC"],[13],[1,"."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-diff"],[12],[1,"# package.json\\n{\\n \\"dependencies\\": {\\n"],[10,1],[14,0,"hljs-addition"],[12],[1,"+ \\"ember-engines-router-service\\": \\"^0.6.0\\","],[13],[1,"\\n ...\\n }\\n}\\n"],[13],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"In line with "],[10,3],[14,6,"https://rfcs.emberjs.com/id/0674-deprecate-transition-methods-of-controller-and-route/"],[14,0,"docs-md__a"],[12],[1,"RFC 674"],[13],[1,"\\ntransition methods of Controller and Route were removed.\\nFollow "],[10,3],[14,6,"/docs/deprecations#-transition-methods-of-controller-and-route"],[14,0,"docs-md__a"],[12],[1,"deprecation guide"],[13],[1," for migration examples."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"Dropped supp
68ort for query param only router service transitions until it\'s resolved upstream "],[10,3],[14,6,"https://github.com/villander/ember-engines-router-service/issues/74"],[14,0,"docs-md__a"],[12],[1,"https://github.com/villander/ember-engines-router-service/issues/74"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"Example for unsupported syntax â:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"transitionTo"],[13],[1,"({ "],[10,1],[14,0,"hljs-attr"],[12],[1,"queryParams"],[13],[1,": { "],[10,1],[14,0,"hljs-attr"],[12],[1,"page"],[13],[1,": "],[10,1],[14,0,"hljs-number"],[12],[1,"1"],[13],[1," }});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Example for unchanged syntax â :"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"transitionTo"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'posts\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"queryParams"],[13],[1,": { "],[10,1],[14,0,"hljs-attr"],[12],[1,"page"],[13],[1,": "],[10,1],[14,0,"hljs-number"],[12],[1,"1"],[13],[1," }});\\n"],[13],[13],[1,"\\n"],[13],[1,"\\n"],[13],[1,"\\n "],[13]],[],["div","h1","h3","a","ol","li","p","pre","code","span"]]',moduleName:"dummy/templates/docs/migrations.hbs",isStrictMode:!1})}),define("dummy/templates/docs/quickstart",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 69e.default=(0,n.createTemplateFactory)({id:"RMfQfMdh",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"quickstart"],[14,0,"docs-md__h1"],[12],[1,"Quickstart"],[13],[1,"\\n \\n "],[10,"h2"],[14,1,"creating-an-engine"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#creating-an-engine"],[14,0,"heading-anchor"],[12],[1,"Creating An Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Now that we have all the conceptual and theoretical talk out of the way, let\'s actually make an Engine!"],[13],[1,"\\n"],[10,2],[12],[1,"As discussed previously, Engines are distributed as Addons and In-Repo-Addons."],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"create-as-in-repo-engine"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#create-as-in-repo-engine"],[14,0,"heading-anchor"],[12],[1,"Create as In-Repo-Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"To create an engine within an existing application\'s project, run the\\n"],[10,"code"],[12],[1,"in-repo-engine"],[13],[1," generator:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember g in-repo-engine <engine-name>\\n"],[13],[13],[1,"\\n"],[10,"blockquote"],[14,0,"docs-md__blockquote"],[12],[10,2],[12],[1,"Note: In-repo addons currently are created in the "],[10,"code"],[12],[1,"/lib"],[13],[1," directory (e.g. "],[10,"code"],[12],[1,"/lib/my-addon"],[13],[1,"). Unit tests and integration tests are currently co-mingled with tests for the main application. A separate repo should be used for your engine if you wish to avoid this co-mingling."],[13],[1,"\\n"],[13],[10,2],[12],[1,"So, if we name our Engine "],[10,"code"],[12],[1,"super-blog"],[13],[1,", we just do the following:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember g in-repo-engine super-blog\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"This has added a directory named "],[10,"code"],[12],[1,"lib"],[13],[1," and an app addon directory structure named for "],[10,"code"],[12],[1,"super-blog"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"Using the blueprint in-repo-engine, ember-cli has added all the appropriate files to create a new app structure."],[13],[1,"\\n"],[10,2],[12],[1,"If you want to share elements between an in-repo engine and application, you could do so with an in-repo addon. For example, the following in-repo engine\'s package ("],[10,"code"],[12],[1,"lib/super-blog/package.json"],[13],[1,") references the "],[10,"code"],[12],[1,"common"],[13],[1," in-repo addon:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-json"],[12],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"name\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"super-blog\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,","],[13],[1,"\\n\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"dependencies\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"ember-cli-htmlbars\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"*\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,","],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"ember-cli-babel\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"*\\""],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,","],[13],[1,"\\n\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"ember-
69addon\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"paths\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"["],[13],[1,"\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"../common\\""],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"]"],[13],[1,"\\n "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n"],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"generate-in-an-in-repo-engine"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#generate-in-an-in-repo-engine"],[14,0,"heading-anchor"],[12],[1,"Generate in an In-Repo-Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Using the right flags, generating routes, components (etc) in an in-repo engine is the same as in a regular Ember application."],[13],[1,"\\n"],[10,2],[12],[1,"To create a route within an in-repo-engine, you can run:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember generate route <route-name> --in-repo <in-repo-name>\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"To create a component within an in-repo-engine, you can run:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember generate component <component-name> --in-repo <in-repo-name>\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"To generate helpers, controllers and other things, you can use the "],[10,"code"],[12],[1,"--in-repo"],[13],[1," flag like above."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"using-the-in-flag"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#using-the-in-flag"],[14,0,"heading-anchor"],[12],[1,"Using the --in flag"],[13],[13],[1,"\\n "],[10,2],[12],[1,"As of "],[10,3],[14,6,"mailto:[email protected]"],[14,0,"docs-md__a"],[12],[1,"[email protected]"],[13],[1," and higher the generate command includes an "],[10,"code"],[12],[1,"--in"],[13],[1," flag that allows you to specify the directory to generate into.\\nFor example, given an in-repo addon at lib/my-foo/:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember generate component awesome-sauce --in ./lib/foo\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Will generate the following files:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"lib/foo/addon/components/awesome-sauce.js\\nlib/foo/addon/templates/components/awesome-sauce.hbs\\ntests/integration/components/awesome-sauce-test.js\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"remove-from-in-repo-engine"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#remove-from-in-repo-engine"],[14,0,"heading-anchor"],[12],[1,"Remove from In-Repo-Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"For removing the above generated routes (components and other things) from your engine, replace "],[10,"code"],[12],[1,"generate"],[13],[1," with "],[10,"code"],[12],[1,"destroy"],[13],[1," in the shell command"],[13],[1,"\\n"],[10,2],[12],[1,"Removing a route from an in-repo engine:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember destroy route <route-name> --in-repo <in-repo-name>\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Removing a component from an in-repo engine:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember destroy component <component-name> --in-repo <in-repo-name>\\n"],[13],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"create-as-addon"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#create-as-addon"],[14,0,"heading-anchor"],[12],[1,"Create as Addon"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Separate addon projects can be created with the addon command:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember addon <engine-name>\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"So, if we name our Engine "],[10,"code"],[12],[1,"super-blog"],[13],[1,", we just do the following:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"ember addon super-blog\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Using a vanilla addon we still need turn it into an engine, follow the steps below."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"install-engine-dependencies"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#install-engine-dependencies"],[14,0,"heading-anchor"],[12],[1,"Install Engine Dependencies"],[13],[13],[1,"\\n "],[10,2],[12],[1,"At this point, you have a vanilla Addon which is not yet an Engine, so let\'s introduce the remaining pieces needed for it to function as one."],[13],[1,"\\n"],[10,2],[12],[1,"First, we need to install the "],[10,"code"],[12],[1,"ember-engines"],[13],[1," addon, which provides support for all the Engines features which haven\'t been accepted into Ember core yet. Installation is as simple as:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"cd super-blog/\\nember install ember-engines\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"A quick note, Engines should have "],[10,"code"],[12],[1,"ember-engines"],[13],[1," listed as a "],[10,"code"],[12],[1,"devDependency"],[13],[1," and "],[10,"code"],[12],[1,"peerDepen
69dency"],[13],[1,". The reason for this is that if you include "],[10,"code"],[12],[1,"ember-engines"],[13],[1," as a "],[10,"code"],[12],[1,"dependency"],[13],[1," of both the host application and the Engine, you\'ll wind up duplicating some crucial functionality which can cause problems. Therefore, it is best that the host application provide the copy to be used."],[13],[1,"\\n"],[10,2],[12],[1,"Finally, we need to ensure "],[10,"code"],[12],[1,"ember-cli-htmlbars"],[13],[1," is listed as a dependency for compiling our templates:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-json"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// package.json"],[13],[1,"\\n"],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"dependencies\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-punctuation"],[12],[1,"{"],[13],[1,"\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"\\"ember-cli-htmlbars\\""],[13],[10,1],[14,0,"hljs-punctuation"],[12],[1,":"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"^1.1.0\\""],[13],[1,"\\n"],[10,1],[14,0,"hljs-punctuation"],[12],[1,"}"],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Pretty simple so far. At this point, we have everything needed to actually create an Engine, but we don\'t have an Engine itself."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"configuring-your-engine"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#configuring-your-engine"],[14,0,"heading-anchor"],[12],[1,"Configuring your Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Within your Engine\'s root directory, modify "],[10,"code"],[12],[1,"index.js"],[13],[1," so that your addon is configured as an Engine using the "],[10,"code"],[12],[1,"buildEngine"],[13],[1," function:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// index.js"],[13],[1,"\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"const"],[13],[1," { buildEngine } = "],[10,1],[14,0,"hljs-built_in"],[12],[1,"require"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-engines/lib/engine-addon\'"],[13],[1,");\\n\\n"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"exports"],[13],[1," = "],[10,1],[14,0,"hljs-title function_"],[12],[1,"buildEngine"],[13],[1,"({\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"name"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,",\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"lazyLoading"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"enabled"],[13],[1,": "],[10,1],[14,0,"hljs-literal"],[12],[1,"false"],[13],[1,"\\n }\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"We\'ll leave the "],[10,"code"],[12],[1,"lazyLoading.enabled"],[13],[1," flag as "],[10,"code"],[12],[1,"false"],[13],[1," for now, as we\'ll be discussing the topic of lazy-loading engines in depth later on in this guide."],[13],[1,"\\n"],[10,2],[12],[1,"Within your Engine\'s "],[10,"code"],[12],[1,"config"],[13],[1," directory, modify the "],[10,"code"],[12],[1,"environment.js"],[13],[1," file:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// config/environment.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-meta"],[12],[1,"\\n\'use strict\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"exports"],[13],[1," = "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"environment"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"const"],[13],[1," "],[10,1],[14,0,"hljs-variable constant_"],[12],[1,"ENV"],[13],[1," = {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"modulePrefix"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,",\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"environment"],[13],[1,": environment\\n }\\n\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-variable constant_"],[12],[1,"ENV"],[13],[1,";\\n};\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Finally, to make this addon an actual Engine, create a "],[10,"code"],[12],[1,"engine.js"],[13],[1," file under the "],[10,"code"],[12],[1,"addon"],[13],[1," directory:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"touch addon/engine.js\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"The "],[10,"code"],[12],[1,"engine.js"],[13],[1," file lives inside the "],[10,"code"],[12],[1,"addon"],[13],[1," directory because we want it to be within the Addon\'s/Engine\'s namespace. We\'ll explore this idea more later, but it is important to note for now."],[13],[1,"\\n"],[10,2],[12],[1,"Next, add the following code to "],[10,"code"],[12],[1,"engine.js"],[13],[1,":"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// addon/engine.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Engine"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/engine\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," loadInitializer
69s "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-load-initializers\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Resolver"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-resolver\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," config "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'./config/environment\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"const"],[13],[1," { modulePrefix } = config;\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"YourEngine"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Engine"],[13],[1," {\\n modulePrefix = modulePrefix;\\n "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Resolver"],[13],[1," = "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Resolver"],[13],[1,";\\n}\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"loadInitializers"],[13],[1,"("],[10,1],[14,0,"hljs-title class_"],[12],[1,"YourEngine"],[13],[1,", modulePrefix);\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"This code will look familiar to anyone that\'s seen an Ember Application\'s "],[10,"code"],[12],[1,"app.js"],[13],[1," file before. Since Engines are so closely related to Applications, it makes sense that their initial files look similar."],[13],[1,"\\n"],[10,2],[12],[1,"There are four important points from the "],[10,"code"],[12],[1,"engine.js"],[13],[1," file:"],[13],[1,"\\n\\n "],[10,"ol"],[14,0,"docs-list-decimal"],[12],[10,"li"],[12],[10,"strong"],[12],[10,"code"],[12],[1,"config"],[13],[13],[1,": Each Engine has its own configuration file, similar to the one Ember Applications normally have. It\'s even found in the same location - "],[10,"code"],[12],[1,"config/environment.js"],[13],[13],[1,"\\n"],[10,"li"],[12],[10,"strong"],[12],[10,"code"],[12],[1,"Resolver"],[13],[13],[1,": Engines have their own Resolver. This means they look things up independently of their host application."],[13],[1,"\\n"],[10,"li"],[12],[10,"strong"],[12],[10,"code"],[12],[1,"modulePrefix"],[13],[13],[1,": Since Engines have their own Resolver, they also must have their own "],[10,"code"],[12],[1,"modulePrefix"],[13],[1," to define which modules belong to their namespace. Since the "],[10,"code"],[12],[1,"config"],[13],[1," is empty by default, you\'ll want to add this to your "],[10,"code"],[12],[1,"config/environment.js"],[13],[1," file."],[13],[1,"\\n"],[10,"li"],[12],[10,"strong"],[12],[10,"code"],[12],[1,"loadInitializers"],[13],[13],[1,": Again, since Engines have their own Resolver and thus their own Container, we want to make sure we run initializers against the Engine on boot-up so they can perform tasks like injections."],[13],[1,"\\n"],[13],[1,"\\n "],[10,"hr"],[14,0,"docs-md__hr"],[12],[13],[1,"\\n "],[10,"h3"],[14,1,"aside-app-vs-addon-namespace"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#aside-app-vs-addon-namespace"],[14,0,"heading-anchor"],[12],[10,"strong"],[12],[1,"Aside"],[13],[1,": App Vs Addon Namespace"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Let\'s take a moment to talk about namespaces."],[13],[1,"\\n"],[10,2],[12],[1,"Every Ember Application has a namespace defined by its "],[10,"code"],[12],[1,"modulePrefix"],[13],[1," value. This namespace allows your "],[10,"code"],[12],[1,"Resolver"],[13],[1," to find the modules created by Ember-CLI at runtime. You\'ll likely have noticed before that if you try to import a module that is in your "],[10,"code"],[12],[1,"app"],[13],[1," directory, then you need to use the "],[10,"code"],[12],[1,"modulePrefix"],[13],[1," instead."],[13],[1,"\\n"],[10,2],[12],[1,"So, if you have the file "],[10,"code"],[12],[1,"app/components/foo-bar.js"],[13],[1," and the "],[10,"code"],[12],[1,"modulePrefix"],[13],[1," "],[10,"code"],[12],[1,"baz"],[13],[1,", you\'ll have to look it up using "],[10,"code"],[12],[1,"baz/components/foo-bar"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"Similarly, Addons, and therefore Engines, have their own namespace defined by their "],[10,"code"],[12],[1,"name"],[13],[1," value in their "],[10,"code"],[12],[1,"index.js"],[13],[1,". Anything in the "],[10,"code"],[12],[1,"addon"],[13],[1," directory, gets put into the Addon\'s namespace. Having a separate namespace is one of the primary ways\\nEngines achieve code isolation."],[13],[1,"\\n"],[10,2],[12],[1,"As long as the "],[10,"code"],[12],[1,"modulePrefix"],[13],[1," for your application doesn\'t match the "],[10,"code"],[12],[1,"name"],[13],[1," of an Addon, then your application won\'t be able to resolve modules living in y
69our Addon. This is why it is important that Engines have their own "],[10,"code"],[12],[1,"Resolver"],[13],[1," with a separate "],[10,"code"],[12],[1,"modulePrefix"],[13],[1," that matches the Addon\'s "],[10,"code"],[12],[1,"name"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"Observant developers might also note that Addon\'s have an "],[10,"code"],[12],[1,"app"],[13],[1," directory in addition to their "],[10,"code"],[12],[1,"addon"],[13],[1," directory. The "],[10,"code"],[12],[1,"app"],[13],[1," directory from an Addon gets merged into the host\'s namespace. This allows Addons to \\"re-export\\" modules from their own namespace into the namespace of the consumer so that they can be used as if part of the host. Engines, however, should never re-export modules into their host, and so anything placed into the "],[10,"code"],[12],[1,"app"],[13],[1," directory of an Engine Addon will not be included in the build."],[13],[1,"\\n"],[10,"hr"],[14,0,"docs-md__hr"],[12],[13],[1,"\\n "],[10,"h2"],[14,1,"adding-routes-for-routable-engines"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#adding-routes-for-routable-engines"],[14,0,"heading-anchor"],[12],[1,"Adding Routes for Routable Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"At this point, if you\'re building a Route-less Engine, then you\'re done and can skip ahead to the \\""],[10,3],[14,6,"#mounting-an-engine"],[14,0,"docs-md__a"],[12],[1,"Mounting An Engine"],[13],[1,"\\" section. If, however, you\'re building a Routable Engine, then you need to create one more file:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"touch addon/routes.js\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"The "],[10,"code"],[12],[1,"routes.js"],[13],[1," file defines the route map for a routable Engine. The contents are fairly simple:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," buildRoutes "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-engines/routes\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"buildRoutes"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// route map"],[13],[1,"\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"The callback passed to "],[10,"code"],[12],[1,"buildRoutes"],[13],[1," functions the same way as "],[10,3],[14,6,"https://api.emberjs.com/ember/release/classes/EmberRouter"],[14,0,"docs-md__a"],[12],[10,"code"],[12],[1,"Router#map"],[13],[13],[1," does in a normal application. This means, the "],[10,"code"],[12],[1,"routes.js"],[13],[1," file for our "],[10,"code"],[12],[1,"super-blog"],[13],[1," might look something like:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," buildRoutes "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-engines/routes\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"buildRoutes"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"route"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'new\'"],[13],[1,");\\n\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"route"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'post\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"path"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'post/:id\'"],[13],[1," }, "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"route"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'comments\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"route"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'comment\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"path"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\':id\'"],[13],[1," });\\n });\\n });\\n});\\n"],[13],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"mounting-an-engine"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#mounting-an-engine"],[14,0,"heading-anchor"],[12],[1,"Mounting An Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Now that we have our Engine created, we need to \\"mount\\" it in our application so that we can use it. First, however, we should probably talk about templates and top-level routes."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"engine-templates-top-level-routes"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#engine-templates-top-level-routes"],[14,0,"heading-anchor"],[12],[1,"Engine Templates & Top-Level Routes"],[13],[13],[1,"\\n "],[10,2],[12],[1,"In order to actually verify that our Engine renders properly, we need to add a template."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-shell"],[12],[1,"mkdir addon/templates\\ntouch addon/templates/application.hbs\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Note that the template we added is called "],[10,"code"],[12],[1,"application"],[13],[1,". This is because the top-level route and template in an Engine are known as "],[10,"code"],[12],[1,"application"],[13],[1,", similar to what happens with the top-level in a normal application."],[13],[1,"\\n"],[10,2],[12],[1,"This means that from within an Engine, if you want to transition to the first route, you would use "],[10,"code"],[12],[1,"application"],[13],[1," as the name instead of the location that the host application knows about."],[13],[1,"\\n"],[10,2],[12],[1,"Anyway, let\'s add something super simple to our template:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-hbs"],[12],[10,1],[14,0,"language-xml"],[12],[10,1],[14,0,"hljs-tag"],[12],[1,"<"],[10,1],[14,0,"hljs-name"],[12],[1,"h3"],[13],[1,">"],[13],[1,"Hello World!"],[10,1],[14,0,"hljs-tag"],[12],[1,"</"],[10,1],[14,0,"hljs-name"],[12],[1,"h3"],[13],[1,">"],[13],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Now we\'ll be able to verify that our Engine renders when we mount it."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"loading-phases"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#loading-phases"],[14,0,"heading-anchor"],[12],[1,"Loading phases"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Engines can exist in several phases:"],[13],[1,"\\n"],[10,2],[12],[1," "],[10,"strong"],[12],[1,"Booted"],[13],[1," - an engine that\'s been installed in a parent application will have its dependencies loaded and its (non-instance) initializer
69s invoked when the parent application boots."],[13],[1,"\\n"],[10,2],[12],[1," "],[10,"strong"],[12],[1,"Mounted"],[13],[1," - Routable and route-less engines have slightly different concepts of \\"mounting\\". A routable engine is considered mounted when it has been included by a router at one or more mount-points. A route-less engine is considered mounted as soon as a route\'s "],[10,"code"],[12],[1,"mount"],[13],[1," call resolves."],[13],[1,"\\n"],[10,2],[12],[1," "],[10,"strong"],[12],[1,"Instantiated"],[13],[1," - When an engine is instantiated, an "],[10,"code"],[12],[1,"EngineInstance"],[13],[1," is created and an engine\'s instance initializers are invoked. A routable engine is instantiated when a route is visited at or beyond its mount-point. A route-less engine is instantiated as soon as it is mounted."],[13],[1,"\\n"],[10,2],[12],[1,"Special "],[10,"code"],[12],[1,"before"],[13],[1," and "],[10,"code"],[12],[1,"after"],[13],[1," hooks could be added to application instance initializers that allow them to be ordered relative to engine instance "],[10,3],[14,6,"https://guides.emberjs.com/release/applications/initializers/"],[14,0,"docs-md__a"],[12],[1,"initializers"],[13],[1,"."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"routable-engines"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#routable-engines"],[14,0,"heading-anchor"],[12],[1,"Routable Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"The technique to mount an Engine into your application varies by the type of Engine you\'re using. We\'ll cover routable Engines first."],[13],[1,"\\n"],[10,2],[12],[1,"Mounting a Routable Engine is done through the consumer\'s "],[10,"code"],[12],[1,"Router"],[13],[1," map, like so:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"map"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"mount"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,");\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Pretty straightforward. The "],[10,"code"],[12],[1,"mount"],[13],[1," method is very similar to the "],[10,"code"],[12],[1,"route"],[13],[1," method you would normally use to define routes. You can specify a "],[10,"code"],[12],[1,"path"],[13],[1," and "],[10,"code"],[12],[1,"resetNamespace"],[13],[1," options like you normally would:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"map"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"mount"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"resetNamespace"],[13],[1,": "],[10,1],[14,0,"hljs-literal"],[12],[1,"true"],[13],[1,", "],[10,1],[14,0,"hljs-attr"],[12],[1,"path"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'/blog\'"],[13],[1," });\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"You can also specify a special property, "],[10,"code"],[12],[1,"as"],[13],[1,", which allows you to mount more than one instance of an Engine by specifying the route name it\'ll live under:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"map"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"mount"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"path"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'/blog\'"],[13],[1," });\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"mount"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"as"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'dev-blog\'"],[13],[1,", "],[10,1],[14,0,"hljs-attr"],[12],[1,"path"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'/dev-blog\'"],[13],[1," });\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"This means that if you transitioned to "],[10,"code"],[12],[1,"super-blog"],[13],[1,", you\'ll land on "],[10,"code"],[12],[1,"/blog"],[13],[1,", but if you transition to "],[10,"code"],[12],[1,"dev-blog"],[13],[1,", you\'ll land on "],[10,"code"],[12],[1,"/dev-blog"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"Other than "],[10,"code"],[12],[1,"as"],[13],[1,", the key difference between "],[10,"code"],[12],[1,"mount"],[13],[1," and "],[10,"code"],[12],[1,"route"],[13],[1," is how you specify child routes. For "],[10,"code"],[12],[1,"route"],[13],[1," you would normally pass a callback function as an additional argument. With Engines, though, we want our routing structure to be isolated from the host application, and so child routes are defined in the Engines "],[10,"code"],[12],[1,"routes.js"],[13],[1," file discussed in the previous section."],[13],[1,"\\n"],[10,2],[12],[1,"Thus, when using "],[10,"code"],[12],[1,"this.mount"],[13],[1,", the "],[10,"code"],[12],[1,"buildRoutes"],[13],[1," function exported from "],[10,"code"],[12],[1,"routes.js"],[13],[1," gets used as the callback y
69ou would normally pass to "],[10,"code"],[12],[1,"this.route"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"That about covers it for routable Engines, let\'s talk about route-less Engines now."],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"route-less-engines"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#route-less-engines"],[14,0,"heading-anchor"],[12],[1,"Route-less Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Route-less Engines are much more straightforward to mount in an application."],[13],[1,"\\n"],[10,2],[12],[1,"To mount a route-less Engine, you use the "],[10,"code"],[12],[1,"{{mount}}"],[13],[1," keyword in any of your templates:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-hbs"],[12],[10,1],[14,0,"hljs-template-variable"],[12],[1,"{{"],[10,1],[14,0,"hljs-name"],[12],[1,"mount"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\\"super-blog\\""],[13],[1,"}}"],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"And that\'s it! The Engine\'s "],[10,"code"],[12],[1,"application.hbs"],[13],[1," will be rendered into the DOM at the mount location."],[13],[1,"\\n"],[10,2],[12],[1,"Prior to Ember 2.16, the "],[10,"code"],[12],[1,"{{mount}}"],[13],[1," helper only accepts an Engine\'s name, no other variables are supported. As of Ember 2.16 a "],[10,"code"],[12],[1,"model"],[13],[1," argument can be used to pass state and/or context directly to an engine. An inline "],[10,"code"],[12],[1,"hash"],[13],[1," can even be used to pass components via "],[10,"code"],[12],[1,"model"],[13],[1,". For more information, please see "],[10,3],[14,6,"https://www.emberjs.com/api/ember/3.7/classes/Ember.Templates.helpers/methods/mount?anchor=mount"],[14,0,"docs-md__a"],[12],[1,"the documentation"],[13],[1," for this helper."],[13],[1,"\\n"],[13]],[],["div","h1","h2","a","p","code","pre","blockquote","span","h3","ol","li","strong","hr"]]',moduleName:"dummy/templates/docs/quickstart.hbs",isStrictMode:!1})}),define("dummy/templates/docs/routable-vs-routeless",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 70e.default=(0,n.createTemplateFactory)({id:"9e7zUXGE",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"routable-vs-route-less"],[14,0,"docs-md__h1"],[12],[1,"Routable Vs. Route-less"],[13],[1,"\\n "],[10,2],[12],[1,"Finally, there are two types of Engines that you could potentially encounter: "],[10,"em"],[12],[1,"routable"],[13],[1," and "],[10,"em"],[12],[1,"route-less"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"Routable Engines are, as the name implies, Engines which are able to be routed to. This means that they live at a designated route in your application and can have their own internal routes which you can navigate to. Examples of good candidates for routable Engines are admin control panels or blogging systems."],[13],[1,"\\n"],[10,2],[12],[1,"Route-less Engines, on the other hand, are Engines which are not able to be routed to. This means that they don\'t live at a specific route, but are instead mounted within a template or your application. Examples of good candidates for route-less Engines are chat boxes or complex forms."],[13],[1,"\\n"],[13]],[],["div","h1","p","em"]]',moduleName:"dummy/templates/docs/routable-vs-routeless.hbs",isStrictMode:!1})}),define("dummy/templates/docs/services",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 71e.default=(0,n.createTemplateFactory)({id:"iZxM7YmJ",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"services"],[14,0,"docs-md__h1"],[12],[1,"Services"],[13],[1,"\\n "],[10,2],[12],[1,"In addition to external routes, you can also specify Services as dependencies of your Engine which are provided from the host application. For example:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// super-blog/addon/engine.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"SuperBlog"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Engine"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n dependencies = {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"services"],[13],[1,": [\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'store\'"],[13],[1,",\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'session\'"],[13],[1,"\\n ]\\n }\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"This means that your Engine will expect the host application to provide both the "],[10,"code"],[12],[1,"store"],[13],[1," service and "],[10,"code"],[12],[1,"session"],[13],[1," service that it uses. The host application can then specify the services it provides like so:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// dummy/app/app.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"App"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Application"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n engines = {\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'super-blog\'"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"dependencies"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"services"],[13],[1,": [\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'store\'"],[13],[1,",\\n { "],[10,1],[14,0,"hljs-string"],[12],[1,"\'session\'"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'user-session\'"],[13],[1," }\\n ]\\n }\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"In this example, the host provides its "],[10,"code"],[12],[1,"store"],[13],[1," service for the Engine\'s "],[10,"code"],[12],[1,"store"],[13],[1,". The Engine\'s "],[10,"code"],[12],[1,"session"],[13],[1," service, however, is actually the "],[10,"code"],[12],[1,"user-session"],[13],[1," service of the host. Thus, you can provide a re-mapping of service names by using an object instead of a simple string."],[13],[1,"\\n"],[10,2],[12],[1,"However, if you have "],[10,"code"],[12],[1,"ServiceX"],[13],[1," in "],[10,"code"],[12],[1,"Engine B"],[13],[1,", and want to share that service with "],[10,"code"],[12],[1,"Engine A"],[13],[1,", you\'d need to create a separate addon (likely an in-repo addon in the host app) to share those services accross."],[13],[1,"\\n"],[10,2],[12],[1,"Currently, Services are the sanctioned way of passing state and data between the host and the Engine. Since Services are singletons and only passed from host-to-child, there is little risk of coupling and violation of isolation. That said, you should keep the number of services your Engine relies on to a minimum so that your host does not need to provide services fulfilling all of those interfaces."],[13],[1,"\\n"],[13]],[],["div","h1","p","pre","code","span"]]',moduleName:"dummy/templates/docs/services.hbs",isStrictMode:!1})}),define("dummy/templates/docs/sharing-code",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
71dule",{value:!0}),e.default=void 0 72e.default=(0,n.createTemplateFactory)({id:"adrRneIL",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"sharing-code"],[14,0,"docs-md__h1"],[12],[1,"Sharing code"],[13],[1,"\\n "],[10,2],[12],[1,"For Engines, globally relevant constructs, such as Services and Route paths, make sense to cross Engine boundaries because they should be unique throughout the system. Non-global constructs, such as Components, Helpers, and Utilities should be handled carefully to avoid incidental coupling with a specific host design/architecture."],[13],[1,"\\n"],[10,2],[12],[1,"For instance, having to provide several route paths and services, such as Ember Data\'s Store, creates a relatively easy to fulfill API for consumers of your Engine. If your Engine also required specific components, helpers, and utilities, all needing to conform to the API usage inside your Engine, then you all of a sudden have substantially more coupling involved. This is bad for isolation and does not give you flexibility in developing your Engine independently of your host."],[13],[1,"\\n"],[10,2],[12],[1,"However, there are use cases for needing to share components and more across Engine boundaries. In those instances, the proper solution is to move the shared constructs into an addon."],[13],[1,"\\n"],[13]],[],["div","h1","p"]]',moduleName:"dummy/templates/docs/sharing-code.hbs",isStrictMode:!1})}),define("dummy/templates/docs/testing-acceptance",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 73e.default=(0,n.createTemplateFactory)({id:"9ph5eaKD",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"application-testing"],[14,0,"docs-md__h1"],[12],[1,"Application Testing"],[13],[1,"\\n \\n "],[10,"h2"],[14,1,"testing-standalone-engine"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#testing-standalone-engine"],[14,0,"heading-anchor"],[12],[1,"Testing Standalone Engine"],[13],[13],[1,"\\n "],[10,2],[12],[1,"The first step is mounting the engine on the dummy app:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// admin-engine/tests/dummy/app/router.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"EmberRouter"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/routing/router\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," config "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'./config/environment\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"EmberRouter"],[13],[1," {\\n location = config."],[10,1],[14,0,"hljs-property"],[12],[1,"locationType"],[13],[1,";\\n rootURL = config."],[10,1],[14,0,"hljs-property"],[12],[1,"rootURL"],[13],[1,";\\n}\\n\\n"],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"map"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"mount"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'admin-engine\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"path"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'/\'"],[13],[1," });\\n});\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1,";\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Now you can write tests in the same way as in a normal "],[10,3],[14,6,"https://guides.emberjs.com/release/testing/testing-application/"],[14,0,"docs-md__a"],[12],[1,"Ember application"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"Suppose that we are setting "],[10,"code"],[12],[1,"users"],[13],[1," route on engine router:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," buildRoutes "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-engines/routes\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"buildRoutes"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"route"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'users\'"],[13],[1,");\\n});\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Here is an application test for routing:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// admin-engine/tests/acceptance/basic-test.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,", test } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupApplicationTest } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { visit, click, currentURL } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/test-helpers\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"module"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'basic acceptance test\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"hooks"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupApplicationTest"],[13],[1,"(hooks);\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"test"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'the user can visit home page\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"async"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"assert"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"visit"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'/\'"],[13],[1,");\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"click"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'.user-menu-item\'"],[13],[1,");\\n\\n assert."],[10,1],[14,0,"hljs-title function_"],[12],[1,"equal"],[13],[1,"("],[10,1],[14,0,"hljs-title function_"],[12],[1,"currentURL"],[13],[1,"(), "],[10,1],[14,0,"hljs-string"],[12],[1,"\'/users\'"],[13],[1,");\\n });\\n});\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"stubbing-services"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#stubbing-services"],[14,0,"heading-anchor"],[12],[1,"Stubbing services"],[13],[13],[1,"\\n "],[10,2],[12],[1,"In cases where engines have "],[10,"code"],[12],[1,"services"],[13],[1," dependencies, it is possible to stub these dependencies for application tests. "],[13],[1,"\\n"],[10,2],[12],[1,"The first step is to specify on the dummy app the services provided by host-app like so:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// admin-engine/tests/dummy/app/app.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Application"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/application\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"App"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Application"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n engines = {\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'admin-engine\'"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"dependencies"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"services"],[13],[1,": [\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'location-service\'"],[13],[1,"\\n ]\\n }\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"To stub the location service in your test, create a local stub object that extends "],[10,"code"],[12],[1,"Service from @ember/service"],[13],[1,", and register the stub as the service your test."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// admin-engine/tests/acceptance/basic-test.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,", test } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupApplicationTest } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { visit, click, currentURL } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/test-helpers\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Service"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/service\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-comment"],[12],[1,"//Stub location service"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"LocationStub"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Service"],[13],[1," {\\n city = "],[10,1],[14,0,"hljs-string"],[12],[1,"\'New York\'"],[13],[1,";\\n country = "],[10,1],[14,0,"hljs-string"],[12],[1,"\'USA\'"],[13],[1,";\\n currentLocation = {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"x"],[13],[1,": "],[10,1],[14,0,"hljs-number"],[12],[1,"1234"],[13],[1,",\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"y"],[13],[1,": "],[10,1],[14,0,"hljs-number"],[12],[1,"5678"],[13],[1,"\\n };\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"getCurrentCity"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"city"],[13],[1,";\\n }\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"getCurrentCountry"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"country"],[13],[1,";\\n }\\n}\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"module"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'basic acceptance test\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"hooks"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupApplicationTest"],[13],[1,"(hooks);\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"test"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'the user can visit home page\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"async"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"assert"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"owner"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"register"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'service:location-service\'"],[13],[1,", "],[10,1],[14,0,"hljs-title class_"],[12],[1,"LocationStub"],[13],[1,");\\n\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"visit"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'/\'"],[13],[1,");\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"click"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'.user-menu-item\'"],[13],[1,");\\n\\n assert."],[10,1],[14,0,"hljs-title function_"],[12],[1,"equal"],[13],[1,"("],[10,1],[14,0,"hljs-title function_"],[12],[1,"currentURL"],[13],[1,"(), "],[10,1],[14,0,"hljs-string"],[12],[1,"\'/users\'"],[13],[1,");\\n });\\n});\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"stubbing-external-routes"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#stubbing-external-routes"],[14,0,"heading-anchor"],[12],[1,"Stubbing external routes"],[13],[13],[1,"\\n "],[10,2],[12],[1,"In cases where engines have "],[10,"code"],[12],[1,"externalRoutes"],[13],[1," dependencies, it is possible to stub these dependencies for application tests."],[13],[1,"\\n"],[10,2],[12],[1,"The first step is to specify on the dummy app the external routes provided by host-app like so:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// admin-engine/tests/dummy/app/app.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Application"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/application\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"App"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Application"],[13],[1," {\\n "],[10,1],[14,0,"hljs-comment"],[12],[1,"// ..."],[13],[1,"\\n engines = {\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'admin-engine\'"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"dependencies"],[13],[1,": {\\n "],[10,1],[14,0,"hljs-attr"],[12],[1,"externalRoutes"],[13],[1,": [\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'home\'"],[13],[1,"\\n ]\\n }\\n }\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"To stub the external route service in your test, create a local stub object that extends "],[10,"code"],[12],[1,"Service from @ember/service"],[13],[1,", and register the stub as the service your test."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// admin-engine/tests/acceptance/basic-test.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,", test } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-
73string"],[12],[1,"\'qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupApplicationTest } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { visit, click, currentURL } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/test-helpers\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Service"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/service\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"module"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'basic acceptance test\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"hooks"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupApplicationTest"],[13],[1,"(hooks);\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"test"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'the user can click on the home button and trigger external transition\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"async"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"assert"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"owner"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"unregister"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'service:router\'"],[13],[1,");\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"owner"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"register"],[13],[1,"(\\n "],[10,1],[14,0,"hljs-string"],[12],[1,"\'service:router\'"],[13],[1,",\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Service"],[13],[1," {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"transitionToExternal"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"actual"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"let"],[13],[1," expected = "],[10,1],[14,0,"hljs-string"],[12],[1,"\'home\'"],[13],[1,";\\n assert."],[10,1],[14,0,"hljs-title function_"],[12],[1,"equal"],[13],[1,"(actual, expected);\\n }\\n }\\n );\\n\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"visit"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'/\'"],[13],[1,");\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"click"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'.back-to-home\'"],[13],[1,");\\n });\\n});\\n"],[13],[13],[1,"\\n\\n "],[10,"h2"],[14,1,"testing-host-application"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#testing-host-application"],[14,0,"heading-anchor"],[12],[1,"Testing Host Application"],[13],[13],[1,"\\n "],[10,2],[12],[1,"Sometimes it is necessary to write application tests on the host app because some engines have flows that depend on the host app such as "],[10,"code"],[12],[1,"services"],[13],[1," that interact a lot with a host app or a redirect to an external context by "],[10,3],[14,6,"./links#external-routes"],[14,0,"docs-md__a"],[12],[1,"external routes"],[13],[1,". Therefore, in application tests normally we try to avoid mocking external dependencies, since this kind of test is supposed to test things as close to \\"real life\\" as possible."],[13],[1,"\\n"],[10,2],[12],[1,"Suppose that we are mouting "],[10,"code"],[12],[1,"admin-engine"],[13],[1," on host-app router:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// <app-name>/app/router.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"EmberRouter"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/routing/router\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," config "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'./config/environment\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"EmberRouter"],[13],[1," {\\n location = config."],[10,1],[14,0,"hljs-property"],[12],[1,"locationType"],[13],[1,";\\n rootURL = config."],[10,1],[14,0,"hljs-property"],[12],[1,"rootURL"],[13],[1,";\\n}\\n\\n"],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"map"],[13],[1,"("],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[13],[1,") {\\n "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"mount"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'admin-engine\'"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"path"],[13],[1,": "],[10,1],[14,0,"hljs-string"],[12],[1,"\'/admin\'"],[13],[1," });\\n});\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Router"],[13],[1,";\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Here is an acceptance test for routing:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// <app-name>/tests/acceptance/basic-test.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,", test } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupApplicationTest } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { visit, click, currentURL } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/test-helpers\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"module"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'basic acceptance test\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"hooks"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupApplicationTest"],[13],[1,"(hooks);\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"test"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'the user can visit /admin page\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"async"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"assert"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"visit"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'/\'"],[13],[1,");\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"click"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'.admin-menu-item\'"],[13],[1,");\\n\\n assert."],[10,1],[14,0,"hljs-title function_"],[12],[1,"equal"],[13],[1,"("],[10,1],[14,0,"hljs-title function_"],[12],[1,"currentURL"],[13],[1,"(), "],[10,1],[14,0,"hljs-string"],[12],[1,"\'/admin\'"],[13],[1,");\\n });\\n});\\n"],[13],[13],[1,"\\n"],[13]],[],["div","h1","h2","a","p","pre","code","span","h3"]]',moduleName:"dummy/templates/docs/testing-acceptance.hbs",isStrictMode:!1})}) 74define("dummy/templates/docs/testing-integration",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
74dule",{value:!0}),e.default=void 0 75e.default=(0,n.createTemplateFactory)({id:"43DbixK2",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"rendering-testing"],[14,0,"docs-md__h1"],[12],[1,"Rendering Testing"],[13],[1,"\\n "],[10,2],[12],[1,"Suppose that our engine has a component:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-hbs"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"{{!-- admin-engine/addon/components/hello-name.hbs --}}"],[13],[10,1],[14,0,"language-xml"],[12],[1,"\\nHello, "],[13],[10,1],[14,0,"hljs-template-variable"],[12],[1,"{{@"],[10,1],[14,0,"hljs-name"],[12],[1,"name"],[13],[1,"}}"],[13],[10,1],[14,0,"language-xml"],[12],[1,"!"],[13],[1,"\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"Here\'s an example rendering test for that component:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// <app-name>/tests/integration/components/hello-name-test.js"],[13],[1,"\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,", test } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupRenderingTest } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { render } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/test-helpers\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," hbs "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'htmlbars-inline-precompile\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupEngine } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-engines/test-support\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"module"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'Integration | Component | hello-name\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"hooks"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupRenderingTest"],[13],[1,"(hooks);\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupEngine"],[13],[1,"(hooks, "],[10,1],[14,0,"hljs-string"],[12],[1,"\'admin-engine\'"],[13],[1,")\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"test"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'it renders\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"async"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"assert"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"await"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"render"],[13],[1,"(hbs"],[10,1],[14,0,"hljs-string"],[12],[1,"`<HelloName @name=\\"Tom\\"/>`"],[13],[1,", { "],[10,1],[14,0,"hljs-attr"],[12],[1,"owner"],[13],[1,": "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"engine"],[13],[1," });\\n\\n assert."],[10,1],[14,0,"hljs-title function_"],[12],[1,"equal"],[13],[1,"("],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"element"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"textContent"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"trim"],[13],[1,"(), "],[10,1],[14,0,"hljs-string"],[12],[1,"\'Hello, Tom!\'"],[13],[1,");\\n });\\n});\\n"],[13],[13],[1,"\\n"],[13]],[],["div","h1","p","pre","code","span"]]',moduleName:"dummy/templates/docs/testing-integration.hbs",isStrictMode:!1})}),define("dummy/templates/docs/testing-intro",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
75dule",{value:!0}),e.default=void 0 76e.default=(0,n.createTemplateFactory)({id:"e7D2ihtG",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"testing"],[14,0,"docs-md__h1"],[12],[1,"Testing"],[13],[1,"\\n "],[10,2],[12],[1,"Just like other addons, engines must be tested differently depending upon whether they are \\"in-repo\\" or \\"standalone\\":"],[13],[1,"\\n\\n "],[10,"ul"],[14,0,"docs-list-disc"],[12],[10,"li"],[12],[10,2],[12],[1,"To test an in-repo engine, co-locate the engine\'s tests with the host app\'s tests, just like any other in-repo addon."],[13],[1,"\\n"],[13],[1,"\\n"],[10,"li"],[12],[10,2],[12],[1,"To test a standalone engine, use the dummy app, just like any other standalone addon project."],[13],[1,"\\n"],[13],[1,"\\n"],[13],[1,"\\n \\n "],[10,"h2"],[14,1,"setup"],[14,0,"docs-md__h2"],[12],[10,3],[14,6,"#setup"],[14,0,"heading-anchor"],[12],[1,"Setup"],[13],[13],[1,"\\n \\n "],[10,"h3"],[14,1,"lazy-engines"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#lazy-engines"],[14,0,"heading-anchor"],[12],[1,"Lazy Engines"],[13],[13],[1,"\\n "],[10,2],[12],[1,"If you have a lazy engine, you\'ll need to ensure that your "],[10,"code"],[12],[1,"tests/test-helper.js"],[13],[1," is configured to preload your engine\'s assets:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// <app-name>/tests/test-helper.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Application"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'../app\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," config "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'../config/environment\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setApplication } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/test-helpers\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { start } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," preloadAssets "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-asset-loader/test-support/preload-assets\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," manifest "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'<app-name>/config/asset-manifest\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"setApplication"],[13],[1,"("],[10,1],[14,0,"hljs-title class_"],[12],[1,"Application"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"create"],[13],[1,"(config."],[10,1],[14,0,"hljs-property"],[12],[1,"APP"],[13],[1,"));\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"preloadAssets"],[13],[1,"(manifest)."],[10,1],[14,0,"hljs-title function_"],[12],[1,"then"],[13],[1,"(start); "],[10,1],[14,0,"hljs-comment"],[12],[1,"// This ensures all engine resources are loaded before the tests"],[13],[1,"\\n"],[13],[13],[1,"\\n\\n "],[10,"h3"],[14,1,"rendering-unit-tests"],[14,0,"docs-md__h3"],[12],[10,3],[14,6,"#rendering-unit-tests"],[14,0,"heading-anchor"],[12],[1,"Rendering/Unit tests"],[13],[13],[1,"\\n "],[10,2],[12],[1,"When you deal with "],[10,"code"],[12],[1,"ember-engines"],[13],[1," and you would like to test your engine code (e.g. components and services), you need to make sure that the test environment instantiates the engine. The "],[10,"code"],[12],[1,"setupEngine"],[13],[1," helper can be used to automatically load, instantiate, and provide access to the engine."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// tests/<integration or unit>/â¦"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupEngine } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-engines/test-support\'"],[13],[1,";\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"To use it, include it in your test module with the name of your engine."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupEngine"],[13],[1,"(hooks, "],[10,1],[14,0,"hljs-string"],[12],[1,"\'<engine-name>\'"],[13],[1,");\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"The engine owner can be accessed in tests through "],[10,"code"],[12],[1,"this.engine"],[13],[1,"."],[13],[1,"\\n"],[13]],[],["div","h1","p","ul","li","h2","a","h3","code","pre","span"]]',moduleName:"dummy/templates/docs/testing-intro.hbs",isStrictMode:!1})}),define("dummy/templates/docs/testing-unit",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
76dule",{value:!0}),e.default=void 0 77e.default=(0,n.createTemplateFactory)({id:"pDYYpUqm",block:'[[[10,0],[14,0,"docs-md"],[12],[1,"\\n "],[10,"h1"],[14,1,"unit-testing"],[14,0,"docs-md__h1"],[12],[1,"Unit Testing"],[13],[1,"\\n "],[10,2],[12],[1,"To test candidates for unit/integration (e.g. components, services and controllers) declared inside an engine, you need to set up the engine using the "],[10,"code"],[12],[1,"setupEngine"],[13],[1," helper. This helper provides access to the engine in the test environment via "],[10,"code"],[12],[1,"this.engine"],[13],[1,"."],[13],[1,"\\n"],[10,2],[12],[1,"What does it look like to test a component from a host app or dummy app? Let\'s go over some examples in the next section. In the following tests, "],[10,"code"],[12],[1,"admin-engine"],[13],[1," is an engine, "],[10,"code"],[12],[1,"hello-name"],[13],[1," is a component, and "],[10,"code"],[12],[1,"some-thing"],[13],[1," is a service. (Note: the same tests will apply whether "],[10,"code"],[12],[1,"admin-engine"],[13],[1," is an in-repo or standalone engine)."],[13],[1,"\\n"],[10,2],[12],[1,"Suppose that we have in the engine a service that has a "],[10,"code"],[12],[1,"computedFoo"],[13],[1," computed property based on a "],[10,"code"],[12],[1,"foo"],[13],[1," property."],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// admin-engine/services/some-thing-test.js"],[13],[1,"\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"Service"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/service\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { computed } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'@ember/object\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"export"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"default"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"class"],[13],[1," "],[10,1],[14,0,"hljs-title class_"],[12],[1,"SomeService"],[13],[1," "],[10,1],[14,0,"hljs-keyword"],[12],[1,"extends"],[13],[1," "],[10,1],[14,0,"hljs-title class_ inherited__"],[12],[1,"Service"],[13],[1," {\\n foo = "],[10,1],[14,0,"hljs-string"],[12],[1,"\'bar\'"],[13],[1,";\\n\\n @"],[10,1],[14,0,"hljs-title function_"],[12],[1,"computed"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'foo\'"],[13],[1,")\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"get"],[13],[1," "],[10,1],[14,0,"hljs-title function_"],[12],[1,"computedFoo"],[13],[1,"() {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"return"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"`computed "],[10,1],[14,0,"hljs-subst"],[12],[1,"${"],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,".foo}"],[13],[1,"`"],[13],[1,";\\n }\\n}\\n"],[13],[13],[1,"\\n"],[10,2],[12],[1,"The unit test will be like this:"],[13],[1,"\\n"],[10,"pre"],[14,0,"docs-md__code"],[12],[10,"code"],[14,0,"language-js"],[12],[10,1],[14,0,"hljs-comment"],[12],[1,"// <app-name>/tests/unit/services/some-thing-test.js"],[13],[1,"\\n\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"module"],[13],[1,", test } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupTest } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-qunit\'"],[13],[1,";\\n"],[10,1],[14,0,"hljs-keyword"],[12],[1,"import"],[13],[1," { setupEngine } "],[10,1],[14,0,"hljs-keyword"],[12],[1,"from"],[13],[1," "],[10,1],[14,0,"hljs-string"],[12],[1,"\'ember-engines/test-support\'"],[13],[1,";\\n\\n"],[10,1],[14,0,"hljs-title function_"],[12],[1,"module"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'Unit | Service | some thing\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"hooks"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupTest"],[13],[1,"(hooks);\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"setupEngine"],[13],[1,"(hooks, "],[10,1],[14,0,"hljs-string"],[12],[1,"\'admin-engine\'"],[13],[1,")\\n\\n "],[10,1],[14,0,"hljs-title function_"],[12],[1,"test"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'should correctly concat foo\'"],[13],[1,", "],[10,1],[14,0,"hljs-keyword"],[12],[1,"function"],[13],[1,"("],[10,1],[14,0,"hljs-params"],[12],[1,"assert"],[13],[1,") {\\n "],[10,1],[14,0,"hljs-keyword"],[12],[1,"const"],[13],[1," someThing = "],[10,1],[14,0,"hljs-variable language_"],[12],[1,"this"],[13],[1,"."],[10,1],[14,0,"hljs-property"],[12],[1,"engine"],[13],[1,"."],[10,1],[14,0,"hljs-title function_"],[12],[1,"lookup"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'service:some-thing\'"],[13],[1,");\\n someThing."],[10,1],[14,0,"hljs-title function_"],[12],[1,"set"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'foo\'"],[13],[1,", "],[10,1],[14,0,"hljs-string"],[12],[1,"\'baz\'"],[13],[1,");\\n\\n assert."],[10,1],[14,0,"hljs-title function_"],[12],[1,"equal"],[13],[1,"(someThing."],[10,1],[14,0,"hljs-title function_"],[12],[1,"get"],[13],[1,"("],[10,1],[14,0,"hljs-string"],[12],[1,"\'computedFoo\'"],[13],[1,"), "],[10,1],[14,0,"hljs-string"],[12],[1,"\'computed baz\'"],[13],[1,");\\n });\\n});\\n"],[13],[13],[1,"\\n"],[13]],[],["div","h1","p","code","pre","span"]]',moduleName:"dummy/templates/docs/testing-unit.hbs",isStrictMode:!1})}),define("dummy/templates/index",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esMo
77dule",{value:!0}),e.default=void 0 78e.default=(0,n.createTemplateFactory)({id:"COSe85ym",block:'[[[10,0],[15,0,[29,["docs-bg-brand docs-text-white docs-px-4 docs-py-16 docs-text-center ",[30,0,["class"]]," "]]],[12],[1,"\\n "],[10,0],[14,0,"docs-max-w-sm docs-mx-auto"],[12],[1,"\\n "],[10,"h1"],[14,0,"docs-font-title docs-font-normal docs-text-jumbo-1 md:docs-text-jumbo-2 xl:docs-text-jumbo-3 docs-leading-none docs-tracking-tight"],[12],[1,"\\n "],[10,1],[14,0,"docs-block docs-text-large-5 md:docs-text-large-6 xl:docs-text-large-7"],[12],[1,"\\n Ember Engines\\n "],[13],[1,"\\n "],[13],[1,"\\n\\n "],[10,2],[14,0,"docs-mt-4 xl:docs-mt-6 docs-mb-2 docs-leading-small docs-mx-auto docs-tracking-tight docs-text-large-1 md:docs-text-large-2 xl:docs-text-large-3"],[12],[1,"\\n Composable applications for ambitious user experiences.\\n "],[13],[1,"\\n\\n "],[10,0],[14,0,"docs-mt-8"],[12],[1,"\\n "],[8,[39,4],[[24,0,"docs-no-underline docs-bg-white docs-text-brand docs-text-xs docs-px-3 docs-py-2 docs-rounded docs-mt-4 docs-shadow-md hover:docs-shadow-lg docs-transition hover:docs-nudge-t docs-font-bold docs-inline-block docs-uppercase"]],[["@route"],["docs"]],[["default"],[[[[1,"\\n Read the docs\\n "]],[]]]]],[1,"\\n "],[13],[1,"\\n\\n "],[18,1,null],[1,"\\n "],[13],[1,"\\n"],[13],[1,"\\n\\n"],[10,0],[14,0,"docs-bg-white"],[12],[1,"\\n "],[10,0],[14,0,"docs-container docs-md"],[12],[1,"\\n "],[10,"section"],[14,0,"docs-max-w-md docs-mx-auto docs-pb-8"],[12],[1,"\\n "],[10,"aside"],[12],[1,"Looking for the quickstart?\\n "],[6,[39,8],["docs.quickstart"],null,[["default"],[[[[1,"Click here"]],[]]]]],[1,"."],[13],[1,"\\n\\n "],[10,"h1"],[14,1,"introduction"],[12],[1,"Introduction"],[13],[1,"\\n "],[10,2],[12],[1,"Welcome to the official guide for Ember Engines! This guide is intended to get you up and running with Engines\\n as implemented in the\\n "],[10,3],[14,6,"https://www.npmjs.com/package/ember-engines"],[12],[10,"code"],[12],[1,"ember-engines"],[13],[13],[1,"\\n addon and give you background on various concepts and ideas related to Engines. It is intended to be read from\\n start to finish, but has been broken down in case you want to come back and re-read a specific topic."],[13],[1,"\\n "],[10,2],[12],[1,"Do note that since Engines have not had a 1.0.0 release the APIs and examples given in this guide are subject\\n to change."],[13],[1,"\\n "],[10,"h2"],[14,1,"get-help-amp-contribute"],[12],[1,"Get Help & Contribute"],[13],[1,"\\n "],[10,2],[12],[1,"The Ember Engines source code (including this website) is available on\\n "],[10,3],[14,6,"http://github.com/ember-engines"],[12],[1,"GitHub"],[13],[1,". If you run into an error with the Engines code itself or\\n think a feature is missing, please\\n "],[10,3],[14,6,"https://github.com/ember-engines/ember-engines/issues"],[12],[1,"file an issue"],[13],[1,"."],[13],[1,"\\n "],[10,2],[12],[1,"The best way to get help for project-specific issues is via the\\n "],[10,3],[14,6,"https://discordapp.com/invite/zT3asNS"],[12],[1,"Ember Community Discord"],[13],[1,". Once youâve signed up, join the\\n "],[10,3],[14,6,"https://discordapp.com/channels/480462759797063690/487221820638887947"],[12],[1,"#ember-engines"],[13],[1,"\\n channel."],[13],[1,"\\n "],[10,"h2"],[14,1,"engines-roadmap"],[12],[1,"Engines Roadmap"],[13],[1,"\\n "],[10,2],[12],[1,"Ember Engines are currently pre-1.0 software and under active development. Check out our\\n "],[10,3],[14,6,"https://discuss.emberjs.com/t/engines-1-0-roadmap/14914"],[12],[1,"roadmap to 1.0"],[13],[1,"."],[13],[1,"\\n "],[10,"h2"],[14,1,"additional-resources"],[12],[1,"Additional Resources"],[13],[1,"\\n "],[10,"ul"],[12],[1,"\\n "],[10,"li"],[12],[10,3],[14,6,"https://github.com/ember-engines/ember-engines"],[12],[1,"Ember Engines on GitHub"],[13],[13],[1,"\\n "],[10,"li"],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/10"],[12],[1,"Engines RFC"],[13],[13],[1,"\\n "],[10,"li"],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/122"],[12],[1,"Engine Linking RFC"],[13],[13],[1,"\\n "],[10,"li"],[12],[10,3],[14,6,"https://github.com/ember-engines/ember-asset-loader"],[12],[1,"Ember Asset Loader on GitHub"],[13],[13],[1,"\\n "],[10,"li"],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/153"],[12],[1,"Asset Manifest RFC"],[13],[13],[1,"\\n "],[10,"li"],[12],[10,3],[14,6,"https://github.com/emberjs/rfcs/pull/158"],[12],[1,"Asset Loader Service RFC"],[13],[13],[1,"\\n "],[13],[1,"\\n "],[10,2],[12],[10,"em"],[12],[1,"Note: this guide is accurate as of the 0.8.x release of ember-engines"],[13],[1,"."],[13],[1,"\\n\\n "],[10,0],[14,0,"docs-my-16 docs-text-right"],[12],[1,"\\n "],[8,[39,4],[[24,0,"docs-bg-grey-darkest hover:
78docs-bg-black docs-text-white docs-py-2 docs-px-4 docs-no-underline docs-rounded"]],[["@route"],["docs"]],[["default"],[[[[1,"\\n Read the docs â\\n "]],[]]]]],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"],[13]],["&default"],["div","h1","span","p","link-to","yield","section","aside","docs-link","a","code","h2","ul","li","em"]]',moduleName:"dummy/templates/index.hbs",isStrictMode:!1})}),define("dummy/templates/not-found",["exports","@ember/template-factory"],function(e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 79e.default=(0,n.createTemplateFactory)({id:"99S+dN/n",block:'[[[10,0],[14,0,"docs-container"],[12],[1,"\\n "],[10,"h1"],[12],[1,"Not found"],[13],[1,"\\n "],[10,2],[12],[1,"This page doesn\'t exist. "],[8,[39,3],null,[["@route"],["index"]],[["default"],[[[[1,"Head home?"]],[]]]]],[13],[1,"\\n"],[13]],[],["div","h1","p","link-to"]]',moduleName:"dummy/templates/not-found.hbs",isStrictMode:!1})}),define("dummy/transforms/boolean",["exports","@ember/debug","@ember-data/serializer/transform"],function(e,n,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 80class o extends t.BooleanTransform{constructor(...e){super(...e)}}e.default=o}),define("dummy/transforms/date",["exports","@ember/debug","@ember-data/serializer/transform"],function(e,n,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 81class o extends t.DateTransform{constructor(...e){super(...e)}}e.default=o}),define("dummy/transforms/number",["exports","@ember/debug","@ember-data/serializer/transform"],function(e,n,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 82class o extends t.NumberTransform{constructor(...e){super(...e)}}e.default=o}),define("dummy/transforms/string",["exports","@ember/debug","@ember-data/serializer/transform"],function(e,n,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 83class o extends t.StringTransform{constructor(...e){super(...e)}}e.default=o}),define("dummy/config/environment",[],function(){try{var e="dummy/config/environment",n=document.querySelector('meta[name="'+e+'"]').getAttribute("content"),t={default:JSON.parse(decodeURIComponent(n))} 84return Object.defineProperty(t,"__esModule",{value:!0}),t}catch(o){throw new Error('Could not read config from meta tag with name "'+e+'".')}}),runningTests||require("dummy/app").default.create({})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.