Skip to content

Commit

Permalink
Update docusaurus
Browse files Browse the repository at this point in the history
Summary:
Update docusaurus to 2.0.0-beta.16

- Moves the `gtag` config, following:
```
[ERROR] Error: The "gtag" field in themeConfig should now be specified as option for plugin-google-gtag. For preset-classic, simply move themeConfig.gtag to preset options. More information at facebook/docusaurus#5832.
```

- Remove our dependence on `react-markdown` (only used for the Help page) to resolve a build error:
```
Module not found: Error: Can't resolve 'path' in '/Users/rob/workspace/metro/website/node_modules/react-markdown/node_modules/vfile'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
	- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "path": false }
Module not found: Error: Can't resolve 'path' in '/Users/rob/workspace/metro/website/node_modules/replace-ext'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
	- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "path": false }
```

- Sets `isCloseable: false` (a new docusaurus feature) on our Ukraine banner, in line with React Native

Reviewed By: motiz88

Differential Revision: D34614027

fbshipit-source-id: 15a014ac5c821c01e39fa4df9365e1886e2642fb
  • Loading branch information
robhogan authored and facebook-github-bot committed Mar 4, 2022
1 parent 540eefb commit 9e06ce6
Show file tree
Hide file tree
Showing 4 changed files with 4,027 additions and 5,939 deletions.
7 changes: 4 additions & 3 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const siteConfig = {
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
gtag: {
trackingID: 'UA-44373548-17',
},
},
],
],
Expand All @@ -40,6 +43,7 @@ const siteConfig = {
'Support Ukraine 🇺🇦 <a target="_blank" rel="noopener noreferrer" href="https://opensource.facebook.com/support-ukraine"> Help Provide Humanitarian Aid to Ukraine</a>.',
backgroundColor: '#20232a',
textColor: '#fff',
isCloseable: false,
},
navbar: {
title: 'Metro',
Expand Down Expand Up @@ -105,9 +109,6 @@ const siteConfig = {
appId: 'T38HJZTD87',
indexName: 'metro',
},
gtag: {
trackingID: 'UA-44373548-17',
},
},
scripts: ['https://buttons.github.io/buttons.js'],
};
Expand Down
7 changes: 3 additions & 4 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
"deploy": "docusaurus deploy"
},
"dependencies": {
"@docusaurus/core": "2.0.0-alpha.61",
"@docusaurus/preset-classic":"2.0.0-alpha.61",
"@docusaurus/core": "2.0.0-beta.16",
"@docusaurus/preset-classic":"2.0.0-beta.16",
"classnames": "2.2.6",
"react": "16.13.0",
"react-dom": "16.13.0",
"react-github-btn": "1.1.1",
"react-markdown":"4.3.1"
"react-github-btn": "1.1.1"
},
"devDependencies": {
"prettier": "^2.4.1"
Expand Down
75 changes: 55 additions & 20 deletions website/src/pages/help/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,70 @@
* @format
*/

'use strict';

import Layout from '@theme/Layout';
import React from 'react';
import ReactMarkdown from 'react-markdown';

const supportLinks = [
{
content: `Find what you're looking for in our detailed documentation and
guides.\n\n- Learn how to [get
started](/metro/docs/getting-started) with Metro.\n- [Troubleshoot](/metro/docs/troubleshooting) problems with
Metro.\n- Learn how to [configure
Metro](/metro/docs/configuration).\n- Look at the full [API
Reference](/metro/docs/api).`,
title: 'Browse the docs',
summary:
"Find what you're looking for in our detailed documentation and guides",
content: (
<ul>
<li>
Learn how to <a href="/metro/docs/getting-started">get started</a>{' '}
with Metro.
</li>
<li>
<a href="/metro/docs/troubleshooting">Troubleshoot</a> problems with
Metro.
</li>
<li>
Learn how to <a href="/metro/docs/configuration">configure Metro</a>.
</li>
<li>
Look at the full <a href="/metro/docs/api">API Reference</a>.
</li>
</ul>
),
},
{
content: `Ask questions and find answers from other Metro users like you.\n\n- Join the
[#metro](https://discordapp.com/channels/102860784329052160/103622435865104384)
channel on [Reactiflux](http://www.reactiflux.com/), a Discord
community.\n- Many members of the community use Stack Overflow. Read
through the [existing questions](https://stackoverflow.com/search?q=metro+bundler)
or [ask your own](https://stackoverflow.com/questions/ask)!`,
summary: 'Ask questions and find answers from other Metro users like you.',
title: 'Join the community',
content: (
<ul>
<li>
Join the{' '}
<a href="https://discordapp.com/channels/102860784329052160/103622435865104384">
#metro
</a>{' '}
channel on <a href="http://www.reactiflux.com/">Reactiflux</a>, a
Discord community.
</li>
<li>
Many members of the community use Stack Overflow. Read through the{' '}
<a href="https://stackoverflow.com/search?q=metro+bundler">
existing questions
</a>{' '}
or <a href="https://stackoverflow.com/questions/ask">ask your own</a>!
</li>
</ul>
),
},
{
content: `Find out what's new with Metro.\n\n- Follow
[Metro](https://twitter.com/MetroBundler) on Twitter.\n- Subscribe
to the [Metro blog](/metro/blog/).`,
title: 'Stay up to date',
summary: "Find out what's new with Metro.",
content: (
<ul>
<li>
Follow <a href="https://twitter.com/MetroBundler">Metro</a> on
Twitter.
</li>
<li>
Subscribe to the <a href="/metro/blog/">Metro blog</a>.
</li>
</ul>
),
},
];

Expand All @@ -53,11 +87,12 @@ const Help = () => {
</p>

<div class="row">
{supportLinks.map(({content, title}) => {
{supportLinks.map(({content, summary, title}) => {
return (
<div className="col col--4 margin-vert--md">
<h2>{title}</h2>
<ReactMarkdown source={content} />
<p>{summary}</p>
{content}
</div>
);
})}
Expand Down
Loading

0 comments on commit 9e06ce6

Please sign in to comment.