Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
"express/path-to-regexp": "0.1.13",
"on-headers": "^1.1.0",
"tar-fs": "^3.1.1",
"js-yaml": "^3.14.2",
"brace-expansion": "^1.1.12",
"cross-spawn": "^7.0.5",
Comment thread
edwardalee marked this conversation as resolved.
"image-size": "^2.0.2",
Expand Down
8 changes: 6 additions & 2 deletions src/components/HomepageSlider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ export const CodeContainer = ({
className?: string;
}): JSX.Element => {
const [page, setPage] = useState(0);
const refs = [useRef(null), useRef(null), useRef(null)] as (React.LegacyRef<HTMLDivElement> | undefined)[];
const refs = [
useRef<HTMLDivElement>(null),
useRef<HTMLDivElement>(null),
useRef<HTMLDivElement>(null),
];

return (
<div className={clsx(className, styles.codeContainer)}>
Expand All @@ -64,7 +68,7 @@ export const CodeContainer = ({
key={page}
nodeRef={refs[page]}
addEndListener={(done) => {
refs[page]!.current.addEventListener("transitionend", done, false);
refs[page].current?.addEventListener("transitionend", done, false);
}}
Comment thread
edwardalee marked this conversation as resolved.
classNames={{
enter: styles.fadeEnter,
Expand Down
6 changes: 4 additions & 2 deletions src/remark/ReplaceTargetLanguagePlaceholder.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Plugin } from "unified";
import { visit } from "unist-util-visit";
import type { Parent } from "unist";
import type { Root, Text } from "mdast";

const PLACEHOLDER = "$target-language$";

Expand All @@ -16,7 +17,7 @@ const targetLanguageJsx = {
* Replaces legacy `$target-language$` placeholders (from the old handbook
* preprocessor) with an inline <TargetLanguage /> MDX element.
*/
export const replaceTargetLanguagePlaceholder: Plugin = () => {
export const replaceTargetLanguagePlaceholder: Plugin<[], Root> = () => {
return (tree) => {
visit(tree, "text", (node, index, parent) => {
if (
Expand All @@ -33,7 +34,8 @@ export const replaceTargetLanguagePlaceholder: Plugin = () => {
const newChildren: Parent["children"] = [];
parts.forEach((part, i) => {
if (part.length > 0) {
newChildren.push({ type: "text", value: part });
const text: Text = { type: "text", value: part };
newChildren.push(text);
}
if (i < parts.length - 1) {
newChildren.push({ ...targetLanguageJsx });
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
"module": "ESNext",
"strictNullChecks": true,
},
"exclude": ["**/src-gen/**"],
}
14 changes: 13 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3604,6 +3604,11 @@ argparse@^1.0.7:
dependencies:
sprintf-js "~1.0.2"

argparse@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==

array-flatten@1.1.1:
version "1.1.1"
resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz"
Expand Down Expand Up @@ -6263,14 +6268,21 @@ joi@^17.9.2:
resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==

js-yaml@^3.13.1, js-yaml@^3.14.2, js-yaml@^4.1.0:
js-yaml@^3.13.1:
version "3.14.2"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.2.tgz#77485ce1dd7f33c061fd1b16ecea23b55fcb04b0"
integrity sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==
dependencies:
argparse "^1.0.7"
esprima "^4.0.0"

js-yaml@^4.1.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.3.0.tgz#d1900572a7f7cf0b5f540c83673e60bad3436592"
integrity sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==
dependencies:
argparse "^2.0.1"

jsdoc-type-pratt-parser@^4.0.0:
version "4.1.0"
resolved "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.1.0.tgz"
Expand Down
Loading