collapse the dual-world type layer and delete the widening shims
The types/bsky post/profile/starterPack unions drop their @atproto/api arms, and dangerousIsType/validate go with the old-world guards they wrapped. The moderation subjects.ts widening shim and rich-text-helpers' asSdkFacets both existed only to bridge branded and unbranded views, so their 55 and 14 callers now go straight to @bsky.app/sdk/moderation and the raw facets. Boundary fallout: lexicon token defs are camelCase schema objects needing .value, and the branded string slots that the widening used to absorb are now cast or branded at their producers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {useCallback, useEffect, useMemo, useRef} from 'react'
|
||||
import {type AtUriString, AtUri} from '@atproto/syntax'
|
||||
import {RichText} from '@bsky.app/sdk/richtext'
|
||||
import {moderateFeedGenerator} from '@bsky.app/sdk/moderation'
|
||||
import {t} from '@lingui/core/macro'
|
||||
import {
|
||||
type InfiniteData,
|
||||
@@ -13,10 +14,8 @@ import {
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
import {DISCOVER_FEED_URI, DISCOVER_SAVED_FEED} from '#/lib/constants'
|
||||
import {moderateFeedGenerator} from '#/lib/moderation/subjects'
|
||||
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||
import {asSdkFacets} from '#/lib/strings/rich-text-helpers'
|
||||
import {GCTIME, STALE} from '#/state/queries'
|
||||
import {RQKEY as listQueryKey} from '#/state/queries/list'
|
||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||
@@ -99,7 +98,7 @@ export function hydrateFeedGenerator(
|
||||
|
||||
const description = new RichText({
|
||||
text: view.description || '',
|
||||
facets: asSdkFacets((view.descriptionFacets || [])?.slice()),
|
||||
facets: (view.descriptionFacets || [])?.slice(),
|
||||
})
|
||||
|
||||
if (!view.descriptionFacets) {
|
||||
@@ -142,7 +141,7 @@ export function hydrateList(
|
||||
|
||||
const description = new RichText({
|
||||
text: view.description || '',
|
||||
facets: asSdkFacets((view.descriptionFacets || [])?.slice()),
|
||||
facets: (view.descriptionFacets || [])?.slice(),
|
||||
})
|
||||
|
||||
if (!view.descriptionFacets) {
|
||||
|
||||
Reference in New Issue
Block a user