feat: bump blocksuite (#5845)

This commit is contained in:
Ayush Agrawal
2024-02-20 18:19:41 +05:30
committed by GitHub
parent a554c8aabe
commit 6fad241350
36 changed files with 187 additions and 179 deletions

View File

@@ -3,8 +3,8 @@
"private": true,
"type": "module",
"devDependencies": {
"@blocksuite/global": "0.12.0-canary-202402091051-49c1eff",
"@blocksuite/store": "0.12.0-canary-202402091051-49c1eff",
"@blocksuite/global": "0.12.0-canary-202402200831-bc2769f",
"@blocksuite/store": "0.12.0-canary-202402200831-bc2769f",
"react": "18.2.0",
"react-dom": "18.2.0",
"vitest": "1.2.2"

View File

@@ -7,6 +7,7 @@ import { isDesktop, isServer } from './constant.js';
import { UaHelper } from './ua-helper.js';
export const blockSuiteFeatureFlags = z.object({
enable_synced_doc_block: z.boolean(),
enable_expand_database_block: z.boolean(),
enable_bultin_ledits: z.boolean(),
});

View File

@@ -17,9 +17,9 @@
"@affine/debug": "workspace:*",
"@affine/env": "workspace:*",
"@affine/templates": "workspace:*",
"@blocksuite/blocks": "0.12.0-canary-202402091051-49c1eff",
"@blocksuite/global": "0.12.0-canary-202402091051-49c1eff",
"@blocksuite/store": "0.12.0-canary-202402091051-49c1eff",
"@blocksuite/blocks": "0.12.0-canary-202402200831-bc2769f",
"@blocksuite/global": "0.12.0-canary-202402200831-bc2769f",
"@blocksuite/store": "0.12.0-canary-202402200831-bc2769f",
"foxact": "^0.2.20",
"jotai": "^2.5.1",
"jotai-effect": "^0.5.0",
@@ -33,8 +33,8 @@
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine/templates": "workspace:*",
"@blocksuite/lit": "0.12.0-canary-202402091051-49c1eff",
"@blocksuite/presets": "0.12.0-canary-202402091051-49c1eff",
"@blocksuite/lit": "0.12.0-canary-202402200831-bc2769f",
"@blocksuite/presets": "0.12.0-canary-202402200831-bc2769f",
"@testing-library/react": "^14.0.0",
"async-call-rpc": "^6.3.1",
"react": "^18.2.0",

View File

@@ -13,8 +13,8 @@ import { Map as YMap } from 'yjs';
import { getLatestVersions } from '../migration/blocksuite';
import { replaceIdMiddleware } from './middleware';
export async function initEmptyPage(page: Page, title?: string) {
await page.load(() => {
export function initEmptyPage(page: Page, title?: string) {
page.load(() => {
const pageBlockId = page.addBlock('affine:page', {
title: new page.Text(title ?? ''),
});

View File

@@ -25,7 +25,7 @@ describe('Workspace System', () => {
const page = workspace.blockSuiteWorkspace.createPage({
id: 'page0',
});
await page.load();
page.load();
page.addBlock('affine:page', {
title: new page.Text('test-page'),
});

View File

@@ -45,7 +45,7 @@ describe('SyncEngine', () => {
const page = workspace.createPage({
id: 'page0',
});
await page.load();
page.load();
const pageBlockId = page.addBlock('affine:page', {
title: new page.Text(''),
});

View File

@@ -38,7 +38,7 @@ describe('SyncPeer', () => {
const page = workspace.createPage({
id: 'page0',
});
await page.load();
page.load();
const pageBlockId = page.addBlock('affine:page', {
title: new page.Text(''),
});
@@ -89,7 +89,7 @@ describe('SyncPeer', () => {
id: 'page0',
});
expect(syncPeer.status.step).toBe(SyncPeerStep.LoadingSubDoc);
await page.load();
page.load();
await syncPeer.waitForSynced();
page.addBlock('affine:page', {
title: new page.Text(''),

View File

@@ -1,4 +1,5 @@
import { DebugLogger } from '@affine/debug';
import { setupEditorFlags } from '@affine/env/global';
import { WorkspaceFlavour } from '@affine/env/workspace';
import { assertEquals } from '@blocksuite/global/utils';
import type { Workspace as BlockSuiteWorkspace } from '@blocksuite/store';
@@ -192,6 +193,8 @@ export class WorkspaceManager {
// apply compatibility fix
fixWorkspaceVersion(workspace.blockSuiteWorkspace.doc);
setupEditorFlags(workspace.blockSuiteWorkspace);
return workspace;
}
}

View File

@@ -32,14 +32,14 @@
}
},
"dependencies": {
"@blocksuite/global": "0.12.0-canary-202402091051-49c1eff",
"@blocksuite/global": "0.12.0-canary-202402200831-bc2769f",
"idb": "^8.0.0",
"nanoid": "^5.0.3",
"y-provider": "workspace:*"
},
"devDependencies": {
"@blocksuite/blocks": "0.12.0-canary-202402091051-49c1eff",
"@blocksuite/store": "0.12.0-canary-202402091051-49c1eff",
"@blocksuite/blocks": "0.12.0-canary-202402200831-bc2769f",
"@blocksuite/store": "0.12.0-canary-202402200831-bc2769f",
"fake-indexeddb": "^5.0.0",
"vite": "^5.0.6",
"vite-plugin-dts": "3.7.2",

View File

@@ -100,7 +100,7 @@ describe('indexeddb provider', () => {
],
});
const page = workspace.createPage({ id: 'page0' });
await page.waitForLoaded();
page.waitForLoaded();
const pageBlockId = page.addBlock('affine:page', { title: '' });
const frameId = page.addBlock('affine:note', {}, pageBlockId);
page.addBlock('affine:paragraph', {}, frameId);
@@ -129,7 +129,7 @@ describe('indexeddb provider', () => {
| WorkspacePersist
| undefined;
assertExists(data);
await testWorkspace.getPage('page0')?.waitForLoaded();
testWorkspace.getPage('page0')?.waitForLoaded();
data.updates.forEach(({ update }) => {
Workspace.Y.applyUpdate(subPage, update);
});
@@ -148,7 +148,7 @@ describe('indexeddb provider', () => {
expect(provider.connected).toBe(false);
{
const page = workspace.createPage({ id: 'page0' });
await page.waitForLoaded();
page.waitForLoaded();
const pageBlockId = page.addBlock('affine:page', { title: '' });
const frameId = page.addBlock('affine:note', {}, pageBlockId);
page.addBlock('affine:paragraph', {}, frameId);
@@ -203,7 +203,7 @@ describe('indexeddb provider', () => {
provider.connect();
{
const page = workspace.createPage({ id: 'page0' });
await page.waitForLoaded();
page.waitForLoaded();
const pageBlockId = page.addBlock('affine:page', { title: '' });
const frameId = page.addBlock('affine:note', {}, pageBlockId);
for (let i = 0; i < 99; i++) {
@@ -369,14 +369,14 @@ describe('subDoc', () => {
const page0 = workspace.createPage({
id: 'page0',
});
await page0.waitForLoaded();
page0.waitForLoaded();
const { paragraphBlockId: paragraphBlockIdPage1 } = initEmptyPage(page0);
const provider = createIndexedDBProvider(workspace.doc, rootDBName);
provider.connect();
const page1 = workspace.createPage({
id: 'page1',
});
await page1.waitForLoaded();
page1.waitForLoaded();
const { paragraphBlockId: paragraphBlockIdPage2 } = initEmptyPage(page1);
await setTimeout(200);
provider.disconnect();
@@ -390,14 +390,14 @@ describe('subDoc', () => {
provider.connect();
await setTimeout(200);
const page0 = newWorkspace.getPage('page0') as Page;
await page0.waitForLoaded();
page0.waitForLoaded();
await setTimeout(200);
{
const block = page0.getBlockById(paragraphBlockIdPage1);
assertExists(block);
}
const page1 = newWorkspace.getPage('page1') as Page;
await page1.waitForLoaded();
page1.waitForLoaded();
await setTimeout(200);
{
const block = page1.getBlockById(paragraphBlockIdPage2);
@@ -410,7 +410,7 @@ describe('subDoc', () => {
describe('utils', () => {
test('download binary', async () => {
const page = workspace.createPage({ id: 'page0' });
await page.waitForLoaded();
page.waitForLoaded();
initEmptyPage(page);
const provider = createIndexedDBProvider(workspace.doc, rootDBName);
provider.connect();

View File

@@ -24,7 +24,7 @@
"build": "vite build"
},
"devDependencies": {
"@blocksuite/store": "0.12.0-canary-202402091051-49c1eff",
"@blocksuite/store": "0.12.0-canary-202402200831-bc2769f",
"vite": "^5.0.6",
"vite-plugin-dts": "3.7.2",
"vitest": "1.2.2",