-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It's at a state where it's stable release now.
- Loading branch information
Showing
7 changed files
with
213 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
id: custom | ||
title: Writing custom middleware | ||
sidebar_label: Writing your own Middleware* | ||
sidebar_label: Write your own | ||
slug: /middleware/custom | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
id: logging | ||
title: Logging | ||
sidebar_label: Logging | ||
slug: /middleware/logging | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,35 @@ | ||
--- | ||
id: typecheck | ||
title: Runtime Type Checking | ||
sidebar_label: Runtime Type Checker* | ||
sidebar_label: Enforcing types at runtime | ||
slug: /middleware/types | ||
--- | ||
--- | ||
import Code, { DEFAULT_VALUE, GROUP, TABS } from '@site/src/components/Code' | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
It's important when you recieve events or calls from the server that you ensure the types are correct, otherwise unwanted errors may pop up. | ||
|
||
If you want to ensure the types you're recieving from the client _are_ the types you're expecting, you can use the [`Net.Middleware.TypeChecking`](../api/middleware#typechecking) middleware. | ||
|
||
This middleware just takes type checking functions. | ||
|
||
## Using a library like `t` | ||
|
||
The rate limiter middleware is created as such: | ||
|
||
<Tabs defaultValue={DEFAULT_VALUE} groupId={GROUP} values={TABS}> | ||
<TabItem value="ts"> | ||
|
||
```ts | ||
Net.Middleware.TypeCheck(t.string) | ||
``` | ||
</TabItem> | ||
<TabItem value="luau"> | ||
|
||
```lua | ||
Net.Middleware.TypeCheck(t.string) | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,127 +1,127 @@ | ||
module.exports = { | ||
title: "Roblox Networking", | ||
tagline: "Advanced multi-language networking library for Roblox.", | ||
url: "https://docs.vorlias.com/rbx-net", | ||
baseUrl: "/rbx-net/", | ||
onBrokenLinks: "throw", | ||
onBrokenMarkdownLinks: "warn", | ||
favicon: "img/favicon.ico", | ||
organizationName: "roblox-aurora", // Usually your GitHub org/user name. | ||
projectName: "rbx-net", // Usually your repo name. | ||
themeConfig: { | ||
colorMode: { | ||
// defaultMode: "dark", | ||
// disableSwitch: true, | ||
respectPrefersColorScheme: true, | ||
}, | ||
prism: { | ||
theme: require("prism-react-renderer/themes/vsDark"), | ||
additionalLanguages: ["typescript", "lua", "powershell", "toml"], | ||
}, | ||
navbar: { | ||
title: "Roblox Networking", | ||
logo: { | ||
alt: "RbxNet Logo", | ||
src: "img/net2.svg", | ||
srcDark: "img/net2-light.svg", | ||
}, | ||
items: [ | ||
{ | ||
label: "Documentation", | ||
type: "docsVersion", | ||
}, | ||
{ | ||
type: "docsVersionDropdown", | ||
position: "right", | ||
|
||
// Add additional dropdown items at the beginning/end of the dropdown. | ||
dropdownItemsBefore: [], | ||
dropdownItemsAfter: [], | ||
|
||
// Do not add the link active class when browsing docs. | ||
dropdownActiveClassDisabled: true, | ||
}, | ||
// { to: "docs/api", label: "API", position: "right" }, | ||
{ to: "blog", label: "Updates", position: "right" }, | ||
{ | ||
href: "https://github.com/roblox-aurora/rbx-net", | ||
label: "GitHub", | ||
position: "right", | ||
}, | ||
], | ||
}, | ||
footer: { | ||
style: "dark", | ||
links: [ | ||
// { | ||
// title: 'Docs', | ||
// items: [ | ||
// { | ||
// label: 'Style Guide', | ||
// to: 'docs/', | ||
// }, | ||
// { | ||
// label: 'Second Doc', | ||
// to: 'docs/doc2/', | ||
// }, | ||
// ], | ||
// }, | ||
// { | ||
// title: 'Community', | ||
// items: [ | ||
// { | ||
// label: 'Discord', | ||
// href: 'https://discordapp.com/invite/docusaurus', | ||
// }, | ||
// ], | ||
// }, | ||
// { | ||
// title: 'More', | ||
// items: [ | ||
// { | ||
// label: 'Blog', | ||
// to: 'blog', | ||
// }, | ||
// { | ||
// label: 'GitHub', | ||
// href: 'https://github.com/roblox-aurora/rbx-net', | ||
// }, | ||
// ], | ||
// }, | ||
], | ||
copyright: `Copyright © ${new Date().getFullYear()} Jonathan Holmes`, | ||
}, | ||
}, | ||
presets: [ | ||
[ | ||
"@docusaurus/preset-classic", | ||
{ | ||
docs: { | ||
sidebarPath: require.resolve("./sidebars.json"), | ||
lastVersion: "current", | ||
versions: { | ||
current: { | ||
label: require("../package.json").version, | ||
path: "2.0" | ||
}, | ||
"1.3.0": { | ||
label: "1.3.0-beta.6.2", | ||
path: "1.3.x", | ||
}, | ||
}, | ||
// Please change this to your repo. | ||
editUrl: "https://github.com/roblox-aurora/rbx-net/edit/main/docs/", | ||
}, | ||
blog: { | ||
showReadingTime: true, | ||
// Please change this to your repo. | ||
editUrl: | ||
"https://github.com/roblox-aurora/rbx-net/edit/main/docs/blog/", | ||
}, | ||
theme: { | ||
customCss: require.resolve("./src/css/custom.css"), | ||
}, | ||
}, | ||
], | ||
], | ||
}; | ||
module.exports = { | ||
title: "Roblox Networking", | ||
tagline: "Advanced multi-language networking library for Roblox.", | ||
url: "https://docs.vorlias.com/rbx-net", | ||
baseUrl: "/rbx-net/", | ||
onBrokenLinks: "throw", | ||
onBrokenMarkdownLinks: "warn", | ||
favicon: "img/favicon.ico", | ||
organizationName: "roblox-aurora", // Usually your GitHub org/user name. | ||
projectName: "rbx-net", // Usually your repo name. | ||
themeConfig: { | ||
colorMode: { | ||
// defaultMode: "dark", | ||
// disableSwitch: true, | ||
respectPrefersColorScheme: true, | ||
}, | ||
prism: { | ||
theme: require("prism-react-renderer/themes/vsDark"), | ||
additionalLanguages: ["typescript", "lua", "powershell", "toml"], | ||
}, | ||
navbar: { | ||
title: "Roblox Networking", | ||
logo: { | ||
alt: "RbxNet Logo", | ||
src: "img/net2.svg", | ||
srcDark: "img/net2-light.svg", | ||
}, | ||
items: [ | ||
{ | ||
label: "Documentation", | ||
type: "docsVersion", | ||
}, | ||
{ | ||
type: "docsVersionDropdown", | ||
position: "right", | ||
|
||
// Add additional dropdown items at the beginning/end of the dropdown. | ||
dropdownItemsBefore: [], | ||
dropdownItemsAfter: [], | ||
|
||
// Do not add the link active class when browsing docs. | ||
dropdownActiveClassDisabled: true, | ||
}, | ||
// { to: "docs/api", label: "API", position: "right" }, | ||
{ to: "blog", label: "Updates", position: "right" }, | ||
{ | ||
href: "https://github.com/roblox-aurora/rbx-net", | ||
label: "GitHub", | ||
position: "right", | ||
}, | ||
], | ||
}, | ||
footer: { | ||
style: "dark", | ||
links: [ | ||
// { | ||
// title: 'Docs', | ||
// items: [ | ||
// { | ||
// label: 'Style Guide', | ||
// to: 'docs/', | ||
// }, | ||
// { | ||
// label: 'Second Doc', | ||
// to: 'docs/doc2/', | ||
// }, | ||
// ], | ||
// }, | ||
// { | ||
// title: 'Community', | ||
// items: [ | ||
// { | ||
// label: 'Discord', | ||
// href: 'https://discordapp.com/invite/docusaurus', | ||
// }, | ||
// ], | ||
// }, | ||
// { | ||
// title: 'More', | ||
// items: [ | ||
// { | ||
// label: 'Blog', | ||
// to: 'blog', | ||
// }, | ||
// { | ||
// label: 'GitHub', | ||
// href: 'https://github.com/roblox-aurora/rbx-net', | ||
// }, | ||
// ], | ||
// }, | ||
], | ||
copyright: `Copyright © ${new Date().getFullYear()} Jonathan Holmes`, | ||
}, | ||
}, | ||
presets: [ | ||
[ | ||
"@docusaurus/preset-classic", | ||
{ | ||
docs: { | ||
sidebarPath: require.resolve("./sidebars.json"), | ||
lastVersion: "current", | ||
versions: { | ||
current: { | ||
label: require("../package.json").version, | ||
path: "2.0" | ||
}, | ||
"1.3.0": { | ||
label: "1.3.0-beta.6.2", | ||
path: "1.3.x", | ||
}, | ||
}, | ||
// Please change this to your repo. | ||
editUrl: "https://github.com/roblox-aurora/rbx-net/edit/main/docs/", | ||
}, | ||
blog: { | ||
showReadingTime: true, | ||
// Please change this to your repo. | ||
editUrl: | ||
"https://github.com/roblox-aurora/rbx-net/edit/main/docs/blog/", | ||
}, | ||
theme: { | ||
customCss: require.resolve("./src/css/custom.css"), | ||
}, | ||
}, | ||
], | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.