Skip to content

Commit 70c3128

Browse files
committed
feat: complete HDS 4.8.0 upgrade and HCRC 2.0.0 release
HCRC-178 The HCRC library was updated to major version 2.0.0 following the complete migration and upgrade to Helsinki Design System (HDS) version 4.8.0. ### Component Migrations and Refactors: * The carousel button was refactored and migrated to the new HDS button component. * The Tag component was migrated to utilize the new HDS styles. * The URL for the City of Helsinki logo in stories was updated for the Link component. * Trivial coloring fixes were applied to PageSection stories. ### Component Logic and Styling Fixes: * **Tag `onClick` Logic:** The `onClick` handler was updated to be definable as `undefined`. This resolves a styling issue concerning border display and removes a needless decorator, allowing the direct use of the HDS `onClick` property. * **Tag Multiline Text:** Default Tag styling was adjusted to support multiline text, overriding the HDS v4 default of `white-space: nowrap` which prevented necessary text wrapping. ### Environment and Configuration Fixes: * Availability of the **`Buffer` object was ensured** in all required environments. * The **type of the load more button theme** was corrected in the configuration. ### Design Token Update: * The `hds-design-tokens` package was updated. ### Testing and Utilities Improvements: * **Test Utilities:** * A `hideConsoleMessages` utility was added to suppress non-essential console output during testing. * `act` warnings were resolved by converting affected tests to an asynchronous format. * Apollo messages are now always loaded during testing. * Comments were added to clarify console messages that are being hidden. ### Versioning and Dependencies: * The HCRC version was set to 2.0.0, and corresponding dependencies were upgraded.
1 parent a9c6276 commit 70c3128

16 files changed

Lines changed: 2070 additions & 897 deletions

File tree

jest-setup.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,24 @@ import '@testing-library/jest-dom';
55
import { toHaveNoViolations } from 'jest-axe';
66
// eslint-disable-next-line import/no-extraneous-dependencies
77
import fetchMock from 'jest-fetch-mock';
8+
import { loadErrorMessages, loadDevMessages } from '@apollo/client/dev';
9+
import { hideConsoleMessages } from './src/tests/hideConsoleMessages';
10+
11+
hideConsoleMessages({
12+
warn: [
13+
// Apollo deprecation message is spammed in tests, just for future info. It's not useful in unit tests.
14+
/`canonizeResults` is deprecated and will be removed in Apollo Client 4.0. Please remove this option./,
15+
],
16+
error: [
17+
// CSS stylesheets are not ever parsed by JSDOM, so the message is useless.
18+
/Could not parse CSS stylesheet/,
19+
],
20+
});
821

922
fetchMock.enableMocks();
1023

1124
// Extend except with jest-axe
1225
expect.extend(toHaveNoViolations);
26+
27+
loadDevMessages();
28+
loadErrorMessages();

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-helsinki-headless-cms",
3-
"version": "1.3.0",
3+
"version": "2.0.0",
44
"description": "React components for displaying Headless CMS content according to guidelines set by HDS",
55
"main": "cjs/index.js",
66
"module": "index.js",
@@ -48,7 +48,7 @@
4848
"homepage": "https://github.com/City-of-Helsinki/react-helsinki-headless-cms#readme",
4949
"peerDependencies": {
5050
"@apollo/client": "^3.11.10",
51-
"hds-react": ">=4.7.1",
51+
"hds-react": ">=4.8.0",
5252
"react": "^18",
5353
"react-dom": "^18"
5454
},
@@ -84,7 +84,7 @@
8484
"@storybook/react": "^8.4.2",
8585
"@storybook/react-webpack5": "^8.4.2",
8686
"@storybook/test": "^8.4.2",
87-
"@storybook/test-runner": "^0.19.1",
87+
"@storybook/test-runner": "^0.24.1",
8888
"@testing-library/jest-dom": "^6.6.3",
8989
"@testing-library/react": "^16.0.1",
9090
"@testing-library/user-event": "^14.5.2",
@@ -111,7 +111,7 @@
111111
"eslint-plugin-react-hooks": "^5.0.0",
112112
"git-rev-sync": "^3.0.2",
113113
"graphql": "^16.9.0",
114-
"hds-react": "^4.7.1",
114+
"hds-react": "^4.8.0",
115115
"identity-obj-proxy": "^3.0.0",
116116
"jest": "^29.7.0",
117117
"jest-axe": "^9.0.0",
@@ -141,16 +141,16 @@
141141
"webpack": "^5.96.1"
142142
},
143143
"dependencies": {
144+
"classnames": "^2.5.1",
144145
"date-fns": "^4.1.0",
145-
"hds-design-tokens": "^3.11.0",
146+
"hds-design-tokens": "^4.8.0",
146147
"html-entities": "^2.5.2",
147148
"html-react-parser": "^4.2.9",
148-
"isomorphic-dompurify": "^2.16.0",
149-
"jest-environment-jsdom": "^29.7.0",
150-
"lodash-es": "^4.17.21",
151-
"classnames": "^2.5.1"
149+
"isomorphic-dompurify": "^2.31.0",
150+
"jest-environment-jsdom": "^30.2.0",
151+
"lodash-es": "^4.17.21"
152152
},
153153
"msw": {
154154
"workerDirectory": "public"
155155
}
156-
}
156+
}

0 commit comments

Comments
 (0)