react-webpack-generators / generator-react-webpack

Yeoman generator for ReactJS and Webpack
http://newtriks.com/2013/12/31/automating-react-with-yeoman-and-grunt/
MIT License
2.88k stars 355 forks source link

V4 -- Support organizing an app with PODs #291

Closed sthzg closed 7 years ago

sthzg commented 7 years ago

I borrowed the term from the Ember world, where this kind of structure was pretty common (at the time I was using it) and is supported by ember-cli:

Simply put, pods are a way of grouping files in your project by feature (ex: Task) rather than by type (ex: controllers).

So an app dir might look like this

mycrm
    projects
        components
        routes
        reducers
        ...
    contacts
        components
        routes
        reducers
        ...
    shared
        components
        reducers
        ...
     client.js

As I currently refactor an app to this structure I am missing native generator support (I can create components, but I have to move them and adjust the imports).

I would like to work on an update that during installation prompts the user to choose between the default app structure (the one we have right now) or a pod structure.

There are a few ways about implementation that I have in mind, but before going ahead I'd like to make sure this would be considered a feature worth merging.

As far as the user interface is concerned, I'd plan to have a new sub generator that creates (or deletes) new pods (e.g. yo react-webpack:pod blog), as well as extending the component subgen to support a --pod=<podname> option that would create new components and their tests at the right paths.

sthzg commented 7 years ago

Closed due to inactivity.