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

Version 8.0 #581

Merged
merged 7 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.14.2
v18.12.1
3 changes: 3 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
core: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needed to upgrade to webpack 5 in order to resolve issues with Node 18 and SSL. See: https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported

builder: 'webpack5',
},
stories: ['../**/*.story.js'],
addons: [
'@storybook/addon-actions',
Expand Down
13 changes: 12 additions & 1 deletion .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ module.exports = async ({ config }) => {
// Storysource-addon
config.module.rules.push({
test: /\.story\.jsx?$/,
loaders: [require.resolve('@storybook/source-loader')],
use: [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needed to change the webpack configuration in order to accommodate webpack 5.

{
loader: require.resolve('@storybook/source-loader')
}
],
enforce: 'pre',
})
// Sass
Expand Down Expand Up @@ -39,5 +43,12 @@ module.exports = async ({ config }) => {
src: path.resolve(__dirname, '../src'),
},
}
// Required for Node ^18.12.1 to resolve an OpenSSL configuraiton deprecation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: configuration

// See: https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported/73465262#73465262
config.output = {
...config.output,
hashFunction: 'xxhash64',
}

return config
}
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: node_js
dist: focal
chawes13 marked this conversation as resolved.
Show resolved Hide resolved
cache: yarn
before_script:
- 'yarn lint --max-warnings=0'
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Documentation and usage info can be found in [docs.md](docs.md).
- [v5.0.0](migration-guides/v5.0.0.md)
- [v6.0.0](migration-guides/v6.0.0.md)
- [v7.0.0](migration-guides/v7.0.0.md)
- [v8.0.0](migration-guides/v8.0.0.md)

## Contribution

Expand Down
29 changes: 29 additions & 0 deletions migration-guides/v8.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# v8.0.0 Migration Guide
chawes13 marked this conversation as resolved.
Show resolved Hide resolved

This version contains the following breaking changes:

1. Upgraded Node version to 18.12.1
2. Removed `node-sass` in favor of `sass`
3. Upgraded webpack and related loaders

Further explanation of each item is detailed below.

---

## 1. Upgraded Node version to 18.12.1

Typically, the Node version of an application can be updated without any breaking change. However, Node 18 requires an upgraded version of `glibc`. This has impact on both Travis and the existing `node-sass` executable.

For Travis, the default distribution used for builds and test execution does not have the version of `glibc` required by Node 18. To resolve this issue, a specific distribution is specified in the `.travis.yml` configuration file that has the correct `glibc` version.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you reference the distribution name directly in this paragraph please? Any official docs from Travis to reference for more info?


`node-sass` has been deprecated and the latest version does not support the later `glibc` version (an exception is generated when one tries to execute `node-sass` with the later Node version). To resolve this, `node-sass` was removed and `sass` (Dart Sass, the currently active Sass implementation) was added. This change required an additional update to the `build:styles` script to use `sass` for style builds.
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add this paragraph to the section below.


Finally, this version of `lp-components` will not support older Node versions. You must use Node version ^18.12.1.

## 2. Removed `node-sass` in favor of `sass`

As mentioned above, `node-sass` was removed in favor of `sass`. Additionally, the latest version of `style-loader` was included in this version of `lp-components`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the style-loader note relevant in this section? Seems like your mention of it in #3 is sufficient enough IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's fine. Removed.


## 3. Upgraded webpack and related loaders

The Node upgrade [mentioned above](#1-upgraded-node-version-to-18121) also fixed an OpenSSL issue. That fix required that the latest version of Webpack be used, along with configuration of a specific hashing function. To accommodate this change, webpack was upgraded to ^5.75.0 and the `css-loader`, `style-loader`, and `sass-loader` were also upgraded to their latest versions.
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@launchpadlab/lp-components",
"version": "7.0.2",
"version": "8.0.0",
mwislek marked this conversation as resolved.
Show resolved Hide resolved
"engines": {
"node": "^14.19 || ^16.14"
"node": "^18.12"
mwislek marked this conversation as resolved.
Show resolved Hide resolved
},
"description": "Our Components",
"main": "lib/index.js",
Expand All @@ -20,7 +20,7 @@
"build": "yarn build:cjs && yarn build:esm && yarn build:styles",
"build:cjs": "babel src --out-dir lib",
"build:esm": "BABEL_ENV=esm babel src --out-dir esm",
"build:styles": "cp -r src/styles lib/styles && node-sass src/styles/ -o lib/styles",
"build:styles": "cp -r src/styles lib/styles && sass src/styles:lib/styles",
chawes13 marked this conversation as resolved.
Show resolved Hide resolved
"build:development": "BABEL_ENV=esm babel src --watch --out-dir esm",
"clean": "rm -rf lib esm",
"docs": "documentation build src/index.js -f md -o docs.md",
Expand Down Expand Up @@ -67,31 +67,33 @@
"@storybook/addon-storysource": "^6.4.22",
"@storybook/addon-viewport": "^6.4.22",
"@storybook/addons": "^6.4.22",
"@storybook/builder-webpack5": "^6.5.14",
"@storybook/manager-webpack5": "^6.5.14",
"@storybook/react": "^6.4.22",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
"babel-loader": "^8.2.4",
"babel-loader": "^9.1.0",
"bourbon": "^7.2.0",
"bourbon-neat": "^4.0.0",
"core-js": "^3.21.1",
"css-loader": "^5.2.7",
"css-loader": "^6.7.2",
"documentation": "^13.2.5",
"enzyme": "^3.2.0",
"eslint": "^7.32.0",
"husky": "^7.0.4",
"jest": "^25.1.0",
"jest-canvas-mock": "^2.1.1",
"lint-staged": "^13.0.3",
"node-sass": "^6.0.1",
"prettier": "^2.7.1",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"recompose": "^0.30.0",
"redux": "^4.1.2",
"regenerator-runtime": "^0.13.9",
"sass-loader": "^10.2.1",
"sass": "^1.56.1",
"sass-loader": "^13.2.0",
"size-limit": "^7.0.8",
"style-loader": "^2.0.0",
"webpack": "^4.39.2"
"style-loader": "^3.3.1",
"webpack": "^5.75.0"
},
"peerDependencies": {
"react": "^16.14.0 || ^17.0.0"
Expand Down
114 changes: 114 additions & 0 deletions src/styles/modal.css

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

1 change: 1 addition & 0 deletions src/styles/modal.css.map

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

Loading