Skip to content

Remove deprecated API#567

Merged
dahlia merged 4 commits intofedify-dev:mainfrom
2chanhaeng:main
Feb 15, 2026
Merged

Remove deprecated API#567
dahlia merged 4 commits intofedify-dev:mainfrom
2chanhaeng:main

Conversation

@2chanhaeng
Copy link
Contributor

Summary

Remove deprecated APIs for Fedify 2.0: CreateFederationOptions,
fetchDocumentLoader(), and { handle: string }.

Related issue

Changes

  • Deleted CreateFederationOptions, fetchDocumentLoader.
  • Removed { handle: string }, {handle} URL pattern and the deprecated warnings.

Benefits

No more deprecated API.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @2chanhaeng, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request completes the removal of several deprecated APIs as part of the Fedify 2.0 cleanup. The changes streamline the codebase by eliminating outdated interfaces and functions, ensuring that developers use the most current and recommended patterns for federation configuration, document loading, and identity handling. This effort improves API consistency and reduces potential confusion by standardizing on FederationOptions, getDocumentLoader(), and the identifier parameter for user references.

Highlights

  • API Deprecation Removal: The deprecated CreateFederationOptions interface has been entirely removed, promoting the use of FederationOptions for consistency and clarity in configuration.
  • Document Loader Update: The fetchDocumentLoader() function, previously deprecated, has been removed. Users should now utilize getDocumentLoader() from @fedify/vocab-runtime for document loading.
  • Handle Parameter Replacement: The { handle: string } parameter form has been removed from various functions and types, including sendActivity(), forwardActivity(), getDocumentLoader(), and ParseUriResult. It has been replaced by { identifier: string } or { username: string } to standardize identity representation.
Changelog
  • CHANGES.md
    • Added entries documenting the removal of CreateFederationOptions, fetchDocumentLoader(), and the { handle: string } parameter form.
  • docs/manual/federation.md
    • Updated documentation examples to reflect the change from {handle} to {identifier} in actor dispatcher paths.
  • docs/manual/integration.md
    • Modified text to refer to {identifier} instead of {handle} in integration examples and explanations.
  • examples/express/federation.ts
    • Updated actor and object dispatcher paths to use {identifier} instead of {handle}.
  • examples/express/index.ts
    • Modified Express route parameter from :handle to :identifier.
  • examples/h3/federation.ts
    • Updated actor and object dispatcher paths to use {identifier} instead of {handle}.
  • examples/h3/index.ts
    • Modified H3 route parameter from :handle to :identifier.
  • examples/koa/federation.ts
    • Updated actor and object dispatcher paths to use {identifier} instead of {handle}.
  • packages/fedify/src/federation/builder.ts
    • Removed {handle} from the type definition for dispatcher paths and eliminated associated deprecation warnings.
  • packages/fedify/src/federation/callback.ts
    • Removed { handle: string } from SharedInboxKeyDispatcher type definitions.
  • packages/fedify/src/federation/context.ts
    • Removed { handle: string } from getDocumentLoader identity types, sendActivity sender types, forwardActivity forwarder types, and ParseUriResult properties.
  • packages/fedify/src/federation/federation.ts
    • Removed {handle} from various dispatcher path type definitions and updated FederationOptions references.
  • packages/fedify/src/federation/handler.test.ts
    • Updated tests to use identifier instead of handle in actor and object dispatchers and collection handlers.
  • packages/fedify/src/federation/middleware.test.ts
    • Replaced fetchDocumentLoader with getDocumentLoader and updated ParseUriResult assertions to remove handle.
  • packages/fedify/src/federation/middleware.ts
    • Removed the deprecated CreateFederationOptions interface and updated references to FederationOptions and FederationOrigin. Eliminated logic related to the deprecated handle property in FederationImpl and ContextImpl.
  • packages/fedify/src/federation/mod.ts
    • Removed the export of CreateFederationOptions.
  • packages/fedify/src/federation/webfinger.test.ts
    • Updated webfinger tests to remove the deprecated handle property from ParseUriResult.
  • packages/fedify/src/utils/docloader.ts
    • Removed the deprecated fetchDocumentLoader function and its internal constants.
  • packages/testing/src/mock.ts
    • Updated URI template expansion and mock context methods to remove references to handle.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively removes several deprecated APIs (CreateFederationOptions, fetchDocumentLoader(), and the { handle: string } parameter form) in preparation for Fedify 2.0. The changes are applied consistently across the entire codebase, including the core implementation, documentation, examples, and tests. This cleanup simplifies the API surface and improves code clarity. The changes are well-executed, and I have no further suggestions for improvement.

@codecov
Copy link

codecov bot commented Feb 15, 2026

Codecov Report

❌ Patch coverage is 87.27273% with 7 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/fedify/src/federation/builder.ts 61.11% 7 Missing ⚠️
Files with missing lines Coverage Δ
packages/fedify/src/federation/middleware.ts 95.54% <100.00%> (+0.11%) ⬆️
packages/fedify/src/federation/mod.ts 100.00% <ø> (ø)
packages/fedify/src/utils/docloader.ts 100.00% <ø> (+4.76%) ⬆️
packages/testing/src/mock.ts 65.13% <ø> (-0.53%) ⬇️
packages/fedify/src/federation/builder.ts 49.89% <61.11%> (+2.65%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@dahlia dahlia left a comment

Choose a reason for hiding this comment

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

Good job, thanks!

@dahlia dahlia merged commit cb8f5a5 into fedify-dev:main Feb 15, 2026
16 checks passed
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.

Remove deprecated APIs for Fedify 2.0

2 participants