Skip to content

Refactor folder structure: move components into app #447

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

Merged
merged 6 commits into from
Mar 27, 2015
Merged

Refactor folder structure: move components into app #447

merged 6 commits into from
Mar 27, 2015

Conversation

zckrs
Copy link
Collaborator

@zckrs zckrs commented Mar 25, 2015

After a careful review of https://google-styleguide.googlecode.com/svn/trunk/angularjs-google-style.html and https://docs.google.com/document/d/1XXMvReO8-Awi1EZXAXS4PzDzdNvV6pGcuaF4Q9821Es/pub I move the components folder in app.

As mentioned in these docs:

Components

  • A components directory contains directives, services, filters, and related files.
  • Common data (images, models, utility files, etc.) might also live under components (e.g. components/lib/), OR it can be stored externally.
  • Components can have subcomponent directories, including appended naming where possible.
  • Components may contain module definitions, if appropriate.

Sub-sections (like our main folder)

  • These top-level (or nested) directories contains only templates (.html, .css), controllers, and module definitions.
  • We stamp out sub-level child sub-sections using the same unit template (i.e., a section is made up of templates, controllers, and module definitions), going deeper and deeper as needed to reflect the inheritance of elements in the UI.
  • For a very simple app, with just one controller, sub-section directories might not be needed, since everything is defined in the top-level files.
  • Sub-sections may or may not have their own modules, depending on how complex the code is.

This PR should fix #272

@zckrs zckrs mentioned this pull request Mar 25, 2015
@Swiip
Copy link
Owner

Swiip commented Mar 26, 2015

👍 👍

I was thinking if maybe the simplification of globs pattern could simplify the karma process but no. We still need to pass the globs through gulp in order to apply the sorts we need.

About the debate on the need of the app folder, to be honest, I don't care very much. It's nothing more than a additional folder targeting more classifying. For big project, it could be better but there is no absolute answer.

@e-oz
Copy link

e-oz commented May 26, 2015

I hate this change. It will learn users to think that components (services, directives) are parts of their current app and they can use other parts of app inside components. And their components will not be reusable anymore.
Before this change this generator was example of perfect folders structure and I have been always recommend this generator as best of existing. With this change I understand I can't recommend it, because I don't have moral right to learn users create non-reusable components.

@zckrs zckrs deleted the refactor-folder-struct branch September 9, 2015 07:45
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.

App Folder Structure
3 participants