Skip to content

Commit 48780f7

Browse files
committed
Merge branch 'main' into update-vanilla-extract
2 parents 2da2dbf + dcef24b commit 48780f7

File tree

7 files changed

+1012
-175
lines changed

7 files changed

+1012
-175
lines changed

.eslintrc.cjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,21 @@ module.exports = {
4646
"react/react-in-jsx-scope": "off",
4747
"react-hooks/rules-of-hooks": "error",
4848
"react-hooks/exhaustive-deps": "warn",
49+
// React compiler rules
50+
"react-hooks/purity": "warn", // Side effects during render
51+
"react-hooks/refs": "warn", // Reading/writing refs during render
52+
"react-hooks/set-state-in-render": "warn", // setState during render
53+
"react-hooks/set-state-in-effect": "warn", // Synchronous setState in effects
54+
"react-hooks/immutability": "warn", // Mutation of props/state
55+
"react-hooks/static-components": "warn", // Dynamic component creation
56+
"react-hooks/use-memo": "warn", // useMemo violations
57+
"react-hooks/void-use-memo": "warn", // useMemo returning void
58+
"react-hooks/component-hook-factories": "warn", // Component/hook factory violations
59+
"react-hooks/preserve-manual-memoization": "warn", // Manual memoization issues
60+
"react-hooks/globals": "warn", // Global variable usage
61+
"react-hooks/error-boundaries": "warn", // Error boundary violations
62+
"react-hooks/config": "warn", // Config violations
63+
"react-hooks/gating": "warn", // Conditional rendering violations
4964
"import/no-unresolved": "error",
5065
"import/order": [
5166
"error",

.storybook/main.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { mergeConfig } from "vite";
22
import { resolve } from "path";
3+
import type { StorybookConfig } from "@storybook/react-vite";
34

4-
export default {
5+
const config: StorybookConfig = {
56
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
67
addons: [
78
"@storybook/addon-links",
@@ -17,9 +18,12 @@ export default {
1718
],
1819
framework: {
1920
name: "@storybook/react-vite",
20-
options: {},
21+
options: {
22+
strictMode: true,
23+
},
2124
},
2225
features: {
26+
// @ts-expect-error TODO: Check why do we use this feature, maybe it can be removed?
2327
storyStoreV7: true,
2428
},
2529
async viteFinal(config) {
@@ -37,3 +41,5 @@ export default {
3741
});
3842
},
3943
};
44+
45+
export default config;

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# @saleor/macaw-ui
22

3+
## 1.4.1
4+
5+
### Patch Changes
6+
7+
- 54c2363: Upgrade `eslint-plugin-react-hooks` from version 4.6.0 to 7.0.1, add react compiler ESLint rules to detect issues with incorrect hook implementation causing React to crash.
8+
- 0d2f5ee: CSS Variables from macaw-ui are now set in useLayoutEffect hook, instead of render function, which should resolve issues with React timing. Previously macaw-ui was breaking React contract by making updates in render function, making it not pure.
9+
- ed9cb0a: React Strict mode was enabled in Storybook for development to detect possible issues earlier. This might mean some components might have "bugs" in development, but not in production build due to additional rendering done in Strict mode. Refer to React docs for more details
10+
- 10164ae: Fixed crashes caused by `useAutoHeightTextarea` used by Textarea component. It now makes calculations in `useLayoutEffect`, which should prevent timing issues with React 18+
11+
312
## 1.4.0
413

514
### Minor Changes

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.4.0",
2+
"version": "1.4.1",
33
"license": "CC-BY-4.0",
44
"homepage": "https://macaw-ui.vercel.app/",
55
"repository": {
@@ -87,8 +87,8 @@
8787
"eslint-config-prettier": "^9.0.0",
8888
"eslint-import-resolver-typescript": "^3.5.5",
8989
"eslint-plugin-import": "^2.28.0",
90-
"eslint-plugin-react": "^7.33.1",
91-
"eslint-plugin-react-hooks": "^4.6.0",
90+
"eslint-plugin-react": "^7.37.5",
91+
"eslint-plugin-react-hooks": "^7.0.1",
9292
"eslint-plugin-storybook": "^0.6.13",
9393
"husky": "^8.0.3",
9494
"is-ci": "^3.0.1",

0 commit comments

Comments
 (0)