Ember-CLI Basics

Ember-cli is truly a world class build tool, and it's more capable and versatile than most people think!

Ember-CLI Basics

Codegen & Commands

Ember-cli's blueprints and command features are incredibly powerful, and are tremendously under-utilized in the ember community. In this unit, we'll explore:

  • How apps (and addons contained therein) can extend ember-cli
  • How arguments passed to ember-cli on the command line make it into your blueprint or command
  • Testing on the node.js side

  • Codegen & CommandsAdding Commands

    Like many modern tools, much of the amazing stuff we appreciate about ember-cli comes from the ability to extend it by way of libraries. We've already looked at how this can be done with broccoli plugins, but we can also change ember-cli's code generation features, and even add brand new commands!

    We'll first look at an addon that adds new commands to ember-cli, and discuss positional and named options, default values, and automatic ember help generation.

  • Codegen & CommandsEXERCISE: A new command

    Add a new command to ember-cli, to broadcast a slack message to a particular channel.

  • Codegen & CommandsBeautiful Blueprints

    We can build our own blueprints for dynamic code generation, and study how options and locals turn our parameterized code templates into code. This underutilized and under-appreciated ember-cli feature has the potential to save you and your team loads of time, and to reduce accidental inconsistencies as well!

  • Codegen & CommandsEXERCISE: Computed property macro blueprint

    Build a blueprint that makes a new computed property in the app/cp folder of your app, using command line arguments to dynamically specify local names (and number) of arguments passed to the macro.

  • Codegen & CommandsTesting Commands and Blueprints

    One of the challenges around building ember addons that are more tool oriented than client-side oriented, is that the existing testing stories that we rely on for our ember app's code won't help us much. We'll outline some strategies for asserting that your blueprints and commands do the things they're supposed to do, and ensure that these tests (in addition to testing your browser-based code) are part of what's run in your CI pipeline.

  • Codegen & CommandsWrap Up & Goodbye

    We'll recap the things we've learned today, and discuss resources for continued research and practice.


Pragmatic

We'll focus most of our time on concepts and tacts that you'll actually use in your app.

Interactive

Nearly 50% of our time will be spent writing code, and putting new knowledge into practice!

Example-Driven

We'll dissect some things you already use and can relate to. No unrealistically-rosy toy examples!