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 22 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
5 changes: 5 additions & 0 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,6 +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: npm i --no-save react@${{ matrix.override-react-version }} react-dom@${{ matrix.override-react-version }}
- run: npm run test-unit

integration:
Expand Down
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: |
npm i --no-save react@${{ inputs.override-react-version }} react-dom@${{ 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
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = {
},
},
],
'@babel/preset-react',
['@babel/preset-react', {runtime: 'automatic'}],
'@babel/preset-flow',
],
};
Loading
Loading