Skip to content

Commit 94f4810

Browse files
author
Xleine
authored
Merge branch 'main' into use-layout-effect
2 parents fbc9852 + 6131899 commit 94f4810

File tree

102 files changed

+1673
-1741
lines changed

Some content is hidden

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

102 files changed

+1673
-1741
lines changed

.github/dependabot.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
# Disable Dependabot. Doing it here so it propagates to translation forks.
8+
open-pull-requests-limit: 0

.github/workflows/analyze.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Set up node
3131
uses: actions/setup-node@v1
3232
with:
33-
node-version: "14.x"
33+
node-version: '20.x'
3434

3535
- name: Install dependencies
3636
uses: bahmutov/npm-install@v1.7.10
@@ -52,7 +52,7 @@ jobs:
5252
# Here's the first place where next-bundle-analysis' own script is used
5353
# This step pulls the raw bundle stats for the current bundle
5454
- name: Analyze bundle
55-
run: npx -p nextjs-bundle-analysis report
55+
run: npx -p nextjs-bundle-analysis@0.5.0 report
5656

5757
- name: Upload bundle
5858
uses: actions/upload-artifact@v2

.github/workflows/analyze_comment.yml

+5-22
Original file line numberDiff line numberDiff line change
@@ -60,26 +60,9 @@ jobs:
6060
pr_number=$(cat pr_number/pr_number)
6161
echo "pr-number=$pr_number" >> $GITHUB_OUTPUT
6262
63-
- name: Find Comment
64-
uses: peter-evans/find-comment@v1
65-
if: success() && github.event.workflow_run.conclusion == 'success' && steps.get-type.outputs.event-type == 'pull_request'
66-
id: fc
67-
with:
68-
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
69-
body-includes: "<!-- __NEXTJS_BUNDLE -->"
70-
71-
- name: Create Comment
72-
uses: peter-evans/create-or-update-comment@v1.4.4
73-
if: success() && steps.fc.outputs.comment-id == 0 && github.event.workflow_run.conclusion == 'success' && steps.get-type.outputs.event-type == 'pull_request'
74-
with:
75-
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
76-
body: ${{ steps.get-comment-body.outputs.body }}
77-
78-
- name: Update Comment
79-
uses: peter-evans/create-or-update-comment@v1.4.4
80-
if: success() && steps.fc.outputs.comment-id != 0 && github.event.workflow_run.conclusion == 'success' && steps.get-type.outputs.event-type == 'pull_request'
63+
- name: Comment
64+
uses: marocchino/sticky-pull-request-comment@v2
8165
with:
82-
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
83-
body: ${{ steps.get-comment-body.outputs.body }}
84-
comment-id: ${{ steps.fc.outputs.comment-id }}
85-
edit-mode: replace
66+
header: next-bundle-analysis
67+
number: ${{ steps.get-comment-body.outputs.pr-number }}
68+
message: ${{ steps.get-comment-body.outputs.body }}

.github/workflows/site_lint.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ jobs:
1111
lint:
1212
runs-on: ubuntu-latest
1313

14-
name: Lint on node 12.x and ubuntu-latest
14+
name: Lint on node 20.x and ubuntu-latest
1515

1616
steps:
1717
- uses: actions/checkout@v1
18-
- name: Use Node.js 12.x
19-
uses: actions/setup-node@v1
18+
- name: Use Node.js 20.x
19+
uses: actions/setup-node@v3
2020
with:
21-
node-version: 12.x
21+
node-version: 20.x
2222

2323
- name: Install deps and build (with cache)
24-
uses: bahmutov/npm-install@v1.7.10
24+
uses: bahmutov/npm-install@v1.8.32
2525

2626
- name: Lint codebase
2727
run: yarn ci-check

