Skip to content

📒 docs: Improve wording and fix typos#3713

Merged
ReneWerner87 merged 3 commits intomainfrom
2025-08-26-09-56-18
Aug 26, 2025
Merged

📒 docs: Improve wording and fix typos#3713
ReneWerner87 merged 3 commits intomainfrom
2025-08-26-09-56-18

Conversation

@gaby
Copy link
Member

@gaby gaby commented Aug 26, 2025

Summary

  • polish intro and routing docs for clearer guidance
  • refine JSON encoder advice and fix syntax example
  • clarify error handling, templating, advanced format, and grouping docs

Copilot AI review requested due to automatic review settings August 26, 2025 09:56
@gaby gaby requested a review from a team as a code owner August 26, 2025 09:56
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 26, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Documentation wording and example adjustments across multiple guides: Advanced Format (MsgPack/CBOR heading, Accept header wording, example variable fix), error-handling clarifications, performance page library additions and example tweaks, grouping terminology and phrasing updates, templates “bound” wording, and intro phrasing refinements. No code or API changes.

Changes

Cohort / File(s) Summary of changes
Advanced format docs
docs/guide/advance-format.md
Corrected title to "Advanced Format", normalized "MsgPack" casing, clarified Accept header formatting, fixed MsgPack example to return c.MsgPack(user), refined CBOR wording and header formatting, and minor consistency edits.
Error handling docs
docs/guide/error-handling.md
Reworded for clarity and tone; clarified fiber.NewError() message default behavior; no behavioral changes.
Performance (Faster Fiber)
docs/guide/faster-fiber.md
Generalized encoder performance wording; added segmentio/encoding and minio/simdjson-go to recommendations; minor example comment and import edits.
Grouping docs
docs/guide/grouping.md
Normalized "Express.js" naming, clarified group routing semantics and processing order, updated path-prefix guidance, emphasized Next for group handlers, reworded 404 caution; examples unchanged.
Templates docs
docs/guide/templates.md
Replaced "binded" with "bound", rephrased Render description and linkage to ctx.Render().
Intro docs
docs/intro.md
Phrasing refinements (welcome, installation line, zero-allocation guidance tone, Hello World wording, routing description); no API changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • sixcolors
  • efectn
  • ReneWerner87

Poem

I nibble docs with tiny paws,
Fixing words and smoothing flaws.
MsgPack crumbs and CBOR tea,
Bound not binded — hop with me.
Fiber hops, the docs are bright! 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 63ab677 and 1aea4aa.

📒 Files selected for processing (1)
  • docs/guide/advance-format.md (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/guide/advance-format.md
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 2025-08-26-09-56-18

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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
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.

Summary of Changes

Hello @gaby, 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 focuses on enhancing the clarity, accuracy, and consistency of the Fiber framework's documentation. It includes significant wording improvements, typo fixes, and refined explanations across various guide sections, such as advanced data formats, error handling, templating, JSON encoding, and routing groups, aiming to provide clearer guidance for users.

Highlights

  • Documentation Clarity: Improved overall wording and fixed typos across multiple guide documents for better readability and understanding.
  • Advanced Formats: Clarified explanations and corrected examples for MessagePack (MsgPack) and CBOR usage.
  • Error Handling: Refined descriptions for catching errors and using custom error handlers in Fiber applications.
  • JSON Encoder/Decoder: Updated advice on custom JSON encoders and corrected a code comment in the example.
  • Grouping and Routing: Enhanced explanations for route grouping behavior and basic routing concepts.
  • Templating: Standardized terminology from "binded data" to "bound data" for template rendering.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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

@gaby gaby changed the title docs: improve wording and fix typos 📒 docs: Improve wording and fix typos Aug 26, 2025
@gaby gaby added this to v3 Aug 26, 2025
@gaby gaby added this to the v3 milestone Aug 26, 2025
@gaby gaby moved this to In Progress in v3 Aug 26, 2025
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 provides a series of documentation improvements, including fixing typos, correcting grammatical errors, and rephrasing content for better clarity and conciseness. The changes span multiple guide documents, enhancing their readability and correctness. A notable fix includes correcting a variable name in a code example, which improves the example's accuracy. Overall, these are excellent changes that polish the documentation.

Copy link
Contributor

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

This PR improves the clarity and accuracy of Fiber's documentation by refining language, fixing typos, and enhancing technical explanations across multiple guide files.

  • Polished wording in introduction and routing sections for better readability
  • Fixed grammatical errors and improved technical terminology consistency
  • Corrected code examples and enhanced explanations of advanced features

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docs/intro.md Streamlined welcome message and improved explanations of zero allocation and basic routing concepts
docs/guide/templates.md Fixed grammar issues with "binded" to "bound" and clarified template rendering explanations
docs/guide/grouping.md Enhanced group functionality explanations and improved clarity of handler behavior
docs/guide/faster-fiber.md Fixed syntax error in code comment and refined JSON encoder guidance
docs/guide/error-handling.md Streamlined error handling explanations and improved custom error handler descriptions
docs/guide/advance-format.md Corrected title spelling, fixed variable name in example, and improved CBOR/MsgPack explanations

Copy link
Contributor

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docs/guide/templates.md (1)

127-133: Example compiles: missing closing parenthesis in AddFunc example.

The function literal closes with “}” but the AddFunc call needs “})”. Copy-paste will fail as-is.

