Skip to content

Commit

Permalink
Merge remote-tracking branch 'reactdev/main' into merge-react-dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	.eslintignore
#	README.md
#	content/docs/accessibility.md
#	content/docs/add-react-to-a-website.md
#	content/docs/addons-shallow-renderer.md
#	content/docs/addons-test-utils.md
#	content/docs/cdn-links.md
#	content/docs/code-splitting.md
#	content/docs/codebase-overview.md
#	content/docs/components-and-props.md
#	content/docs/composition-vs-inheritance.md
#	content/docs/concurrent-mode-adoption.md
#	content/docs/concurrent-mode-intro.md
#	content/docs/concurrent-mode-reference.md
#	content/docs/concurrent-mode-suspense.md
#	content/docs/conditional-rendering.md
#	content/docs/context.md
#	content/docs/create-a-new-react-app.md
#	content/docs/error-boundaries.md
#	content/docs/faq-ajax.md
#	content/docs/faq-build.md
#	content/docs/faq-functions.md
#	content/docs/faq-internals.md
#	content/docs/faq-state.md
#	content/docs/faq-structure.md
#	content/docs/faq-styling.md
#	content/docs/faq-versioning.md
#	content/docs/forms.md
#	content/docs/forwarding-refs.md
#	content/docs/fragments.md
#	content/docs/getting-started.md
#	content/docs/handling-events.md
#	content/docs/hello-world.md
#	content/docs/higher-order-components.md
#	content/docs/hooks-custom.md
#	content/docs/hooks-effect.md
#	content/docs/hooks-faq.md
#	content/docs/hooks-intro.md
#	content/docs/hooks-overview.md
#	content/docs/hooks-reference.md
#	content/docs/hooks-rules.md
#	content/docs/hooks-state.md
#	content/docs/how-to-contribute.md
#	content/docs/implementation-notes.md
#	content/docs/integrating-with-other-libraries.md
#	content/docs/introducing-jsx.md
#	content/docs/jsx-in-depth.md
#	content/docs/lifting-state-up.md
#	content/docs/lists-and-keys.md
#	content/docs/nav.yml
#	content/docs/optimizing-performance.md
#	content/docs/portals.md
#	content/docs/react-without-es6.md
#	content/docs/react-without-jsx.md
#	content/docs/reconciliation.md
#	content/docs/reference-dom-elements.md
#	content/docs/reference-events.md
#	content/docs/reference-glossary.md
#	content/docs/reference-javascript-environment-requirements.md
#	content/docs/reference-react-component.md
#	content/docs/reference-react-dom-server.md
#	content/docs/reference-react-dom.md
#	content/docs/reference-react.md
#	content/docs/reference-test-renderer.md
#	content/docs/refs-and-the-dom.md
#	content/docs/render-props.md
#	content/docs/rendering-elements.md
#	content/docs/state-and-lifecycle.md
#	content/docs/static-type-checking.md
#	content/docs/strict-mode.md
#	content/docs/testing-environments.md
#	content/docs/testing-recipes.md
#	content/docs/testing.md
#	content/docs/thinking-in-react.md
#	content/docs/typechecking-with-proptypes.md
#	content/docs/uncontrolled-components.md
#	content/docs/web-components.md
#	content/home/examples/a-component-using-external-plugins.md
#	content/home/examples/a-simple-component.md
#	content/home/examples/a-stateful-component.md
#	content/home/examples/an-application.md
#	content/home/marketing/component-based.md
#	content/home/marketing/declarative.md
#	content/home/marketing/learn-once-write-anywhere.md
#	content/tutorial/nav.yml
#	content/tutorial/tutorial.md
#	content/warnings/dont-call-proptypes.md
#	content/warnings/invalid-aria-prop.md
#	content/warnings/legacy-factories.md
#	content/warnings/refs-must-have-owner.md
#	content/warnings/special-props.md
#	examples/context/motivation-problem.js
#	examples/context/motivation-solution.js
#	examples/context/multiple-contexts.js
#	examples/context/theme-detailed-app.js
#	examples/context/theme-detailed-theme-context.js
#	examples/context/updating-nested-context-app.js
#	examples/context/updating-nested-context-context.js
#	examples/context/updating-nested-context-theme-toggler-button.js
#	examples/forwarding-refs/customized-display-name.js
#	examples/forwarding-refs/fancy-button-ref.js
#	examples/forwarding-refs/fancy-button-simple-ref.js
#	examples/forwarding-refs/fancy-button.js
#	examples/forwarding-refs/log-props-after.js
#	gatsby-config.js
#	src/components/CodeEditor/CodeEditor.js
#	src/components/CodeExample/CodeExample.js
#	src/components/ErrorDecoder/ErrorDecoder.js
#	src/components/LayoutFooter/Footer.js
#	src/components/LayoutHeader/DocSearch.js
#	src/components/MarkdownPage/MarkdownPage.js
#	src/components/TitleAndMetaTags/TitleAndMetaTags.js
#	src/content/warnings/invalid-hook-call-warning.md
#	src/content/warnings/unknown-prop.md
#	src/pages/index.js
  • Loading branch information
