ember-cli-defeatureify icon indicating copy to clipboard operation
ember-cli-defeatureify copied to clipboard

Generate a module instead of using globals.

Open nathanhammond opened this issue 9 years ago • 5 comments

I'd like to move away from inserting feature state as a global inside of app-prefix to make it easier to move to a modules-only world. See: https://github.com/ember-cli/ember-cli/issues/5240

As a result I would want to modify ember-cli-defeatureify to generate a module which could be included into any ember app's module that needs defeatureifying:

import myNamespace from 'ember-cli-defeatureify/config';

The change for any existing users of this addon would be the above mechanical change. Would you accept a PR for this functionality?

nathanhammond avatar Dec 22 '15 00:12 nathanhammond

import 'ember-cli-defeatureify/config' as myNamespace;

I don't believe this is valid syntax.

stefanpenner avatar Dec 22 '15 15:12 stefanpenner

As feature state is entirely static, and it is more configuration related, encoding it as a meta tag and using https://github.com/ember-cli/ember-cli/pull/5233 to insert it as a module seems the best bet.

stefanpenner avatar Dec 22 '15 15:12 stefanpenner

@stefanpenner responding in order:

  1. Totally right, flipped the clauses in that import statement. Corrected inline above.
  2. +1, I agree. How should storing config in meta tags play with https://github.com/tildeio/ember-cli-fastboot/pull/81? Then again, since defeatureify actually removes the code, I don't know that fastboot actually cares. Can @zeppelin chime in here?

nathanhammond avatar Dec 22 '15 15:12 nathanhammond

, I don't know that fastboot actually cares.

I suspect it does.

How should storing config in meta tags play with tildeio/ember-cli-fastboot#81?

ideally by just inserting the given module into the loader an alternative way (arg to the boot process maybe?)

stefanpenner avatar Dec 22 '15 15:12 stefanpenner

@nathanhammond can do, but I have very little knowledge of Ember's boot process (& FastBoot in general). That said, I have to learn more about it at some point, so I'll definitely keep myself in the loop.

zeppelin avatar Dec 23 '15 20:12 zeppelin