Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build cleanup #448

Merged
merged 5 commits into from
Feb 25, 2019
Merged
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
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
],
"devDependencies": {
"@apache-arrow/es5-esm": "^0.4.0",
"@babel/core": "^7.1.0",
"@babel/plugin-proposal-decorators": "^7.1.2",
"@babel/plugin-transform-for-of": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.1.0",
"@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.1.5",
"babel-plugin-transform-custom-element-classes": "^0.1.0",
"@babel/cli": "^7.2.3",
"babel-polyfill": "^6.26.0",
"babel-eslint": "^8.2.3",
"babel-jest": "^23.6.0",
"chart.js": "^2.7.1",
Expand All @@ -16,7 +24,6 @@
"eslint": "^4.19.1",
"eslint-config-prettier": "^3.0.1",
"eslint-plugin-prettier": "^2.6.2",
"fast-async": "^6.3.8",
"jest": "^23.6.0",
"js-beautify": "^1.8.6",
"jsdoc": "^3.5.5",
Expand Down
19 changes: 14 additions & 5 deletions packages/perspective-jupyterlab/src/ts/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,22 @@
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/
import {
DOMWidgetModel, DOMWidgetView, ISerializers
} from '@jupyter-widgets/base';

/* defines */
import {DOMWidgetModel, DOMWidgetView, ISerializers} from '@jupyter-widgets/base';

import {PERSPECTIVE_VERSION} from './version';
import {PerspectiveWidget} from '@jpmorganchase/perspective-phosphor';

import perspective from "@jpmorganchase/perspective";
import * as wasm from "arraybuffer-loader!@jpmorganchase/perspective/build/psp.async.wasm";
import * as worker from "file-worker-loader?inline=true!@jpmorganchase/perspective/build/perspective.wasm.worker.js";

if (perspective) {
perspective.override({wasm, worker});
} else {
console.warn('Perspective was undefined - wasm load errors may occur');
}

import {PerspectiveWidget} from '@jpmorganchase/perspective-phosphor/src/ts/index';

export
class PerspectiveModel extends DOMWidgetModel {
Expand Down
5 changes: 0 additions & 5 deletions packages/perspective-phosphor/src/config/plugin.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ const webpack = require("webpack");

module.exports = {
entry: "./src/ts/index.ts",
resolveLoader: {
alias: {
"file-worker-loader": "@jpmorganchase/perspective-webpack-plugin/src/js/psp-worker-loader.js"
}
},
resolve: {
extensions: [".ts", ".js", ".json"]
},
Expand Down
12 changes: 0 additions & 12 deletions packages/perspective-phosphor/src/ts/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ import "@jpmorganchase/perspective-viewer";
import "@jpmorganchase/perspective-viewer-hypergrid";
import "@jpmorganchase/perspective-viewer-highcharts";

import perspective from "@jpmorganchase/perspective";
import * as wasm from "arraybuffer-loader!@jpmorganchase/perspective/build/psp.async.wasm";
import * as worker from "file-worker-loader?inline=true!@jpmorganchase/perspective/build/perspective.wasm.worker.js";

if (perspective) {
perspective.override({ wasm, worker });
} else {
console.warn('Perspective was undefined - wasm load errors may occur');
}
/**************************/


import { Message } from '@phosphor/messaging';
import { Widget } from '@phosphor/widgets';
import { MIME_TYPE, PSP_CLASS, PSP_CONTAINER_CLASS, PSP_CONTAINER_CLASS_DARK } from './utils';
Expand Down
1 change: 0 additions & 1 deletion packages/perspective-viewer-highcharts/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = {
],
sourceType: "unambiguous",
plugins: [
"module:fast-async",
["@babel/plugin-proposal-decorators", {legacy: true}],
"transform-custom-element-classes",
[
Expand Down
13 changes: 8 additions & 5 deletions packages/perspective-viewer-highcharts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@
"name": "@jpmorganchase/perspective-viewer-highcharts",
"version": "0.2.16",
"description": "Perspective.js",
"main": "src/js/highcharts.js",
"main": "cjs/js/highcharts.js",
"browser": "cjs/js/highcharts.js",
"module": "cjs/js/highcharts.js",
"files": [
"build/**/*",
"src/**/*",
"babel.config.js"
"cjs/**/*"
],
"scripts": {
"bench": "npm-run-all bench:build bench:run",
"bench:build": "echo \"No Benchmarks\"",
"bench:run": "echo \"No Benchmarks\"",
"build": "webpack --color --config src/config/highcharts.plugin.config.js",
"prebuild": "mkdir -p cjs",
"build:babel": "cp -r src/* cjs && babel src/js --source-maps --out-dir cjs/js",
"build:webpack": "webpack --color --config src/config/highcharts.plugin.config.js",
"build": "npm-run-all build:babel build:webpack",
"test:build": "cp test/html/* build",
"watch": "webpack --color --watch --config src/config/highcharts.plugin.config.js",
"test:run": "jest --silent --color 2>&1",
Expand Down Expand Up @@ -41,7 +45,6 @@
"dependencies": {
"@jpmorganchase/perspective": "^0.2.16",
"@jpmorganchase/perspective-viewer": "^0.2.16",
"babel-runtime": "^6.26.0",
"chroma-js": "^1.3.4",
"detectie": "1.0.0",
"gradient-parser": "0.1.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require("path");
const common = require("@jpmorganchase/perspective/src/config/common.config.js");

module.exports = Object.assign({}, common(), {
entry: "./src/js/highcharts.js",
entry: "./cjs/js/highcharts.js",
output: {
filename: "highcharts.plugin.js",
library: "perspective-view-highcharts",
Expand Down
2 changes: 1 addition & 1 deletion packages/perspective-viewer-highcharts/src/js/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {COLORS_10, COLORS_20} from "./externals.js";
import {color_axis} from "./color_axis.js";
import {make_tree_data, make_y_data, make_xy_data, make_xyz_data, make_xy_column_data} from "./series.js";
import {set_boost, set_category_axis, set_both_axis, default_config, set_tick_size} from "./config.js";
import {bindTemplate} from "@jpmorganchase/perspective-viewer/src/js/utils";
import {bindTemplate} from "@jpmorganchase/perspective-viewer/cjs/js/utils";
import detectIE from "detectie";

export const PRIVATE = Symbol("Highcharts private");
Expand Down
2 changes: 1 addition & 1 deletion packages/perspective-viewer-highcharts/src/js/series.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function replace_null(str) {
if (str === null) {
return "-";
} else {
return "" + str;
return str;
}
}

Expand Down
7 changes: 7 additions & 0 deletions packages/perspective-viewer-highcharts/test/js/bar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ utils.with_server({}, () => {
await utils.invoke_tooltip(bar, page);
});

test.capture("dates on the x-axis display correctly.", async page => {
const viewer = await page.$("perspective-viewer");
await page.shadow_click("perspective-viewer", "#config_button");
await page.evaluate(element => element.setAttribute("row-pivots", '["Order Date"]'), viewer);
await page.waitForSelector("perspective-viewer:not([updating])");
});

test.capture("tooltip shows proper column labels based on hover target.", async page => {
const viewer = await page.$("perspective-viewer");
await page.shadow_click("perspective-viewer", "#config_button");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,6 @@
"line.html/replaces all rows.": "c799ce879d22a1ca89a6266575920d3a",
"bar.html/perspective dispatches perspective-click event with NO filters.": "bec1634c0b71ce6646b56ddd566bd602",
"bar.html/perspective dispatches perspective-click event with one filter.": "fa2075a72ffbbd0a005c3d8f82c65486",
"bar.html/perspective dispatches perspective-click event with filters.": "04b918cdfdf26d0869182163b9bd0d06"
"bar.html/perspective dispatches perspective-click event with filters.": "04b918cdfdf26d0869182163b9bd0d06",
"bar.html/dates on the x-axis display correctly.": "2e921b758962fa28bf7fd5673c3c3c8e"
}
1 change: 0 additions & 1 deletion packages/perspective-viewer-hypergrid/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = {
],
sourceType: "unambiguous",
plugins: [
"module:fast-async",
["@babel/plugin-proposal-decorators", {legacy: true}],
"transform-custom-element-classes",
[
Expand Down
14 changes: 8 additions & 6 deletions packages/perspective-viewer-hypergrid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@
"name": "@jpmorganchase/perspective-viewer-hypergrid",
"version": "0.2.16",
"description": "Perspective.js",
"main": "src/js/hypergrid.js",
"main": "cjs/js/hypergrid.js",
"module": "cjs/js/hypergrid.js",
"browser": "cjs/js/hypergrid.js",
"files": [
"build/**/*",
"src/**/*",
"babel.config.js"
"cjs/**/*"
],
"scripts": {
"bench": "npm-run-all bench:build bench:run",
"bench:build": "echo \"No Benchmarks\"",
"bench:run": "echo \"No Benchmarks\"",
"build": "webpack --color --config src/config/hypergrid.plugin.config.js",
"prebuild": "mkdir -p cjs",
"build:babel": "cp -r src/* cjs && babel src/js --source-maps --out-dir cjs/js",
"build:webpack": "webpack --color --config src/config/hypergrid.plugin.config.js",
"build": "npm-run-all build:babel build:webpack",
"test:build": "cp test/html/* build",
"test:run": "jest --silent --color",
"test": "npm-run-all test:build test:run",
Expand Down Expand Up @@ -40,8 +44,6 @@
"dependencies": {
"@jpmorganchase/perspective": "^0.2.16",
"@jpmorganchase/perspective-viewer": "^0.2.16",
"babel-polyfill": "^6.26.0",
"babel-runtime": "^6.26.0",
"datasaur-local": "3.0.0",
"fin-hypergrid": "3.2.0",
"fin-hypergrid-grouped-header-plugin": "^1.2.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require("path");
const common = require("@jpmorganchase/perspective/src/config/common.config.js");

module.exports = Object.assign({}, common(), {
entry: "./src/js/hypergrid.js",
entry: "./cjs/js/hypergrid.js",
output: {
filename: "hypergrid.plugin.js",
library: "perspective-view-hypergrid",
Expand Down
2 changes: 1 addition & 1 deletion packages/perspective-viewer-hypergrid/src/js/hypergrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const PerspectiveDataModel = require("./PerspectiveDataModel");
const treeLineRendererPaint = require("./hypergrid-tree-cell-renderer").treeLineRendererPaint;
const {psp2hypergrid} = require("./psp-to-hypergrid");

import {bindTemplate} from "@jpmorganchase/perspective-viewer/src/js/utils.js";
import {bindTemplate} from "@jpmorganchase/perspective-viewer/cjs/js/utils.js";

const TEMPLATE = require("../html/hypergrid.html");

Expand Down
1 change: 0 additions & 1 deletion packages/perspective-viewer/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = {
],
sourceType: "unambiguous",
plugins: [
"module:fast-async",
["@babel/plugin-proposal-decorators", {legacy: true}],
"transform-custom-element-classes",
[
Expand Down
17 changes: 9 additions & 8 deletions packages/perspective-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@
"name": "@jpmorganchase/perspective-viewer",
"version": "0.2.16",
"description": "Perspective.js",
"main": "src/js/viewer.js",
"main": "cjs/js/viewer.js",
"browser": "cjs/js/viewer.js",
"module": "cjs/js/viewer.js",
"files": [
"build/**/*",
"src/**/*",
"babel.config.js",
"cjs/**/*",
"index.d.ts"
],
"typings": "index.d.ts",
"scripts": {
"bench": "npm-run-all bench:build bench:run",
"bench:build": "echo \"No Benchmarks\"",
"bench:run": "echo \"No Benchmarks\"",
"build:webpack": "webpack --color --config src/config/view.config.js",
"build:themes": "webpack --color --config src/config/themes.config.js && rm build/__themes.js",
"build": "npm-run-all build:*",
"prebuild": "mkdir -p cjs",
"build:babel": "cp -r src/* cjs && babel src/js --source-maps --out-dir cjs/js",
"build:webpack:viewer": "webpack --color --config src/config/view.config.js",
"build:webpack:themes": "webpack --color --config src/config/themes.config.js && rm build/__themes.js",
"build": "npm-run-all build:babel build:webpack:*",
"watch": "webpack --color --watch --config src/config/view.config.js",
"test:build": "cp test/html/* build && cp test/csv/* build && cp test/css/* build",
"test:run": "jest --silent --color",
Expand Down Expand Up @@ -48,8 +51,6 @@
"@webcomponents/shadycss": "^1.5.2",
"@webcomponents/webcomponentsjs": "~2.0.4",
"awesomplete": "^1.1.2",
"babel-polyfill": "^6.26.0",
"babel-runtime": "^6.26.0",
"d3-array": "^1.2.1",
"detectie": "1.0.0",
"lodash": "^4.17.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/perspective-viewer/src/config/view.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require("path");
const common = require("@jpmorganchase/perspective/src/config/common.config.js");

module.exports = Object.assign({}, common(), {
entry: "./src/js/viewer.js",
entry: "./cjs/js/viewer.js",
output: {
filename: "perspective.view.js",
libraryTarget: "umd",
Expand Down
1 change: 1 addition & 0 deletions packages/perspective-viewer/src/less/row.less
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
:host #sort_order {
display: none;
font-family: var(--button--font-family, inherit);
margin-right: 4px;
&:before {
content: var(--row-sort-order--before, "-");
}
Expand Down
2 changes: 1 addition & 1 deletion packages/perspective-viewer/src/less/viewer.less
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
white-space: nowrap;
}
#sort perspective-row {
--sort_order-display: inline-block;
--sort_order-display: inline;
--sort_order-padding: 0 0 0 10px;
&[sort-order="asc"] {
--row-sort-order--before: var(--sort-order-asc--before, "\2191");
Expand Down
22 changes: 0 additions & 22 deletions packages/perspective-webpack-plugin/babel.config.js

This file was deleted.

29 changes: 6 additions & 23 deletions packages/perspective-webpack-plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ const PSP_WORKER_LOADER = require.resolve("./src/js/psp-worker-loader");
const WASM_LOADER = require.resolve("./src/js/wasm-loader.js");
const PSP_WORKER_COMPILER_LOADER = require.resolve("./src/js/psp-worker-compiler-loader.js");

const BABEL_CONFIG = require("./babel.config.js");

class PerspectiveWebpackPlugin {
constructor(options = {}) {
this.options = Object.assign(
Expand Down Expand Up @@ -82,26 +80,11 @@ class PerspectiveWebpackPlugin {
});
}

if (!this.options.build_worker) {
rules.push({
test: /\.js$/,
include: this.options.load_path,
exclude: /node_modules[/\\](?!\@jpmorganchase)|psp\.(asmjs|async|sync)\.js|perspective\.(asmjs|wasm)\.worker\.js/,
loader: "babel-loader",
options: BABEL_CONFIG
});
rules.push({
test: /\.js$/,
include: /node_modules[/\\](?!\@jpmorganchase)|psp\.(asmjs|async|sync)\.js|perspective\.(asmjs|wasm)\.worker\.js/,
loader: "source-map-loader"
});
} else {
rules.push({
test: /\.js$/,
loader: "source-map-loader"
});
}

rules.push({
test: /\.js$/,
loader: "source-map-loader"
});

// FIXME Workaround for performance regression in @apache-arrow 4.0
rules.push({
test: /\.js$/,
Expand All @@ -112,7 +95,7 @@ class PerspectiveWebpackPlugin {
loader: "string-replace-loader",
options: {
search: "BaseVector.prototype[Symbol.isConcatSpreadable] = true;",
replace: ''
replace: ""
}
}
]
Expand Down
Loading