-
Notifications
You must be signed in to change notification settings - Fork 233
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
Support React 18 #655
Closed
Closed
Support React 18 #655
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9172654
Support React 18
snowystinger 6456f4a
fix some more obvious cases
snowystinger 0d82a5f
fix hydration
snowystinger 81db73a
annotate a test so I can get help
snowystinger 1f0bf1d
Will definitely need something like this in order to support 17 and 1…
snowystinger 3cc6f2e
drop prepare
snowystinger 15347e5
restore package.json
snowystinger 25cfd74
restore test to passing but leave comment about 18
snowystinger 668088b
Fix install script one last time
snowystinger 8fa0041
add some shortcut scripts so it's easier to test locally
snowystinger c95ef45
remove invalid comma
snowystinger 00526a8
add support for the minimum specified supported version as well as la…
snowystinger c060620
temporarily drop coverageThreshold
snowystinger d4ba70c
experimental tests should not block known quantities
snowystinger 2b4a770
refactor: add createLegacyRoot to reduce uncovered code percentage
mpeyper ea9d4f9
chore: increase coverage threshold again
mpeyper 274932b
Merge branch 'main' into react-18-upgrade
snowystinger 9f296b1
Merge branch 'main' into react-18-upgrade
snowystinger 07041f1
Merge branch 'main' into react-18-upgrade
snowystinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import * as ReactDOM from 'react-dom' | ||
import * as React from 'react' | ||
|
||
/* istanbul ignore next */ | ||
function createLegacyRoot(container: Element): ReactDOM.Root { | ||
return { | ||
render(element: React.ReactElement) { | ||
ReactDOM.render(element, container) | ||
}, | ||
unmount() { | ||
ReactDOM.unmountComponentAtNode(container) | ||
} | ||
} | ||
} | ||
|
||
/* istanbul ignore next */ | ||
export function createRoot(container: Element) { | ||
return (ReactDOM.createRoot ? ReactDOM.createRoot : createLegacyRoot)(container) | ||
} | ||
|
||
/* istanbul ignore next */ | ||
export function hydrateLegacyRoot(container: Element, element: React.ReactElement): ReactDOM.Root { | ||
ReactDOM.hydrate(element, container) | ||
return createLegacyRoot(container) | ||
} | ||
|
||
/* istanbul ignore next */ | ||
export function hydrateRoot(container: Element, element: React.ReactElement) { | ||
return (ReactDOM.hydrateRoot ? ReactDOM.hydrateRoot : hydrateLegacyRoot)(container, element) | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"extends": "./node_modules/kcd-scripts/shared-tsconfig.json", | ||
"compilerOptions": { | ||
"target": "ES6" | ||
"target": "ES6", | ||
"types": ["node", "jest", "react/next", "react-dom/next"] | ||
} | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what else we'll need to do now that I've removed this because of https://docs.npmjs.com/cli/v7/commands/npm-install