Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 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
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
4 changes: 1 addition & 3 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ const nextConfig = {
pageExtensions: ['jsx', 'js', 'ts', 'tsx', 'mdx', 'md'],
reactStrictMode: true,
experimental: {
// TODO: Remove after https://github.com/vercel/next.js/issues/49355 is fixed
appDir: false,
scrollRestoration: true,
legacyBrowsers: false,
reactCompiler: true,
},
env: {},
webpack: (config, {dev, isServer, ...options}) => {
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"ci-check": "npm-run-all prettier:diff --parallel lint tsc lint-heading-ids rss",
"tsc": "tsc --noEmit",
"start": "next start",
"postinstall": "patch-package && (is-ci || husky install .husky)",
"postinstall": "is-ci || husky install .husky",
"check-all": "npm-run-all prettier lint:fix tsc rss",
"rss": "node scripts/generateRss.js"
},
Expand All @@ -28,17 +28,18 @@
"@docsearch/react": "^3.6.1",
"@headlessui/react": "^1.7.0",
"@radix-ui/react-context-menu": "^2.1.5",
"babel-plugin-react-compiler": "0.0.0-experimental-696af53-20240625",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattcarrollcode this is a super old version of the compiler, I'd suggest using one of the beta releases

Copy link
Member

@poteto poteto Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"body-scroll-lock": "^3.1.3",
"classnames": "^2.2.6",
"date-fns": "^2.16.1",
"debounce": "^1.2.1",
"github-slugger": "^1.3.0",
"next": "^13.4.1",
"next": "15.1.0",
"next-remote-watch": "^1.0.0",
"parse-numeric-range": "^1.2.0",
"react": "^0.0.0-experimental-16d053d59-20230506",
"react": "^19.0.0",
"react-collapsed": "4.0.4",
"react-dom": "^0.0.0-experimental-16d053d59-20230506",
"react-dom": "^19.0.0",
"remark-frontmatter": "^4.0.1",
"remark-gfm": "^3.0.1"
},
Expand Down Expand Up @@ -78,7 +79,6 @@
"mdast-util-to-string": "^1.1.0",
"metro-cache": "0.72.2",
"npm-run-all": "^4.1.5",
"patch-package": "^6.2.2",
"postcss": "^8.4.5",
"postcss-flexbugs-fixes": "4.2.1",
"postcss-preset-env": "^6.7.0",
Expand All @@ -94,7 +94,7 @@
"retext-smartypants": "^4.0.0",
"rss": "^1.2.2",
"tailwindcss": "^3.4.1",
"typescript": "^4.0.2",
"typescript": "^5.7.2",
"unist-util-visit": "^2.0.3",
"webpack-bundle-analyzer": "^4.5.0"
},
Expand Down
22 changes: 0 additions & 22 deletions patches/next+13.4.1.patch

This file was deleted.

16 changes: 0 additions & 16 deletions patches/next-remote-watch+1.0.0.patch

This file was deleted.

