Skip to content

Remove expo-av and the unused features that depended on it#5907

Open
janicduplessis wants to merge 8 commits into
developfrom
janic/expo-av-to-expo-audio
Open

Remove expo-av and the unused features that depended on it#5907
janicduplessis wants to merge 8 commits into
developfrom
janic/expo-av-to-expo-audio

Conversation

@janicduplessis

@janicduplessis janicduplessis commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

expo-av is deprecated and is removed in upcoming Expo SDKs. Auditing its last consumers showed they were all part of unused or unreachable features — the experimental custom-channel mic/audio post type and an orphaned embed-rendering system — so instead of migrating them to expo-audio, this PR removes them and drops the dependency. Voice memos, the one production audio feature, were already on expo-audio and are untouched.

Extracted from #5886 so the dep removal can land independently of the SDK 56 upgrade.

Changes

  • Remove the mic draft input / audio post type (confirmed unused by the team): MicInput, AudioPost, their registrations in ComponentsKitProvider, and the tlon.r0.input.mic / tlon.r0.content.audio registry entries. Channels that still carry that config degrade gracefully — unknown renderer ids fall back to the channel-type default (PostView), unknown input ids render no composer (DraftInputView). These are channel-level config ids, not message types: posts created through MicInput are plain chat posts with an audio-file attachment, so no message on the network references anything removed here.
  • Remove the customChannelCreation feature flag and the channel-configuration UI it gated: the "Configure view" sheet action, ChannelConfigurationBar/ConfigInput in CreateChannelSheet, and the Channel ref plumbing (forwardRef/useImperativeHandle) that existed only to open the bar. The action was already non-functional — ChatOptionsSheet never forwarded onPressConfigureChannel past its top-level component, so the button did nothing from anywhere. Flags persisted in local storage that are no longer in featureMeta are tolerated on load.
  • Remove the orphaned embed-rendering system: chat links stopped rendering through EmbedContent when they switched to preview cards (af5e9b9, ~5 months ago), leaving EmbedContent, AudioEmbed, AudioPlayer (+.web), Embed, EmbedWebView (+.web), the YouTube/Spotify/Twitter/TikTok providers HTML generators, and the useEmbed hook reachable only from Cosmos fixtures. fetchEmbed/isTrustedEmbed in @tloncorp/shared stay — the link-preview metadata path (metagrabActions) still uses them for oEmbed enrichment.
  • Remove the write-orphaned remainder of the custom-channel registry. Deleting the configuration UI left no code path that can assign these ids to a channel, so the components behind them are unreachable for any new data: collection renderers carousel/cards/sign/boardroom/strobe/summaries (all of postCollectionViews/ except the standard ListPostCollection), content renderers color/raw/yell/scratchpad, and draft inputs yo/color. The summaries view was also the only navigator to PostUsingContentConfigurationScreen, so that screen and DetailPostUsingContentConfiguration go with it. The notes ids stay — notes channels are a live feature with their own creation path (createNotesChannel). Legacy channels carrying removed ids degrade the same way as the mic/audio ones.
  • Rename VideoEmbedVideoPreview and flatten the now single-file Embed/ directory. The component renders an uploaded video attachment (poster, play badge, duration) and opens the media viewer — it isn't an embed; BlockRenderer's VideoBlock keeps wrapping it.
  • Drop expo-av from apps/tlon-mobile and packages/ui package.json plus the pnpm, CocoaPods, and gradle lockfiles (the Android lockfile loses ExoPlayer 2.18 and the guava transitives that only expo-av was pulling).

How did I test?

  • Typechecked api, app, shared, tlon-mobile, and tlon-web; packages/api tests pass (192/192) after the registry-entry removal and packages/shared logic tests pass (108/108) after the useEmbed removal; eslint on touched files shows only pre-existing warnings.
  • App builds and runs with expo-av removed on iOS (iPhone 17 Pro simulator / iOS 26.2 and physical iPhone 17 Pro / iOS 26.5) and Android (Medium_Phone_API_35 emulator, productionDebug). Voice memo record/playback verified unaffected.
  • The removed surfaces had no reachable entry points to regression-test: link embeds stopped rendering through EmbedContent five months ago, and "Configure view" was dead due to the unforwarded prop.

Risks and impact

  • Safe to rollback without consulting PR author? Yes
  • Affects important code area:
    • Onboarding
    • State / providers
    • Message sync
    • Channel display
    • Notifications
    • Other: removal of unused/unreachable custom-channel and embed code; no behavior change to reachable surfaces

Worst case: a channel somewhere still has a removed content config (mic/audio or one of the experimental renderers above) (required the Tlon-employee flag plus the broken Configure view, so realistically only internal test channels) — its old posts render via the default chat renderer as attachment blocks instead of an audio player, and it shows no composer until reconfigured. Voice memos, video blocks, and link previews are untouched.

