You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have started out with in-repo engines, which were really easy to setup and get started.
Now, I wanted to use the lazy loading feature, so I migrated them to dedicated addons. However, it turned out that wasn't as straight-forward as I imagined it to be. So I figured the things I "missed" there could also be missed by others, so they might as well go into the README. I'll make a PR with the information I gathered, but wanted to verify a few things so that the information I write there is correct ;)
All dependencies of the host app need to go into the engine's devDependencies
All dependencies of the engine need to go into the engine's dependencies
a.) Everything in the dependencies will be included in the lazy loaded bundle
b.) Nested dependencies do not work correctly. For example, if an engine has a dependency A, which itself has the dependency "ember-d3" (which loads D3.js), then D3.js will not be correctly loaded in the engine. Instead, you need to also include ember-d3 as dependency of your engine.
c.) Remove the ember-disable-prototype-extensions addon from the engine
"ember-engines" should additionally to devDependencies, also go into "peerDependencies"
The engine's dummy app should be setup like the host app
A related question is, if we need to include ember-data as a dependency of the engine if we pass the store as a dependent service. I tried to remove it but ran into weird errors.
I have started out with in-repo engines, which were really easy to setup and get started.
Now, I wanted to use the lazy loading feature, so I migrated them to dedicated addons. However, it turned out that wasn't as straight-forward as I imagined it to be. So I figured the things I "missed" there could also be missed by others, so they might as well go into the README. I'll make a PR with the information I gathered, but wanted to verify a few things so that the information I write there is correct ;)
All dependencies of the host app need to go into the engine's devDependencies
All dependencies of the engine need to go into the engine's dependencies
a.) Everything in the dependencies will be included in the lazy loaded bundle
b.) Nested dependencies do not work correctly. For example, if an engine has a dependency A, which itself has the dependency "ember-d3" (which loads D3.js), then D3.js will not be correctly loaded in the engine. Instead, you need to also include ember-d3 as dependency of your engine.
c.) Remove the ember-disable-prototype-extensions addon from the engine
"ember-engines" should additionally to devDependencies, also go into "peerDependencies"
The engine's dummy app should be setup like the host app
(Moved from ember-engines/ember-engines#307)
The text was updated successfully, but these errors were encountered: