Skip to content

Conversation

@dodok8
Copy link
Contributor

@dodok8 dodok8 commented Nov 5, 2025

Summary

This PR introduces a new @fedify/fresh package that provides seamless integration between Fedify and Fresh 2.0, replacing the deprecated @fedify/fedify/x/fresh module that was designed for Fresh 1.x.

Related Issue

Changes

  • Created new @fedify/fresh package with Fresh 2.0 compatible middleware
  • Added Fresh 2.0 example application.
  • Updated documentation in docs/manual/integration.md
  • Changes root deno.json's nodeModulesDir field to auto from 'none`.

Benefits

  • Fresh 2.0 compatibility
  • Future-proof: Aligns with Fresh's modern architecture and Vite-based build system
  • Clear migration path: Documentation provides examples for migrating from the deprecated @fedify/fedify/x/fresh module

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

  • The package only supports Fresh 2.0+; users on Fresh 1.x should continue using @fedify/fedify/x/fresh until they upgrade
  • Due to a CJS issue with the multicodec dependency, users must externalize @fedify/fedify in their vite.config.ts (documented in the integration guide)
  • Due to an unknown error, the preact frontend of examples doesn't work.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @dodok8, 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 enhances Fedify's compatibility by introducing a dedicated integration package for Fresh 2.0. This update ensures that developers can leverage Fedify's capabilities within the modern Fresh framework, complete with an example application and updated documentation to guide the transition from older Fresh versions.

Highlights

  • New Fresh 2.0 Integration Package: Introduced a new @fedify/fresh package to provide seamless integration with Fresh 2.0, replacing the previously deprecated module designed for Fresh 1.x.
  • Fresh 2.0 Example Application: Added a comprehensive example application demonstrating how to use Fedify with Fresh 2.0, including middleware setup and configuration.
  • Updated Documentation: The docs/manual/integration.md file has been updated with detailed instructions and code examples for integrating Fedify with Fresh 2.0, including a necessary workaround for a multicodec CJS issue.
  • Dependency Updates: Numerous dependencies in deno.lock have been updated and new ones added to support Fresh 2.0, Preact, Vite, and Babel, ensuring compatibility with the latest ecosystem.
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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @dodok8, 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 enhances Fedify's compatibility with the Fresh framework by introducing a dedicated integration package for Fresh 2.0. This update ensures that Fedify users can leverage the latest features and architecture of Fresh, providing a robust and future-proof solution for building federated applications on Deno.

Highlights

  • New Fresh 2.0 Integration Package: Introduced a new @fedify/fresh package to provide seamless integration between Fedify and Fresh 2.0, replacing the older, now deprecated, Fresh 1.x module.
  • Fresh 2.0 Example Application: Added a comprehensive example application demonstrating how to use Fedify with Fresh 2.0, including middleware setup and basic functionality.
  • Updated Documentation: The integration manual (docs/manual/integration.md) has been updated with detailed instructions and code examples for setting up Fedify with Fresh 2.0.
  • CJS Dependency Workaround: Addressed a known CJS issue with the multicodec dependency by documenting the necessity to externalize @fedify/fedify in vite.config.ts for Fresh 2.0 projects.
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 introduces a new @fedify/fresh package for Fresh 2.0 integration, replacing the deprecated module for Fresh 1.x. The changes are well-structured, including the new package, a comprehensive example application, and updated documentation. The implementation of the Fresh middleware is clean and follows established patterns. I have one suggestion to improve the clarity of a code example in the documentation.

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 introduces a new @fedify/fresh package for seamless integration with Fresh 2.0, which is a great addition. The new package is well-structured, and the accompanying example application is comprehensive and very helpful for users to get started. The documentation is also updated to reflect these changes. My only suggestion is to make one of the documentation examples more complete to improve clarity for users. Overall, this is a solid contribution that aligns with Fresh's modern architecture.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @dodok8, 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 introduces a new package, @fedify/fresh, to facilitate integration between Fedify and Fresh 2.0. It includes an example application and updated documentation, ensuring compatibility with Fresh's modern architecture. The changes address issue #466 and provide a clear migration path for users upgrading from Fresh 1.x.

Highlights

  • New Package: Introduces the @fedify/fresh package, providing integration between Fedify and Fresh 2.0, replacing the deprecated @fedify/fedify/x/fresh module.
  • Example Application: Adds a Fresh 2.0 example application to demonstrate the usage of the new package.
  • Documentation Update: Updates the documentation in docs/manual/integration.md to reflect the changes and provide a migration path.
  • Configuration Note: Documents the requirement to externalize @fedify/fedify in vite.config.ts due to a CJS issue with the multicodec dependency.
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.

@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 introduces a new @fedify/fresh package for seamless integration with Fresh 2.0, along with a comprehensive example application and updated documentation. The implementation of the Fresh middleware is clean and correctly utilizes Fresh 2.0's context and middleware patterns. The example project is well-structured and serves as a great starting point for users. I've made a few minor suggestions to improve documentation clarity, but overall, this is an excellent addition to the Fedify ecosystem.

@issues-auto-labeler issues-auto-labeler bot added breaking change Breaking change component/integration Web framework integration difficulty/intermediate Intermediate level examples Example code related labels Nov 5, 2025
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.

Apparently it fails to compile @fedify/cli into executables during the publish job in the CI… Could you change the packages/cli/scripts/pack.ts script so that it does not include node_modules directory at all?

diff --git a/packages/cli/scripts/pack.ts b/packages/cli/scripts/pack.ts
index e0270054..b4284c9d 100644
--- a/packages/cli/scripts/pack.ts
+++ b/packages/cli/scripts/pack.ts
@@ -26,7 +26,7 @@ async function compile(os: OS, arch: Arch, into: string): Promise<void> {
   }
   await $`deno compile --allow-all --include=${
     join("src", "init", "templates")
-  } --target=${target} --output=${into} ${
+  } --node-modules-dir=none --target=${target} --output=${into} ${
     join(dirname(import.meta.dirname!), "src", "mod.ts")
   }`;
 }

@dahlia
Copy link
Member

dahlia commented Nov 16, 2025

@dodok8 Looks like there's a conflict with the next branch. Could you please do a rebase?

@github-actions
Copy link
Contributor

github-actions bot commented Nov 16, 2025

The docs for this pull request have been published:

https://0f48f782.fedify.pages.dev

@github-actions
Copy link
Contributor

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.478.1918+b54c0fbd JSR npm
@fedify/cli 2.0.0-pr.478.1918+b54c0fbd JSR npm
@fedify/amqp 2.0.0-pr.478.1918+b54c0fbd JSR npm
@fedify/cfworkers 2.0.0-pr.478.1918+b54c0fbd JSR npm
@fedify/denokv 2.0.0-pr.478.1918+b54c0fbd JSR
@fedify/elysia 2.0.0-pr.478.1918+b54c0fbd npm
@fedify/express 2.0.0-pr.478.1918+b54c0fbd JSR npm
@fedify/h3 2.0.0-pr.478.1918+b54c0fbd JSR npm
@fedify/hono 2.0.0-pr.478.1918+b54c0fbd JSR npm
@fedify/koa 2.0.0-pr.478.1918+b54c0fbd JSR npm
@fedify/nestjs 2.0.0-pr.478.1918+b54c0fbd npm
@fedify/next 2.0.0-pr.478.1918+b54c0fbd npm
@fedify/postgres 2.0.0-pr.478.1918+b54c0fbd JSR npm
@fedify/redis 2.0.0-pr.478.1918+b54c0fbd JSR npm
@fedify/sqlite 2.0.0-pr.478.1918+b54c0fbd JSR npm
@fedify/sveltekit 2.0.0-pr.478.1918+b54c0fbd JSR npm
@fedify/testing 2.0.0-pr.478.1918+b54c0fbd JSR npm

@dodok8
Copy link
Contributor Author

dodok8 commented Nov 22, 2025

I fixed the blank screen issue in commit 4cb9fda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Breaking change component/integration Web framework integration difficulty/intermediate Intermediate level examples Example code related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants