Skip to content
This repository has been archived by the owner on Jun 3, 2019. It is now read-only.

Latest commit

 

History

History
80 lines (55 loc) · 3.41 KB

FEATURE_BRANCHES.md

File metadata and controls

80 lines (55 loc) · 3.41 KB

Feature Branches

Below are a list of extensions to this repository, in the form of branches. Each of them has been tailored to add an individual technology. It is possible to merge multiple branches together in order to create a technology mix that suits your project's needs. We'll detail this workflow after the repository list.

  • apollo - Adds the Apollo Stack (i.e. Graphql).
  • mobx - Adds MobX as a state management library.
  • postcss-sass - Adds PostCSS and SASS.
  • redux-opinionated - Adds an opinionated Redux implementation, using redux-thunk and react-jobs to support data loading across the client/server.

If you would like to add a new feature branch log an issue describing your chosen technology and we can come up with a plan together. :)

An example workflow

Ok, so how do you go about creating a repo that uses a mix mash of these feature branches? Well, say you wanted a combo of apollo and styletron, you could do the following:

NOTE: Merging the yarn.lock file is messy in my opinion. I rather select "merge all" from "theirs" or "ours" and then after the merge I delete the yarn.lock file and run the yarn command to rebuild it properly.

# First clone this repo
git clone https://github.com/ctrlplusb/react-universally my-project

# Go into your project
cd my-project

# Now rename the "origin" git remote to "upstream"
git remote rename origin upstream

# I would then recommend creating a hosted repository for your
# project.

# Then add your newly created repository as the new "origin"
git remote add origin https://github.com/my-github-username/my-project

# Then push the master branch. This will also bind it to new
# "origin" remote.
git push -u origin master

# Ok, so now you need to choose and merge each feature branch.

# -------------------------------------------------------------
# First up, apollo:

# First fetch the latest changes from the upstream
git fetch upstream

# Then merge the apollo branch into your project
git merge upstream/feature/apollo

# Deal with the merge conflicts, delete the yarn.lock file and
# rebuild it, then commit and push.

# -------------------------------------------------------------
# Next, styletron:

# First fetch the latest changes from the upstream
git fetch upstream

# Then merge the styletron branch into your project
git merge upstream/feature/styletron

# Deal with the merge conflicts, delete the yarn.lock file and
# rebuild it, then commit and push.

# --------------------------------------------------------------

# You now have an apollo SSR app with styletron powered styles!

# Any time you want to pull changes from one of the branches
# simply repeat:
git fetch upstream
git merge upstream/feature/FEATURENAME
# deal with conflicts, rebuild yarn.lock, commit, push