rickhanlonii committed Apr 24, 2023
2 parents 1fd852a + 920f32e commit 8c3fd94
Show file tree
Hide file tree
Showing 1,096 changed files with 99,973 additions and 63,107 deletions.
41 changes: 0 additions & 41 deletions .babelrc

This file was deleted.

20 changes: 0 additions & 20 deletions .circleci/config.yml

This file was deleted.

1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SANDPACK_BARE_COMPONENTS=true
2 changes: 2 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NEXT_PUBLIC_GA_TRACKING_ID = 'UA-41298772-4'
SANDPACK_BARE_COMPONENTS=true
13 changes: 3 additions & 10 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
node_modules/*

# Ignore markdown files and examples
content/*

# Ignore built files
public/*

# Ignore examples
examples/*
scripts
plugins
next.config.js
20 changes: 9 additions & 11 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
{
"extends": [
"fbjs"
],
"plugins": [
"prettier",
"react"
],
"parser": "babel-eslint",
"root": true,
"extends": "next/core-web-vitals",
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"relay/graphql-naming": 0,
"max-len": 0
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "warn"
},
"env": {
"node": true,
"browser": true
"commonjs": true,
"browser": true,
"es6": true
}
}
35 changes: 0 additions & 35 deletions .flowconfig

This file was deleted.

4 changes: 1 addition & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@


<!--
Thank you for the PR! Contributors like you keep React awesome!
Please see the Contribution Guide for guidelines:
https://github.com/reactjs/reactjs.org/blob/master/CONTRIBUTING.md
https://github.com/reactjs/react.dev/blob/main/CONTRIBUTING.md
If your PR references an existing issue, please add the issue number below
Expand Down
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
# Disable Dependabot. Doing it here so it propagates to translation forks.
open-pull-requests-limit: 0
91 changes: 91 additions & 0 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Analyze Bundle

on:
pull_request:
push:
branches:
- main # change this if your default branch is named differently
workflow_dispatch:

jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up node
uses: actions/setup-node@v1
with:
node-version: "14.x"

- name: Install dependencies
uses: bahmutov/[email protected]

- name: Restore next build
uses: actions/cache@v2
id: restore-build-cache
env:
cache-name: cache-next-build
with:
path: .next/cache
# change this if you prefer a more strict cache
key: ${{ runner.os }}-build-${{ env.cache-name }}

- name: Build next.js app
# change this if your site requires a custom build command
run: ./node_modules/.bin/next build

# Here's the first place where next-bundle-analysis' own script is used
# This step pulls the raw bundle stats for the current bundle
- name: Analyze bundle
run: npx -p nextjs-bundle-analysis report

- name: Upload bundle
uses: actions/upload-artifact@v2
with:
path: .next/analyze/__bundle_analysis.json
name: bundle_analysis.json

- name: Download base branch bundle stats
uses: dawidd6/action-download-artifact@v2
if: success() && github.event.number
with:
workflow: analyze.yml
branch: ${{ github.event.pull_request.base.ref }}
name: bundle_analysis.json
path: .next/analyze/base/bundle

# And here's the second place - this runs after we have both the current and
# base branch bundle stats, and will compare them to determine what changed.
# There are two configurable arguments that come from package.json:
#
# - budget: optional, set a budget (bytes) against which size changes are measured
# it's set to 350kb here by default, as informed by the following piece:
# https://infrequently.org/2021/03/the-performance-inequality-gap/
#
# - red-status-percentage: sets the percent size increase where you get a red
# status indicator, defaults to 20%
#
# Either of these arguments can be changed or removed by editing the `nextBundleAnalysis`
# entry in your package.json file.
- name: Compare with base branch bundle
if: success() && github.event.number
run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare

- name: Upload analysis comment
uses: actions/upload-artifact@v2
with:
name: analysis_comment.txt
path: .next/analyze/__bundle_analysis_comment.txt

- name: Save PR number
run: echo ${{ github.event.number }} > ./pr_number

- name: Upload PR number
uses: actions/upload-artifact@v2
with:
name: pr_number
path: ./pr_number

# The actual commenting happens in the other action, matching the guidance in
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
72 changes: 72 additions & 0 deletions .github/workflows/analyze_comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Analyze Bundle (Comment)

on:
workflow_run:
workflows: ["Analyze Bundle"]
types:
- completed

jobs:
comment:
runs-on: ubuntu-latest
if: >
${{ github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Download base branch bundle stats
uses: dawidd6/action-download-artifact@v2
with:
workflow: analyze.yml
run_id: ${{ github.event.workflow_run.id }}
name: analysis_comment.txt
path: analysis_comment.txt

- name: Download PR number
uses: dawidd6/action-download-artifact@v2
with:
workflow: analyze.yml
run_id: ${{ github.event.workflow_run.id }}
name: pr_number
path: pr_number

- name: Get comment body
id: get-comment-body
if: success()
run: |
echo 'body<<EOF' >> $GITHUB_OUTPUT
echo '' >> $GITHUB_OUTPUT
echo '## Size changes' >> $GITHUB_OUTPUT
echo '' >> $GITHUB_OUTPUT
echo '<details>' >> $GITHUB_OUTPUT
echo '' >> $GITHUB_OUTPUT
cat analysis_comment.txt/__bundle_analysis_comment.txt >> $GITHUB_OUTPUT
echo '' >> $GITHUB_OUTPUT
echo '</details>' >> $GITHUB_OUTPUT
echo '' >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
pr_number=$(cat pr_number/pr_number)
echo "pr-number=$pr_number" >> $GITHUB_OUTPUT
- name: Find Comment
uses: peter-evans/find-comment@v1
if: success()
id: fc
with:
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
body-includes: "<!-- __NEXTJS_BUNDLE -->"

- name: Create Comment
uses: peter-evans/[email protected]
if: success() && steps.fc.outputs.comment-id == 0
with:
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
body: ${{ steps.get-comment-body.outputs.body }}

- name: Update Comment
uses: peter-evans/[email protected]
if: success() && steps.fc.outputs.comment-id != 0
with:
issue-number: ${{ steps.get-comment-body.outputs.pr-number }}
body: ${{ steps.get-comment-body.outputs.body }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
27 changes: 27 additions & 0 deletions .github/workflows/site_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Site Lint / Heading ID check

on:
push:
branches:
- main # change this if your default branch is named differently
pull_request:
types: [opened, synchronize, reopened]

jobs:
lint:
runs-on: ubuntu-latest

name: Lint on node 12.x and ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Install deps and build (with cache)
uses: bahmutov/[email protected]

- name: Lint codebase
run: yarn ci-check
Loading

0 comments on commit 8c3fd94

Please sign in to comment.