Skip to content

Commit 8743dc1

Browse files
committed
update with latest upstream
1 parent 271ed1f commit 8743dc1

File tree

212 files changed

+13071
-12474
lines changed

Some content is hidden

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

212 files changed

+13071
-12474
lines changed

.env.development

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
NEXT_PUBLIC_HJ_SITE_ID=
2-
NEXT_PUBLIC_HJ_SITE_V=
1+
SANDPACK_BARE_COMPONENTS=true
2+
PORT=3000

.env.production

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

.eslintrc

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,12 @@
11
{
2-
"extends": [
3-
"react-app",
4-
"plugin:jsx-a11y/recommended"
5-
],
6-
"plugins": [
7-
"jsx-a11y"
8-
],
9-
"overrides": [
10-
{
11-
"files": [
12-
"**/*.ts?(x)"
13-
],
14-
"rules": {
15-
"jsx-a11y/anchor-is-valid": 0,
16-
"react-hooks/exhaustive-deps": [
17-
"warn",
18-
{
19-
"additionalHooks": "(useObservable)"
20-
}
21-
],
22-
"quotes": [
23-
"error",
24-
"single"
25-
]
26-
}
27-
}
28-
],
2+
"root": true,
3+
"extends": "next/core-web-vitals",
4+
"parser": "@typescript-eslint/parser",
5+
"plugins": ["@typescript-eslint"],
6+
"rules": {
7+
"no-unused-vars": "off",
8+
"@typescript-eslint/no-unused-vars": "warn"
9+
},
2910
"env": {
3011
"node": true,
3112
"commonjs": true,

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Build
2626
run: yarn build
2727
env:
28-
NEXT_PUBLIC_GA_ID: ${{ secrets.ANALYTICS_ID }}
28+
NEXT_PUBLIC_GA_TRACKING_ID: ${{ secrets.ANALYTICS_ID }}
2929

3030
- name: Deploy
3131
uses: JamesIves/github-pages-deploy-action@4.1.1

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
13
# dependencies
24
node_modules
35

@@ -27,6 +29,7 @@ node_modules
2729
# misc
2830
.DS_Store
2931
*.pem
32+
tsconfig.tsbuildinfo
3033

3134
# debug
3235
npm-debug.log*
@@ -41,3 +44,8 @@ yarn-error.log*
4144

4245
# vercel
4346
.vercel
47+
48+
# external fonts
49+
public/fonts/Optimistic_Display_W_Lt.woff2
50+
public/fonts/Optimistic_Display_W_Md.woff2
51+
public/fonts/Optimistic_Display_W_Bd.woff2

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/content/**/*.md

.prettierrc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"bracketSpacing": true,
3+
"singleQuote": true,
4+
"bracketSameLine": true,
5+
"trailingComma": "es5",
6+
"printWidth": 80,
7+
"overrides": [
8+
{
9+
"files": "*.css",
10+
"options": {
11+
"parser": "css"
12+
}
13+
},
14+
{
15+
"files": "*.md",
16+
"options": {
17+
"parser": "mdx"
18+
}
19+
}
20+
]
21+
}

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The documentation is divided into sections to cater to different learning styles
2020

2121
**[Learn React](https://beta.reactjs.org/learn)** is designed to introduce fundamental concepts in a step-by-step way. Each individual article in Learn React builds on the knowledge from the previous ones, so make sure not to add any "cyclical dependencies" between them. It is important that the reader can start with the first article and work their way to the last Learn React article without ever having to "look ahead" for a definition. This explains some ordering choices (e.g. that state is explained before events, or that "thinking in React" doesn't use refs). Learn React also serves as a reference manual for React concepts, so it is important to be very strict about their definitions and relationships between them.
2222

23-
**[API Reference](https://reactjs.org/reference)** is organized by APIs rather than concepts. It is intended to be exhaustive. Any corner cases or recommendations that were skipped for brevity in Learn React should be mentioned in the reference documentation for the corresponding APIs.
23+
**[API Reference](https://reactjs.org/apis/react)** is organized by APIs rather than concepts. It is intended to be exhaustive. Any corner cases or recommendations that were skipped for brevity in Learn React should be mentioned in the reference documentation for the corresponding APIs.
2424

2525
**Try to follow your own instructions.**
2626

README.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,71 @@
11
# reactjs.org
22

3-
This repo contains the source code fo documentation at [reactunity.github.io](https://reactunity.github.io/).
3+
This repo contains the source code and documentation powering [beta.reactjs.org](https://beta.reactjs.org/).
4+
5+
6+
## Getting started
7+
8+
### Prerequisites
9+
10+
1. Git
11+
1. Node: any 12.x version starting with v12.0.0 or greater
12+
1. Yarn: See [Yarn website for installation instructions](https://yarnpkg.com/lang/en/docs/install/)
13+
1. A fork of the repo (for any contributions)
14+
1. A clone of the [reactjs.org repo](https://github.com/reactjs/reactjs.org) on your local machine
15+
16+
### Installation
17+
18+
`yarn` to install the website's npm dependencies
19+
20+
### Running locally
21+
22+
1. Make sure you're in the `beta` folder
23+
1. `yarn dev` to start the development server (powered by [Next.js](https://nextjs.org/))
24+
1. `open http://localhost:3000` to open the site in your favorite browser
25+
26+
## Contributing
27+
28+
### Guidelines
29+
30+
The documentation is divided into several sections with a different tone and purpose. If you plan to write more than a few sentences, you might find it helpful to get familiar with the [contributing guidelines](https://github.com/reactjs/reactjs.org/blob/main/CONTRIBUTING.md#guidelines-for-text) for the appropriate sections.
31+
32+
### Create a branch
33+
34+
1. `git checkout main` from any folder in your local `reactjs.org` repository
35+
1. `git pull origin main` to ensure you have the latest main code
36+
1. `git checkout -b the-name-of-my-branch` (replacing `the-name-of-my-branch` with a suitable name) to create a branch
37+
38+
### Make the change
39+
40+
1. Follow the ["Running locally"](#running-locally) instructions
41+
1. Save the files and check in the browser
42+
1. Changes to React components in `src` will hot-reload
43+
1. Changes to markdown files in `content` will hot-reload
44+
1. If working with plugins, you may need to remove the `.cache` directory and restart the server
45+
46+
### Test the change
47+
48+
1. If possible, test any visual changes in all latest versions of common browsers, on both desktop and mobile.
49+
2. Run `yarn check-all` from the `beta` folder. (This will run Prettier, ESLint and validate types.)
50+
51+
### Push it
52+
53+
1. `git add -A && git commit -m "My message"` (replacing `My message` with a commit message, such as `Fix header logo on Android`) to stage and commit your changes
54+
1. `git push my-fork-name the-name-of-my-branch`
55+
1. Go to the [reactjs.org repo](https://github.com/reactjs/reactjs.org) and you should see recently pushed branches.
56+
1. Follow GitHub's instructions.
57+
1. If possible, include screenshots of visual changes. A preview build is triggered after your changes are pushed to GitHub.
58+
59+
## Translation
60+
61+
If you are interested in translating `reactjs.org`, please see the current translation efforts at [translations.reactjs.org](https://translations.reactjs.org/).
62+
63+
64+
If your language does not have a translation and you would like to create one, please follow the instructions at [reactjs.org Translations](https://github.com/reactjs/reactjs.org-translation#translating-reactjsorg).
65+
66+
## Troubleshooting
67+
68+
- `yarn reset` to clear the local cache
469

570
## Acknowledgements
671

next.config.js

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

5-
const path = require('path');
6-
const { remarkPlugins } = require('./plugins/markdownToHtml');
7-
const redirects = require('./src/redirects.json');
8-
95
/**
106
* @type {import('next').NextConfig}
117
**/
128
const nextConfig = {
139
pageExtensions: ['jsx', 'js', 'ts', 'tsx', 'mdx', 'md'],
10+
reactStrictMode: true,
1411
experimental: {
1512
plugins: true,
1613
scrollRestoration: true,
1714
legacyBrowsers: false,
1815
browsersListForSwc: true,
1916
},
20-
async redirects() {
21-
return redirects.redirects;
17+
env: {
18+
SANDPACK_BARE_COMPONENTS: process.env.SANDPACK_BARE_COMPONENTS,
2219
},
23-
// TODO: this causes extra router.replace() on every page.
24-
// Let's disable until we figure out what's going on.
25-
// rewrites() {
26-
// return [
27-
// {
28-
// source: '/feed.xml',
29-
// destination: '/_next/static/feed.xml',
30-
// },
31-
// ];
32-
// },
3320
webpack: (config, { dev, isServer, ...options }) => {
3421
if (process.env.ANALYZE) {
3522
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
@@ -46,8 +33,20 @@ const nextConfig = {
4633
// Don't bundle the shim unnecessarily.
4734
config.resolve.alias['use-sync-external-store/shim'] = 'react';
4835

49-
const { IgnorePlugin } = require('webpack');
36+
const { IgnorePlugin, NormalModuleReplacementPlugin } = require('webpack');
5037
config.plugins.push(
38+
new NormalModuleReplacementPlugin(
39+
/^@stitches\/core$/,
40+
require.resolve('./src/utils/emptyShim.js')
41+
),
42+
new NormalModuleReplacementPlugin(
43+
/^raf$/,
44+
require.resolve('./src/utils/rafShim.js')
45+
),
46+
new NormalModuleReplacementPlugin(
47+
/^process$/,
48+
require.resolve('./src/utils/processShim.js')
49+
),
5150
new IgnorePlugin({
5251
checkResource(resource, context) {
5352
if (
@@ -64,22 +63,6 @@ const nextConfig = {
6463
})
6564
);
6665

67-
// Add our custom markdown loader in order to support frontmatter
68-
// and layout
69-
config.module.rules.push({
70-
test: /.mdx?$/, // load both .md and .mdx files
71-
use: [
72-
options.defaultLoaders.babel,
73-
{
74-
loader: '@mdx-js/loader',
75-
options: {
76-
remarkPlugins,
77-
},
78-
},
79-
path.join(__dirname, './plugins/md-layout-loader'),
80-
],
81-
});
82-
8366
return config;
8467
},
8568
};

0 commit comments

Comments
 (0)