From 42c721e71627be6ff10a8ac12bf79b501851ca00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9?= Date: Sun, 21 Apr 2024 15:06:36 +0200 Subject: [PATCH] [v3-Maintenance]-Consolidate-and-Document-Core-Changes-in-v3 --- docs/core/whats_new.md | 68 ++++++++++++++++++- .../DocVersionBanner/{index.js => index.tsx} | 26 ++++--- 2 files changed, 80 insertions(+), 14 deletions(-) rename src/theme/DocVersionBanner/{index.js => index.tsx} (77%) diff --git a/docs/core/whats_new.md b/docs/core/whats_new.md index 308486794b4..3e4f755c341 100644 --- a/docs/core/whats_new.md +++ b/docs/core/whats_new.md @@ -28,21 +28,83 @@ Fiber v3 drops support for Go versions below 1.21. We recommend upgrading to Go We have made several changes to the Fiber app, including: -Listen -Mount +* Listen -> unified with config +* app.Config properties moved to listen config + * DisableStartupMessage + * EnablePrefork -> previously Prefork + * EnablePrintRoutes + * ListenerNetwork -> previously Network +#### new methods + +* RegisterCustomBinder +* RegisterCustomConstraint +* NewCtxFunc + +#### removed methods + +* Mount -> Use app.Use() instead +* ListenTLS -> Use app.Listen() with tls.Config +* ListenTLSWithCertificate -> Use app.Listen() with tls.Config +* ListenMutualTLS -> Use app.Listen() with tls.Config +* ListenMutualTLSWithCertificate -> Use app.Listen() with tls.Config + +#### changed methods + +* Routing methods -> Get(), Post(), Put(), Delete(), Patch(), Options(), Trace(), Connect() and All() +* Use -> can be used for app mounting +* Test -> timeout changed to 1 second +* Listen -> has a config parameter +* Listener -> has a config parameter ### Context change #### interface #### customizable + +#### new methods + +* AutoFormat -> ExpressJs like +* Host -> ExpressJs like +* Port -> ExpressJs like +* IsProxyTrusted +* Reset +* Schema -> ExpressJs like +* SendStream -> ExpressJs like +* SendString -> ExpressJs like +* String -> ExpressJs like +* ViewBind -> instead of Bind + +#### removed methods + +* AllParams -> c.Bind().URL() ? +* ParamsInt -> Params Generic +* QueryBool -> Query Generic +* QueryFloat -> Query Generic +* QueryInt -> Query Generic +* BodyParser -> c.Bind().Body() +* CookieParser -> c.Bind().Cookie() +* ParamsParser -> c.Bind().URL() +* RedirectToRoute -> c.Redirect().Route() +* RedirectBack -> c.Redirect().Back() +* ReqHeaderParser -> c.Bind().Header() + +#### changed methods + +* Bind -> for Binding instead of View, us c.ViewBind() +* Format -> Param: body interface{} -> handlers ...ResFmt + ### Client package + + ### Binding ### Generic functions + ### Middleware refactoring #### Session middleware #### Filesystem middleware +### Monitor middleware -### monitor middleware +Monitor middleware is now in Contrib package. ## Migration guide ... diff --git a/src/theme/DocVersionBanner/index.js b/src/theme/DocVersionBanner/index.tsx similarity index 77% rename from src/theme/DocVersionBanner/index.js rename to src/theme/DocVersionBanner/index.tsx index ffafec55a57..dbc78f27146 100644 --- a/src/theme/DocVersionBanner/index.js +++ b/src/theme/DocVersionBanner/index.tsx @@ -1,13 +1,17 @@ import React from 'react'; import clsx from 'clsx'; import DocVersionBanner from '@theme-original/DocVersionBanner'; -import {ThemeClassNames} from '@docusaurus/theme-common'; -import {useActivePlugin, useActiveDocContext} from "@docusaurus/plugin-content-docs/lib/client"; +import { ThemeClassNames } from '@docusaurus/theme-common'; +import type DocVersionBannerType from '@theme/DocVersionBanner'; +import type {WrapperProps} from '@docusaurus/types'; +import { useActiveDocContext, useActivePlugin } from '@docusaurus/plugin-content-docs/lib/client'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +type Props = WrapperProps; + const multiRepoPkg = ['contrib', 'storage', 'template']; -export default function DocVersionBannerWrapper(props) { +export default function DocVersionBannerWrapper(props: Props): JSX.Element { const plugin = useActivePlugin(); const docContext = useActiveDocContext(plugin.pluginId); const currVersion = docContext?.activeVersion?.name; @@ -30,9 +34,9 @@ export default function DocVersionBannerWrapper(props) { )} role="alert"> {currVersion === 'current' && -
- This is unreleased documentation for {title} Next {possiblePackage} version. -
+
+ This is unreleased documentation for {title} Next {possiblePackage} version. +
}
For up-to-date documentation, see the latest version ({alternativePackageVersion}). @@ -48,9 +52,9 @@ export default function DocVersionBannerWrapper(props) { return null; } - return ( - <> - - - ); + return ( + <> + + + ); }