Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config property to use pods as default structure. #2514

Merged
merged 1 commit into from
Nov 18, 2014

Conversation

trabus
Copy link
Contributor

@trabus trabus commented Nov 18, 2014

This PR adds a config property that inverts the meaning of the --pod flag. Current working name is usePodsByDefault, but the name is less important than the functionality. The basic result is that we no longer need to use --pod when generating and destroying blueprints.

// with `config.usePodsByDefault` set to true
// defaults to pod structure
ember g route taco
version: 0.1.2
installing
  create app/taco/route.js
  create app/taco/template.hbs
installing
  create tests/unit/routes/taco-test.js

// use `--pod` flag for type structure
ember g route taco --pod
version: 0.1.2
installing
  create app/routes/taco.js
  create app/templates/taco.hbs
installing
  create tests/unit/routes/taco-test.js

In blueprint install and uninstall, we check for the config property and return the inverse if usePodsByDefault is true.

I still need to write a couple tests, but I wanted to put this up in case there were objections or suggestions on the property name. I also wanted to make sure this was the right way to go about the change, since it does seem like it could lead to some confusion if someone wasn't aware of the config property and it was set somehow.

I was also wondering if the value should be added to the app blueprint config, set to false by default.

stefanpenner added a commit that referenced this pull request Nov 18, 2014
Add config property to use pods as default structure.
@stefanpenner stefanpenner merged commit aecd06f into ember-cli:master Nov 18, 2014
@trabus
Copy link
Contributor Author

trabus commented Nov 18, 2014

I will add some documentation for this tonight.

@stefanpenner
Copy link
Contributor

@trabus :)

@trabus trabus mentioned this pull request Dec 3, 2014
8 tasks
@leandrocp
Copy link
Contributor

👌 for property name.

But I dont think inverting --pod is a good idea. I'd expect --pod to create the pod structure, with ou without usePodsByDefault.

My suggestion is print an informative message for the user.

@trabus
Copy link
Contributor Author

trabus commented Dec 5, 2014

I agree that it's not super intuitive, but if you're using pods, you generally won't need to generate in the classic format. This was really just intended to be a stopgap until pods become the default format.

@leandrocp
Copy link
Contributor

@trabus this PR should be a TODO item on issue #2646

Why not make ember new --pod set usePodsByDefault = true ? It´s an easy way to set pods by default and also turn it off when you dont need anymore.

@trabus
Copy link
Contributor Author

trabus commented Dec 5, 2014

There's actually already an issue regarding what to do with usePodsByDefault.

Currently, you have to go out of your way to set the config value, otherwise it's ignored and everything works as it always has. And it only affects the generate and destroy commands, as it was primarily added to allow apps that already use pods to not require the --pod flag when generating new blueprints.

Again, I agree that it's not very intuitive, but it was the quickest, least invasive way to relieve a painpoint that was affecting some users. We will be doing it the right way in the near future.

@leandrocp
Copy link
Contributor

@trabus good to know about #2652 thanks! I´ll watch both issues.

@trabus trabus deleted the default-pods branch January 21, 2015 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants