feat(browser-react): add React 17 entry via @rstest/browser-react/react17#1239
Closed
fi3ework wants to merge 1 commit into
Closed
feat(browser-react): add React 17 entry via @rstest/browser-react/react17#1239fi3ework wants to merge 1 commit into
@rstest/browser-react/react17#1239fi3ework wants to merge 1 commit into
Conversation
…act17` - Extract a shared `createRenderApi` factory so render/renderHook/cleanup logic is reused across React majors. - Add `./react17` and `./react17/pure` entries that mount via `ReactDOM.render` / `unmountComponentAtNode` and use `act` from `react-dom/test-utils`. - Fall back to `React.unstable_act` for React 18.0–18.2. - Cover the new entry with an e2e fixture pinned to React 17.
Rsdoctor Bundle Diff AnalysisFound 12 projects in monorepo, 1 project with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 browser-reactPath:
📦 Download Diff Report: browser-react Bundle Diff Generated by Rsdoctor GitHub Action |
2 tasks
Member
Author
|
close until we decide to do it in the future. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Background
@rstest/browser-reactstatically importsreact-dom/client, which does not exist under React 17. React 17 users hit a hard resolution error today and have no workable entry point.Implementation
createRenderApifactory sorender/renderHook/cleanupare reused across React majors.@rstest/browser-react/react17(auto-cleanup) and@rstest/browser-react/react17/pure, mounting viaReactDOM.render/unmountComponentAtNodeand pullingactfromreact-dom/test-utils.React.unstable_actso the default entry also keeps working under React 18.0–18.2.User Impact
React 17 projects can now use
@rstest/browser-react/react17without bundler configuration. React 18+ users are unaffected (default entry is unchanged).Checklist