Skip to content

Commit d404f41

Browse files
piotrpdeverickzhao
andauthored
Apply suggestions from code review
Co-authored-by: Erick Zhao <[email protected]>
1 parent 9be2bea commit d404f41

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

blog/introducing-api-history.md

+14-17
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Electron documentation and its functions, classes, etc. in a similar fashion to
2020
use of a simple but powerful YAML schema in the API documentation Markdown files
2121
and displaying it nicely on the Electron documentation website.
2222

23+
<!--truncate-->
2324
## Details
2425

2526
### API history documentation system / YAML schema
@@ -75,7 +76,7 @@ One large change is the removal of version numbers:
7576
> the proposal, which came up during discussion when we were reviewing proposals.
7677
> [...]
7778
>
78-
> [we] decided that the approach with the least drawbacks would be to only
79+
> [we] decided that the approach with the [fewest] drawbacks would be to only
7980
> use PR URLs (the root PRs to main) instead of hardcoded version strings as in
8081
> the proposal.
8182
>
@@ -88,10 +89,10 @@ One large change is the removal of version numbers:
8889
We also didn't include removals in the API History, since when an API is removed
8990
from Electron, it is also removed from the documentation.
9091

91-
### JavaScript details
92+
### JavaScript implementation
9293

9394
I originally planned to create a new `@electron/docs-api-history-tools`
94-
NPM package that would contain scripts for extracting, validating/linting and converting
95+
npm package that would contain scripts for extracting, validating/linting and converting
9596
the API history in the documentation files.
9697

9798
About a week before the coding period began, and after some discussion with my
@@ -120,14 +121,14 @@ Instead, we divided those various tools across the Electron repos that were most
120121
relevant to them:
121122

122123
- `yaml-api-history-schema.json`
123-
- -> `electron/electron` (`api-history.schema.json`)
124+
- -> `electron/electron` ([`api-history.schema.json`](https://github.com/electron/electron/blob/main/docs/api-history.schema.json))
124125
- `lint-yaml-api-history.ts`
125-
- -> `electron/lint-roller` (`lint-markdown-api-history.ts`)
126+
- -> `electron/lint-roller` ([`lint-markdown-api-history.ts`](https://github.com/electron/lint-roller/blob/3d87b7ba8f99868a28648297f31a1587945045ab/bin/lint-markdown-api-history.ts#L4))
126127
- `extract-yaml-api-history.ts`
127-
- -> `electron/website` (`preprocess-api-history.ts`)
128+
- -> `electron/website` ([`preprocess-api-history.ts`](https://github.com/electron/website/blob/f7e9446dd7d04b3369e9454f7c95f638fa061f1e/scripts/tasks/preprocess-api-history.ts#L4))
128129
- `yaml-api-history-to-markdown.ts`
129-
- -> `electron/website` (`transformers/api-history.ts`)
130-
- -> `electron/website` (`ApiHistoryTable.tsx`)
130+
- -> `electron/website` ([`transformers/api-history.ts`](https://github.com/electron/website/blob/f7e9446dd7d04b3369e9454f7c95f638fa061f1e/src/transformers/api-history.ts))
131+
- -> `electron/website` ([`ApiHistoryTable.tsx`](https://github.com/electron/website/blob/f7e9446dd7d04b3369e9454f7c95f638fa061f1e/src/components/ApiHistoryTable.tsx))
131132

132133
### UI and styling for Electron documentation website
133134

@@ -146,16 +147,16 @@ of [SemVer](https://semver.org/) ranges, which were chosen to better communicate
146147
which versions a feature is present in (thanks Samuel Attard
147148
[(@MarshallOfSound)](https://github.com/MarshallOfSound) for the suggestion!).
148149

149-
### Usage/style Guide
150+
### Usage/style guide
150151

151152
I added a usage/style guide dedicated to writing API history documentation for
152153
new features. I described proper usages of the YAML schema in detail, provided
153154
typical/useful examples, etc. You can find it
154155
[here](https://github.com/electron/electron/blob/main/docs/styleguide.md#api-history).
155156

156-
### Migration Guide
157+
### Migration guide
157158

158-
Since existing API's have to be migrated to the new documentation system, I created
159+
Since existing APIs have to be migrated to the new documentation system, I created
159160
a migration guide. It features the typical steps of what a developer has
160161
to do when migrating old APIs: looking through breaking changes, browsing through
161162
the past releases, maybe looking through old commits, etc.
@@ -166,7 +167,7 @@ Sadly, I couldn't think of a way to automate this effectively. This would probab
166167
be a great task for an AI/ML engineer; however, I don't possess those skills and
167168
was too afraid of accidentally introducing [hallucinations](<https://en.wikipedia.org/wiki/Hallucination_(artificial_intelligence)>)
168169
into the API history. Even if automated, the information would still probably have
169-
to be verified by a human in the end :/. This task will probably have to be done
170+
to be verified by a human in the end 😕. This task will probably have to be done
170171
manually, on a file-by-file basis,
171172
[just like it was done for the Node.js documentation](https://github.com/nodejs/node/issues/6578).
172173

@@ -177,11 +178,10 @@ manually, on a file-by-file basis,
177178
- A comprehensive YAML schema for documenting API history which includes support
178179
for:
179180
- [x] Additions
180-
- [x] Depreciations
181+
- [x] Deprecations
181182
- [x] Changes
182183
- [x] Links to relevant pull requests
183184
- [x] Backports
184-
- [x] etc.
185185
- [x] Proposed in: [electron/rfc#6][rfc]
186186
- [x] Implemented/Used in: [electron/electron#42982][electron]
187187
- [x] Used in: [electron/website#594][website]
@@ -216,7 +216,6 @@ manually, on a file-by-file basis,
216216
documentation website.
217217
- [x] Uses styling that follows the rest of the website's design.
218218
- [x] Responsive, accessible, and generally well written HTML, CSS, and JS.
219-
- [x] etc.
220219
- [x] Implemented/Used in: [electron/website#594][website]
221220

222221
- `styleguide.md`
@@ -225,15 +224,13 @@ manually, on a file-by-file basis,
225224
- [x] Easy to understand
226225
- [x] Well written
227226
- [x] Includes examples
228-
- [x] etc.
229227
- [x] Implemented/Used in: [electron/electron#42982][electron]
230228

231229
- `api-history-migration-guide.md`
232230
- Migration guide for new API history documentation system.
233231
- [x] Easy to understand
234232
- [x] Well written
235233
- [x] Includes examples
236-
- [x] etc.
237234
- [x] Implemented/Used in: [electron/electron#42982][electron]
238235

239236
## Conclusion

0 commit comments

Comments
 (0)