-
Notifications
You must be signed in to change notification settings - Fork 5
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
rfc: API History Schema #6
Conversation
Co-authored-by: Erick Zhao <erick@hotmail.ca>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
the experience of a user upgrading major versions of Electron in their project. | ||
The process should ideally be as effortless as possible. | ||
|
||
## Unresolved questions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One interesting question is how this impacts / can be used in @electron/docs-parser
. The module we use to to generate structured docs from markdown.
It's possible that the website we should build the parsing of this schema into that module and then have the website use @electron/docs-parser
to do it's actual parsing. But in any case at a minimum that module will need to be updated to parse/ignore/consume the new block as we probably don't want it appearing raw in the typescript docs for instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But in any case at a minimum that module will need to be updated to parse/ignore/consume the new block as we probably don't want it appearing raw in the typescript docs for instance.
Cough, electron/docs-parser#113.
* feat(api-history): basic webpack and remark plugin * feat(api-history): basic table * feat(api-history): minor table styling * refactor(api-history): move regexp to variable * feat(api-history): better regexp * feat(api-history): move plugin to own file * feat(api-history): remove `removed` property * feat(api-history): fetch version using pr * feat(api-history): types for data fetch code * refactor(api-history): more readable row sorting * feat(api-history): changes markdown support * feat(api-history): strip comment tags in pre-build instead of plugin * feat(api-history): `pr-release-versions-plugin` * feat(api-history): use react component instead of handmade AST * fix(api-history): revert accidental dependency * refactor(api-history): get pr releases in transformer, remove plugin * docs(api-history): todo in transformer * docs(api-history): add temp example api history and schema for pr review * fix(api-history): update `yarn.lock` for now * feat(api-history): use example pr versions by default for now #594 (comment) * refactor(api-history): move `ApiHistoryTable` styles to module #594 (comment) * style(api-history): better var name, fix style lint #594 (comment) * feat(api-history): map pre-releases to released stable versions * feat(api-history): better styles, remove pr number * feat(api-history): link table change to breaking-changes * fix(api-history): provide key for table elements * feat(api-history): table semver ranges Co-authored-by: Samuel Attard <sam@electronjs.org> * feat(api-history): better error handling #594 (comment) * feat(api-history): type predicates in transformer #594 (comment) * feat(api-history): update to accepted schema electron/rfcs#6 * docs(api-history): remove old comments * feat(api-history): only pre-process `/docs/api/*.md` containing `<!--` * Update scripts/tasks/preprocess-api-history.ts Co-authored-by: Kevin Cui <158blackhole@gmail.com> * fix(api-history): match api history block consistently * feat(api-history): pre-process more error checking * Update docs/latest/api-history.schema.json Co-authored-by: Erick Zhao <erick@hotmail.ca> * fix(api-history): duplicate dependencies * docs(api-history): remove unnecessary comment * refactor(api-history): move pre-process deps to dev deps * feat(api-history): `isHtml(node)` type guard #594 (comment) * fix(api-history): missing `toLowerCase()` * Update scripts/tasks/preprocess-api-history.ts Co-authored-by: Kevin Cui <158blackhole@gmail.com> * Update scripts/tasks/preprocess-api-history.ts Co-authored-by: Kevin Cui <158blackhole@gmail.com> * Update src/components/ApiHistoryTable.tsx Co-authored-by: Kevin Cui <158blackhole@gmail.com> * revert(api-history): `isHtml(node)` type guard This reverts commit 9481b1c. * feat(api-history): tell user to run `lint-roller` * fix(api-history): stricter change type param * Apply suggestions from code review Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * style(api-history): fix lint * fix(api-history): remove unnecessary null check * style(api-history): fix lint * docs(api-history): stricter schema Reference: electron/electron@c9de2c5 * docs(api-history): `ipc-renderer` Reference: electron/electron#42982 (comment) * docs(api-history): `browser-view` * ci: use GH token with correct permissions * fix(api-history): change semver sign if backport is `x.0.0` Reported-by: David Sanders <dsanders11@ucsbalum.com> * fix(api-history): preprocess warn on missing schema * Update src/components/ApiHistoryTable.tsx Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * refactor(api-history): better semver logic Co-authored-by: David Sanders <dsanders11@ucsbalum.com> Based-on-patch-by: David Sanders <dsanders11@ucsbalum.com> Reference: #594 (comment) * refactor(api-history): remove test `docs/` `git diff feat/api-history origin/main -- docs/latest/api/ | git apply` * refactor(api-history): remove test PR data --------- Co-authored-by: Samuel Attard <sam@electronjs.org> Co-authored-by: Kevin Cui <158blackhole@gmail.com> Co-authored-by: Erick Zhao <erick@hotmail.ca> Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Note
This RFC is part of the 2024 Electron GSoC [Project] [Proposal].
This RFC aims to introduce a JSON Schema for (YAML) API history blocks in
electron/electron
documentation. It will be used to enforce and validate the structure and content of these blocks, which will include historical information about changes to the various APIs in Electron.Preview: https://github.com/piotrpdev/rfcs/blob/feat/api-history/text/0004-api-history-schema.md
Related: electron/electron#39877
Implementation: electron/lint-roller@d88115a
@dsanders11 @erickzhao