next.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ const nextConfig = {
99
pageExtensions: ['jsx', 'js', 'ts', 'tsx', 'mdx', 'md'],
1010
reactStrictMode: true,
1111
experimental: {
12-
plugins: true,
12+
// TODO: Remove after https://github.com/vercel/next.js/issues/49355 is fixed
13+
appDir: false,
1314
scrollRestoration: true,
1415
legacyBrowsers: false,
15-
browsersListForSwc: true,
1616
},
1717
env: {
1818
SANDPACK_BARE_COMPONENTS: process.env.SANDPACK_BARE_COMPONENTS,

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
"debounce": "^1.2.1",
3333
"ga-lite": "^2.1.4",
3434
"github-slugger": "^1.3.0",
35-
"next": "12.3.2-canary.7",
35+
"next": "^13.4.1",
3636
"next-remote-watch": "^1.0.0",
3737
"parse-numeric-range": "^1.2.0",
38-
"react": "0.0.0-experimental-cb5084d1c-20220924",
38+
"react": "^0.0.0-experimental-16d053d59-20230506",
3939
"react-collapsed": "npm:@gaearon/react-collapsed@3.1.0-forked.1",
40-
"react-dom": "0.0.0-experimental-cb5084d1c-20220924",
40+
"react-dom": "^0.0.0-experimental-16d053d59-20230506",
4141
"remark-frontmatter": "^4.0.1",
4242
"remark-gfm": "^3.0.1"
4343
},
@@ -98,7 +98,7 @@
9898
"webpack-bundle-analyzer": "^4.5.0"
9999
},
100100
"engines": {
101-
"node": ">=12.x"
101+
"node": "^16.8.0 || ^18.0.0 || ^19.0.0 || ^20.0.0"
102102
},
103103
"nextBundleAnalysis": {
104104
"budget": null,

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

+38-2
Large diffs are not rendered by default.

patches/next+12.3.2-canary.7.patch

-22
This file was deleted.

patches/next+13.4.1.patch

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/node_modules/next/dist/server/render.js b/node_modules/next/dist/server/render.js
2+
index a1f8648..1b3d608 100644
3+
--- a/node_modules/next/dist/server/render.js
4+
+++ b/node_modules/next/dist/server/render.js
5+
@@ -758,9 +758,14 @@ async function renderToHTML(req, res, pathname, query, renderOpts) {
6+
// Always using react concurrent rendering mode with required react version 18.x
7+
const renderShell = async (EnhancedApp, EnhancedComponent)=>{
8+
const content = renderContent(EnhancedApp, EnhancedComponent);
9+
- return await (0, _nodewebstreamshelper.renderToInitialStream)({
10+
- ReactDOMServer: _serverbrowser.default,
11+
- element: content
12+
+ return new Promise((resolve, reject) => {
13+
+ (0, _nodewebstreamshelper.renderToInitialStream)({
14+
+ ReactDOMServer: _serverbrowser.default,
15+
+ element: content,
16+
+ streamOptions: {
17+
+ onError: reject
18+
+ }
19+
+ }).then(resolve, reject);
20+
});
21+
};
22+
const createBodyResult = (0, _tracer.getTracer)().wrap(_constants2.RenderSpan.createBodyResult, (initialStream, suffix)=>{
Loading
Loading

src/components/Breadcrumbs.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ function Breadcrumbs({breadcrumbs}: {breadcrumbs: RouteItem[]}) {
1515
!crumb.skipBreadcrumb && (
1616
<div className="flex mb-3 mt-0.5 items-center" key={i}>
1717
<Fragment key={crumb.path}>
18-
<Link href={crumb.path}>
19-
<a className="text-link dark:text-link-dark text-sm tracking-wide font-bold uppercase mr-1 hover:underline">
20-
{crumb.title}
21-
</a>
18+
<Link
19+
href={crumb.path}
20+
className="text-link dark:text-link-dark text-sm tracking-wide font-bold uppercase mr-1 hover:underline">
21+
{crumb.title}
2222
</Link>
2323
<span className="inline-block mr-1 text-link dark:text-link-dark text-lg">
2424
<svg

src/components/ButtonLink.tsx

+8-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function ButtonLink({
2121
label,
2222
target = '_self',
2323
...props
24-
}: JSX.IntrinsicElements['a'] & ButtonLinkProps) {
24+
}: React.AnchorHTMLAttributes<HTMLAnchorElement> & ButtonLinkProps) {
2525
const classes = cn(
2626
className,
2727
'active:scale-[.98] transition-transform inline-flex font-bold items-center outline-none focus:outline-none focus-visible:outline focus-visible:outline-link focus:outline-offset-2 focus-visible:dark:focus:outline-link-dark leading-snug',
@@ -34,10 +34,13 @@ function ButtonLink({
3434
}
3535
);
3636
return (
37-
<NextLink href={href as string}>
38-
<a className={classes} {...props} aria-label={label} target={target}>
39-
{children}
40-
</a>
37+
<NextLink
38+
href={href as string}
39+
className={classes}
40+
{...props}
41+
aria-label={label}
42+
target={target}>
43+
{children}
4144
</NextLink>
4245
);
4346
}

src/components/DocsFooter.tsx

+17-18
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,24 @@ function FooterLink({
6666
type: '上一页' | '下一页';
6767
}) {
6868
return (
69-
<NextLink href={href}>
70-
<a
71-
className={cn(
72-
'flex gap-x-4 md:gap-x-6 items-center w-full md:w-80 px-4 md:px-5 py-6 border-2 border-transparent text-base leading-base text-link dark:text-link-dark rounded-lg group focus:text-link dark:focus:text-link-dark focus:bg-highlight focus:border-link dark:focus:bg-highlight-dark dark:focus:border-link-dark focus:border-opacity-100 focus:border-2 focus:ring-1 focus:ring-offset-4 focus:ring-blue-40 active:ring-0 active:ring-offset-0 hover:bg-gray-5 dark:hover:bg-gray-80',
73-
{
74-
'flex-row-reverse justify-self-end text-right': type === '下一页',
75-
}
76-
)}>
77-
<IconNavArrow
78-
className="text-tertiary dark:text-tertiary-dark inline group-focus:text-link dark:group-focus:text-link-dark"
79-
displayDirection={type === '上一页' ? 'left' : 'right'}
80-
/>
81-
<span>
82-
<span className="block no-underline text-sm tracking-wide text-secondary dark:text-secondary-dark uppercase font-bold group-focus:text-link dark:group-focus:text-link-dark group-focus:text-opacity-100">
83-
{type}
84-
</span>
85-
<span className="block text-lg group-hover:underline">{title}</span>
69+
<NextLink
70+
href={href}
71+
className={cn(
72+
'flex gap-x-4 md:gap-x-6 items-center w-full md:w-80 px-4 md:px-5 py-6 border-2 border-transparent text-base leading-base text-link dark:text-link-dark rounded-lg group focus:text-link dark:focus:text-link-dark focus:bg-highlight focus:border-link dark:focus:bg-highlight-dark dark:focus:border-link-dark focus:border-opacity-100 focus:border-2 focus:ring-1 focus:ring-offset-4 focus:ring-blue-40 active:ring-0 active:ring-offset-0 hover:bg-gray-5 dark:hover:bg-gray-80',
73+
{
74+
'flex-row-reverse justify-self-end text-right': type === '下一页',
75+
}
76+
)}>
77+
<IconNavArrow
78+
className="text-tertiary dark:text-tertiary-dark inline group-focus:text-link dark:group-focus:text-link-dark"
79+
displayDirection={type === '上一页' ? 'left' : 'right'}
80+
/>
81+
<span>
82+
<span className="block no-underline text-sm tracking-wide text-secondary dark:text-secondary-dark uppercase font-bold group-focus:text-link dark:group-focus:text-link-dark group-focus:text-opacity-100">
83+
{type}
8684
</span>
87-
</a>
85+
<span className="block text-lg group-hover:underline">{title}</span>
86+
</span>
8887
</NextLink>
8988
);
9089
}

src/components/Layout/Feedback.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function SendFeedback({onSubmit}: {onSubmit: () => void}) {
6363
return (
6464
<div className="max-w-xs w-80 lg:w-auto py-3 shadow-lg rounded-lg m-4 bg-wash dark:bg-gray-95 px-4 flex">
6565
<p className="w-full font-bold text-primary dark:text-primary-dark text-lg mr-4">
66-
{isSubmitted ? 'Thank you for your feedback!' : 'Is this page useful?'}
66+
{isSubmitted ? '谢谢你的反馈意见!' : '这个页面有用吗?'}
6767
</p>
6868
{!isSubmitted && (
6969
<button

src/components/Layout/Footer.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@ function FooterLink({
382382

383383
return (
384384
<div>
385-
<NextLink href={href}>
386-
<a className={classes}>{children}</a>
385+
<NextLink href={href} className={classes}>
386+
{children}
387387
</NextLink>
388388
</div>
389389
);

src/components/Layout/HomeContent.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -1167,21 +1167,22 @@ async function Talks({ confId }) {
11671167

11681168
function useNestedScrollLock(ref) {
11691169
useEffect(() => {
1170+
let node = ref.current;
11701171
let isLocked = false;
11711172
let lastScroll = performance.now();
11721173

11731174
function handleScroll() {
11741175
if (!isLocked) {
11751176
isLocked = true;
1176-
ref.current.style.pointerEvents = 'none';
1177+
node.style.pointerEvents = 'none';
11771178
}
11781179
lastScroll = performance.now();
11791180
}
11801181

11811182
function updateLock() {
11821183
if (isLocked && performance.now() - lastScroll > 150) {
11831184
isLocked = false;
1184-
ref.current.style.pointerEvents = '';
1185+
node.style.pointerEvents = '';
11851186
}
11861187
}
11871188

@@ -1255,7 +1256,7 @@ function BrowserChrome({children, hasPulse, hasRefresh, domain, path}) {
12551256
<div className="mx-auto max-w-3xl shadow-nav dark:shadow-nav-dark relative overflow-hidden w-full dark:border-opacity-10 rounded-2xl">
12561257
<div className="w-full h-14 rounded-t-2xl shadow-outer-border backdrop-filter overflow-hidden backdrop-blur-lg backdrop-saturate-200 bg-white bg-opacity-90 z-10 absolute top-0 px-3 gap-2 flex flex-row items-center">
12571258
<div className="select-none h-8 relative bg-gray-30/20 text-sm text-tertiary text-center rounded-full w-full flex-row flex space-between items-center">
1258-
<div className="h-4 w-6" />
1259+
{hasRefresh && <div className="h-4 w-6" />}
12591260
<div className="w-full leading-snug flex flex-row items-center justify-center">
12601261
<svg
12611262
className="text-tertiary mr-1 opacity-60"
@@ -1444,7 +1445,10 @@ function VideoList({videos, emptyHeading}) {
14441445
function SearchInput({value, onChange}) {
14451446
const id = useId();
14461447
return (
1447-
<form className="mb-3 py-1" data-hover="SearchInput">
1448+
<form
1449+
className="mb-3 py-1"
1450+
data-hover="SearchInput"
1451+
onSubmit={(e) => e.preventDefault()}>
14481452
<label htmlFor={id} className="sr-only">
14491453
Search
14501454
</label>

0 commit comments

Comments
 (0)