Skip to content

Add @fedify/solidstart package for SolidStart integration#601

Open
dodok8 wants to merge 7 commits intofedify-dev:mainfrom
dodok8:solidstart
Open

Add @fedify/solidstart package for SolidStart integration#601
dodok8 wants to merge 7 commits intofedify-dev:mainfrom
dodok8:solidstart

Conversation

@dodok8
Copy link
Contributor

@dodok8 dodok8 commented Mar 5, 2026

Summary

Add SolidStart integration support for Fedify, including a new
@fedify/solidstart package, example application, documentation,
and fedify init scaffolding support.

Closes #476.

Related issue

Changes

  • Added @fedify/solidstart package (packages/solidstart/) providing
    fedifyMiddleware() for integrating Fedify with SolidStart's
    middleware system
  • Added SolidStart example application (examples/solidstart/)
    demonstrating actor dispatching, WebFinger, and NodeInfo
  • Added SolidStart section to the integration documentation
    (docs/manual/integration.md)
  • Added "solidstart" option to fedify init with template files
    for app config, middleware, routes, and entry points
  • Added BANNED_COMBOS mechanism to the test-init lookup filter
    to support per-framework+PM granular test skipping
  • Fixed missing ::: code-group / ::: wrapping in the Elysia
    integration documentation section
  • Updated CHANGES.md with the new package entry under Version 2.1.0
  • Updated README.md and packages/fedify/README.md with JSR badge
    for @fedify/solidstart

Benefits

  • Users can now build federated applications with SolidStart, a
    modern full-stack framework built on SolidJS
  • fedify init supports scaffolding SolidStart projects with all
    package managers (Deno, pnpm, npm)
  • The BANNED_COMBOS test mechanism allows finer-grained control
    over which framework+PM combinations are tested for server lookup,
    rather than banning entire frameworks

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 mise test on your machine?

Additional notes

  • The fedify init lookup test skips the solidstart + deno
    combination because Deno's links feature does not populate
    node_modules/, which Vite (used internally by vinxi/SolidStart)
    requires for SSR module resolution. The pnpm and npm lookup
    tests pass fully.
  • The @fedify/solidstart middleware converts SolidStart's H3 events
    to standard Request/Response objects for Fedify's federation
    handler, similar to how @fedify/h3 works.

@issues-auto-labeler issues-auto-labeler bot added component/cli CLI tools related component/federation Federation object related component/integration Web framework integration labels Mar 5, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 expands Fedify's ecosystem by introducing first-class support for SolidStart, a modern full-stack framework. It delivers a new integration package, a complete example application, and comprehensive documentation, enabling developers to easily build federated applications using SolidStart. Additionally, the fedify init tool now supports scaffolding SolidStart projects, streamlining the setup process and improving test flexibility.

Highlights

  • SolidStart Integration Package: Introduced a new @fedify/solidstart package, providing fedifyMiddleware() for seamless integration of Fedify with SolidStart's middleware system.
  • SolidStart Example Application: Added a comprehensive example application demonstrating Fedify's capabilities within SolidStart, including actor dispatching, WebFinger, and NodeInfo.
  • Documentation and Scaffolding: Updated the integration documentation with a dedicated section for SolidStart and enhanced the fedify init command to scaffold new SolidStart projects with Fedify integration.
  • Granular Test Skipping: Implemented a BANNED_COMBOS mechanism in the test-init lookup filter, allowing for more granular control over skipping specific framework and package manager combinations during testing.
  • Elysia Documentation Fix: Corrected missing code-group wrapping in the Elysia integration documentation section for improved rendering.
