Skip to content

Commit

Permalink
[v3-Maintenance]-Consolidate-and-Document-Core-Changes-in-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneWerner87 committed Apr 21, 2024
1 parent 13dedd9 commit 42c721e
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 14 deletions.
68 changes: 65 additions & 3 deletions docs/core/whats_new.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
...
Original file line number Diff line number Diff line change
@@ -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<typeof DocVersionBannerType>;

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;
Expand All @@ -30,9 +34,9 @@ export default function DocVersionBannerWrapper(props) {
)}
role="alert">
{currVersion === 'current' &&
<div>
This is unreleased documentation for {title} Next <b>{possiblePackage}</b> version.
</div>
<div>
This is unreleased documentation for {title} Next <b>{possiblePackage}</b> version.
</div>
}
<div>
For up-to-date documentation, see the <a href={docContext.alternateDocVersions[alternativePackageVersion].path}>latest version ({alternativePackageVersion})</a>.
Expand All @@ -48,9 +52,9 @@ export default function DocVersionBannerWrapper(props) {

return null;
}
return (
<>
<DocVersionBanner {...props} />
</>
);
return (
<>
<DocVersionBanner {...props} />
</>
);
}

0 comments on commit 42c721e

Please sign in to comment.