Skip to content

Commit 5b31d1f

Browse files
committed
Update and prep for React 19
1 parent 235e804 commit 5b31d1f

File tree

9 files changed

+157
-93
lines changed

9 files changed

+157
-93
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Restore Gatsby cache
26+
uses: actions/cache@v4
27+
with:
28+
path: |
29+
.cache
30+
public
31+
key: ${{ runner.os }}-gatsby-20-${{ hashFiles('**/package-lock.json') }}
32+
restore-keys: |
33+
${{ runner.os }}-gatsby-20-
34+
35+
- name: Lint
36+
run: npm run lint --silent
37+
38+
- name: Build
39+
run: npm run build --silent

README.md

Lines changed: 45 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
1+
# AdoptOpenJDK Blog
2+
13
[![Deploy to GitHub Pages](https://github.com/AdoptOpenJDK/blog/actions/workflows/deploy-to-gh-pages.yml/badge.svg)](https://github.com/AdoptOpenJDK/blog/actions/workflows/deploy-to-gh-pages.yml)
24

3-
# AdoptOpenJDK Blog
5+
This is the source of the AdoptOpenJDK blog: <https://blog.adoptopenjdk.net/>
46

5-
This is the source of the [AdoptOpenJDK blog](https://blog.adoptopenjdk.net/).
7+
React 19 upgrade plan: see docs/react19-plan.md for the phased plan and current blocker status.
68

79
## Prerequisites
810

911
1. Install dependencies, run `npm install` in the root directory of the repository.
1012

1113
## Adding Content
1214

13-
1. Create a folder in `blog` that is named after your post's title. [Slugify](https://blog.tersmitten.nl/slugify/) the title if it's more than a single word. Example: `hello-world`.
15+
1. Create a folder in `blog` that is named after your post's title. Slugify the title if it's more than a single word. Example: `hello-world`.
1416
2. Create a file called `index.md` in the directory you just created (`blog/hello-world`).
1517
3. Add the required metadata at the beginning of the file
16-
```
17-
---
18-
title: Hello World
19-
date: "2020-04-21T12:20:00+00:00"
20-
author: janedoe
21-
featuredImage: "./featured_image.png" (optional)
22-
---
23-
```
24-
`title` is the title of your post as it appears on the website. `date` is the ISO 8601 timestamp of the publication date (`date -u +"%Y-%m-%dT%H:%M:%SZ"` generates that for you on the command line) and `author` the identifier of the author as specified in the `authors.json`. `featuredImage` (optional) the relative path to the featured image.
18+
19+
---
20+
title: Hello World
21+
date: "2020-04-21T12:20:00+00:00"
22+
author: janedoe
23+
featuredImage: "./featured_image.png" (optional)
24+
---
25+
26+
`title` is the title of your post as it appears on the website. `date` is the ISO 8601 timestamp of the publication date (`date -u +"%Y-%m-%dT%H:%M:%SZ"` generates that for you on the command line) and `author` the identifier of the author as specified in the `authors.json`. `featuredImage` (optional) the relative path to the featured image.
2527
4. Write your post in Markdown. Save any images in the folder of your post alongside the `index.md`. Put the biggest resolution in there that you have. Responsive images will automatically be generated for you.
2628

2729
To preview your post, start the local development server by running `gatsby develop` in the root directory of the repository.
2830

29-
**WARNING**: The RSS feed is only generated in production mode: `gatsby build && gatsby serve`.
31+
WARNING: The RSS feed is only generated in production mode: `gatsby build && gatsby serve`.
3032

3133
## Editing Conventions
3234

@@ -38,75 +40,61 @@ On the front page, we only display excerpts and not full posts. By default, Gats
3840

3941
To add captions to your images, use the following structure:
4042

41-
```markdown
42-
![Alt text](./image.jpg)
43-
*Your caption here*
44-
```
43+
![Alt text](./image.jpg)
44+
*Your caption here*
4545

4646
Our CSS will take care of rendering it correctly by looking for `img + em`.
4747

4848
Example:
4949

50-
```markdown
51-
![Photo depiciting a drop of water](./clean-drop-of-water-liquid.jpg)
52-
*AQA v1.0 is a first drop in an on-going series of improvements.*
53-
```
50+
![Photo depiciting a drop of water](./clean-drop-of-water-liquid.jpg)
51+
*AQA v1.0 is a first drop in an on-going series of improvements.*
5452

5553
### Quotes
5654

57-
```markdown
58-
> Quote
59-
>
60-
> <cite>Name of the person</cite>
61-
```
55+
> Quote
56+
>
57+
> <cite>Name of the person</cite>
6258

6359
Example:
6460

65-
```markdown
66-
> When the Well is Dry, We’ll Know the Worth of Water.
67-
>
68-
> <cite>Benjamin Franklin</cite>
69-
```
61+
> When the Well is Dry, We’ll Know the Worth of Water.
62+
>
63+
> <cite>Benjamin Franklin</cite>
7064

7165
### Guest Posts
7266

7367
Right after the front matter, add the following snippet to introduce the person that wrote the post:
7468

75-
```markdown
76-
<GuestPost>
77-
Some introductory text
78-
</GuestPost>
79-
```
69+
<GuestPost>
70+
Some introductory text
71+
</GuestPost>
8072

8173
This is going to render as:
8274

83-
```
84-
<p className="guestpost">
85-
<em>Some introductory text – AdoptOpenJDK Team</em>
86-
</p>
87-
```
75+
<p className="guestpost">
76+
<em>Some introductory text – AdoptOpenJDK Team</em>
77+
</p>
8878

8979
Example:
9080

91-
```markdown
92-
<GuestPost>
93-
This a guest post by <a href="https://www.linkedin.com/in/weitzelm/">Mark Weitzel</a>, General Manager, New Relic One at New Relic.
94-
</GuestPost>
95-
```
81+
<GuestPost>
82+
This a guest post by <a href="https://www.linkedin.com/in/weitzelm/">Mark Weitzel</a>, General Manager, New Relic One at New Relic.
83+
</GuestPost>
9684

97-
**Note:** Markdown is not supported within `<GuestPost/>`. This is a limitation of MDX v1 and fixed in [MDX v2](https://github.com/mdx-js/mdx/issues/1041) which is currently being developed.
85+
Note: Markdown is not supported within `<GuestPost/>`. This is a limitation of MDX v1 and fixed in MDX v2 (<https://github.com/mdx-js/mdx/issues/1041>) which is currently being developed.
9886

9987
## Adding Authors
10088

10189
1. Create an entry in `content/authors.json`. Structure:
102-
```json
103-
{
104-
"janedoe": {
105-
"name": "Jane Doe",
106-
"summary": "Some info about Jane",
107-
"twitter": "Jane's Twitter handle",
108-
"github": "Jane's GitHub username"
109-
}
110-
}
111-
```
90+
91+
{
92+
"janedoe": {
93+
"name": "Jane Doe",
94+
"summary": "Some info about Jane",
95+
"twitter": "Jane's Twitter handle",
96+
"github": "Jane's GitHub username"
97+
}
98+
}
99+
112100
2. Your profile picture comes from github but this can be changed by adding a profile picture in `content/assets/authors`. If the key in the `authors.json` is `janedoe`, name the image file `janedoe.jpg`.

content/blog/bundling-adoptopenjdk-into-a-notarized-macos-application/index.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Some changes have been made to the way we codesign our macOS binaries.
1515

1616
## Summary
1717

18-
Apple has recently changed the requirements for applications to install on macOS 10.15 and above. The change requires developers to notarize the application before it gets shipped. Notarization involves submitting the application to Apple to be scanned and generates a JSON report with any issues. More information about notarization can be found [here](https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution).
18+
Apple has recently changed the requirements for applications to install on macOS 10.15 and above. The change requires developers to notarize the application before it gets shipped. Notarization involves submitting the application to Apple to be scanned and generates a JSON report with any issues. More information about notarization can be found in [Apple’s docs on notarization](https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution).
1919

2020
## What’s changed?
2121

@@ -25,8 +25,10 @@ We have enabled hardened runtime on our macOS binaries which will allow them to
2525

2626
We had multiple bug reports from users saying that when they bundle AdoptOpenJDK binaries into their applications, the notarization fails with multiple errors such as the ones below:
2727

28-
“message”: “The signature algorithm used is too weak.”,
29-
“message”: “The executable does not have the hardened runtime enabled.”,
28+
```text
29+
“message”: “The signature algorithm used is too weak.”,
30+
“message”: “The executable does not have the hardened runtime enabled.”,
31+
```
3032

3133
In order to work around this, we have had to enable hardened runtime on our binaries when we codesign them.
3234

@@ -51,7 +53,7 @@ This requires us to add --options runtime to the codesign command. It also requi
5153

5254
If you try and bundle our OpenJDK8 binaries you will receive the following notarization failure:
5355

54-
```output
56+
```text
5557
"message": "The binary uses an SDK older than the 10.9 SDK.",
5658
```
5759

docs/react19-plan.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# React 19 upgrade plan (tracking)
2+
3+
Status: Blocked by Gatsby 5 peer dependency on React ^18.
4+
5+
Phases
6+
7+
1) Upgrade Gatsby to the first React 19–compatible major and bump all official plugins to matching majors.
8+
9+
2) Align MDX ecosystem: gatsby-plugin-mdx to matching major, @mdx-js/react v3, gatsby-remark-* majors.
10+
11+
3) Upgrade react/react-dom to 19.1.0. Validate SSR/hydration across pages.
12+
13+
Done
14+
15+
- Removed defaultProps on function components (SEO) and used param defaults.
16+
- Switched analytics to gatsby-plugin-google-gtag.
17+
- Cleaned tsconfig include.
18+
19+
To monitor
20+
21+
- `npm view gatsby peerDependencies` should include react: ^19 once supported.
22+
23+
Quick check
24+
25+
- npm run check:compat

gatsby-config.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,16 @@ module.exports = {
4646
],
4747
},
4848
},
49-
"gatsby-remark-images",
49+
// Note: gatsby-remark-images is configured via
50+
// gatsby-plugin-mdx's gatsbyRemarkPlugins
5051
"gatsby-transformer-sharp",
5152
"gatsby-plugin-image",
5253
"gatsby-plugin-sharp",
5354
{
54-
resolve: "gatsby-plugin-google-analytics",
55+
resolve: "gatsby-plugin-google-gtag",
5556
options: {
56-
trackingId: "UA-99905649-2",
57-
anonymize: true,
57+
trackingIds: ["UA-99905649-2"],
58+
gtagConfig: { anonymize_ip: true },
5859
},
5960
},
6061
{

0 commit comments

Comments
 (0)