Hashnode / mern-starter

⛔️ DEPRECATED - Boilerplate for getting started with MERN stack
MIT License
5.15k stars 1.18k forks source link

MERN V2 #146

Closed somus closed 8 years ago

somus commented 8 years ago

For the past few weeks, we were busy with the development of Hashnode. That's why couldn't give more time to MERN. We are sorry for those pending issues and pull requests. We will close those issues ASAP.

In upcoming weeks, we are planning to release the next version of MERN. This is a discussion thread for what should go in MERN v2. I'm adding a rough list of things what we think would be a great addition to MERN. If you think something should not be there or something else should be there, feel free to comment.

Note: I'll be creating a v2 branch, please make all future PRs against that branch.

carloscuatin commented 8 years ago

great was waiting for this to start contributing to this great project 👍

carloscuatin commented 8 years ago

@somus create branch ? v2.0.0 ?

joernroeder commented 8 years ago

One thing I'm currently missing are server-to-server api calls with credentials (cookies) set. I was working on a form with presaved state which wasn't possible on the server and I ended up using an additional request on the client only.

somus commented 8 years ago

@carloscuatin Created.

SOSANA commented 8 years ago

@somus can we assign @weslleyaraujo for implementation of postCSS? as mentioned in #89

SOSANA commented 8 years ago

@carloscuatin you been assigned anything yet?

carloscuatin commented 8 years ago

@SOSANA I'm working on changing the test runner and possibly add react-intl

carloscuatin commented 8 years ago

although I think the first thing that will work is the file structure so that is not so difficult to add new updates, we agree that the final structure is proposed by @somus in #90 ?

somus commented 8 years ago

@SOSANA Definitely. I'm not sure whether to have SASS only or PostCSS only or both with CSS Modules. PostCSS looks like a good option. I'm leaning towards pre-processing with SASS and post-processing with PostCSS. @SOSANA @carloscuatin @weslleyaraujo @Ajar-Ajar @evansendra @raksonibs what do you think?

@evansendra and @raksonibs have done a great job in implementing scss in #50 and #81. But, I think we should import and process scss using webpack. For isomorphic support, as I mentioned above webpack isomorphic tools looks like a good option.

@carloscuatin You are right. We should first implement the file structure changes. If the option which I proposed in #90 looks good, I'll get on with implementing it. After that, we can target rest of the features in the list.

somus commented 8 years ago

@joernroeder You can use something like express session middleware to preserve data on the server side. would this solve your problem?

carloscuatin commented 8 years ago

@somus I'm moving in the file structure

carloscuatin commented 8 years ago

add react-hot-loader version 3 ?

carloscuatin commented 8 years ago

merged in branch v2.0.0 no ?

joernroeder commented 8 years ago

@somus yes, i'm using the session middleware right now, the main problem was forwarding the requests from the client to the api route during server-side rendering. Imagine the following example: A client with an active session (logged in) requests an api endpoint directly, sends it's stored session via fetch with cookies enabled, the middleware on the server connects the request to the session and responds accordingly. In contrast to the direct client side request is the server the initiator of the fetch request during ss-rendering and the cookie value needs to be forwarded from the client-->server to the server-->server request.

The https://github.com/erikras/react-redux-universal-hot-example claims that:

Both client and server make calls to load data from separate API server

but i had no the time to check it out yet…

osenvosem commented 8 years ago

Change state management library from Redux to MobX which is much simpler, intuitive and faster. Demands less boilerplate and code. cfhtqs-wwaazkkw

somus commented 8 years ago

@osenvosem Thanks for the suggestion. :) I've been hearing good things about MobX. We even had an AMA with MobX creator at Hashnode. But, it introduces a couple of new concepts and I'm not sure whether it will be beginner friendly. But, we are planning to make mern-cli clone different versions of mern-starter (more details at Hashnode/mern-cli#10). In future, we can fit in a version with MobX there.

osenvosem commented 8 years ago

@somus actually MobX is more beginner friendly than Redux (which is more complicated). You mark your state as @observable, you mark react component as @observer and that's it. With Redux (and several mandatory libs with it) beginners must learn and write much more.

weslleyaraujo commented 8 years ago

@osenvosem I am quite new to MobX, would it play nice with server side render as well?

good suggestion 💪

osenvosem commented 8 years ago

@weslleyaraujo I haven't had a need in that yet, but I saw a couple examples of SSR here on github. For example

ischyrus commented 8 years ago

Getting code coverage configured and installed as part of the package.

SOSANA commented 8 years ago

@osenvosem, open an issue to discuss Mobx so we can keep the discussion and topics related to mern v2

hounded commented 8 years ago

could it be possible to adapt the Ducks methodolgy so that way we can bundle up the functionality we are creating therefore having some kind of module system that would allow the community to develop modules for the mern stack?

YarivGilad commented 8 years ago

Any plans to add authentication? passport, tokens, social OAuth, the real thing... I think it's pretty basic... every application needs one, and it's not trivial how to set it up in Mern...

somus commented 8 years ago

@Ajar-Ajar There are a lot of ways to include auth. There is no single universal way to do it. We don't want to add one single method in mern-starter. That's why we are going to make mern-cli clone variants of mern. One of the variants can have social auth, and other can have jwt auth. Through this way, the possibilities are infinite. We are looking to modify mern-cli with this week to make it possible.

YarivGilad commented 8 years ago

Sounds exciting!!! looking forward to see it in action :)

mayankchd commented 8 years ago

Tree shaking and code splitting with react-router is super super cool!

koshuang commented 8 years ago

Good job for you guys. Just wondering if you have any plans about using redux-saga? Thanks!

somus commented 8 years ago

V2 is released. 🎆 📢 🍻 😸 We have also updated mern.io. Check it out.

brandonburkett commented 8 years ago

I know this is closed, but just curious if anyone made or is making a mobx version. I did a mern-cli list but it didn't look like anyone published a variant.