Skip to content

Conversation

@doodlewind
Copy link
Collaborator

@doodlewind doodlewind commented Mar 20, 2024

This continues from #6167 and removes the requirement for ensuring non-empty doc to be attached to editor.

Before:

const editor = new AffineEditorContainer();
// ...load the doc in either sync or async way

// after the doc is loaded
editor.doc = doc;

After:

const editor = new AffineEditorContainer();
const doc = collection.createDoc();
editor.doc = doc;

// load or create the doc, content will be streamed
// after doc loaded from provider, call this line to render it
indexeddbProvider.on('sync', () => {
  doc.load();
})

The slots.ready is now not required to be used in official docs.

A new example shows the basic case using BlockSuite with default yjs providers:

Screen.Recording.2024-03-20.at.5.22.53.PM.mov

@doodlewind doodlewind requested a review from Saul-Mirone as a code owner March 20, 2024 09:28
@vercel
Copy link

vercel bot commented Mar 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blocksuite ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 20, 2024 10:02am
blocksuite-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 20, 2024 10:02am

@doodlewind doodlewind added the notable Major improvement worth emphasizing label Mar 20, 2024
@doodlewind doodlewind merged commit 82c3962 into master Mar 20, 2024
@doodlewind doodlewind deleted the doodle/refactor branch March 20, 2024 09:55
Brooooooklyn pushed a commit to toeverything/AFFiNE that referenced this pull request Mar 25, 2024
## Features
- toeverything/blocksuite#6544 @golok727
- toeverything/blocksuite#6543 @golok727
- toeverything/blocksuite#6536 @donteatfriedrice
- toeverything/blocksuite#6497 @doouding
- toeverything/blocksuite#6514 @regischen
- toeverything/blocksuite#6523 @donteatfriedrice
- toeverything/blocksuite#6530 @zzj3720
- toeverything/blocksuite#6526 @fourdim
- toeverything/blocksuite#6532 @donteatfriedrice
- toeverything/blocksuite#6493 @golok727
- toeverything/blocksuite#6529 @zzj3720
- toeverything/blocksuite#6528 @zzj3720
- toeverything/blocksuite#6509 @zzj3720
- toeverything/blocksuite#6525 @doodlewind
- toeverything/blocksuite#6502 @donteatfriedrice
- toeverything/blocksuite#6489 @Flrande

## Bugfix
- toeverything/blocksuite#6558 @fourdim
- toeverything/blocksuite#6556 @fourdim
- toeverything/blocksuite#6547 @fundon
- toeverything/blocksuite#6537 @golok727
- toeverything/blocksuite#6531 @donteatfriedrice
- toeverything/blocksuite#6524 @doodlewind
- toeverything/blocksuite#6519 @regischen
- toeverything/blocksuite#6517 @doodlewind
- toeverything/blocksuite#6516 @doodlewind
- toeverything/blocksuite#6510 @donteatfriedrice
- toeverything/blocksuite#6511 @congzhou09
- toeverything/blocksuite#6507 @doouding
- toeverything/blocksuite#6500 @fourdim
- toeverything/blocksuite#6486 @congzhou09
- toeverything/blocksuite#6495 @donteatfriedrice
- toeverything/blocksuite#6488 @Saul-Mirone
- toeverything/blocksuite#6482 @Flrande
- toeverything/blocksuite#6558 @fourdim

## Refactor
- toeverything/blocksuite#6548 @doodlewind
- toeverything/blocksuite#6522 @doodlewind
- toeverything/blocksuite#6518 @regischen
- toeverything/blocksuite#6521 @Saul-Mirone

## Misc
- toeverything/blocksuite#6557 @fourdim
- toeverything/blocksuite#6546 @Flrande
- docs: update package desc
- toeverything/blocksuite#6527 @fourdim
- toeverything/blocksuite#6505 @Brooooooklyn
- toeverything/blocksuite#6503 @fourdim
- v0.13.0
- toeverything/blocksuite#6496 @doodlewind
- toeverything/blocksuite#6562 @donteatfriedrice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notable Major improvement worth emphasizing

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants