Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Rename ClientApp to src folder in templates #59

Closed

Description

@laskoviymishka

According to most recent starter kits for modern SPA frameworks client app code usually lies in src folder. Here couple samples
https://github.com/kriasoft/react-starter-kit
https://github.com/AngularClass/angular2-webpack-starter
https://github.com/aurelia/app-contacts

May be it better to rename ClientApp folder to src? Or at least allow to change it in yo generato? (this name use in couple places accross app (index.cshtml, webpack.configs).

Activity

  1. SteveSandersonMS commented on May 2, 2016

    @SteveSandersonMS
    Member

    Good question.

    It doesn't seem necessarily appropriate to use the name src for that, because this project includes both server and client aspects, both of which are "source" files. This is different from the starter kits you've linked to, which are client-only apps (and as such, have no source files besides their React/Angular/Aurelia code).

    We could rename it to ClientSrc but I'm not sure if that's really any better.

    What do you think?

  2. laskoviymishka commented on May 4, 2016

    @laskoviymishka
    ContributorAuthor

    I strongly prefer src folder. I talk to some front-end guys, and they used to see some src or app folder as front app folder. But you are right - this for UI only apps, but for combined it could be difference. ClientSrc is not quite good imho, since it still not proper cased for front-end app. Usualy they have different from .net naming convention for folder. It can be client or may be client-src. The case is pretty serious thing when you tolk about front-end, since it usually builded on linux machines (you know case sensitive folder etc 😰 ). Usually front-end do not use any came case notations for folders.

    In my opinion if there will be such option in yo generator it would be really nice! 🐱

  3. VishalMadhvani commented on Jul 12, 2016

    @VishalMadhvani

    how about wwwroot/src?

  4. chris-herring commented on Jul 13, 2016

    @chris-herring

    Also keep in mind the latest structure for ASP dotnet core solutions in Visual Studio (and possibly other project types?) is to create a src folder that contains all projects under the solution folder. Renaming ClientApp to src would be confusing I think.

  5. Wayne-Mather commented on Jul 13, 2016

    @Wayne-Mather

    @VishalMadhvani - I would prefer the code not to be in wwwroot/src. It would be better for the source be outside the tree as that would be .ts files.

    wwroot/clientapp should contain the emitted es5 code for the browser to consume (or whatever depending on the rules done by the developer to pack the emitted code). The key takeway is the source outside wwwroot and emitted/bundled code inside it.

  6. RobCannon commented on Jul 28, 2016

    @RobCannon

    I would prefer clientsrc. But it definitely needs to be lower case to match javascript developer conventions.

  7. MarkPieszak commented on Jul 28, 2016

    @MarkPieszak
    Contributor

    Typically it would just be named app since that's where the main components / etc are located. Also since it's being server-side rendered it's not "just" a client-side app :)

  8. andreymir commented on Jul 30, 2016

    @andreymir

    I prefer it will not be called just src, since someone will put their HomeController.cs there. It not a good idea to mix *.ts and *.cs files in the same folder.

  9. adilmughal commented on Aug 6, 2016

    @adilmughal

    I have seen some projects, which include both server and client side code, have "src" folder containing "server" and "client".

  10. SteveSandersonMS commented on Sep 29, 2016

    @SteveSandersonMS
    Member

    Based on this discussion, it doesn't look like there will be one particular layout that everyone would consider ideal, so whatever we do will be arbitrary.

    My best recommendation is that you rename ClientApp to whatever you like best in your own project. With this starting point, at least it's easy to rename and then search-replace for any references to the string ClientApp. Also, having a shared starting point for everyone makes the documentation much easier to understand (vs having warnings in every code snippet that you might have chosen a different name).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions