Skip to content

Commit 97f17f6

Browse files
merging all conflicts
2 parents 9589057 + 9aa84b1 commit 97f17f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+672
-870
lines changed

.env.development

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
SANDPACK_BARE_COMPONENTS=true

.env.production

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
NEXT_PUBLIC_GA_TRACKING_ID = 'UA-41298772-4'
2-
SANDPACK_BARE_COMPONENTS=true
1+
NEXT_PUBLIC_GA_TRACKING_ID = 'UA-41298772-4'

next.config.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ const nextConfig = {
1414
scrollRestoration: true,
1515
legacyBrowsers: false,
1616
},
17-
env: {
18-
SANDPACK_BARE_COMPONENTS: process.env.SANDPACK_BARE_COMPONENTS,
19-
},
17+
env: {},
2018
webpack: (config, {dev, isServer, ...options}) => {
2119
if (process.env.ANALYZE) {
2220
const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer');
@@ -35,10 +33,6 @@ const nextConfig = {
3533

3634
const {IgnorePlugin, NormalModuleReplacementPlugin} = require('webpack');
3735
config.plugins.push(
38-
new NormalModuleReplacementPlugin(
39-
/^@stitches\/core$/,
40-
require.resolve('./src/utils/emptyShim.js')
41-
),
4236
new NormalModuleReplacementPlugin(
4337
/^raf$/,
4438
require.resolve('./src/utils/rafShim.js')

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"check-all": "npm-run-all prettier lint:fix tsc"
2323
},
2424
"dependencies": {
25-
"@codesandbox/sandpack-react": "1.15.5",
25+
"@codesandbox/sandpack-react": "2.6.0",
2626
"@docsearch/css": "3.0.0-alpha.41",
2727
"@docsearch/react": "3.0.0-alpha.41",
2828
"@headlessui/react": "^1.7.0",

patches/@codemirror+lang-javascript+0.19.6.patch

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

patches/@codesandbox+sandpack-react+1.15.5.patch

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

patches/@lezer+javascript+0.15.2.patch

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

public/images/team/dave-mccabe.jpg

-203 KB
Binary file not shown.

public/images/team/lunaruan.jpg

-150 KB
Binary file not shown.

public/images/team/mengdi-chen.jpg

-106 KB
Binary file not shown.

public/images/team/sean-keegan.jpg

-199 KB
Binary file not shown.

src/components/Layout/HomeContent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,8 +1654,8 @@ function LikeButton({video}) {
16541654
<button
16551655
data-hover="LikeButton"
16561656
className={cn(
1657-
'outline-none focus:bg-red-50/5 focus:text-red-50 relative flex items-center justify-center w-10 h-10 cursor-pointer rounded-full text-tertiary hover:bg-card active:scale-95 active:bg-red-50/5 active:text-red-50',
1658-
isLiked && 'text-red-50'
1657+
'outline-none focus:bg-red-50/5 focus:text-red-50 relative flex items-center justify-center w-10 h-10 cursor-pointer rounded-full hover:bg-card active:scale-95 active:bg-red-50/5 active:text-red-50',
1658+
isLiked ? 'text-red-50' : 'text-tertiary'
16591659
)}
16601660
aria-label={isLiked ? 'Unsave' : 'Save'}
16611661
onClick={() => {

src/components/Layout/Toc.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ export function Toc({headings}: {headings: Toc}) {
2727
<ul className="space-y-2 pb-16">
2828
{headings.length > 0 &&
2929
headings.map((h, i) => {
30-
if (h.url == null) {
31-
// TODO: only log in DEV
30+
if (!h.url && process.env.NODE_ENV === 'development') {
3231
console.error('Heading does not have URL');
3332
}
3433
return (

src/components/MDX/CodeBlock/CodeBlock.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
*/
44

55
import cn from 'classnames';
6-
import {highlightTree, HighlightStyle, tags} from '@codemirror/highlight';
6+
import {HighlightStyle} from '@codemirror/language';
7+
import {highlightTree} from '@lezer/highlight';
78
import {javascript} from '@codemirror/lang-javascript';
89
import {html} from '@codemirror/lang-html';
910
import {css} from '@codemirror/lang-css';
1011
import rangeParser from 'parse-numeric-range';
12+
import {tags} from '@lezer/highlight';
13+
1114
import {CustomTheme} from '../Sandpack/Themes';
1215

1316
interface InlineHighlight {
@@ -52,7 +55,7 @@ const CodeBlock = function CodeBlock({
5255
let tokenStarts = new Map();
5356
let tokenEnds = new Map();
5457
const highlightTheme = getSyntaxHighlight(CustomTheme);
55-
highlightTree(tree, highlightTheme.match, (from, to, className) => {
58+
highlightTree(tree, highlightTheme, (from, to, className) => {
5659
tokenStarts.set(from, className);
5760
tokenEnds.set(to, className);
5861
});

src/components/MDX/Sandpack/Console.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import cn from 'classnames';
55
import {useState, useRef, useEffect} from 'react';
66
import {IconChevron} from 'components/Icon/IconChevron';
77

8-
import {SandpackCodeViewer, useSandpack} from '@codesandbox/sandpack-react';
8+
import {
9+
SandpackCodeViewer,
10+
useSandpack,
11+
} from '@codesandbox/sandpack-react/unstyled';
912
import type {SandpackMessageConsoleMethods} from '@codesandbox/sandpack-client';
1013

1114
const getType = (

src/components/MDX/Sandpack/CustomPreset.tsx

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ import {
77
useSandpack,
88
useActiveCode,
99
SandpackCodeEditor,
10-
// SandpackReactDevTools,
1110
SandpackLayout,
12-
} from '@codesandbox/sandpack-react';
11+
} from '@codesandbox/sandpack-react/unstyled';
1312
import cn from 'classnames';
1413

1514
import {IconChevron} from 'components/Icon/IconChevron';
@@ -19,14 +18,8 @@ import {Preview} from './Preview';
1918
import {useSandpackLint} from './useSandpackLint';
2019

2120
export const CustomPreset = memo(function CustomPreset({
22-
showDevTools,
23-
onDevToolsLoad,
24-
devToolsLoaded,
2521
providedFiles,
2622
}: {
27-
showDevTools: boolean;
28-
devToolsLoaded: boolean;
29-
onDevToolsLoad: () => void;
3023
providedFiles: Array<string>;
3124
}) {
3225
const {lintErrors, lintExtensions} = useSandpackLint();
@@ -41,9 +34,6 @@ export const CustomPreset = memo(function CustomPreset({
4134
const isExpandable = lineCount > 16;
4235
return (
4336
<SandboxShell
44-
showDevTools={showDevTools}
45-
onDevToolsLoad={onDevToolsLoad}
46-
devToolsLoaded={devToolsLoaded}
4737
providedFiles={providedFiles}
4838
lintErrors={lintErrors}
4939
lintExtensions={lintExtensions}
@@ -53,16 +43,11 @@ export const CustomPreset = memo(function CustomPreset({
5343
});
5444

5545
const SandboxShell = memo(function SandboxShell({
56-
showDevTools,
57-
devToolsLoaded,
5846
providedFiles,
5947
lintErrors,
6048
lintExtensions,
6149
isExpandable,
6250
}: {
63-
showDevTools: boolean;
64-
devToolsLoaded: boolean;
65-
onDevToolsLoad: () => void;
6651
providedFiles: Array<string>;
6752
lintErrors: Array<any>;
6853
lintExtensions: Array<any>;
@@ -81,7 +66,6 @@ const SandboxShell = memo(function SandboxShell({
8166
<NavigationBar providedFiles={providedFiles} />
8267
<SandpackLayout
8368
className={cn(
84-
showDevTools && devToolsLoaded && 'sp-layout-devtools',
8569
!(isExpandable || isExpanded) && 'rounded-b-lg overflow-hidden',
8670
isExpanded && 'sp-layout-expanded'
8771
)}>
@@ -123,11 +107,6 @@ const SandboxShell = memo(function SandboxShell({
123107
</button>
124108
)}
125109
</SandpackLayout>
126-
127-
{/* {showDevTools && (
128-
// @ts-ignore TODO(@danilowoz): support devtools
129-
<SandpackReactDevTools onLoadModule={onDevToolsLoad} />
130-
)} */}
131110
</div>
132111
</>
133112
);

src/components/MDX/Sandpack/DownloadButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
import {useSyncExternalStore} from 'react';
6-
import {useSandpack} from '@codesandbox/sandpack-react';
6+
import {useSandpack} from '@codesandbox/sandpack-react/unstyled';
77
import {IconDownload} from '../../Icon/IconDownload';
88
export interface DownloadButtonProps {}
99

src/components/MDX/Sandpack/LoadingOverlay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
LoadingOverlayState,
55
OpenInCodeSandboxButton,
66
useSandpack,
7-
} from '@codesandbox/sandpack-react';
7+
} from '@codesandbox/sandpack-react/unstyled';
88
import {useEffect} from 'react';
99

1010
const FADE_ANIMATION_DURATION = 200;

src/components/MDX/Sandpack/NavigationBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
FileTabs,
1616
useSandpack,
1717
useSandpackNavigation,
18-
} from '@codesandbox/sandpack-react';
18+
} from '@codesandbox/sandpack-react/unstyled';
1919
import {OpenInCodeSandboxButton} from './OpenInCodeSandboxButton';
2020
import {ResetButton} from './ResetButton';
2121
import {DownloadButton} from './DownloadButton';

src/components/MDX/Sandpack/OpenInCodeSandboxButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) Facebook, Inc. and its affiliates.
33
*/
44

5-
import {UnstyledOpenInCodeSandboxButton} from '@codesandbox/sandpack-react';
5+
import {UnstyledOpenInCodeSandboxButton} from '@codesandbox/sandpack-react/unstyled';
66
import {IconNewPage} from '../../Icon/IconNewPage';
77

88
export const OpenInCodeSandboxButton = () => {

src/components/MDX/Sandpack/Preview.tsx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/* eslint-disable react-hooks/exhaustive-deps */
66
import {useRef, useState, useEffect, useMemo, useId} from 'react';
7-
import {useSandpack, SandpackStack} from '@codesandbox/sandpack-react';
7+
import {useSandpack, SandpackStack} from '@codesandbox/sandpack-react/unstyled';
88
import cn from 'classnames';
99
import {ErrorMessage} from './ErrorMessage';
1010
import {SandpackConsole} from './Console';
@@ -42,14 +42,7 @@ export function Preview({
4242
null
4343
);
4444

45-
let {
46-
error: rawError,
47-
registerBundler,
48-
unregisterBundler,
49-
errorScreenRegisteredRef,
50-
openInCSBRegisteredRef,
51-
loadingScreenRegisteredRef,
52-
} = sandpack;
45+
let {error: rawError, registerBundler, unregisterBundler} = sandpack;
5346

5447
if (
5548
rawError &&
@@ -88,12 +81,6 @@ export function Preview({
8881
const clientId = useId();
8982
const iframeRef = useRef<HTMLIFrameElement | null>(null);
9083

91-
// SandpackPreview immediately registers the custom screens/components so the bundler does not render any of them
92-
// TODO: why are we doing this during render?
93-
openInCSBRegisteredRef.current = true;
94-
errorScreenRegisteredRef.current = true;
95-
loadingScreenRegisteredRef.current = true;
96-
9784
const sandpackIdle = sandpack.status === 'idle';
9885

9986
useEffect(function createBundler() {

src/components/MDX/Sandpack/SandpackRoot.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* Copyright (c) Facebook, Inc. and its affiliates.
33
*/
44

5-
import {Children, useState} from 'react';
5+
import {Children} from 'react';
66
import * as React from 'react';
7-
import {SandpackProvider} from '@codesandbox/sandpack-react';
7+
import {SandpackProvider} from '@codesandbox/sandpack-react/unstyled';
88
import {SandpackLogLevel} from '@codesandbox/sandpack-client';
99
import {CustomPreset} from './CustomPreset';
1010
import {createFileMap} from './createFileMap';
@@ -13,7 +13,6 @@ import {CustomTheme} from './Themes';
1313
type SandpackProps = {
1414
children: React.ReactNode;
1515
autorun?: boolean;
16-
showDevTools?: boolean;
1716
};
1817

1918
const sandboxStyle = `
@@ -67,8 +66,7 @@ ul {
6766
`.trim();
6867

6968
function SandpackRoot(props: SandpackProps) {
70-
let {children, autorun = true, showDevTools = false} = props;
71-
const [devToolsLoaded, setDevToolsLoaded] = useState(false);
69+
let {children, autorun = true} = props;
7270
const codeSnippets = Children.toArray(children) as React.ReactElement[];
7371
const files = createFileMap(codeSnippets);
7472

@@ -90,12 +88,7 @@ function SandpackRoot(props: SandpackProps) {
9088
bundlerURL: 'https://1e4ad8f7.sandpack-bundler-4bw.pages.dev',
9189
logLevel: SandpackLogLevel.None,
9290
}}>
93-
<CustomPreset
94-
showDevTools={showDevTools}
95-
onDevToolsLoad={() => setDevToolsLoaded(true)}
96-
devToolsLoaded={devToolsLoaded}
97-
providedFiles={Object.keys(files)}
98-
/>
91+
<CustomPreset providedFiles={Object.keys(files)} />
9992
</SandpackProvider>
10093
</div>
10194
);

src/components/MDX/Sandpack/createFileMap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) Facebook, Inc. and its affiliates.
33
*/
44

5-
import type {SandpackFile} from '@codesandbox/sandpack-react';
5+
import type {SandpackFile} from '@codesandbox/sandpack-react/unstyled';
66

77
export const createFileMap = (codeSnippets: any) => {
88
return codeSnippets.reduce(

src/components/Seo.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,12 @@ const deployedTranslations = [
2121
'en',
2222
'zh-hans',
2323
'es',
24+
'fr',
2425
// We'll add more languages when they have enough content.
2526
// Please DO NOT edit this list without a discussion in the reactjs/react.dev repo.
2627
// It must be the same between all translations.
2728
];
2829

29-
let shouldPreventIndexing = false;
30-
if (
31-
siteConfig.languageCode !== 'en' &&
32-
!deployedTranslations.includes(siteConfig.languageCode)
33-
) {
34-
shouldPreventIndexing = true;
35-
}
36-
3730
function getDomain(languageCode: string): string {
3831
const subdomain = languageCode === 'en' ? '' : languageCode + '.';
3932
return subdomain + 'react.dev';
@@ -69,7 +62,6 @@ export const Seo = withRouter(
6962
href={canonicalUrl.replace(siteDomain, getDomain('en'))}
7063
hrefLang="x-default"
7164
/>
72-
{shouldPreventIndexing && <meta name="robots" content="noindex" />}
7365
{deployedTranslations.map((languageCode) => (
7466
<link
7567
key={'alt-' + languageCode}

src/content/blog/2022/06/15/react-labs-what-we-have-been-working-on-june-2022.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ June 15, 2022 by [Andrew Clark](https://twitter.com/acdlite), [Dan Abramov](http
88

99
<Intro>
1010

11-
[React 18](https://reactjs.org/blog/2022/03/29/react-v18) was years in the making, and with it brought valuable lessons for the React team. Its release was the result of many years of research and exploring many paths. Some of those paths were successful; many more were dead-ends that led to new insights. One lesson we’ve learned is that it’s frustrating for the community to wait for new features without having insight into these paths that we’re exploring.
11+
[React 18](https://react.dev/blog/2022/03/29/react-v18) was years in the making, and with it brought valuable lessons for the React team. Its release was the result of many years of research and exploring many paths. Some of those paths were successful; many more were dead-ends that led to new insights. One lesson we’ve learned is that it’s frustrating for the community to wait for new features without having insight into these paths that we’re exploring.
1212

1313
</Intro>
1414

src/content/community/acknowledgements.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ We'd like to recognize a few people who have made significant contributions to R
2424
* [Christoph Nakazawa](https://github.com/cpojer)
2525
* [Christopher Chedeau](https://github.com/vjeux)
2626
* [Clement Hoang](https://github.com/clemmy)
27+
* [Dave McCabe](https://github.com/davidmccabe)
2728
* [Dominic Gannaway](https://github.com/trueadm)
2829
* [Flarnie Marchan](https://github.com/flarnie)
2930
* [Jason Quense](https://github.com/jquense)
@@ -33,8 +34,10 @@ We'd like to recognize a few people who have made significant contributions to R
3334
* [Josh Duck](https://github.com/joshduck)
3435
* [Joe Critchley](https://github.com/joecritch)
3536
* [Jeff Morrison](https://github.com/jeffmo)
37+
* [Luna Ruan](https://github.com/lunaruan)
3638
* [Keyan Zhang](https://github.com/keyz)
3739
* [Marco Salazar](https://github.com/salazarm)
40+
* [Mengdi Chen](https://github.com/mondaychen)
3841
* [Nat Alison](https://github.com/tesseralis)
3942
* [Nathan Hunzaker](https://github.com/nhunzaker)
4043
* [Nicolas Gallagher](https://github.com/necolas)
@@ -45,7 +48,7 @@ We'd like to recognize a few people who have made significant contributions to R
4548
* [Robert Zhang](https://github.com/robertzhidealx)
4649
* [Sander Spies](https://github.com/sanderspies)
4750
* [Sasha Aickin](https://github.com/aickin)
48-
* [Seth Webster](https://github.com/sethwebster)
51+
* [Sean Keegan](https://github.com/seanryankeegan)
4952
* [Sophia Shoemaker](https://github.com/mrscobbler)
5053
* [Sunil Pai](https://github.com/threepointone)
5154
* [Tim Yung](https://github.com/yungsters)

0 commit comments

Comments
 (0)