Changelog
  • CHANGES.md
    • Added a changelog entry for the new @fedify/solidstart package under version 2.1.0.
  • deno.json
    • Included the new packages/solidstart directory in the Deno workspace configuration.
  • docs/manual/integration.md
    • Added a new section detailing Fedify integration with SolidStart.
    • Fixed code-group directives in the Elysia section.
  • examples/README.md
    • Updated the examples list to include the new SolidStart integration example.
  • examples/solidstart/.gitignore
    • Added common build and dependency ignore patterns for a SolidStart project.
  • examples/solidstart/app.config.ts
    • Configured SolidStart middleware and server preset for the example application.
  • examples/solidstart/package.json
    • Defined dependencies and scripts for the SolidStart example application.
  • examples/solidstart/src/app.css
    • Added basic CSS styling for the example application.
  • examples/solidstart/src/app.tsx
    • Configured the main SolidStart application component with routing.
  • examples/solidstart/src/entry-client.tsx
    • Defined the client-side entry point for the SolidStart example.
  • examples/solidstart/src/entry-server.tsx
    • Defined the server-side entry point for the SolidStart example, including HTML structure.
  • examples/solidstart/src/lib/federation.ts
    • Implemented the Fedify federation logic, including actor dispatchers, inbox listeners, and follower dispatchers for the example.
  • examples/solidstart/src/lib/store.ts
    • Created in-memory stores for key pairs and relations for the SolidStart example.
  • examples/solidstart/src/middleware/index.ts
    • Configured the SolidStart middleware to use fedifyMiddleware.
  • examples/solidstart/src/routes/index.tsx
    • Added a redirect route for the SolidStart example's home page.
  • examples/solidstart/src/routes/users/[identifier].tsx
    • Implemented a dynamic user profile page for the SolidStart example, displaying Fedify data.
  • examples/solidstart/tsconfig.json
    • Configured TypeScript settings for the SolidStart example project.
  • packages/fedify/README.md
    • Updated the main README to list @fedify/solidstart and its JSR/npm badges.
  • packages/init/src/const.ts
    • Extended the list of supported web frameworks to include "solidstart".
  • packages/init/src/templates/solidstart/app.config.ts.tpl
    • Added a template for SolidStart's app.config.ts for scaffolding.
  • packages/init/src/templates/solidstart/src/app.tsx.tpl
    • Added a template for SolidStart's main app.tsx for scaffolding.
  • packages/init/src/templates/solidstart/src/entry-client.tsx.tpl
    • Added a template for SolidStart's client entry point for scaffolding.
  • packages/init/src/templates/solidstart/src/entry-server.tsx.tpl
    • Added a template for SolidStart's server entry point for scaffolding.
  • packages/init/src/templates/solidstart/src/middleware/index.ts.tpl
    • Added a template for SolidStart's middleware for scaffolding.
  • packages/init/src/templates/solidstart/src/routes/index.tsx.tpl
    • Added a template for SolidStart's default route for scaffolding.
  • packages/init/src/test/lookup.ts
    • Introduced BANNED_COMBOS to allow specific framework-package manager combinations to be skipped in tests.
  • packages/init/src/webframeworks/mod.ts
    • Integrated the SolidStart web framework definition into the fedify init tool.
  • packages/init/src/webframeworks/solidstart.ts
    • Defined the configuration and dependencies for SolidStart projects when using fedify init.
  • packages/solidstart/README.md
    • Added a README file for the new @fedify/solidstart package, explaining its purpose and usage.
  • packages/solidstart/deno.json
    • Configured the Deno project settings for the @fedify/solidstart package.
  • packages/solidstart/package.json
    • Defined the Node.js package metadata, dependencies, and build scripts for @fedify/solidstart.
  • packages/solidstart/src/index.ts
    • Implemented the fedifyMiddleware function for SolidStart, handling request processing and content negotiation.
  • packages/solidstart/tsdown.config.ts
    • Configured tsdown for building the @fedify/solidstart package.
  • pnpm-workspace.yaml
    • Updated the pnpm workspace configuration to include the new packages/solidstart and examples/solidstart directories.
Activity
  • No specific review comments or discussions have been recorded for this pull request yet. The changes represent an initial contribution by dodok8 to integrate SolidStart with Fedify.
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 SolidStart integration for Fedify through a new @fedify/solidstart package. The changes are comprehensive, including the new package, an example application, documentation updates, and support in fedify init. The implementation is well-structured and follows existing patterns in the repository. I've identified one high-severity type safety issue in the new fedifyMiddleware function and provided a suggestion to address it using function overloads. Overall, this is a great addition to the Fedify ecosystem.

I am having trouble creating individual review comments. Click here to see my feedback.

packages/solidstart/src/index.ts (54-104)

high

