Skip to content

Commit

Permalink
docs(website): correct minor warnings and enable spelling checks
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 committed Mar 21, 2021
1 parent 2abb092 commit 6286b12
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
],
"overrides": [
{
"filename": "**/*.{ts,js}",
"filename": "**/*.{ts,js,tsx,jsx}",
"ignoreRegExpList": ["/@[a-z]+/", "/#(end)?region/"],
"includeRegExpList": [
"/\\/\\*[\\s\\S]*?\\*\\/|([^\\\\:]|^)\\/\\/.*$/",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"check:configs": "lerna run check:configs",
"check:docs": "lerna run check:docs",
"check:format": "prettier --list-different \"./**/*.{ts,js,json,md}\"",
"check:spelling": "cspell --config=.cspell.json \"**/*.{md,ts,js}\"",
"check:spelling": "cspell --config=.cspell.json \"**/*.{md,mdx,ts,js,tsx,jsx}\"",
"clean": "lerna clean && lerna run clean",
"cz": "git-cz",
"format": "prettier --write \"./**/*.{ts,tsx,js,jsx,json,md,css}\"",
Expand Down
40 changes: 19 additions & 21 deletions website/src/pages/repl.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
import React, { lazy, Suspense } from 'react';
import Layout from '@theme/Layout';

let Repl;
/**
* This is a hack for stuff that are bad in docosaurus
* we do not want to load playground for ssr
*/
const Playground = !process.env.IS_SERVER
? lazy(() => import('../components/playground'))
: (): JSX.Element => <div />;

/**
* This is a hack for stuff that are bad in docusaurus
* https://reactjs.org/docs/error-decoder.html?invariant=294
*/
if (!process.env.IS_SERVER) {
const Playground = lazy(() => import('../components/playground'));
const SSRSuspense = !process.env.IS_SERVER
? Suspense
: (props: { children: JSX.Element }): JSX.Element => props.children;

Repl = function () {
return (
<Layout title="Playground" description="Playground" noFooter={true}>
<Suspense fallback="loading">
<Playground />
</Suspense>
</Layout>
);
};
} else {
Repl = function () {
return (
<Layout title="Playground" description="Playground" noFooter={true}>
<div />
</Layout>
);
};
function Repl(): JSX.Element {
return (
<Layout title="Playground" description="Playground" noFooter={true}>
<SSRSuspense fallback="loading">
<Playground />
</SSRSuspense>
</Layout>
);
}

export default Repl;

0 comments on commit 6286b12

Please sign in to comment.