mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
feat(editor): feature flag store extension builder (#12235)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced feature flag synchronization for enhanced control over feature availability. - Added new configuration options for store management, allowing initialization and feature flag setup. - **Improvements** - Updated how store extensions are accessed throughout the app for more robust initialization and configuration. - Enhanced workspace entities to support feature flag services, improving flexibility for workspace-specific features. - Centralized configuration of storage implementations for Electron environments. - **Refactor** - Simplified editor module by removing direct feature flag synchronization logic. - Streamlined imports and configuration for storage modules, especially in Electron-based apps. - **Bug Fixes** - Ensured consistent retrieval of store extensions across various modules and platforms. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -252,7 +252,8 @@ framework.scope(ServerScope).override(AuthProvider, resolver => {
|
||||
|
||||
const container = new Container();
|
||||
getStoreManager()
|
||||
.get('store')
|
||||
.config.init()
|
||||
.value.get('store')
|
||||
.forEach(ext => {
|
||||
ext.setup(container);
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { configureElectronStateStorageImpls } from '@affine/core/desktop/storage';
|
||||
import { configureCommonModules } from '@affine/core/modules';
|
||||
import { configureAppTabsHeaderModule } from '@affine/core/modules/app-tabs-header';
|
||||
import { configureDesktopBackupModule } from '@affine/core/modules/backup';
|
||||
@@ -11,7 +12,6 @@ import {
|
||||
configureTraySettingModule,
|
||||
} from '@affine/core/modules/editor-setting';
|
||||
import { configureFindInPageModule } from '@affine/core/modules/find-in-page';
|
||||
import { configureElectronStateStorageImpls } from '@affine/core/modules/storage';
|
||||
import {
|
||||
ClientSchemeProvider,
|
||||
PopupWindowProvider,
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { ThemeProvider } from '@affine/core/components/theme-provider';
|
||||
import { configureElectronStateStorageImpls } from '@affine/core/desktop/storage';
|
||||
import { configureDesktopApiModule } from '@affine/core/modules/desktop-api';
|
||||
import { configureI18nModule, I18nProvider } from '@affine/core/modules/i18n';
|
||||
import {
|
||||
configureElectronStateStorageImpls,
|
||||
configureStorageModule,
|
||||
} from '@affine/core/modules/storage';
|
||||
import { configureStorageModule } from '@affine/core/modules/storage';
|
||||
import { configureEssentialThemeModule } from '@affine/core/modules/theme';
|
||||
import { appInfo } from '@affine/electron-api';
|
||||
import { Framework, FrameworkRoot } from '@toeverything/infra';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useAppSettingHelper } from '@affine/core/components/hooks/affine/use-app-setting-helper';
|
||||
import { WindowsAppControls } from '@affine/core/components/pure/header/windows-app-controls';
|
||||
import { ThemeProvider } from '@affine/core/components/theme-provider';
|
||||
import { configureElectronStateStorageImpls } from '@affine/core/desktop/storage';
|
||||
import { configureAppSidebarModule } from '@affine/core/modules/app-sidebar';
|
||||
import { ShellAppSidebarFallback } from '@affine/core/modules/app-sidebar/views';
|
||||
import {
|
||||
@@ -9,10 +10,7 @@ import {
|
||||
} from '@affine/core/modules/app-tabs-header';
|
||||
import { configureDesktopApiModule } from '@affine/core/modules/desktop-api';
|
||||
import { configureI18nModule, I18nProvider } from '@affine/core/modules/i18n';
|
||||
import {
|
||||
configureElectronStateStorageImpls,
|
||||
configureStorageModule,
|
||||
} from '@affine/core/modules/storage';
|
||||
import { configureStorageModule } from '@affine/core/modules/storage';
|
||||
import { configureAppThemeModule } from '@affine/core/modules/theme';
|
||||
import { Framework, FrameworkRoot } from '@toeverything/infra';
|
||||
|
||||
|
||||
@@ -264,7 +264,8 @@ const frameworkProvider = framework.provider();
|
||||
|
||||
const container = new Container();
|
||||
getStoreManager()
|
||||
.get('store')
|
||||
.config.init()
|
||||
.value.get('store')
|
||||
.forEach(ext => {
|
||||
ext.setup(container);
|
||||
});
|
||||
@@ -309,7 +310,7 @@ const frameworkProvider = framework.provider();
|
||||
collection: workspace.docCollection,
|
||||
schema: getAFFiNEWorkspaceSchema(),
|
||||
markdown,
|
||||
extensions: getStoreManager().get('store'),
|
||||
extensions: getStoreManager().config.init().value.get('store'),
|
||||
});
|
||||
const docsService = workspace.scope.get(DocsService);
|
||||
if (docId) {
|
||||
|
||||
Reference in New Issue
Block a user