Skip to content

Commit 6cee2fc

Browse files
author
Seth Lemmons
committed
Added project folder READMEs
removed unused project
1 parent ca9ed01 commit 6cee2fc

File tree

57 files changed

+449
-19529
lines changed

Some content is hidden

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

57 files changed

+449
-19529
lines changed

01-scaffolding/README.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1-
# 01 Scaffolding
1+
# 01 Ext JS to React: Scaffolding
22

3-
This subdirectory contains an app already generated with create-react-app, as
4-
described in the Scaffolding blog post (link here)
3+
This directory contains an example of a sample React application generated by
4+
[create-react-app](https://www.npmjs.com/package/create-react-app) as described
5+
in the
6+
[Scaffolding blog post](https://moduscreate.com/blog/ext-js-to-react-scaffolding/).
57

6-
Make sure you have yarn installed.
8+
Create-react-app is a great way to spin up a starter application with React and
9+
will be used extensively in this repo.
710

8-
To run the app server:
11+
## Example Projects
912

10-
```
11-
$ cd my-app
12-
$ yarn start
13-
```
13+
- [my-app](./my-app): sample starter app created by create-react-app
1414

15-
A browser window will automatically open and will load the app.
16-
17-
As you make edits to the sources in the my-app/ directory, the browser will
18-
automatically refresh to reflect your changes.
19-
20-
The blog post suggetss some simple edits to see this in action.
21-
22-
For a quick start, you can edit my-app/src/App.js and comment out one of the two
23-
import lines, for logo.svg OR logo2.svg.
15+
### Related Blog Article
2416

17+
[Ext JS to React: Scaffolding](https://moduscreate.com/blog/ext-js-to-react-scaffolding/)

01-scaffolding/my-app/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app).
22

3+
# my-app
4+
5+
This directory contains an example of a sample React application generated by
6+
[create-react-app](https://www.npmjs.com/package/create-react-app) as described
7+
in the
8+
[Scaffolding blog post](https://moduscreate.com/blog/ext-js-to-react-scaffolding/).
9+
10+
This project contains a simple modification to demonstrate how to edit files
11+
within the starter app and see the changes update in the browser real-time (when
12+
following the steps outlined in the [Scaffolding blog article](https://moduscreate.com/blog/ext-js-to-react-scaffolding/)).
13+
14+
*Make sure you have npm installed.*
15+
16+
To run the app server:
17+
18+
```
19+
$ npm install
20+
$ npm start
21+
```
22+
23+
A browser window will automatically open and will load the app.
24+
25+
As you make edits to the sources in the my-app/ directory, the browser will
26+
automatically refresh to reflect your changes.
27+
28+
The blog post suggests some simple edits to see this in action.
29+
30+
For a quick start, you can edit my-app/src/App.js and comment out one of the two
31+
import lines, for logo.svg OR logo2.svg.
32+
33+
34+
# Create React App README
35+
336
Below you will find some information on how to perform common tasks.<br>
437
You can find the most recent version of this guide [here](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md).
538

01-scaffolding/my-app/src/App.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { Component } from 'react';
22

3-
//import logo from './logo.svg';
3+
// import logo from './logo.svg';
4+
// replace the original logo from the generated app with one we'll supply
45
import logo from './logo2.svg';
56
import './App.css';
67

02-instantiation/README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
# 02 Instantiation
1+
# 02 Ext JS to React: Class Instantiation and Code Style
22

3-
This subdirectory contains an app already generated with create-react-app, as
4-
described in the Instantiation blog post (link here). The source code has been
5-
modified to include the examples in the blog post so you can see it in action.
3+
React components can be created a couple of different ways. The
4+
[my-app](./my-app) example project demonstrates how React components may be
5+
instantiated.
66

7-
See my-app/src/App.js
7+
## Example Projects
8+
9+
- [my-app](./my-app): sample app demonstrating how React components are
10+
instantiated
11+
12+
### Related Blog Article
13+
14+
[Ext JS to React: Class Instantiation and Code Style](https://moduscreate.com/blog/extjs-react-class-instantiation-code-style/)
815

02-instantiation/my-app/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
# my-app
2+
3+
This directory contains an example of a sample React application generated by
4+
[create-react-app](https://www.npmjs.com/package/create-react-app) as described
5+
in the
6+
[Scaffolding blog post](https://moduscreate.com/blog/ext-js-to-react-scaffolding/).
7+
8+
This project contains an example `MyHeader` component which is instantiated
9+
within the `MyComponent` class. The `MyComponent` is then instantiated by the
10+
`App` component exported from [src/App.js](./src/App.js).
11+
12+
*Make sure you have npm installed.*
13+
14+
To run the app server:
15+
16+
```
17+
$ npm install
18+
$ npm start
19+
```
20+
21+
A browser window will automatically open and will load the app.
22+
23+
24+
# Create React App README
25+
126
This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app).
227

328
Below you will find some information on how to perform common tasks.<br>

02-instantiation/my-app/src/App.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const MyHeader = ({ text }) => {
88
)
99
}
1010

11+
// A MyClass instance is created when MyComponent is created since MyComponent
12+
// includes a MyHeader node in the returned JSX
1113
const MyComponent = () => {
1214
return (
1315
<div>
@@ -19,6 +21,7 @@ const MyComponent = () => {
1921
)
2022
}
2123

24+
// An instance of MyComponent is returned by the application's main view: App
2225
class App extends Component {
2326
render() {
2427
return (

03-defining-classes/README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
# 03 Defining Classes
1+
# 03 Ext JS to React: Defining Classes
22

3-
This subdirectory contains apps already generated with create-react-app, as
4-
described in the Instantiation blog post (link here). The source code has been
5-
modified to include the examples in the blog post so you can see it in action.
3+
This directory contains apps already generated with [create-react-app](https://www.npmjs.com/package/create-react-app), as described in the
4+
[Instantiation blog post](https://moduscreate.com/blog/extjs-react-class-instantiation-code-style/). The
5+
source code has been modified to include the examples in the blog post so you
6+
can see it in action.
67

7-
For each of the following examples, cd into the directory and run ```npm
8-
install``` followeed by ```npm run```
8+
## Defining Example Projects
99

10-
* a-functional-basic - simplest example, importing a single functional component
11-
* b-functional-property - simple example, importing a single functional component that takes a prop
12-
* c-class-instances - referencing class instances example, component declared as a proper JavaScript class.
13-
* d-refs - referencing child components
10+
- [a-functional-basic](./a-functional-basic): a simple, functional React
11+
component
12+
- [b-functional-property](./b-functional-property): a functional component with
13+
a single prop
14+
- [c-class-instances](./c-class-instances): a single component extending
15+
React.Component is defined including its own state and event handler
16+
- [d-refs](./d-refs): how to create references to elements within a React
17+
component
18+
19+
### Related Blog Article
20+
21+
[Ext JS to React: Defining Classes](https://moduscreate.com/blog/ext-js-react-defining-classes/)

03-defining-classes/a-functional-basic/src/MyComponent.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React from 'react';
22

3+
// MyComponent is defined as a functional React component (one that is defined
4+
// as a function, rather than a class extending React.Component)
35
const MyComponent = () => {
46
return (
57
<div>Hello from Modus!</div>

03-defining-classes/b-functional-property/src/App.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ import React from 'react';
22
import MyContainer from './MyContainer'
33
import './App.css';
44

5+
// The main view of the application simply returns an instance of MyContainer
56
export default () => <MyContainer />;

03-defining-classes/b-functional-property/src/MyComponent.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import React from 'react';
22

3+
// MyComponent is defined as a functional React component (one that is defined
4+
// as a function, rather than a class extending React.Component). The component
5+
// accepts a single prop of `text` with a default value of "Hello from Modus"
36
const MyComponent = ({ text = 'Hello from Modus!' }) => {
47
return (
58
<div>{text}</div>

03-defining-classes/b-functional-property/src/MyContainer.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import React from 'react';
22
import MyComponent from './MyComponent';
33

4+
// MyContainer instantiates two MyComponents
5+
// - the first with a default text value
6+
// - the second with a value passed in using MyComponent's 'text' attribute
47
const MyContainer = () => {
58
return (
69
<div>

03-defining-classes/c-class-instances/src/MyComponent.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { Component } from 'react';
22

33
class MyComponent extends Component {
4+
// sets the initial value of `text` on the component's state object
45
state = {
56
text: 'Hello from Modus!'
67
}
@@ -10,12 +11,15 @@ class MyComponent extends Component {
1011

1112
return (
1213
<div>
14+
{/* the input's value comes from the component's state.text */}
1315
<input defaultValue={text} />
1416
<button onClick={this.onBtnClick}>Set Text</button>
1517
</div>
1618
)
1719
}
1820

21+
// setting `text` on the component state results in render running once more
22+
// and updating the value of the input field
1923
onBtnClick = () => {
2024
this.setState({
2125
text: 'Text changed!'

03-defining-classes/d-refs/src/MyComponent.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { Component } from 'react';
22

33
class MyComponent extends Component {
4+
// sets the initial value of `text` on the component's state object
45
state = {
56
text: 'Hello from Modus!'
67
}
@@ -10,6 +11,7 @@ class MyComponent extends Component {
1011

1112
return (
1213
<div>
14+
{/* the input's value comes from the component's state.text */}
1315
<input
1416
defaultValue={text}
1517
ref={ input => this.textInput = input }
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
# 04 Static and Config Members
1+
# 04 Ext JS to React: Static and Config Members
22

3+
The following examples show how to define components with static class members
4+
as well as pass configuration options
35

4-
This subdirectory contains apps already generated with create-react-app, as
5-
described in the Static and Config Members blog post (link here). The source code has been
6-
modified to include the examples in the blog post so you can see it in action.
6+
## Example Projects
77

8-
For each of the following examples, cd into the directory and run ```npm
9-
install``` followeed by ```npm run```
8+
- [a-static-members](./a-static-members): static class methods can be defined
9+
for use in a React app
10+
- [b-configs](./b-configs): recreate the set / get methods for a component
11+
property in React similar to what the Ext JS class system does for options
12+
defined in a `config` block in an Ext JS defined class
1013

11-
See src/App.js in each of the example directories.
12-
13-
* a-static-members - simple example illustrating static members (examine the error object thrown via Chrome developer tools)
14-
* b-configs - simple example illustrating static members (examine output in Chrome developer tools)
14+
### Related Blog Article
1515

16+
[Ext JS to React: Static and Config Members](https://moduscreate.com/blog/ext-js-react-static-config-members/)

05-mixins/README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
# 05 Mixins
1+
# 05 Ext JS to React: Mixins
22

3+
The following examples demonstrate techniques used to share common code within a
4+
React application similar to how you would use `mixins` in an Ext JS application
35

4-
This subdirectory contains apps already generated with create-react-app, as
5-
described in the Mixinsblog post (link here). The source code has been
6-
modified to include the examples in the blog post so you can see it in action.
6+
## Example Projects
77

8-
For each of the following examples, cd into the directory and run ```npm
9-
install``` followeed by ```npm run```
8+
- [a-floatingbox](./a-floatingbox): simple example illustrating the HOC patter
9+
to enable other components to assume a floated position within the viewport
10+
- [b-simple-decorators](./b-simple-decorators): simple example illustrating
11+
class decorator syntax for use with the HOC pattern used to share code
12+
- [c-maskable-example](./c-maskable-example): the render prop pattern for
13+
shared code is used to mask the elements of the component composed within a
14+
`Mask` component
1015

11-
* a-floatingbox - simple example illustrating hoc for floating box (see src/box.js and src/App.css)
12-
* b-configs - simple example illustrating decorators (this has been ejected and configured so decorators work)
13-
* c-maskable-example - example illustrating hoc to add maksable to a component (this has been ejected and configured so decorators work)
16+
### Related Blog Article
1417

18+
[Ext JS to React: Mixins](https://moduscreate.com/blog/ext-js-react-mixins/)

06-templating/README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
# 06 Templating
1+
# 06 Ext JS to React: Templating
22

3+
In these examples we explore how to create templated classes similar to what you
4+
would do when creating HTML templates using Ext JS XTemplate
35

4-
This subdirectory contains apps already generated with create-react-app, as
5-
described in the "Temolating" and "Advanced Templating" blog posts (link here).
6-
The source code has been modified to include the examples in the blog post so
7-
you can see it in action.
6+
## Example Projects
87

9-
For each of the following examples, cd into the directory and run ```npm
10-
install``` followeed by ```npm run```
8+
- [a-simple-templating](./a-simple-templating): simple React component whose
9+
content is fed from a data object using templating syntax
10+
- [b-advanced-templating](./b-advanced-templating): a somewhat more advanced
11+
templating example that uses a class method owned by the component rendering
12+
the template. This is similar to using member functions in Ext JS templates.
1113

12-
See src/App.js in each of the example directories.
14+
### Related Blog Articles
1315

14-
* a-simple-templating- example illustrating simple templating in React
15-
* b-advanced-templating - example illustrating advanced templating
16+
[Ext JS to React: Simple Templating](https://moduscreate.com/blog/ext-js-react-simple-templating/)
1617

18+
[Ext JS to React: Advanced Templating](https://moduscreate.com/blog/ext-js-react-advanced-templating/)

07-list/README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
# 07 Lists
1+
# 07 Ext JS to React: List
22

3-
This subdirectory contains apps already generated with create-react-app, as
4-
described in the "List" blog post (link here). The source code has been
5-
modified to include the examples in the blog post so you can see it in action.
3+
The Ext JS list component, including selectable rows and icon buttons, is
4+
recreated as a React component in the following examples
65

7-
For each of the following examples, cd into the directory and run ```npm
8-
install``` followeed by ```npm run```
6+
## Example Projects
97

10-
See src/App.js in each of the example directories.
8+
- [a-basic-list](./a-basic-list): simple list component
9+
- [b-selectable-list](./b-selectable-list): simple list with an included
10+
selection model
11+
- [c-list-tools](./c-list-tools): list component with configurable icon font
12+
buttons embedded in the list item
1113

12-
* a-basic-List- example illustrating basic List component in React
13-
* b-advanced-templating - example illustrating advanced templating
14+
### Related Blog Article
1415

16+
[Ext JS to React: List](https://moduscreate.com/blog/ext-js-react-list/)

08-basic-grid/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
# 08 Basic Grid
1+
# 08 Ext JS to React: Basic Grid
22

3-
This subdirectory contains apps already generated with create-react-app, as
4-
described in the "Grid" blog post (link here). The source code has been
5-
modified to include the examples in the blog post so you can see it in action.
3+
The Ext JS grid component, including sorting the records by clicking on a column
4+
header, is recreated as a React component in the following examples
65

7-
For each of the following examples, cd into the directory and run ```npm
8-
install``` followeed by ```npm run```
6+
## Example Projects
97

10-
See src/App.js in each of the example directories.
8+
- [a-basic-grid](./a-basic-grid): simple grid component populated by a data
9+
object
10+
- [b-basic-grid-sorting](./b-basic-grid-sorting): simple grid component with
11+
record sorting driven by user interaction with the column headers
1112

12-
* a-basic-grid- example illustrating basic Grid component in React
13+
### Related Blog Article
1314

15+
[Ext JS to React: Basic Grid](https://moduscreate.com/blog/ext-js-react-basic-grid/)

0 commit comments

Comments
 (0)