Skip to content

Commit fee09bc

Browse files
authored
chore: merge main into major-10.0
2 parents 403e7aa + 70d0db0 commit fee09bc

3,308 files changed

Lines changed: 15390 additions & 11286 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/CI.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,19 @@ jobs:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
matrix:
15-
node_version: [20]
16-
# Build processes work differently across operating systems, so the
15+
# Build processes work differently across operating systems, so the
1716
# checks run on each one to make sure anyone can contribute to the
1817
# docs.
1918
os: [windows-latest, macOS-latest]
2019

2120
steps:
2221
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
23-
- name: ⚙️ Use Node.js ${{ matrix.node_version }}
22+
- name: ⚙️ Use Node.js
2423
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
2524
with:
26-
node-version: ${{ matrix.node_version }}
25+
node-version: 24
2726
- name: 🕸️ Install Dependencies
28-
run: npm ci --legacy-peer-deps
27+
run: npm ci
2928
- name: 🖌️ Lint
3029
run: npm run lint
3130
- name: Test

.prettierignore

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
# Wrapped components are our own code, so they follow the repo's formatting.
44
src/theme/DocItem/Layout/index.tsx
55
src/theme/EditMetaRow/index.tsx
6+
src/theme/Icon/DarkMode/index.tsx
67
src/theme/Icon/Edit/index.tsx
8+
src/theme/Icon/LightMode/index.tsx
79
src/theme/Icon/Language/index.tsx
810
src/theme/Layout/index.tsx
911
src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx
@@ -12,21 +14,18 @@ src/theme/prism-include-languages.ts
1214
legacy-stencil-components
1315
scripts/bak
1416

15-
docs/api
16-
versioned_docs/version-v*/api
17+
# Auto-generated files
1718
docs/native
1819
versioned_docs/version-v*/native
1920
docs/cli/commands
20-
# Each definition in these files is one line of prose inside a JSX <section>.
21-
# Prettier's mdx parser reflows those children and moves link text onto its own
22-
# line, which MDX then wraps in a paragraph, rendering invalid HTML such as
23-
# <a><p>Android SDK</p></a>. Formatting these files reintroduces that markup.
24-
docs/reference/glossary.md
25-
versioned_docs/version-v*/reference/glossary.md
21+
versioned_docs/version-v*/cli/commands
2622

2723
# Archived versions
2824
versioned_docs/version-v5
2925
versioned_docs/version-v6
26+
versioned_docs/version-v7
27+
static/usage/v6
28+
static/usage/v7
3029

3130
static/code/stackblitz
3231

.prettierrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Prettier configuration for the docs site.
3+
*/
4+
5+
const ionicConfig = require('@ionic/prettier-config');
6+
7+
module.exports = {
8+
...ionicConfig,
9+
// Override the trailingComma setting to avoid trailing commas in function arguments and JSX props.
10+
trailingComma: 'es5',
11+
};

CONTRIBUTING.md

Lines changed: 102 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,27 +214,119 @@ The Ionic documentation's `main` branch is deployed automatically and separately
214214

215215
### Archiving a Version
216216

217-
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:
217+
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:
218218

219-
- [`versions.json`](./versions.json): lists the versions Docusaurus rebuilds on every deploy.
219+
- [`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`.
220220
- [`versionsArchived.json`](./versionsArchived.json): maps each archived version to the frozen deployment URL the version picker links to.
221221

222-
The archived URL has to point at a build that _included_ the version, so you build it first, then move it to `versionsArchived.json`:
222+
The docs keep the current version plus one older version rebuildable, so each major release archives one version and involves two different version numbers. The steps below refer to them as:
223223

224-
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.
225-
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.
226-
3. **Copy its URL.** Use the deployment's unique `ionic-docs-<hash>-ionic1.vercel.app` URL, not the branch or production alias.
227-
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):
224+
- `<archiving>`: the version being frozen and removed from `versions.json`.
225+
- `<last-current>`: the version that just stopped being current and moved into `versions.json`. It is not being archived, but step 1 has to account for it.
226+
227+
For example, when `v9` becomes current: `v8` is `<last-current>` and `v7` is `<archiving>`.
228+
229+
The archived URL has to point at a build that _included_ `<archiving>`, so you build it first, then move it to `versionsArchived.json`:
230+
231+
1. **Check the `vercel.json` redirects.** The frozen deployment bakes in whatever `vercel.json` looked like at build time, and it serves every version in that build. Any `:version(...)` group missing a version therefore stays broken on that host for good. Make sure the groups already list `<last-current>`, which is the one most likely to be missing since it only just moved into `versions.json`. The `angular`, `react`, `vue` and `javascript` landing pages each need a group, as no version ships an index page for them:
232+
233+
```json
234+
{
235+
"source": "/docs/:version(v6|v7|<last-current>)/angular",
236+
"destination": "/docs/:version/angular/overview"
237+
},
238+
{
239+
"source": "/docs/:version(<last-current>)/javascript",
240+
"destination": "/docs/:version/javascript/overview"
241+
}
242+
```
243+
244+
The groups accumulate, so existing entries stay in place whether or not that version is archived and you are only ever adding to them. The `javascript` group only covers versions that have a `javascript/` section.
245+
246+
Everything from here on refers to `<archiving>`:
247+
248+
2. **Build `<archiving>`.** 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`, and add it back to the generation scripts in step 10. Commit, push and let Vercel deploy.
249+
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.
250+
4. **Copy its URL.** Use the deployment's unique `ionic-docs-<hash>-ionic1.vercel.app` URL, not the branch or production alias.
251+
5. **Archive it.** Remove `<archiving>` from `versions.json`, then add it to `versionsArchived.json` with `/docs/<archiving>` appended and no trailing slash (a trailing slash causes a brief 404 flash):
252+
253+
_`versions.json`_
254+
255+
```diff
256+
[
257+
- "v8",
258+
- "<archiving>"
259+
+ "v8"
260+
]
261+
```
262+
263+
_`versionsArchived.json`_
228264

229265
```json
230266
{
231-
"v6": "https://ionic-docs-<hash>-ionic1.vercel.app/docs/v6"
267+
"<archiving>": "https://ionic-docs-<hash>-ionic1.vercel.app/docs/<archiving>",
268+
"v6": "https://ionic-docs-lq0if04rc-ionic1.vercel.app/docs/v6",
269+
"v5": "https://ionic-docs-5utg8ms4c-ionic1.vercel.app/docs/v5"
232270
}
233271
```
234272

235-
5. **Open a PR.** Once merged, the version picker links to the archive and `main` stops building that version.
273+
6. **Update `.prettierignore`.** Add the archived version folders to the archived versions group to keep Prettier from formatting generated files:
274+
275+
```
276+
static/usage/<archiving>
277+
versioned_docs/version-<archiving>
278+
```
279+
280+
7. **Update `cspell.json`.** Add the archived version to the `ignorePaths` array so the spell checker skips generated files:
281+
282+
```diff
283+
"ignorePaths": [
284+
...
285+
"versioned_docs/version-v5",
286+
"versioned_docs/version-v6",
287+
+ "versioned_docs/version-<archiving>"
288+
]
289+
```
290+
291+
8. **Update `renovate.json`.** Add the archived version's StackBlitz examples to `ignorePaths` so Renovate stops opening dependency PRs against frozen examples:
292+
293+
```diff
294+
"ignorePaths": [
295+
"static/code/stackblitz/v6/**",
296+
+ "static/code/stackblitz/<archiving>/**"
297+
]
298+
```
299+
300+
Then remove that version's `@ionic/` `allowedVersions` rule from `packageRules`, since it no longer has anything to match.
301+
302+
9. **Update the playground generator.** Remove `<archiving>` from the version choices in [`_templates/playground/new/index.js`](./_templates/playground/new/index.js) so `npm run playground:new` stops offering a version that is no longer built. The choices are bare numbers, without the `v`:
303+
304+
```diff
305+
- choices: ['<archiving>', '8', '9'],
306+
+ choices: ['8', '9'],
307+
```
308+
309+
10. **Update the generation scripts.** Remove `<archiving>` from the write lists in [`scripts/native.mjs`](./scripts/native.mjs) and [`scripts/cli.mjs`](./scripts/cli.mjs), so every build stops regenerating content for a version served from a frozen deployment. The remaining targets are `docs/` (the current version) and the one older version still in `versions.json`.
310+
311+
_`scripts/native.mjs`_
312+
313+
```diff
314+
writeFileSync(`docs/native/${fileName}`, apiContent);
315+
- writeFileSync(`versioned_docs/version-<archiving>/native/${fileName}`, apiContent);
316+
writeFileSync(`versioned_docs/version-v8/native/${fileName}`, apiContent);
317+
```
318+
319+
_`scripts/cli.mjs`_
320+
321+
```diff
322+
writeFileSync(`docs/${path}`, data);
323+
- writeFileSync(`versioned_docs/version-<archiving>/${path}`, data);
324+
writeFileSync(`versioned_docs/version-v8/${path}`, data);
325+
```
326+
327+
11. **Open a PR.** Once merged, the version picker links to the archive and `main` stops building `<archiving>`.
236328

237-
Removed versions keep their `versioned_docs/` and `versioned_sidebars/` content, so they can be rebuilt anytime by adding them back to `versions.json`.
329+
Removed versions keep their authored `versioned_docs/` and `versioned_sidebars/` content, so they can be rebuilt anytime by adding them back to `versions.json`. Their `native/` and `cli/commands/` pages are generated rather than committed, so a rebuild also needs the version back in the write lists from step 10. Without it those sections build empty.
238330

239331
> [!NOTE]
240332
> Ionic v3 and v4 use other build tools and are not managed here.

_templates/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Once you've generated your playground, you need to add it to the main markdown f
2626
```
2727
## Feature
2828
29-
import Feature from '@site/static/usage/v8/button/feature/index.md';
29+
import Feature from '@site/static/usage/v9/button/feature/index.mdx';
3030
3131
<Feature />
3232
```

_templates/playground/new/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module.exports = {
5555
name: 'version',
5656
message: 'Select the Ionic Framework version for the playground',
5757
initial: '10',
58-
choices: ['6', '7', '8', '9', '10'],
58+
choices: ['8', '9', '10'],
5959
},
6060
{
6161
type: 'toggle',
@@ -72,7 +72,7 @@ module.exports = {
7272

7373
const playgroundName = changeCase.pascal(answers.path.split('/').pop());
7474
console.log(
75-
`\nTo use this playground in a docs markdown file, include\nthe following:\n\n## ${playgroundName}\n\nimport ${playgroundName} from '@site/static/usage/v${answers.version}/${answers.name}/${answers.path}/index.md';\n\n<${playgroundName} />\n`
75+
`\nTo use this playground in a docs markdown file, include\nthe following:\n\n## ${playgroundName}\n\nimport ${playgroundName} from '@site/static/usage/v${answers.version}/${answers.name}/${answers.path}/index.mdx';\n\n<${playgroundName} />\n`
7676
);
7777

