Skip to content

Commit cfe877d

Browse files
authored
Merge pull request #231 from Drawbotics/feat/widen-react-peerdeps
Widen React peerDependencies, bump use-screen-size, add React 18 CI
2 parents b7e3e9d + c0bd0d7 commit cfe877d

7 files changed

Lines changed: 44 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,39 @@ jobs:
4444
env:
4545
NODE_AUTH_TOKEN: ${{secrets.GH_TOKEN}}
4646

47+
test-react-18:
48+
runs-on: ubuntu-latest
49+
if: "!contains(github.event.head_commit.message, 'skip ci')"
50+
continue-on-error: true
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
- uses: actions/setup-node@v4
55+
with:
56+
node-version: '20.x'
57+
registry-url: https://npm.pkg.github.com/
58+
scope: '@drawbotics'
59+
- name: Install dependencies and build libs
60+
run: |
61+
npm run bootstrap
62+
npm run build-libs
63+
env:
64+
NODE_AUTH_TOKEN: ${{secrets.GH_TOKEN}}
65+
- name: Swap to React 18
66+
run: |
67+
# Install React 18 in a temp dir to avoid disrupting lerna's symlinks
68+
TMPDIR=$(mktemp -d)
69+
cd "$TMPDIR" && npm init -y > /dev/null 2>&1
70+
npm install react@18 react-dom@18 react-test-renderer@18 2>&1
71+
# Replace only the react packages in root node_modules (where jest resolves them)
72+
for pkg in react react-dom react-test-renderer scheduler; do
73+
rm -rf "$GITHUB_WORKSPACE/node_modules/$pkg"
74+
[ -d "$TMPDIR/node_modules/$pkg" ] && cp -rL "$TMPDIR/node_modules/$pkg" "$GITHUB_WORKSPACE/node_modules/$pkg"
75+
done
76+
rm -rf "$TMPDIR"
77+
- name: Run react-drylus tests
78+
run: npm run test:react
79+
4780
release:
4881
needs: test
4982
if: contains(github.ref, 'master')

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ There are 7 total packages:
1717
- [![npm version](https://badge.fury.io/js/%40drawbotics%2Fdrylus-style-vars.svg)](https://badge.fury.io/js/%40drawbotics%2Fdrylus-style-vars) [drylus-style-vars](/packages/drylus-style-vars):
1818
This package holds all the variables used in the Drawbotics styles. Exports js, less and css vars.
1919
- [![npm version](https://badge.fury.io/js/%40drawbotics%2Ficons.svg)](https://badge.fury.io/js/%40drawbotics%2Ficons) [icons](/packages/icons): This package holds all the icons used throughout the Drawbotics design system
20-
- [![npm version](https://badge.fury.io/js/%40drawbotics%2Freact-drylus.svg)](https://badge.fury.io/js/%40drawbotics%2Freact-drylus) [react-drylus](/packages/react-drylus): This is basically the source of all the components for the library; it uses React
20+
- [![npm version](https://badge.fury.io/js/%40drawbotics%2Freact-drylus.svg)](https://badge.fury.io/js/%40drawbotics%2Freact-drylus) [react-drylus](/packages/react-drylus): This is basically the source of all the components for the library; it uses React (>=16.8, best-effort React 18/19 support)
2121
- [![npm version](https://badge.fury.io/js/%40drawbotics%2Fvanilla-drylus.svg)](https://badge.fury.io/js/%40drawbotics%2Fvanilla-drylus) [vanilla-drylus](/packages/vanilla-drylus): The vanilla JS version of the library. The styles (CSS) is extracted from `react-drylus` using `extract-emotion` (see next point) and bundled to be used in non-react apps. Since we can't extract JS logic from React, the component logic is re-written in non-react code and bundled separately as well
2222
- [![npm version](https://badge.fury.io/js/%40drawbotics%2Fextract-emotion.svg)](https://badge.fury.io/js/%40drawbotics%2Fextract-emotion) [extract-emotion](/packages/extract-emotion): A small CLI tool to extract the CSS from React components that use [emotion](https://github.com/emotion-js/emotion) for styling (see [readme](/packages/extract-emotion/README.md))
2323
- [drylus-web-components](/packages/drylus-web-components): __WIP__ Auto generated from `react-drylus`

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"@babel/preset-react": "^7.0.0",
6666
"@drawbotics/check-env": "^3.0.0",
6767
"@drawbotics/s3sync": "^1.0.1",
68-
"@drawbotics/use-screen-size": "^2.0.2",
68+
"@drawbotics/use-screen-size": "^3.0.1",
6969
"@emotion/core": "^10.0.21",
7070
"@hot-loader/react-dom": "^16.8.6",
7171
"@mdx-js/loader": "^1.6.21",

packages/extract-emotion/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"peerDependencies": {
2727
"emotion": "^10",
28-
"react": "^16.8.0"
28+
"react": ">=16.8.0 <20"
2929
},
3030
"repository": {
3131
"type": "git",

packages/react-drylus/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ The "root" package for all of the Drawbotics styles (excluding [icons]('../icons
44

55
The components are written in React and are styled using [emotion](https://github.com/emotion-js/emotion).
66

7+
## React Version Support
8+
- Developed and tested against **React 16**
9+
- **React 18/19** support is best-effort and community-tested
10+
- If you encounter issues on newer React versions, please report them
711

812
## Development
913
```

packages/react-drylus/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"@dnd-kit/utilities": "^3.1.0",
2929
"@drawbotics/drylus-style-vars": "file:../drylus-style-vars",
3030
"@drawbotics/icons": "file:../icons",
31-
"@drawbotics/use-screen-size": "^2.0.2",
31+
"@drawbotics/use-screen-size": "^3.0.1",
3232
"@emotion/core": "^10.0.21",
3333
"@turf/circle": "^6.0.1",
3434
"animejs": "^3.0.1",
@@ -47,8 +47,8 @@
4747
"uuid": "^3.3.2"
4848
},
4949
"peerDependencies": {
50-
"react": "^16.8.6",
51-
"react-dom": "^16.8.6"
50+
"react": ">=16.8.0 <20",
51+
"react-dom": ">=16.8.0 <20"
5252
},
5353
"repository": {
5454
"type": "git",

packages/styleguide/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"dependencies": {
1717
"@drawbotics/icons": "file:../icons",
1818
"@drawbotics/react-drylus": "file:../react-drylus",
19-
"@drawbotics/use-screen-size": "^2.0.2",
19+
"@drawbotics/use-screen-size": "^3.0.1",
2020
"@drawbotics/vanilla-drylus": "file:../vanilla-drylus",
2121
"core-js": "2",
2222
"fast-xml-parser": "^3.12.16",

0 commit comments

Comments
 (0)