Comments (9)
We are going to work on v2 of MERN starting today. I've put up a discussion thread for the roadmap of v2 at #146. I've put things which were discussed here in that thread. We can continue the discussion there.
from mern-starter.
Thanks a lot @timomeh for your feedback, we will look into it and make relevant changes!
from mern-starter.
Sweet! Some of my proposals are big changes which need to be discussed, so I don't want to simply open a pull request. But if I can help, I'd be glad to help!
from mern-starter.
About the 3rd point, it should be great to use a directory structure, with index.js files in it.
For example, in the redux
directory, there should be a actions
directory, a constants
directory... with at the root of each one an index.js
. So that a simple import { action1, action2 } from '../actions'
, or import * from '../constants'
would work.
The same principle could be adapted for components. Each component could be in a directory (named after the component), with inside a index.jsx
file.
from mern-starter.
Is a dedicated directory for actions and constants really necessary? A actions.js
and constants.js
in no dedicated directory fulfills the same goal, without having a directory with a single file in it.
from mern-starter.
Sure thing.
Maybe a directory could allow to have multiple files (for huge apps, where constants or actions should be splitted), and all these files could be exported into the index.js file.
But for a boilerplate, maybe only a file, and not a directory, is enough.
from mern-starter.
This could also be a good way to "force users to structure their app". No one likes refactoring. π
For example, constants.js
is just a list of constants. You won't have a few hundred lines of constants, so a single file is enough.
But all actions in a single file would get very messy as your app grows. Separating actions into multiple files (actions/PostAction.js
, ...) and a re-exporting actions/index.js
is nice for both small and growing apps.
This could also be helpful for reducers. Maybe together with redux's combineReducers
(or its more verbose VanillaJS-equivalent).
from mern-starter.
@timomeh @sylvainlap We definitely need to put actions in multiple files and use combineReducers
, also I think some people like to keep constants for different parts of their app like say admin
or users
in different constant files thus dedicated directories for them doesn't sound like an awful idea to me. π
from mern-starter.
What about 1st and 2nd points? I think that after implementation of this improvements + different directory structure MERN source code would be absolutely identical to react-redux-universal-hot-example. The only different is MongoDB present.
from mern-starter.
Related Issues (20)
- Problem with production mode in server HOT 2
- TypeError: Cannot read property 'table' of undefined HOT 1
- postcss-cssnext is technically deprecated HOT 1
- Upgrading to webpack 4 breaks the mern-starter HOT 1
- Error importing header / footer background image HOT 4
- Deploying the app using PM2 in EC2 HOT 3
- this.props.history is undefined Trying to access history object HOT 2
- Website is lacking pictures HOT 1
- Upgrade to React Router (MERN 2.6) HOT 6
- Add provision for code-splitting as required
- Can't resolve DNS host HOT 2
- The images on mern.io requested from res.cloudinary.com are resulting in 401 errors (and thus aren't successfully loading)
- Error comment in scss file HOT 1
- How to integrate Reactstrap into mern-starter HOT 4
- Code execution continues when it should stop in POST action HOT 1
- 3.0ε₯ζΆεε₯½ε’οΌζ们ηηι»ηθι½εδΊοΌ HOT 2
- RESTful MERN in Typescript - A new project other than this one
- MSBuild.exe` failed with exit code: 1
- Grammatical error on Twitter redirecting text π
- Alternative to this repo : Mern Starter Project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mern-starter.