fix(cleanup channels): Reorganize channels feature into dedicated @posthog/core package#3332
Draft
adamleithp wants to merge 3 commits into
Draft
fix(cleanup channels): Reorganize channels feature into dedicated @posthog/core package#3332adamleithp wants to merge 3 commits into
adamleithp wants to merge 3 commits into
Conversation
…src/channels Create a dedicated channels feature so future channel-identity unification is a change to one service's internals rather than to every call site. Pure code relocation with no behavior change; still gated by the existing project-bluebird flag via the routes that mount these surfaces. - Move ChannelTasksService -> ChannelsService (channels/channels.ts) with an IChannelsService interface; inject the shared DesktopFsClient from canvas. - Move channel task schemas -> channels/schemas.ts. - Move validateChannelName -> channels/channelName.ts. - Move ChannelLinkService -> channels/channel-link.ts. - Add channels/identifiers.ts (CHANNELS_SERVICE, CHANNEL_LINK_SERVICE) and channels/channels.module.ts (channelsCoreModule), loaded beside canvasCoreModule. - Rewire host-router routers, apps/code DI, and UI imports; drop the old channel bindings/tokens from canvas and links. No core channel store is introduced: channel data state currently lives in React Query caches in the UI, so an empty domain store would be a dead abstraction. The api-client-direct channel/task-channel queries are left on their existing transport; routing them through ChannelsService is the deferred client migration this seam is designed to absorb. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AYbS2SjLS49DSrT7fJLy7T
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
…vice test Address architect-review feedback on the channels seam: - Fix dependency direction: move desktopFsClient (+ DESKTOP_FS_CLIENT token and its binding) into channels and have canvas dashboards import it from there, so the arrow points canvas -> channels instead of channels -> canvas. channels is the foundational seam; canvas is a consumer. Load channelsCoreModule before canvasCoreModule since it now binds the shared FS client. - Raise method altitude for the broader service name: ChannelsService list/file/unfile -> listTasks/fileTask/unfileTask (tRPC procedure names on the channelTasks router are unchanged, so the UI wire is untouched). - Add channels.test.ts covering listTasks/fileTask/unfileTask against a faked DesktopFsClient (the seam service was previously untested). Still a pure refactor with no behavior change, gated by the existing project-bluebird flag. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AYbS2SjLS49DSrT7fJLy7T
The channels/schemas import must sort after canvas/dashboardSchemas (canvas < channels); biome's import-sort assist flagged both files in the quality CI job. No behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AYbS2SjLS49DSrT7fJLy7T
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.
Problem
The channels feature (project-bluebird) was scattered across
@posthog/core/canvasand@posthog/core/links, mixing it with unrelated canvas and link concerns. This made the feature harder to locate, understand, and evolve independently.Changes
Reorganized the channels feature into a dedicated
@posthog/core/channelspackage:Moved files from
canvas/andlinks/to newchannels/directory:channelTaskSchemas.ts→channels/schemas.tschannelName.ts,channelName.test.ts→channels/channel-link.ts,channel-link.test.ts→channels/Created new channels module (
channels/channels.module.ts):ChannelsService(renamed fromChannelTasksService) toCHANNELS_SERVICEtokenDesktopFsClientfrom canvas module withAuthServiceExtracted DI tokens to
channels/identifiers.ts:CHANNELS_SERVICE(host-agnostic service)CHANNEL_LINK_SERVICE(host-bound deep-link service)canvas/andlinks/Defined service interface (
IChannelsService):canvas/services.tstochannels/channels.tsUpdated imports across the codebase:
host-routerchannel-tasks router now imports from@posthog/core/channelschannelsCoreModuleRemoved from canvas module:
ChannelTasksServicebinding andCHANNEL_TASKS_SERVICEtokenIChannelTasksServiceinterface (moved to channels)canvas/identifiers.tsandcanvas/services.tsRemoved from links module:
CHANNEL_LINK_SERVICEtoken (moved to channels/identifiers.ts)ChannelLinkServiceimport (now imported from channels/channel-link.ts)This reorganization follows the architecture principle of feature cohesion: all channels-related code lives in one place, making the feature boundary clear and enabling independent evolution.
How did you test this?
Automatic notifications
https://claude.ai/code/session_01AYbS2SjLS49DSrT7fJLy7T