(core) Fix imports in DocTour.ts, particularly wildcard lodash import causing a big bundle

Summary: This reduces the size of the bundle 'vendors~GristDoc' from 587036 to 46526. Woops.

Test Plan: this

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D3160
This commit is contained in:
Alex Hall 2021-11-30 13:53:45 +02:00
parent e482427e83
commit 90fdb55bfd

View File

@ -1,13 +1,13 @@
import {DocComm} from "app/client/components/DocComm"; import {Placement} from '@popperjs/core';
import {IOnBoardingMsg, startOnBoarding} from "app/client/ui/OnBoardingPopups"; import {placements} from '@popperjs/core/lib/enums';
import {DocData} from "../../common/DocData"; import {DocComm} from 'app/client/components/DocComm';
import * as _ from "lodash"; import {sameDocumentUrlState} from 'app/client/models/gristUrlState';
import {Placement} from "@popperjs/core"; import {cssButtons, cssLinkBtn, cssLinkIcon} from 'app/client/ui/ExampleCard';
import {placements} from "@popperjs/core/lib/enums"; import {IOnBoardingMsg, startOnBoarding} from 'app/client/ui/OnBoardingPopups';
import {sameDocumentUrlState} from "../models/gristUrlState"; import {IconList, IconName} from 'app/client/ui2018/IconList';
import {dom} from "grainjs"; import {DocData} from 'app/common/DocData';
import {IconList, IconName} from "../ui2018/IconList"; import {dom} from 'grainjs';
import {cssButtons, cssLinkBtn, cssLinkIcon} from "./ExampleCard"; import sortBy = require('lodash/sortBy');
export async function startDocTour(docData: DocData, docComm: DocComm, onFinishCB: () => void) { export async function startDocTour(docData: DocData, docComm: DocComm, onFinishCB: () => void) {
@ -35,7 +35,7 @@ async function makeDocTour(docData: DocData, docComm: DocComm): Promise<IOnBoard
await docComm.waitForInitialization(); await docComm.waitForInitialization();
await docData.fetchTable(tableId); await docData.fetchTable(tableId);
const tableData = docData.getTable(tableId)!; const tableData = docData.getTable(tableId)!;
const result = _.sortBy(tableData.getRowIds(), tableData.getRowPropFunc('manualSort') as any).map(rowId => { const result = sortBy(tableData.getRowIds(), tableData.getRowPropFunc('manualSort') as any).map(rowId => {
function getValue(colId: string): string { function getValue(colId: string): string {
return String(tableData.getValue(rowId, colId) || ""); return String(tableData.getValue(rowId, colId) || "");
} }