Skip to content

feat: support React 18 and 19 #2

feat: support React 18 and 19

feat: support React 18 and 19 #2

Workflow file for this run

name: React 18 compatibility
permissions:
contents: read
on:
pull_request:
branches:
- main
paths:
- 'packages/**'
jobs:
setup:
uses: ./.github/workflows/_setup.yml

Check warning on line 13 in .github/workflows/react18-compat.yaml

View workflow run for this annotation

GitHub Actions / React 18 compatibility

Workflow syntax warning

In .github/workflows/react18-compat.yaml (Line: 13, Col: 11): Error from called workflow equinor/design-system/.github/workflows/_setup.yml@bd8c861bcd4ee762472d6c7fc8bd624e7069f0ab (Line: 110, Col: 13): Conditional expression contains literal text outside replacement tokens. This will cause the expression to always evaluate to truthy. Did you mean to put the entire expression inside ${{ }}?
secrets: inherit
with:
cacheKey: ${{ github.sha }}-react18
checkout_paths: packages apps scripts .github
react18:
name: Build & test with React 18
runs-on: ubuntu-latest
needs: setup
steps:
- name: Use "setup" cache
id: setup-cache
uses: actions/cache@v5
with:
path: |
./*
~/.pnpm-store
key: ${{ github.sha }}-react18
- name: Fallback checkout (cache miss)
if: steps.setup-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v6
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: '22.12.0'
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Fallback install (cache miss)
if: steps.setup-cache.outputs.cache-hit != 'true'
run: pnpm install
- name: Override to React 18
run: |
pnpm add -Dw react@18 react-dom@18 @types/react@18 @types/react-dom@18
- name: Build packages
run: pnpm run build
- name: Test packages
run: pnpm run test
- name: Type check packages
run: |
pnpm --filter @equinor/eds-tokens types
pnpm --filter @equinor/eds-utils types
pnpm --filter @equinor/eds-icons types
pnpm --filter @equinor/eds-core-react types
pnpm --filter @equinor/eds-lab-react types
pnpm --filter @equinor/eds-data-grid-react types