Converting Ember addon to ember engine


#1

When converting any Ember addon (say my-custom-app) to an Ember engine, what all things does it loose like ? Meaning since engines are more isolated, does it loose ability to be easily shared e.g. in case of addon, app directory files just get merged. Does the same happen with engines ? Also what about things in addon ?

In short, just wanted to understand what happens in an addon environment V/s an engine environment ?

PS: I am no referring to an in-repo addon here


#2

Well… engines are VERY isolated compared to addons. First, there are two types of engines: routeless and routable.

Routable engines are essentially separate apps. They can share data through services, but they don’t ‘share’ files in the way you describe above (like files getting mixed into an app from an addon). If an engine and an app both need the same stuff (component for example) I believe you’d need to put that component in an addon that they both import. Routable engines can also be given references to app routes so they can transition to them. Routable engines are mounted through the applications router.

Routeless engines have a similar interface to the mounting app, but without the concept of routes. You’d primarily interact with them via a service. We’re using one to render a sidebar component in one of our apps.

Anyway, depending on how your addon worked before there could be a lot of restructuring, or at least consideration you’ll have to give to the separation of concerns and such.


#3

Hi, I have a question to ask. I’m wondering what’s the reason behind to drive you write a engine for a sidebar component? What if instead to write it in application directly? pros and cons?

I always have interests to explore ember-engine, but I never found enough reason to actually take an action.


#4

The main reason to use engines is when you’re part of a large organization with many teams all contributing to one big application. Engines lets each team have their own area that is clearly separated from the others.

Engines are good for that and some companies have a large number of them.

If your app is developed by a small team, engines are probably not very helpful for you. The isolation is good when it matches organizational boundaries, but bad when it doesn’t.