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

Update rollup and babel to latest versions #8200

Merged
merged 3 commits into from
Jan 30, 2023
Merged
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
28 changes: 15 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,30 @@
"postinstall": "patch-package"
},
"devDependencies": {
"@babel/core": "^7.15.0",
"@babel/node": "^7.14.9",
"@babel/core": "^7.20.12",
"@babel/node": "^7.20.7",
"@babel/preset-typescript": "^7.18.6",
"@changesets/changelog-github": "^0.4.4",
"@changesets/cli": "^2.23.0",
"@changesets/get-release-plan": "^3.0.14",
"@next/eslint-plugin-next": "^12.1.4",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^21.1.0",
"@rollup/plugin-image": "^2.0.5",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.2.1",
"@rollup/plugin-replace": "^2.3.3",
"@rollup/plugin-virtual": "^2.0.3",
"@rollup/pluginutils": "^4.1.0",
"@shopify/babel-preset": "^24.1.2",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-image": "^3.0.2",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.2",
"@rollup/plugin-virtual": "^3.0.1",
"@rollup/pluginutils": "^5.0.2",
"@shopify/babel-preset": "^25.0.0",
"@shopify/cli": "^3.10.1",
"@shopify/eslint-plugin": "^42.0.1",
"@shopify/prettier-config": "^1.1.2",
"@shopify/stylelint-plugin": "^11.0.0",
"@shopify/typescript-configs": "^5.1.0",
"@size-limit/preset-small-lib": "^5.0.3",
"@types/jest": "^27.5.1",
"babel-loader": "^9.1.2",
"downlevel-dts": "^0.6.0",
"eslint": "^8.3.0",
"execa": "^5.0.0",
Expand All @@ -76,8 +78,8 @@
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.5.0",
"rollup": "^2.70.2",
"rollup-plugin-node-externals": "^4.0.0",
"rollup": "^3.12.0",
"rollup-plugin-node-externals": "^5.1.0",
"size-limit": "^5.0.3",
"stylelint": "^14.15.0",
"ts-node": "^10.7.0",
Expand Down
20 changes: 11 additions & 9 deletions polaris-icons/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -222,24 +222,26 @@ export default [
interop,
entryFileNames: '[name].js',
chunkFileNames: '[name].js',
manualChunks: (id) => {
if (id.startsWith(iconBasePath)) {
return id.replace(iconBasePath, 'icons/');
}
},
},
{
dir: 'dist',
format: 'esm',
interop,
entryFileNames: '[name].mjs',
chunkFileNames: '[name].mjs',
manualChunks: (id) => {
if (id.startsWith(iconBasePath)) {
return id.replace(iconBasePath, 'icons/');
}
},
},
],
manualChunks: (id) => {
// Generate distinct chunks for each icon
// This allows consuming apps to split up the icons into multiple subchunks
// containing a few icons each instead of always having to put every icon
// into a single shared chunk
if (id.startsWith(iconBasePath)) {
return id.replace(iconBasePath, 'icons/');
}
},
Comment on lines -234 to -242
Copy link
Member Author

@alex-page alex-page Jan 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

manualChunks is going to move to output in the next breaking change. This moves it now so we don't have to fix it later.


external: ['react'],
onwarn: (warning, warn) => {
// Unresolved imports means Rollup couldn't find an import, possibly because
Expand Down
4 changes: 0 additions & 4 deletions polaris-migrator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@
"devDependencies": {
"@types/is-git-clean": "^1.1.0",
"@types/jscodeshift": "^0.11.5",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.3.0",
Comment on lines -51 to -54
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to root

"@shopify/polaris": "^10.24.0",
"plop": "^3.1.1",
"plop-dir": "^0.0.5",
Expand Down
4 changes: 2 additions & 2 deletions polaris-migrator/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ export default {
output: [
{
format: /** @type {const} */ ('cjs'),
entryFileNames: '[name][assetExtname].js',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[assetExtname] no longer exists in the latest version of rollup.

Note that in this case, [name] will include the relative path from the output root and possibly the original file extension if it was not one of .js, .jsx, .mjs, .cjs, .ts, .tsx, .mts, or .cts.
https://rollupjs.org/configuration-options/#output-entryfilenames

entryFileNames: '[name].js',
dir: path.dirname(pkg.main),
preserveModules: true,
exports: 'auto',
},
{
format: /** @type {const} */ ('esm'),
entryFileNames: '[name][assetExtname].mjs',
entryFileNames: '[name].mjs',
dir: path.dirname(pkg.module),
preserveModules: true,
},
Expand Down
4 changes: 0 additions & 4 deletions polaris-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0"
},
"devDependencies": {
"@babel/core": "^7.15.0",
"@babel/node": "^7.14.9",
"@changesets/get-release-plan": "^3.0.13",
"@shopify/browserslist-config": "^3.0.0",
"@shopify/jest-dom-mocks": "^3.0.5",
Expand All @@ -93,8 +91,6 @@
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6",
"ajv-cli": "^5.0.0",
"babel-core": "7.0.0-bridge.0",
"babel-loader": "^8.1.0",
"change-case": "^3.1.0",
"chromatic": "^6.5.4",
"core-js": "^3.6.5",
Expand Down
6 changes: 3 additions & 3 deletions polaris-react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ export default [
format: 'cjs',
dir: path.dirname(pkg.main),
preserveModules: true,
entryFileNames: '[name][assetExtname].js',
entryFileNames: '[name].js',
exports: 'named',
},
{
format: 'esm',
dir: path.dirname(pkg.module),
preserveModules: true,
entryFileNames: '[name][assetExtname].js',
entryFileNames: '[name].js',
},
],
}),
Expand All @@ -95,7 +95,7 @@ export default [
format: 'esm',
dir: path.dirname(pkg.esnext),
preserveModules: true,
entryFileNames: '[name][assetExtname].esnext',
entryFileNames: '[name].esnext',
},
],
}),
Expand Down
4 changes: 2 additions & 2 deletions polaris-tokens/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ export default {
output: [
{
format: /** @type {const} */ ('cjs'),
entryFileNames: '[name][assetExtname].js',
entryFileNames: '[name].js',
dir: 'dist/cjs',
preserveModules: true,
},
{
format: /** @type {const} */ ('es'),
entryFileNames: '[name][assetExtname].mjs',
entryFileNames: '[name].mjs',
dir: 'dist/esm',
preserveModules: true,
},
Expand Down
Loading