Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit b10709f

Browse files
authored
chore: 🔧 merge dev to master before release (#30)
2 parents aba2801 + b93ca66 commit b10709f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+727
-229
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- run: npm run lint
3838
- run: npm run checkTs
3939
- run: npm run test
40-
- run: npm run cleanExampleApp
40+
- run: npm run cleanAndSetup
4141
- run: npm run build
4242
- run: npm run test:generators
4343
- run: npm run lint

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- run: npm run test:generators
2424
- run: npm run lint
2525
- run: npm run checkTs
26-
- run: npm run cleanExampleApp
26+
- run: npm run cleanAndSetup
2727
- run: npm run build
2828
- run: npm run test:generators
2929
- run: npm run lint

.versionrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ module.exports = {
2929
{ type: 'style', section: internalSection, hidden: false },
3030
],
3131
skip: {
32-
commit: true,
32+
changelog: true,
3333
},
3434
};

README.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ with a focus on
1515
<a href="https://github.com/react-boilerplate/react-boilerplate-cra-template/actions?query=workflow%3Atests">
1616
<img src="https://github.com/react-boilerplate/react-boilerplate-cra-template/workflows/test/badge.svg" alt="Tests Status" />
1717
</a>
18+
<a href="https://github.com/react-boilerplate/react-boilerplate-cra-template/actions?query=workflow%release">
19+
<img src="https://github.com/react-boilerplate/react-boilerplate-cra-template/workflows/release/badge.svg" alt="Release Status" />
20+
</a>
1821
<a href="https://coveralls.io/github/react-boilerplate/react-boilerplate-cra-template">
1922
<img src="https://coveralls.io/repos/github/react-boilerplate/react-boilerplate-cra-template/badge.svg?branch=master" alt="Coverage" />
2023
</a>
21-
22-
</a>
2324
</div>
25+
2426
<div align="center">
2527
<a href="https://david-dm.org/react-boilerplate/react-boilerplate-cra-template">
2628
<img src="https://david-dm.org/react-boilerplate/react-boilerplate-cra-template.svg" alt="Dependency Status" />
@@ -31,7 +33,6 @@ with a focus on
3133
<a href="https://opencollective.com/react-boilerplate/">
3234
<img src="https://opencollective.com/react-boilerplate/sponsors/badge.svg" alt="Sponsors" />
3335
</a>
34-
<img src="https://img.shields.io/github/license/react-boilerplate/react-boilerplate-cra-template" alt="License" />
3536
</div>
3637

