0
votes

I have a 'core' Ember application that needs to be able to be extended by 'child' Ember apps. In Ember 0.10, this was achieved by heavily modding grunt tasks, but Ember 2 appears to have a possible workflow for this built in.

A super high level summary of my current (and target) setup:

  • core-application ('core')
    • contains shared business logic across All apps + templates and components
  • plugins
    • shared templates and logic that can be reused across apps (but not needed by all)
  • application
    • is composed of elements from core-application, plugins, + any app specific code. a note that routes should be able to be 'pulled in' from 'core'

In the current Ember 0.10 app structure, this has worked by modifying grunt tasks to build the apps in a quick, fairly fool-proof way.

Now, in Ember 2, it appears that this sort of pathway for app development is provided by using addons and blueprints. I suspect my 'core' app should become a 'blueprint' and plugins could be either an 'addon' OR 'blueprint' based on what is required by them. I'm writing proof of concept code now, but I have the following questions:

  1. what does the --blueprint flag for the ember addon command do? I see that it essentially generates an app structure, but I don't see any realy documentation regarding where to go from there. This appears to to be what I want to use for my 'core' app, but the documentation is lacking here.
  2. If the above --blueprint flag isn't what I want for this kind of set up, is there a better approach I should be considering?
  3. Any other info regarding the above that folk with greater Ember 2 + ember-cli experience than I have can share on this would be hugely helpful.

Thanks in advance for any all feedback.

1
Sounds to me like you need components and services. Package them together depending on purpose as stand alone add-ons and include them as you need.NicholasJohn16

1 Answers

0
votes

I found my answer by digging around existing Ember community addons.

The ember admin project seems to outline the structure AND consumption of an Ember addon that essentially creates an Ember app complete with routes and overridable/extendable elements.

The Host application then 'mounts' the admin addon by importing the admin addon's routes to the host application's routes and BOOM things work as expected. I've been able to write POC code to prove this concept works for my needs.