Convert backend code to ES modules

Bundling code now with Rollup for its flat bundling and tree shaking
support. Front end code still goes through Webpack for browser support.
This commit is contained in:
Zaid Abdulla committed 2019-02-04 23:47:54 -08:00
1 parent 824639976f
commit 1e41c72d60
62 files changed
+718 -898

No files matched your search

+2 -2
View File
@@ -4,10 +4,10 @@ import m from "mithril";
import * as components from "../components";
import * as taskQueue from "../task-queue";
import longTextComponent from "../long-text-component";
import * as expression from "../../lib/common/expression";
import { parse } from "../../lib/common/expression-parser";
import memoize from "../../lib/common/memoize";
const memoizedParse = memoize(expression.parse);
const memoizedParse = memoize(parse);
function escapeRegExp(str) {
return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
+3 -5
View File
@@ -1,20 +1,20 @@
"use strict";
import m from "mithril";
import * as components from "../components";
import { get } from "../components";
import memoize from "../../lib/common/memoize";
const getChildAttrs = memoize((attrs, device) =>
Object.assign({}, attrs, { device: device })
);
const component = {
export default {
view: vnode => {
const device = vnode.attrs.device;
const rows = Object.values(vnode.attrs.parameters).map(parameter => {
const p = m(
components.get(parameter.type || "parameter"),
get(parameter.type || "parameter"),
getChildAttrs(parameter, device)
);
@@ -33,5 +33,3 @@ const component = {
return m("table.parameter-list", rows);
}
};
export default component;