Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement SvelteKit integration #183

Merged
merged 4 commits into from
Nov 23, 2024
Merged

Conversation

robin-maki
Copy link
Contributor

@robin-maki robin-maki commented Nov 23, 2024

This PR implements SvelteKit integration with server hooks

resolve #171

Summary by CodeRabbit

  • New Features

    • Introduced fedifyHook module for seamless integration of SvelteKit with the Federation framework.
    • Enhanced error handling and logging for incoming requests.
    • Expanded configurability with new options for message queue and HTTP request handling.
    • Added support for OpenTelemetry tracing.
    • Updated documentation with new integration instructions for SvelteKit.
  • Bug Fixes

    • Improved handling of 404 and 406 response statuses for better user experience.
    • Various bug fixes and performance enhancements throughout the application.

Copy link

coderabbitai bot commented Nov 23, 2024

Walkthrough

The changes introduce a new module in src/x/sveltekit.ts that integrates SvelteKit with a Federation object through a middleware function called fedifyHook. This function processes requests, utilizes the federation.fetch method for handling requests, and includes structured error handling for not found and not acceptable scenarios. Additionally, the changelog outlines various enhancements and updates across the Fedify framework, including new options for message queues, HTTP requests, key caching, and router functionalities.

Changes

File Change Summary
src/x/sveltekit.ts Added fedifyHook method for SvelteKit integration with Federation, including request handling and error management.
CHANGES.md Updated changelog for Fedify version 1.3.0, detailing enhancements in message queue configuration, HTTP requests, key caching, router enhancements, OpenTelemetry support, and SvelteKit integration.
src/deno.json Added export and import for the sveltekit module to the exports and imports sections.
docs/manual/integration.md Updated integration documentation to include instructions for SvelteKit, detailing usage of the fedifyHook function.

Assessment against linked issues

