Skip to content

redundant file naming #12

Open
Open

Description

@Nemo64

This is more a question! If I create the scaffold for person i'll have this folder structure:

client/controllers/person
client/controllers/person/person_index.js
client/views/person
client/views/person/person_index
client/views/person/person_index/person_index.html
client/views/person/person_index/person_index.js
client/views/person/person_index/person_index.css

Isn't that person_index kind of redundant if it is in a folder called person? I know that the template must be called PersonIndex because of missing namespaces, but the folder and file names seem wrong to me. Am I missing something?

Activity

  1. added this to the Ideas and Design milestone on Apr 19, 2014
  2. cmather commented on Apr 19, 2014

    @cmather
    Contributor

    The idea is that a "person" could have multiple views including a list view, details view, etc. So instead of having a bunch of top level folders you could put them under the /person folder. We could probably improve the scheme by discussion and people putting up their ideas.

  3. Nemo64 commented on Apr 19, 2014

    @Nemo64
    Author

    I'm coming from a symfony background and there i'm used to that the views are only index.html.twig, show.html.twig, edit.html.twig and so on inside a folder which is named after the controller.

    client/controllers/person/index.js
    client/controllers/person/show.js
    client/views/person
    client/views/person/index
    client/views/person/index/index.html
    client/views/person/index/index.js
    client/views/person/index/index.css
    client/views/person/show
    client/views/person/show/show.html
    client/views/person/show/show.js
    client/views/person/show/show.css
    

    I don't think that would be as bad.... but it could be a lack of meteor experience there. it's just the first thing i noticed while trying em out. ;)

  4. cmather commented on Apr 19, 2014

    @cmather
    Contributor

    Oh I missed your point entirely. You're saying to remove the person_ prefix. That seems like a reasonable improvement :). Interested in others' feedback too.

  5. Spiralis commented on Apr 20, 2014

    @Spiralis

    @cmather I second that. Of course, the templates need to be named using the folder and the view-name, like @Nemo64 suggests.

  6. zimt28 commented on Apr 21, 2014

    @zimt28

    I like @Nemo64's suggestion, that's the structure I'm used to :)

  7. scottmcpherson commented on Jun 3, 2014

    @scottmcpherson

    This might be another option that would be great to have in the .em/config.json file(devel branch). Maybe something like this?:

    {
      "view": {
        "html": {
          "create": true,
          "extension": ".jade"
        },
        ...
        "scaffold: {
            "folderStructure": "client/views/[resource]/[resource]_index/[resource]_index.*"
        }
      }
    }
    
  8. Nemo64 commented on Nov 18, 2014

    @Nemo64
    Author

    Good point. I use jetbrains ide's which show tabs like this:
    screenshot 2014-11-18 12 03 53
    So I usually don't have that problem but others may.

    I'm actually against making everything configurable as I want to be able to quickly use another project but if everyone uses other convention, it'll become somewhat annoying imo.

  9. Spiralis commented on Dec 11, 2014

    @Spiralis

    I use sublime which also shows extra context in the tabs when needed. So, for me too the change is welcome. I personally don't mind having the configuration option though. I'd rather do the extra config option and have a less "bloated" structure. It helps me keeping the projects and the code "clean" 😄.

  10. rhyslbw commented on Dec 15, 2014

    @rhyslbw

    @DigitalAndre there's a configuration option in WebStorm 'Show directory in editor tabs for non-unique filenames' that solves the ambiguous display.

    +1 for simplifying the filenames. I've actually stopped using the tool since the redundant folder names were making the tree structures hard to read and understand the app

  11. ianserlin commented on Mar 12, 2015

    @ianserlin

    We do it the same as @DigitalAndre and I prefer it that way, even though I have a full paths in my sublime title bar. In sublime the CMD+t search works across directory names so it's not a huge issue however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions