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
Closed
Conversation
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.
Author
|
Closing this. The migration guide belongs in 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch is a no-op against
origin/main—git diff origin/main...HEADis 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/docsatarticles/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, aGITHUB_TOKENexpired between committing and pushing a follow-up rewrite, so that patch was parked underpending-vaadin-docs/to keep the work from being lost. Both holding directories have now served their purpose and were deleted once the content landed invaadin/docs.What the delivered guide covers
For reviewers who want the substance rather than the file moves, the article that landed in
vaadin/docsmaps every Collaboration Kit concept onto its shared signals equivalent:UserInfoto an application record,PresenceManager/CollaborationAvatarGroupto aSharedListSignalbound withAvatarGroup.bindItems(), collaborative forms, field highlighting, chat and messages, the low-level map/list topic API, and background threads.NotSerializableExceptionbecause every public constructor creates the asynchronous tree that refuses serialization, and both view fields and the lambdas captured bybind*()keep the signal reachable from the session, so Kubernetes Kit session replication cannot work.TypeReferenceoverloads, no previous value in effects, no list emptiness conditions, no cluster membership events.Corrections made along the way
Several claims and examples were tightened before the content was handed over:
retain/releaseacross attach and detach in the topic registry example; registering only a detach listener releases more times than it retains when a view is reattached.SharedMapSignal.verifyKey()as the counterpart ofCollaborationMap.replace()— it verifies that a key maps to a given child signal, not that an entry holds an expected value.verifyValue().ListChangeEventchange-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.FieldHighlighterInitializerrather than issuing a bareexecuteJscall — the@NpmPackage/@JsModuleannotations 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, andvaadin-highlight-hidenow 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/docsPR branch:vale --config=.vale-pr.inireports 0 errors, 0 warnings, and 0 suggestions, andasciidoctor -a skip-front-matterrenders 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.