Skip to content

Move the Collaboration Kit to Signals migration guide to vaadin/docs (no net change here) - #142

Closed
totally-not-ai[bot] wants to merge 7 commits into
mainfrom
docs/collaboration-kit-to-signals-migration-guide
Closed

Move the Collaboration Kit to Signals migration guide to vaadin/docs (no net change here)#142
totally-not-ai[bot] wants to merge 7 commits into
mainfrom
docs/collaboration-kit-to-signals-migration-guide

Conversation

@totally-not-ai

@totally-not-ai totally-not-ai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Summary

This branch is a no-op against origin/maingit diff origin/main...HEAD is empty. It exists only as the commit history of a documentation effort that was drafted here and then delivered to its real home in vaadin/docs#5888.

The guide itself, Migrating from Collaboration Kit to Signals, lives entirely in vaadin/docs at articles/tools/collaboration/migrating-to-signals.adoc. Nothing in this repository is added, changed, or removed.

Why the round trip

At the time the writing started, this repository was the only one the change could be committed to, so the article was staged under docs/vaadin-docs/ with a README describing how to copy it across. Later, a GITHUB_TOKEN expired between committing and pushing a follow-up rewrite, so that patch was parked under pending-vaadin-docs/ to keep the work from being lost. Both holding directories have now served their purpose and were deleted once the content landed in vaadin/docs.

What the delivered guide covers

For reviewers who want the substance rather than the file moves, the article that landed in vaadin/docs maps every Collaboration Kit concept onto its shared signals equivalent:

  • Concept mapping and migration steps — topics to an application-scoped signal registry, UserInfo to an application record, PresenceManager/CollaborationAvatarGroup to a SharedListSignal bound with AvatarGroup.bindItems(), collaborative forms, field highlighting, chat and messages, the low-level map/list topic API, and background threads.
  • Gaps and cases that can't be migrated, split into three groups:
    • Blockers: clustering, and session serialization — serializing a shared signal throws NotSerializableException because every public constructor creates the asynchronous tree that refuses serialization, and both view fields and the lambdas captured by bind*() keep the signal reachable from the session, so Kubernetes Kit session replication cannot work.
    • Behavior that has to be rebuilt: connection-scoped cleanup and the tab-close beacon, topic and entry expiration, automatic user color assignment, the field highlighter overlay with multiple editors and sub-field indexes, and the message persister fetch protocol.
    • API-level differences: no TypeReference overloads, no previous value in effects, no list emptiness conditions, no cluster membership events.
  • What isn't a gap — the features that carry over unchanged — plus a feature checklist table.

Corrections made along the way

Several claims and examples were tightened before the content was handed over:

  • Paired retain/release across attach and detach in the topic registry example; registering only a detach listener releases more times than it retains when a view is reattached.
  • Stopped presenting SharedMapSignal.verifyKey() as the counterpart of CollaborationMap.replace() — it verifies that a key maps to a given child signal, not that an entry holds an expected value.
  • Removed the field highlight entry on blur only while it still belongs to the local user, inside a transaction with verifyValue().
  • Guarded the nullable supervisor identifier in the entity-valued field example and cached it so the backend lookup does not run on every unrelated form change.
  • Narrowed the automatic color allocation claim (sequential allocation is local-backend only; the registry never shrinks, so the eighth distinct user since startup collides with the first).
  • Dropped the ListChangeEvent change-type claim: the accessor and enum are package-private, so subscribers cannot read it. What signals actually lack is the previous value and the surrounding keys.
  • Field highlighting now extends FieldHighlighterInitializer rather than issuing a bare executeJs call — the @NpmPackage/@JsModule annotations sit on that class, so without it Flow's production scan drops the module and the custom element is undefined in production. It also fixes re-initialization on reattach, and vaadin-highlight-hide now matches on property and user so two show events without an intervening hide cannot orphan an entry.

Verification

The regenerated patch was applied to a fresh checkout of the vaadin/docs PR branch: vale --config=.vale-pr.ini reports 0 errors, 0 warnings, and 0 suggestions, and asciidoctor -a skip-front-matter renders the file cleanly. Cross-file xref targets were checked by hand, since Asciidoctor on a single file resolves neither {articles} nor inter-document xrefs.

Review notes

There is nothing to review in this repository's tree. Review the documentation in vaadin/docs#5888. This PR can be closed without merging, or merged as an empty history record — whichever the team prefers.

Adds an AsciiDoc article that maps every Collaboration Kit concept to its
shared signals equivalent: topics to an application-scoped signal registry,
UserInfo to an application record, PresenceManager and CollaborationAvatarGroup
to a SharedListSignal bound with AvatarGroup.bindItems(), CollaborationBinder to
a SharedValueSignal with map()/updater() alongside a regular Binder, field
highlighting to CSS bindings, chat to a SharedListSignal with
MessageList.bindItems(), and the low-level map and list APIs operation by
operation. It also states what shared signals do not yet cover: clustering,
connection-scoped cleanup, and topic expiration.

The article targets the vaadin/docs repository, which cannot be pushed to from
here, so it is staged under docs/vaadin-docs/ mirroring its target path, with a
README describing how to copy it over.
…tion guide

