Skip to content

Commit ed1b28c

Browse files
committed
use examples plugin, convert to CRA
1 parent e96d3a6 commit ed1b28c

File tree

16 files changed

+99
-102
lines changed

16 files changed

+99
-102
lines changed

examples/columns/package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@
33
"version": "1.0.0",
44
"description": "Columns, rows - ActiveWidgets/React",
55
"license": "MIT",
6-
"main": "src/index.jsx",
76
"scripts": {
8-
"start": "vite --open /",
9-
"build": "vite build"
7+
"start": "react-scripts start",
8+
"build": "react-scripts build"
109
},
1110
"dependencies": {
1211
"@activewidgets/examples": "*",
1312
"@activewidgets/react": "^3",
14-
"react": "^17",
15-
"react-dom": "^17"
13+
"react": "^18",
14+
"react-dom": "^18"
1615
},
1716
"devDependencies": {
18-
"vite": "^2"
17+
"react-scripts": "^5"
1918
},
19+
"browserslist": [
20+
"defaults"
21+
],
2022
"repository": {
2123
"type": "git",
2224
"url": "https://github.com/activewidgets/react.git",
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
<!DOCTYPE html>
2-
<html>
3-
<head>
4-
<title>Columns, rows - ActiveWidgets/React</title>
5-
<meta name="viewport" content="width=device-width, initial-scale=1">
6-
</head>
7-
<body>
8-
<div id="app">Loading...</div>
9-
<script type="module" src="./src/index.jsx"></script>
10-
</body>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Columns, rows - ActiveWidgets/React</title>
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
</head>
7+
<body>
8+
<div id="app">Loading...</div>
9+
</body>
1110
</html>

examples/columns/src/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import React from "react";
8-
import ReactDOM from "react-dom";
8+
import { createRoot } from "react-dom/client";
99
import { Datagrid } from "@activewidgets/react";
1010
import { northwind } from "@activewidgets/examples/data";
1111
import './styles.css';
@@ -32,4 +32,4 @@ function App(){
3232
}
3333

3434

35-
ReactDOM.render(<App />, document.getElementById("app"));
35+
createRoot(document.getElementById("app")).render(<App />);

examples/demo/package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@
33
"version": "1.0.0",
44
"description": "Demo - ActiveWidgets/React",
55
"license": "MIT",
6-
"main": "src/index.jsx",
76
"scripts": {
8-
"start": "vite --open /",
9-
"build": "vite build"
7+
"start": "react-scripts start",
8+
"build": "react-scripts build"
109
},
1110
"dependencies": {
1211
"@activewidgets/examples": "*",
1312
"@activewidgets/options": "^3",
1413
"@activewidgets/react": "^3",
15-
"react": "^17",
16-
"react-dom": "^17"
14+
"react": "^18",
15+
"react-dom": "^18"
1716
},
1817
"devDependencies": {
19-
"vite": "^2"
18+
"react-scripts": "^5"
2019
},
20+
"browserslist": [
21+
"defaults"
22+
],
2123
"repository": {
2224
"type": "git",
2325
"url": "https://github.com/activewidgets/react.git",
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
<!DOCTYPE html>
2-
<html>
3-
<head>
4-
<title>Demo - ActiveWidgets/React</title>
5-
<meta name="viewport" content="width=device-width, initial-scale=1">
6-
</head>
7-
<body>
8-
<div id="app"></div>
9-
<script type="module" src="./src/index.jsx"></script>
10-
</body>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Demo - ActiveWidgets/React</title>
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
</head>
7+
<body>
8+
<div id="app"></div>
9+
</body>
1110
</html>

examples/demo/src/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import React from 'react';
8-
import ReactDOM from 'react-dom';
8+
import { createRoot } from "react-dom/client";
99
import { Datagrid } from '@activewidgets/react';
1010
import { northwind } from '@activewidgets/examples/data';
1111
import * as templates from './templates';
@@ -36,4 +36,4 @@ function App(){
3636
return <Datagrid columns={columns} rows={rows} calc={calc} templates={templates} options={options}/>
3737
}
3838

39-
ReactDOM.render(<App />, document.getElementById('app'));
39+
createRoot(document.getElementById("app")).render(<App />);

examples/events/package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@
33
"version": "1.0.0",
44
"description": "User events - ActiveWidgets/React",
55
"license": "MIT",
6-
"main": "src/index.jsx",
76
"scripts": {
8-
"start": "vite --open /",
9-
"build": "vite build"
7+
"start": "react-scripts start",
8+
"build": "react-scripts build"
109
},
1110
"dependencies": {
1211
"@activewidgets/examples": "*",
1312
"@activewidgets/react": "^3",
14-
"react": "^17",
15-
"react-dom": "^17"
13+
"react": "^18",
14+
"react-dom": "^18"
1615
},
1716
"devDependencies": {
18-
"vite": "^2"
17+
"react-scripts": "^5"
1918
},
19+
"browserslist": [
20+
"defaults"
21+
],
2022
"repository": {
2123
"type": "git",
2224
"url": "https://github.com/activewidgets/react.git",
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
<!DOCTYPE html>
2-
<html>
3-
<head>
4-
<title>User events - ActiveWidgets/React</title>
5-
<meta name="viewport" content="width=device-width, initial-scale=1">
6-
</head>
7-
<body>
8-
<div id="app">Loading...</div>
9-
<p>&#10140; Click on a datagrid row to open an alert box</p>
10-
<script type="module" src="./src/index.jsx"></script>
11-
</body>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>User events - ActiveWidgets/React</title>
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
</head>
7+
<body>
8+
<div id="app">Loading...</div>
9+
<p>&#10140; Click on a datagrid row to open an alert box</p>
10+
</body>
1211
</html>

examples/events/src/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import React from "react";
8-
import ReactDOM from "react-dom";
8+
import { createRoot } from "react-dom/client";
99
import { Datagrid } from "@activewidgets/react";
1010
import { columns, rows } from "@activewidgets/examples/data";
1111
import './styles.css';
@@ -30,4 +30,4 @@ function App(){
3030
return <Datagrid columns={columns} rows={rows} onInit={onInit} onClick={onClick} />
3131
}
3232

33-
ReactDOM.render(<App />, document.getElementById("app"));
33+
createRoot(document.getElementById("app")).render(<App />);

examples/hello-world/package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,21 @@
33
"version": "1.0.0",
44
"description": "Hello World - ActiveWidgets/React",
55
"license": "MIT",
6-
"main": "src/index.jsx",
76
"scripts": {
8-
"start": "vite --open /",
9-
"build": "vite build"
7+
"start": "react-scripts start",
8+
"build": "react-scripts build"
109
},
1110
"dependencies": {
1211
"@activewidgets/react": "^3",
13-
"react": "^17",
14-
"react-dom": "^17"
12+
"react": "^18",
13+
"react-dom": "^18"
1514
},
1615
"devDependencies": {
17-
"vite": "^2"
16+
"react-scripts": "^5"
1817
},
18+
"browserslist": [
19+
"defaults"
20+
],
1921
"repository": {
2022
"type": "git",
2123
"url": "https://github.com/activewidgets/react.git",
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
<!DOCTYPE html>
2-
<html>
3-
<head>
4-
<title>Hello World - ActiveWidgets/React</title>
5-
<meta name="viewport" content="width=device-width, initial-scale=1">
6-
</head>
7-
<body>
8-
<div id="app"></div>
9-
<script type="module" src="./src/index.jsx"></script>
10-
</body>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Hello World - ActiveWidgets/React</title>
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
</head>
7+
<body>
8+
<div id="app"></div>
9+
</body>
1110
</html>

examples/hello-world/src/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import React from "react";
8-
import ReactDOM from "react-dom";
8+
import { createRoot } from "react-dom/client";
99
import { Datagrid } from "@activewidgets/react";
1010
import './styles.css';
1111

@@ -18,4 +18,4 @@ function App(){
1818
return <Datagrid rows={rows} />
1919
}
2020

21-
ReactDOM.render(<App />, document.getElementById("app"));
21+
createRoot(document.getElementById("app")).render(<App />);

examples/performance/package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@
33
"version": "1.0.0",
44
"description": "Performance - ActiveWidgets/React",
55
"license": "MIT",
6-
"main": "src/index.jsx",
76
"scripts": {
8-
"start": "vite --open /",
9-
"build": "vite build"
7+
"start": "react-scripts start",
8+
"build": "react-scripts build"
109
},
1110
"dependencies": {
1211
"@activewidgets/examples": "*",
1312
"@activewidgets/options": "^3",
1413
"@activewidgets/react": "^3",
15-
"react": "^17",
16-
"react-dom": "^17"
14+
"react": "^18",
15+
"react-dom": "^18"
1716
},
1817
"devDependencies": {
19-
"vite": "^2"
18+
"react-scripts": "^5"
2019
},
20+
"browserslist": [
21+
"defaults"
22+
],
2123
"repository": {
2224
"type": "git",
2325
"url": "https://github.com/activewidgets/react.git",
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
<!DOCTYPE html>
2-
<html>
3-
<head>
4-
<title>Performance - ActiveWidgets/React</title>
5-
<meta name="viewport" content="width=device-width, initial-scale=1">
6-
</head>
7-
<body>
8-
<div id="app">Loading...</div>
9-
<script type="module" src="./src/index.jsx"></script>
10-
</body>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Performance - ActiveWidgets/React</title>
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
</head>
7+
<body>
8+
<div id="app">Loading...</div>
9+
</body>
1110
</html>

examples/performance/src/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import React from "react";
8-
import ReactDOM from "react-dom";
8+
import { createRoot } from "react-dom/client";
99
import { Datagrid } from "@activewidgets/react";
1010
import { lazy } from '@activewidgets/options';
1111
import './styles.css';
@@ -52,4 +52,4 @@ function App(){
5252
}
5353

5454

55-
ReactDOM.render(<App />, document.getElementById("app"));
55+
createRoot(document.getElementById("app")).render(<App />);

vite.config.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
import {resolve} from 'path';
22
import markdown from 'rollup-plugin-md';
3+
import examples from '@activewidgets/examples/plugin';
34

45
export default {
56
root: 'examples',
67
build: {
78
outDir: '../out',
8-
emptyOutDir: true,
9-
rollupOptions: {
10-
input: {
11-
main: resolve('examples/index.html'),
12-
columns: resolve('examples/columns/index.html'),
13-
demo: resolve('examples/demo/index.html'),
14-
events: resolve('examples/events/index.html'),
15-
hello: resolve('examples/hello-world/index.html'),
16-
performance: resolve('examples/performance/index.html')
17-
}
18-
}
9+
emptyOutDir: true
1910
},
2011
plugins: [
12+
examples(),
2113
markdown()
2214
],
2315
resolve: {

0 commit comments

Comments
 (0)