3738
<br />
@@ -44,29 +45,38 @@ The official [Create React App](https://github.com/facebook/create-react-app) te
4445

4546
Start your `create-react-app` projects in seconds with the best, industry-standard tools and practices made ready for you.
4647

47-
**📝 Documentation:** [Gitbook](https://cansahin.gitbook.io/react-boilerplate-cra-template/)
48+
**📚Documentation:** [Gitbook](https://cansahin.gitbook.io/react-boilerplate-cra-template/)
49+
50+
**🎨 Check the example app:** [Boilerplate Example Application](https://react-boilerplate.github.io/react-boilerplate-cra-template/)
51+
52+
**🚑 Collection of `'HOW TO'`s:** [Examples & Tutorials for common patterns](https://github.com/react-boilerplate/cra-template-examples)
4853

4954
**📦 Package:** [npm](https://www.npmjs.com/package/cra-template-rb)
5055

5156
![version](https://img.shields.io/npm/v/cra-template-rb)
5257
![version](https://img.shields.io/npm/dm/cra-template-rb)
5358

54-
**👁️ Explore the Example Application:** [Example Application](https://react-boilerplate.github.io/react-boilerplate-cra-template/)
55-
5659
---
5760

5861
## Install & Start
5962

63+
Create React App with the template
64+
6065
```shell
61-
# Create React App with the template
6266
npx create-react-app --template cra-template-rb my-app
67+
```
68+
69+
Start and check our example app, if you want
6370

64-
# Check the example app
71+
```shell
6572
cd my-app
6673
npm start
74+
```
75+
76+
Remove the example app to start your project!
6777

68-
# Remove the example app and start your project!
69-
npm run cleanExampleApp
78+
```shell
79+
npm run cleanAndSetup
7080
```
7181

7282
## Features

docs/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030

3131
## Misc
3232

33-
- [Gotchas & Tips](misc/gotchas.md)
33+
- [FAQ](misc/faq.md)

docs/building-blocks/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ First we have to look at what is happening when react starts its life with out `
99
It is one of the biggest files of the boilerplate. It contains all the global setup to make sure your app runs smoothly. Let's break its contents down:
1010

1111
- `react-app-polyfill` is imported to enable compatibility with many browsers and cool stuff like generator functions, Promises, etc.
12-
- A `history` object is created, which remembers all the browsing history for your app. This is used by the ConnectedRouter to know which pages your users visit. (Very useful for analytics, by the way.)
1312
- A redux `store` is instantiated.
14-
- `ReactDOM.render()` not only renders the [root react component](https://github.com/react-boilerplate/react-boilerplate/blob/master/app/containers/App/index.js) called `<App />`, of your application, but it renders it with `<Provider />`, `<ConnectedRouter />`.
13+
- `ReactDOM.render()` not only renders the [root react component](https://github.com/react-boilerplate/react-boilerplate/blob/master/app/containers/App/index.js) called `<App />`, of your application, but it renders it with `<Provider />`.
1514
- Hot module replacement is set up via [Webpack HMR](https://webpack.js.org/guides/hot-module-replacement/) that makes all the reducers, injected sagas, components, containers, and i18n messages hot reloadable.
1615
- i18n internationalization support setup.
1716
- `<Provider />` connects your app with the redux `store`.
@@ -40,10 +39,9 @@ The store is created with the `createStore()` factory, which accepts three param
4039
2. **Initial state:** The initial state of your app as determined by your reducers.
4140
3. **Middleware/enhancers:** Middlewares are third party libraries which intercept each redux action dispatched to the redux store and then... do stuff. For example, if you install the [`redux-logger`](https://github.com/evgenyrodionov/redux-logger) middleware, it will listen to all the actions being dispatched to the store and print previous and next state in the browser console. It's helpful to track what happens in your app.
4241

43-
In our application we are using two such middleware.
42+
In our application we are using a single middleware.
4443

45-
1. **Router middleware:** Keeps your routes in sync with the redux `store`.
46-
2. **Redux saga:** Used for managing _side-effects_ such as dispatching actions asynchronously or accessing browser data.
44+
1. **Redux saga:** Used for managing _side-effects_ such as dispatching actions asynchronously or accessing browser data.
4745

4846
### Redux-Toolkit
4947

docs/building-blocks/css.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,21 @@ _(The CSS rules are automatically vendor prefixed, so you don't have to think ab
6161
🧙**Tips:** Importing from `styled-components/macro` will enable some features you can [see here](https://styled-components.com/docs/tooling#babel-macro)
6262

6363
{% endhint %}
64+
65+
## Media queries
66+
67+
Type-safe media queries can be complicated if you haven't mastered the typescript. Therefore we include a [media utility file](../../src/styles/media.ts) to make things easier for you.
68+
69+
### Example Usage
70+
71+
```ts
72+
import { media } from 'styles/media';
73+
74+
const SomeDiv = styled.div`
75+
display: flex;
76+
....
77+
${media.medium`
78+
display: block
79+
`};
80+
`;
81+
```

docs/building-blocks/routing.md

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Routing
22

33
`react-router` is the de-facto standard routing solution for react applications.
4-
The thing is that with redux and a single state tree, the URL is part of that
5-
state. `connected-react-router` takes care of synchronizing the location of our
6-
application with the application state.
74

8-
(See the [`connected-react-router` FAQ](https://github.com/supasate/connected-react-router/blob/master/FAQ.md)
9-
for more information)
5+
## Why not using [connected-react-router](https://github.com/supasate/connected-react-router)?
6+
7+
There is detailed explanation [here](https://reacttraining.com/react-router/web/guides/redux-integration/deep-integration). In short, it is not suggested to integrate route with redux, simply because it shouldn't be needed. There are other ways of navigating as explained there.
108

119
## Usage
1210

@@ -20,25 +18,6 @@ Top level routes are located in `src/app/index.tsx`.
2018

2119
If you want your route component (or any component for that matter) to be loaded asynchronously, use container or component generator with 'Do you want to load resources asynchronously?' option activated.
2220

23-
To go to a new page use the `push` function by `connected-react-router`:
24-
25-
```ts
26-
import { push } from 'connected-react-router';
27-
28-
dispatch(push('/path/to/somewhere'));
29-
```
30-
31-
You can do the same thing in a saga:
32-
33-
```ts
34-
import { push } from 'connected-react-router';
35-
import { put } from 'redux-saga/effects';
36-
37-
export function* mySaga() {
38-
yield put(push('/home'));
39-
}
40-
```
41-
4221
## Child Routes
4322

4423
For example, if you have a route called `about` at `/about` and want to make a child route called `team` at `/about/our-team`, follow the example

docs/deployment/netlify.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
11
# Deploy to Netlify
22

3-
This docs is still awaiting help 😢If you want to help with this documenation please contact to us
3+
### Easy 5-Step Deployment Process
4+
5+
_Step 1:_ Create a `netlifty.toml` file in the root directory of your project and copy this code below. Edit these settings if you did not follow the boilerplate structure. More settings available here (https://docs.netlify.com/configure-builds/file-based-configuration/#sample-file)
6+
7+
```
8+
[build]
9+
# Directory to change to before starting a build.
10+
# This is where we will look for package.json/.nvmrc/etc.
11+
base = "/"
12+
13+
# Directory (relative to root of your repo) that contains the deploy-ready
14+
# HTML files and assets generated by the build. If a base directory has
15+
# been specified, include it in the publish directory path.
16+
publish = "./build"
17+
18+
# Default build command.
19+
command = "npm run build"
20+
21+
# The following redirect is intended for use with most SPAs that handle routing internally.
22+
[[redirects]]
23+
from = "/*"
24+
to = "/index.html"
25+
status = 200
26+
```
27+
28+
_Step 2:_ Commit your code and push your latest updates to a GitHub repository.
29+
30+
_Step 3:_ Register or Login in at Netlify (https://app.netlify.com/).
31+
32+
_Step 4:_ In your account | team page click `New site from git` then chose your repository.
33+
34+
_Step 5:_ Click deploy.
35+
36+
37+
> Note: No need to change any setting in the last step as `netlify.toml` overwrites these settings.
38+
39+
Now your code will be deployed automatically to netlify on every push to the default branch of your repository.🥳🥳

docs/misc/faq.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# FAQ
2+
3+
- [Using global reducers instead of injecting](#load-reducers-optimistically)
4+
- [Keeping up-to-date with the template](keeping-up-to-date-with-the-template)
5+
- [Are there any examples or tutorials?](examples-and-tutorials)
6+
7+
## Using reducers optimistically
8+
9+
If you have containers that should be available throughout the app, like a `NavigationBar` (they aren't route specific), you need to add their respective reducers to the root reducer with the help of `combineReducers`.
10+
11+
```ts
12+
// In src/store/reducers.ts
13+
14+
...
15+
import { combineReducers } from '@reduxjs/toolkit';
16+
...
17+
18+
import navigationBarReducer from 'containers/NavigationBar/reducer';
19+
20+
export function createReducer(injectedReducers: InjectedReducersType = {}) {
21+
const rootReducer = combineReducers({
22+
navigationBar: navigationBarReducer,
23+
...injectedReducers,
24+
});
25+
26+
return rootReducer;
27+
}
28+
```
29+
30+
## Keeping up-to-date with the template
31+
32+
Eventhough the template is an npm package it's not possible for you to **just update** the package, since you start CRA with this template initially. The suggested way to keep an eye on the [CHANGELOG](../../CHANGELOG.md) file. All the changes that **concerns** the template user will be displayed there, like bug fixes, documentation updates, new features etc... You can check each change's commits and file changes and see what has been changed. Then, the decision is yours if you want to apply those to your code.
33+
34+
## Examples & Tutorials
35+
36+
Take a look our [another 'how to' repo](https://github.com/react-boilerplate/cra-template-examples) for examples and common web app implementations & patterns

0 commit comments

Comments
 (0)