Skip to content
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

refactor(react): only ship es modules #26044

Merged
merged 11 commits into from
Sep 30, 2022
13 changes: 13 additions & 0 deletions BREAKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ This is a comprehensive list of the breaking changes introduced in the major ver
- [Slides](#version-7x-slides)
- [Textarea](#version-7x-textarea)
- [Virtual Scroll](#version-7x-virtual-scroll)
- [JavaScript Frameworks](#version-7x-javascript-frameworks)
- [React](#version-7x-react)
- [Vue](#version-7x-vue)
- [Utilities](#version-7x-utilities)
- [hidden attribute](#version-7x-hidden-attribute)

Expand Down Expand Up @@ -133,6 +136,16 @@ Developers using the component will need to migrate to a virtual scroll solution

Any references to the virtual scroll types from `@ionic/core` have been removed. Please remove or replace these types: `Cell`, `VirtualNode`, `CellType`, `NodeChange`, `HeaderFn`, `ItemHeightFn`, `FooterHeightFn`, `ItemRenderFn` and `DomRenderFn`.

<h2 id="version-7x-javascript-frameworks">JavaScript Frameworks</h2>

<h4 id="version-7x-react">React</h4>

`@ionic/react` and `@ionic/react-router` no longer ship a CommonJS entry point. Instead, only an ES Module entry point is provided for improved compatibility with Vite. Developers should not need to make any changes to their projects.

<h4 id="version-7x-vue">Vue</h4>

`@ionic/vue` and `@ionic/vue-router` no longer ships a CommonJS entry point. Instead, only an ES Module entry point is provided for improved compatibility with Vite. Developers should not need to make any changes to their project.

<h2 id="version-7x-utilities">Utilities</h2>

<h4 id="version-7x-hidden-attribute">`hidden` attribute</h4>
Expand Down
1 change: 0 additions & 1 deletion packages/react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"sync": "sh ./scripts/sync.sh"
},
"main": "dist/index.js",
"module": "dist/index.esm.js",
"types": "dist/types/index.d.ts",
"files": [
"dist/"
Expand Down
9 changes: 2 additions & 7 deletions packages/react-router/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@ import resolve from '@rollup/plugin-node-resolve';
export default {
input: 'dist-transpiled/index.js',
output: [
{
file: 'dist/index.esm.js',
format: 'es',
sourcemap: true,
},
{
file: 'dist/index.js',
format: 'commonjs',
format: 'es',
sourcemap: true,
},
}
],
external: (id) => !/^(\.|\/)/.test(id),
plugins: [resolve(), sourcemaps()],
Expand Down
1 change: 0 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"sync": "sh ./scripts/sync.sh"
},
"main": "dist/index.js",
"module": "dist/index.esm.js",
"types": "dist/types/index.d.ts",
"files": [
"dist/",
Expand Down
12 changes: 3 additions & 9 deletions packages/react/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,11 @@ export default {
output: [
{
dir: 'dist/',
entryFileNames: '[name].esm.js',
chunkFileNames: '[name]-[hash].esm.js',
entryFileNames: '[name].js',
chunkFileNames: '[name]-[hash].js',
format: 'es',
sourcemap: true,
},
{
dir: 'dist/',
format: 'commonjs',
preferConst: true,
sourcemap: true,
},
}
],
external: (id) => !/^(\.|\/)/.test(id),
plugins: [
Expand Down
1 change: 0 additions & 1 deletion packages/vue-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"sync": "sh ./scripts/sync.sh"
},
"main": "./dist/index.js",
"module": "./dist/index.esm.js",
"types": "./dist/types/index.d.ts",
"files": [
"dist/"
Expand Down
7 changes: 1 addition & 6 deletions packages/vue-router/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
export default {
input: 'dist-transpiled/index.js',
output: [
{
file: 'dist/index.esm.js',
format: 'es',
sourcemap: true,
},
{
file: 'dist/index.js',
format: 'commonjs',
format: 'es',
sourcemap: true,
}
],
Expand Down
1 change: 0 additions & 1 deletion packages/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"sync": "sh ./scripts/sync.sh"
},
"main": "./dist/index.js",
"module": "./dist/index.esm.js",
"types": "./dist/types/index.d.ts",
"files": [
"dist/",
Expand Down
10 changes: 2 additions & 8 deletions packages/vue/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@ export default {
output: [
{
dir: 'dist/',
entryFileNames: '[name].esm.js',
chunkFileNames: '[name]-[hash].esm.js',
entryFileNames: '[name].js',
chunkFileNames: '[name]-[hash].js',
format: 'es',
sourcemap: true
},
{
dir: 'dist/',
format: 'commonjs',
preferConst: true,
sourcemap: true
}
],
external: id => external.includes(id) || id.startsWith('@ionic/core') || id.startsWith('ionicons')
};