Skip to content

Commit 737b599

Browse files
author
Ari
committed
Moved to folder structure instead of branch structure
1 parent f56d52e commit 737b599

File tree

680 files changed

+252363
-141
lines changed

Some content is hidden

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

680 files changed

+252363
-141
lines changed

README.md

+4-18
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,16 @@
11
## 30 days of react
22

3-
This repo contains the entire source and content for the article series of [30 days of React](https://www.fullstackreact.com/30-days-of-react) hosted by the Fullstack.io team.
3+
This repo contains the entire source and content for the article series of [30 days of React](https://www.fullstackreact.com/30-days-of-react) hosted by the Fullstack.io team.
44

55
## How to use this repository
66

7-
The repository contains all the sources for the article series where each day is separated out by branch. For instance, the day-1 branch is contained in the `day-1` branch.
7+
The repository contains all the sources for the article series where each day is separated out by branch. For instance, the day-1 branch is contained in the `day-1` branch.
88

9-
To list all the available branches, you can run the `git branch` command in this directory after cloning it locally. It's also available in the github interface.
10-
11-
To only fetch a particular day, you can clone the branch directly using the `git` tool. For instance, to get day 8 from the repo, use the following:
12-
13-
```bash
14-
git clone https://github.com/fullstackreact/30-days-of-react --branch day-8
15-
```
16-
17-
Alternatively, clone the entire repository and check out the `day-8` branch as a tracking branch.
18-
19-
```bash
20-
git clone https://github.com/fullstackreact/30-days-of-react
21-
cd 30-days-of-react
22-
git checkout --tracking -b origin/day-8 day-8
23-
```
9+
Each day is separated by folder and each has their own `project.json`. This makes it incredibly easy to manage different projects from day-to-day.
2410

2511
## What's in it?
2612

27-
Every day contains a full react application, following the same procedure used to create the article series. Every day can be run using the same basic steps. For the days that require a bit more work, check out the tutorial series on the blog.
13+
Every day contains a full react application, following the same procedure used to create the article series. Every day can be run using the same basic steps. For the days that require a bit more work, check out the tutorial series on the blog.
2814

2915
The steps to use a day from the 30 days of React project are:
3016

day-1/doc/doc.mkd

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
page_id: 30-days-of-react/day-1
3+
permalink: day-1
4+
title: What is React?
5+
description: Today, we're starting out at the beginning. Let's look at what React is and what makes it tick. We'll discuss why we want to use it.
6+
day: 1
7+
hero_image: /assets/images/series/30-days-of-react/headings/1.jpg
8+
imageUrl: /assets/images/series/30-days-of-react/headings/1.jpg
9+
dayDir: '01'
10+
introBannerUrl: '/assets/images/series/30-days-of-react/headings/1_wide.jpg'
11+
date: Tue Oct 04 2016 21:29:25 GMT-0700 (PDT)
12+
includeFile: ./../_params.yaml
13+
---
14+
15+
Over the next 30 days, you'll get a good feel for the various parts of the [React](https://facebook.github.io/react/) web framework and its ecosystem.
16+
17+
Each day in our 30 day adventure will build upon the previous day's materials, so by the end of the series, you'll not only know the terms, concepts, and underpinnings of how the framework works, but be able to use React in your next web application.
18+
19+
Let's get started. We'll start [at the very beginning](https://www.youtube.com/watch?v=1RW3nDRmu6k) as it's a very good place to start.
20+
21+
## What is React?
22+
23+
[React](https://facebook.github.io/react/) is a JavaScript library for building user interfaces. It is the view layer for web applications.
24+
25+
At the heart of all React applications are **components**. A component is a self-contained module that renders some output. We can write interface elements like a button or an input field as a React component. Components are _composable_. A component might include one or more other components in its output.
26+
27+
Broadly speaking, to write React apps we write React components that correspond to various interface elements. We then organize these components inside higher-level components which define the structure of our application.
28+
29+
For example, take a form. A form might consist of many interface elements, like input fields, labels, or buttons. Each element inside the form can be written as a React component. We'd then write a higher-level component, the form component itself. The form component would specify the structure of the form and include each of these interface elements inside of it.
30+
31+
Importantly, each component in a React app abides by strict data management principles. Complex, interactive user interfaces often involve complex data and application state. The surface area of React is limited and aimed at giving us the tools to be able to anticipate how our application will look with a given set of circumstances. We dig into these principles later in the course.
32+
33+
## Okay, so how do we use it?
34+
35+
React is a JavaScript framework. Using the framework is as simple as including a JavaScript file in our HTML and using the `React` exports in our application's JavaScript.
36+
37+
For instance, the _Hello world_ example of a React website can be as simple as:
38+
39+
```html
40+
<html>
41+
<head>
42+
<meta charset="utf-8">
43+
<title>Hello world</title>
44+
<!-- Script tags including React -->
45+
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.min.js"></script>
46+
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react-dom.min.js"></script>
47+
<script src="https://npmcdn.com/[email protected]/browser.min.js"></script>
48+
</head>
49+
<body>
50+
<div id="app"></div>
51+
<script type="text/babel">
52+
ReactDOM.render(
53+
<h1>Hello world</h1>,
54+
document.querySelector('#app')
55+
);
56+
</script>
57+
</body>
58+
</html>
59+
```
60+
61+
<div id="demo1"></div>
62+
63+
Although it might look a little scary, the JavaScript code is a single line that dynamically adds _Hello world_ to the page. Note that we only needed to include a handful of JavaScript files to get everything working.
64+
65+
## How does it work?
66+
67+
Unlike many of its predecessors, React operates not directly on the browser's Document Object Model (DOM) immediately, but on a **virtual DOM**. That is, rather than manipulating the `document` in a browser after changes to our data (which can be quite slow) it resolves changes in its virtual DOM. After the virtual DOM has been updated, React intelligently determines what changes to make to the actual DOM.
68+
69+
The [React Virtual DOM](https://facebook.github.io/react/docs/dom-differences.html) exists entirely in-memory and is a representation of the web browser's DOM. Because of this, we when we write a React component, we're not writing directly to the DOM, but we're writing a virtual component that React will turn into the DOM.
70+
71+
In the next article, we'll look at what this means for us as we build our React components and jump into JSX and writing our first real components.

day-1/package.json

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"name": "30Days",
3+
"version": "0.1.0",
4+
"private": true,
5+
"devDependencies": {
6+
"@fullstackio/cqmd": "^5.0.6",
7+
"babel-jest": "^19.0.0",
8+
"babel-polyfill": "^6.23.0",
9+
"babel-preset-stage-0": "^6.22.0",
10+
"enzyme": "^2.8.0",
11+
"git-rev": "^0.2.1",
12+
"gray-matter": "^2.1.1",
13+
"highlight.js": "^9.10.0",
14+
"hljs": "^6.2.3",
15+
"jest-cli": "^19.0.2",
16+
"map-stream": "^0.0.7",
17+
"marked": "^0.3.6",
18+
"nodemon": "^1.11.0",
19+
"npm-run-all": "^4.0.2",
20+
"nunjucks": "^3.0.0",
21+
"react-addons-test-utils": "^15.4.2",
22+
"react-scripts": "0.9.5",
23+
"react-test-renderer": "^15.4.2",
24+
"redux-mock-store": "^1.2.2",
25+
"simple-git": "^1.69.0",
26+
"sinon": "^2.1.0",
27+
"vinyl-fs": "^2.4.4"
28+
},
29+
"dependencies": {
30+
"autoprefixer": "^6.7.7",
31+
"font-awesome": "^4.7.0",
32+
"moment": "^2.18.1",
33+
"postcss-cli": "^3.0.0",
34+
"postcss-import": "^9.1.0",
35+
"precss": "^1.4.0",
36+
"react": "^15.4.2",
37+
"react-dom": "^15.4.2",
38+
"react-frame-component": "^1.0.2",
39+
"react-redux": "^5.0.3",
40+
"react-router-dom": "^4.0.0",
41+
"redux": "^3.6.0"
42+
},
43+
"scripts": {
44+
"start": "npm-run-all -c --parallel start:*",
45+
"build": "npm-run-all build:*",
46+
"start:styles": "npm run build:styles -- --watch",
47+
"build:styles": "./node_modules/.bin/postcss --config postcss.config.js src/styles/index.css -o src/index.css",
48+
"start:react": "react-scripts start",
49+
"build:react": "react-scripts build",
50+
"test": "react-scripts test --env=jsdom",
51+
"eject": "react-scripts eject"
52+
}
53+
}

day-1/post.md

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
page_id: 30-days-of-react/day-1
3+
permalink: day-1
4+
day: 1
5+
series: 30-days-of-react
6+
title: What is React?
7+
description: >-
8+
Today, we're starting out at the beginning. Let's look at what React is and
9+
what makes it tick. We'll discuss why we want to use it.
10+
hero_image: /assets/images/series/30-days-of-react/headings/1.jpg
11+
imageUrl: /assets/images/series/30-days-of-react/headings/1.jpg
12+
dayDir: '01'
13+
introBannerUrl: /assets/images/series/30-days-of-react/headings/1_wide.jpg
14+
date: 'Tue Oct 04 2016 21:29:25 GMT-0700 (PDT)'
15+
imagesDir: /assets/images/series/30-days-of-react/day-1
16+
includeFile: ./../_params.yaml
17+
articleEntry: '__SITE_PATH__/build/static/js/main'
18+
---
19+
20+
21+
Over the next 30 days, you'll get a good feel for the various parts of the [React](https://facebook.github.io/react/) web framework and its ecosystem.
22+
23+
Each day in our 30 day adventure will build upon the previous day's materials, so by the end of the series, you'll not only know the terms, concepts, and underpinnings of how the framework works, but be able to use React in your next web application.
24+
25+
Let's get started. We'll start [at the very beginning](https://www.youtube.com/watch?v=1RW3nDRmu6k) as it's a very good place to start.
26+
27+
## What is React?
28+
29+
[React](https://facebook.github.io/react/) is a JavaScript library for building user interfaces. It is the view layer for web applications.
30+
31+
At the heart of all React applications are **components**. A component is a self-contained module that renders some output. We can write interface elements like a button or an input field as a React component. Components are _composable_. A component might include one or more other components in its output.
32+
33+
Broadly speaking, to write React apps we write React components that correspond to various interface elements. We then organize these components inside higher-level components which define the structure of our application.
34+
35+
For example, take a form. A form might consist of many interface elements, like input fields, labels, or buttons. Each element inside the form can be written as a React component. We'd then write a higher-level component, the form component itself. The form component would specify the structure of the form and include each of these interface elements inside of it.
36+
37+
Importantly, each component in a React app abides by strict data management principles. Complex, interactive user interfaces often involve complex data and application state. The surface area of React is limited and aimed at giving us the tools to be able to anticipate how our application will look with a given set of circumstances. We dig into these principles later in the course.
38+
39+
## Okay, so how do we use it?
40+
41+
React is a JavaScript framework. Using the framework is as simple as including a JavaScript file in our HTML and using the `React` exports in our application's JavaScript.
42+
43+
For instance, the _Hello world_ example of a React website can be as simple as:
44+
45+
```html
46+
<html>
47+
<head>
48+
<meta charset="utf-8">
49+
<title>Hello world</title>
50+
<!-- Script tags including React -->
51+
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.min.js"></script>
52+
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react-dom.min.js"></script>
53+
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
54+
</head>
55+
<body>
56+
<div id="app"></div>
57+
<script type="text/babel">
58+
ReactDOM.render(
59+
<h1>Hello world</h1>,
60+
document.querySelector('#app')
61+
);
62+
</script>
63+
</body>
64+
</html>
65+
```
66+
67+
<div id="demo1"></div>
68+
69+
Although it might look a little scary, the JavaScript code is a single line that dynamically adds _Hello world_ to the page. Note that we only needed to include a handful of JavaScript files to get everything working.
70+
71+
## How does it work?
72+
73+
Unlike many of its predecessors, React operates not directly on the browser's Document Object Model (DOM) immediately, but on a **virtual DOM**. That is, rather than manipulating the `document` in a browser after changes to our data (which can be quite slow) it resolves changes on a DOM built and run entirely in memory. After the virtual DOM has been updated, React intelligently determines what changes to make to the actual browser's DOM.
74+
75+
The [React Virtual DOM](https://facebook.github.io/react/docs/dom-differences.html) exists entirely in-memory and is a representation of the web browser's DOM. Because of this, we when we write a React component, we're not writing directly to the DOM, but we're writing a virtual component that React will turn into the DOM.
76+
77+
In the next article, we'll look at what this means for us as we build our React components and jump into JSX and writing our first real components.
78+

day-1/postcss.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = ctx => {
2+
return {
3+
plugins: [
4+
require('postcss-import')(),
5+
require('precss')(),
6+
require('autoprefixer')()
7+
]
8+
}
9+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import React from 'react';
2+
3+
// Don't do it like this. This is for example only
4+
class Timeline extends React.Component {
5+
render() {
6+
return (
7+
<div className="notificationsFrame">
8+
<div className="panel">
9+
<div className="header">
10+
11+
<div className="menuIcon">
12+
<div className="dashTop"></div>
13+
<div className="dashBottom"></div>
14+
<div className="circle"></div>
15+
</div>
16+
17+
<span className="title">Timeline</span>
18+
19+
<input
20+
type="text"
21+
className="searchInput"
22+
placeholder="Search ..." />
23+
24+
<div className="fa fa-search searchIcon"></div>
25+
</div>
26+
<div className="content">
27+
<div className="line"></div>
28+
<div className="item">
29+
30+
<div className="avatar">
31+
<img
32+
alt='doug'
33+
src="http://www.croop.cl/UI/twitter/images/doug.jpg" />
34+
</div>
35+
36+
<span className="time">
37+
An hour ago
38+
</span>
39+
<p>Ate lunch</p>
40+
</div>
41+
42+
<div className="item">
43+
<div className="avatar">
44+
<img
45+
alt='doug' src="http://www.croop.cl/UI/twitter/images/doug.jpg" />
46+
</div>
47+
48+
<span className="time">10 am</span>
49+
<p>Read Day two article</p>
50+
</div>
51+
52+
<div className="item">
53+
<div className="avatar">
54+
<img
55+
alt='doug' src="http://www.croop.cl/UI/twitter/images/doug.jpg" />
56+
</div>
57+
58+
<span className="time">10 am</span>
59+
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
60+
</div>
61+
62+
<div className="item">
63+
<div className="avatar">
64+
<img
65+
alt='doug' src="http://www.croop.cl/UI/twitter/images/doug.jpg" />
66+
</div>
67+
68+
<span className="time">2:21 pm</span>
69+
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
70+
</div>
71+
72+
</div>
73+
</div>
74+
</div>
75+
)
76+
}
77+
}
78+
79+
export default Timeline

0 commit comments

Comments
 (0)