Objective Addressed Explanation
SvelteKit integration (#171)
  • Lookup multiple args #186: The changes in this PR enhance the command-line interface for handling multiple arguments, which may indirectly relate to the overall integration capabilities of Fedify, but do not directly connect to the SvelteKit integration or the fedifyHook function introduced in the main PR.

🐰 In a world of code so bright,
A hook for SvelteKit takes flight.
With Federation now in play,
Requests are handled in a better way.
Errors caught, no need to fear,
Hopping forward, the future is near! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (2)
src/x/sveltekit.ts (2)

7-7: Update the SvelteKit documentation link

The link to SvelteKit in the documentation points to the general Svelte site. Updating it to the specific SvelteKit documentation will provide more direct and relevant information.

Apply this diff to correct the link:

  *
- * [SvelteKit]: https://svelte.dev/
+ * [SvelteKit]: https://kit.svelte.dev/
  *
  * @module
  */

31-31: Correct the import path in the documentation example

In the example, the import statement uses "federation.ts", which may not reflect the actual module path. Ensure the import path is accurate so developers can follow the example without confusion.

Consider updating the import statement:

 * ``` typescript
-import { federation } from "federation.ts"; // Import the `Federation` object
+import { federation } from "../federation/federation.ts"; // Import the `Federation` object
 *
 * export const handle = fedifyHook(federation, () => undefined);
 * ```
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 96f725d and fea49d1.

📒 Files selected for processing (1)
  • src/x/sveltekit.ts (1 hunks)
🔇 Additional comments (1)
src/x/sveltekit.ts (1)

60-88: Ensure FederationFetchOptions methods match expected signatures

The methods onNotFound and onNotAcceptable inside integrateFetchOptions should align with the expected signatures defined in FederationFetchOptions. Verify that these implementations are correctly typed and handle all necessary parameters.

Please confirm that the FederationFetchOptions interface expects methods with these signatures. If discrepancies exist, adjust the method implementations accordingly.

src/x/sveltekit.ts Outdated Show resolved Hide resolved
src/x/sveltekit.ts Show resolved Hide resolved
Copy link
Owner

@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.

Could you remove debug logs?

@robin-maki robin-maki requested a review from dahlia November 23, 2024 07:20
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (4)
src/x/sveltekit.ts (3)

1-10: Enhance module documentation with more details

While the documentation provides a basic overview, consider adding:

  • Purpose and benefits of the integration
  • Content negotiation behavior
  • Configuration options and examples
  • Error handling scenarios
 /**
  * Fedify with SvelteKit
  * ================
  *
  * This module provides a [SvelteKit] middleware to integrate with the Fedify.
+ * 
+ * ## Features
+ * - Seamless integration between Fedify and SvelteKit
+ * - Content negotiation based on Accept headers
+ * - Fallback to SvelteKit's default handling for non-federation requests
+ * 
+ * ## Configuration
+ * The integration can be configured through the `fedifyHook` function parameters:
+ * - `federation`: The Federation instance to handle requests
+ * - `createContextData`: Custom function to provide context data
  *
  * [SvelteKit]: https://svelte.dev/
  *
  * @module
  */

29-34: Enhance example with more realistic use case

The current example is minimal. Consider expanding it to show:

  • Context data creation
  • Error handling
  • Content negotiation scenarios
  * @example hooks.server.ts
  * ``` typescript
  * import { federation } from "federation.ts"; // Import the `Federation` object
+ * 
+ * // Example context creation
+ * const createContext = (event: RequestEvent) => ({
+ *   user: event.locals.user,
+ *   // Add other context data
+ * });
  *
- * export const handle = fedifyHook(federation, () => undefined);
+ * export const handle = fedifyHook(federation, createContext);
+ * 
+ * // The hook will:
+ * // 1. Handle federation requests with JSON-LD responses
+ * // 2. Fall back to SvelteKit for HTML responses
+ * // 3. Return 406 Not Acceptable when content negotiation fails
  * ```

75-85: Consider enhancing error handling in onNotAcceptable

While the current implementation handles 404 status, consider:

  1. Adding error logging for debugging
  2. Handling other error status codes explicitly
  3. Including more detailed error messages
  async onNotAcceptable(): Promise<Response> {
    const res = await resolve(event);
-   if (res.status !== 404) return res;
+   // Handle specific error cases
+   switch (res.status) {
+     case 404:
+       return new Response("Not acceptable - Resource not found", {
+         status: 406,
+         headers: {
+           "Content-Type": "text/plain",
+           Vary: "Accept",
+           "X-Error-Code": "RESOURCE_NOT_FOUND"
+         },
+       });
+     case 500:
+       // Log internal errors but return generic message
+       console.error("Internal error during content negotiation");
+       return new Response("Not acceptable - Internal error", {
+         status: 406,
+         headers: {
+           "Content-Type": "text/plain",
+           Vary: "Accept",
+           "X-Error-Code": "INTERNAL_ERROR"
+         },
+       });
+     default:
+       return res;
+   }
-   return new Response("Not acceptable", {
-     status: 406,
-     headers: {
-       "Content-Type": "text/plain",
-       Vary: "Accept",
-     },
-   });
  },
CHANGES.md (1)

70-70: Fix the unordered list indentation.

The unordered list item is not properly indented according to the style guide.

Apply this diff to fix the indentation:

- -  Support SvelteKit integrations. [[#183]]
+  -  Support SvelteKit integrations. [[#183]]
🧰 Tools
🪛 Markdownlint (0.35.0)

70-70: Expected: 0; Actual: 1
Unordered list indentation

(MD007, ul-indent)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between fea49d1 and 41e9422.

📒 Files selected for processing (2)
  • CHANGES.md (1 hunks)
  • src/x/sveltekit.ts (1 hunks)
🧰 Additional context used
🪛 Markdownlint (0.35.0)
CHANGES.md

70-70: Expected: 0; Actual: 1
Unordered list indentation

(MD007, ul-indent)

🔇 Additional comments (1)
src/x/sveltekit.ts (1)

43-54: Verify error handling with Federation framework

The integration looks solid, but let's verify proper error propagation between SvelteKit and Federation.

✅ Verification successful

Error handling is properly implemented in the Federation framework

The integration between SvelteKit and Federation has robust error handling:

  • Federation middleware implements comprehensive error handling with proper logging and error propagation
  • Errors are caught at multiple levels (JSON parsing, activity processing, signature verification)
  • Custom error handlers (inboxErrorHandler, onOutboxError) allow customization of error handling
  • HTTP status codes and error responses are properly set for different error scenarios
  • Error states are logged with appropriate context for debugging
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check error handling implementation in Federation framework

# Look for error handling patterns in Federation
echo "Checking Federation error handling..."
rg -A 5 "catch|throw|Error|error" ../federation/federation.ts

# Check for similar SvelteKit integrations
echo "Checking for similar patterns in other integrations..."
fd -e ts -e js | xargs rg -l "onNotFound|onNotAcceptable"

Length of output: 665


Script:

#!/bin/bash
# Let's check error handling in the actual federation implementation
echo "Checking Federation implementation..."
ast-grep --pattern 'class Federation {
  $$$
  fetch($$$) {
    $$$
  }
  $$$
}'

echo "\nChecking error handling in federation handler..."
rg -A 5 "catch|throw|Error|error" src/federation/handler.ts

echo "\nChecking error handling in federation middleware..."
rg -A 5 "catch|throw|Error|error" src/federation/middleware.ts

echo "\nChecking error handling in federation tests..."
rg "catch|throw|Error|error" src/federation/handler.test.ts

Length of output: 22629

CHANGES.md Outdated
@@ -67,6 +67,7 @@ To be released.

[#162]: https://github.com/dahlia/fedify/issues/162

- Support SvelteKit integrations. [[#183]]
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

The SvelteKit integration needs better documentation coverage

The current documentation for SvelteKit integration is limited to code comments in src/x/sveltekit.ts. While these comments provide basic usage examples, the integration should be documented in the main integration manual alongside other frameworks like Express, Hono, h3, and Fresh.

  • Add SvelteKit section to docs/manual/integration.md
  • Include detailed explanation of fedifyHook middleware functionality
  • Document configuration options and content negotiation behavior
  • Add code examples similar to other framework integrations
  • Consider adding a SvelteKit-specific tutorial or example
🔗 Analysis chain

Enhance the SvelteKit integration documentation.

The changelog entry for SvelteKit integration is quite brief. Consider adding more details about:

  • The functionality provided by the fedifyHook middleware
  • Configuration options and usage examples
  • Any limitations or considerations when using SvelteKit integration

Let's check if there's any documentation for the SvelteKit integration:


Let me check the content of the SvelteKit integration file to see if there's sufficient documentation.


Let me check if there's any SvelteKit integration documentation in the manual or tutorial sections.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Look for SvelteKit integration documentation
# Test: Search for SvelteKit-related documentation files and code comments

# Check for documentation files
fd -t f -e md -e mdx sveltekit

# Check for detailed code comments in the SvelteKit module
rg -l "SvelteKit" "src/x"

Length of output: 75


Script:

#!/bin/bash
# Check the content of the SvelteKit integration file
cat src/x/sveltekit.ts

# Also check if there are any examples or documentation in docs directory
fd -t f -e md -e mdx . docs

Length of output: 3363


Script:

#!/bin/bash
# Check manual integration docs for SvelteKit content
cat docs/manual/integration.md

# Search for any SvelteKit mentions in tutorials
rg -i sveltekit docs/tutorial/

Length of output: 9065

🧰 Tools
🪛 Markdownlint (0.35.0)

70-70: Expected: 0; Actual: 1
Unordered list indentation

(MD007, ul-indent)

Copy link

codecov bot commented Nov 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.46%. Comparing base (ad29077) to head (a6eb859).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #183   +/-   ##
=======================================
  Coverage   84.46%   84.46%           
=======================================
  Files          42       42           
  Lines       11618    11618           
  Branches     1157     1157           
=======================================
  Hits         9813     9813           
  Misses       1784     1784           
  Partials       21       21           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

dahlia
dahlia previously approved these changes Nov 23, 2024
Copy link
Owner

@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.

Thanks for your first contribution!

@dahlia dahlia force-pushed the integration/svelte branch 2 times, most recently from a27deac to 819ece9 Compare November 23, 2024 16:52
@dahlia dahlia force-pushed the integration/svelte branch from 819ece9 to a6eb859 Compare November 23, 2024 16:52
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (3)
src/x/sveltekit.ts (2)

1-11: Enhance module documentation with more examples

The module documentation is well-structured, but consider adding:

  • Examples of different context data scenarios
  • Common use cases for federation integration
  • Error handling examples

46-58: Consider enhancing error handling and type safety

The implementation could benefit from:

  1. Adding try-catch block to handle potential errors from createContextData
  2. Adding runtime validation for the federation object

Consider applying this improvement:

 export function fedifyHook<TContextData>(
   federation: Federation<TContextData>,
   createContextData: (
     event: RequestEvent,
   ) => TContextData | Promise<TContextData>,
 ): (params: HookParams) => Promise<Response> {
   return async ({ event, resolve }: HookParams) => {
+    try {
+      const contextData = await createContextData(event);
       return await federation.fetch(event.request, {
-        contextData: await createContextData(event),
+        contextData,
         ...integrateFetchOptions({ event, resolve }),
       });
+    } catch (error) {
+      console.error('Error in fedifyHook:', error);
+      return new Response('Internal Server Error', { status: 500 });
+    }
   };
 }
docs/manual/integration.md (1)

199-214: Consider enhancing the SvelteKit integration documentation.

While the basic integration is well documented, consider adding:

  • A brief explanation of SvelteKit's server hooks concept
  • Any specific considerations or limitations when using Fedify with SvelteKit
  • Examples of common use cases or patterns

Would you like me to help draft the additional documentation sections?

🛑 Comments failed to post (1)
docs/manual/integration.md (1)

216-216: ⚠️ Potential issue

Fix typo in SvelteKit link reference.

There's a typo in the link reference: "SevlteKit" should be "SvelteKit".

Apply this fix:

-[SevlteKit]: https://kit.svelte.dev/
+[SvelteKit]: https://kit.svelte.dev/
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

[SvelteKit]: https://kit.svelte.dev/
🧰 Tools
🪛 Markdownlint (0.35.0)

216-216: Unused link or image reference definition: "sevltekit"
Link and image reference definitions should be needed

(MD053, link-image-reference-definitions)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (7)
docs/manual/integration.md (2)

194-214: Enhance the SvelteKit integration documentation.

While the section follows the document's structure well, consider these improvements to make it more comprehensive:

  1. Add comments explaining the expected shape and usage of the context data parameter in the code example
  2. Include any specific considerations or limitations when using Fedify with SvelteKit
  3. Add an example of how to handle errors or customize the hook behavior

Here's a suggested addition to the code example:

 // This is the entry point to the Fedify hook from the SvelteKit framework:
-export const handle = fedifyHook(federation, (req) => "context data");
+// The context data factory function receives the SvelteKit Request object
+// and should return any data needed by your Fedify handlers
+export const handle = fedifyHook(federation, (req) => {
+  // Example: return user session data, configuration, etc.
+  return "context data";
+});

219-219: Remove extra blank line for consistent section spacing.

To maintain consistent formatting with other sections, remove the extra blank line.

CHANGES.md (1)

64-69: Fix list indentation for consistency.

The unordered lists have inconsistent indentation. According to the static analysis:

  • The main bullet points should have 0 spaces indentation
  • Sub-bullet points should have 2 spaces indentation

Apply this diff to fix the indentation:

-    -  Added `fedifyHook()` function.
+  - Added `fedifyHook()` function.
🧰 Tools
🪛 Markdownlint (0.35.0)

64-64: Expected: 0; Actual: 1
Unordered list indentation

(MD007, ul-indent)


67-67: Expected: 2; Actual: 5
Unordered list indentation

(MD007, ul-indent)


69-69: Expected: 0; Actual: 1
Unordered list indentation

(MD007, ul-indent)

src/x/sveltekit.ts (4)

53-53: Remove redundant await in return await

Since federation.fetch returns a Promise, you can return it directly without using await.

Apply this diff:

-    return await federation.fetch(event.request, {
+    return federation.fetch(event.request, {

65-65: Remove redundant await in return await

The resolve(event) call returns a Promise. You can return it directly without await.

Apply this diff:

-      return await resolve(event);
+      return resolve(event);

68-68: Minor grammatical correction in comment

Consider rephrasing the comment for better readability.

Apply this diff:

-    // Similar to `onNotFound`, but slightly more tricky one.
+    // Similar to `onNotFound`, but slightly trickier.

70-72: Clarify the comment for better understanding

Consider rewording the comment to improve clarity.

Apply this diff:

-    // provided by the SvelteKit framework so that it renders HTML if there's some
-    // page.  Otherwise, it will simply return a 406 Not Acceptable response.
+    // provided by the SvelteKit framework to render HTML if there's a corresponding
+    // page. Otherwise, it returns a 406 Not Acceptable response.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between a27deac and a6eb859.

📒 Files selected for processing (3)
  • CHANGES.md (2 hunks)
  • docs/manual/integration.md (1 hunks)
  • src/x/sveltekit.ts (1 hunks)
🧰 Additional context used
🪛 Markdownlint (0.35.0)
CHANGES.md

64-64: Expected: 0; Actual: 1
Unordered list indentation

(MD007, ul-indent)


67-67: Expected: 2; Actual: 5
Unordered list indentation

(MD007, ul-indent)


69-69: Expected: 0; Actual: 1
Unordered list indentation

(MD007, ul-indent)


72-72: Expected: 0; Actual: 1
Unordered list indentation

(MD007, ul-indent)

🔇 Additional comments (6)
docs/manual/integration.md (2)

199-202: Documentation aligns well with PR objectives.

The section effectively documents the SvelteKit integration, addressing Issue #171's requirements and clearly explaining the server hook implementation.


205-206: Verify the SvelteKit module exports.

Let's verify that the documented module and exports exist in the codebase.

✅ Verification successful

Documentation accurately reflects the implementation

The documentation correctly references the fedifyHook function which exists in the @fedify/fedify/x/sveltekit module. The implementation in src/x/sveltekit.ts matches the documented usage, showing both the function export and its practical application in creating a SvelteKit handle.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of the SvelteKit module and its exports

# Check if the module file exists
fd -t f "sveltekit.ts" src/x

# Check for fedifyHook export
rg -l "export.*fedifyHook" src/x/sveltekit.ts

Length of output: 114


Script:

#!/bin/bash
# Let's verify the actual implementation and exports
rg -A 5 "export.*fedifyHook" src/x/sveltekit.ts

# Also check the main package exports to ensure the module is properly exposed
fd -t f "index.ts" src/x
rg "export.*sveltekit" src/x/index.ts

Length of output: 664

CHANGES.md (2)

64-68: Enhance the SvelteKit integration documentation.

The changelog entry for SvelteKit integration is quite brief. Consider adding more details about:

  • The functionality provided by the fedifyHook middleware
  • Configuration options and usage examples
  • Any limitations or considerations when using SvelteKit integration
🧰 Tools
🪛 Markdownlint (0.35.0)

64-64: Expected: 0; Actual: 1
Unordered list indentation

(MD007, ul-indent)


67-67: Expected: 2; Actual: 5
Unordered list indentation

(MD007, ul-indent)


76-80: LGTM!

The link references are properly formatted and follow the standard markdown syntax.

src/x/sveltekit.ts (2)

52-57: Well-implemented integration with federation.fetch

The asynchronous function correctly integrates with the Federation object, ensuring proper context data handling and fetch options.


63-86: Effective handling of content negotiation and route sharing

The integrateFetchOptions function provides appropriate responses for onNotFound and onNotAcceptable scenarios, enabling seamless integration between Fedify and SvelteKit routes with proper content negotiation based on the Accept header.

@dahlia dahlia merged commit fb2366f into dahlia:main Nov 23, 2024
14 checks passed
@robin-maki robin-maki deleted the integration/svelte branch November 24, 2024 02:13
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.

SvelteKit integration
2 participants