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

[lexical-react] Feature: React 19 unit tests #6048

Merged
merged 34 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
23274d5
unit test
etrepum May 6, 2024
e5e470d
try the unit tests with react beta
etrepum May 13, 2024
8cd0664
Silence __DEV__ ArtificialNode__DO_NOT_USE warnings
etrepum May 7, 2024
7f470c0
handle react-dom/test-utils deprecation
etrepum May 7, 2024
e275d04
e2e with beta
etrepum May 7, 2024
853dd2e
Slight changes to docs for React 19 conventions
etrepum May 7, 2024
17d27e6
validate React 19 installation expectations
etrepum May 7, 2024
e41306e
Resolve warnings in LexicalNormalization.test.tsx
etrepum May 7, 2024
ef7ac8f
Update React19 test comments
etrepum May 7, 2024
f124a24
Fix Placeholder warnings in LexicalEditor test
etrepum May 8, 2024
f190a05
fix react-dom warnings in selection tests
etrepum May 8, 2024
9cf1369
Add typedoc-plugin-rename-defaults and start updating docs
etrepum May 9, 2024
89bde93
start on React FAQ
etrepum May 10, 2024
e1140be
HMR notes
etrepum May 11, 2024
9a2da54
Confirm useLexicalComposerContext behavior
etrepum May 11, 2024
2d25a16
Comment IS_REACT_ACT_ENVIRONMENT usage and remove inadvertent console…
etrepum May 12, 2024
efb66b9
[lexical] Chore: Update TestTextNode related tests
etrepum May 12, 2024
f687256
Audit @ts-ignore usage and fix possible `window.queueMicrotask = unde…
etrepum May 12, 2024
3628979
Use React 17+ jsx transform
etrepum May 11, 2024
97564a5
Suggested renames
etrepum May 13, 2024
1a2b722
reduce react-beta e2e matrix outputs from 4 to 1
etrepum May 13, 2024
0c85bb0
Merge remote-tracking branch 'origin/main' into react-19-unit-tests
etrepum May 16, 2024
e49b7c8
Merge remote-tracking branch 'origin/main' into react-19-unit-tests
etrepum May 16, 2024
3319e2b
Add useLexicalEditable docstring back that got lost in the merge
etrepum May 16, 2024
774a297
Disable react beta e2e, handle in follow-up #6126
etrepum May 17, 2024
75f5c98
Update typescript because we were installing two versions of it
etrepum May 16, 2024
90a98b1
Use more correct react override strategy
etrepum May 17, 2024
5b81091
Workaround for rollup
etrepum May 17, 2024
d378edb
Add react beta e2e to tests.yml for testing
etrepum May 17, 2024
b21494e
Change ArtificialNode workaround to be resilient to renaming
etrepum May 17, 2024
a48687c
Remove canary react-beta e2e test before approval
etrepum May 17, 2024
492816e
Fix #6132 react build size regression from #6088
etrepum May 17, 2024
3541f2d
Merge remote-tracking branch 'origin/main' into react-19-unit-tests
etrepum May 17, 2024
81ce684
Merge remote-tracking branch 'origin/main' into react-19-unit-tests
etrepum May 21, 2024
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
25 changes: 7 additions & 18 deletions .github/workflows/call-core-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
strategy:
matrix:
node-version: [18.18.0]
override-react-version: ['', 'beta']
env:
CI: true
steps:
Expand All @@ -41,22 +42,10 @@ jobs:
cache: npm
- name: Install dependencies
run: npm ci
- name: Install React ${{ matrix.override-react-version }}
if: matrix.override-react-version != ''
# This should be safe since we are caching ~/.npm and not node_modules
run: |
node ./scripts/override-react.js --version=${{ matrix.override-react-version }}
grep version node_modules/{react,react-dom}/package.json
- run: npm run test-unit

integration:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.18.0]
env:
CI: true
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci
- run: npm run test-integration
17 changes: 17 additions & 0 deletions .github/workflows/call-e2e-all-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,20 @@ jobs:
browser: ${{ matrix.browser }}
editor-mode: ${{ matrix.editor-mode }}
events-mode: ${{ matrix.events-mode }}

react-beta:
etrepum marked this conversation as resolved.
Show resolved Hide resolved
strategy:
matrix:
# Currently using a single combination for every-patch e2e tests of
# react beta to reduce cost impact
editor-mode: ['rich-text']
prod: [false]
uses: ./.github/workflows/call-e2e-test.yml
with:
os: 'macos-latest'
browser: 'chromium'
node-version: 18.18.0
events-mode: 'modern-events'
editor-mode: ${{ matrix.editor-mode }}
prod: ${{ matrix.prod }}
override-react-version: beta
10 changes: 9 additions & 1 deletion .github/workflows/call-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
editor-mode: {required: true, type: string}
events-mode: {required: true, type: string}
prod: {required: false, type: boolean}
override-react-version: {required: false, type: string}

jobs:
e2e-test:
Expand All @@ -18,6 +19,7 @@ jobs:
CI: true
E2E_EDITOR_MODE: ${{ inputs.editor-mode }}
E2E_EVENTS_MODE: ${{ inputs.events-mode }}
OVERRIDE_REACT_VERSION: ${{ inputs.override-react-version }}
cache_playwright_path: ${{ inputs.os == 'macos-latest' && '~/Library/Caches/ms-playwright' || inputs.os == 'windows-latest' && 'C:\Users\runneradmin\AppData\Local\ms-playwright' || '~/.cache/ms-playwright' }}
test_results_path: ${{ inputs.os == 'windows-latest' && '~/.npm/_logs/' || 'test-results/' }}
test_script: test-e2e-${{ inputs.editor-mode == 'rich-text-with-collab' && 'collab-' || '' }}${{ inputs.prod && 'prod-' || '' }}ci-${{ inputs.browser }}
Expand All @@ -35,6 +37,12 @@ jobs:
sudo apt-get install xvfb
- name: Install dependencies
run: npm ci
- name: Install React ${{ inputs.override-react-version }}
if: inputs.override-react-version != ''
# This should be safe since we are caching ~/.npm and not node_modules
run: |
node ./scripts/override-react.js --version=${{ inputs.override-react-version }}
grep version node_modules/{react,react-dom}/package.json
- name: Restore playwright from cache
uses: actions/cache/restore@v4
id: playwright-cache
Expand All @@ -55,6 +63,6 @@ jobs:
if: failure()
uses: actions/upload-artifact@v4
with:
name: Test Results ${{ inputs.os }}-${{ inputs.browser }}-${{ inputs.editor-mode }}-${{ inputs.events-mode }}-${{ inputs.prod && 'prod' || 'dev' }}-${{ inputs.node-version }}
name: Test Results ${{ inputs.os }}-${{ inputs.browser }}-${{ inputs.editor-mode }}-${{ inputs.events-mode }}-${{ inputs.prod && 'prod' || 'dev' }}-${{ inputs.node-version }}-${{ inputs.override-react-version }}
path: ${{ env.test_results_path }}
retention-days: 7
23 changes: 23 additions & 0 deletions .github/workflows/call-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lexical Integration Tests

on:
workflow_call:

jobs:
integration:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.18.0]
env:
CI: true
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci
- run: npm run test-integration
7 changes: 6 additions & 1 deletion .github/workflows/tests-extended.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: Lexical Tests (Extended)

on:
pull_request:
types: [labeled, synchronize]
types: [labeled, synchronize, reopened]
paths-ignore:
- 'packages/lexical-website/**'
- 'packages/*/README.md'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -14,3 +15,7 @@ jobs:
e2e-tests:
if: github.repository_owner == 'facebook' && contains(github.event.pull_request.labels.*.name, 'extended-tests')
uses: ./.github/workflows/call-e2e-all-tests.yml

integration-tests:
if: github.repository_owner == 'facebook' && contains(github.event.pull_request.labels.*.name, 'extended-tests')
uses: ./.github/workflows/call-integration-tests.yml
Loading
Loading