Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

update to newer revision of components and add webpack and vscode #237

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Chrome :3000",
"runtimeExecutable": "/usr/bin/chromium-browser",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
{
"type": "chrome",
"request": "launch",
"name": "Chrome ./index.html",
"runtimeExecutable": "/usr/bin/chromium-browser",
"cwd": "${workspaceFolder}",
"url": "file://${workspaceFolder}/index.html",
"webRoot": "${workspaceFolder}"
}
]
}
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# TypeScript, React rdux, webpack and vscode

forked from https://github.com/Microsoft/TypeScript-React-Starter

Updated versions:

Node v10.13.0
npm 6.4.1
react 16.6.3
react-redux 5.1.1
redux 4.0.1

Additions:

webpack 4.26.0 (following this tutorial https://www.typescriptlang.org/docs/handbook/react-&-webpack.html)

vscode + debug script for chrom on linux


Note:
running webpack in the root folder will build the include files for index.html
After building you can run the debugger usinf the "launch ./index.html" option

# Cool Visual Studio Code tip:

Run `npm run start` in the integrted terminal and keep it open.
Any errors will show with a link.
Ctrl+click the link will open the file and location the error report referes to.

# TypeScript React Starter

This quick start guide will teach you how to wire up TypeScript with [React](http://facebook.github.io/react/).
Expand Down Expand Up @@ -376,7 +405,7 @@ Enzyme is similar, but builds on jsdom and makes it easier to make certain queri
Let's install it as a development-time dependency.

```sh
npm install -D enzyme @types/enzyme enzyme-adapter-react-16 @types/enzyme-adapter-react-16 react-test-renderer
npm install --save-dev enzyme @types/enzyme enzyme-adapter-react-16 @types/enzyme-adapter-react-16 react-test-renderer
```

Notice we installed packages `enzyme` as well as `@types/enzyme`.
Expand Down Expand Up @@ -719,7 +748,7 @@ import { createStore } from 'redux';
import { enthusiasm } from './reducers/index';
import { StoreState } from './types/index';

const store = createStore<StoreState>(enthusiasm, {
const store = createStore(enthusiasm, {
enthusiasmLevel: 1,
languageName: 'TypeScript',
});
Expand Down
17 changes: 17 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hello React!</title>
</head>
<body>
<div id="example"></div>

<!-- Dependencies -->
<script src="./node_modules/react/umd/react.development.js"></script>
<script src="./node_modules/react-dom/umd/react-dom.development.js"></script>

<!-- Main -->
<script src="./build/dist/bundle.js"></script>
</body>
</html>
Loading