Skip to content

Commit

Permalink
Remove node polyfills no longer needed for rich text components (#2195)
Browse files Browse the repository at this point in the history
# Pull Request

## 🤨 Rationale

Fixes #1700 These two polyfills were added in #1335 because markdown-it
implicitly depended on some functionality that existed in Node but not
browser environments. We've since upgraded markdown-it to a version that
expresses those dependencies on normal npm packages, so the polyfills
are no longer needed.
markdown-it/markdown-it#967

## 👩‍💻 Implementation

Remove rollup plugins and npm dependencies on those plugins that were
added in #1335.

## 🧪 Testing

Mostly depending on PR build but also spot checking rich text
functionality in storybook.

## ✅ Checklist

<!--- Review the list and put an x in the boxes that apply or ~~strike
through~~ around items that don't (along with an explanation). -->

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.
  • Loading branch information
jattasNI authored Jun 17, 2024
1 parent 288fec3 commit 4befcd5
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 87 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Remove unneeded rollup dependencies",
"packageName": "@ni/nimble-components",
"email": "jattasNI@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Remove unneeded rollup dependencies",
"packageName": "@ni/spright-components",
"email": "jattasNI@users.noreply.github.com",
"dependentChangeType": "patch"
}
47 changes: 0 additions & 47 deletions package-lock.json

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

2 changes: 0 additions & 2 deletions packages/nimble-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
"@ni-private/eslint-config-nimble": "*",
"@ni/jasmine-parameterized": "^0.3.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.1",
"@rollup/plugin-terser": "^0.4.0",
Expand All @@ -132,7 +131,6 @@
"prettier-eslint": "^16.3.0",
"prettier-eslint-cli": "^8.0.1",
"rollup": "^4.12.0",
"rollup-plugin-polyfill-node": "^0.13.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"source-map-loader": "^5.0.0",
"terser-webpack-plugin": "^5.3.10",
Expand Down
20 changes: 2 additions & 18 deletions packages/nimble-components/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import resolve from '@rollup/plugin-node-resolve';
import sourcemaps from 'rollup-plugin-sourcemaps';
import terser from '@rollup/plugin-terser';
import replace from '@rollup/plugin-replace';
import json from '@rollup/plugin-json';
import nodePolyfills from 'rollup-plugin-polyfill-node';

const umdDevelopmentPlugin = () => replace({
'process.env.NODE_ENV': JSON.stringify('development'),
Expand Down Expand Up @@ -52,14 +50,7 @@ export default [
format: 'iife',
sourcemap: true
},
plugins: [
umdDevelopmentPlugin(),
nodePolyfills(),
sourcemaps(),
resolve(),
commonJS(),
json()
],
plugins: [umdDevelopmentPlugin(), sourcemaps(), resolve(), commonJS()],
onwarn
},
{
Expand All @@ -76,14 +67,7 @@ export default [
})
]
},
plugins: [
umdProductionPlugin(),
nodePolyfills(),
sourcemaps(),
resolve(),
commonJS(),
json()
],
plugins: [umdProductionPlugin(), sourcemaps(), resolve(), commonJS()],
onwarn
}
];
2 changes: 0 additions & 2 deletions packages/spright-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"@ni/jasmine-parameterized": "^0.3.0",
"@ni-private/eslint-config-nimble": "*",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.1",
"@rollup/plugin-terser": "^0.4.0",
Expand All @@ -85,7 +84,6 @@
"prettier-eslint": "^16.3.0",
"prettier-eslint-cli": "^8.0.1",
"rollup": "^4.12.0",
"rollup-plugin-polyfill-node": "^0.13.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"source-map-loader": "^5.0.0",
"typescript": "~5.1.6",
Expand Down
20 changes: 2 additions & 18 deletions packages/spright-components/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import resolve from '@rollup/plugin-node-resolve';
import sourcemaps from 'rollup-plugin-sourcemaps';
import terser from '@rollup/plugin-terser';
import replace from '@rollup/plugin-replace';
import json from '@rollup/plugin-json';
import nodePolyfills from 'rollup-plugin-polyfill-node';

const umdDevelopmentPlugin = () => replace({
'process.env.NODE_ENV': JSON.stringify('development'),
Expand Down Expand Up @@ -52,14 +50,7 @@ export default [
format: 'iife',
sourcemap: true
},
plugins: [
umdDevelopmentPlugin(),
nodePolyfills(),
sourcemaps(),
resolve(),
commonJS(),
json()
],
plugins: [umdDevelopmentPlugin(), sourcemaps(), resolve(), commonJS()],
onwarn
},
{
Expand All @@ -76,14 +67,7 @@ export default [
})
]
},
plugins: [
umdProductionPlugin(),
nodePolyfills(),
sourcemaps(),
resolve(),
commonJS(),
json()
],
plugins: [umdProductionPlugin(), sourcemaps(), resolve(), commonJS()],
onwarn
}
];

0 comments on commit 4befcd5

Please sign in to comment.