jkarsrud / ember-cli-defeatureify

Ember-CLI addon to defeatureify your apps
MIT License
18 stars 6 forks source link

Generate a module instead of using globals. #15

Open nathanhammond opened 8 years ago

nathanhammond commented 8 years ago

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?

stefanpenner commented 8 years ago

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

I don't believe this is valid syntax.

stefanpenner commented 8 years ago

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.

nathanhammond commented 8 years ago

@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?
stefanpenner commented 8 years ago

, 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?)

zeppelin commented 8 years ago

@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.