Skip to content

Separated @fedify/fedify/runtime with @fedify/vocab-runtime and @fedify/fedify/utils#451

Merged
dahlia merged 40 commits intofedify-dev:nextfrom
2chanhaeng:vocab/runtime
Oct 4, 2025
Merged

Separated @fedify/fedify/runtime with @fedify/vocab-runtime and @fedify/fedify/utils#451
dahlia merged 40 commits intofedify-dev:nextfrom
2chanhaeng:vocab/runtime

Conversation

@2chanhaeng
Copy link
Contributor

Summary

Separated @fedify/fedify/runtime with @fedify/vocab-runtime and @fedify/fedify/utils.
Modules related to ActivityPub vocabulary generation was moved to @fedify/vocab-runtime.
The other modules have been moved to the @fedify/fedify/utils path because they can be used not only at runtime but also in general situations(e.g. getUserAgent).

I thought that only the code used in vocab should be exported from @fedify/vocab-runtime. Therefore, code not directly used in vocab is defined separately in @fedify/vocab-runtime and @fedify/fedify, leading to code duplication.

Related Issue

Changes

  • Removed @fedify/fedify/runtime.
  • Added @fedify/vocab-runtime and @fedify/fedify/utils.
  • Replaced imports from @fedify/fedify/runtime with @fedify/vocab-runtime or @fedify/fedify/utils.

Benefits

This PR improve modularity and extend Activity Vocabulary with custom types or use the vocabulary in non-Deno environments.

Checklist

  • Did you add a changelog entry to the CHANGES.md?
  • Did you write some relevant docs about this change (if it's a new feature)?
  • Did you write a regression test to reproduce the bug (if it's a bug fix)?
  • Did you write some tests for this change (if it's a new feature)?
  • Did you run deno task test-all on your machine?

Additional Notes

If you think it's better for the entire /runtime to be separated into another package, please let me know.

Set setting files for vocab-runtime

Set setting files for vocab-runtime
…untime` in `fedify/src/vocab`"

This reverts commit d0023a5.
…in `fedify/src/vocab` and `fedify/src/codegen`
This reverts commit 2af90e6.
@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 significantly refactors the internal architecture of the Fedify project by breaking down the monolithic runtime module into more granular and logically grouped components. The primary goal is to improve modularity and reduce interdependencies, making the system more maintainable and flexible. This change enables better support for extending Activity Vocabulary and allows for greater portability of vocabulary-related functionalities beyond Deno-specific environments.

Highlights

  • Module Separation: The @fedify/fedify/runtime module has been deprecated and its functionalities split into two new, more specialized components.
  • New Package: @fedify/vocab-runtime: Modules specifically related to ActivityPub vocabulary generation, including document loaders, cryptographic key handling, and language string processing, have been extracted into a new dedicated package, @fedify/vocab-runtime.
  • New Module: @fedify/fedify/utils: General-purpose runtime utilities that are not directly tied to vocabulary generation, such as request handling and KV caching, have been moved to a new utils module within the main @fedify/fedify package.
  • Improved Modularity: This refactoring enhances the overall modularity of the Fedify project, reducing coupling between core federation logic and vocabulary processing, and facilitating easier extension and use in diverse environments.
  • Updated Import Paths: All internal and external import paths across the codebase have been updated to reflect the new module and package organization.
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 is an excellent and significant refactoring that separates the @fedify/fedify/runtime module into a new @fedify/vocab-runtime package and a new internal @fedify/fedify/utils module. This change greatly improves the project's modularity, separates concerns more cleanly, and resolves circular dependencies that existed in the previous structure. The file moves, import path updates, and dependency adjustments across the monorepo have been executed thoroughly and consistently.

My review found one issue in the implementation of the deprecated fetchDocumentLoader function, where it fails to pass through options, breaking functionality like request cancellation. Other than that, the changes look solid and are a great step forward for the project's architecture.

@ThisIsMissEm
Copy link
Contributor

I'll have to look at this closer later, but I'm pretty sure this isn't what #444 was suggesting

@dahlia
Copy link
Member

dahlia commented Oct 2, 2025

@ThisIsMissEm I believe although this pull request does not completely address #444, but it partially does:

  1. Create new packages:
    • @fedify/vocab-tools (or @fedify/vocab-codegen): Code generation tools
      • Extract all code from packages/fedify/src/codegen/ into this package
      • Make it runtime-agnostic (support Deno, Node.js, and Bun)
    • @fedify/vocab-runtime: Runtime utilities needed by generated vocabulary code
      • Extract runtime dependencies from packages/fedify/src/runtime/ that are used by vocabulary
    • Publish both packages to npm and JSR

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.

Left few review comments!

2chanhaeng and others added 2 commits October 4, 2025 13:33
@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2025

The latest push to this pull request has been published to JSR and npm as a pre-release:

Package Version JSR npm
@fedify/fedify 2.0.0-pr.451.1735+e5916226 JSR npm
@fedify/cli 2.0.0-pr.451.1735+e5916226 JSR
@fedify/amqp 2.0.0-pr.451.1735+e5916226 JSR npm
@fedify/cfworkers 2.0.0-pr.451.1735+e5916226 JSR npm
@fedify/denokv 2.0.0-pr.451.1735+e5916226 JSR
@fedify/elysia 2.0.0-pr.451.1735+e5916226 npm
@fedify/express 2.0.0-pr.451.1735+e5916226 JSR npm
@fedify/h3 2.0.0-pr.451.1735+e5916226 JSR npm
@fedify/hono 2.0.0-pr.451.1735+e5916226 JSR npm
@fedify/nestjs 2.0.0-pr.451.1735+e5916226 npm
@fedify/next 2.0.0-pr.451.1735+e5916226 npm
@fedify/postgres 2.0.0-pr.451.1735+e5916226 JSR npm
@fedify/redis 2.0.0-pr.451.1735+e5916226 JSR npm
@fedify/sqlite 2.0.0-pr.451.1735+e5916226 JSR npm
@fedify/sveltekit 2.0.0-pr.451.1735+e5916226 JSR npm
@fedify/testing 2.0.0-pr.451.1735+e5916226 JSR npm

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2025

The docs for this pull request have been published:

https://2ebf1513.fedify.pages.dev

@dahlia dahlia merged commit ea8e853 into fedify-dev:next Oct 4, 2025
10 checks passed
@2chanhaeng 2chanhaeng deleted the vocab/runtime branch December 18, 2025 11:29
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.

3 participants