Ember-cli: Module Unification: Blueprints

Created on 2 Jan 2018  路  31Comments  路  Source: ember-cli/ember-cli

馃敿 Part of [QUEST] Module Unification: Final Cut


This issue is part of the Module Unification Quest and will serve as a list of remaining tasks to land blueprint support for module unification apps.

Interested in helping?

Great! Comment on the issue to take on one of these blueprints. They are mostly pretty straightforward, see the service blueprint for example. Anything without a 馃敀 is up for grabs.

If you have any questions, you can ask them in the #st-module-unification channel on the Ember community slack or you can ask me directly @gavinjoyce.

Creating a new module unification app

Install Ember CLI master:

npm install -g https://github.com/ember-cli/ember-cli.git

Generate a new app with the module unification env variables:

MODULE_UNIFICATION=true EMBER_CLI_MODULE_UNIFICATION=true ember new my-mu-app

Generate a component:

EMBER_CLI_MODULE_UNIFICATION=true ember g component x-button

Run the app:

EMBER_CLI_MODULE_UNIFICATION=true ember serve

ember-cli/ember-cli (blueprints):

  • addon-import (not applicable)
  • [x] [MODULE_UNIFICATION=true ember addon my-addon](https://github.com/ember-cli/ember-cli/pull/7658)
  • [x] [MODULE_UNIFICATION=true ember new my-app](https://github.com/ember-cli/ember-cli/pull/7488)
  • ember generate blueprint (not applicable)
  • ember generate http-mock (not applicable)
  • ember generate http-proxy (not applicable)
  • [x] [ember generate in-repo-addon](https://github.com/ember-cli/ember-cli/pull/7783)

    • [ ] remove .jshintrc and .eslintrc (see discussion)

  • ember generate lib
  • ember generate server (not applicable)
  • ember generate vendor-shim (not applicable)

emberjs/ember.js (blueprints):

  • [ ] ember generate acceptance-test
  • [x] [ember generate component](https://github.com/emberjs/ember.js/pull/16043)
  • [x] [ember generate controller](https://github.com/emberjs/ember.js/pull/16656) 馃嵒 @dexturr @kevinansfield
  • [ ] ember generate helper 馃啌 this incomplete PR might help
  • [x] [ember generate initializer](https://github.com/emberjs/ember.js/pull/16489) 馃敀@sduquej
  • [ ] ember generate instance-initializer 馃啌 this incomplete PR might help
  • [x] [ember generate mixin](https://github.com/emberjs/ember.js/pull/16524) 馃嵒@jackbeegan
  • [x] [ember generate route](https://github.com/emberjs/ember.js/pull/16663) 馃嵒 @kevinansfield
  • [x] [ember generate service](https://github.com/emberjs/ember.js/pull/16397)
  • [x] [ember generate template](https://github.com/emberjs/ember.js/pull/16651) 馃嵒@Willibaur @pablobm
  • [x] [ember generate util](https://github.com/emberjs/ember.js/pull/16490) 馃嵒@daibhin

running emberjs blueprint tests

yarn run test:blueprints

emberjs/data (blueprints):

  • [x] [ember generate adapter](https://github.com/emberjs/data/pull/5476) 馃敀 @kevinansfield
  • [x] [ember generate model](https://github.com/emberjs/data/pull/5491) 馃敀@dcyriller
  • [x] [ember generate serializer](https://github.com/emberjs/data/pull/5494) 馃敀@dcyriller
  • [x] [ember generate transform](https://github.com/emberjs/data/pull/5495) 馃敀@dcyriller

other items

  • [ ] replace {{welcome-page}} addon with component example

    • [x] remove bower and user ember canary in package.json (https://github.com/ember-cli/ember-cli/pull/7533)

    • [ ] support init command (and any other commands which MU affects)

    • [ ] reduce the duplication between classic and MU blueprints @ro0gr (WIP https://github.com/ember-cli/ember-cli/pull/7595)

    • [x] create a mini module unification blueprint quest issue (once we've migrated a few)

    • [ ] document new blueprint usage

    • [ ] [don't use ember-resolver/resolvers/fallback resolver by default](https://github.com/ember-cli/ember-cli/pull/7531)

    • [ ] fix travis-ci build failure on app output (config/environment.js : 51:37 error Empty block statement no-empty)

    • [x] [allow MU app/addon to be created using ember-cli-blueprint-test-helpers and emberNew](https://github.com/ember-cli/ember-cli-blueprint-test-helpers/pull/153) (we currently just create an empty src directory, which means we have to do things like this) 馃敀@dcyriller

    • [ ] ...

Most helpful comment

@GavinJoyce Please, could you update the task list status.

ember-cli/ember-cli

  • [x] MODULE_UNIFICATION=true ember new my-app

    • [x] [Generate tests/acceptance folder](https://github.com/ember-cli/ember-cli/pull/8194)
  • [x] [remove .jshintrc and .eslintrc](https://github.com/ember-cli/ember-cli/pull/8179)

emberjs

  • [x] [ember generate acceptance-test](https://github.com/emberjs/ember.js/pull/17209)
  • [x] [ember generate helper](https://github.com/emberjs/ember.js/pull/17211)
  • [x] [ember generate instance-initializer](https://github.com/emberjs/ember.js/pull/17235)

other items

  • [x] replace {{welcome-page}} addon with component example. It may be removed based on the #8139 discussion.

  • [x] [adds tests for the --no-welcome option of the new MU app](https://github.com/ember-cli/ember-cli/pull/8195)

All 31 comments

I submitted https://github.com/ember-cli/ember-cli/pull/7533 to tackle:

remove bower and user ember canary in package.json

Should we have a ember-new-module-unification-output repo also?

I've started working on

reduce the duplication between classic and MU blueprints

I think the first necessary step is to improve testing of the new and addon command output https://github.com/ember-cli/ember-cli/pull/7557

Hey! I'll take the mixin blueprint!

I'm taking a stab at the routes blueprint :)

I've made a start on the Ember Data adapter blueprint, I'll try and get that finished off tonight

Hello! I just did the model blueprint https://github.com/emberjs/data/pull/5491 (based on @kevinansfield 's https://github.com/emberjs/data/pull/5476)

@GavinJoyce acceptance blueprint should remain unchanged according to MU RFC or am I wrong?

@dcyriller hey, sorry I haven't had time to look into your PR yet. I have little time this week to work on OS, if no one else has reviewed your PR or answered your question by then I'll get to it early next week when I have more time.

acceptance blueprint should remain unchanged according to MU RFC or am I wrong?

I don't have the answer of the top of my head, perhaps you could ask in the #st-module-unification slack channel?

@thoov and I discovered today that there is poor testing interop between old world and new world blueprints due to the inability to configure the state of the EMBER_CLI_MODULE_UNIFICATION feature flag for the test. We had to skip the adapter tests for MU due to this. We propose something like the following being possible:

emberNew({
   cliOptions: {
     EMBER_CLI_MODULE_UNIFICATION: true
   }
});

cc @GavinJoyce @rwjblue

@GavinJoyce may you update the emberjs/data part with a 馃敀?

Also some work is in progress on ember-cli test helpers https://github.com/ember-cli/ember-cli-blueprint-test-helpers/pull/153

@dcyriller sure, what needs to be updated? (I've been busy on other projects so haven't been following MU progress)

Thanks :)

A 馃敀 should be added on ember-data blueprints. @NullVoxPopuli do you agree we should keep the PRs https://github.com/emberjs/data/pull/5491, https://github.com/emberjs/data/pull/5494, https://github.com/emberjs/data/pull/5542 (as they contain tests)?

The last item allow MU app/addon to be created using ember-cli-blueprint-test-helpers and emberNew (we currently just create an empty src directory, which means we have to do things like this) is also in progress (ember-cli/ember-cli-blueprint-test-helpers#153).

@dcyriller yeah, your code is pretty much the same as mine, but yours has tests.

@dcyriller updated, nice one for taking these on!

the ember-data blueprints look like they're all implemented. (just confirmed they all work)

Nice work @dcyriller! I've updated the todo list

Thank you @GavinJoyce! You can also tick the last item (the blueprint thing) which is merged. :)

replace {{welcome-page}} addon with component example

@GavinJoyce what exactly is the requirement here? I can work on this if no one is working on it already. Is the plan to remove ember-welcome-page addon from package ? If so, should it be removed for the regular app structure as well? If not, the --no-welcome flag's description in the help sections need to be changed accordingly, for ex: It could be "Install and uses {{ember-welcome-page}}..." for regular app structure and it could be "Creates {{welcome-page}} component..." for MU based apps. What is the stance on this?

@abhilashlr I seem to recall that @locks was proposing that we implement a welcome-page component in the blueprint, possibly so that there is an example component in the app. @locks, perhaps you recall and can confirm?

Can we have two blueprints instead? One for beginners, that has two routes and a component on one of them and one for people that are already familiar with ember, they receive a blank ember setup to get started right away? I can put a screenshot from ember-cli-create later that gives makes this one more understandable from a consumers pov.

@gossi ember new my-project --no-welcome is already that, is it not?

@GavinJoyce Confirm! Due to isolated nature of pods, I think it is a better experience to have a folder that you can inspect the code of and tweak and see, than a "magic" welcome-page component that is injected.

@locks true but I think we can do better by offering two blueprints instead: ember new my-project -b beginner-app (with route and component) and ember new my-project -b regular-app (blank app) I made passing the blueprint explicit in this scenario. Should be handled by cli instead, like I do in ember-cli-create. Can provide a screenshot in the evening.

@GavinJoyce @Turbo87 @locks Here it is for removal of ember-welcome-page and using in app component generation: https://github.com/ember-cli/ember-cli/pull/8139

remove .jshintrc and .eslintrc -> #8179

Next, I will try to complete the helper and instance-initializer generators.

acceptance-test -> emberjs/ember.js#17209

8194 stops adding tests/{unit,integration} folders on the ember new blueprint (#7488)

8195 adds tests for the --no-welcome option of thenew MU app blueprint.

I think, replace {{welcome-page}} addon with component example can be removed from the list. Read the #8139 discussion.

ember generate helper -> emberjs/ember.js#17211

@GavinJoyce Please, could you update the task list status.

ember-cli/ember-cli

  • [x] MODULE_UNIFICATION=true ember new my-app

    • [x] [Generate tests/acceptance folder](https://github.com/ember-cli/ember-cli/pull/8194)
  • [x] [remove .jshintrc and .eslintrc](https://github.com/ember-cli/ember-cli/pull/8179)

emberjs

  • [x] [ember generate acceptance-test](https://github.com/emberjs/ember.js/pull/17209)
  • [x] [ember generate helper](https://github.com/emberjs/ember.js/pull/17211)
  • [x] [ember generate instance-initializer](https://github.com/emberjs/ember.js/pull/17235)

other items

  • [x] replace {{welcome-page}} addon with component example. It may be removed based on the #8139 discussion.

  • [x] [adds tests for the --no-welcome option of the new MU app](https://github.com/ember-cli/ember-cli/pull/8195)

Was this page helpful?
0 / 5 - 0 ratings