The current implementation of fedifyMiddleware has a potential type safety issue. If a Federation object is created with a specific context data type (e.g., createFederation<MyContext>()), but fedifyMiddleware is called without a createContextData function, the default implementation will provide undefined as the context data. This can lead to runtime TypeErrors in your dispatchers if they expect a MyContext object but receive undefined.

To enforce type safety at compile time, it's better to use function overloads. This will make the createContextData parameter required when the federation object has a context data type other than void.

export function fedifyMiddleware(
  federation: Federation<void>,
): ReturnType<typeof createMiddleware>;
export function fedifyMiddleware<TContextData>(
  federation: Federation<TContextData>,
  createContextData: ContextDataFactory<TContextData>,
): ReturnType<typeof createMiddleware>;
export function fedifyMiddleware<TContextData>(
  federation: Federation<TContextData>,
  createContextData?: ContextDataFactory<TContextData>,
): ReturnType<typeof createMiddleware> {
  return createMiddleware({
    onRequest: async (event: FetchEvent) => {
      const response = await federation.fetch(event.request, {
        contextData: await (createContextData ?? (() => undefined))(event) as TContextData,
        onNotFound: () =>
          new Response("Not Found", { status: 404 }),
        onNotAcceptable: () =>
          new Response("Not Acceptable", {
            status: 406,
            headers: { "Content-Type": "text/plain", Vary: "Accept" },
          }),
      });

      // If Fedify does not handle this route, let SolidStart handle it:
      if (response.status === 404) return;

      // If content negotiation failed (client does not want JSON-LD),
      // store the 406 response and let SolidStart try to serve HTML.
      // If SolidStart also cannot handle it, onBeforeResponse will
      // return the 406:
      if (response.status === 406) {
        notAcceptableResponses.set(event.request, response);
        return;
      }

      // Fedify handled the request successfully:
      return response;
    },

    // Similar to onRequest, but slightly more tricky one.
    // When the federation object finds a request not acceptable type-wise
    // (i.e., a user-agent does not want JSON-LD), onRequest stores the 406
    // response and lets SolidStart try to render HTML.  If SolidStart also
    // has no page for this route (404), we return the stored 406 instead.
    // This enables Fedify and SolidStart to share the same routes and do
    // content negotiation depending on the Accept header:
    onBeforeResponse: (event: FetchEvent) => {
      const stored = notAcceptableResponses.get(event.request);
      if (stored != null) {
        notAcceptableResponses.delete(event.request);
        const status = event.response.status ?? 200;
        if (status === 404) return stored;
      }
    },
  });
}

dodok8 and others added 7 commits March 5, 2026 18:20
Extract the Fedify middleware for SolidStart into a dedicated package
(@fedify/solidstart), providing a fedifyMiddleware() helper that handles
ActivityPub content negotiation with SolidStart's middleware system.

Uses a WeakMap<Request, Response> internally for 406 response storage,
so users don't need to declare App.RequestEventLocals.

Update the example to use the new package instead of inline middleware.

fedify-dev#476

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a SolidStart section to docs/manual/integration.md with installation
instructions, app.config.ts setup, and middleware usage example.

Add @fedify/solidstart changelog entry under Version 2.1.0, and update
packages/fedify/README.md with JSR link for the new package.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add SolidStart as a web framework option in the `fedify init` command,
allowing users to scaffold new Fedify+SolidStart projects.  All
boilerplate files (app config, middleware, routes, entry points) are
provided as templates since no suitable degit template exists for
SolidStart.

The lookup test skips the solidstart+deno combination because Deno's
`links` feature does not populate `node_modules/`, which Vite (used by
vinxi) requires for SSR module resolution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.
see 1 file with indirect coverage changes

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class SolidStart integration to Fedify by introducing a new @fedify/solidstart package, an example SolidStart app, documentation updates, and fedify init scaffolding for SolidStart projects.

Changes:

  • Added @fedify/solidstart package exposing fedifyMiddleware() for SolidStart middleware integration.
  • Added SolidStart example app plus integration docs and changelog entry.
  • Extended fedify init to scaffold SolidStart projects and refined lookup test filtering via BANNED_COMBOS.

Reviewed changes