- Pair retain/release across attach and detach in the topic registry example.
  Registering only a detach listener releases more times than it retains when a
  view is reattached, dropping shared state that is still in use. Adds a note
  about the grace period a re-attaching view needs.
- Stop presenting SharedMapSignal.verifyKey() as the counterpart of
  CollaborationMap.replace(). It verifies that a key maps to a given child
  signal, not that the entry holds an expected value; replace() or
  verifyValue() on the entry signal are the value-based equivalents.
- Remove the field highlight entry on blur only while it still belongs to the
  local user, in a transaction with verifyValue(), so that blurring does not
  clear an entry a second user has since written.
- Guard the nullable supervisor identifier in the entity-valued field example,
  and cache the identifier so the backend lookup does not run on every change
  to an unrelated form property.
…Kit migration

Adds a 'Gaps and Cases That Can't Be Migrated' section, split into three
groups, and retargets the early triage list at it.

Blockers: clustering, and session serialization. Serializing a shared signal
throws NotSerializableException, since every public constructor creates the
asynchronous tree that refuses serialization; both view fields and the lambdas
captured by bind*() keep the signal reachable from the session, so Kubernetes
Kit session replication cannot work.

Behavior that has to be rebuilt: connection-scoped cleanup and the beacon that
makes tab-close detection prompt, topic and entry expiration, automatic user
color assignment, the field highlighter overlay with multiple editors and
sub-field indexes, and the message persister fetch protocol.

API-level differences: no TypeReference overloads, so parameterized value types
have to be wrapped in a record; no previous value or change type in effects,
unlike MapChangeEvent and ListChangeEvent; no list emptiness conditions; no
cluster membership events.

Also adds a 'What Isn't a Gap' list for the features that carry over unchanged,
and extends the feature checklist with the new rows.
- ListChangeEvent tracks a change type, but the accessor and the enum are
  package-private, so subscribers cannot read it. Drop it from the gap and the
  checklist row: what signals actually lack is the previous value and the
  surrounding keys, both of which are public in Collaboration Kit.
- Narrow the automatic color allocation claim. Sequential allocation applies
  only to the local backend, the registry never shrinks so the eighth distinct
  user since startup collides with the first, and a non-local backend falls
  back to hashing the user id - the same approach the guide suggests.
- CollaborationBinder::forField takes the collection and element types as two
  Class arguments; TypeReference belongs to the topic API. Separate the two.
- Say in the README exactly how the cross-file xref targets were checked, since
  Asciidoctor on a single file resolves neither {articles} nor inter-document
  xrefs.
The guide now lives in vaadin/docs, where it belongs:
vaadin/docs#5888

It was staged here only because this was the repository the change could be
committed to at the time.
The GITHUB_TOKEN expired between committing and pushing the field-highlighting
rewrite for vaadin/docs#5888. Parking the patch here so the work survives; it
should be applied to that PR and this directory deleted.
Four problems in the recipe, all found by checking it against Collaboration
Kit's own implementation:

- The @NpmPackage and @jsmodule annotations for @vaadin/field-highlighter sit
  on FieldHighlighterInitializer. A bare executeJs call never references that
  class, so Flow's production scan drops the module and the custom element is
  undefined in production while development mode works. Removing Collaboration
  Kit removes the only thing that referenced it. The recipe now extends
  FieldHighlighterInitializer, as Collaboration Kit does.
- That also fixes initialization: FieldHighlighterInitializer.init() re-runs on
  every attach, whereas the one-shot executeJs left a re-attached field without
  the focus observer, silently unreported from then on.
- vaadin-highlight-hide removed only the last inserted entry. Two show events
  can arrive without a hide between them - moving between the parts of a
  DateTimePicker - orphaning the earlier entry and leaving a highlight nobody
  can clear. Removal now matches property and user, as FormManager does.
- Collaboration Kit declares vaadin-field-highlighter-flow as provided, so it
  is vaadin-core, not Collaboration Kit, that puts it on the classpath.

Also aligns DocumentState with the list-based editor model, moves the
FormManager tip back to the section level, and restores the heading spacing.

Verified by applying the regenerated patch to a fresh checkout of the PR
branch: Vale reports no errors, warnings, or suggestions, and Asciidoctor
renders the file cleanly.
@totally-not-ai totally-not-ai Bot changed the title docs: add a Collaboration Kit to Signals migration guide staged for vaadin/docs Park an unpushed vaadin/docs patch for the Collaboration Kit to Signals migration guide Aug 21, 2026
@totally-not-ai

Copy link
Copy Markdown
Author

Closing this. The migration guide belongs in vaadin/docs, and that's where it now lives: vaadin/docs#5888.

This PR only ever existed as a holding place — first for the guide itself, then for a patch that couldn't be pushed while a token was expired. That patch has been applied to vaadin/docs#5888, so this branch no longer changes anything in this repository.

Context for anyone following the migration work: vaadin/collaboration-kit#138 and vaadin/flow#23868.

@totally-not-ai totally-not-ai Bot closed this Aug 21, 2026
@totally-not-ai totally-not-ai Bot changed the title Park an unpushed vaadin/docs patch for the Collaboration Kit to Signals migration guide Move the Collaboration Kit to Signals migration guide to vaadin/docs (no net change here) Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants