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
18 changes: 18 additions & 0 deletions BREAKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This is a comprehensive list of the breaking changes introduced in the major ver
## Version 9.x

- [Browser and Platform Support](#version-9x-browser-platform-support)
- [Package Exports](#version-9x-package-exports)
- [Components](#version-9x-components)
- [Legacy Picker](#version-9x-legacy-picker)
- [Router Outlet](#version-9x-router-outlet)
Expand All @@ -32,6 +33,23 @@ This section details the desktop browser, JavaScript framework, and mobile platf
| --------- | --------------------- |
| React | 18+ |

<h2 id="version-9x-package-exports">Package Exports</h2>

`@ionic/core`'s `package.json` now declares an `exports` field. Subpaths like `@ionic/core/components` and `@ionic/core/loader` previously failed under Node ESM (Angular 21's default Vitest builder, raw Node, etc.) with `ERR_UNSUPPORTED_DIR_IMPORT`, because the strict ESM resolver doesn't read the nested `package.json` files this package relied on. The new `exports` map declares the documented subpaths explicitly.

`exports` is an allowlist. Apps using Node ESM, webpack 5, or TypeScript `moduleResolution: "bundler"`/`"node16"`/`"nodenext"` that import from undocumented internal paths need to switch to one of the supported subpaths:

| Subpath | Use |
| ---------------------------------- | ----------------------------------------------------- |
| `@ionic/core` | Root entry, controllers, animation builders |
| `@ionic/core/components` | Custom-element constructors and shared utilities |
| `@ionic/core/components/ion-*.js` | Single-component custom-element constructor |
| `@ionic/core/loader` | `defineCustomElements` lazy loader |
| `@ionic/core/hydrate` | SSR hydration entry |
| `@ionic/core/css/*.css` | Global stylesheets and palettes |

Apps on `moduleResolution: "node"` (classic) and webpack 4 keep resolving through the legacy fields and are unaffected.

<h2 id="version-9x-components">Components</h2>

<h4 id="version-9x-legacy-picker">Legacy Picker</h4>
Expand Down
40 changes: 23 additions & 17 deletions core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,38 @@
"collection:main": "dist/collection/index.js",
"collection": "dist/collection/collection-manifest.json",
"types": "dist/types/interface.d.ts",
"exports": {
".": {
"types": "./dist/types/interface.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs.js",
"default": "./dist/index.js"
},
"./components": {
"types": "./components/custom-elements.d.ts",
"import": "./components/index.js",
"default": "./components/index.js"
},
"./components/*": "./components/*",
"./loader": {
"types": "./loader/index.d.ts",
"import": "./loader/index.js",
"require": "./loader/index.cjs.js",
"default": "./loader/index.js"
},
"./loader/*": "./loader/*",
"./hydrate": {
"types": "./hydrate/index.d.ts",
"import": "./hydrate/index.mjs",
"require": "./hydrate/index.js",
"default": "./hydrate/index.js"
},
"./hydrate/*": "./hydrate/*",
"./css/*.css": "./css/*.css",
"./css/*": "./css/*",
"./dist/*": "./dist/*",
"./package.json": "./package.json"
},
"files": [
"components/",
"css/",
Expand Down