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

Doesn't work with pod structure #18

Closed
elbeezi opened this issue Sep 8, 2015 · 3 comments
Closed

Doesn't work with pod structure #18

elbeezi opened this issue Sep 8, 2015 · 3 comments

Comments

@elbeezi
Copy link

elbeezi commented Sep 8, 2015

e.g., switching component view from template.hbs via hotkey will open template.js (even if there's no such file)

@mariusandra
Copy link
Collaborator

Hey,

I don't use the pod structure myself. That's probably why I desperately wanted a hotkey in the first place to navigate between all the folders.

So please walk me through how it works and what should happen. Googling around I see that the directory structure should look something like this:

app/taco/controller.js
app/taco/route.js
app/taco/model.js
app/taco/template.hbs

Is there only "controller.js" in a pod structure or can there also be a "component.js"? Are there any other files that can be in the pod?

So basically CTRL+ALT+E should then toggle between controller.js and template.hbs, correct?
And CTRL+ALT+R between controller.js and route.js?

@elbeezi
Copy link
Author

elbeezi commented Sep 9, 2015

Unfortunately it's a bit more complicated than that, especially since there isn't a single source of truth for application-wide pod structure. By default (in ember-cli 1.13.8), all pod-enabled blueprints will generate into {model-name}/{filename}, regardless of type. However, people currently seem to use different strategies for separating models, routes, and components. For example, I tend to split up my pods in the following way (adopted & adapted from this ember-cli issue comment):

/app
|_helpers/
|_components/
        |_ myComponent/
            |_ component.js
            |_ template.hbs
|_initializers/
|_models
    |_foo/
        |_adapter.js
        |_serializer.js
        |_model.js
|_ myRoute
    |_ route.js
    |_ controller.js
    |_ template.hbs
|_ utils/

Also note that there may be significant changes to this pattern when routable components land.

@mariusandra
Copy link
Collaborator

Hey, unfortunately I haven't found time to work on this since the issue was opened. If you still need this, feel free to hack on the component and send a PR. :)

Closing for now, will reopen if needed.

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

No branches or pull requests

2 participants