7878
return answers;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
to: "<%= `static/usage/v${version}/${name}/${path}/index.md` %>"
2+
to: "<%= `static/usage/v${version}/${name}/${path}/index.mdx` %>"
33
---
44
import Playground from '@site/src/components/global/Playground';
55

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"versioned_docs/**/native",
2121
"versioned_docs/version-v5",
2222
"versioned_docs/version-v6",
23+
"versioned_docs/version-v7",
2324
"node_modules"
2425
],
2526
"flagWords": [

docs/angular/build-options.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ The Standalone approach uses modern Angular APIs and is the recommended way to b
1010
## Standalone
1111

1212
:::info
13+
1314
Ionic UI components as Angular standalone components is supported starting in Ionic v7.5.
15+
1416
:::
1517

1618
### Overview
@@ -30,13 +32,17 @@ Refer to the [Standalone Migration Guide](#migrating-from-modules-to-standalone)
3032
1. Ionic components need to be imported into every Angular component they are used in which can be time consuming to set up.
3133

3234
:::info[Code splitting]
35+
3336
Ionic ships standalone components from a single entry point (`@ionic/angular`). Bundlers such as Webpack and esbuild cannot split code from a single entry point across separate chunks, so the Ionic components you import are included in the main bundle rather than in the chunk for the route or component where they are used. Unused components are still tree-shaken out of the build.
37+
3438
:::
3539

3640
### Usage with Standalone-based Applications
3741

3842
:::warning
43+
3944
All Ionic imports should be imported from the `@ionic/angular` submodule. This includes imports such as components, directives, providers, and types. Importing from `@ionic/angular/lazy` may pull in lazy loaded Ionic code which can interfere with treeshaking.
45+
4046
:::
4147

4248
**Bootstrapping and Configuration**
@@ -203,7 +209,9 @@ Ionic Angular's standalone components use ES Modules. As a result, developers us
203209
### Usage with NgModule-based Applications
204210

205211
:::warning
212+
206213
All Ionic imports should be imported from the `@ionic/angular` submodule. This includes imports such as components, directives, providers, and types. Importing from `@ionic/angular/lazy` may pull in lazy loaded Ionic code which can interfere with treeshaking.
214+
207215
:::
208216

209217
**Bootstrapping and Configuration**
@@ -366,7 +374,9 @@ Ionic Angular's standalone components use ES Modules. As a result, developers us
366374
## Modules
367375

368376
:::warning[Deprecation Notice]
377+
369378
The Modules approach, including `IonicModule`, is **deprecated** and will be removed in a future major release. Existing applications will continue to work during the deprecation period but should migrate using the [Standalone migration guide](#migrating-from-modules-to-standalone). New applications should use the [Standalone](#standalone) approach.
379+
370380
:::
371381

372382
### Overview
@@ -405,9 +415,11 @@ export class AppModule {}
405415
## Migrating from Modules to Standalone
406416

407417
:::tip
418+
408419
Try our automated utility for migrating to standalone!
409420

410421
Refer to the [standalone migration codemods](https://github.com/ionic-team/ionic-angular-standalone-codemods) for instructions on how to get started. All issues related to the migration utility should be filed on the linked repo.
422+
411423
:::
412424

413425
The Standalone option is newer than the Modules option, so developers may wish to switch during the development of their application. This guide details the steps needed to migrate.

docs/angular/lifecycle.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ Ionic embraces the life cycle events provided by Angular. The two Angular events
2727
For more info on the Angular Component Life Cycle events, visit their [component lifecycle docs](https://angular.io/guide/lifecycle-hooks).
2828

2929
:::note
30+
3031
Components that use `ion-nav` or `ion-router-outlet` should not use the `OnPush` change detection strategy. Doing so will prevent lifecycle hooks such as `ngOnInit` from firing. Additionally, asynchronous state changes may not render properly.
32+
3133
:::
3234

3335
## Ionic Page Events

0 commit comments

Comments
 (0)