4 changes: 4 additions & 0 deletions src/components/Layout/HomeContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,7 @@ function Example1() {
isFromPackageImport={false}
noShadow={true}
noMargin={true}>
{/* eslint-disable-next-line react/no-unknown-property */}
<div meta={meta}>{`function Video({ video }) {
return (
<div>
Expand Down Expand Up @@ -987,6 +988,7 @@ function Example2() {
isFromPackageImport={false}
noShadow={true}
noMargin={true}>
{/* eslint-disable-next-line react/no-unknown-property */}
<div meta={meta}>{`function VideoList({ videos, emptyHeading }) {
const count = videos.length;
let heading = emptyHeading;
Expand Down Expand Up @@ -1078,6 +1080,7 @@ function Example3() {
isFromPackageImport={false}
noShadow={true}
noMargin={true}>
{/* eslint-disable-next-line react/no-unknown-property */}
<div meta={meta}>{`import { useState } from 'react';

function SearchableVideoList({ videos }) {
Expand Down Expand Up @@ -1149,6 +1152,7 @@ function Example4() {
isFromPackageImport={false}
noShadow={true}
noMargin={true}>
{/* eslint-disable-next-line react/no-unknown-property */}
<div meta={meta}>{`import { db } from './database.js';
import { Suspense } from 'react';

Expand Down
1 change: 1 addition & 0 deletions src/components/MDX/CodeDiagram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export function CodeDiagram({children, flip = false}: CodeDiagramProps) {
});
const content = Children.toArray(children).map((child: any) => {
if (child.type?.mdxName === 'pre') {
// eslint-disable-next-line react/jsx-key
return <CodeBlock {...child.props} noMargin={true} noMarkers={true} />;
} else if (child.type === 'img') {
return null;
Expand Down
1 change: 1 addition & 0 deletions src/components/MDX/TeamMember.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export function TeamMember({
}: TeamMemberProps) {
if (name == null || title == null || permalink == null || children == null) {
throw new Error(
// @ts-ignore
'Expected name, title, permalink, and children for ' + name ??
title ??
permalink ??
Expand Down
1 change: 1 addition & 0 deletions src/components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export function Search({
}: SearchProps) {
useDocSearchKeyboardEvents({isOpen, onOpen, onClose});
return (
// @ts-ignore
<>
<Head>
<link
Expand Down
30 changes: 13 additions & 17 deletions src/pages/[[...markdownPath]].js
Original file line number Diff line number Diff line change
Expand Up @@ -71,31 +71,27 @@ function useActiveSection() {
}

// Deserialize a client React tree from JSON.
function reviveNodeOnClient(key, val) {
function reviveNodeOnClient(parentPropertyName, val) {
if (Array.isArray(val) && val[0] == '$r') {
// Assume it's a React element.
let type = val[1];
let Type = val[1];
let key = val[2];
if (key == null) {
key = parentPropertyName; // Index within a parent.
}
let props = val[3];
if (type === 'wrapper') {
type = Fragment;
if (Type === 'wrapper') {
Type = Fragment;
props = {children: props.children};
}
if (MDXComponents[type]) {
type = MDXComponents[type];
if (Type in MDXComponents) {
Type = MDXComponents[Type];
}
if (!type) {
console.error('Unknown type: ' + type);
type = Fragment;
if (!Type) {
console.error('Unknown type: ' + Type);
Type = Fragment;
}
return {
$$typeof: Symbol.for('react.element'),
type: type,
key: key,
ref: null,
props: props,
_owner: null,
};
return <Type key={key} {...props} />;
} else {
return val;
}
Expand Down
30 changes: 13 additions & 17 deletions src/pages/errors/[errorCode].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,31 +53,27 @@ export default function ErrorDecoderPage({
}

// Deserialize a client React tree from JSON.
function reviveNodeOnClient(key: unknown, val: any) {
function reviveNodeOnClient(parentPropertyName: unknown, val: any) {
if (Array.isArray(val) && val[0] == '$r') {
// Assume it's a React element.
let type = val[1];
let Type = val[1];
let key = val[2];
if (key == null) {
key = parentPropertyName; // Index within a parent.
}
let props = val[3];
if (type === 'wrapper') {
type = Fragment;
if (Type === 'wrapper') {
Type = Fragment;
props = {children: props.children};
}
if (type in MDXComponents) {
type = MDXComponents[type as keyof typeof MDXComponents];
if (Type in MDXComponents) {
Type = MDXComponents[Type as keyof typeof MDXComponents];
}
if (!type) {
console.error('Unknown type: ' + type);
type = Fragment;
if (!Type) {
console.error('Unknown type: ' + Type);
Type = Fragment;
}
return {
$$typeof: Symbol.for('react.element'),
type: type,
key: key,
ref: null,
props: props,
_owner: null,
};
return <Type key={key} {...props} />;
} else {
return val;
}
Expand Down
7 changes: 5 additions & 2 deletions src/utils/compileMDX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {MDXComponents} from 'components/MDX/MDXComponents';

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~ IMPORTANT: BUMP THIS IF YOU CHANGE ANY CODE BELOW ~~~
const DISK_CACHE_BREAKER = 9;
const DISK_CACHE_BREAKER = 10;
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

export default async function compileMDX(
Expand Down Expand Up @@ -144,7 +144,10 @@ export default async function compileMDX(

// Serialize a server React tree node to JSON.
function stringifyNodeOnServer(key: unknown, val: any) {
if (val != null && val.$$typeof === Symbol.for('react.element')) {
if (
val != null &&
val.$$typeof === Symbol.for('react.transitional.element')
) {
// Remove fake MDX props.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const {mdxType, originalType, parentName, ...cleanProps} = val.props;
Expand Down
Loading
Loading