Rollback plan

Revert the PR

Screenshots / videos

N/A — no UI changes to reachable surfaces.

expo-av is deprecated and removed in newer Expo SDKs. The rest of the
app already uses expo-audio (AudioRecorder, nowPlaying); this migrates
the two remaining expo-av consumers and drops the dependency.

- AudioPlayer: rebuilt on the useAudioPlayer/useAudioPlayerStatus hooks
  and the new setAudioModeAsync signature.
- MicInput: rebuilt on useAudioRecorder/useAudioRecorderState,
  RecordingPresets, and AudioModule permission APIs.
- Remove expo-av from apps/tlon-mobile and packages/ui package.json,
  pnpm-lock.yaml, and apps/tlon-mobile/ios/Podfile.lock.
@janicduplessis janicduplessis force-pushed the janic/expo-av-to-expo-audio branch from 554e453 to 075228f Compare June 9, 2026 17:18
EmbedContent lost its last production consumer when links switched to
preview cards (af5e9b9); with AudioPost gone, the AudioEmbed/AudioPlayer
chain it carried is unreachable outside Cosmos fixtures. VideoEmbed stays
as it renders video blocks.
The Configure view action was already non-functional: ChatOptionsSheet
never forwarded onPressConfigureChannel past the top-level component.
With the experimental custom-channel feature unused, remove the flag,
the configuration bar, and the ref plumbing that existed only to open it.
The component renders an uploaded video attachment (poster, play badge,
duration) and opens the media viewer; it is not an external-content
embed, and it was the last file left in the Embed directory.
@janicduplessis janicduplessis force-pushed the janic/expo-av-to-expo-audio branch from 9356bd5 to 184969a Compare June 10, 2026 04:07
@janicduplessis janicduplessis changed the title Migrate audio recording/playback from expo-av to expo-audio Remove expo-av and the unused features that depended on it Jun 10, 2026
@janicduplessis janicduplessis marked this pull request as ready for review June 10, 2026 04:38
With the channel configuration UI gone, nothing can assign these ids to
a channel anymore: collection renderers carousel/cards/sign/boardroom/
strobe/summaries, content renderers color/raw/yell/scratchpad, and
draft inputs yo/color. The summaries view was also the only navigator
to PostUsingContentConfigurationScreen, so that screen and its
DetailPostUsingContentConfiguration renderer go too. Channels that
still carry these ids fall back to the channel-type defaults.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the deprecated expo-av dependency by deleting the last remaining (unused/unreachable) app features that depended on it: experimental custom-channel configuration/renderers/inputs and an orphaned embed-rendering system. It also renames the uploaded-video attachment component from VideoEmbed to VideoPreview and updates call sites accordingly.

Changes:

  • Removed unused custom-channel configuration UI/flag and pruned unreachable renderer/input registry entries and implementations.
  • Removed the orphaned embed-rendering system (including useEmbed, embed UI components, and Cosmos fixtures that referenced it).
  • Dropped expo-av from dependency manifests/lockfiles and updated video attachment rendering to VideoPreview.

Reviewed changes

