mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Faster builds all around.
Summary: Building: - Builds no longer wait for tsc for either client, server, or test targets. All use esbuild which is very fast. - Build still runs tsc, but only to report errors. This may be turned off with `SKIP_TSC=1` env var. - Grist-core continues to build using tsc. - Esbuild requires ES6 module semantics. Typescript's esModuleInterop is turned on, so that tsc accepts and enforces correct usage. - Client-side code is watched and bundled by webpack as before (using esbuild-loader) Code changes: - Imports must now follow ES6 semantics: `import * as X from ...` produces a module object; to import functions or class instances, use `import X from ...`. - Everything is now built with isolatedModules flag. Some exports were updated for it. Packages: - Upgraded browserify dependency, and related packages (used for the distribution-building step). - Building the distribution now uses esbuild's minification. babel-minify is no longer used. Test Plan: Should have no behavior changes, existing tests should pass, and docker image should build too. Reviewers: georgegevoian Reviewed By: georgegevoian Subscribers: alexmojaki Differential Revision: https://phab.getgrist.com/D3506
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
import * as dispose from 'app/client/lib/dispose';
|
||||
import * as dom from 'app/client/lib/dom';
|
||||
import dom from 'app/client/lib/dom';
|
||||
import {timeFormat} from 'app/common/timeFormat';
|
||||
import * as ko from 'knockout';
|
||||
import map = require('lodash/map');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as BaseView from 'app/client/components/BaseView';
|
||||
import BaseView from 'app/client/components/BaseView';
|
||||
import {GristDoc} from 'app/client/components/GristDoc';
|
||||
import {consolidateValues, formatPercent, sortByXValues, splitValuesByIndex,
|
||||
uniqXValues} from 'app/client/lib/chartUtil';
|
||||
@@ -6,7 +6,7 @@ import {Delay} from 'app/client/lib/Delay';
|
||||
import {Disposable} from 'app/client/lib/dispose';
|
||||
import {fromKoSave} from 'app/client/lib/fromKoSave';
|
||||
import {loadPlotly, PlotlyType} from 'app/client/lib/imports';
|
||||
import * as DataTableModel from 'app/client/models/DataTableModel';
|
||||
import DataTableModel from 'app/client/models/DataTableModel';
|
||||
import {ColumnRec, ViewFieldRec, ViewSectionRec} from 'app/client/models/DocModel';
|
||||
import {reportError} from 'app/client/models/errors';
|
||||
import {KoSaveableObservable, ObjObservable, setSaveValue} from 'app/client/models/modelUtil';
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
*/
|
||||
|
||||
|
||||
import * as BaseView from 'app/client/components/BaseView';
|
||||
import BaseView from 'app/client/components/BaseView';
|
||||
import * as commands from 'app/client/components/commands';
|
||||
import * as BaseRowModel from 'app/client/models/BaseRowModel';
|
||||
import BaseRowModel from 'app/client/models/BaseRowModel';
|
||||
import {LazyArrayModel} from 'app/client/models/DataTableModel';
|
||||
import type {RowId} from 'app/client/models/rowset';
|
||||
import {Disposable} from 'grainjs';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as BaseView from 'app/client/components/BaseView';
|
||||
import BaseView from 'app/client/components/BaseView';
|
||||
import {Cursor} from 'app/client/components/Cursor';
|
||||
import * as commands from 'app/client/components/commands';
|
||||
import {GristDoc} from 'app/client/components/GristDoc';
|
||||
@@ -7,9 +7,9 @@ import {ConfigNotifier, CustomSectionAPIImpl, GristDocAPIImpl, GristViewImpl,
|
||||
WidgetFrame} from 'app/client/components/WidgetFrame';
|
||||
import {CustomSectionElement, ViewProcess} from 'app/client/lib/CustomSectionElement';
|
||||
import {Disposable} from 'app/client/lib/dispose';
|
||||
import * as dom from 'app/client/lib/dom';
|
||||
import dom from 'app/client/lib/dom';
|
||||
import * as kd from 'app/client/lib/koDom';
|
||||
import * as DataTableModel from 'app/client/models/DataTableModel';
|
||||
import DataTableModel from 'app/client/models/DataTableModel';
|
||||
import {ViewSectionRec} from 'app/client/models/DocModel';
|
||||
import {CustomViewSectionDef} from 'app/client/models/entities/ViewSectionRec';
|
||||
import {UserError} from 'app/client/models/errors';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import {AccessRules} from 'app/client/aclui/AccessRules';
|
||||
import {ActionLog} from 'app/client/components/ActionLog';
|
||||
import * as BaseView from 'app/client/components/BaseView';
|
||||
import BaseView from 'app/client/components/BaseView';
|
||||
import {isNumericLike, isNumericOnly} from 'app/client/components/ChartView';
|
||||
import {CodeEditorPanel} from 'app/client/components/CodeEditorPanel';
|
||||
import * as commands from 'app/client/components/commands';
|
||||
@@ -27,7 +27,7 @@ import {createSessionObs} from 'app/client/lib/sessionObs';
|
||||
import {setTestState} from 'app/client/lib/testState';
|
||||
import {selectFiles} from 'app/client/lib/uploads';
|
||||
import {reportError} from 'app/client/models/AppModel';
|
||||
import * as DataTableModel from 'app/client/models/DataTableModel';
|
||||
import DataTableModel from 'app/client/models/DataTableModel';
|
||||
import {DataTableModelWithDiff} from 'app/client/models/DataTableModelWithDiff';
|
||||
import {DocData} from 'app/client/models/DocData';
|
||||
import {DocInfoRec, DocModel, ViewRec, ViewSectionRec} from 'app/client/models/DocModel';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {DataRowModel} from "app/client/models/DataRowModel";
|
||||
import * as DataTableModel from "app/client/models/DataTableModel";
|
||||
import DataTableModel from "app/client/models/DataTableModel";
|
||||
import {DocModel} from 'app/client/models/DocModel';
|
||||
import {ColumnRec} from "app/client/models/entities/ColumnRec";
|
||||
import {TableRec} from "app/client/models/entities/TableRec";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {CustomView} from 'app/client/components/CustomView';
|
||||
import {DataRowModel} from 'app/client/models/DataRowModel';
|
||||
import * as DataTableModel from 'app/client/models/DataTableModel';
|
||||
import DataTableModel from 'app/client/models/DataTableModel';
|
||||
import {ViewSectionRec} from 'app/client/models/DocModel';
|
||||
import {dom} from 'grainjs';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as BaseView from 'app/client/components/BaseView';
|
||||
import BaseView from 'app/client/components/BaseView';
|
||||
import {ChartView} from 'app/client/components/ChartView';
|
||||
import * as commands from 'app/client/components/commands';
|
||||
import {CustomView} from 'app/client/components/CustomView';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// This module is unused except to group some modules for a webpack bundle.
|
||||
// TODO It is a vestige of the old ViewPane.js, and can go away with some bundling improvements.
|
||||
|
||||
import * as ViewConfigTab from 'app/client/components/ViewConfigTab';
|
||||
import ViewConfigTab from 'app/client/components/ViewConfigTab';
|
||||
import * as FieldConfig from 'app/client/ui/FieldConfig';
|
||||
export {ViewConfigTab, FieldConfig};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as BaseView from 'app/client/components/BaseView';
|
||||
import BaseView from 'app/client/components/BaseView';
|
||||
import {GristDoc} from 'app/client/components/GristDoc';
|
||||
import {get as getBrowserGlobals} from 'app/client/lib/browserGlobals';
|
||||
import {ColumnRec, ViewSectionRec} from 'app/client/models/DocModel';
|
||||
|
||||
16
app/client/declarations.d.ts
vendored
16
app/client/declarations.d.ts
vendored
@@ -33,10 +33,10 @@ declare module "app/client/components/BaseView" {
|
||||
import {Cursor, CursorPos} from 'app/client/components/Cursor';
|
||||
import {GristDoc} from 'app/client/components/GristDoc';
|
||||
import {Disposable} from 'app/client/lib/dispose';
|
||||
import * as BaseRowModel from "app/client/models/BaseRowModel";
|
||||
import BaseRowModel from "app/client/models/BaseRowModel";
|
||||
import {DataRowModel} from 'app/client/models/DataRowModel';
|
||||
import {LazyArrayModel} from "app/client/models/DataTableModel";
|
||||
import * as DataTableModel from "app/client/models/DataTableModel";
|
||||
import DataTableModel from "app/client/models/DataTableModel";
|
||||
import {ViewSectionRec} from "app/client/models/DocModel";
|
||||
import {FilterInfo} from 'app/client/models/entities/ViewSectionRec';
|
||||
import {SortedRowSet} from 'app/client/models/rowset';
|
||||
@@ -141,7 +141,7 @@ declare module "app/client/components/commands" {
|
||||
|
||||
declare module "app/client/models/BaseRowModel" {
|
||||
import {Disposable} from 'app/client/lib/dispose';
|
||||
import * as TableModel from 'app/client/models/TableModel';
|
||||
import TableModel from 'app/client/models/TableModel';
|
||||
import {ColValues} from 'app/common/DocActions';
|
||||
|
||||
namespace BaseRowModel {}
|
||||
@@ -158,7 +158,7 @@ declare module "app/client/models/BaseRowModel" {
|
||||
}
|
||||
|
||||
declare module "app/client/models/MetaRowModel" {
|
||||
import * as BaseRowModel from "app/client/models/BaseRowModel";
|
||||
import BaseRowModel from "app/client/models/BaseRowModel";
|
||||
namespace MetaRowModel {}
|
||||
class MetaRowModel extends BaseRowModel {
|
||||
public _isDeleted: ko.Observable<boolean>;
|
||||
@@ -246,10 +246,10 @@ declare module "app/client/models/TableModel" {
|
||||
declare module "app/client/models/MetaTableModel" {
|
||||
import {KoArray} from "app/client/lib/koArray";
|
||||
import {DocModel} from "app/client/models/DocModel";
|
||||
import * as MetaRowModel from "app/client/models/MetaRowModel";
|
||||
import MetaRowModel from "app/client/models/MetaRowModel";
|
||||
import {RowSource} from "app/client/models/rowset";
|
||||
import {TableData} from "app/client/models/TableData";
|
||||
import * as TableModel from "app/client/models/TableModel";
|
||||
import TableModel from "app/client/models/TableModel";
|
||||
import {CellValue} from "app/common/DocActions";
|
||||
|
||||
namespace MetaTableModel {}
|
||||
@@ -270,12 +270,12 @@ declare module "app/client/models/MetaTableModel" {
|
||||
|
||||
declare module "app/client/models/DataTableModel" {
|
||||
import {KoArray} from "app/client/lib/koArray";
|
||||
import * as BaseRowModel from "app/client/models/BaseRowModel";
|
||||
import BaseRowModel from "app/client/models/BaseRowModel";
|
||||
import {DocModel, TableRec} from "app/client/models/DocModel";
|
||||
import {TableQuerySets} from 'app/client/models/QuerySet';
|
||||
import {SortedRowSet} from "app/client/models/rowset";
|
||||
import {TableData} from "app/client/models/TableData";
|
||||
import * as TableModel from "app/client/models/TableModel";
|
||||
import TableModel from "app/client/models/TableModel";
|
||||
import {UIRowId} from "app/common/UIRowId";
|
||||
|
||||
namespace DataTableModel {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
import { ClientScope } from 'app/client/components/ClientScope';
|
||||
import { get as getBrowserGlobals } from 'app/client/lib/browserGlobals';
|
||||
import * as dom from 'app/client/lib/dom';
|
||||
import dom from 'app/client/lib/dom';
|
||||
import * as Mousetrap from 'app/client/lib/Mousetrap';
|
||||
import { ActionRouter } from 'app/common/ActionRouter';
|
||||
import { BaseComponent, BaseLogger, createRpcLogger, PluginInstance, warnIfNotReady } from 'app/common/PluginInstance';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as DataTableModel from 'app/client/models/DataTableModel';
|
||||
import DataTableModel from 'app/client/models/DataTableModel';
|
||||
import { ColumnGetter, ColumnGetters } from 'app/common/ColumnGetters';
|
||||
import * as gristTypes from 'app/common/gristTypes';
|
||||
import { choiceGetter } from 'app/common/SortFunc';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { KoArray } from 'app/client/lib/koArray';
|
||||
import * as koUtil from 'app/client/lib/koUtil';
|
||||
import * as BaseRowModel from 'app/client/models/BaseRowModel';
|
||||
import * as DataTableModel from 'app/client/models/DataTableModel';
|
||||
import BaseRowModel from 'app/client/models/BaseRowModel';
|
||||
import DataTableModel from 'app/client/models/DataTableModel';
|
||||
import { IRowModel } from 'app/client/models/DocModel';
|
||||
import { ValidationRec } from 'app/client/models/entities/ValidationRec';
|
||||
import * as modelUtil from 'app/client/models/modelUtil';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as BaseRowModel from "app/client/models/BaseRowModel";
|
||||
import * as DataTableModel from 'app/client/models/DataTableModel';
|
||||
import BaseRowModel from "app/client/models/BaseRowModel";
|
||||
import DataTableModel from 'app/client/models/DataTableModel';
|
||||
import { DocModel } from 'app/client/models/DocModel';
|
||||
import { TableRec } from 'app/client/models/entities/TableRec';
|
||||
import { TableQuerySets } from 'app/client/models/QuerySet';
|
||||
|
||||
@@ -16,11 +16,11 @@ import * as ko from 'knockout';
|
||||
|
||||
import * as koArray from 'app/client/lib/koArray';
|
||||
import * as koUtil from 'app/client/lib/koUtil';
|
||||
import * as DataTableModel from 'app/client/models/DataTableModel';
|
||||
import DataTableModel from 'app/client/models/DataTableModel';
|
||||
import {DocData} from 'app/client/models/DocData';
|
||||
import {urlState} from 'app/client/models/gristUrlState';
|
||||
import * as MetaRowModel from 'app/client/models/MetaRowModel';
|
||||
import * as MetaTableModel from 'app/client/models/MetaTableModel';
|
||||
import MetaRowModel from 'app/client/models/MetaRowModel';
|
||||
import MetaTableModel from 'app/client/models/MetaTableModel';
|
||||
import * as rowset from 'app/client/models/rowset';
|
||||
import {isHiddenTable, isRawTable} from 'app/common/isHiddenTable';
|
||||
import {schema, SchemaTypes} from 'app/common/schema';
|
||||
|
||||
@@ -13,7 +13,7 @@ import {SortPref, UserOrgPrefs, ViewPref} from 'app/common/Prefs';
|
||||
import * as roles from 'app/common/roles';
|
||||
import {Document, Organization, Workspace} from 'app/common/UserAPI';
|
||||
import {bundleChanges, Computed, Disposable, Observable, subscribe} from 'grainjs';
|
||||
import * as moment from 'moment';
|
||||
import moment from 'moment';
|
||||
import flatten = require('lodash/flatten');
|
||||
import sortBy = require('lodash/sortBy');
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* TODO: client-side should show "..." or "50000 more rows not shown" in that case.
|
||||
* TODO: Reference columns don't work properly because always use a displayCol which relies on formulas
|
||||
*/
|
||||
import * as DataTableModel from 'app/client/models/DataTableModel';
|
||||
import DataTableModel from 'app/client/models/DataTableModel';
|
||||
import {DocModel} from 'app/client/models/DocModel';
|
||||
import {BaseFilteredRowSource, RowId, RowList, RowSource} from 'app/client/models/rowset';
|
||||
import {TableData} from 'app/client/models/TableData';
|
||||
|
||||
@@ -4,7 +4,7 @@ import {ColumnRec, ValidationRec, ViewRec} from 'app/client/models/DocModel';
|
||||
import * as modelUtil from 'app/client/models/modelUtil';
|
||||
import {MANUALSORT} from 'app/common/gristTypes';
|
||||
import * as ko from 'knockout';
|
||||
import * as randomcolor from 'randomcolor';
|
||||
import randomcolor from 'randomcolor';
|
||||
|
||||
// Represents a user-defined table.
|
||||
export interface TableRec extends IRowModel<"_grist_Tables"> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as BaseView from 'app/client/components/BaseView';
|
||||
import BaseView from 'app/client/components/BaseView';
|
||||
import {CursorPos} from 'app/client/components/Cursor';
|
||||
import {FilterColValues, LinkingState} from 'app/client/components/LinkingState';
|
||||
import {KoArray} from 'app/client/lib/koArray';
|
||||
|
||||
@@ -12,7 +12,7 @@ import {buildUrlId, parseUrlId} from 'app/common/gristUrls';
|
||||
import {StringUnion} from 'app/common/StringUnion';
|
||||
import {DocSnapshot} from 'app/common/UserAPI';
|
||||
import {Disposable, dom, IDomComponent, MultiHolder, Observable, styled} from 'grainjs';
|
||||
import * as moment from 'moment';
|
||||
import moment from 'moment';
|
||||
|
||||
const DocHistorySubTab = StringUnion("activity", "snapshots");
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import * as browserGlobals from 'app/client/lib/browserGlobals';
|
||||
import * as dom from 'app/client/lib/dom';
|
||||
import dom from 'app/client/lib/dom';
|
||||
const G = browserGlobals.get('document', 'window');
|
||||
|
||||
export interface FileDialogOptions {
|
||||
|
||||
@@ -3,7 +3,7 @@ import {duplicatePage} from 'app/client/components/duplicatePage';
|
||||
import {GristDoc} from 'app/client/components/GristDoc';
|
||||
import {PageRec} from 'app/client/models/DocModel';
|
||||
import {urlState} from 'app/client/models/gristUrlState';
|
||||
import * as MetaTableModel from 'app/client/models/MetaTableModel';
|
||||
import MetaTableModel from 'app/client/models/MetaTableModel';
|
||||
import {find as findInTree, fromTableData, TreeItemRecord, TreeRecord,
|
||||
TreeTableData} from 'app/client/models/TreeModel';
|
||||
import {TreeViewComponent} from 'app/client/ui/TreeViewComponent';
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
import * as commands from 'app/client/components/commands';
|
||||
import {GristDoc, IExtraTool, TabContent} from 'app/client/components/GristDoc';
|
||||
import * as RefSelect from 'app/client/components/RefSelect';
|
||||
import * as ViewConfigTab from 'app/client/components/ViewConfigTab';
|
||||
import RefSelect from 'app/client/components/RefSelect';
|
||||
import ViewConfigTab from 'app/client/components/ViewConfigTab';
|
||||
import {domAsync} from 'app/client/lib/domAsync';
|
||||
import * as imports from 'app/client/lib/imports';
|
||||
import {createSessionObs} from 'app/client/lib/sessionObs';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { ColumnRec, DocModel, TableRec, ViewSectionRec } from 'app/client/models
|
||||
import { IPageWidget } from 'app/client/ui/PageWidgetPicker';
|
||||
import { getReferencedTableId } from 'app/common/gristTypes';
|
||||
import { IOptionFull } from 'grainjs';
|
||||
import * as assert from 'assert';
|
||||
import assert from 'assert';
|
||||
import * as gutil from "app/common/gutil";
|
||||
|
||||
// some unicode characters
|
||||
|
||||
@@ -4,7 +4,7 @@ import { FormulaTransform } from 'app/client/components/FormulaTransform';
|
||||
import { GristDoc } from 'app/client/components/GristDoc';
|
||||
import { addColTypeSuffix } from 'app/client/components/TypeConversion';
|
||||
import { TypeTransform } from 'app/client/components/TypeTransform';
|
||||
import * as dom from 'app/client/lib/dom';
|
||||
import dom from 'app/client/lib/dom';
|
||||
import { KoArray } from 'app/client/lib/koArray';
|
||||
import * as kd from 'app/client/lib/koDom';
|
||||
import * as kf from 'app/client/lib/koForm';
|
||||
|
||||
Reference in New Issue
Block a user