Apply this diff:

-engine.AddFunc("ToUpper", func(s string) string {
-    return strings.ToUpper(s)
-}
+engine.AddFunc("ToUpper", func(s string) string {
+    return strings.ToUpper(s)
+})
docs/guide/error-handling.md (1)

58-66: Fix unreachable code in example; show alternatives without breaking compilation.

Two return statements in sequence make the second one unreachable if copied verbatim. Present one as a commented alternative.

 app.Get("/", func(c fiber.Ctx) error {
-    // 503 Service Unavailable
-    return fiber.ErrServiceUnavailable
-
-    // 503 On vacation!
-    return fiber.NewError(fiber.StatusServiceUnavailable, "On vacation!")
+    // Option 1: 503 Service Unavailable (predefined)
+    // return fiber.ErrServiceUnavailable
+
+    // Option 2: 503 with custom message
+    return fiber.NewError(fiber.StatusServiceUnavailable, "On vacation!")
 })
🧹 Nitpick comments (6)
docs/guide/templates.md (1)

55-57: Terminology consistency: “bound data” vs. “data to bind.”

Line 55 uses “bound data” while Line 61 says “data to bind.” Prefer one term across the page (I’d keep “bound data”).

Apply this diff to Line 61:

-The `Render` method powers the [**ctx.Render()**](../api/ctx.md#render) function, which accepts a template name and data to bind.
+The `Render` method powers the [**ctx.Render()**](../api/ctx.md#render) function, which accepts a template name and bound data.
docs/guide/faster-fiber.md (1)

11-15: Clarify drop-in vs. non drop-in libraries.

  • segmentio/encoding/json can act as a drop-in (same Marshal/Unmarshal signatures under a json import alias).
  • minio/simdjson-go is primarily a high-performance parser and not a drop-in replacement for encoding/json encoders/decoders; it won’t plug into JSONEncoder/JSONDecoder without adapters.

A short note next to each bullet would prevent confusion.

Apply this diff:

-- [segmentio/encoding](https://github.com/segmentio/encoding)
-- [minio/simdjson-go](https://github.com/minio/simdjson-go)
+- [segmentio/encoding](https://github.com/segmentio/encoding) — Drop-in `json.Marshal`/`json.Unmarshal` under `github.com/segmentio/encoding/json`.
+- [minio/simdjson-go](https://github.com/minio/simdjson-go) — SIMD-accelerated JSON parser (not a drop-in encoder/decoder).
docs/intro.md (1)

132-166: Ports vary across examples (3000 vs. 8080).

Consider standardizing on one port across examples for consistency (e.g., 3000).

docs/guide/grouping.md (1)

8-9: Tone: “identical to Express.js” is stronger than necessary.

Suggest softening to “similar to Express.js” to avoid implying perfect parity in edge cases.

Apply this diff:

-In general, group functionality in Fiber behaves like Express.js. Groups are declared virtually, and all routes defined within a group are flattened into a single list with a prefix and processed in the order declared. This makes group behavior in Fiber identical to Express.js.
+In general, group functionality in Fiber is similar to Express.js. Groups are declared virtually, and all routes defined within a group are flattened into a single list with a prefix and processed in the order declared.
docs/guide/error-handling.md (2)

16-16: Tighten wording: errors are returned from handlers to Fiber’s error handler, not “to the handler function”.

The current phrasing can be misread. This edit is clearer and accurate.

-Ensure that Fiber catches all errors from route handlers and middleware by returning them to the handler function for processing.
+Return errors from your handlers and middleware so Fiber’s error handler can process them.

96-96: Add a short note on avoiding sensitive error leakage; optionally include a JSON error example.

Since many users copy docs verbatim, a one-liner reminding to avoid returning internal error strings directly (and to prefer structured JSON for APIs) is valuable.

-In most cases, the default error handler is sufficient. However, a custom handler is useful when you need to capture different error types and respond accordingly—for example, sending notification emails or logging to a centralized system. You can also send custom responses to the client, such as an error page or a JSON message.
+In most cases, the default error handler is sufficient. However, a custom handler is useful when you need to capture different error types and respond accordingly—for example, sending notification emails or logging to a centralized system. You can also send custom responses to the client (HTML pages or structured JSON). For production APIs, avoid leaking internal error details in responses; log them server‑side and return sanitized messages to clients.

Optional example (no change required in this PR):

// JSON-oriented error handler (sanitizes messages)
app := fiber.New(fiber.Config{
    ErrorHandler: func(c fiber.Ctx, err error) error {
        code := fiber.StatusInternalServerError
        var fe *fiber.Error
        if errors.As(err, &fe) {
            code = fe.Code
        }

        // Log full error internally
        // log.Printf("request_id=%s err=%v", c.GetRespHeader("X-Request-ID"), err)

        // Return a minimal, structured response
        type apiError struct {
            Error   string `json:"error"`
            Code    int    `json:"code"`
            TraceID string `json:"trace_id,omitempty"`
        }
        payload := apiError{
            Error: http.StatusText(code),
            Code:  code,
            // TraceID: c.GetRespHeader("X-Request-ID"), // if you set one
        }
        c.Set(fiber.HeaderContentType, fiber.MIMEApplicationJSONCharsetUTF8)
        return c.Status(code).JSON(payload)
    },
})
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a6b0389 and 63ab677.

📒 Files selected for processing (6)
  • docs/guide/advance-format.md (3 hunks)
  • docs/guide/error-handling.md (3 hunks)
  • docs/guide/faster-fiber.md (2 hunks)
  • docs/guide/grouping.md (3 hunks)
  • docs/guide/templates.md (1 hunks)
  • docs/intro.md (4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs/**

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Review and update the contents of the docs folder if necessary when modifying code

Files:

  • docs/guide/templates.md
  • docs/guide/grouping.md
  • docs/guide/error-handling.md
  • docs/guide/faster-fiber.md
  • docs/guide/advance-format.md
  • docs/intro.md
🧠 Learnings (7)
📚 Learning: 2024-11-15T07:56:21.623Z
Learnt from: ReneWerner87
PR: gofiber/fiber#3161
File: app.go:923-932
Timestamp: 2024-11-15T07:56:21.623Z
Learning: In the Fiber framework, breaking changes are acceptable when moving from version 2 to version 3, including modifications to method signatures such as in the `Test` method in `app.go`.

Applied to files:

  • docs/guide/error-handling.md
  • docs/guide/faster-fiber.md
  • docs/intro.md
📚 Learning: 2024-09-25T16:18:34.719Z
Learnt from: sixcolors
PR: gofiber/fiber#3016
File: middleware/session/config.go:122-122
Timestamp: 2024-09-25T16:18:34.719Z
Learning: In `DefaultErrorHandler(c *fiber.Ctx, err error)`, since `c` is a pointer to an interface, we need to dereference `*c` when calling interface methods like `SendStatus`.

Applied to files:

  • docs/guide/error-handling.md
📚 Learning: 2025-07-08T13:41:20.627Z
Learnt from: ksw2000
PR: gofiber/fiber#0
File: :0-0
Timestamp: 2025-07-08T13:41:20.627Z
Learning: ksw2000 suggests implementing a pluggable encoder/decoder registry system in Fiber instead of hardcoding all encoders in app.config. This would solve dependency management issues by allowing users to opt-in only to the formats they need, keeping JSON and XML as defaults while making CBOR and MsgPack explicit registrations.

Applied to files:

  • docs/guide/faster-fiber.md
  • docs/guide/advance-format.md
📚 Learning: 2024-12-01T10:28:36.011Z
Learnt from: ReneWerner87
PR: gofiber/fiber#0
File: :0-0
Timestamp: 2024-12-01T10:28:36.011Z
Learning: Fiber currently supports square bracket notation in form data with 'application/x-www-form-urlencoded' content type, but this feature is not available for multipart form data. The implementation for form-urlencoded is in ctx.go (BodyParser method), while multipart form data handling needs enhancement to support this feature.

Applied to files:

  • docs/guide/advance-format.md
📚 Learning: 2025-05-13T00:19:16.407Z
Learnt from: sixcolors
PR: gofiber/fiber#3446
File: docs/middleware/logger.md:44-44
Timestamp: 2025-05-13T00:19:16.407Z
Learning: In documentation files for the Fiber framework, code examples are often partial and don't repeat import statements that were shown in earlier examples, focusing instead on demonstrating specific usage patterns.

Applied to files:

  • docs/intro.md
📚 Learning: 2024-11-10T23:44:13.704Z
Learnt from: gaby
PR: gofiber/fiber#3193
File: middleware/adaptor/adaptor.go:111-111
Timestamp: 2024-11-10T23:44:13.704Z
Learning: In the `middleware/adaptor/adaptor.go` file of the Fiber framework, when updating context handling, replacing `c.Context()` with `c.RequestCtx()` is appropriate to access the `fasthttp.RequestCtx`.

Applied to files:

  • docs/intro.md
📚 Learning: 2024-11-08T04:10:42.990Z
Learnt from: gaby
PR: gofiber/fiber#3193
File: middleware/cache/cache_test.go:897-897
Timestamp: 2024-11-08T04:10:42.990Z
Learning: In the Fiber framework, `Context()` is being renamed to `RequestCtx()`, and `UserContext()` to `Context()` to improve clarity and align with Go's context conventions.

Applied to files:

  • docs/intro.md
🔇 Additional comments (17)
docs/guide/templates.md (1)

66-66: Good clarification on “bound” wording.

Replacing “binded” with “bound” fixes the grammar and reads cleanly.

docs/guide/faster-fiber.md (2)

28-28: LGTM on comment style.

Switching to // ... matches Go conventions inside code blocks.


9-9: Verify the version where encoding/json became the default
The note in docs/guide/faster-fiber.md (line 9) states “Since Fiber v2.32.0…”. Please double-check Fiber’s release history or source to confirm the exact version that re-adopted encoding/json as the default JSON implementation. If this is incorrect, update the version to the accurate one.

  • docs/guide/faster-fiber.md: line 9
docs/guide/advance-format.md (3)

3-3: Title fix reads correctly.

“Advanced Format” is the right phrasing and improves discoverability.


58-60: Example variable fix is correct.

Returning user matches the value bound above.


58-59: No changes required: Content-Type is application/vnd.msgpack.

The code’s default for Ctx.MsgPack() is indeed application/vnd.msgpack (see constants.go:31 where MIMEApplicationMsgPack = "application/vnd.msgpack", and DefaultRes.MsgPack uses this constant when no custom type is provided). Tests in ctx_test.go also assert this value. The documentation correctly reflects this.

docs/intro.md (7)

7-7: Welcome sentence reads better.

Nice, concise improvement.


19-23: Instruction reads clearer.

“Install Fiber using the go get command” is more direct.


27-36: Good balance of “should” vs. “must not.”

This keeps the performance guidance firm without sounding overly prescriptive.


78-94: Phrasing improvement acknowledged.

“Simplest Fiber application” is clearer phrasing.


104-119: Routing description is tighter.

The reworded sentence is accurate and easier to scan.


11-11: Update placeholder with official Fiber v3 release date

Please replace the placeholder “Month xx, 202x” with the actual public release date of Fiber v3 (as documented in the official GitHub releases or changelog) before merging.

• File: docs/intro.md
• Line: 11
• Current text:
These docs are for **Fiber v3**, which was released on **Month xx, 202x**.
• Action: swap out “Month xx, 202x” for the real release date (e.g., “June 10, 2025”).

Please verify the exact date from your authoritative source (e.g., the Fiber GitHub Releases page) and update accordingly.


17-17: Verify Go version requirement

I wasn’t able to locate any go.mod in the repository to confirm the minimum Go version. Please ensure the docs align with the actual requirement declared in your module or CI configuration:

• Confirm where your go.mod lives and check its go <version> directive.
• If you specify the Go version in CI (e.g. GitHub Actions workflows), make sure docs/intro.md matches that.
• Update line 17 of docs/intro.md (“Version 1.25 or higher is required.”) to reflect the true minimum version.

docs/guide/grouping.md (4)

13-14: Good simplification.

“Path prefixes to organize related routes” is clearer and accurate.


33-34: LGTM on phrasing.

“Include an optional handler” reads better.


54-55: Caution note reads cleaner.

The 404 guidance is accurate and concise.


59-73: Accurate requirement to call Next.

Essential detail for group middleware; good clarification.

@ReneWerner87 ReneWerner87 merged commit 3646c82 into main Aug 26, 2025
2 checks passed
@ReneWerner87 ReneWerner87 deleted the 2025-08-26-09-56-18 branch August 26, 2025 10:37
@github-project-automation github-project-automation bot moved this from In Progress to Done in v3 Aug 26, 2025
Abhirup-99 pushed a commit to Abhirup-99/fiber that referenced this pull request Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants