Skip to content

Commit 6536cd8

Browse files
committedJun 21, 2017
Initial commit
0 parents  commit 6536cd8

File tree

21 files changed

+3855
-0
lines changed

21 files changed

+3855
-0
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

‎basic-react/index.html

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>unpkg :: basic-react demo</title>
5+
</head>
6+
<body>
7+
<div id="app"></div>
8+
9+
<script src="https://unpkg.com/react@15.5.4/dist/react.min.js"></script>
10+
<script src="https://unpkg.com/react-dom@15.5.4/dist/react-dom.min.js"></script>
11+
<script src="https://unpkg.com/babel-standalone@6.24.2/babel.min.js"></script>
12+
13+
<script type="text/babel">
14+
class MyApp extends React.Component {
15+
render() {
16+
return <h1>Hello from React {React.version}</h1>
17+
}
18+
}
19+
20+
ReactDOM.render(
21+
<MyApp/>,
22+
document.getElementById('app')
23+
)
24+
</script>
25+
</body>
26+
</html>

‎getlibs-react/index.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>unpkg :: getlibs-react demo</title>
5+
6+
<script src="https://unpkg.com/getlibs"></script>
7+
8+
<script>
9+
System.import('./main.js')
10+
</script>
11+
</head>
12+
<body>
13+
<div id="app"></div>
14+
</body>
15+
</html>

‎getlibs-react/main.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react'
2+
import ReactDOM from 'react-dom'
3+
4+
class MyApp extends React.Component {
5+
render() {
6+
return <h1>Hello from React {React.version}</h1>
7+
}
8+
}
9+
10+
ReactDOM.render(
11+
<MyApp/>,
12+
document.getElementById('app')
13+
)

‎systemjs-angular/config.js

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
System.config({
2+
transpiler: 'typescript',
3+
typescriptOptions: {
4+
emitDecoratorMetadata: true
5+
},
6+
paths: {
7+
'npm:': 'https://unpkg.com/'
8+
},
9+
map: {
10+
'app': './src',
11+
12+
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
13+
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
14+
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
15+
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
16+
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
17+
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
18+
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
19+
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
20+
'@angular/animations': 'npm:@angular/animations/bundles/animations.umd.js',
21+
'@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
22+
'@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.js',
23+
24+
'@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js',
25+
'@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js',
26+
'@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js',
27+
'@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
28+
'@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
29+
'@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js',
30+
'@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js',
31+
32+
'rxjs': 'npm:rxjs',
33+
'typescript': 'npm:typescript@2.2.1/lib/typescript.js'
34+
},
35+
packages: {
36+
app: {
37+
main: './main.ts',
38+
defaultExtension: 'ts'
39+
},
40+
rxjs: {
41+
defaultExtension: 'js'
42+
}
43+
}
44+
})

‎systemjs-angular/index.html

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<base href="."/>
5+
<title>unpkg :: systemjs-angular demo</title>
6+
7+
<script src="https://unpkg.com/core-js@2.4.1/client/shim.min.js"></script>
8+
<script src="https://unpkg.com/zone.js/dist/zone.js"></script>
9+
<script src="https://unpkg.com/zone.js/dist/long-stack-trace-zone.js"></script>
10+
<script src="https://unpkg.com/reflect-metadata@0.1.3/Reflect.js"></script>
11+
<script src="https://unpkg.com/systemjs@0.19.31/dist/system.js"></script>
12+
<script src="config.js"></script>
13+
14+
<script>
15+
System.import('app')
16+
</script>
17+
</head>
18+
19+
<body>
20+
<my-app>loading...</my-app>
21+
</body>
22+
</html>

‎systemjs-angular/src/app.ts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//our root app component
2+
import {Component, NgModule, VERSION} from '@angular/core'
3+
import {BrowserModule} from '@angular/platform-browser'
4+
5+
@Component({
6+
selector: 'my-app',
7+
template: `
8+
<h1>{{message}}</h1>
9+
`,
10+
})
11+
export class App {
12+
message:string;
13+
constructor() {
14+
this.message = `Hello from Angular ${VERSION.full}`
15+
}
16+
}
17+
18+
@NgModule({
19+
imports: [ BrowserModule ],
20+
declarations: [ App ],
21+
bootstrap: [ App ]
22+
})
23+
export class AppModule {}

‎systemjs-angular/src/main.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//main entry point
2+
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
3+
import {AppModule} from './app';
4+
5+
platformBrowserDynamic().bootstrapModule(AppModule)

‎systemjs-react-bundle/config.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
System.config({
2+
transpiler: 'babel',
3+
paths: {
4+
'npm:': 'https://unpkg.com/'
5+
},
6+
map: {
7+
'babel': 'npm:babel-core@5.8.38/browser.min.js',
8+
'react': 'npm:react@15.5.4/dist/react.min.js',
9+
'react-dom': 'npm:react-dom@15.5.4/dist/react-dom.min.js'
10+
}
11+
})

‎systemjs-react-bundle/index.html

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>unpkg :: systemjs-react-bundle demo</title>
5+
6+
<script src="https://unpkg.com/systemjs@0.19.31/dist/system.js"></script>
7+
<script src="config.js"></script>
8+
9+
<script>
10+
System.import('./main.js')
11+
</script>
12+
</head>
13+
<body>
14+
<div id="app"></div>
15+
</body>
16+
</html>

‎systemjs-react-bundle/main.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react'
2+
import ReactDOM from 'react-dom'
3+
4+
class MyApp extends React.Component {
5+
render() {
6+
return <h1>Hello from React {React.version}</h1>
7+
}
8+
}
9+
10+
ReactDOM.render(
11+
<MyApp/>,
12+
document.getElementById('app')
13+
)

‎systemjs-react/config.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
System.config({
2+
transpiler: 'babel',
3+
meta: {
4+
'*': {
5+
globals: {
6+
process: 'process.js'
7+
}
8+
}
9+
},
10+
paths: {
11+
'npm:': 'https://unpkg.com/'
12+
},
13+
map: {
14+
'babel': 'npm:babel-core@5.8.38',
15+
'react': 'npm:react@15.5.4',
16+
'react-dom': 'npm:react-dom@15.5.4',
17+
'fbjs': 'npm:fbjs@0.8.12',
18+
'prop-types': 'npm:prop-types@15.5.4',
19+
'object-assign': 'npm:object-assign@4.1.1'
20+
},
21+
packages: {
22+
'babel': {
23+
main: 'browser.min.js'
24+
},
25+
'react': {
26+
main: 'react.js'
27+
},
28+
'react-dom': {
29+
main: 'index.js'
30+
}
31+
}
32+
})

‎systemjs-react/index.html

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>unpkg :: systemjs-react demo</title>
5+
6+
<script src="https://unpkg.com/systemjs@0.19.31/dist/system.js"></script>
7+
<script src="config.js"></script>
8+
9+
<script>
10+
System.import('./main.js')
11+
</script>
12+
</head>
13+
<body>
14+
<div id="app"></div>
15+
</body>
16+
</html>

‎systemjs-react/main.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react'
2+
import ReactDOM from 'react-dom'
3+
4+
class MyApp extends React.Component {
5+
render() {
6+
return <h1>Hello from React {React.version}</h1>
7+
}
8+
}
9+
10+
ReactDOM.render(
11+
<MyApp/>,
12+
document.getElementById('app')
13+
)

‎systemjs-react/process.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
exports.env = {
2+
NODE_ENV: 'development'
3+
}

‎webpack-react/.babelrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": [
3+
"es2015",
4+
"react"
5+
]
6+
}

‎webpack-react/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build
2+
node_modules

‎webpack-react/main.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react'
2+
import ReactDOM from 'react-dom'
3+
4+
class MyApp extends React.Component {
5+
render() {
6+
return <h1>Hello from React {React.version}</h1>
7+
}
8+
}
9+
10+
ReactDOM.render(
11+
<MyApp/>,
12+
document.body
13+
)

‎webpack-react/package.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"scripts": {
3+
"start": "webpack-dev-server --inline"
4+
},
5+
"dependencies": {
6+
"babel-core": "^6.24.1",
7+
"babel-loader": "^7.0.0",
8+
"babel-preset-es2015": "^6.24.1",
9+
"babel-preset-react": "^6.24.1",
10+
"html-webpack-plugin": "^2.28.0",
11+
"html-webpack-template": "^6.0.1",
12+
"module-to-cdn": "^3.0.1",
13+
"modules-cdn-webpack-plugin": "^3.0.2",
14+
"react": "^15.5.4",
15+
"react-dom": "^15.5.4",
16+
"webpack": "^2.6.1",
17+
"webpack-dev-server": "^2.4.5"
18+
}
19+
}

‎webpack-react/webpack.config.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const path = require('path')
2+
const HTMLWebpackPlugin = require('html-webpack-plugin')
3+
const ModulesCDNWebpackPlugin = require('modules-cdn-webpack-plugin')
4+
5+
module.exports = {
6+
entry: './main.js',
7+
output: {
8+
path: path.join(__dirname, 'build'),
9+
filename: 'bundle.js'
10+
},
11+
module: {
12+
rules: [
13+
{
14+
test: /\.js$/,
15+
exclude: /node_modules/,
16+
use: {
17+
loader: 'babel-loader'
18+
}
19+
}
20+
]
21+
},
22+
plugins: [
23+
new HTMLWebpackPlugin(),
24+
new ModulesCDNWebpackPlugin()
25+
]
26+
}

‎webpack-react/yarn.lock

+3,536
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.