Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ versioned_docs/version-v*/reference/glossary.md
# Archived versions
versioned_docs/version-v5
versioned_docs/version-v6
versioned_docs/version-v7
static/usage/v6
static/usage/v7

static/code/stackblitz

Expand Down
50 changes: 43 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,25 +214,61 @@ The Ionic documentation's `main` branch is deployed automatically and separately

### Archiving a Version

Archived versions are served from a frozen Vercel deployment instead of being rebuilt on every `main` deploy, which keeps build times and memory usage low. Two files control this:
Archived versions are served from a frozen Vercel deployment instead of being rebuilt on every `main` deploy, which keeps build times and memory usage low. That deployment is a full snapshot of the site, so it serves every version that was in the build. Two files control this:

- [`versions.json`](./versions.json): lists the versions Docusaurus rebuilds on every deploy.
- [`versions.json`](./versions.json): lists the older versions Docusaurus rebuilds on every deploy. It does not include the current version, which is built from `docs/` and takes its label from `versions.current` in `docusaurus.config.js`.
- [`versionsArchived.json`](./versionsArchived.json): maps each archived version to the frozen deployment URL the version picker links to.

The archived URL has to point at a build that _included_ the version, so you build it first, then move it to `versionsArchived.json`:

1. **Build the version.** Make sure it is in `versions.json`. If you are refreshing an already-archived version, move it out of `versionsArchived.json` and back into `versions.json`. Commit, push and let Vercel deploy.
2. **Promote the deployment.** In the Vercel dashboard, open that deployment and **Promote to Production** so it does not get cleaned up. Wait for the build to finish before pushing again, or it may get canceled.
3. **Copy its URL.** Use the deployment's unique `ionic-docs-<hash>-ionic1.vercel.app` URL, not the branch or production alias.
4. **Archive it.** Remove the version from `versions.json`, then add it to `versionsArchived.json` with `/docs/<version>` appended and no trailing slash (a trailing slash causes a brief 404 flash):
1. **Check the `vercel.json` redirects.** Any `:version(...)` group missing a version at build time stays broken on that host for good. Add the version that most recently stopped being current, since it is the one most likely to be missing. The `angular`, `react`, `vue` and `javascript` landing pages each need a group, as no version ships an index page for them:

```json
{
"source": "/docs/:version(v6|v7|v<version>)/angular",
"destination": "/docs/:version/angular/overview"
},
{
"source": "/docs/:version(v<version>)/javascript",
"destination": "/docs/:version/javascript/overview"
}
```

The `javascript` group only covers versions that have a `javascript/` section.

2. **Build the version.** Make sure it is in `versions.json`. If you are refreshing an already-archived version, move it out of `versionsArchived.json` and back into `versions.json`. Commit, push and let Vercel deploy.
3. **Promote the deployment.** In the Vercel dashboard, open that deployment and **Promote to Production** so it does not get cleaned up. Wait for the build to finish before pushing again, or it may get canceled.
4. **Copy its URL.** Use the deployment's unique `ionic-docs-<hash>-ionic1.vercel.app` URL, not the branch or production alias.
5. **Archive it.** Remove the version from `versions.json`, then add it to `versionsArchived.json` with `/docs/<version>` appended and no trailing slash (a trailing slash causes a brief 404 flash):

```json
{
"v6": "https://ionic-docs-<hash>-ionic1.vercel.app/docs/v6"
}
```

5. **Open a PR.** Once merged, the version picker links to the archive and `main` stops building that version.
6. **Update `.prettierignore`.** Add the archived version folders to the archived versions group to keep Prettier from formatting generated files:

```
static/usage/v<version>
versioned_docs/version-v<version>
```

7. **Update `cspell.json`.** Add the archived version to the `ignorePaths` array so the spell checker skips generated files:

```json
"versioned_docs/version-v<version>"
```

8. **Update `renovate.json`.** Add the version's StackBlitz examples to `ignorePaths` so Renovate stops opening dependency PRs against frozen examples:

```json
"ignorePaths": ["static/code/stackblitz/v<version>/**"]
```

Then remove that version's `@ionic/` `allowedVersions` rule from `packageRules`, since it no longer has anything to match.

9. **Open a PR.** Once merged, the version picker links to the archive and `main` stops building that version.

Removed versions keep their `versioned_docs/` and `versioned_sidebars/` content, so they can be rebuilt anytime by adding them back to `versions.json`.

Expand Down
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"versioned_docs/**/native",
"versioned_docs/version-v5",
"versioned_docs/version-v6",
"versioned_docs/version-v7",
"node_modules"
],
"flagWords": [
Expand Down
10 changes: 7 additions & 3 deletions vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"destination": "/docs/angular/overview"
},
{
"source": "/docs/:version(v6|v7)/angular",
"source": "/docs/:version(v6|v7|v8)/angular",
"destination": "/docs/:version/angular/overview"
},
{
Expand Down Expand Up @@ -37,6 +37,10 @@
"source": "/docs/javascript",
"destination": "/docs/javascript/overview"
},
{
"source": "/docs/:version(v8)/javascript",
"destination": "/docs/:version/javascript/overview"
},
{
"source": "/docs/ja/",
"destination": "/docs/ja"
Expand All @@ -53,7 +57,7 @@
"destination": "/docs/react/overview"
},
{
"source": "/docs/:version(v6|v7)/react",
"source": "/docs/:version(v6|v7|v8)/react",
"destination": "/docs/:version/react/overview"
},
{
Expand Down Expand Up @@ -82,7 +86,7 @@
"destination": "/docs/vue/overview"
},
{
"source": "/docs/:version(v6|v7)/vue",
"source": "/docs/:version(v6|v7|v8)/vue",
"destination": "/docs/:version/vue/overview"
},
{ "source": "/docs/vue/your-first-app/2-taking-photos", "destination": "/docs/vue/your-first-app/taking-photos" },
Expand Down