Skip to content

Commit

Permalink
MM: fix Docusaurus 3 breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtnzlml committed Nov 6, 2023
1 parent aca6f8e commit e2a8e84
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/mrtnzlml-meta/docs/graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Quotation from the following source: https://github.com/graphql/graphql-js/issue
>
> While memcached and redis are much faster than SQL, they still often require going between services or physical machines, so another layer of cache that you might consider is an in-memory cache in your API service's runtime. This can be trickier to implement though, you'll need a good cache policy and need to ensure you don't leak sensitive data between requests.
>
> When using caching, subsequent loads to { post(id: 1) { id, ... } will just be a fast cache lookup (though we still run the access control rules every time). When paginating through lists of things, this layer of caching makes loading the post much cheaper.
> When using caching, subsequent loads to `{ post(id: 1) { id, ... } }` will just be a fast cache lookup (though we still run the access control rules every time). When paginating through lists of things, this layer of caching makes loading the post much cheaper.
>
> #### Partial Fetches
>
Expand Down
4 changes: 2 additions & 2 deletions src/mrtnzlml-meta/docs/relay.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ These are things which are somehow difficult to achieve with current Relay abili

> My general advice for applications is, for now:
>
> 1: Establish and enforce a convention in your schema for the values returned in the errors property, and when an error is considered critical enough to return null for data (When nothing can be meaningfully be rendered anyway). For example, for critical errors you might choose to still return data but have errors contain an object with {critical: true, message: '...'}, or you might choose to make data be null. The important part is consistency.
> 1: Establish and enforce a convention in your schema for the values returned in the errors property, and when an error is considered critical enough to return null for data (When nothing can be meaningfully be rendered anyway). For example, for critical errors you might choose to still return data but have errors contain an object with `{critical: true, message: '...'}`, or you might choose to make data be null. The important part is consistency.
>
> 2: Take advantage of this in your network layer. Check the data/errors property for the presence of critical error based on whatever approach you follow from the previous step, and if a critical error is present return {data: null, errors} to Relay. Otherwise pass through the data as-is.
> 2: Take advantage of this in your network layer. Check the data/errors property for the presence of critical error based on whatever approach you follow from the previous step, and if a critical error is present return `{data: null, errors}` to Relay. Otherwise pass through the data as-is.
(https://github.com/facebook/relay/issues/1816#issuecomment-304492071)

Expand Down
6 changes: 5 additions & 1 deletion src/mrtnzlml-meta/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ module.exports = {
prism: {
// https://prismjs.com/#supported-languages
additionalLanguages: [
'rust',
'bash',
'graphql',
'javascript',
'json',
'reason', // ReScript
'rust',
],
},
announcementBar: {
Expand Down
4 changes: 2 additions & 2 deletions src/mrtnzlml-meta/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"dependencies": {
"@docusaurus/core": "^3.0.0",
"@docusaurus/preset-classic": "^3.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@playwright/test": "^1.39.0"
Expand Down
18 changes: 15 additions & 3 deletions src/mrtnzlml-meta/playwright/ui/landingPages.play.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
// eslint-disable-next-line ft-flow/require-valid-file-annotation,import/no-extraneous-dependencies
import { test, expect } from '@playwright/test';

test('that /til works', async ({ page }) => {
test('/til', async ({ page }) => {
await page.goto('/');
await expect(page).toHaveTitle(/^Today I Learned \| Martin Zlámal 🤓$/);
});

test('that /til-articles works', async ({ page }) => {
test('/til/2022/04/03/list-of-all-packages-installed-using-homebrew', async ({ page }) => {
await page.goto('/til/2022/04/03/list-of-all-packages-installed-using-homebrew');
await expect(page).toHaveTitle(
/^List of all packages installed using Homebrew | Martin Zlámal 🤓$/,
);
});

test('/til-articles', async ({ page }) => {
await page.goto('/til-articles');
await expect(page).toHaveTitle(/^Articles \| Martin Zlámal 🤓$/);
});

test('that /docs/flow works', async ({ page }) => {
test('/til-articles/2021/09/30/fbt-deep-dive', async ({ page }) => {
await page.goto('/til-articles/2021/09/30/fbt-deep-dive');
await expect(page).toHaveTitle(/^FBT deep dive | Martin Zlámal 🤓$/);
});

test('/docs/flow', async ({ page }) => {
await page.goto('/docs/flow');
await expect(page).toHaveTitle(/^Flow all-in \| Martin Zlámal 🤓$/);
});
37 changes: 2 additions & 35 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19077,8 +19077,8 @@ __metadata:
"@docusaurus/core": "npm:^3.0.0"
"@docusaurus/preset-classic": "npm:^3.0.0"
"@playwright/test": "npm:^1.39.0"
react: "npm:^17.0.2"
react-dom: "npm:^17.0.2"
react: "npm:^18.2.0"
react-dom: "npm:^18.2.0"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -21879,19 +21879,6 @@ __metadata:
languageName: node
linkType: hard

"react-dom@npm:^17.0.2":
version: 17.0.2
resolution: "react-dom@npm:17.0.2"
dependencies:
loose-envify: "npm:^1.1.0"
object-assign: "npm:^4.1.1"
scheduler: "npm:^0.20.2"
peerDependencies:
react: 17.0.2
checksum: 51abbcb72450fe527ebf978c3bc989ba266630faaa53f47a2fae5392369729e8de62b2e4683598cbe651ea7873cd34ec7d5127e2f50bf4bfe6bd0c3ad9bddcb0
languageName: node
linkType: hard

"react-dom@npm:^18.2.0":
version: 18.2.0
resolution: "react-dom@npm:18.2.0"
Expand Down Expand Up @@ -22144,16 +22131,6 @@ __metadata:
languageName: node
linkType: hard

"react@npm:^17.0.2":
version: 17.0.2
resolution: "react@npm:17.0.2"
dependencies:
loose-envify: "npm:^1.1.0"
object-assign: "npm:^4.1.1"
checksum: 07ae8959acf1596f0550685102fd6097d461a54a4fd46a50f88a0cd7daaa97fdd6415de1dcb4bfe0da6aa43221a6746ce380410fa848acc60f8ac41f6649c148
languageName: node
linkType: hard

"react@npm:^18.2.0":
version: 18.2.0
resolution: "react@npm:18.2.0"
Expand Down Expand Up @@ -23298,16 +23275,6 @@ __metadata:
languageName: node
linkType: hard

"scheduler@npm:^0.20.2":
version: 0.20.2
resolution: "scheduler@npm:0.20.2"
dependencies:
loose-envify: "npm:^1.1.0"
object-assign: "npm:^4.1.1"
checksum: b0982e4b0f34f4ffa4f2f486161c0fd9ce9b88680b045dccbf250eb1aa4fd27413570645455187a83535e2370f5c667a251045547765408492bd883cbe95fcdb
languageName: node
linkType: hard

"scheduler@npm:^0.23.0":
version: 0.23.0
resolution: "scheduler@npm:0.23.0"
Expand Down

0 comments on commit e2a8e84

Please sign in to comment.