Copilot reviewed 52 out of 54 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pnpm-lock.yaml Removes expo-av from the workspace lock and prunes its resolved package entries.
packages/ui/package.json Drops expo-av from peerDependencies.
packages/shared/src/logic/embed.ts Removes useEmbed hook; retains fetchEmbed + trusted-provider logic for oEmbed enrichment paths.
packages/app/ui/index.tsx Removes exports tied to deleted custom-channel/embed features; exports VideoPreview.
packages/app/ui/contexts/componentsKits/ComponentsKitProvider.tsx Removes registrations for deleted content renderers, draft inputs, and collection renderers.
packages/app/ui/contexts/chatOptions/chatOptions.tsx Removes the dead onPressConfigureChannel plumbing from provider → sheet wiring.
packages/app/ui/components/YellPost.tsx Deletes the unused YellPost renderer.
packages/app/ui/components/VideoPreview.tsx Introduces/relocates VideoPreview (renamed from VideoEmbed) for uploaded video attachments.
packages/app/ui/components/PostContent/BlockRenderer.tsx Switches video block rendering from VideoEmbed to VideoPreview and updates related comments/types.
packages/app/ui/components/postCollectionViews/useLoadPostsInWindow.ts Deletes helper hook used only by removed collection views.
packages/app/ui/components/postCollectionViews/SummaryCollectionView.tsx Deletes the summaries collection view (unreachable after custom-channel removal).
packages/app/ui/components/postCollectionViews/StrobePostCollectionView.tsx Deletes the strobe collection view implementation.
packages/app/ui/components/postCollectionViews/CarouselPostCollectionView.tsx Deletes the carousel collection view implementation.
packages/app/ui/components/postCollectionViews/CardsPostCollectionView.tsx Deletes the cards/sign collection view implementations.
packages/app/ui/components/postCollectionViews/BoardroomPostCollectionView.tsx Deletes the boardroom collection view implementation.
packages/app/ui/components/ManageChannels/CreateChannelSheet.tsx Removes custom-channel configuration bar/UI and related helper logic.
packages/app/ui/components/Embed/providers.ts Deletes provider HTML generators for the removed embed system.
packages/app/ui/components/Embed/index.tsx Deletes the embed barrel exports.
packages/app/ui/components/Embed/EmbedWebView.web.tsx Deletes web embed renderer.
packages/app/ui/components/Embed/EmbedWebView.tsx Deletes native embed renderer.
packages/app/ui/components/Embed/EmbedContent.tsx Deletes embed content renderer (previously only reachable via fixtures).
packages/app/ui/components/Embed/Embed.tsx Deletes embed UI frame component.
packages/app/ui/components/Embed/AudioPlayer.web.tsx Deletes web audio player for embeds.
packages/app/ui/components/Embed/AudioPlayer.tsx Deletes native expo-av-based audio player.
packages/app/ui/components/Embed/AudioEmbedShared.ts Deletes shared types for audio embed/player components.
packages/app/ui/components/Embed/AudioEmbed.tsx Deletes audio embed wrapper component.
packages/app/ui/components/EditableNotePostContent.tsx Deletes scratchpad/note editing renderer tied to removed registry entries.
packages/app/ui/components/draftInputs/MicInput.tsx Deletes expo-av-based mic draft input.
packages/app/ui/components/draftInputs/index.ts Removes exports for deleted draft inputs.
packages/app/ui/components/draftInputs/ColorInput.tsx Deletes color draft input.
packages/app/ui/components/draftInputs/ButtonInput.tsx Deletes “yo button” draft input implementation.
packages/app/ui/components/DetailPostUsingContentConfiguration/index.ts Deletes orphan detail-post export for custom-channel content configuration flow.
packages/app/ui/components/DetailPostUsingContentConfiguration/DetailPostUsingContentConfiguration.tsx Deletes the detail-post screen component used only by removed summaries navigator path.
packages/app/ui/components/DetailPostUsingContentConfiguration/contextmenu.tsx Deletes context-menu helper used only by removed detail-post flow.
packages/app/ui/components/ColorPost.tsx Deletes color post renderer.
packages/app/ui/components/ChatOptionsSheet.tsx Removes dead “Configure view” option and custom-channel flag subscription logic.
packages/app/ui/components/Channel/index.tsx Removes ref-based configuration-bar opening and associated UI; simplifies Channel component API accordingly.
packages/app/ui/components/AudioPost.tsx Deletes the audio post renderer that depended on removed audio player/embed code.
packages/app/navigation/types.ts Removes PostUsingContentConfiguration route type.
packages/app/navigation/RootStack.tsx Removes the PostUsingContentConfiguration screen from navigation.
packages/app/lib/featureFlags.ts Removes customChannelCreation from feature metadata.
packages/app/fixtures/VideoPreview.fixture.tsx Updates Cosmos fixture to use VideoPreview naming/export.
packages/app/fixtures/SummaryCollectionView.fixture.tsx Deletes fixture for removed summary collection view.
packages/app/fixtures/EmbedContent.fixture.tsx Deletes fixture for removed embed system.
packages/app/fixtures/ChannelConfigurationBar.fixture.tsx Deletes fixture for removed configuration bar.
packages/app/fixtures/Channel.fixture.tsx Removes custom-channel configurator fixture wiring.
packages/app/fixtures/AudioEmbed.fixture.tsx Deletes fixture for removed audio embed.
packages/app/features/top/PostUsingContentConfigurationScreen.tsx Deletes screen used only by removed summaries/navigation path.
packages/app/features/top/ChannelScreen.tsx Removes Channel ref usage and configure-channel handler wiring.
packages/api/src/client/channelContentConfig.ts Removes orphaned custom-channel registry specs for deleted renderers/inputs/content types.
apps/tlon-mobile/package.json Removes expo-av dependency from the mobile app.
apps/tlon-mobile/ios/Podfile.lock Removes EXAV pod entries tied to expo-av.
apps/tlon-mobile/cosmos.imports.ts Removes Cosmos fixture imports for deleted embed/config/summary fixtures; renames video fixture import.
apps/tlon-mobile/android/app/gradle.lockfile Removes expo-av/ExoPlayer-related locked artifacts and updates remaining locked coordinates.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants