Skip to content

Commit ec6daee

Browse files
committed
Updated to latest docusaurus 2.x version
Removed custom codeblock: docusaurus default codeblocks now offer almost the same functionality (except the open in playground button)
1 parent 4d56f67 commit ec6daee

File tree

8 files changed

+16380
-22767
lines changed

8 files changed

+16380
-22767
lines changed

docusaurus-plugin.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const resolve = (query) => path.resolve(__dirname, query);
1010
module.exports = () => ({
1111
configureWebpack: (config, isServer) => {
1212
return {
13-
node: { fs: "empty" },
1413
resolveLoader: {
1514
// Don't generate worker files in server build, because it overrides client files
1615
alias: isServer ? { "worker-loader": require.resolve("null-loader") } : {},

docusaurus.config.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,18 @@ module.exports = {
1313
items: [
1414
{ to: "docs/getting-started", label: "Docs", position: "left" },
1515
{ to: "play", label: "Playground", position: "left" },
16-
{ href: "https://discord.gg/BWAq58Y", label: "Discord", position: "right" },
17-
{ href: "https://github.com/TypeScriptToLua/TypeScriptToLua", label: "GitHub", position: "right" },
16+
{
17+
href: "https://discord.gg/BWAq58Y",
18+
className: "header-discord-link",
19+
"aria-label": "Discord Server",
20+
position: "right",
21+
},
22+
{
23+
href: "https://github.com/TypeScriptToLua/TypeScriptToLua",
24+
className: "header-github-link",
25+
"aria-label": "GitHub repository",
26+
position: "right",
27+
},
1828
],
1929
},
2030
footer: {

package-lock.json

Lines changed: 16307 additions & 22558 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"lua-types": "^2.10.1",
2626
"lz-string": "^1.4.4",
2727
"monaco-editor": "^0.21.2",
28+
"pako": "^2.0.3",
2829
"react": "^16.14.0",
2930
"react-dom": "^16.14.0",
3031
"react-json-tree": "^0.13.0",
@@ -33,9 +34,10 @@
3334
},
3435
"devDependencies": {
3536
"@ark120202/typescript-config": "^2.2.0",
36-
"@docusaurus/core": "^2.0.0-alpha.66",
37-
"@docusaurus/preset-classic": "^2.0.0-alpha.66",
37+
"@docusaurus/core": "^2.0.0-beta.0",
38+
"@docusaurus/preset-classic": "^2.0.0-beta.0",
3839
"@types/node": "^14.14.2",
40+
"@types/pako": "^1.0.1",
3941
"file-loader": "^6.1.1",
4042
"fork-ts-checker-webpack-plugin": "^5.2.0",
4143
"null-loader": "^4.0.1",

src/custom.scss

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
--ifm-code-font-size: 95%;
33
}
44

5-
.docusaurus-highlight-code-line {
6-
background-color: rgb(72, 77, 91);
7-
display: block;
8-
margin: 0 calc(-1 * var(--ifm-pre-padding));
9-
padding: 0 var(--ifm-pre-padding);
10-
}
11-
125
:root {
136
--monaco-background: #fffffe;
147
--monaco-accent: #c4c4c4;
@@ -18,3 +11,58 @@
1811
--monaco-background: #1e1e1e;
1912
--monaco-accent: #333333;
2013
}
14+
15+
.docusaurus-highlight-code-line {
16+
background-color: rgba(0, 0, 0, 0.1);
17+
display: block;
18+
margin: 0 calc(-1 * var(--ifm-pre-padding));
19+
padding: 0 var(--ifm-pre-padding);
20+
}
21+
22+
html[data-theme="dark"] .docusaurus-highlight-code-line {
23+
background-color: rgba(0, 0, 0, 0.3);
24+
}
25+
26+
.navbar__title {
27+
text-overflow: unset;
28+
}
29+
30+
.header-github-link:hover {
31+
opacity: 0.6;
32+
}
33+
34+
.header-github-link:before {
35+
content: "";
36+
width: 24px;
37+
height: 24px;
38+
display: flex;
39+
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")
40+
no-repeat;
41+
}
42+
43+
html[data-theme="dark"] .header-github-link:before {
44+
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")
45+
no-repeat;
46+
}
47+
48+
.header-discord-link:hover {
49+
opacity: 0.6;
50+
}
51+
52+
.header-discord-link:before {
53+
content: "";
54+
width: 28px;
55+
height: 28px;
56+
display: flex;
57+
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='black' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z'/%3E%3C/svg%3E")
58+
no-repeat;
59+
}
60+
61+
html[data-theme="dark"] .header-discord-link:before {
62+
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z'/%3E%3C/svg%3E")
63+
no-repeat;
64+
}
65+
66+
.react-toggle {
67+
margin: var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal);
68+
}

src/pages/benchviz/Benchmark.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as d3 from "d3";
22
import React, { useEffect, useRef } from "react";
3-
import * as zlib from "zlib";
3+
import pako from "pako";
44
import { BenchmarkResult, MemoryBenchmarkCategory } from "./benchmark-types";
55
import { joinOnProperty, JoinResult } from "./util";
66
import { barComparisonGraph } from "./visualizations/bar-comparison-graph";
@@ -117,7 +117,7 @@ export default function Benchmark() {
117117
}
118118

119119
function decodeBenchmarkData(encodedData: string) {
120-
const results = JSON.parse(zlib.inflateSync(Buffer.from(encodedData, "base64")).toString());
120+
const results = JSON.parse(pako.inflate(btoa(encodedData)).toString());
121121

122122
const dataMaster = results.old as BenchmarkResult[];
123123
const dataCommit = results.new as BenchmarkResult[];

src/theme/CodeBlock/index.js

Lines changed: 0 additions & 141 deletions
This file was deleted.

src/theme/CodeBlock/styles.module.scss

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)