vendredi 24 juin 2016

Proper way to compose an application in Ember 2 using custom addons and blueprints

I'm migrating a collection of tools and apps from Ember 0.10 to Ember 2. We have a 'core' application + plugins + multiple apps that are composed using the'core' app and plugins.

A high level summary:

  • core-application ('core')
    • contains basic logic for templates + shared business logic across All apps, including routes
  • 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.




Aucun commentaire:

Enregistrer un commentaire