Skip to content

Commit

Permalink
Fix react and remote-workspace examples
Browse files Browse the repository at this point in the history
  • Loading branch information
texodus committed May 6, 2021
1 parent 4d0b3fc commit ef56e79
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 35 deletions.
8 changes: 2 additions & 6 deletions examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.8.0",
"description": "An example app built using `@finos/perspective-viewer`.",
"scripts": {
"start": "webpack-dev-server --open",
"start": "webpack serve --open",
"webpack": "webpack --colour"
},
"keywords": [],
Expand All @@ -21,12 +21,8 @@
"@finos/perspective-webpack-plugin": "^0.8.0",
"@types/react": "^16.8.6",
"@types/react-dom": "^16.9.4",
"css-loader": "^0.28.7",
"html-webpack-plugin": "^3.2.0",
"source-map-loader": "^0.2.4",
"style-loader": "^0.18.2",
"ts-loader": "^6.2.1",
"typescript": "^3.7.4",
"webpack-dev-server": "^3.11.2"
"typescript": "^3.7.4"
}
}
2 changes: 1 addition & 1 deletion examples/react/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = {
{
test: /\.ts(x?)$/,
exclude: /node_modules/,
loader: ["ts-loader"]
loader: "ts-loader"
},
{
test: /\.css$/,
Expand Down
2 changes: 1 addition & 1 deletion examples/remote-workspace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.8.0",
"description": "An example app built using `@finos/perspective-workspace`.",
"scripts": {
"start:server": "webpack-dev-server --open",
"start:server": "webpack serve --open",
"start:client": "node server.js",
"start": "npm-run-all -p start:server start:client"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/remote-workspace/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const perspective = require("@finos/perspective");
const {securities} = require("../datasources");

const host = new perspective.WebSocketServer();
const host = new perspective.WebSocketServer({port: 8081});
securities().then(table => host.host_table("securities_table", table));
8 changes: 8 additions & 0 deletions examples/remote-workspace/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
</body>
</html>
8 changes: 4 additions & 4 deletions examples/remote-workspace/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import "@finos/perspective-workspace";

import "./index.less";

window.addEventListener("load", async () => {
const websocket = perspective.websocket("ws://localhost:8080");
window.addEventListener("DOMContentLoaded", async () => {
const websocket = perspective.websocket("ws://localhost:8081");
const worker = perspective.shared_worker();
const view = websocket.open_view("securities");
const table = await worker.table(view, {limit: 10000});
const server_table = websocket.open_table("securities_table");
const table = await worker.table(await server_table.view(), {limit: 10000});

const workspace = document.createElement("perspective-workspace");
document.body.appendChild(workspace);
Expand Down
7 changes: 6 additions & 1 deletion examples/remote-workspace/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

const PerspectivePlugin = require("@finos/perspective-webpack-plugin");
const HtmlWebPackPlugin = require("html-webpack-plugin");
const path = require("path");

module.exports = {
mode: process.env.NODE_ENV || "development",
Expand All @@ -18,7 +19,8 @@ module.exports = {
},
plugins: [
new HtmlWebPackPlugin({
title: "Workspace Example"
title: "Workspace Example",
template: "./src/index.html"
}),
new PerspectivePlugin({})
],
Expand All @@ -30,5 +32,8 @@ module.exports = {
}
]
},
devServer: {
contentBase: [path.join(__dirname, "dist"), path.join(__dirname, "../../node_modules/superstore-arrow")]
},
devtool: "source-map"
};
24 changes: 3 additions & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8930,7 +8930,7 @@ html-minifier-terser@^5.0.1:
relateurl "^0.2.7"
terser "^4.6.3"

html-minifier@^3.2.3, html-minifier@^3.5.8:
html-minifier@^3.5.8:
version "3.5.21"
resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.21.tgz#d0040e054730e354db008463593194015212d20c"
integrity sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA==
Expand All @@ -8943,19 +8943,6 @@ html-minifier@^3.2.3, html-minifier@^3.5.8:
relateurl "0.2.x"
uglify-js "3.4.x"

html-webpack-plugin@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz#b01abbd723acaaa7b37b6af4492ebda03d9dd37b"
integrity sha1-sBq71yOsqqeze2r0SS69oD2d03s=
dependencies:
html-minifier "^3.2.3"
loader-utils "^0.2.16"
lodash "^4.17.3"
pretty-error "^2.0.2"
tapable "^1.0.0"
toposort "^1.0.0"
util.promisify "1.0.0"

html-webpack-plugin@^4.5.1:
version "4.5.1"
resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.5.1.tgz#40aaf1b5cb78f2f23a83333999625c20929cda65"
Expand Down Expand Up @@ -11202,7 +11189,7 @@ lodash.uniq@^4.5.0:
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=

lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.2.1, lodash@~4.17.10:
lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.4, lodash@^4.2.1, lodash@~4.17.10:
version "4.17.20"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
Expand Down Expand Up @@ -13885,7 +13872,7 @@ prettier@^1.19.1:
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==

pretty-error@^2.0.2, pretty-error@^2.1.1:
pretty-error@^2.1.1:
version "2.1.2"
resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.2.tgz#be89f82d81b1c86ec8fdfbc385045882727f93b6"
integrity sha512-EY5oDzmsX5wvuynAByrmY0P0hcp+QpnAKbJng2A2MPjVKXCxrDSUkzghVJ4ZGPIv+JC4gX8fPUWscC0RtjsWGw==
Expand Down Expand Up @@ -16427,11 +16414,6 @@ toml@^2.3.2:
resolved "https://registry.yarnpkg.com/toml/-/toml-2.3.6.tgz#25b0866483a9722474895559088b436fd11f861b"
integrity sha512-gVweAectJU3ebq//Ferr2JUY4WKSDe5N+z0FvjDncLGyHmIDoxgY/2Ie4qfEIDm4IS7OA6Rmdm7pdEEdMcV/xQ==

toposort@^1.0.0:
version "1.0.7"
resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.7.tgz#2e68442d9f64ec720b8cc89e6443ac6caa950029"
integrity sha1-LmhELZ9k7HILjMieZEOsbKqVACk=

tough-cookie@^2.3.3, tough-cookie@~2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2"
Expand Down

0 comments on commit ef56e79

Please sign in to comment.