FormidableLabs / builder-react-app

A React app archetype for builder
5 stars 4 forks source link

Move all client, server, etc sources to `src` directory #3

Open zachhale opened 8 years ago

zachhale commented 8 years ago

/cc @baer

ryan-roemer commented 8 years ago

@zachhale @baer -- What's the reasoning behind the move? client/ and server/ are pretty standard. src/ usually means client-side only for a react component.

zachhale commented 8 years ago

While reviewing with @baer he made a good point about code organization and I agreed that moving server/, client/ and templates/ to src/ would be good idea for code organization to keep the root clean.

ryan-roemer commented 8 years ago

Hmm... OK. Just so long as we're not transpiling src/server :wink:

baer commented 8 years ago

@ryan-roemer @zachhale

There is no real standard that I've seen across webservers much less between universal javascript applications. Hapi has client, server express has lib, public and other webservers have other things depending on their community. This is inconsistency is magnified when you look across the github landscape of universal javascript applications. Here are a few to give you a sense of it:

Unless you have some exceptionally strong evidence to the contrary I think we should discuss the merit of the PR as it stands.


Why you might want to have a src directory:

  1. You have things at the project root that exist at differing levels of abstraction. The test directory is a parent containing a number of different test targets but the source directories have no such parent. Ideally each directory level contains packages at the same level of abstraction.
  2. There is reason to believe that any given application may evolve to have multiple "targets" (Web, Android, iOS, Electron) which would clutter the structure of the application in it's current form.
  3. We are not alone in thinking about the problem - it would be helpful to have a look at how very thoughtful groups of people have done this in the past:
    • ember - has app and test
    • ruby - has app and public
    • Java - uses src/main and src/test