Skip to content

Commit

Permalink
Bump to v2.0.0
Browse files Browse the repository at this point in the history
It's at a state where it's stable release now.
  • Loading branch information
Vorlias committed Mar 2, 2021
1 parent 98ba872 commit d230841
Show file tree
Hide file tree
Showing 7 changed files with 213 additions and 176 deletions.
2 changes: 1 addition & 1 deletion docs/docs/middleware/custom.md
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
---
6 changes: 6 additions & 0 deletions docs/docs/middleware/logger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: logging
title: Logging
sidebar_label: Logging
slug: /middleware/logging
---
33 changes: 31 additions & 2 deletions docs/docs/middleware/typecheck.md
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>
254 changes: 127 additions & 127 deletions docs/docusaurus.config.js
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"),
},
},
],
],
};
4 changes: 3 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"dependencies": {
"@docusaurus/core": "2.0.0-alpha.70",
"@docusaurus/preset-classic": "2.0.0-alpha.70",
"@mdi/js": "^5.9.55",
"@mdi/react": "^1.4.0",
"@mdx-js/react": "^1.6.21",
"clsx": "^1.1.1",
"react": "^16.8.4",
Expand All @@ -31,4 +33,4 @@
"last 1 safari version"
]
}
}
}
Loading

0 comments on commit d230841

Please sign in to comment.