How to write and use a helper in a module unification app?

I’m using ember-cli 3.4.0-beta.1

In a module unification app, when I use a generator to create a helper, it puts it in the old, non-module-unification app/helpers directory:

installing helper
  create app/helpers/myhelper.js
installing helper-test
  create tests/integration/helpers/myhelper-test.js

I also tried manually creating the file src/ui/components/myhelper.js (this is what I gathered it should be from reading the RFC) with the following contents:

import { helper } from '@ember/component/helper';

export function myhelper(/* params, hash*/) {
  return 'stuff';

export default helper(myhelper);

Then, in my template I call the helper as {{myhelper}}. This all builds, but in the browser it gives me the following error:

Uncaught Error: Compile Error: myhelper is not a helper.

Is module unification not implemented yet for helpers, or am I doing something wrong? What is the right way to make a module-unification-style helper?



The problem with the blueprint is likely fixed with a more recent ember-source version [WIP] [Feature] helper blueprint for module unification · emberjs/ember.js@cf0c5b4 · GitHub

If you want to use MU, you should use the latest ember-cli which includes the latest MU changes. Generating an MU app sets your ember-source dependency to the latest Ember canary version whose blueprints are up-to-date.

Related Upgrade `ember-source` for MU new blueprints by ppcano · Pull Request #8317 · ember-cli/ember-cli · GitHub

EMBER_CLI_MODULE_UNIFICATION=true ember g helper myhelper
installing helper
  create src/ui/components/myhelper.js
installing helper-test
  create src/ui/components/myhelper-test.js

Please, let us know if something is not working when using the latest versions.