Copilot reviewed 34 out of 36 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pnpm-workspace.yaml Registers the new package and example in the workspace.
packages/solidstart/tsdown.config.ts Build configuration for the new SolidStart integration package.
packages/solidstart/src/index.ts Implements fedifyMiddleware() for SolidStart.
packages/solidstart/package.json Declares package metadata, exports, build scripts, and peer deps.
packages/solidstart/deno.json JSR/Deno publishing metadata for the new package.
packages/solidstart/README.md Package-level usage docs for SolidStart integration.
packages/init/src/webframeworks/solidstart.ts Adds SolidStart scaffolding configuration to fedify init.
packages/init/src/webframeworks/mod.ts Registers SolidStart in the framework registry.
packages/init/src/test/lookup.ts Adds per-(framework, package manager) skip support via BANNED_COMBOS.
packages/init/src/templates/solidstart/src/routes/index.tsx.tpl SolidStart template: default home route.
packages/init/src/templates/solidstart/src/middleware/index.ts.tpl SolidStart template: middleware entry using @fedify/solidstart.
packages/init/src/templates/solidstart/src/entry-server.tsx.tpl SolidStart template: server entry point.
packages/init/src/templates/solidstart/src/entry-client.tsx.tpl SolidStart template: client entry point.
packages/init/src/templates/solidstart/src/app.tsx.tpl SolidStart template: app router shell.
packages/init/src/templates/solidstart/app.config.ts.tpl SolidStart template: app config with middleware + server preset.
packages/init/src/const.ts Adds "solidstart" to the list of supported web frameworks.
packages/fedify/README.md Adds @fedify/solidstart to the package list and links.
examples/solidstart/tsconfig.json TypeScript config for the SolidStart example.
examples/solidstart/src/routes/users/[identifier].tsx Example user profile route demonstrating server query + rendering.
examples/solidstart/src/routes/index.tsx Example root route redirect.
examples/solidstart/src/middleware/index.ts Example middleware using fedifyMiddleware().
examples/solidstart/src/lib/store.ts Example in-memory/global stores for demo persistence.
examples/solidstart/src/lib/federation.ts Example Fedify federation setup + dispatchers/listeners.
examples/solidstart/src/entry-server.tsx Example SolidStart server entry point.
examples/solidstart/src/entry-client.tsx Example SolidStart client entry point.
examples/solidstart/src/app.tsx Example app shell with styles.
examples/solidstart/src/app.css Example app styling.
examples/solidstart/package.json Example app dependencies/scripts.
examples/solidstart/app.config.ts Example app config enabling middleware.
examples/solidstart/.gitignore Example app ignore rules.
examples/README.md Adds SolidStart example link to examples index.
docs/manual/integration.md Documents SolidStart integration + fixes Elysia code-group wrapping.
deno.lock Updates lockfile for newly introduced npm dependencies.
deno.json Adds workspace entry and import map entries for SolidStart subpaths.
CHANGES.md Changelog entry for the new @fedify/solidstart package.

Comment on lines +12 to +21
dependencies: pm === "deno"
? {
...defaultDenoDependencies,
"@solidjs/router": "npm:@solidjs/router@^0.15.4",
"@solidjs/start": "npm:@solidjs/start@^1.3.2",
"solid-js": "npm:solid-js@^1.9.11",
vinxi: "npm:vinxi@^0.5.11",
"@fedify/solidstart": PACKAGE_VERSION,
}
: {
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

For the Deno template, the generated deno.json imports will include an entry for "@solidjs/start", but @fedify/solidstart imports "@solidjs/start/middleware" and "@solidjs/start/server" as separate specifiers. Deno import maps do not resolve these subpaths from the base "@solidjs/start" entry, so the scaffolded SolidStart+Deno project is likely to fail type-checking/runtime module resolution unless these subpath mappings are also emitted. Consider adding explicit dependencies for "@solidjs/start/middleware" and "@solidjs/start/server" (with the appropriate npm: specifiers) to the Deno dependencies here, or changing @fedify/solidstart to avoid subpath imports that require separate import-map entries.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/cli CLI tools related component/federation Federation object related component/integration Web framework integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create @fedify/solidstart package for SolidStart integration

2 participants