Repository navigation
feat(core)!: hooks as pre-commit consultation, events as announcement; drop legacy hook aliases - #19
Merged
Merged
Conversation
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 47 minutes. View limit details
TanStack is on CodeRabbit Free, which includes PR summaries. Ask your admin to upgrade for code reviews.
|
🦋 Changeset detectedLatest commit: 663eb51 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
cursor
Bot
force-pushed
the
cursor/hooks-events-framing-7523
branch
2 times, most recently
from
November 6, 2026 02:09
21bf531 to
0b17ec3
Compare
cursor
Bot
changed the base branch from
main
to
cursor/collections-array-0f74
November 6, 2026 02:09
jherr
force-pushed
the
cursor/collections-array-0f74
branch
from
November 6, 2026 02:24
4c9af65 to
b6447c1
Compare
…recate afterChange/afterDelete Remove beforeValidate/beforeChange/beforeDelete/afterRead from CollectionHooks and the store runners (use preValidate/postValidate/preDelete/postRead). Outside production, a hook slower than the 50ms guideline logs one warning per collection.stage per process. Mark afterChange/afterDelete @deprecated in favour of durable defineEventHandler handlers. Co-authored-by: jherr <jherr@pobox.com>
…mit announcement Lead events-and-hooks with the before/after-the-game model, document the dev slow-hook warning, the afterChange/afterDelete deprecation and its event-handler replacement, and migrate docs, the Payload skill, and the redirects cms-skill off the removed alias names. Add the cms-core changeset. Co-authored-by: jherr <jherr@pobox.com>
InterfaceView opens its EventSource in a passive effect keyed on the loaded view, which can run after the heading is found; the test then read an unset Stream.current (about 1 in 10 runs). Co-authored-by: jherr <jherr@pobox.com>
Co-authored-by: jherr <jherr@pobox.com>
jherr
force-pushed
the
cursor/hooks-events-framing-7523
branch
from
November 6, 2026 02:39
0b17ec3 to
663eb51
Compare
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.
Implements cms-refactor-plan.md § Phase 1c (item 11, part).
Stack: S1 #20 → S2 #21 → 1c (this PR). It's based on
cursor/collections-array-0f74, so merge #21 first. Two core tests clashed with S2:readiness.test.ts, and the newslow-hooks.test.ts, which still used the name-keyedcollectionsobject. Stacking this PR on S2 fixes both.What
docs/architecture/events-and-hooks.mdleads with this framing.collections-and-fields,cms-core,cms-core-server,building-pages,review-queue,overviewandfrom-payload.redirects-and-broken-linkscms-skill are updated too.CollectionHooksand the store runners. The only uses were in core tests andapp/prm/src/collections.ts, both migrated.runHooktimer. WhenNODE_ENV !== 'production', a hook slower than 50 ms (theSLOW_HOOK_MSconstant) logs one warning per collection and stage per process, even when the hook throws. Tests are inpackages/core/tests/slow-hooks.test.ts.afterChange/afterDeleteare@deprecated. They point todefineEventHandlerondocument.created,document.updatedanddocument.deleted, and they still run. The docs include a before/after..changeset/hooks-events-framing.md(@tanstack/cms-coreminor) lists the mapping and the deprecations. The unreleased.changeset/events-and-hooks.mdno longer promises the aliases stay.Breaking changes
beforeValidatepreValidatebeforeChangepostValidatebeforeDeletepreDeleteafterReadpostReadEach alias ran in the same slot as its replacement.
How verified
nx affected --base=origin/cursor/collections-array-0f74with thetest:prtargets, pluspnpm test:dts. The only failure is the@tanstack/cms-apioxlint error thatmainalready has.NX_BASE=origin/main pnpm test:pracross 39 affected projects showed the same result.pnpm formatis clean.Notes for review
app/base/src/model.tsstill uses the deprecatedafterChange/afterDeletefor its admin audit. It reads the request'scurrentSession(), which an event handler doesn't have. 1e(ii) feat(core)!: split plugins and app configs into a definition and a runtime #25 moves these hooks into the runtime config, and phase 2b replaces them.review.*events, and separatingpostRead.Divergence from plan
None.