Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

refactor: monaco lazy load and larger components lazy load

Pranav Cb6141a5077db
diff --git a/packages/nc-gui/app.vue b/packages/nc-gui/app.vue
index 6f4db8dff4..2732a99560 100644
--- a/packages/nc-gui/app.vue
+++ b/packages/nc-gui/app.vue
@@ -137,7 +137,7 @@ const _ = (window as any).ResizeObserver
<NcNuxtLoadingIndicator />
<!-- Command Menu -->
- <CmdK
+ <LazyCmdK
ref="commandPalette"
v-model:open="cmdK"
:scope="activeScope.scope"
@@ -148,9 +148,9 @@ const _ = (window as any).ResizeObserver
@scope="onScope"
/>
<!-- Recent Views. Cycles through recently visited Views -->
- <CmdL v-model:open="cmdL" :set-active-cmd-view="setActiveCmdView" />
+ <LazyCmdL v-model:open="cmdL" :set-active-cmd-view="setActiveCmdView" />
<!-- Documentation. Integrated NocoDB Docs directly inside the Product -->
- <CmdJ v-model:open="cmdJ" :set-active-cmd-view="setActiveCmdView" />
+ <LazyCmdJ v-model:open="cmdJ" :set-active-cmd-view="setActiveCmdView" />
<DashboardFeatureExperimentation v-model:value="isExperimentalFeatureModalOpen" />
</div>
</ErrorBoundary>
diff --git a/packages/nc-gui/components/dashboard/settings/DataSources.vue b/packages/nc-gui/components/dashboard/settings/DataSources.vue
index 3ba3e14bfb..4cb32711f1 100644
--- a/packages/nc-gui/components/dashboard/settings/DataSources.vue
+++ b/packages/nc-gui/components/dashboard/settings/DataSources.vue
@@ -419,7 +419,7 @@ const handleClickRow = (source: SourceType, tab?: string) => {
</div>
</template>
<div class="p-6 h-full">
- <LazyDashboardSettingsMetadata :source-id="activeSource.id" @source-synced="loadBases(true)" />
+ <DashboardSettingsMetadata :source-id="activeSource.id" @source-synced="loadBases(true)" />
</div>
</a-tab-pane>
</NcTabs>
diff --git a/packages/nc-gui/components/smartsheet/FormulaWrapperCell.vue b/packages/nc-gui/components/smartsheet/FormulaWrapperCell.vue
index 8ae16d3132..154a665856 100644
--- a/packages/nc-gui/components/smartsheet/FormulaWrapperCell.vue
+++ b/packages/nc-gui/components/smartsheet/FormulaWrapperCell.vue
@@ -54,23 +54,23 @@ provide(ColumnInj, column)
}"
>
<template v-if="showNull && (ncIsNull(cellValue) || ncIsUndefined(cellValue))">
- <LazyCellText model-value="NULL" />
+ <CellText model-value="NULL" />
</template>
- <LazyCellCheckbox v-else-if="isBoolean(column)" :model-value="cellValue" />
- <LazyCellCurrency v-else-if="isCurrency(column)" :model-value="cellValue" />
- <LazyCellDecimal v-else-if="isDecimal(column)" :model-value="cellValue" />
+ <CellCheckbox v-else-if="isBoolean(column)" :model-value="cellValue" />
+ <CellCurrency v-else-if="isCurrency(column)" :model-value="cellValue" />
+ <CellDecimal v-else-if="isDecimal(column)" :model-value="cellValue" />
<div v-else-if="isPercent(column)" class="flex" :class="{ 'h-[30px] min-h-[30px]': parseProp(column.meta)?.is_progress }">
- <LazyCellPercentReadonly :model-value="cellValue" />
+ <CellPercentReadonly :model-value="cellValue" />
</div>
- <LazyCellRating v-else-if="isRating(column)" :model-value="cellValue" />
- <LazyCellDateReadonly v-else-if="isDate(column, '')" :model-value="cellValue" />
- <LazyCellDateTimeReadonly v-else-if="isDateTime(column, '')" :model-value="cellValue" />
- <LazyCellTime v-else-if="isTime(column, '')" :model-value="cellValue" />
- <LazyCellEmail v-else-if="isEmail(column)" :model-value="cellValue" />
- <LazyCellUrl v-else-if="isURL(column)" :model-value="cellValue" />
- <LazyCellPhoneNumber v-else-if="isPhoneNumber(column)" :model-value="cellValue" />
+ <CellRating v-else-if="isRating(column)" :model-value="cellValue" />
+ <CellDateReadonly v-else-if="isDate(column, '')" :model-value="cellValue" />
+ <CellDateTimeReadonly v-else-if="isDateTime(column, '')" :model-value="cellValue" />
+ <CellTime v-else-if="isTime(column, '')" :model-value="cellValue" />
+ <CellEmail v-else-if="isEmail(column)" :model-value="cellValue" />
+ <CellUrl v-else-if="isURL(column)" :model-value="cellValue" />
+ <CellPhoneNumber v-else-if="isPhoneNumber(column)" :model-value="cellValue" />
<LazyCellTextArea v-else-if="isTextArea(column) && showAsLongText" :model-value="cellValue" />
- <LazyCellText v-else :model-value="cellValue" />
+ <CellText v-else :model-value="cellValue" />
</div>
</template>
diff --git a/packages/nc-gui/components/smartsheet/calendar/SideMenu.vue b/packages/nc-gui/components/smartsheet/calendar/SideMenu.vue
index 7bc62559e6..9b6ef3c72b 100644
--- a/packages/nc-gui/components/smartsheet/calendar/SideMenu.vue
+++ b/packages/nc-gui/components/smartsheet/calendar/SideMenu.vue
@@ -535,7 +535,7 @@ const selectOption = (option) => {
</div>
<template v-else-if="renderData.length > 0">
<div class="gap-2 flex flex-col">
- <LazySmartsheetRow v-for="(record, rowIndex) in renderData" :key="rowIndex" :row="record">
+ <SmartsheetRow v-for="(record, rowIndex) in renderData" :key="rowIndex" :row="record">
<LazySmartsheetCalendarSideRecordCard
:draggable="sideBarFilterOption === 'withoutDates' && activeCalendarView !== 'year'"
:row="record"
@@ -552,7 +552,7 @@ const selectOption = (option) => {
<span class="text-nc-content-gray-muted"> - </span>
</template>
</LazySmartsheetCalendarSideRecordCard>
- </LazySmartsheetRow>
+ </SmartsheetRow>
</div>
</template>
</div>
diff --git a/packages/nc-gui/components/smartsheet/expanded-form/index.vue b/packages/nc-gui/components/smartsheet/expanded-form/index.vue
index 36173cf527..067161d5ac 100644
--- a/packages/nc-gui/components/smartsheet/expanded-form/index.vue
+++ b/packages/nc-gui/components/smartsheet/expanded-form/index.vue
@@ -833,7 +833,7 @@ export default {
class="flex items-center font-bold text-nc-content-gray text-2xl overflow-hidden"
>
<span class="min-w-[120px] md:min-w-[300px]">
- <LazySmartsheetPlainCell v-model="displayValue" :column="displayField" show-tooltip />
+ <SmartsheetPlainCell v-model="displayValue" :column="displayField" show-tooltip />
</span>
</div>
</div>
diff --git a/packages/nc-gui/components/smartsheet/grid/index.vue b/packages/nc-gui/components/smartsheet/grid/index.vue
index 5491567e60..4b508445be 100644
--- a/packages/nc-gui/components/smartsheet/grid/index.vue
+++ b/packages/nc-gui/components/smartsheet/grid/index.vue
@@ -498,7 +498,7 @@ watch([() => view.value?.id, () => meta.value?.columns], async () => {
@update:model-value="addRowExpandOnClose(expandedFormRow)"
/>
</Suspense>
- <SmartsheetExpandedForm
+ <LazySmartsheetExpandedForm
v-if="expandedFormOnRowIdDlg && meta?.id"
ref="expandedFormRef"
v-model="expandedFormOnRowIdDlg"
diff --git a/packages/nc-gui/components/tabs/Smartsheet.vue b/packages/nc-gui/components/tabs/Smartsheet.vue
index 9e3f8fe097..a6e2e7933f 100644
--- a/packages/nc-gui/components/tabs/Smartsheet.vue
+++ b/packages/nc-gui/components/tabs/Smartsheet.vue
@@ -302,8 +302,8 @@ watch(isViewsLoading, async () => {
</Transition>
</div>
</Pane>
- <ExtensionsPane v-if="isPanelExpanded" ref="extensionPaneRef" />
- <ActionsPane v-if="isActionPanelExpanded" ref="actionPaneRef" />
+ <LazyExtensionsPane v-if="isPanelExpanded" ref="extensionPaneRef" />
+ <LazyActionsPane v-if="isActionPanelExpanded" ref="actionPaneRef" />
</Splitpanes>
</NcFullScreen>
diff --git a/packages/nc-gui/components/virtual-cell/Rollup.vue b/packages/nc-gui/components/virtual-cell/Rollup.vue
index 0550a86fcb..58bff2bd23 100644
--- a/packages/nc-gui/components/virtual-cell/Rollup.vue
+++ b/packages/nc-gui/components/virtual-cell/Rollup.vue
@@ -46,7 +46,7 @@ const renderAsTextFun = computed(() => {
<template>
<div @dblclick="activateShowEditNonEditableFieldWarning">
- <LazyCellDecimal v-if="renderAsTextFun.includes((colOptions as RollupType).rollup_function!)" :model-value="value" />
+ <CellDecimal v-if="renderAsTextFun.includes((colOptions as RollupType).rollup_function!)" :model-value="value" />
<LazySmartsheetCell v-else v-model="value" :column="childColumn" :edit-enabled="false" :read-only="true" />
<div v-if="showEditNonEditableFieldWarning" class="text-left text-wrap mt-2 text-[#e65100] text-xs">
{{ $t('msg.info.computedFieldEditWarning') }}