Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MDX] Migration to gatsby-plugin-mdx v4 (requires migration to MDX v2) #4532

Merged
merged 69 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
04dee31
prep for testing mdx fix comparison
randychilau Jul 6, 2023
5d7e9e6
record memory usage
randychilau Jul 6, 2023
5f935d7
update root-wrapper with mdx shortcodes
randychilau Jul 7, 2023
507a5a8
add additional shortcodes
randychilau Jul 7, 2023
061eadd
remove shortcode imports from mdx files
randychilau Jul 7, 2023
598a27b
move styles to main folder for use with shortcodes
randychilau Jul 7, 2023
91f3455
clear eslint warnings for no-unused-vars
randychilau Jul 7, 2023
d600d4b
add and removed plugins for migration to MDXv2
randychilau Jul 7, 2023
4089305
update config to use plugins
randychilau Jul 7, 2023
774db7b
update style attributes to be jsx compatible
randychilau Jul 7, 2023
b74d75f
update mdx files to clear mdx eslint warnings
randychilau Jul 7, 2023
2bd7317
resolve undefined string by moving empty template
randychilau Jul 7, 2023
9034cdb
replace MDXRenderer, body with children per mdxv2
randychilau Jul 7, 2023
deeb248
import children props to templates per mdxv2
randychilau Jul 7, 2023
a5351e7
workaround to add responsive SVG to mdxv2
randychilau Jul 7, 2023
3590795
update pre props to mdxv2
randychilau Jul 7, 2023
6fa8b6b
clear mdxv2 error for div tag on table
randychilau Jul 7, 2023
3c78fd2
added contentfilepath to templates and queries
randychilau Jul 7, 2023
af7f48e
added eslint for mdx files for mdxv2 compatibility
randychilau Jul 7, 2023
5ad6aea
replace html with excerpt in feeds per mdxv2 guide
randychilau Jul 7, 2023
656602a
remove mdxrenderer per gatsby mdx2 migration guide
randychilau Jul 7, 2023
a910882
remove logging for debugging
randychilau Jul 7, 2023
310e47c
fix for heap memory OOM issue, see comments
randychilau Jul 7, 2023
a1f1ba3
feat: env var to turn on ignoreArray for dev build
randychilau Jul 9, 2023
6c1c165
fix: add react-markdow to replace mdxrenderer case
randychilau Jul 10, 2023
66a8a16
fix: add rehyperaw plugin for html in md snippets
randychilau Jul 10, 2023
901887f
fix: parse mdx body in non-templates with pkgs
randychilau Jul 10, 2023
4e0a8f8
fix: update from mdx to markdown for remark use
randychilau Jul 10, 2023
d0a8ae3
feat: add env var for faster dev prod local builds
randychilau Jul 10, 2023
2a550bc
fix: default set dev_amended value to false
randychilau Jul 10, 2023
68f0666
Merge branch 'master' into mdx2-upgrade
randychilau Jul 11, 2023
78ef967
fix: add "no-sourcemaps" plugin for dev mem issue
randychilau Jul 11, 2023
d7a316c
feat: filesystem ignore array for faster dev build
randychilau Jul 11, 2023
42bd0bc
feat: add env for faster dev_amended build option
randychilau Jul 11, 2023
537bfde
more shortcodes for any components imported to mdx
randychilau Jul 15, 2023
c32fe46
fix: resize, resave png to reduce webp filesize
randychilau Jul 15, 2023
b3db1f6
fix: update mdx pages to use webp instead of png
randychilau Jul 15, 2023
af14e6d
fix: optimize large files used in mdx
randychilau Jul 15, 2023
8db58cd
fix: update mdx files to use optimized images/pdfs
randychilau Jul 15, 2023
54e2de6
fix: clear all setTimeouts, add useTimeout hook
randychilau Jul 15, 2023
08ec3ca
fix: clear eventListener and update deprecated ref
randychilau Jul 15, 2023
a06943e
fix: use loadable, remove lightbox in templates
randychilau Jul 15, 2023
578d7e9
fix: disable dev amended on default
randychilau Jul 15, 2023
1232630
Merge branch 'master' into mdx2-upgrade
randychilau Jul 16, 2023
d589e28
fix: eslint errors in mdx
randychilau Jul 16, 2023
7043b6e
fix: resolve wrong case for "cleanupIds"
randychilau Jul 16, 2023
8778b34
fix: rename image temporarily
randychilau Jul 16, 2023
f5f1b5c
fix: revert file name with different casing
randychilau Jul 16, 2023
7e090e2
fix: update mdx and image file name
randychilau Jul 16, 2023
b1691f5
Merge branch 'master' into mdx2-upgrade
randychilau Jul 16, 2023
eeeb674
fix: replace svg with 300dpi webp to reduce file
randychilau Jul 16, 2023
3c6d2ec
Merge branch 'master' into mdx2-upgrade
randychilau Jul 17, 2023
aed8862
Merge branch 'master' into mdx2-upgrade
leecalcote Jul 17, 2023
d5b431e
fix: mdxrenderer workaround for dropdown selection
randychilau Jul 18, 2023
0e7af13
Merge branch 'mdx2-upgrade' of https://github.com/randychilau/layer5 …
randychilau Jul 18, 2023
68ba3a7
fix: handle "undefined" for options.length
randychilau Jul 18, 2023
9d94848
fix: add loadable to chunk split files using mdx
randychilau Jul 18, 2023
3aecb9b
fix: change to default exports for loadable use
randychilau Jul 18, 2023
694e5b4
fix: correct folder/file name to replace .md
randychilau Jul 18, 2023
773057a
fix: correct date on folder name
randychilau Jul 18, 2023
4528905
fix: use loadable to not auto include app bundle
randychilau Jul 18, 2023
7f7a512
chore: uninstall gatsby-plugin-no-sourcemaps
randychilau Jul 18, 2023
b4a5215
fix: update and cleanup import list
randychilau Jul 18, 2023
8ccd095
feat: add build time warning to doc, add nav items
randychilau Jul 18, 2023
fecd393
Merge 'master' into mdx2-upgrade, resolve conflict
randychilau Jul 18, 2023
ada7ab0
fix: correct eslint semicolon issue
randychilau Jul 18, 2023
fff2d3b
fix: reinstall gatsby-plugin-no-sourcemaps
randychilau Jul 19, 2023
e3d201f
fix: corrections for images and urls
randychilau Jul 19, 2023
697d013
feat: add build expecations to CONTRIBUTING.md
randychilau Jul 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
GATSBY_GRAPHQL_IDE=playground
GATSBY_DEV_AMENDED=false
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GATSBY_DEV_AMENDED=false
25 changes: 24 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,28 @@ module.exports = {
"space-infix-ops": [
"error"
]
}
},
"overrides": [
{
"files": ["*.mdx", "*.md"],
"extends": ["plugin:mdx/recommended"],
"settings": {
"mdx/code-blocks": true,
"mdx/language-mapper": {},
},
"rules": {
//these eslint rule exceptions allow for checklint to run and lint mdx files are compatible with MDXv2, and not error out due to react/eslint rules
"semi": 0,
"indent": 0,
"no-trailing-spaces": 0,
"object-curly-spacing": 0,
"space-infix-ops": 0,
"no-irregular-whitespace": 0,
"no-unused-expressions": 0,
"linebreak-style": 0,
"react/jsx-no-undef": 0,
"no-unused-vars": 0,
}
}
],
};
234 changes: 218 additions & 16 deletions CONTRIBUTING.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@ videos: 3
lectures: 8
cardImage: "../../../src/assets/images/service-mesh-icons/istio-white.svg"
meshesYouLearn:
[
{
imagepath: "../../../src/assets/images/service-mesh-icons/istio.svg",
name: "Istio",
},
{
imagepath: "../../../src/assets/images/service-mesh-icons/linkerd.webp",
name: "Linkerd",
}
]
- imagepath: "../../../src/assets/images/service-mesh-icons/istio.svg"
name: "Istio"
- imagepath: "../../../src/assets/images/service-mesh-icons/linkerd.webp"
name: "Linkerd"
toc:
[
'getting-started',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ lectures: 12
order: 8
---

import { ChapterStyle } from "../../../../src/components/Learn-Components/Chapters-Style/chapters.style.js";


<ChapterStyle>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ lectures: 12
order: 2
---

import { ChapterStyle } from "../../../../src/components/Learn-Components/Chapters-Style/chapters.style.js";

import BookInfoOffMesh from "../../../../src/assets/images/learn-layer5/istio/bookinfo-off-mesh.webp";
import BookInfoOnMesh from "../../../../src/assets/images/learn-layer5/istio/bookinfo-on-mesh.webp";

Expand Down Expand Up @@ -61,7 +61,7 @@ If your environment **does NOT** supports either of these two APIs, then you may
As part of Istio deployment in [Previous chapter](./getting-started), you have deployed the sidecar injector.

<br />
<h2 class="chapter-sub-heading">
<h2 className="chapter-sub-heading">
<a name="auto"></a> Deploying Sample App with Automatic sidecar injection
</h2>

Expand Down Expand Up @@ -107,7 +107,7 @@ This will do 3 things:
1. Deploys all the BookInfo services in the `default` namespace.
1. Deploys the virtual service and gateway needed to expose the BookInfo's productpage application in the `default` namespace.

<h3 class="chapter-sub-heading">
<h3 className="chapter-sub-heading">
<a name="verify"></a> Verify Bookinfo deployment{" "}
</h3>

Expand Down Expand Up @@ -139,7 +139,7 @@ Follow this if the above steps did not work for you
<br />
<br />

<h4 class="chapter-alt-heading"> Label namespace for injection</h4>
<h4 className="chapter-alt-heading"> Label namespace for injection</h4>

Label the default namespace with istio-injection=enabled

Expand All @@ -161,7 +161,7 @@ kube-public Active 1h
kube-system Active 1h
```

<h4 class="chapter-alt-heading"> Deploy BookInfo</h4>
<h4 className="chapter-alt-heading"> Deploy BookInfo</h4>
<br />

Applying this yaml file included in the Istio package you collected in [Getting Started](./getting-started) will deploy the BookInfo app in you cluster.
Expand All @@ -170,7 +170,7 @@ Applying this yaml file included in the Istio package you collected in [Getting
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
```

<h4 class="chapter-alt-heading">
<h4 className="chapter-alt-heading">
Deploy Gateway and Virtual Service for BookInfo app
</h4>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ lectures: 12
order: 3
---

import { ChapterStyle } from "../../../../src/components/Learn-Components/Chapters-Style/chapters.style.js";


<ChapterStyle>
The components deployed on the service mesh by default are not exposed outside the cluster. An Ingress Gateway is deployed as a Kubernetes service of type LoadBalancer (or NodePort). To make Bookinfo accessible external to the cluster, you have to create an `Istio Gateway` for the Bookinfo application and also define an `Istio VirtualService` with the routes we need.

<br />
<br />

<h2 class="chapter-sub-heading"> Inspecting the Istio Ingress Gateway</h2>
<h2 className="chapter-sub-heading"> Inspecting the Istio Ingress Gateway</h2>

<br />
The ingress gateway gets exposed as a normal Kubernetes service of type LoadBalancer
Expand Down Expand Up @@ -63,10 +63,10 @@ Now let us find the ingress pod and output the log:
kubectl logs istio-ingressgateway-... -n istio-system
```

<h2 class="chapter-sub-heading">View Istio Ingress Gateway for Bookinfo</h2>
<h2 className="chapter-sub-heading">View Istio Ingress Gateway for Bookinfo</h2>
<br />

<h3 class="chapter-sub-heading"> View the Gateway and VirtualServices</h3>
<h3 className="chapter-sub-heading"> View the Gateway and VirtualServices</h3>

Check the created `Istio Gateway` and `Istio VirtualService` to see the changes deployed:

Expand All @@ -78,7 +78,7 @@ kubectl get virtualservices
kubectl get virtualservices -o yaml
```

<h3 class="chapter-sub-heading">
<h3 className="chapter-sub-heading">
Find the external port of the Istio Ingress Gateway by running:
</h3>

Expand All @@ -92,7 +92,7 @@ To just get the first port of istio-ingressgateway service, we can run this:
kubectl get service istio-ingressgateway -n istio-system --template='{{(index .spec.ports 1).nodePort}}'
```

<h3 class="chapter-sub-heading"> Create a DNS entry:</h3>
<h3 className="chapter-sub-heading"> Create a DNS entry:</h3>

Modify your local `/etc/hosts` file to add an entry for your sample application.

Expand All @@ -108,7 +108,7 @@ echo "http://$(kubectl get nodes --selector=kubernetes.io/role!=master -o jsonpa

Docker Desktop users please use `http://localhost/productpage` to access product page in your browser.

<h2 class="chapter-sub-heading"> Apply default destination rules</h2>
<h2 className="chapter-sub-heading"> Apply default destination rules</h2>

Before we start playing with Istio's traffic management capabilities we need to define the available versions of the deployed services. They are called subsets, in destination rules.

Expand Down Expand Up @@ -189,16 +189,16 @@ kubectl get destinationrules
kubectl get destinationrules -o yaml
```

<h2 class="chapter-sub-heading"> Browse to BookInfo</h2>
<h2 className="chapter-sub-heading"> Browse to BookInfo</h2>

Browse to the website of the Bookinfo. To view the product page, you will have to append
`/productpage` to the url.

<h3 class="chapter-sub-heading"> Reload Page</h3>
<h3 className="chapter-sub-heading"> Reload Page</h3>

Now, reload the page multiple times and notice how it round robins between v1, v2 and v3 of the reviews service.

<h2 class="chapter-sub-heading">
<h2 className="chapter-sub-heading">
Inspect the Istio proxy of the productpage pod
</h2>

Expand Down Expand Up @@ -232,15 +232,15 @@ Follow this if the above steps did not work for you
<br />
<br />

<h4 class="chapter-alt-heading"> Default destination rules</h4>
<h4 className="chapter-alt-heading"> Default destination rules</h4>

Run the following command to create default destination rules for the Bookinfo services:

```sh
kubectl apply -f samples/bookinfo/networking/destination-rule-all-mtls.yaml
```

<h4 class="chapter-alt-heading">
<h4 className="chapter-alt-heading">
Configure the Bookinfo route with the Istio Ingress gateway
</h4>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ lectures: 12
order: 1
---

import { ChapterStyle } from "../../../../src/components/Learn-Components/Chapters-Style/chapters.style.js";

import InstallIstio from "../../../../src/assets/images/learn-layer5/istio/install-istio.webp";
import IstioAdapter from "../../../../src/assets/images/learn-layer5/istio/istio-adapter.webp";

<ChapterStyle>

<h2 class="chapter-sub-heading">Setup Istio </h2>
<h2 className="chapter-sub-heading">Setup Istio </h2>

Now that we have a Kubernetes cluster and Meshery, we are ready to download and deploy Istio resources.

<h2 class="chapter-sub-heading">Steps</h2>
<h2 className="chapter-sub-heading">Steps</h2>

1. [Install Istio](#1)
1. [Verify install](#2)
Expand All @@ -28,7 +28,7 @@ Optional (manual install of Istio):
1. [Setup `istioctl`](#1.2)
1. [Install istio](#1.3)

<h3 class="chapter-sub-heading">
<h3 className="chapter-sub-heading">
<a name="1">Install Istio</a>
</h3>

Expand All @@ -53,7 +53,7 @@ Perform the below steps if the above steps doesn't work for you.
<br />
<br />

<h4 class="chapter-alt-heading">
<h4 className="chapter-alt-heading">
<a name="1.1">Download Istio</a>
</h4>

Expand All @@ -67,7 +67,7 @@ On your local machine, execute:
curl -L https://git.io/getLatestIstio | ISTIO_VERSION=1.7.3 sh -
```

<h4 class="chapter-alt-heading">
<h4 className="chapter-alt-heading">
<a name="1.2">Setting up istioctl</a>
</h4>

Expand Down Expand Up @@ -96,7 +96,7 @@ Check if the cluster is ready for installation:
istioctl verify-install
```

<h4 class="chapter-alt-heading">
<h4 className="chapter-alt-heading">
<a name="1.3">Install Istio</a>
</h4>

Expand All @@ -112,7 +112,7 @@ Alternatively, with Envoy logging enabled:
istioctl install --set profile=demo --set meshConfig.accessLogFile=/dev/stdout
```

<h3 class="chapter-sub-heading">
<h3 className="chapter-sub-heading">
<a name="2">Verify install</a>
</h3>

Expand All @@ -121,7 +121,7 @@ In the Istio management page:
1. Click the (+) icon on the `Validate Service Mesh Configuration` card.
1. Select `Verify Installation` to verify the installation of Istio.

<h4 class="chapter-alt-heading">Alternatively:</h4>
<h4 className="chapter-alt-heading">Alternatively:</h4>

Istio is deployed in a separate Kubernetes namespace `istio-system`. To check if Istio is deployed, and also, to see all the pieces that are deployed, execute the following:

Expand Down
Loading